Don't autoconfigure address on RPL Root

This commit is contained in:
Laurent Deru 2017-12-11 17:19:02 +01:00
parent 1549a55e42
commit 52f7e4a9f5

View File

@ -522,6 +522,7 @@ rpl_set_prefix(rpl_dag_t *dag, uip_ipaddr_t *prefix, unsigned len)
dag->prefix_info.length = len;
dag->prefix_info.flags = UIP_ND6_RA_FLAG_AUTONOMOUS;
PRINTF("RPL: Prefix set - will announce this in DIOs\n");
if(dag->rank != ROOT_RANK(dag->instance)) {
/* Autoconfigure an address if this node does not already have an address
with this prefix. Otherwise, update the prefix */
if(last_len == 0) {
@ -531,6 +532,7 @@ rpl_set_prefix(rpl_dag_t *dag, uip_ipaddr_t *prefix, unsigned len)
PRINTF("rpl_set_prefix - prefix NON-NULL\n");
check_prefix(&last_prefix, &dag->prefix_info);
}
}
return 1;
}
/*---------------------------------------------------------------------------*/