From: Stanislav Zaikin Date: Tue, 10 May 2022 18:50:36 +0000 (+0200) Subject: l2: skip arp term for locally originated packets X-Git-Tag: v23.02-rc0~51 X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;ds=sidebyside;h=7dc351f6895d94eaee1fd04672368cc425e14103;p=vpp.git l2: skip arp term for locally originated packets Mark arp packet as locally originated when probing/replying and don't apply any arp-term logic against it. Type: fix Signed-off-by: Stanislav Zaikin Change-Id: I305ff5cac8cac456decf92f21b961aa4ce286079 --- diff --git a/src/vnet/arp/arp_packet.h b/src/vnet/arp/arp_packet.h index a860c258f75..66ab384a33e 100644 --- a/src/vnet/arp/arp_packet.h +++ b/src/vnet/arp/arp_packet.h @@ -68,6 +68,8 @@ arp_mk_reply (vnet_main_t * vnm, clib_mem_unaligned (&arp0->ip4_over_ethernet[0].ip4.data_u32, u32) = if_addr0->data_u32; + p0->flags |= VNET_BUFFER_F_LOCALLY_ORIGINATED; + /* Hardware must be ethernet-like. */ ASSERT (vec_len (hw_if0->hw_address) == 6); diff --git a/src/vnet/ip-neighbor/ip4_neighbor.h b/src/vnet/ip-neighbor/ip4_neighbor.h index 8ace8d1a2d0..7941ebdbced 100644 --- a/src/vnet/ip-neighbor/ip4_neighbor.h +++ b/src/vnet/ip-neighbor/ip4_neighbor.h @@ -61,6 +61,7 @@ ip4_neighbor_probe (vlib_main_t *vm, vnet_main_t *vnm, h0->ip4_over_ethernet[1].ip4 = *dst; vnet_buffer (b0)->sw_if_index[VLIB_TX] = adj0->rewrite_header.sw_if_index; + b0->flags |= VNET_BUFFER_F_LOCALLY_ORIGINATED; vlib_buffer_advance (b0, -adj0->rewrite_header.data_bytes); diff --git a/src/vnet/l2/l2_arp_term.c b/src/vnet/l2/l2_arp_term.c index d0734328759..594ee8e3622 100644 --- a/src/vnet/l2/l2_arp_term.c +++ b/src/vnet/l2/l2_arp_term.c @@ -290,6 +290,9 @@ arp_term_l2bd (vlib_main_t * vm, ethertype0 = clib_net_to_host_u16 (*(u16 *) (l3h0 - 2)); arp0 = (ethernet_arp_header_t *) l3h0; + if (p0->flags & VNET_BUFFER_F_LOCALLY_ORIGINATED) + goto next_l2_feature; + if (ethertype0 != ETHERNET_TYPE_ARP) goto check_ip6_nd;