Skip to content

Commit

Permalink
Send no-path DAO only when the dag has a preferred parent
Browse files Browse the repository at this point in the history
  • Loading branch information
laurentderu committed Dec 19, 2014
1 parent 7286c9a commit 81a92bd
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions core/net/rpl/rpl-dag.c
Expand Up @@ -765,7 +765,6 @@ rpl_nullify_parent(rpl_parent_t *parent)
/* This function can be called when the preferred parent is NULL, so we
need to handle this condition in order to trigger uip_ds6_defrt_rm. */
if(parent == dag->preferred_parent || dag->preferred_parent == NULL) {
rpl_set_preferred_parent(dag, NULL);
dag->rank = INFINITE_RANK;
if(dag->joined) {
if(dag->instance->def_route != NULL) {
Expand All @@ -775,7 +774,11 @@ rpl_nullify_parent(rpl_parent_t *parent)
uip_ds6_defrt_rm(dag->instance->def_route);
dag->instance->def_route = NULL;
}
dao_output(parent, RPL_ZERO_LIFETIME);
/* Send no-path DAO only to preferred parent, if any */
if(parent == dag->preferred_parent) {
dao_output(parent, RPL_ZERO_LIFETIME);
rpl_set_preferred_parent(dag, NULL);
}
}
}

Expand Down

0 comments on commit 81a92bd

Please sign in to comment.