summary refs log tree commit diff
path: root/src/nm-manager.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nm-manager.c')
-rw-r--r--src/nm-manager.c33
1 files changed, 21 insertions, 12 deletions
diff --git a/src/nm-manager.c b/src/nm-manager.c
index 9f0891a7..c6d82c9d 100644
--- a/src/nm-manager.c
+++ b/src/nm-manager.c
@@ -1558,6 +1558,12 @@ again:
 	}
 }
 
+static gboolean
+device_is_wake_on_lan (NMPlatform *platform, NMDevice *device)
+{
+	return nm_platform_link_get_wake_on_lan (platform, nm_device_get_ip_ifindex (device));
+}
+
 static void
 remove_device (NMManager *self,
                NMDevice *device,
@@ -1567,14 +1573,19 @@ remove_device (NMManager *self,
 	NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self);
 	gboolean unmanage = FALSE;
 
-	_LOG2D (LOGD_DEVICE, device, "removing device (allow_unmanage %d, managed %d)",
-	        allow_unmanage, nm_device_get_managed (device, FALSE));
+	_LOG2D (LOGD_DEVICE, device, "removing device (allow_unmanage %d, managed %d, wol %d)",
+	        allow_unmanage, nm_device_get_managed (device, FALSE),
+	        device_is_wake_on_lan (priv->platform, device));
 
 	if (allow_unmanage && nm_device_get_managed (device, FALSE)) {
 
-		if (quitting)
-			unmanage = nm_device_unmanage_on_quit (device);
-		else {
+		if (quitting) {
+			/* Leave configured if wo(w)lan and quitting */
+			if (device_is_wake_on_lan (priv->platform, device))
+				unmanage = FALSE;
+			else
+				unmanage = nm_device_unmanage_on_quit (device);
+		} else {
 			/* the device is already gone. Unmanage it. */
 			unmanage = TRUE;
 		}
@@ -4747,12 +4758,16 @@ impl_manager_activate_connection (NMDBusObject *obj,
 	if (!active)
 		goto error;
 
-	nm_active_connection_authorize (g_steal_pointer (&active),
+	nm_active_connection_authorize (active,
 	                                NULL,
 	                                _async_op_complete_ac_auth_cb,
 	                                _async_op_data_new_ac_auth_activate_user (self,
 	                                                                          active,
 	                                                                          invocation));
+
+	/* we passed the pointer on to _async_op_data_new_ac_auth_activate_user() */
+	g_steal_pointer (&active);
+
 	return;
 
 error:
@@ -5135,12 +5150,6 @@ done:
 }
 
 static gboolean
-device_is_wake_on_lan (NMPlatform *platform, NMDevice *device)
-{
-	return nm_platform_link_get_wake_on_lan (platform, nm_device_get_ip_ifindex (device));
-}
-
-static gboolean
 sleep_devices_add (NMManager *self, NMDevice *device, gboolean suspending)
 {
 	NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self);