From 36dd282eb7ca2adca166f7a03d2e9e40b4fca89b Mon Sep 17 00:00:00 2001 From: Simon Duquennoy Date: Thu, 4 Feb 2016 22:46:16 +0100 Subject: [PATCH] RPL: reset Trickle timer on incoming DIOs with INFINITE_RANK only if the DIO is from the preferred parent --- core/net/rpl/rpl-dag.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/net/rpl/rpl-dag.c b/core/net/rpl/rpl-dag.c index a534a7c92..a0f01caaf 100644 --- a/core/net/rpl/rpl-dag.c +++ b/core/net/rpl/rpl-dag.c @@ -1441,8 +1441,6 @@ rpl_process_dio(uip_ipaddr_t *from, rpl_dio_t *dio) PRINTF("RPL: Ignoring DIO with too low rank: %u\n", (unsigned)dio->rank); return; - } else if(dio->rank == INFINITE_RANK && dag->joined) { - rpl_reset_dio_timer(instance); } /* Prefix Information Option treated to add new prefix */ @@ -1509,6 +1507,11 @@ rpl_process_dio(uip_ipaddr_t *from, rpl_dio_t *dio) } p->rank = dio->rank; + if(dio->rank == INFINITE_RANK && p == dag->preferred_parent) { + /* Our preferred parent advertised an infinite rank, reset DIO timer */ + rpl_reset_dio_timer(instance); + } + /* Parent info has been updated, trigger rank recalculation */ p->flags |= RPL_PARENT_FLAG_UPDATED;