]> 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)
commit282e5f8fe907dc3f2fbf9f2103b0e62ffc3a68a5
tree0e6da4b3bca173baae61c9d66ea8afc9fce8594f
parent0a375c822497ed6ad6b5da0792a12a6f1af10c0b
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: 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>
net/netfilter/nft_nat.c
tools/testing/selftests/netfilter/nft_nat.sh