diff --git a/core/net/rpl/rpl-dag.c b/core/net/rpl/rpl-dag.c index ced73990f..2077c4eb4 100644 --- a/core/net/rpl/rpl-dag.c +++ b/core/net/rpl/rpl-dag.c @@ -1527,6 +1527,11 @@ rpl_process_dio(uip_ipaddr_t *from, rpl_dio_t *dio) } } + if(!add_nbr_from_dio(from, dio)) { + PRINTF("RPL: Could not add parent based on DIO\n"); + return; + } + if(dag->rank == ROOT_RANK(instance)) { if(dio->rank != INFINITE_RANK) { instance->dio_counter++; @@ -1547,11 +1552,6 @@ rpl_process_dio(uip_ipaddr_t *from, rpl_dio_t *dio) * whether to keep it in the set. */ - if(!add_nbr_from_dio(from, dio)) { - PRINTF("RPL: Could not add parent based on DIO\n"); - return; - } - p = rpl_find_parent(dag, from); if(p == NULL) { previous_dag = find_parent_dag(instance, from);