Merge pull request #914 from cetic/pr-always-send-no-path-dao
Send no-path DAO only when the dag has a preferred parent
This commit is contained in:
commit
2734c97234
|
@ -789,7 +789,6 @@ rpl_nullify_parent(rpl_parent_t *parent)
|
||||||
/* This function can be called when the preferred parent is NULL, so we
|
/* 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. */
|
need to handle this condition in order to trigger uip_ds6_defrt_rm. */
|
||||||
if(parent == dag->preferred_parent || dag->preferred_parent == NULL) {
|
if(parent == dag->preferred_parent || dag->preferred_parent == NULL) {
|
||||||
rpl_set_preferred_parent(dag, NULL);
|
|
||||||
dag->rank = INFINITE_RANK;
|
dag->rank = INFINITE_RANK;
|
||||||
if(dag->joined) {
|
if(dag->joined) {
|
||||||
if(dag->instance->def_route != NULL) {
|
if(dag->instance->def_route != NULL) {
|
||||||
|
@ -799,7 +798,11 @@ rpl_nullify_parent(rpl_parent_t *parent)
|
||||||
uip_ds6_defrt_rm(dag->instance->def_route);
|
uip_ds6_defrt_rm(dag->instance->def_route);
|
||||||
dag->instance->def_route = NULL;
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue