Blame SOURCES/0055-fix-ipXtables-rich-avoid-duplicate-rules-for-icmp-ty.patch

725d6a
From d4f35b11f2edb1cf680ed2081a14b599ef3f3b63 Mon Sep 17 00:00:00 2001
725d6a
From: Eric Garver <eric@garver.life>
725d6a
Date: Mon, 31 Aug 2020 15:38:34 -0400
725d6a
Subject: [PATCH 55/62] fix(ipXtables): rich: avoid duplicate rules for
725d6a
 icmp-type w/ mark action
725d6a
725d6a
This is a stable only fix. It does not occur on master.
725d6a
725d6a
(cherry picked from commit 9b7ba2fcedace408aae498fea1c973a988370808)
725d6a
---
725d6a
 src/firewall/core/ipXtables.py | 7 ++++++-
725d6a
 1 file changed, 6 insertions(+), 1 deletion(-)
725d6a
725d6a
diff --git a/src/firewall/core/ipXtables.py b/src/firewall/core/ipXtables.py
725d6a
index b1d6c202fda7..c4535f2e5818 100644
725d6a
--- a/src/firewall/core/ipXtables.py
725d6a
+++ b/src/firewall/core/ipXtables.py
725d6a
@@ -1240,8 +1240,13 @@ class ip4tables(object):
725d6a
             proto = [ "-p", "ipv6-icmp" ]
725d6a
             match = [ "-m", "icmp6", "--icmpv6-type", ict.name ]
725d6a
 
725d6a
+        if rich_rule and rich_rule.action and isinstance(rich_rule.action, Rich_Mark):
725d6a
+            chains = ["PREROUTING"]
725d6a
+        else:
725d6a
+            chains = ["INPUT", "FORWARD_IN"]
725d6a
+
725d6a
         rules = []
725d6a
-        for chain in ["INPUT", "FORWARD_IN"]:
725d6a
+        for chain in chains:
725d6a
             target = DEFAULT_ZONE_TARGET.format(chain=SHORTCUTS[chain],
725d6a
                                                 zone=zone)
725d6a
             if self._fw.zone.query_icmp_block_inversion(zone):
725d6a
-- 
725d6a
2.28.0
725d6a