manager: allow controller activation if device is deactivating

When activating a port connection it will require the controller
connection is active or a valid controller device candidate is available
for activation.

One of the conditions we consider for a controller device to be a valid
candidate for the connection is that it is not active, therefore we
should also consider as valid a device that is currently deactivating.
Otherwise, we could fail during the port activation just because the
deactivation of the controller device candidate didn't finish yet.

https://bugzilla.redhat.com/show_bug.cgi?id=2125615

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1693
(cherry picked from commit fb362e0583)
(cherry picked from commit 43f244ef2e)
This commit is contained in:
Fernando Fernandez Mancera 2023-07-18 13:46:30 +02:00
parent 04ef92fc12
commit 401f153dfb

View file

@ -4600,11 +4600,11 @@ ensure_master_active_connection(NMManager *self,
NULL))
continue;
if (!nm_device_is_software(candidate)) {
master_state = nm_device_get_state(candidate);
if (nm_device_is_real(candidate) && master_state != NM_DEVICE_STATE_DISCONNECTED)
continue;
}
if (nm_device_is_real(candidate)
&& !NM_IN_SET(nm_device_get_state(candidate),
NM_DEVICE_STATE_DISCONNECTED,
NM_DEVICE_STATE_DEACTIVATING))
continue;
master_ac = nm_manager_activate_connection(
self,