From 7052994a19bd3361ea9181c6ef99a82b398033ed Mon Sep 17 00:00:00 2001 From: Jaap Keuter Date: Fri, 18 Dec 2020 13:22:15 +0100 Subject: [PATCH] IPv6: SRH setup correct DA for pseudo header When a Segment Routing Header is present in the IPv6 packet provisions have to be made to setup the right destination address for the pseudo header used in checksum calculations. When segments are left in the header the first address in the list has to replace the destination address. Closes #17097 --- epan/dissectors/packet-ipv6.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/epan/dissectors/packet-ipv6.c b/epan/dissectors/packet-ipv6.c index 530a47b024..3176de2abf 100644 --- a/epan/dissectors/packet-ipv6.c +++ b/epan/dissectors/packet-ipv6.c @@ -1109,6 +1109,10 @@ dissect_routing6_srh(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void * "IPv6 Type 4 Routing Header segments left field must not exceed address count (%u)", addr_count); } + if (pinfo->dst.type == AT_IPv6 && rt->hdr.ip6r_segleft > 0) { + alloc_address_wmem_ipv6(pinfo->pool, &pinfo->dst, tvb_get_ptr_ipv6(tvb, offset)); + } + for (unsigned i = 0; i < addr_count; i++) { addr_offset = offset + i * IPv6_ADDR_SIZE; _proto_tree_add_ipv6_vector_address(tree, hf_ipv6_routing_srh_addr, tvb,