Skip to content

Commit

Permalink
Merge pull request contiki-os#2054 from cetic/pr-check-incoming-rank
Browse files Browse the repository at this point in the history
Reject parents with invalid rank
  • Loading branch information
alignan authored Jan 13, 2017
2 parents 0fb4a68 + f9ffa25 commit 3d40056
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion core/net/rpl/rpl-dag.c
Original file line number Diff line number Diff line change
Expand Up @@ -865,7 +865,10 @@ best_parent(rpl_dag_t *dag, int fresh_only)
for(p = nbr_table_head(rpl_parents); p != NULL; p = nbr_table_next(rpl_parents, p)) {

/* Exclude parents from other DAGs or announcing an infinite rank */
if(p->dag != dag || p->rank == INFINITE_RANK) {
if(p->dag != dag || p->rank == INFINITE_RANK || p->rank < ROOT_RANK(dag->instance)) {
if(p->rank < ROOT_RANK(dag->instance)) {
PRINTF("RPL: Parent has invalid rank\n");
}
continue;
}

Expand Down

0 comments on commit 3d40056

Please sign in to comment.