From 328b5dadb35916e8147237f2339dd5f4c38912fc Mon Sep 17 00:00:00 2001 From: Stanislav Zaikin Date: Thu, 15 Jul 2021 16:27:29 +0200 Subject: gre: set proper fib index for unnumbered interfaces, unset fib index before forwarding gre payload This commit introduces 2 fixes: 1) After GRE decapsulation sw_if_index[VLIB_TX] is set as fib index of GRE tunnel. But since GRE tunnel can work on v4 endpoints and have v6 payload, we need to reset it. In case we get IPv6 packet inside IPv4 GRE tunnel (or vice-versa) fib index can be (and usually is) invalid. 2) Check that ip-table and ip6-table are the same when setting interface as an unnumbered one. Also, fix for the pipe test include setting the right unnumbered interface for the pipes Type: fix Signed-off-by: Stanislav Zaikin Change-Id: Id13d239cfdd21e0db6b1c9725f01c40d4af4d800 --- src/vnet/gre/node.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/vnet/gre/node.c') diff --git a/src/vnet/gre/node.c b/src/vnet/gre/node.c index 92523069f05..fdd3118bf3c 100644 --- a/src/vnet/gre/node.c +++ b/src/vnet/gre/node.c @@ -301,6 +301,9 @@ gre_input (vlib_main_t * vm, vnet_buffer (b[1])->sw_if_index[VLIB_RX] = tun_sw_if_index[1]; } + vnet_buffer (b[0])->sw_if_index[VLIB_TX] = (u32) ~0; + vnet_buffer (b[1])->sw_if_index[VLIB_TX] = (u32) ~0; + if (PREDICT_FALSE (b[0]->flags & VLIB_BUFFER_IS_TRACED)) gre_trace (vm, node, b[0], tun_sw_if_index[0], ip6[0], ip4[0], is_ipv6); @@ -411,6 +414,8 @@ gre_input (vlib_main_t * vm, vnet_buffer (b[0])->sw_if_index[VLIB_RX] = tun_sw_if_index[0]; } + vnet_buffer (b[0])->sw_if_index[VLIB_TX] = (u32) ~0; + if (PREDICT_FALSE (b[0]->flags & VLIB_BUFFER_IS_TRACED)) gre_trace (vm, node, b[0], tun_sw_if_index[0], ip6[0], ip4[0], is_ipv6); -- cgit 1.2.3-korg