about summary refs log tree commit diff
path: root/src/devices/nm-device.c
diff options
context:
space:
mode:
authorSebastien Bacher <seb128@ubuntu.com>2020-06-23 18:07:55 +0200
committerSebastien Bacher <seb128@ubuntu.com>2020-06-23 18:09:28 +0200
commit2b0b0375d38edd687055f84be895822801618c4a (patch)
treeacd3aab5044a9bc5950925161b591a08b6e60f53 /src/devices/nm-device.c
parent093c9db7b2a46e6042009e703e2e891abd2d2ba3 (diff)
parent5ed4e66e01b005212aee22c255c9c6b2a4b040a9 (diff)
Merge remote-tracking branch 'salsa/debian/master' into ubuntu/master
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);