RPL Lite: fix acceptable rank check
@@ -360,8 +360,9 @@ best_parent(int fresh_only)
/* Search for the best parent according to the OF */
for(nbr = nbr_table_head(rpl_neighbors); nbr != NULL; nbr = nbr_table_next(rpl_neighbors, nbr)) {
- if(!acceptable_rank(nbr->rank) || !curr_instance.of->nbr_is_acceptable_parent(nbr)) {
- /* Exclude neighbors with a rank that is not acceptable) */
+ if(!acceptable_rank(rpl_neighbor_rank_via_nbr(nbr))
+ || !curr_instance.of->nbr_is_acceptable_parent(nbr)) {
+ /* Exclude neighbors with a rank that is not acceptable */
continue;
}
