From b02353e954dbb7291a7932a78d9c4e4aa15f8c4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Thu, 13 Mar 2014 14:37:26 +0100 Subject: [PATCH] core: fix a regression in manual device disconnection (bgo #726239) Devices disconnected explicitly by user should stay disconnected, preventing auto-connecting until manual request. Introduction of NM_DEVICE_STATE_DEACTIVATING state broke this feature. disconnect_cb() correctly set autoconnect device property to FALSE, however nm_device_state_changed() put it to TRUE again. Thus only the active connection was blocked instead of the whole device. https://bugzilla.gnome.org/show_bug.cgi?id=726239 --- src/devices/nm-device.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index 20970d122a..bdfc63c0a9 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -6545,10 +6545,14 @@ nm_device_state_changed (NMDevice *device, nm_device_deactivate (device, reason); break; default: - priv->autoconnect = TRUE; break; } + /* Reset autoconnect flag when the device is activating or connected. */ + if ( state >= NM_DEVICE_STATE_PREPARE + && state <= NM_DEVICE_STATE_ACTIVATED) + priv->autoconnect = TRUE; + g_object_notify (G_OBJECT (device), NM_DEVICE_STATE); g_object_notify (G_OBJECT (device), NM_DEVICE_STATE_REASON); g_signal_emit_by_name (device, "state-changed", state, old_state, reason);