Skip to contentSkip to conversation

netfilter: ctnetlink: fix expectation mask dump

PATCH Patrick McHardy 1 participant 1 message Jan 21, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

I'm about to commit the following two bugfixes to nf-2.6.git.

I'll wait for a few hours in case someone wants to comment or add an Ack.

commit 0f682015a83fad33869f49b941adf682b4b4394c

Author: Patrick McHardy <[email protected]>
Date:   Thu Jan 21 11:08:52 2010 +0100

netfilter: ctnetlink: fix expectation mask dump

The protocol number is not initialized, so userspace can't interpret the layer 4 data properly.

net/netfilter/nf_conntrack_netlink.c +2 -1
index 79478df..5443a04 100644
@@ -1446,8 +1446,9 @@ ctnetlink_exp_dump_mask(struct sk_buff *skb,
 	struct nlattr *nest_parms;
 
 	memset(&m, 0xFF, sizeof(m));
-	m.src.u.all = mask->src.u.all;
 	memcpy(&m.src.u3, &mask->src.u3, sizeof(m.src.u3));
+	m.src.u.all = mask->src.u.all;
+	m.dst.protonum = tuple->dst.protonum;
 
 	nest_parms = nla_nest_start(skb, CTA_EXPECT_MASK | NLA_F_NESTED);
 	if (!nest_parms)