summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2022-08-25 15:52:27 +0200
committerThomas Haller <thaller@redhat.com>2022-08-25 23:15:24 +0200
commitc183f10f65de3a839a1ce58a15946586ab8a6f7f (patch)
tree02de6b1bf7f4116a2852eb8a47e7ac431163f0d3
parent2f0539b0b73a187d9e42a96bf24c86f7c241b9ff (diff)
downloadNetworkManager-c183f10f65de3a839a1ce58a15946586ab8a6f7f.tar.gz
device: wait for carrier on unavailable device even when it gets a connection assumed
The test in question leaves the device with a master set, which caused a connection to get assumed and therefore the previous fix didn't kick in. Fixes-test: @restart_L2_only_lacp Fixes: 5b7f8f3f7051 ('device: wait for carrier even if it wasn't us who brought the device IFF_UP') https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1348
-rw-r--r--src/core/devices/nm-device.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/core/devices/nm-device.c b/src/core/devices/nm-device.c
index aa7481c71e..6980844635 100644
--- a/src/core/devices/nm-device.c
+++ b/src/core/devices/nm-device.c
@@ -15787,6 +15787,13 @@ _set_state_full(NMDevice *self, NMDeviceState state, NMDeviceStateReason reason,
if (priv->sys_iface_state == NM_DEVICE_SYS_IFACE_STATE_MANAGED)
ip6_managed_setup(self);
device_init_static_sriov_num_vfs(self);
+
+ /* We didn't bring the device up and we have little idea
+ * when was it brought up. Play it safe and assume it could
+ * have been brought up very recently and it might one of
+ * those who take time to detect carrier.
+ */
+ carrier_detect_wait(self);
}
if (priv->sys_iface_state == NM_DEVICE_SYS_IFACE_STATE_MANAGED) {
@@ -15794,13 +15801,6 @@ _set_state_full(NMDevice *self, NMDeviceState state, NMDeviceStateReason reason,
if (!nm_device_bring_up(self, TRUE, &no_firmware) && no_firmware)
_LOGW(LOGD_PLATFORM, "firmware may be missing.");
nm_device_set_firmware_missing(self, no_firmware ? TRUE : FALSE);
- } else {
- /* We didn't bring the device up and we have little idea
- * when was it brought up. Play it safe and assume it could
- * have been brought up very recently and it might one of
- * those who take time to detect carrier.
- */
- carrier_detect_wait(self);
}
/* Ensure the device gets deactivated in response to stuff like