about summary refs log tree commit diff
path: root/src/devices/nm-device.c
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2020-05-30 00:24:45 +0200
committerMichael Biebl <biebl@debian.org>2020-06-21 12:57:23 +0200
commit58a8f6b71c1cbd20fc4b67386ab030252a8cf3b3 (patch)
tree16e649a120dd8788f2be703732390567686133b9 /src/devices/nm-device.c
parent7d3ff20eeaa6c7db2503a0289a210b06030b33c5 (diff)
parent45e8e1149027529194982212c804c0468aa01d98 (diff)
Update upstream source from tag 'upstream/1.24.2'
Update to upstream version '1.24.2'
with Debian dir ccbabe9f55adb82b9a243cc1783c175e85723f60
Diffstat (limited to 'src/devices/nm-device.c')
-rw-r--r--src/devices/nm-device.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index 8a22cba8..76c24a38 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -10879,6 +10879,7 @@ fw_change_zone (NMDevice *self)
 	NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
 	NMConnection *applied_connection;
 	NMSettingConnection *s_con;
+	const char *zone;
 
 	nm_assert (priv->fw_state >= FIREWALL_STATE_INITIALIZED);
 
@@ -10896,9 +10897,19 @@ fw_change_zone (NMDevice *self)
 	if (G_UNLIKELY (!priv->fw_mgr))
 		priv->fw_mgr = g_object_ref (nm_firewall_manager_get ());
 
+	zone = nm_setting_connection_get_zone (s_con);
+#if WITH_FIREWALLD_ZONE
+	if (!zone || zone[0] == '\0') {
+		if (   nm_streq0 (nm_device_get_effective_ip_config_method (self, AF_INET),
+		                  NM_SETTING_IP4_CONFIG_METHOD_SHARED)
+		    || nm_streq0 (nm_device_get_effective_ip_config_method (self, AF_INET6),
+		                  NM_SETTING_IP6_CONFIG_METHOD_SHARED))
+			zone = "nm-shared";
+	}
+#endif
 	priv->fw_call = nm_firewall_manager_add_or_change_zone (priv->fw_mgr,
 	                                                        nm_device_get_ip_iface (self),
-	                                                        nm_setting_connection_get_zone (s_con),
+	                                                        zone,
 	                                                        FALSE, /* change zone */
 	                                                        fw_change_zone_cb,
 	                                                        self);