Skip to content

Commit 3275f83

Browse files
author
Juha Heiskanen
committed
Added support for handle RPL hop by Hop sender rank 0.
Sender rank zero is possible if originator not set own rank to message.
1 parent d62c589 commit 3275f83

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
* Fixed issues related to channel change failures and bad MAC retransmission timings causing heavily decreasing performance on devices.
1818
* Corrected memory leak on Border Router key storage that could occur when key storage is allocated on low memory situation
1919
* Nodes no longer verify BR IID (EAPOL Authenticator EUI-64) from DODAG ID because it causes interworking issues with DODAG IDs which are not generated using EUI-64.
20+
* Added support for handle RPL hop by Hop sender rank 0. This fixes interoperability issues with other Wi-SUN vendors.
2021

2122
## Release v12.7.0 (14-12-2020)
2223

source/RPL/rpl_data.c

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -445,18 +445,20 @@ static buffer_t *rpl_data_exthdr_provider_hbh_2(buffer_t *buf, rpl_instance_t *i
445445
* strictly less for Down packets and strictly greater for Up.
446446
*/
447447
sender_rank = common_read_16_bit(opt + 4);
448-
rpl_cmp_t cmp = rpl_rank_compare_dagrank_rank(dodag, sender_rank, instance->current_rank);
449-
rpl_cmp_t expected_cmp = (opt[2] & RPL_OPT_DOWN) ? RPL_CMP_LESS : RPL_CMP_GREATER;
450-
if (cmp != expected_cmp) {
451-
/* Set the Rank-Error bit; if already set, drop */
452-
if (opt[2] & RPL_OPT_RANK_ERROR) {
453-
protocol_stats_update(STATS_RPL_ROUTELOOP, 1);
454-
tr_info("Forwarding inconsistency R");
455-
rpl_instance_inconsistency(instance);
456-
*result = -1;
457-
return buf;
458-
} else {
459-
opt[2] |= RPL_OPT_RANK_ERROR;
448+
if (sender_rank != 0) {
449+
rpl_cmp_t cmp = rpl_rank_compare_dagrank_rank(dodag, sender_rank, instance->current_rank);
450+
rpl_cmp_t expected_cmp = (opt[2] & RPL_OPT_DOWN) ? RPL_CMP_LESS : RPL_CMP_GREATER;
451+
if (cmp != expected_cmp) {
452+
/* Set the Rank-Error bit; if already set, drop */
453+
if (opt[2] & RPL_OPT_RANK_ERROR) {
454+
protocol_stats_update(STATS_RPL_ROUTELOOP, 1);
455+
tr_info("Forwarding inconsistency R");
456+
rpl_instance_inconsistency(instance);
457+
*result = -1;
458+
return buf;
459+
} else {
460+
opt[2] |= RPL_OPT_RANK_ERROR;
461+
}
460462
}
461463
}
462464
}

0 commit comments

Comments
 (0)