diff --git a/src/nm-manager.c b/src/nm-manager.c index a67b41105d..8414f18802 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -4125,16 +4125,26 @@ do_sleep_wake (NMManager *self, gboolean sleeping_changed) if (waking_from_suspend) { sleep_devices_clear (self); - /* Belatedly take down Wake-on-LAN devices; ideally we wouldn't have to do this - * but for now it's the only way to make sure we re-check their connectivity. - */ for (iter = priv->devices; iter; iter = iter->next) { NMDevice *device = iter->data; if (nm_device_is_software (device)) continue; + + /* Belatedly take down Wake-on-LAN devices; ideally we wouldn't have to do this + * but for now it's the only way to make sure we re-check their connectivity. + */ if (device_is_wake_on_lan (device)) nm_device_set_unmanaged_by_flags (device, NM_UNMANAGED_SLEEPING, TRUE, NM_DEVICE_STATE_REASON_SLEEPING); + + /* Check if the device is unmanaged but the state transition is still pending. + * If so, change state now so that later we re-manage the device forcing a + * re-check of available connections. + */ + if ( !nm_device_get_managed (device, FALSE) + && nm_device_get_state (device) != NM_DEVICE_STATE_UNMANAGED) { + nm_device_state_changed (device, NM_DEVICE_STATE_UNMANAGED, NM_DEVICE_STATE_REASON_SLEEPING); + } } }