fixed so that rpl avoids sending no-path DAOs when changing parent when in NO_DOWNWARD mode of operation

This commit is contained in:
Joakim Eriksson 2011-10-17 14:16:19 +02:00
parent cf61e522a8
commit 17bbb1f1c1

View File

@ -355,9 +355,10 @@ 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);
if(dag->mop != RPL_MOP_NO_DOWNWARD_ROUTES) {
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);
@ -378,7 +379,9 @@ 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(best, ZERO_LIFETIME);
if(dag->mop != RPL_MOP_NO_DOWNWARD_ROUTES) {
dao_output(best, ZERO_LIFETIME);
}
remove_parents(dag, 0);
return NULL;