device: always queue recheck_assume before making device managed

There were a few places where we did already this but there was one
place where we missed it, in nm-manager.c:do_sleep_wake(). Therefore,
the device end in DISCONNECTED state and did not assume the connection.
This commit is contained in:
Fernando Fernandez Mancera
2023-01-24 12:33:09 +01:00
parent 3d18c9c841
commit f00db8e15d

View File

@@ -6495,13 +6495,6 @@ _dev_unmanaged_check_external_down(NMDevice *self, gboolean only_if_unmanaged, g
}
ext_flags = _dev_unmanaged_is_external_down(self, FALSE);
if (ext_flags != NM_UNMAN_FLAG_OP_SET_UNMANAGED) {
/* Ensure the assume check is queued before any queued state changes
* from the transition to UNAVAILABLE.
*/
nm_device_queue_recheck_assume(self);
}
if (now) {
nm_device_set_unmanaged_by_flags(self,
NM_UNMANAGED_EXTERNAL_DOWN,
@@ -6966,12 +6959,6 @@ device_link_changed(gpointer user_data)
}
}
/* The assume check should happen before the device transitions to
* UNAVAILABLE, because in UNAVAILABLE we already clean up the IP
* configuration. Therefore, this function should never trigger a
* sync state transition.
*/
nm_device_queue_recheck_assume(self);
nm_device_set_unmanaged_by_flags_queue(self,
NM_UNMANAGED_PLATFORM_INIT,
NM_UNMAN_FLAG_OP_SET_MANAGED,
@@ -14701,6 +14688,15 @@ _set_unmanaged_flags(NMDevice *self,
if (transition_state) {
new_state = was_managed ? NM_DEVICE_STATE_UNMANAGED : NM_DEVICE_STATE_UNAVAILABLE;
if (new_state != NM_DEVICE_STATE_UNMANAGED) {
/* The assume check should happen before the device transitions to
* UNAVAILABLE, because in UNAVAILABLE we already clean up the IP
* configuration. Therefore, this function should never trigger a
* sync state transition.
*/
nm_device_queue_recheck_assume(self);
}
if (now)
nm_device_state_changed(self, new_state, reason);
else