gre: set proper fib index for unnumbered interfaces, unset fib index before forwardin... 57/33157/6
authorStanislav Zaikin <zstaseg@gmail.com>
Thu, 15 Jul 2021 14:27:29 +0000 (16:27 +0200)
committerNeale Ranns <neale@graphiant.com>
Wed, 28 Jul 2021 08:25:38 +0000 (08:25 +0000)
commit328b5dadb35916e8147237f2339dd5f4c38912fc
treefba6fb6990a21baa5ad5b830ba5a4a21a87b2dcc
parenta44a0c038f5aee70876e240d7a59aaeb79debc4c
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
src/vnet/gre/node.c
src/vnet/interface.c
src/vnet/interface_api.c
src/vnet/interface_cli.c
src/vnet/interface_funcs.h
test/test_pipe.py