1 Star 0 Fork 29

xh/iptables

forked from src-openEuler/iptables 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-fix-wrong-maptype-of-base-chain-counters-on-restore.patch 1.41 KB
一键复制 编辑 原始数据 按行查看 历史
yangl777 提交于 2024-04-18 08:59 . backport some patches from upstream
From 43f78733059ecd28d8567d8205cab5ed62d93458 Mon Sep 17 00:00:00 2001
From: Phil Sutter <phil@nwl.cc>
Date: Thu, 3 Aug 2023 17:59:03 +0200
Subject: 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.
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>
Conflict:NA
Reference:https://git.netfilter.org/iptables//commit/?id=43f78733059ecd28d8567d8205cab5ed62d93458
---
libiptc/libiptc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libiptc/libiptc.c b/libiptc/libiptc.c
index ceeb017..2deccd6 100644
--- a/libiptc/libiptc.c
+++ b/libiptc/libiptc.c
@@ -813,7 +813,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));
--
2.33.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/xinghe_1/iptables.git
git@gitee.com:xinghe_1/iptables.git
xinghe_1
iptables
iptables
master

搜索帮助

D67c1975 1850385 1daf7b77 1850385