RPL: reset Trickle timer on incoming DIOs with INFINITE_RANK only if the DIO is from the preferred parent

This commit is contained in:
Simon Duquennoy 2016-02-04 22:46:16 +01:00
parent 65b854fcee
commit 36dd282eb7

View file

@ -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", PRINTF("RPL: Ignoring DIO with too low rank: %u\n",
(unsigned)dio->rank); (unsigned)dio->rank);
return; return;
} else if(dio->rank == INFINITE_RANK && dag->joined) {
rpl_reset_dio_timer(instance);
} }
/* Prefix Information Option treated to add new prefix */ /* 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; 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 */ /* Parent info has been updated, trigger rank recalculation */
p->flags |= RPL_PARENT_FLAG_UPDATED; p->flags |= RPL_PARENT_FLAG_UPDATED;