From: Maxime Peim Date: Mon, 12 Feb 2024 09:08:03 +0000 (+0100) Subject: misc: fix icmp X-Git-Tag: v24.10-rc0~193 X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=2cc14de7ebe232f99673ef68c2ed5f2f2680754f;p=vpp.git misc: fix icmp - fix ICMPv6 lookup FIB (don't reset sw_if_index[VLIB_TX] to -1) - add locally generated flag in ICMPv4 buffers (reflect ICMPv6) Type: fix Change-Id: If25a176a9952cbe185a030f8b136718af1bff9e8 Signed-off-by: Maxime Peim --- diff --git a/src/vnet/ip/icmp4.c b/src/vnet/ip/icmp4.c index 7dc21c53df1..e9909bf16d9 100644 --- a/src/vnet/ip/icmp4.c +++ b/src/vnet/ip/icmp4.c @@ -325,6 +325,7 @@ ip4_icmp_error (vlib_main_t * vm, -sizeof (ip4_header_t) - sizeof (icmp46_header_t) - 4); + p0->flags |= VNET_BUFFER_F_LOCALLY_ORIGINATED; p0->current_length = p0->current_length > 576 ? 576 : p0->current_length; out_ip0 = vlib_buffer_get_current (p0); diff --git a/src/vnet/ip/icmp6.c b/src/vnet/ip/icmp6.c index 8d95e48b269..184fce6b377 100644 --- a/src/vnet/ip/icmp6.c +++ b/src/vnet/ip/icmp6.c @@ -366,7 +366,6 @@ ip6_icmp_error (vlib_main_t * vm, -(sizeof (ip6_header_t) + sizeof (icmp46_header_t) + 4)); - vnet_buffer (p0)->sw_if_index[VLIB_TX] = ~0; p0->flags |= VNET_BUFFER_F_LOCALLY_ORIGINATED; p0->current_length = p0->current_length > 1280 ? 1280 : p0->current_length; diff --git a/test/test_map.py b/test/test_map.py index 19e582426b2..565f7da6491 100644 --- a/test/test_map.py +++ b/test/test_map.py @@ -659,7 +659,7 @@ class TestMAP(VppTestCase): p4 = p_ether / ip4_ttl_expired / payload icmp4_reply = ( - IP(id=0, ttl=254, src=self.pg0.local_ip4, dst=self.pg0.remote_ip4) + IP(id=0, ttl=255, src=self.pg0.local_ip4, dst=self.pg0.remote_ip4) / ICMP(type="time-exceeded", code="ttl-zero-during-transit") / IP(src=self.pg0.remote_ip4, dst="192.168.0.1", ttl=0) / payload @@ -673,7 +673,7 @@ class TestMAP(VppTestCase): p4 = p_ether / ip4_ttl_expired / payload icmp4_reply = ( - IP(id=0, ttl=254, src=self.pg0.local_ip4, dst=self.pg0.remote_ip4) + IP(id=0, ttl=255, src=self.pg0.local_ip4, dst=self.pg0.remote_ip4) / ICMP(type="time-exceeded", code="ttl-zero-during-transit") / IP(src=self.pg0.remote_ip4, dst="192.168.0.1", ttl=1) / payload diff --git a/test/test_mtu.py b/test/test_mtu.py index ed4fcb57818..6735cc602a8 100644 --- a/test/test_mtu.py +++ b/test/test_mtu.py @@ -99,7 +99,7 @@ class TestMTU(VppTestCase): chksum=0x2DBB, ) icmp4_reply = ( - IP(src=self.pg0.local_ip4, dst=self.pg0.remote_ip4, ttl=254, len=576, id=0) + IP(src=self.pg0.local_ip4, dst=self.pg0.remote_ip4, ttl=255, len=576, id=0) / p_icmp4 / p_ip4 / p_payload