From 2a96835c057136cc8210e7427dec12ffec279a83 Mon Sep 17 00:00:00 2001 From: Adam Dunkels Date: Sun, 13 Feb 2011 14:16:15 +0100 Subject: [PATCH] Don't remove all parents that have a worse rank than an incoming DIO: we may inadvertently remove our preferred parent. Instead, remove parents with a rank that is worse than our preferred parent. If we are lucky, this will give us enough space for the new parent. --- core/net/rpl/rpl-dag.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/net/rpl/rpl-dag.c b/core/net/rpl/rpl-dag.c index 88aa0bdfa..68461e381 100644 --- a/core/net/rpl/rpl-dag.c +++ b/core/net/rpl/rpl-dag.c @@ -682,7 +682,7 @@ rpl_process_dio(uip_ipaddr_t *from, rpl_dio_t *dio) if(p == NULL) { if(RPL_PARENT_COUNT(dag) == RPL_MAX_PARENTS) { /* Try to make room for a new parent. */ - remove_parents(dag, dio->rank); + remove_parents(dag, dag->preferred_parent->rank + dag->min_hoprankinc); } /* Add the DIO sender as a candidate parent. */