Update rank of parent when it has changed DODAG

This commit is contained in:
Laurent Deru 2015-09-30 15:23:34 +02:00
parent 34126173b4
commit 15bc0c6daa

View file

@ -1060,6 +1060,7 @@ rpl_add_dag(uip_ipaddr_t *from, rpl_dio_t *dio)
rpl_move_parent(previous_dag, dag, p); rpl_move_parent(previous_dag, dag, p);
} }
} }
p->rank = dio->rank;
/* Determine the objective function by using the /* Determine the objective function by using the
objective code point of the DIO. */ objective code point of the DIO. */
@ -1374,10 +1375,9 @@ rpl_process_dio(uip_ipaddr_t *from, rpl_dio_t *dio)
if(dag->joined) { if(dag->joined) {
instance->dio_counter++; instance->dio_counter++;
} }
} else {
p->rank=dio->rank;
} }
} }
p->rank = dio->rank;
/* Parent info has been updated, trigger rank recalculation */ /* Parent info has been updated, trigger rank recalculation */
p->flags |= RPL_PARENT_FLAG_UPDATED; p->flags |= RPL_PARENT_FLAG_UPDATED;