加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-fix-nftables-always-flush-main-table-on-start.patch 1.41 KB
一键复制 编辑 原始数据 按行查看 历史
From 6a155ea7195f2c720625e2452afa41544b4b4227 Mon Sep 17 00:00:00 2001
From: Eric Garver <eric@garver.life>
Date: Thu, 10 Aug 2023 08:43:03 -0400
Subject: [PATCH] fix(nftables): always flush main table on start
On start created_tables will not contain the main "firewalld" table so a
flush command is not issued. We should always attempt to flush. If
CleanupOnExit=no, then not flushing causes duplicate rules on restart.
Fixes: rhbz2222044
Conflict: NA
Reference: https://github.com/firewalld/firewalld/commit/6a155ea7195f2c720625e2452afa41544b4b4227
---
src/firewall/core/nftables.py | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/src/firewall/core/nftables.py b/src/firewall/core/nftables.py
index 975f1fa..f7f5bb0 100644
--- a/src/firewall/core/nftables.py
+++ b/src/firewall/core/nftables.py
@@ -410,12 +410,9 @@ class nftables(object):
self.policy_priority_counts = {}
self.zone_source_index_cache = {}
- rules = []
if TABLE_NAME in self.created_tables["inet"]:
- rules.append({"delete": {"table": {"family": "inet",
- "name": TABLE_NAME}}})
self.created_tables["inet"].remove(TABLE_NAME)
- return rules
+ return self._build_delete_table_rules(TABLE_NAME)
def _build_set_policy_rules_ct_rules(self, enable):
add_del = { True: "add", False: "delete" }[enable]
--
2.33.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化