提交 b7de196e 编写于 作者: F Florian Westphal 提交者: Cheng Jian

netfilter: ctnetlink: fix dump of the expect mask attribute

stable inclusion
from linux-4.19.184
commit 2ca21906400986780cb5216e8bdd27201fd4a780

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

[ Upstream commit b58f33d4 ]

Before this change, the mask is never included in the netlink message, so
"conntrack -E expect" always prints 0.0.0.0.

In older kernels the l3num callback struct was passed as argument, based
on tuple->src.l3num. After the l3num indirection got removed, the call
chain is based on m.src.l3num, but this value is 0xffff.

Init l3num to the correct value.

Fixes: f957be9d ("netfilter: conntrack: remove ctnetlink callbacks from l3 protocol trackers")
Signed-off-by: NFlorian Westphal <fw@strlen.de>
Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: NCheng Jian <cj.chengjian@huawei.com>
上级 36248877
...@@ -2656,6 +2656,7 @@ static int ctnetlink_exp_dump_mask(struct sk_buff *skb, ...@@ -2656,6 +2656,7 @@ static int ctnetlink_exp_dump_mask(struct sk_buff *skb,
memset(&m, 0xFF, sizeof(m)); memset(&m, 0xFF, sizeof(m));
memcpy(&m.src.u3, &mask->src.u3, sizeof(m.src.u3)); memcpy(&m.src.u3, &mask->src.u3, sizeof(m.src.u3));
m.src.u.all = mask->src.u.all; m.src.u.all = mask->src.u.all;
m.src.l3num = tuple->src.l3num;
m.dst.protonum = tuple->dst.protonum; m.dst.protonum = tuple->dst.protonum;
nest_parms = nla_nest_start(skb, CTA_EXPECT_MASK | NLA_F_NESTED); nest_parms = nla_nest_start(skb, CTA_EXPECT_MASK | NLA_F_NESTED);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册