]> git.baikalelectronics.ru Git - kernel.git/commit
wireguard: socket: ignore v6 endpoints when ipv6 is disabled
authorJason A. Donenfeld <Jason@zx2c4.com>
Wed, 30 Mar 2022 01:31:27 +0000 (21:31 -0400)
committerJakub Kicinski <kuba@kernel.org>
Thu, 31 Mar 2022 02:14:09 +0000 (19:14 -0700)
commitf84427d7f4280b91305889b70da87fad2d9c9e90
tree01f250266b363a2e63813d5780462fa799fe087a
parent4bc27df5302f75e48f1fdae805e333bc44a60be4
wireguard: socket: ignore v6 endpoints when ipv6 is disabled

The previous commit fixed a memory leak on the send path in the event
that IPv6 is disabled at compile time, but how did a packet even arrive
there to begin with? It turns out we have previously allowed IPv6
endpoints even when IPv6 support is disabled at compile time. This is
awkward and inconsistent. Instead, let's just ignore all things IPv6,
the same way we do other malformed endpoints, in the case where IPv6 is
disabled.

Fixes: 0c73bbc77a76 ("net: WireGuard secure network tunnel")
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/wireguard/socket.c