From 15bc0c6daa4c0dc75328d4215b2b6ee7e8081885 Mon Sep 17 00:00:00 2001 From: Laurent Deru Date: Wed, 30 Sep 2015 15:23:34 +0200 Subject: [PATCH] Update rank of parent when it has changed DODAG --- core/net/rpl/rpl-dag.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/net/rpl/rpl-dag.c b/core/net/rpl/rpl-dag.c index dc6393e6c..9b6c92e3f 100644 --- a/core/net/rpl/rpl-dag.c +++ b/core/net/rpl/rpl-dag.c @@ -1060,6 +1060,7 @@ rpl_add_dag(uip_ipaddr_t *from, rpl_dio_t *dio) rpl_move_parent(previous_dag, dag, p); } } + p->rank = dio->rank; /* Determine the objective function by using the objective code point of the DIO. */ @@ -1374,10 +1375,9 @@ rpl_process_dio(uip_ipaddr_t *from, rpl_dio_t *dio) if(dag->joined) { instance->dio_counter++; } - } else { - p->rank=dio->rank; } } + p->rank = dio->rank; /* Parent info has been updated, trigger rank recalculation */ p->flags |= RPL_PARENT_FLAG_UPDATED;