RPL: trigger a local repair only the first time no parent is found in a DODAG
This commit is contained in:
parent
b176991a06
commit
65b854fcee
|
@ -1290,6 +1290,7 @@ int
|
||||||
rpl_process_parent_event(rpl_instance_t *instance, rpl_parent_t *p)
|
rpl_process_parent_event(rpl_instance_t *instance, rpl_parent_t *p)
|
||||||
{
|
{
|
||||||
int return_value;
|
int return_value;
|
||||||
|
rpl_parent_t *last_parent = instance->current_dag->preferred_parent;
|
||||||
|
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
rpl_rank_t old_rank;
|
rpl_rank_t old_rank;
|
||||||
|
@ -1312,10 +1313,12 @@ rpl_process_parent_event(rpl_instance_t *instance, rpl_parent_t *p)
|
||||||
}
|
}
|
||||||
|
|
||||||
if(rpl_select_dag(instance, p) == NULL) {
|
if(rpl_select_dag(instance, p) == NULL) {
|
||||||
/* No suitable parent; trigger a local repair. */
|
if(last_parent != NULL) {
|
||||||
PRINTF("RPL: No parents found in any DAG\n");
|
/* No suitable parent anymore; trigger a local repair. */
|
||||||
rpl_local_repair(instance);
|
PRINTF("RPL: No parents found in any DAG\n");
|
||||||
return 0;
|
rpl_local_repair(instance);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
|
|
Loading…
Reference in a new issue