@@ -351,8 +351,9 @@ static buffer_t *rpl_data_exthdr_provider_hbh_2(buffer_t *buf, rpl_instance_t *i
351
351
// size because of the LL addresses used on the outer header, so
352
352
// this is an unconditional change. Exception remains for local
353
353
// 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 ))) {
356
357
destination_in_instance = true;
357
358
358
359
if (buf -> rpl_option ) {
@@ -997,7 +998,7 @@ static buffer_t *rpl_data_exthdr_provider_srh(buffer_t *buf, ipv6_exthdr_stage_t
997
998
* (RFC 6554 4.1). When not tunnelling, we include all hops regardless,
998
999
* which means the final destination is there as needed.
999
1000
*/
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 );
1001
1002
if (!srh_info ) {
1002
1003
/* No source routing header required - this must be because it's one hop. */
1003
1004
/* 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
1033
1034
if (final_rpl_dest != buf -> dst_sa .address ) {
1034
1035
memcpy (buf -> dst_sa .address , final_rpl_dest , 16 );
1035
1036
}
1037
+ buf -> route -> ip_dest = rpl_data_sr_next_hop ();
1036
1038
* result = IPV6_EXTHDR_MODIFY_TUNNEL ;
1037
1039
buf -> src_sa .addr_type = ADDR_NONE ; // force auto-selection
1038
1040
return buf ;
0 commit comments