Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RPL] bug fix in OF0: wrong boolean expression #342

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions tos/lib/net/rpl/RPLOF0P.nc
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,12 @@ implementation{

parentNode = call ParentTable.get(min);

while ((!parentNode->valid) &&
(min < MAX_PARENT) &&
(parentNode->rank != INFINITE_RANK)) {
min++;
while ((min < MAX_PARENT) &&
((!parentNode->valid) || (parentNode->rank == INFINITE_RANK))) {
min++; // skipping invalid entries and nodes with infinite rank
parentNode = call ParentTable.get(min);
}

minDesired = parentNode->etx_hop + (parentNode->rank * divideRank);

if (min == MAX_PARENT) {
call RPLOF.resetRank();
call RPLRoute.inconsistency();
Expand All @@ -151,6 +148,8 @@ implementation{
return FALSE;
}

minDesired = parentNode->etx_hop + (parentNode->rank * divideRank);

// printf("RPLOF: Start Compare %d %d: %d %d %d \n",
// htons(prevParent), htons(parentNode->parentIP.s6_addr16[7]),
// minDesired, parentNode->etx_hop, parentNode->rank);
Expand Down