summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWen Liang <liangwen12year@gmail.com>2023-09-08 10:45:17 -0400
committerWen Liang <liangwen12year@gmail.com>2023-09-17 20:39:58 -0400
commit4d0cf4924f6c394f3bb53e04fca14c8acca37c0e (patch)
treeffe53d47bea6b06480c137b40f4e2c5efde68f9e
parent510952b0369e9b8e2b409505a0698512e4891b5a (diff)
device: do not set dependency failed for port if master is reconnecting
When a master is re-enslaved, it will be deactivated and reconnecting immediately, as a result, we should not set the dependency-failed for its port. Otherwise, we may risk blocking the autoconnect of port connections with higher autoconnect-priority. https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1725 https://gitlab.freedesktop.org/NetworkManager/NetworkManager-ci/-/merge_requests/1473
-rw-r--r--src/core/devices/nm-device.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/core/devices/nm-device.c b/src/core/devices/nm-device.c
index 47d17a200b..1fc85ad135 100644
--- a/src/core/devices/nm-device.c
+++ b/src/core/devices/nm-device.c
@@ -9746,10 +9746,16 @@ activate_stage1_device_prepare(NMDevice *self)
master = nm_active_connection_get_master(active);
if (master) {
if (nm_active_connection_get_state(master) >= NM_ACTIVE_CONNECTION_STATE_DEACTIVATING) {
+ NMDevice *master_device = nm_active_connection_get_device(master);
+ NMDeviceStateReason failure_reason = NM_DEVICE_STATE_REASON_DEPENDENCY_FAILED;
+
_LOGD(LOGD_DEVICE, "master connection is deactivating");
- nm_device_state_changed(self,
- NM_DEVICE_STATE_FAILED,
- NM_DEVICE_STATE_REASON_DEPENDENCY_FAILED);
+
+ if (master_device && NM_DEVICE_GET_PRIVATE(master_device)->queued_act_request) {
+ /* if the controller is going to activate again, don't block this device */
+ failure_reason = NM_DEVICE_STATE_REASON_NONE;
+ }
+ nm_device_state_changed(self, NM_DEVICE_STATE_FAILED, failure_reason);
return;
}
/* If the master connection is ready for slaves, attach ourselves */