Skip to contentSkip to conversation

Update ip_conntrack_count in kernel 2.6

PATCH Samir Bellabes 1 participant 1 message Aug 15, 2004

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

Hi Harald,

The ip_conntrack_count patch is broken with the last kernel 2.6.8. This patch, which do the same thing, applies correctly.

thanks.

Signature · 2 lines
samir bellabes
[email protected]
include/linux/sysctl.h +1 -0
diff -Nru --exclude '*~' linux-2.6.8/include/linux/sysctl.h linux-2.6.8-conntrack_count/include/linux/sysctl.h
@@ -410,6 +410,7 @@
 	NET_IPV4_NF_CONNTRACK_ICMP_TIMEOUT=12,
 	NET_IPV4_NF_CONNTRACK_GENERIC_TIMEOUT=13,
 	NET_IPV4_NF_CONNTRACK_BUCKETS=14,
+	NET_IPV4_NF_CONNTRACK_COUNT=15,
 };
  
 /* /proc/sys/net/ipv6 */
net/ipv4/netfilter/ip_conntrack_core.c +1 -1
diff -Nru --exclude '*~' linux-2.6.8/net/ipv4/netfilter/ip_conntrack_core.c linux-2.6.8-conntrack_count/net/ipv4/netfilter/ip_conntrack_core.c
@@ -65,7 +65,7 @@
 static LIST_HEAD(helpers);
 unsigned int ip_conntrack_htable_size = 0;
 int ip_conntrack_max;
-static atomic_t ip_conntrack_count = ATOMIC_INIT(0);
+atomic_t ip_conntrack_count = ATOMIC_INIT(0);
 struct list_head *ip_conntrack_hash;
 static kmem_cache_t *ip_conntrack_cachep;
 struct ip_conntrack ip_conntrack_untracked;
net/ipv4/netfilter/ip_conntrack_standalone.c +9 -0
diff -Nru --exclude '*~' linux-2.6.8/net/ipv4/netfilter/ip_conntrack_standalone.c linux-2.6.8-conntrack_count/net/ipv4/netfilter/ip_conntrack_standalone.c
@@ -312,6 +312,7 @@
 
 /* From ip_conntrack_core.c */
 extern int ip_conntrack_max;
+extern atomic_t ip_conntrack_count;
 extern unsigned int ip_conntrack_htable_size;
 
 /* From ip_conntrack_proto_tcp.c */
@@ -346,6 +347,14 @@
 		.proc_handler	= &proc_dointvec,
 	},
 	{
+		.ctl_name	= NET_IPV4_NF_CONNTRACK_COUNT,
+		.procname	= "ip_conntrack_count",
+		.data		= &ip_conntrack_count,
+		.maxlen		= sizeof(int),
+		.mode		= 0444,
+		.proc_handler	= &proc_dointvec,
+	},
+	{
 		.ctl_name	= NET_IPV4_NF_CONNTRACK_BUCKETS,
 		.procname	= "ip_conntrack_buckets",
 		.data		= &ip_conntrack_htable_size,