diff options
author | Dan Winship <danw@gnome.org> | 2013-10-24 12:36:22 -0400 |
---|---|---|
committer | Dan Winship <danw@gnome.org> | 2013-11-15 10:49:43 -0500 |
commit | 46295e8fa1b45fdca5a2864435cbfd5e9676feaa (patch) | |
tree | 9afd0061d212c4fe6399f748bafd5b1bcf233ea4 | |
parent | 7bc7da83ec46143392d8657e1923adcc6a94794e (diff) | |
download | NetworkManager-46295e8fa1b45fdca5a2864435cbfd5e9676feaa.tar.gz |
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.
-rw-r--r-- | src/devices/nm-device.c | 6 |
1 files 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: |