aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorVladimir Isaev <visaev@netgate.com>2020-02-26 13:21:35 +0300
committerOle Trøan <otroan@employees.org>2020-02-26 11:54:22 +0000
commit7d4cd0cf6f1a94953ef97ab885752424dea6948c (patch)
tree5cbd5c7fcee9e9be7576ca34e6280b2071d2d39f /src/plugins
parent666ece35cd2625bbd8b6ddadb6e87444a617df4d (diff)
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 <visaev@netgate.com> Change-Id: I04d6f5e42f8f072987192d6236085afbd74a4420
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/map/ip6_map_t.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/map/ip6_map_t.c b/src/plugins/map/ip6_map_t.c
index 01bf0f9c281..7d0cd42ff0c 100644
--- a/src/plugins/map/ip6_map_t.c
+++ b/src/plugins/map/ip6_map_t.c
@@ -345,7 +345,7 @@ map_ip6_to_ip4_tcp_udp (vlib_main_t * vm, vlib_buffer_t * p,
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;
@@ -356,7 +356,7 @@ map_ip6_to_ip4_tcp_udp (vlib_main_t * vm, vlib_buffer_t * p,
}
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;
}