Skip to content

Commit 0b82953

Browse files
author
Juha Heiskanen
committed
Traceroute bug fix.
Fixed broken traceroute functionality when Border router forward multihop destination by hop limit 1.
1 parent 04de6e2 commit 0b82953

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
* Removed empty EAPOL-key message send after 4WH completion to nodes on relay
1818
* EAPOL parent candidate compare fix for better TX failure count
1919
* Fixed channel mask usage with OFDM configurations
20+
* Fixed recursive tunnel build problem when sending packets with hop count 1 from Border router to multi hop destination
2021

2122

2223
## Release v13.0.0 (15-04-2021)

source/RPL/rpl_data.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -351,8 +351,9 @@ static buffer_t *rpl_data_exthdr_provider_hbh_2(buffer_t *buf, rpl_instance_t *i
351351
// size because of the LL addresses used on the outer header, so
352352
// this is an unconditional change. Exception remains for local
353353
// DODAGs, where the destination address must be the DODAGID.
354-
if (addr_ipv6_equal(route_info->next_hop_addr, buf->dst_sa.address) || (!rpl_policy_force_tunnel() &&
355-
addr_ipv6_equal(buf->dst_sa.address, dodag->id))) {
354+
const uint8_t *ip_dest = buf->route->ip_dest ? buf->route->ip_dest : buf->dst_sa.address;
355+
if (addr_ipv6_equal(route_info->next_hop_addr, ip_dest) || (!rpl_policy_force_tunnel() &&
356+
addr_ipv6_equal(ip_dest, dodag->id))) {
356357
destination_in_instance = true;
357358

358359
if (buf->rpl_option) {
@@ -997,7 +998,7 @@ static buffer_t *rpl_data_exthdr_provider_srh(buffer_t *buf, ipv6_exthdr_stage_t
997998
* (RFC 6554 4.1). When not tunnelling, we include all hops regardless,
998999
* which means the final destination is there as needed.
9991000
*/
1000-
srh_info = rpl_data_sr_compute_header_size(final_rpl_dest, buf->options.tunnelled && buf->options.type == IPV6_NH_IPV6 ? buf->options.hop_limit : 0xFF);
1001+
srh_info = rpl_data_sr_compute_header_size(final_rpl_dest, buf->options.tunnelled ? buf->options.hop_limit : 0xFF);
10011002
if (!srh_info) {
10021003
/* No source routing header required - this must be because it's one hop. */
10031004
/* In this case, we do need to add a HbH option header */
@@ -1033,6 +1034,7 @@ static buffer_t *rpl_data_exthdr_provider_srh(buffer_t *buf, ipv6_exthdr_stage_t
10331034
if (final_rpl_dest != buf->dst_sa.address) {
10341035
memcpy(buf->dst_sa.address, final_rpl_dest, 16);
10351036
}
1037+
buf->route->ip_dest = rpl_data_sr_next_hop();
10361038
*result = IPV6_EXTHDR_MODIFY_TUNNEL;
10371039
buf->src_sa.addr_type = ADDR_NONE; // force auto-selection
10381040
return buf;

0 commit comments

Comments
 (0)