From 15bf73ba08318f9c7df6863bf31bb9f1efa39903 Mon Sep 17 00:00:00 2001 From: Adam Dunkels Date: Sun, 13 Feb 2011 19:01:15 +0100 Subject: [PATCH] Use DAG_RANK() macro to compute rank --- core/net/rpl/rpl-dag.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/net/rpl/rpl-dag.c b/core/net/rpl/rpl-dag.c index 857129f90..b62fb2a3c 100644 --- a/core/net/rpl/rpl-dag.c +++ b/core/net/rpl/rpl-dag.c @@ -679,7 +679,8 @@ rpl_process_dio(uip_ipaddr_t *from, rpl_dio_t *dio) */ p = rpl_find_parent(dag, from); - if(p == NULL && (dio->rank <= dag->preferred_parent->rank)) { + if(p == NULL && + DAG_RANK(dio->rank, dag) <= DAG_RANK(dag->preferred_parent->rank, dag)) { if(RPL_PARENT_COUNT(dag) == RPL_MAX_PARENTS) { /* Try to make room for a new parent. */ remove_parents(dag, dag->preferred_parent->rank + dag->min_hoprankinc);