Skip to contentSkip to conversation

netfilter:

PATCH New Rusty Russell 1 participant 1 message Dec 31, 2004

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

PATCH 4/8 netfilter:

Name: Fix cleanup patch when sysctl registration fails
Status: Tested under nfsim

nfsim gains sysctl support, and sure enough, --failtest uncovered an unregister when the registration had failed, plus 0 return despite failure.

net/ipv4/netfilter/ip_conntrack_standalone.c +3 -1
Index: linux-2.6.10-bk1-Netfilter/net/ipv4/netfilter/ip_conntrack_standalone.c
===================================================================
@@ -791,7 +791,8 @@
 	ip_ct_sysctl_header = register_sysctl_table(ip_ct_net_table, 0);
 	if (ip_ct_sysctl_header == NULL) {
 		printk("ip_conntrack: can't register to sysctl.\n");
-		goto cleanup;
+		ret = -ENOMEM;
+		goto cleanup_localinops;
 	}
 #endif
 
@@ -800,6 +801,7 @@
  cleanup:
 #ifdef CONFIG_SYSCTL
  	unregister_sysctl_table(ip_ct_sysctl_header);
+ cleanup_localinops:
 #endif
 	nf_unregister_hook(&ip_conntrack_local_in_ops);
  cleanup_inoutandlocalops:
Signature · 1 line
A bad analogy is like a leaky screwdriver -- Richard Braakman