]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
Revert "libiptc: fix wrong maptype of base chain counters on restore"
authorPhil Sutter <phil@nwl.cc>
Thu, 3 Aug 2023 15:59:03 +0000 (17:59 +0200)
committerPhil Sutter <phil@nwl.cc>
Thu, 10 Aug 2023 12:14:39 +0000 (14:14 +0200)
This reverts commit 7c4d668c9c2ee007c82063b7fc784cbbf46b2ec4.

The change can't be right: A simple rule append call will reset all
built-in chains' counters. The old code works fine even given the
mentioned "empty restore" use-case, at least if counters don't change on
the fly in-kernel.

Closes: https://bugzilla.netfilter.org/show_bug.cgi?id=912
Fixes: 7c4d668c9c2ee ("libiptc: fix wrong maptype of base chain counters on restore")
Signed-off-by: Phil Sutter <phil@nwl.cc>
libiptc/libiptc.c

index f9b7779efdba52a4c2b1ce152dc7275cf9bd0648..29ff356f2324e7a58cb372999dd9fa3bee8b2dce 100644 (file)
@@ -822,7 +822,7 @@ static int __iptcc_p_del_policy(struct xtc_handle *h, unsigned int num)
 
                /* save counter and counter_map information */
                h->chain_iterator_cur->counter_map.maptype =
-                                               COUNTER_MAP_ZEROED;
+                                               COUNTER_MAP_NORMAL_MAP;
                h->chain_iterator_cur->counter_map.mappos = num-1;
                memcpy(&h->chain_iterator_cur->counters, &pr->entry->counters,
                        sizeof(h->chain_iterator_cur->counters));