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