Skip to content

Commit

Permalink
Fixed Pan advertisment route cost comapre for consistent and incosistent
Browse files Browse the repository at this point in the history
Route cost must be better when we reset Advertisment.

Change-Id: I589d8fa6f728d32d80ccca7fd70940e1610fa230
  • Loading branch information
Juha Heiskanen committed Jun 26, 2019
1 parent db81d02 commit cafc142
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions source/6LoWPAN/ws/ws_bootstrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -864,17 +864,18 @@ static void ws_bootstrap_pan_advertisement_analyse_active(struct protocol_interf
*
* A consistent transmission is defined as a PAN Advertisement received by a node with PAN ID and
* NETNAME-IE / Network Name matching that of the receiving node, and with a PAN-IE / Routing Cost
* the same or better than (less than or equal to) that of the receiving node.
* the same or worster than (bigger than or equal to) that of the receiving node.
*
* Inconsistent:
* PAN Advertisement solicit
*
* Received Routing Cost is smaller than stored one
*
* A PAN Advertisement received by a node with PAN ID and NETNAME-IE / Network name matching
* that of the receiving node, and PAN-IE / Routing Cost worse than (greater than) that of the receiving node.
* that of the receiving node, and PAN-IE / Routing Cost better than (smaller than) that of the receiving node.
*
*/

if (pan_information->routing_cost <= cur->ws_info->pan_information.routing_cost) {
if (pan_information->routing_cost >= cur->ws_info->pan_information.routing_cost) {
trickle_consistent_heard(&cur->ws_info->trickle_pan_advertisement);
} else {
trickle_inconsistent_heard(&cur->ws_info->trickle_pan_advertisement, &cur->ws_info->trickle_params_pan_discovery);
Expand Down

0 comments on commit cafc142

Please sign in to comment.