1 Star 0 Fork 15

DengXiewei/iptables

forked from src-anolis-os/iptables 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0023-nft-cache-Reset-genid-when-rebuilding-cache.patch 1.17 KB
一键复制 编辑 原始数据 按行查看 历史
geliwei 提交于 2021-06-16 16:13 . update to iptables-1.8.4-17.el8.src.rpm
From 3b98024d952d265d50078c5b7ad04c9c65373733 Mon Sep 17 00:00:00 2001
From: Phil Sutter <psutter@redhat.com>
Date: Fri, 29 May 2020 19:33:22 +0200
Subject: [PATCH] nft: cache: Reset genid when rebuilding cache
This is required in order to avoid a cache rebuild loop if
iptables-nft-restore is called with '--test' parameter and a dump
containing more than a single table.
If non-zero, __nft_build_cache() never updates genid and therefore the
incorrect genid (caused by increment in nft_action()) is never
corrected.
This is a RHEL-only fix, upstream rewrote the whole cache logic which
implicitly resolved this problem.
Fixes: 200bc39965149 ("nft: cache: Fix iptables-save segfault under stress")
Signed-off-by: Phil Sutter <psutter@redhat.com>
---
iptables/nft-cache.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/iptables/nft-cache.c b/iptables/nft-cache.c
index 07265b7795e4f..bc6e7f7eaebfb 100644
--- a/iptables/nft-cache.c
+++ b/iptables/nft-cache.c
@@ -629,6 +629,7 @@ void nft_rebuild_cache(struct nft_handle *h)
if (h->cache_level)
__nft_flush_cache(h);
+ h->nft_genid = 0;
h->cache_level = NFT_CL_NONE;
__nft_build_cache(h, level, NULL, NULL, NULL);
}
--
2.26.2
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/dengxiewei/iptables.git
git@gitee.com:dengxiewei/iptables.git
dengxiewei
iptables
iptables
a8

搜索帮助