summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nm-manager.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/nm-manager.c b/src/nm-manager.c
index 8beb734c61..55330ea594 100644
--- a/src/nm-manager.c
+++ b/src/nm-manager.c
@@ -129,7 +129,6 @@ static void impl_manager_check_connectivity (NMManager *manager,
#include "nm-manager-glue.h"
static void add_device (NMManager *self, NMDevice *device, gboolean generate_con);
-static void remove_device (NMManager *self, NMDevice *device, gboolean quitting);
static NMActiveConnection *_new_active_connection (NMManager *self,
NMConnection *connection,
@@ -742,11 +741,14 @@ device_has_pending_action_changed (NMDevice *device,
}
static void
-remove_device (NMManager *manager, NMDevice *device, gboolean quitting)
+remove_device (NMManager *manager,
+ NMDevice *device,
+ gboolean quitting,
+ gboolean allow_unmanage)
{
NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (manager);
- if (nm_device_get_managed (device)) {
+ if (allow_unmanage && nm_device_get_managed (device)) {
NMActRequest *req = nm_device_get_act_request (device);
gboolean unmanage = FALSE;
@@ -787,7 +789,7 @@ remove_device (NMManager *manager, NMDevice *device, gboolean quitting)
static void
device_removed_cb (NMDevice *device, gpointer user_data)
{
- remove_device (NM_MANAGER (user_data), device, FALSE);
+ remove_device (NM_MANAGER (user_data), device, FALSE, TRUE);
}
static void
@@ -1733,7 +1735,7 @@ add_device (NMManager *self, NMDevice *device, gboolean generate_con)
remove = g_slist_prepend (remove, iter->data);
}
for (iter = remove; iter; iter = iter->next)
- remove_device (self, NM_DEVICE (iter->data), FALSE);
+ remove_device (self, NM_DEVICE (iter->data), FALSE, FALSE);
g_slist_free (remove);
priv->devices = g_slist_append (priv->devices, g_object_ref (device));
@@ -2200,7 +2202,7 @@ platform_link_cb (NMPlatform *platform,
device = find_device_by_ifindex (self, ifindex);
if (device)
- remove_device (self, device, FALSE);
+ remove_device (self, device, FALSE, TRUE);
break;
}
default:
@@ -5003,7 +5005,7 @@ dispose (GObject *object)
/* Remove all devices */
while (priv->devices)
- remove_device (manager, NM_DEVICE (priv->devices->data), TRUE);
+ remove_device (manager, NM_DEVICE (priv->devices->data), TRUE, TRUE);
if (priv->ac_cleanup_id) {
g_source_remove (priv->ac_cleanup_id);