OSDN Git Service

Correct the upto value during list conntrack information
authorXiong Wu <xiong_wu@cpsecure.com>
Fri, 4 Jul 2008 11:21:15 +0000 (13:21 +0200)
committerWilly Tarreau <w@1wt.eu>
Sun, 20 Jul 2008 17:13:34 +0000 (19:13 +0200)
The problem:
When list numerous conntrack information from /proc/net/ip_conntrack,
we found some items are missing.

The solution:
This patch correct the upto value in conntrack_iterate() when the length
of conntrack information exceed the max length.

Cc: Patrick McHardy <kaber@trash.net>
Cc: coreteam@netfilter.org
Signed-off-by: Willy Tarreau <w@1wt.eu>
net/ipv4/netfilter/ip_conntrack_standalone.c

index c64a3a7..8ca7334 100644 (file)
@@ -131,8 +131,11 @@ conntrack_iterate(const struct ip_conntrack_tuple_hash *hash,
                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;