From af50b4f727f6d9d85c722c39b459941e01a34217 Mon Sep 17 00:00:00 2001 From: Matthew Smith Date: Mon, 11 Oct 2021 14:10:15 -0500 Subject: ip6: set local flag on outbound echo reply Type: fix When VPP generates an ICMP echo reply in response to an incoming echo request to a local address, set VNET_BUFFER_F_LOCALLY_ORIGINATED on the buffer. It will prevent ip6-rewrite from decrementing the hop limit. Outbound IPv4 echo replies also get this flag set. Change-Id: Iaa229294eb158edb58cf1bf1b7a90da281321406 Signed-off-by: Matthew Smith --- src/vnet/ip/icmp6.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/vnet/ip/icmp6.c b/src/vnet/ip/icmp6.c index b6ed3ea0ec9..b0fdadb2667 100644 --- a/src/vnet/ip/icmp6.c +++ b/src/vnet/ip/icmp6.c @@ -351,6 +351,9 @@ ip6_icmp_echo_request (vlib_main_t * vm, vnet_buffer (p1)->sw_if_index[VLIB_RX]); vnet_buffer (p1)->sw_if_index[VLIB_TX] = fib_index1; + p0->flags |= VNET_BUFFER_F_LOCALLY_ORIGINATED; + p1->flags |= VNET_BUFFER_F_LOCALLY_ORIGINATED; + /* verify speculative enqueues, maybe switch current next frame */ /* if next0==next1==next_index then nothing special needs to be done */ vlib_validate_buffer_enqueue_x2 (vm, node, next_index, @@ -404,6 +407,7 @@ ip6_icmp_echo_request (vlib_main_t * vm, vnet_buffer (p0)->sw_if_index[VLIB_RX]); vnet_buffer (p0)->sw_if_index[VLIB_TX] = fib_index0; + p0->flags |= VNET_BUFFER_F_LOCALLY_ORIGINATED; /* Verify speculative enqueue, maybe switch current next frame */ vlib_validate_buffer_enqueue_x1 (vm, node, next_index, to_next, n_left_to_next, -- cgit 1.2.3-korg