]> git.baikalelectronics.ru Git - kernel.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)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 1 Jun 2022 13:53:39 +0000 (15:53 +0200)
commita00bd5b5d626f68c95240cfa4e2ce94a7f02511c
tree0e6da4b3bca173baae61c9d66ea8afc9fce8594f
parent49fcad7fb3b9a0d51412ed8ebc20ae864beaecdd
netfilter: nat: really support inet nat without l3 address

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: eed3076d3a9d0 ("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>
net/netfilter/nft_nat.c
tools/testing/selftests/netfilter/nft_nat.sh