Don't add neighbor as a potential parent if its rank is too high.
This commit is contained in:
parent
2a96835c05
commit
e980072817
|
@ -679,7 +679,7 @@ rpl_process_dio(uip_ipaddr_t *from, rpl_dio_t *dio)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
p = rpl_find_parent(dag, from);
|
p = rpl_find_parent(dag, from);
|
||||||
if(p == NULL) {
|
if(p == NULL && (dio->rank <= dag->preferred_parent->rank)) {
|
||||||
if(RPL_PARENT_COUNT(dag) == RPL_MAX_PARENTS) {
|
if(RPL_PARENT_COUNT(dag) == RPL_MAX_PARENTS) {
|
||||||
/* Try to make room for a new parent. */
|
/* Try to make room for a new parent. */
|
||||||
remove_parents(dag, dag->preferred_parent->rank + dag->min_hoprankinc);
|
remove_parents(dag, dag->preferred_parent->rank + dag->min_hoprankinc);
|
||||||
|
|
Loading…
Reference in a new issue