From e5bd1d779fab33353c1dc2d2fa49db639dcebd38 Mon Sep 17 00:00:00 2001 From: Andy Gay Date: Tue, 22 Aug 2006 02:56:41 +0000 Subject: iptables -Z clears the per-rule counters, but not the chain policy counters (Andy Gay ) https://bugzilla.netfilter.org/bugzilla/show_bug.cgi?id=502 --- libiptc/libiptc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libiptc/libiptc.c b/libiptc/libiptc.c index 779df34b..feb4379c 100644 --- a/libiptc/libiptc.c +++ b/libiptc/libiptc.c @@ -1656,6 +1656,9 @@ TC_ZERO_ENTRIES(const IPT_CHAINLABEL chain, TC_HANDLE_T *handle) return 0; } + if (c->counter_map.maptype == COUNTER_MAP_NORMAL_MAP) + c->counter_map.maptype = COUNTER_MAP_ZEROED; + list_for_each_entry(r, &c->rules, list) { if (r->counter_map.maptype == COUNTER_MAP_NORMAL_MAP) r->counter_map.maptype = COUNTER_MAP_ZEROED; -- cgit v1.2.3