aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/interface_cli.c
diff options
context:
space:
mode:
authorStanislav Zaikin <zstaseg@gmail.com>2021-07-15 16:27:29 +0200
committerNeale Ranns <neale@graphiant.com>2021-07-28 08:25:38 +0000
commit328b5dadb35916e8147237f2339dd5f4c38912fc (patch)
treefba6fb6990a21baa5ad5b830ba5a4a21a87b2dcc /src/vnet/interface_cli.c
parenta44a0c038f5aee70876e240d7a59aaeb79debc4c (diff)
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 <zstaseg@gmail.com> Change-Id: Id13d239cfdd21e0db6b1c9725f01c40d4af4d800
Diffstat (limited to 'src/vnet/interface_cli.c')
-rw-r--r--src/vnet/interface_cli.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/vnet/interface_cli.c b/src/vnet/interface_cli.c
index 73b275785b8..68431860183 100644
--- a/src/vnet/interface_cli.c
+++ b/src/vnet/interface_cli.c
@@ -976,8 +976,23 @@ set_unnumbered (vlib_main_t * vm,
return clib_error_return (0, "When enabling unnumbered specify the"
" IP enabled interface that it uses");
- vnet_sw_interface_update_unnumbered (unnumbered_sw_if_index,
- inherit_from_sw_if_index, enable);
+ int rv = vnet_sw_interface_update_unnumbered (
+ unnumbered_sw_if_index, inherit_from_sw_if_index, enable);
+
+ switch (rv)
+ {
+ case 0:
+ break;
+
+ case VNET_API_ERROR_UNEXPECTED_INTF_STATE:
+ return clib_error_return (
+ 0,
+ "When enabling unnumbered both interfaces must be in the same tables");
+
+ default:
+ return clib_error_return (
+ 0, "vnet_sw_interface_update_unnumbered returned %d", rv);
+ }
return (NULL);
}