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);