Skip to content
Snippets Groups Projects
Commit 5fc6eee4 authored by Steffen Thielemans's avatar Steffen Thielemans
Browse files

Fix RPL classic border router prefix

parent e58b5838
Branches
No related tags found
No related merge requests found
...@@ -119,11 +119,9 @@ rpl_dag_root_start(void) ...@@ -119,11 +119,9 @@ rpl_dag_root_start(void)
if(root_if != NULL) { if(root_if != NULL) {
rpl_dag_t *dag; rpl_dag_t *dag;
uip_ipaddr_t prefix; uip_ipaddr_t prefix;
const uip_ipaddr_t *default_prefix;
rpl_set_root(RPL_DEFAULT_INSTANCE, ipaddr); rpl_set_root(RPL_DEFAULT_INSTANCE, ipaddr);
dag = rpl_get_any_dag(); dag = rpl_get_any_dag();
default_prefix = uip_ds6_default_prefix();
/* If there are routes in this dag, we remove them all as we are /* If there are routes in this dag, we remove them all as we are
from now on the new dag root and the old routes are wrong */ from now on the new dag root and the old routes are wrong */
...@@ -135,7 +133,7 @@ rpl_dag_root_start(void) ...@@ -135,7 +133,7 @@ rpl_dag_root_start(void)
dag->instance->def_route = NULL; dag->instance->def_route = NULL;
} }
uip_ip6addr_copy(&prefix, default_prefix); uip_ip6addr_copy(&prefix, ipaddr);
rpl_set_prefix(dag, &prefix, 64); rpl_set_prefix(dag, &prefix, 64);
LOG_INFO("root_set_prefix: created a new RPL dag\n"); LOG_INFO("root_set_prefix: created a new RPL dag\n");
return 0; return 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment