From 512a339c5000f955b733851a5f76a24255b19610 Mon Sep 17 00:00:00 2001 From: Adam Dunkels Date: Fri, 26 Jul 2013 12:38:25 +0200 Subject: [PATCH] Bugfix: DIOs with infinite ranks should not be ignored as they are used by RPL as a signal by nodes that have lost their routes. Instead of ignoring them, we should send out our latest information to let the node with infinite rank find their way into the network again. --- core/net/rpl/rpl-dag.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/core/net/rpl/rpl-dag.c b/core/net/rpl/rpl-dag.c index baad9946b..6ee195c1c 100644 --- a/core/net/rpl/rpl-dag.c +++ b/core/net/rpl/rpl-dag.c @@ -630,7 +630,7 @@ rpl_select_dag(rpl_instance_t *instance, rpl_parent_t *p) instance->of->update_metric_container(instance); /* Update the DAG rank. */ best_dag->rank = instance->of->calculate_rank(best_dag->preferred_parent, 0); - if(best_dag->rank < best_dag->min_rank) { + if(last_parent == NULL || best_dag->rank < best_dag->min_rank) { best_dag->min_rank = best_dag->rank; } else if(!acceptable_rank(best_dag, best_dag->rank)) { PRINTF("RPL: New rank unacceptable!\n"); @@ -1143,13 +1143,6 @@ rpl_process_dio(uip_ipaddr_t *from, rpl_dio_t *dio) } } - if(dio->rank == INFINITE_RANK) { - PRINTF("RPL: Ignoring DIO from node with infinite rank: "); - PRINT6ADDR(from); - PRINTF("\n"); - return; - } - if(instance == NULL) { PRINTF("RPL: New instance detected: Joining...\n"); rpl_join_instance(from, dio);