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 --- test/test_pipe.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'test') diff --git a/test/test_pipe.py b/test/test_pipe.py index 0e766654d2a..937a28ef826 100644 --- a/test/test_pipe.py +++ b/test/test_pipe.py @@ -53,11 +53,13 @@ class VppPipe(VppInterface): return True return False - def set_unnumbered(self, ip_sw_if_index, is_add=True): - res = self._test.vapi.sw_interface_set_unnumbered(ip_sw_if_index, - self.east, is_add) - res = self._test.vapi.sw_interface_set_unnumbered(ip_sw_if_index, - self.west, is_add) + def set_unnumbered(self, ip_sw_if_index, is_east, is_add=True): + if is_east: + res = self._test.vapi.sw_interface_set_unnumbered( + ip_sw_if_index, self.east, is_add) + else: + res = self._test.vapi.sw_interface_set_unnumbered( + ip_sw_if_index, self.west, is_add) class TestPipe(VppTestCase): @@ -203,8 +205,8 @@ class TestPipe(VppTestCase): self.send_and_assert_no_replies(self.pg2, p_east * NUM_PKTS) # IP enable the Pipes by making them unnumbered - pipes[0].set_unnumbered(self.pg2.sw_if_index) - pipes[1].set_unnumbered(self.pg3.sw_if_index) + pipes[1].set_unnumbered(self.pg2.sw_if_index, True) + pipes[1].set_unnumbered(self.pg3.sw_if_index, False) self.send_and_expect(self.pg2, p_east * NUM_PKTS, self.pg3) -- cgit 1.2.3-korg