]> 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)
commitf6664216d8eef6324953a094d92b7904f0b9587f
tree0e6da4b3bca173baae61c9d66ea8afc9fce8594f
parent4bea64a55a1baaf41e4d3838263ec3ee7bd89914
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: 79f31dc395f70 ("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