Blame SOURCES/0107-fix-ebtables-don-t-use-tables-that-aren-t-available.patch

c8bceb
From 3e4c68e79f8b654020a9abac14889d7cb34dad75 Mon Sep 17 00:00:00 2001
c8bceb
From: Eric Garver <eric@garver.life>
c8bceb
Date: Fri, 20 Sep 2019 08:47:22 -0400
c8bceb
Subject: [PATCH 107/109] fix: ebtables: don't use tables that aren't available
c8bceb
c8bceb
(cherry picked from commit 53fa559352156ae4c33613e2e45eb5355e1e86b9)
c8bceb
(cherry picked from commit 3b7dd4993f18c9090f3c307fd40919cc8b2616bc)
c8bceb
---
c8bceb
 src/firewall/core/ebtables.py | 4 ++++
c8bceb
 1 file changed, 4 insertions(+)
c8bceb
c8bceb
diff --git a/src/firewall/core/ebtables.py b/src/firewall/core/ebtables.py
c8bceb
index 65688571ce31..b17e43dadf20 100644
c8bceb
--- a/src/firewall/core/ebtables.py
c8bceb
+++ b/src/firewall/core/ebtables.py
c8bceb
@@ -229,6 +229,8 @@ class ebtables(object):
c8bceb
     def build_flush_rules(self):
c8bceb
         rules = []
c8bceb
         for table in BUILT_IN_CHAINS.keys():
c8bceb
+            if table not in self.get_available_tables():
c8bceb
+                continue
c8bceb
             # Flush firewall rules: -F
c8bceb
             # Delete firewall chains: -X
c8bceb
             # Set counter to zero: -Z
c8bceb
@@ -239,6 +241,8 @@ class ebtables(object):
c8bceb
     def build_set_policy_rules(self, policy):
c8bceb
         rules = []
c8bceb
         for table in BUILT_IN_CHAINS.keys():
c8bceb
+            if table not in self.get_available_tables():
c8bceb
+                continue
c8bceb
             for chain in BUILT_IN_CHAINS[table]:
c8bceb
                 rules.append(["-t", table, "-P", chain, policy])
c8bceb
         return rules
c8bceb
-- 
c8bceb
2.20.1
c8bceb