From 46295e8fa1b45fdca5a2864435cbfd5e9676feaa Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Thu, 24 Oct 2013 12:36:22 -0400 Subject: [PATCH] devices: "deactivate" devices when going from UNMANAGED->UNAVAILABLE We used to call nm_device_deactivate() when moving a device from UNMANAGED to UNAVAILABLE (unless we were assuming the existing connection), but this got lost when default-unmanaged was added. Fix it to do this again, so the device will be in a known-clean state when it is activated. --- src/devices/nm-device.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index a5158caa66..6c1ed1b498 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -6185,9 +6185,11 @@ nm_device_state_changed (NMDevice *device, * carrier changes or rfkill. But don't deactivate devices that are * about to assume a connection since that defeats the purpose of * assuming the device's existing connection. + * + * Note that we "deactivate" the device even when coming from + * UNMANAGED, to ensure that it's in a clean state. */ - if (reason != NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED && - old_state != NM_DEVICE_STATE_UNMANAGED) + if (reason != NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED) nm_device_deactivate (device, reason); break; case NM_DEVICE_STATE_DISCONNECTED: