24f428
From 64d043d8a4fcb1aa9ab0dcfc7c52061cb080e6b9 Mon Sep 17 00:00:00 2001
24f428
From: Eric Garver <e@erig.me>
24f428
Date: Mon, 17 Dec 2018 12:53:30 -0500
24f428
Subject: [PATCH 14/23] nftables: Allow interfaces with wildcards
24f428
24f428
Fixes: rhbz 1644025
24f428
(cherry picked from commit aa01eda4c87dd7b5c1f1e884fc7332c6317fed02)
24f428
---
24f428
 src/firewall/core/nftables.py | 7 +++++--
24f428
 1 file changed, 5 insertions(+), 2 deletions(-)
24f428
24f428
diff --git a/src/firewall/core/nftables.py b/src/firewall/core/nftables.py
24f428
index a1cb2c474737..50303e94ed7b 100644
24f428
--- a/src/firewall/core/nftables.py
24f428
+++ b/src/firewall/core/nftables.py
24f428
@@ -475,6 +475,9 @@ class nftables(object):
24f428
             "OUTPUT": "oifname",
24f428
         }[chain]
24f428
 
24f428
+        if interface[len(interface)-1] == "+":
24f428
+            interface = interface[:len(interface)-1] + "*"
24f428
+
24f428
         target = DEFAULT_ZONE_TARGET.format(chain=SHORTCUTS[chain], zone=zone)
24f428
         if zone_target == DEFAULT_ZONE_TARGET:
24f428
             action = "goto"
24f428
@@ -486,10 +489,10 @@ class nftables(object):
24f428
             rule = ["add", "rule", family, "%s" % TABLE_NAME, "%s_%s_ZONES" % (table, chain)]
24f428
         else:
24f428
             rule = ["delete", "rule", family, "%s" % TABLE_NAME, "%s_%s_ZONES" % (table, chain)]
24f428
-        if interface == "+":
24f428
+        if interface == "*":
24f428
             rule += [action, "%s_%s" % (table, target)]
24f428
         else:
24f428
-            rule += [opt, interface, action, "%s_%s" % (table, target)]
24f428
+            rule += [opt, "\"" + interface + "\"", action, "%s_%s" % (table, target)]
24f428
         return [rule]
24f428
 
24f428
     def build_zone_source_address_rules(self, enable, zone, zone_target,
24f428
-- 
24f428
2.20.1
24f428