Blame SOURCES/0019-fix-fw-when-checking-tables-make-sure-to-check-the-a.patch

e9ad3f
From 0ada4672b42c426de1ffc7f3ae2416629225369f Mon Sep 17 00:00:00 2001
e9ad3f
From: Eric Garver <eric@garver.life>
e9ad3f
Date: Mon, 15 Feb 2021 09:53:02 -0500
e9ad3f
Subject: [PATCH 19/22] fix(fw): when checking tables make sure to check the
e9ad3f
 actual backend
e9ad3f
e9ad3f
Calling get_backend_by_ipv() will return nftables if we're using
e9ad3f
nftables backend, but we really need to check if iptables, et al. are
e9ad3f
available.
e9ad3f
e9ad3f
(cherry picked from commit 48d97fb40929afbc1b0bc82759ad75b1937f6e3f)
e9ad3f
(cherry picked from commit fba59a99735ec46d787141350564137abfec0c87)
e9ad3f
---
e9ad3f
 src/firewall/core/fw.py | 12 ++++++------
e9ad3f
 1 file changed, 6 insertions(+), 6 deletions(-)
e9ad3f
e9ad3f
diff --git a/src/firewall/core/fw.py b/src/firewall/core/fw.py
e9ad3f
index 15284a4929e9..3eb54e37ab5c 100644
e9ad3f
--- a/src/firewall/core/fw.py
e9ad3f
+++ b/src/firewall/core/fw.py
e9ad3f
@@ -131,18 +131,18 @@ class Firewall(object):
e9ad3f
     def _check_tables(self):
e9ad3f
         # check if iptables, ip6tables and ebtables are usable, else disable
e9ad3f
         if self.ip4tables_enabled and \
e9ad3f
-           "filter" not in self.get_backend_by_ipv("ipv4").get_available_tables():
e9ad3f
-            log.warning("iptables not usable, disabling IPv4 firewall.")
e9ad3f
+           "filter" not in self.ip4tables_backend.get_available_tables():
e9ad3f
+            log.info1("iptables is not usable.")
e9ad3f
             self.ip4tables_enabled = False
e9ad3f
 
e9ad3f
         if self.ip6tables_enabled and \
e9ad3f
-           "filter" not in self.get_backend_by_ipv("ipv6").get_available_tables():
e9ad3f
-            log.warning("ip6tables not usable, disabling IPv6 firewall.")
e9ad3f
+           "filter" not in self.ip6tables_backend.get_available_tables():
e9ad3f
+            log.info1("ip6tables is not usable.")
e9ad3f
             self.ip6tables_enabled = False
e9ad3f
 
e9ad3f
         if self.ebtables_enabled and \
e9ad3f
-           "filter" not in self.get_backend_by_ipv("eb").get_available_tables():
e9ad3f
-            log.warning("ebtables not usable, disabling ethernet bridge firewall.")
e9ad3f
+           "filter" not in self.ebtables_backend.get_available_tables():
e9ad3f
+            log.info1("ebtables is not usable.")
e9ad3f
             self.ebtables_enabled = False
e9ad3f
 
e9ad3f
         # is there at least support for ipv4 or ipv6
e9ad3f
-- 
e9ad3f
2.27.0
e9ad3f