]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
netfilter: nat: really support inet nat without l3 address
authorFlorian Westphal <fw@strlen.de>
Wed, 1 Jun 2022 08:47:35 +0000 (10:47 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 14 Jun 2022 16:41:29 +0000 (18:41 +0200)
commitc7e599914669507ed22936e410b924b239e735d4
tree4bef8a8f2f90c36aa3f30ef38dd92f8e3f48f56f
parent8c8e8cc91a6ffc79865108279a74fd57d9070a17
netfilter: nat: really support inet nat without l3 address

[ Upstream commit 282e5f8fe907dc3f2fbf9f2103b0e62ffc3a68a5 ]

When no l3 address is given, priv->family is set to NFPROTO_INET and
the evaluation function isn't called.

Call it too so l4-only rewrite can work.
Also add a test case for this.

Fixes: a33f387ecd5aa ("netfilter: nft_nat: allow to specify layer 4 protocol NAT only")
Reported-by: Yi Chen <yiche@redhat.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/netfilter/nft_nat.c
tools/testing/selftests/netfilter/nft_nat.sh