|
|
00cd46 |
From 4d099f4c0866801e40e362090e6986c693386e2c Mon Sep 17 00:00:00 2001
|
|
|
00cd46 |
From: Eric Garver <eric@garver.life>
|
|
|
00cd46 |
Date: Thu, 27 Aug 2020 15:30:45 -0400
|
|
|
00cd46 |
Subject: [PATCH 50/62] fix(icmptype): when applying rules get ict from perm
|
|
|
00cd46 |
config
|
|
|
00cd46 |
|
|
|
00cd46 |
Otherwise we may get runtime errors because the running kernel doesn't
|
|
|
00cd46 |
support the ict. Use the permanent ict definition so we allow the case
|
|
|
00cd46 |
where ip6tables is missing or not available. Explicit usage of an ict
|
|
|
00cd46 |
not supported by the kernel will still fail to apply at runtime
|
|
|
00cd46 |
(iptables complains), but if ip6tables is missing we don't attempt to
|
|
|
00cd46 |
apply the ipv6 rules thus avoiding the issue.
|
|
|
00cd46 |
|
|
|
00cd46 |
(cherry picked from commit fdc44800aef4ec166987d529ffaea51f13ff54c2)
|
|
|
00cd46 |
(cherry picked from commit 0016ec8e4aefb6cf2a8986a91530eae25a28ead7)
|
|
|
00cd46 |
---
|
|
|
00cd46 |
src/firewall/core/fw_zone.py | 6 +++---
|
|
|
00cd46 |
1 file changed, 3 insertions(+), 3 deletions(-)
|
|
|
00cd46 |
|
|
|
00cd46 |
diff --git a/src/firewall/core/fw_zone.py b/src/firewall/core/fw_zone.py
|
|
|
00cd46 |
index b9fe1f6aae97..9d8bcf620251 100644
|
|
|
00cd46 |
--- a/src/firewall/core/fw_zone.py
|
|
|
00cd46 |
+++ b/src/firewall/core/fw_zone.py
|
|
|
00cd46 |
@@ -1526,7 +1526,7 @@ class FirewallZone(object):
|
|
|
00cd46 |
if rule.family:
|
|
|
00cd46 |
ipvs = [ rule.family ]
|
|
|
00cd46 |
elif rule.element and (isinstance(rule.element, Rich_IcmpBlock) or isinstance(rule.element, Rich_IcmpType)):
|
|
|
00cd46 |
- ict = self._fw.icmptype.get_icmptype(rule.element.name)
|
|
|
00cd46 |
+ ict = self._fw.config.get_icmptype(rule.element.name)
|
|
|
00cd46 |
if ict.destination:
|
|
|
00cd46 |
ipvs = [ipv for ipv in ["ipv4", "ipv6"] if ipv in ict.destination]
|
|
|
00cd46 |
|
|
|
00cd46 |
@@ -1698,7 +1698,7 @@ class FirewallZone(object):
|
|
|
00cd46 |
# ICMP BLOCK and ICMP TYPE
|
|
|
00cd46 |
elif type(rule.element) == Rich_IcmpBlock or \
|
|
|
00cd46 |
type(rule.element) == Rich_IcmpType:
|
|
|
00cd46 |
- ict = self._fw.icmptype.get_icmptype(rule.element.name)
|
|
|
00cd46 |
+ ict = self._fw.config.get_icmptype(rule.element.name)
|
|
|
00cd46 |
|
|
|
00cd46 |
if type(rule.element) == Rich_IcmpBlock and \
|
|
|
00cd46 |
rule.action and type(rule.action) == Rich_Accept:
|
|
|
00cd46 |
@@ -1862,7 +1862,7 @@ class FirewallZone(object):
|
|
|
00cd46 |
transaction.add_rules(backend, rules)
|
|
|
00cd46 |
|
|
|
00cd46 |
def _icmp_block(self, enable, zone, icmp, transaction):
|
|
|
00cd46 |
- ict = self._fw.icmptype.get_icmptype(icmp)
|
|
|
00cd46 |
+ ict = self._fw.config.get_icmptype(icmp)
|
|
|
00cd46 |
|
|
|
00cd46 |
if enable:
|
|
|
00cd46 |
transaction.add_chain(zone, "filter", "INPUT")
|
|
|
00cd46 |
--
|
|
|
00cd46 |
2.28.0
|
|
|
00cd46 |
|