Send No-Path DAOs correctly.

This commit is contained in:
nvt 2011-05-03 17:50:24 +02:00
parent 4b5d380c74
commit 15ee0a6414

View file

@ -357,6 +357,9 @@ rpl_select_parent(rpl_dag_t *dag)
}
if(dag->preferred_parent != best) {
PRINTF("RPL: Sending a No-Path DAO to old DAO parent\n");
dao_output(dag->preferred_parent, ZERO_LIFETIME);
dag->preferred_parent = best; /* Cache the value. */
dag->of->update_metric_container(dag);
rpl_set_default_route(dag, &best->addr);
@ -377,7 +380,7 @@ rpl_select_parent(rpl_dag_t *dag)
dag->min_rank = dag->rank;
} else if(!acceptable_rank(dag, best->rank)) {
/* Send a No-Path DAO to the soon-to-be-removed preferred parent. */
dao_output(p, ZERO_LIFETIME);
dao_output(best, ZERO_LIFETIME);
remove_parents(dag, 0);
return NULL;