From 65e770d895b13a6e5c73d13f436872ea626e47e3 Mon Sep 17 00:00:00 2001 From: Alexander Chernavin Date: Mon, 11 Apr 2022 13:02:11 +0000 Subject: ip: fix arc start in ip46-local for local mfib entries Type: fix After changes made in f840880, VRRP IPv6 cannot reply for neighbor solicitations requesting the link layer address of the configured virtual address. VRRP IPv6 enables the vrrp6-nd-input feature in the ip6-local feature arc for an interface on which a virtual router is configured. When neighbor solicitations arrive on that interface, ip6-local should start feature arc walk for that interface and the messages should be processed by vrrp6-nd-input. The problem is that currently, the feature arc is started for the interface obtained from the receive DPO that has interface unset (i.e. max u32) for local mfib entries. Thus, the feature arc is started not on the interface the messages were received on and vrrp6-nd-input is not traversed. With this fix, if interface obtained from the receive DPO is unset, use RX interface from the buffer to start the ip46-local feature arc. Also, enable tests of this case for both IPv4 and IPv6 address families that are currently tagged as extended and not run on every change. They configure VRRP with priority 255 and are expected to be stable. Signed-off-by: Alexander Chernavin Change-Id: I11ef3d5a7a986e04431e8613d1510b8666094bd7 --- src/vnet/ip/ip6_forward.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'src/vnet/ip/ip6_forward.c') diff --git a/src/vnet/ip/ip6_forward.c b/src/vnet/ip/ip6_forward.c index 5951de45908..44b0052225b 100644 --- a/src/vnet/ip/ip6_forward.c +++ b/src/vnet/ip/ip6_forward.c @@ -1475,6 +1475,11 @@ ip6_local_inline (vlib_main_t *vm, vlib_node_runtime_t *node, vnet_buffer (b[1])->sw_if_index[VLIB_TX] != ~0 ? vnet_buffer (b[1])->sw_if_index[VLIB_TX] : vnet_buffer (b[1])->ip.fib_index; + + vnet_buffer (b[0])->ip.rx_sw_if_index = + vnet_buffer (b[0])->sw_if_index[VLIB_RX]; + vnet_buffer (b[1])->ip.rx_sw_if_index = + vnet_buffer (b[1])->sw_if_index[VLIB_RX]; if (is_receive_dpo) { const receive_dpo_t *rd0, *rd1; @@ -1482,15 +1487,10 @@ ip6_local_inline (vlib_main_t *vm, vlib_node_runtime_t *node, receive_dpo_get (vnet_buffer (b[0])->ip.adj_index[VLIB_TX]); rd1 = receive_dpo_get (vnet_buffer (b[1])->ip.adj_index[VLIB_TX]); - vnet_buffer (b[0])->ip.rx_sw_if_index = rd0->rd_sw_if_index; - vnet_buffer (b[1])->ip.rx_sw_if_index = rd1->rd_sw_if_index; - } - else - { - vnet_buffer (b[0])->ip.rx_sw_if_index = - vnet_buffer (b[0])->ip.adj_index[VLIB_RX]; - vnet_buffer (b[1])->ip.rx_sw_if_index = - vnet_buffer (b[1])->ip.adj_index[VLIB_RX]; + if (rd0->rd_sw_if_index != ~0) + vnet_buffer (b[0])->ip.rx_sw_if_index = rd0->rd_sw_if_index; + if (rd1->rd_sw_if_index != ~0) + vnet_buffer (b[1])->ip.rx_sw_if_index = rd1->rd_sw_if_index; } } /* head_of_feature_arc */ @@ -1619,15 +1619,16 @@ ip6_local_inline (vlib_main_t *vm, vlib_node_runtime_t *node, vnet_buffer (b[0])->sw_if_index[VLIB_TX] != ~0 ? vnet_buffer (b[0])->sw_if_index[VLIB_TX] : vnet_buffer (b[0])->ip.fib_index; + + vnet_buffer (b[0])->ip.rx_sw_if_index = + vnet_buffer (b[0])->sw_if_index[VLIB_RX]; if (is_receive_dpo) { receive_dpo_t *rd; rd = receive_dpo_get (vnet_buffer (b[0])->ip.adj_index[VLIB_TX]); - vnet_buffer (b[0])->ip.rx_sw_if_index = rd->rd_sw_if_index; + if (rd->rd_sw_if_index != ~0) + vnet_buffer (b[0])->ip.rx_sw_if_index = rd->rd_sw_if_index; } - else - vnet_buffer (b[0])->ip.rx_sw_if_index = - vnet_buffer (b[0])->ip.adj_index[VLIB_RX]; } /* head_of_feature_arc */ next[0] = lm->local_next_by_ip_protocol[ip->protocol]; -- cgit 1.2.3-korg