Skip to contentSkip to conversation

Check for status flags existence on conntrack creation

PATCH Applied Pablo Neira Ayuso 2 participants 2 messages Nov 10, 2006 – Nov 23, 2006

Subsystems (2)
lore
Share & tools
lore

Pablo Neira Ayuso

author maintainer
#0 lore raw

PATCH 2/4 Check for status flags existence on conntrack creation

Check that status flags are available in the netlink message received to create a new conntrack.

Signature · 2 lines
The dawn of the fourth age of Linux firewalling is coming; a time of
great struggle and heroic deeds -- J.Kadlecsik got inspired by J.Morris

[CTNETLINK] Check for status flags existence on conntrack creation

Check that status flags are available in the netlink message received to create a new conntrack.

net/ipv4/netfilter/ip_conntrack_netlink.c +5 -3
Index: linux-2.6.git/net/ipv4/netfilter/ip_conntrack_netlink.c
===================================================================
@@ -945,9 +945,11 @@ ctnetlink_create_conntrack(struct nfattr
 	ct->timeout.expires = jiffies + ct->timeout.expires * HZ;
 	ct->status |= IPS_CONFIRMED;
 
-	err = ctnetlink_change_status(ct, cda);
-	if (err < 0)
-		goto err;
+	if (cda[CTA_STATUS-1]) {
+		err = ctnetlink_change_status(ct, cda);
+		if (err < 0)
+			goto err;
+	}
 
 	if (cda[CTA_PROTOINFO-1]) {
 		err = ctnetlink_change_protoinfo(ct, cda);
net/netfilter/nf_conntrack_netlink.c +5 -3
Index: linux-2.6.git/net/netfilter/nf_conntrack_netlink.c
===================================================================
@@ -961,9 +961,11 @@ ctnetlink_create_conntrack(struct nfattr
 	ct->timeout.expires = jiffies + ct->timeout.expires * HZ;
 	ct->status |= IPS_CONFIRMED;
 
-	err = ctnetlink_change_status(ct, cda);
-	if (err < 0)
-		goto err;
+	if (cda[CTA_STATUS-1]) {
+		err = ctnetlink_change_status(ct, cda);
+		if (err < 0)
+			goto err;
+	}
 
 	if (cda[CTA_PROTOINFO-1]) {
 		err = ctnetlink_change_protoinfo(ct, cda);
#1 lore raw
Quoted 1 line · Pablo Neira Ayuso

[CTNETLINK] Check for status flags existence on conntrack creation

Applied, thanks Pablo.