]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net, ip_tunnel: fix interface lookup with no key
authorWilliam Dauchy <w.dauchy@criteo.com>
Fri, 27 Mar 2020 18:56:39 +0000 (19:56 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 8 Apr 2020 07:09:53 +0000 (09:09 +0200)
commit6dd2c0d7a80d3cbb13dc299c0a02a6eea92837ab
treefa758849feb7dc36b8de6fe71c0b56ae5f317317
parent2a51b950bdb86a28c46500c97c462ec48b45180b
net, ip_tunnel: fix interface lookup with no key

[ Upstream commit 25629fdaff2ff509dd0b3f5ff93d70a75e79e0a1 ]

when creating a new ipip interface with no local/remote configuration,
the lookup is done with TUNNEL_NO_KEY flag, making it impossible to
match the new interface (only possible match being fallback or metada
case interface); e.g: `ip link add tunl1 type ipip dev eth0`

To fix this case, adding a flag check before the key comparison so we
permit to match an interface with no local/remote config; it also avoids
breaking possible userland tools relying on TUNNEL_NO_KEY flag and
uninitialised key.

context being on my side, I'm creating an extra ipip interface attached
to the physical one, and moving it to a dedicated namespace.

Fixes: c54419321455 ("GRE: Refactor GRE tunneling code.")
Signed-off-by: William Dauchy <w.dauchy@criteo.com>
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/ipv4/ip_tunnel.c