Skip to contentSkip to conversation

/proc/net/ip_conntrack does not list all connections

PATCH yihyung 3 participants 3 messages Nov 23, 2002 – Dec 5, 2002

Subsystems (2)
lore
Share & tools
lore

yihyung

author
#0 lore raw

I made a patch to fix it for my 2.4.19 kernel.

Yih Yung

net/ipv4/netfilter/ip_conntrack_standalone.c +4 -1
diff -ur linux-2.4.19-old/net/ipv4/netfilter/ip_conntrack_standalone.c linux-2.4.19-new/net/ipv4/netfilter/ip_conntrack_standalone.c
@@ -122,8 +122,10 @@
 		return 0;
 
 	newlen = print_conntrack(buffer + *len, hash->ctrack);
-	if (*len + newlen > maxlen)
+	if (*len + newlen > maxlen) {
+		-- * upto;
 		return 1;
+	}
 	else *len += newlen;
 
 	return 0;
@@ -157,6 +159,7 @@
 		len += print_expect(buffer + len, expect);
 		if (len > length) {
 			len = last_len;
+			-- upto;
 			goto finished;
 		}
 	}
#2 lore raw
Quoted 9 lines · Philip Craig
Quoted 1 line · yihyung

I made a patch to fix it for my 2.4.19 kernel.

/proc/net/ip_masquerade has similar problems, as does /proc/net/ip_tables_names (although you will probably never have enough table names for that one to occur). I posted a patch for these a while ago:

http://lists.netfilter.org/pipermail/netfilter-devel/2002-February/006716.htm

thanks for pointing this out. I simply missed it. Please try pushing this again as soon as you think something was missed.

I'll put it in the pending repository of pom now.

Signature · 5 lines
Live long and prosper
- Harald Welte / [email protected]               http://www.gnumonks.org/
============================================================================
GCS/E/IT d- s-: a-- C+++ UL++++$ P+++ L++++$ E--- W- N++ o? K- w--- O- M- 
V-- PS+ PE-- Y+ PGP++ t++ 5-- !X !R tv-- b+++ DI? !D G+ e* h+ r% y+(*)