Commit ea8fbe32 authored by Florian Westphal's avatar Florian Westphal Committed by Zheng Zengkai
Browse files

netfilter: nat: really support inet nat without l3 address

stable inclusion
from stable-v5.10.122
commit 9edafbc7ec29a36655df43349c2ec569902261f0
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I5W6OE

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=9edafbc7ec29a36655df43349c2ec569902261f0



--------------------------------

[ Upstream commit 282e5f8f ]

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: a33f387e ("netfilter: nft_nat: allow to specify layer 4 protocol NAT only")
Reported-by: default avatarYi Chen <yiche@redhat.com>
Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
Reviewed-by: default avatarWei Li <liwei391@huawei.com>
parent 47fa1a01
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment