From: Andy Gay Date: Tue, 22 Aug 2006 02:56:41 +0000 (+0000) Subject: iptables -Z clears the per-rule counters, but not the chain policy counters (Andy... X-Git-Tag: v1.3.6~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e5bd1d779fab33353c1dc2d2fa49db639dcebd38;p=thirdparty%2Fiptables.git 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 --- 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;