diff -urN --exclude-from=../diff.exclude linux-2.5.74-logging/include/linux/sysctl.h linux-2.5.74-proc/include/linux/sysctl.h
--- linux-2.5.74-logging/include/linux/sysctl.h	2003-07-02 22:49:05.000000000 +0200
+++ linux-2.5.74-proc/include/linux/sysctl.h	2003-07-16 08:06:55.000000000 +0200
@@ -247,6 +247,7 @@
 	NET_IPV4_NEIGH=17,
 	NET_IPV4_ROUTE=18,
 	NET_IPV4_FIB_HASH=19,
+	NET_IPV4_NETFILTER=20,
 
 	NET_IPV4_TCP_TIMESTAMPS=33,
 	NET_IPV4_TCP_WINDOW_SCALING=34,
@@ -361,6 +362,24 @@
 	NET_IPV4_CONF_NOPOLICY=16,
 };
 
+/* /proc/sys/net/ipv4/netfilter */
+enum
+{
+	NET_IPV4_NF_CONNTRACK_MAX=1,
+	NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_SYN_SENT=2,
+	NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_SYN_RECV=3,
+	NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_ESTABLISHED=4,
+	NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_FIN_WAIT=5,
+	NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_CLOSE_WAIT=6,
+	NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_LAST_ACK=7,
+	NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_TIME_WAIT=8,
+	NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_CLOSE=9,
+	NET_IPV4_NF_CONNTRACK_UDP_TIMEOUT=10,
+	NET_IPV4_NF_CONNTRACK_UDP_TIMEOUT_STREAM=11,
+	NET_IPV4_NF_CONNTRACK_ICMP_TIMEOUT=12,
+	NET_IPV4_NF_CONNTRACK_GENERIC_TIMEOUT=13,
+};
+ 
 /* /proc/sys/net/ipv6 */
 enum {
 	NET_IPV6_CONF=16,
diff -urN --exclude-from=../diff.exclude linux-2.5.74-logging/net/ipv4/netfilter/ip_conntrack_core.c linux-2.5.74-proc/net/ipv4/netfilter/ip_conntrack_core.c
--- linux-2.5.74-logging/net/ipv4/netfilter/ip_conntrack_core.c	2003-07-02 22:39:15.000000000 +0200
+++ linux-2.5.74-proc/net/ipv4/netfilter/ip_conntrack_core.c	2003-07-16 08:09:00.000000000 +0200
@@ -60,7 +60,7 @@
 LIST_HEAD(protocol_list);
 static LIST_HEAD(helpers);
 unsigned int ip_conntrack_htable_size = 0;
-static int ip_conntrack_max = 0;
+int ip_conntrack_max = 0;
 static atomic_t ip_conntrack_count = ATOMIC_INIT(0);
 struct list_head *ip_conntrack_hash;
 static kmem_cache_t *ip_conntrack_cachep;
@@ -1321,45 +1321,6 @@
 	.get		= &getorigdst,
 };
 
-#define NET_IP_CONNTRACK_MAX 2089
-#define NET_IP_CONNTRACK_MAX_NAME "ip_conntrack_max"
-
-#ifdef CONFIG_SYSCTL
-static struct ctl_table_header *ip_conntrack_sysctl_header;
-
-static ctl_table ip_conntrack_table[] = {
-	{
-		.ctl_name	= NET_IP_CONNTRACK_MAX,
-		.procname	= NET_IP_CONNTRACK_MAX_NAME,
-		.data		= &ip_conntrack_max,
-		.maxlen		= sizeof(ip_conntrack_max),
-		.mode		= 0644,
-		.proc_handler	= proc_dointvec
-	},
- 	{ .ctl_name = 0 }
-};
-
-static ctl_table ip_conntrack_dir_table[] = {
-	{
-		.ctl_name	= NET_IPV4,
-		.procname	= "ipv4",
-		.mode		= 0555,
-		.child		= ip_conntrack_table
-	},
-	{ .ctl_name = 0 }
-};
-
-static ctl_table ip_conntrack_root_table[] = {
-	{
-		.ctl_name	= CTL_NET,
-		.procname	= "net",
-		.mode		= 0555,
-		.child		= ip_conntrack_dir_table
-	},
-	{ .ctl_name = 0 }
-};
-#endif /*CONFIG_SYSCTL*/
-
 static int kill_all(const struct ip_conntrack *i, void *data)
 {
 	return 1;
@@ -1369,9 +1330,6 @@
    supposed to kill the mall. */
 void ip_conntrack_cleanup(void)
 {
-#ifdef CONFIG_SYSCTL
-	unregister_sysctl_table(ip_conntrack_sysctl_header);
-#endif
 	ip_ct_attach = NULL;
 	/* This makes sure all current packets have passed through
            netfilter framework.  Roll on, two-stage module
@@ -1449,25 +1407,10 @@
 	for (i = 0; i < ip_conntrack_htable_size; i++)
 		INIT_LIST_HEAD(&ip_conntrack_hash[i]);
 
-/* This is fucking braindead.  There is NO WAY of doing this without
-   the CONFIG_SYSCTL unless you don't want to detect errors.
-   Grrr... --RR */
-#ifdef CONFIG_SYSCTL
-	ip_conntrack_sysctl_header
-		= register_sysctl_table(ip_conntrack_root_table, 0);
-	if (ip_conntrack_sysctl_header == NULL) {
-		goto err_free_ct_cachep;
-	}
-#endif /*CONFIG_SYSCTL*/
-
 	/* For use by ipt_REJECT */
 	ip_ct_attach = ip_conntrack_attach;
 	return ret;
 
-#ifdef CONFIG_SYSCTL
-err_free_ct_cachep:
-	kmem_cache_destroy(ip_conntrack_cachep);
-#endif /*CONFIG_SYSCTL*/
 err_free_hash:
 	vfree(ip_conntrack_hash);
 err_unreg_sockopt:
diff -urN --exclude-from=../diff.exclude linux-2.5.74-logging/net/ipv4/netfilter/ip_conntrack_proto_generic.c linux-2.5.74-proc/net/ipv4/netfilter/ip_conntrack_proto_generic.c
--- linux-2.5.74-logging/net/ipv4/netfilter/ip_conntrack_proto_generic.c	2003-07-02 22:45:15.000000000 +0200
+++ linux-2.5.74-proc/net/ipv4/netfilter/ip_conntrack_proto_generic.c	2003-07-16 08:06:55.000000000 +0200
@@ -4,7 +4,7 @@
 #include <linux/netfilter.h>
 #include <linux/netfilter_ipv4/ip_conntrack_protocol.h>
 
-#define GENERIC_TIMEOUT (600*HZ)
+unsigned long ip_ct_generic_timeout = 600*HZ;
 
 static int generic_pkt_to_tuple(const struct sk_buff *skb,
 				unsigned int dataoff,
@@ -44,7 +44,7 @@
 		  const struct sk_buff *skb,
 		  enum ip_conntrack_info conntrackinfo)
 {
-	ip_ct_refresh(conntrack, GENERIC_TIMEOUT);
+	ip_ct_refresh(conntrack, ip_ct_generic_timeout);
 	return NF_ACCEPT;
 }
 
diff -urN --exclude-from=../diff.exclude linux-2.5.74-logging/net/ipv4/netfilter/ip_conntrack_proto_icmp.c linux-2.5.74-proc/net/ipv4/netfilter/ip_conntrack_proto_icmp.c
--- linux-2.5.74-logging/net/ipv4/netfilter/ip_conntrack_proto_icmp.c	2003-07-02 22:40:09.000000000 +0200
+++ linux-2.5.74-proc/net/ipv4/netfilter/ip_conntrack_proto_icmp.c	2003-07-16 08:06:55.000000000 +0200
@@ -6,7 +6,7 @@
 #include <linux/icmp.h>
 #include <linux/netfilter_ipv4/ip_conntrack_protocol.h>
 
-#define ICMP_TIMEOUT (30*HZ)
+unsigned long ip_ct_icmp_timeout = 30*HZ;
 
 #if 0
 #define DEBUGP printk
@@ -86,7 +86,7 @@
 			ct->timeout.function((unsigned long)ct);
 	} else {
 		atomic_inc(&ct->proto.icmp.count);
-		ip_ct_refresh(ct, ICMP_TIMEOUT);
+		ip_ct_refresh(ct, ip_ct_icmp_timeout);
 	}
 
 	return NF_ACCEPT;
diff -urN --exclude-from=../diff.exclude linux-2.5.74-logging/net/ipv4/netfilter/ip_conntrack_proto_tcp.c linux-2.5.74-proc/net/ipv4/netfilter/ip_conntrack_proto_tcp.c
--- linux-2.5.74-logging/net/ipv4/netfilter/ip_conntrack_proto_tcp.c	2003-07-02 22:57:36.000000000 +0200
+++ linux-2.5.74-proc/net/ipv4/netfilter/ip_conntrack_proto_tcp.c	2003-07-16 08:06:55.000000000 +0200
@@ -49,20 +49,28 @@
 #define HOURS * 60 MINS
 #define DAYS * 24 HOURS
 
-
-static unsigned long tcp_timeouts[]
-= { 30 MINS, 	/*	TCP_CONNTRACK_NONE,	*/
-    5 DAYS,	/*	TCP_CONNTRACK_ESTABLISHED,	*/
-    2 MINS,	/*	TCP_CONNTRACK_SYN_SENT,	*/
-    60 SECS,	/*	TCP_CONNTRACK_SYN_RECV,	*/
-    2 MINS,	/*	TCP_CONNTRACK_FIN_WAIT,	*/
-    2 MINS,	/*	TCP_CONNTRACK_TIME_WAIT,	*/
-    10 SECS,	/*	TCP_CONNTRACK_CLOSE,	*/
-    60 SECS,	/*	TCP_CONNTRACK_CLOSE_WAIT,	*/
-    30 SECS,	/*	TCP_CONNTRACK_LAST_ACK,	*/
-    2 MINS,	/*	TCP_CONNTRACK_LISTEN,	*/
-};
-
+unsigned long ip_ct_tcp_timeout_syn_sent =      2 MINS;
+unsigned long ip_ct_tcp_timeout_syn_recv =     60 SECS;
+unsigned long ip_ct_tcp_timeout_established =   5 DAYS;
+unsigned long ip_ct_tcp_timeout_fin_wait =      2 MINS;
+unsigned long ip_ct_tcp_timeout_close_wait =    3 DAYS;
+unsigned long ip_ct_tcp_timeout_last_ack =     30 SECS;
+unsigned long ip_ct_tcp_timeout_time_wait =     2 MINS;
+unsigned long ip_ct_tcp_timeout_close =        10 SECS;
+
+static unsigned long * tcp_timeouts[]
+= { 0,                                 /*      TCP_CONNTRACK_NONE */
+    &ip_ct_tcp_timeout_established,    /*      TCP_CONNTRACK_ESTABLISHED,      */
+    &ip_ct_tcp_timeout_syn_sent,       /*      TCP_CONNTRACK_SYN_SENT, */
+    &ip_ct_tcp_timeout_syn_recv,       /*      TCP_CONNTRACK_SYN_RECV, */
+    &ip_ct_tcp_timeout_fin_wait,       /*      TCP_CONNTRACK_FIN_WAIT, */
+    &ip_ct_tcp_timeout_time_wait,      /*      TCP_CONNTRACK_TIME_WAIT,        */
+    &ip_ct_tcp_timeout_close,          /*      TCP_CONNTRACK_CLOSE,    */
+    &ip_ct_tcp_timeout_close_wait,     /*      TCP_CONNTRACK_CLOSE_WAIT,       */
+    &ip_ct_tcp_timeout_last_ack,       /*      TCP_CONNTRACK_LAST_ACK, */
+    0,                                 /*      TCP_CONNTRACK_LISTEN */
+ };
+ 
 #define sNO TCP_CONNTRACK_NONE
 #define sES TCP_CONNTRACK_ESTABLISHED
 #define sSS TCP_CONNTRACK_SYN_SENT
@@ -204,7 +212,7 @@
 			set_bit(IPS_ASSURED_BIT, &conntrack->status);
 
 		WRITE_UNLOCK(&tcp_lock);
-		ip_ct_refresh(conntrack, tcp_timeouts[newconntrack]);
+		ip_ct_refresh(conntrack, *tcp_timeouts[newconntrack]);
 	}
 
 	return NF_ACCEPT;
diff -urN --exclude-from=../diff.exclude linux-2.5.74-logging/net/ipv4/netfilter/ip_conntrack_proto_udp.c linux-2.5.74-proc/net/ipv4/netfilter/ip_conntrack_proto_udp.c
--- linux-2.5.74-logging/net/ipv4/netfilter/ip_conntrack_proto_udp.c	2003-07-02 22:38:41.000000000 +0200
+++ linux-2.5.74-proc/net/ipv4/netfilter/ip_conntrack_proto_udp.c	2003-07-16 08:06:55.000000000 +0200
@@ -6,8 +6,8 @@
 #include <linux/udp.h>
 #include <linux/netfilter_ipv4/ip_conntrack_protocol.h>
 
-#define UDP_TIMEOUT (30*HZ)
-#define UDP_STREAM_TIMEOUT (180*HZ)
+unsigned long ip_ct_udp_timeout = 30*HZ;
+unsigned long ip_ct_udp_timeout_stream = 180*HZ;
 
 static int udp_pkt_to_tuple(const struct sk_buff *skb,
 			     unsigned int dataoff,
@@ -57,11 +57,11 @@
 	/* If we've seen traffic both ways, this is some kind of UDP
 	   stream.  Extend timeout. */
 	if (test_bit(IPS_SEEN_REPLY_BIT, &conntrack->status)) {
-		ip_ct_refresh(conntrack, UDP_STREAM_TIMEOUT);
+		ip_ct_refresh(conntrack, ip_ct_udp_timeout_stream);
 		/* Also, more likely to be important, and not a probe */
 		set_bit(IPS_ASSURED_BIT, &conntrack->status);
 	} else
-		ip_ct_refresh(conntrack, UDP_TIMEOUT);
+		ip_ct_refresh(conntrack, ip_ct_udp_timeout);
 
 	return NF_ACCEPT;
 }
diff -urN --exclude-from=../diff.exclude linux-2.5.74-logging/net/ipv4/netfilter/ip_conntrack_standalone.c linux-2.5.74-proc/net/ipv4/netfilter/ip_conntrack_standalone.c
--- linux-2.5.74-logging/net/ipv4/netfilter/ip_conntrack_standalone.c	2003-07-02 22:46:52.000000000 +0200
+++ linux-2.5.74-proc/net/ipv4/netfilter/ip_conntrack_standalone.c	2003-07-16 18:47:20.000000000 +0200
@@ -7,6 +7,7 @@
 /* (c) 1999 Paul `Rusty' Russell.  Licenced under the GNU General
    Public Licence. */
 
+#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/ip.h>
 #include <linux/netfilter.h>
@@ -15,8 +16,12 @@
 #include <linux/skbuff.h>
 #include <linux/proc_fs.h>
 #include <linux/version.h>
+#ifdef CONFIG_SYSCTL
+#include <linux/sysctl.h>
+#endif
 #include <net/checksum.h>
 
+
 #define ASSERT_READ_LOCK(x) MUST_BE_READ_LOCKED(&ip_conntrack_lock)
 #define ASSERT_WRITE_LOCK(x) MUST_BE_WRITE_LOCKED(&ip_conntrack_lock)
 
@@ -258,6 +263,158 @@
 	.priority	= NF_IP_PRI_LAST-1,
 };
 
+/* Sysctl support */
+
+#ifdef CONFIG_SYSCTL
+
+/* From ip_conntrack_core.c */
+extern int ip_conntrack_max;
+
+/* From ip_conntrack_proto_tcp.c */
+extern unsigned long ip_ct_tcp_timeout_syn_sent;
+extern unsigned long ip_ct_tcp_timeout_syn_recv;
+extern unsigned long ip_ct_tcp_timeout_established;
+extern unsigned long ip_ct_tcp_timeout_fin_wait;
+extern unsigned long ip_ct_tcp_timeout_close_wait;
+extern unsigned long ip_ct_tcp_timeout_last_ack;
+extern unsigned long ip_ct_tcp_timeout_time_wait;
+extern unsigned long ip_ct_tcp_timeout_close;
+
+/* From ip_conntrack_proto_udp.c */
+extern unsigned long ip_ct_udp_timeout;
+extern unsigned long ip_ct_udp_timeout_stream;
+
+/* From ip_conntrack_proto_icmp.c */
+extern unsigned long ip_ct_icmp_timeout;
+
+/* From ip_conntrack_proto_icmp.c */
+extern unsigned long ip_ct_generic_timeout;
+
+static struct ctl_table_header *ip_ct_sysctl_header;
+
+static ctl_table ip_ct_sysctl_table[] = {
+	{
+		.ctl_name	= NET_IPV4_NF_CONNTRACK_MAX, 
+		.procname	= "ip_conntrack_max",
+	 	.data		= &ip_conntrack_max, 
+	 	.maxlen		= sizeof(ip_conntrack_max), 
+	 	.mode		= 0644,
+	 	.proc_handler	= &proc_dointvec
+	},
+	{	.ctl_name	= NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_SYN_SENT,
+		.procname	= "ip_conntrack_tcp_timeout_syn_sent",
+	 	.data		= &ip_ct_tcp_timeout_syn_sent, 
+	 	.maxlen		= sizeof(ip_ct_tcp_timeout_syn_sent), 
+	 	.mode		= 0644,
+	 	.proc_handler	= &proc_dointvec_jiffies
+	},
+	{	.ctl_name	= NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_SYN_RECV,
+		.procname	= "ip_conntrack_tcp_timeout_syn_recv",
+	 	.data		= &ip_ct_tcp_timeout_syn_recv,
+	 	.maxlen		= sizeof(ip_ct_tcp_timeout_syn_recv),
+	 	.mode		= 0644,
+	 	.proc_handler	= &proc_dointvec_jiffies
+	},
+	{	.ctl_name	= NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_ESTABLISHED,
+		.procname	= "ip_conntrack_tcp_timeout_established",
+	 	.data		= &ip_ct_tcp_timeout_established,
+	 	.maxlen		= sizeof(ip_ct_tcp_timeout_established),
+	 	.mode		= 0644,
+	 	.proc_handler	= &proc_dointvec_jiffies
+	},
+	{	.ctl_name	= NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_FIN_WAIT,
+		.procname	= "ip_conntrack_tcp_timeout_fin_wait",
+	 	.data		= &ip_ct_tcp_timeout_fin_wait,
+	 	.maxlen		= sizeof(ip_ct_tcp_timeout_fin_wait),
+	 	.mode 		= 0644,
+		.proc_handler	= &proc_dointvec_jiffies
+	},
+	{	.ctl_name	= NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_CLOSE_WAIT,
+		.procname	= "ip_conntrack_tcp_timeout_close_wait",
+	 	.data		= &ip_ct_tcp_timeout_close_wait,
+	 	.maxlen		= sizeof(ip_ct_tcp_timeout_close_wait),
+	 	.mode		= 0644,
+	 	.proc_handler	= &proc_dointvec_jiffies
+	},
+	{	.ctl_name	= NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_LAST_ACK,
+		.procname	= "ip_conntrack_tcp_timeout_last_ack",
+	 	.data		= &ip_ct_tcp_timeout_last_ack, 
+	 	.maxlen		= sizeof(ip_ct_tcp_timeout_last_ack), 
+	 	.mode		= 0644,
+	 	.proc_handler	= &proc_dointvec_jiffies
+	},
+	{	.ctl_name	= NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_TIME_WAIT,
+		.procname	= "ip_conntrack_tcp_timeout_time_wait",
+	 	.data		= &ip_ct_tcp_timeout_time_wait,
+	 	.maxlen		= sizeof(ip_ct_tcp_timeout_time_wait),
+	 	.mode		= 0644,
+	 	.proc_handler	= &proc_dointvec_jiffies
+	},
+	{	.ctl_name	= NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_CLOSE,
+		.procname	= "ip_conntrack_tcp_timeout_close",
+	 	.data		= &ip_ct_tcp_timeout_close,
+	 	.maxlen		= sizeof(ip_ct_tcp_timeout_close),
+	 	.mode		= 0644,
+	 	.proc_handler	= &proc_dointvec_jiffies
+	},
+	{	.ctl_name	= NET_IPV4_NF_CONNTRACK_UDP_TIMEOUT,
+		.procname	= "ip_conntrack_udp_timeout",
+	 	.data		= &ip_ct_udp_timeout,
+	 	.maxlen		= sizeof(ip_ct_udp_timeout),
+	 	.mode		= 0644,
+	 	.proc_handler	= &proc_dointvec_jiffies
+	},
+	{	.ctl_name	= NET_IPV4_NF_CONNTRACK_UDP_TIMEOUT_STREAM,
+		.procname	= "ip_conntrack_udp_timeout_stream",
+	 	.data		= &ip_ct_udp_timeout_stream,
+	 	.maxlen		= sizeof(ip_ct_udp_timeout_stream),
+	 	.mode		= 0644,
+	 	.proc_handler	= &proc_dointvec_jiffies
+	},
+	{	.ctl_name	= NET_IPV4_NF_CONNTRACK_ICMP_TIMEOUT,
+		.procname	= "ip_conntrack_icmp_timeout",
+	 	.data		= &ip_ct_icmp_timeout,
+	 	.maxlen		= sizeof(ip_ct_icmp_timeout),
+	 	.mode		= 0644,
+	 	.proc_handler	= &proc_dointvec_jiffies
+	},
+	{	.ctl_name	= NET_IPV4_NF_CONNTRACK_GENERIC_TIMEOUT,
+		.procname	= "ip_conntrack_generic_timeout",
+	 	.data		= &ip_ct_generic_timeout,
+	 	.maxlen		= sizeof(ip_ct_generic_timeout),
+	 	.mode		= 0644,
+	 	.proc_handler	= &proc_dointvec_jiffies
+	},
+	{	.ctl_name	= 0 }
+};
+
+static ctl_table ip_ct_netfilter_table[] = {
+	{	.ctl_name	= NET_IPV4_NETFILTER,
+		.procname	= "netfilter",
+		.mode		= 0555,
+		.child		= ip_ct_sysctl_table
+	},
+	{	.ctl_name	= 0 }
+};
+
+static ctl_table ip_ct_ipv4_table[] = {
+	{	.ctl_name	= NET_IPV4,
+		.procname	= "ipv4",
+		.mode		= 0555,
+		.child		= ip_ct_netfilter_table
+	},
+	{	.ctl_name	= 0 }
+};
+
+static ctl_table ip_ct_net_table[] = {
+	{	.ctl_name	= CTL_NET,
+		.procname	= "net",
+		.mode		= 0555,
+		.child		= ip_ct_ipv4_table,
+	},
+	{	.ctl_name	= 0}
+};
+#endif
 static int init_or_cleanup(int init)
 {
 	struct proc_dir_entry *proc;
@@ -270,7 +427,11 @@
 		goto cleanup_nothing;
 
 	proc = proc_net_create("ip_conntrack",0,list_conntracks);
-	if (!proc) goto cleanup_init;
+	if (!proc) {
+		printk("ip_conntrack: can't register to proc.\n");
+		ret = -EBUSY;
+		goto cleanup_init;
+	}
 	proc->owner = THIS_MODULE;
 
 	ret = nf_register_hook(&ip_conntrack_in_ops);
@@ -293,10 +454,22 @@
 		printk("ip_conntrack: can't register local in hook.\n");
 		goto cleanup_inoutandlocalops;
 	}
+#ifdef CONFIG_SYSCTL
+	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");
+		ret = -EBUSY;
+		goto cleanup_hooks;
+	}
+#endif
 
 	return ret;
 
  cleanup:
+#ifdef CONFIG_SYSCTL
+ 	unregister_sysctl_table(ip_ct_sysctl_header);
+#endif
+ cleanup_hooks:
 	nf_unregister_hook(&ip_conntrack_local_in_ops);
  cleanup_inoutandlocalops:
 	nf_unregister_hook(&ip_conntrack_out_ops);
