Skip to contentSkip to conversation

Revert "libiptc: fix wrong maptype of base chain counters on restore"

PATCH New Phil Sutter 1 participant 1 message Aug 3, 2023 netfilter

lore
Share & tools
lore

Phil Sutter

author reviewer
#0 lore raw

PATCH 1/1 Revert "libiptc: fix wrong maptype of base chain counters on restore"

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.

Fixes 7c4d668c9c2ee ("libiptc: fix wrong maptype of base chain counters on restore")
---
 libiptc/libiptc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
libiptc/libiptc.c +1 -1
index f9b7779efdba5..29ff356f2324e 100644
@@ -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));
Signature · 1 line
2.40.0