Blame SOURCES/0003-firewall.core.fw_nm-ignore-generated-connections.patch

15ccd1
From a3e6d2c48a1535b56bc5f28094818f10f93bf352 Mon Sep 17 00:00:00 2001
15ccd1
From: Lubomir Rintel <lkundrak@v3.sk>
15ccd1
Date: Mon, 16 Jul 2018 17:43:25 +0200
15ccd1
Subject: [PATCH 3/3] firewall.core.fw_nm: ignore generated connections
15ccd1
15ccd1
If a connection is generated by NetworkManager, changing it persists it and
15ccd1
makes the device managed by NetworkManager.
15ccd1
15ccd1
(cherry picked from commit a102dde5d9430d503767cbface3e3b610134bdb6)
15ccd1
---
15ccd1
 src/firewall/core/fw_nm.py | 10 ++++++++++
15ccd1
 1 file changed, 10 insertions(+)
15ccd1
15ccd1
diff --git a/src/firewall/core/fw_nm.py b/src/firewall/core/fw_nm.py
15ccd1
index d21cc25feb8b..0ed19248a79f 100644
15ccd1
--- a/src/firewall/core/fw_nm.py
15ccd1
+++ b/src/firewall/core/fw_nm.py
15ccd1
@@ -148,6 +148,16 @@ def nm_get_connection_of_interface(interface):
15ccd1
     if active_con is None:
15ccd1
         return None
15ccd1
 
15ccd1
+    try:
15ccd1
+        con = active_con.get_connection()
15ccd1
+        if con.get_flags() & NM.SettingsConnectionFlags.NM_GENERATED:
15ccd1
+            return None
15ccd1
+    except AttributeError:
15ccd1
+        # Prior to NetworkManager 1.12, we can only guess
15ccd1
+        # that a connection was generated.
15ccd1
+        if con.get_unsaved():
15ccd1
+            return None
15ccd1
+
15ccd1
     return active_con.get_uuid()
15ccd1
 
15ccd1
 def nm_get_bus_name():
15ccd1
-- 
15ccd1
2.16.3
15ccd1