|
|
cbc1fa |
From f9e0fdd188e7730468bebdf35f573f2a1ef6bd9b Mon Sep 17 00:00:00 2001
|
|
|
cbc1fa |
From: Eric Garver <eric@garver.life>
|
|
|
cbc1fa |
Date: Tue, 2 Aug 2022 13:11:31 -0400
|
|
|
cbc1fa |
Subject: [PATCH 4/5] fix(runtimeToPermanent): errors for interfaces not in
|
|
|
cbc1fa |
zone
|
|
|
cbc1fa |
|
|
|
cbc1fa |
We should only consider the interfaces for the currently iterated over
|
|
|
cbc1fa |
zone. Otherwise we will attempt to remove an interface from a zone for
|
|
|
cbc1fa |
which it is does not belong.
|
|
|
cbc1fa |
|
|
|
cbc1fa |
Note this only occurs when NetworkManager is running.
|
|
|
cbc1fa |
|
|
|
cbc1fa |
Fixes: #976
|
|
|
cbc1fa |
Fixes: rhbz2112982
|
|
|
cbc1fa |
(cherry picked from commit 15f47354c4a078dc694df1541550b3e5156548fc)
|
|
|
cbc1fa |
---
|
|
|
cbc1fa |
src/firewall/server/firewalld.py | 9 +++++----
|
|
|
cbc1fa |
1 file changed, 5 insertions(+), 4 deletions(-)
|
|
|
cbc1fa |
|
|
|
cbc1fa |
diff --git a/src/firewall/server/firewalld.py b/src/firewall/server/firewalld.py
|
|
|
cbc1fa |
index 5cf963dfbbd4..f5f902d6e712 100644
|
|
|
cbc1fa |
--- a/src/firewall/server/firewalld.py
|
|
|
cbc1fa |
+++ b/src/firewall/server/firewalld.py
|
|
|
cbc1fa |
@@ -447,10 +447,11 @@ class FirewallD(DbusServiceObject):
|
|
|
cbc1fa |
conf = self.getZoneSettings2(name)
|
|
|
cbc1fa |
settings = FirewallClientZoneSettings(conf)
|
|
|
cbc1fa |
changed = False
|
|
|
cbc1fa |
- for interface in self.fw._nm_assigned_interfaces:
|
|
|
cbc1fa |
- log.debug1("Zone '%s': interface binding for '%s' has been added by NM, ignoring." % (name, interface))
|
|
|
cbc1fa |
- settings.removeInterface(interface)
|
|
|
cbc1fa |
- changed = True
|
|
|
cbc1fa |
+ for interface in settings.getInterfaces():
|
|
|
cbc1fa |
+ if interface in self.fw._nm_assigned_interfaces:
|
|
|
cbc1fa |
+ log.debug1("Zone '%s': interface binding for '%s' has been added by NM, ignoring." % (name, interface))
|
|
|
cbc1fa |
+ settings.removeInterface(interface)
|
|
|
cbc1fa |
+ changed = True
|
|
|
cbc1fa |
# For the remaining interfaces, attempt to let NM manage them
|
|
|
cbc1fa |
for interface in settings.getInterfaces():
|
|
|
cbc1fa |
try:
|
|
|
cbc1fa |
--
|
|
|
cbc1fa |
2.31.1
|
|
|
cbc1fa |
|