From b745d7b21dd5e7c434435c9fbd36360006cc3fae Mon Sep 17 00:00:00 2001 From: Vladimir Isaev Date: Wed, 26 Feb 2020 13:21:35 +0300 Subject: map: handle IPv6 extension headers for TCP/UDP Without this patch offset for TCP/UDP headers was not calculated correctly if there is one or more IPv6 extension headers. Type: fix Signed-off-by: Vladimir Isaev Change-Id: I04d6f5e42f8f072987192d6236085afbd74a4420 (cherry picked from commit 7d4cd0cf6f1a94953ef97ab885752424dea6948c) --- src/plugins/map/ip6_map_t.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/plugins/map/ip6_map_t.c b/src/plugins/map/ip6_map_t.c index 6757163bb1e..c1c8b63647d 100644 --- a/src/plugins/map/ip6_map_t.c +++ b/src/plugins/map/ip6_map_t.c @@ -381,7 +381,7 @@ map_ip6_to_ip4_tcp_udp (vlib_buffer_t * p, bool udp_checksum) if (l4_protocol == IP_PROTOCOL_TCP) { - tcp_header_t *tcp = ip6_next_header (ip6); + tcp_header_t *tcp = (tcp_header_t *) u8_ptr_add (ip6, l4_offset); if (mm->tcp_mss > 0) { csum = tcp->checksum; @@ -392,7 +392,7 @@ map_ip6_to_ip4_tcp_udp (vlib_buffer_t * p, bool udp_checksum) } else { - udp_header_t *udp = ip6_next_header (ip6); + udp_header_t *udp = (udp_header_t *) u8_ptr_add (ip6, l4_offset); checksum = &udp->checksum; } -- cgit 1.2.3-korg