summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2022-11-14 17:08:55 +0100
committerBeniamino Galvani <bgalvani@redhat.com>2022-11-16 10:22:45 +0100
commit07bc5121a771b54a2c1e8d14e72cd1e263561f66 (patch)
tree7ce9a194368b4b2c212228dae9a34d800c14f33f
parent9fd9eaf27619375a24f87dab36fee0f2ecae6629 (diff)
device: fix missing transition from UNAVAILABLE to DISCONNECTEDbg/rh2122564
When called with update_carrier=TRUE, nm_device_bring_up_full() checks for carrier changes and it may queue a transition to DISCONNECTED through the following call chain: -> nm_device_bring_up_full() -> nm_device_set_carrier_from_platform() -> nm_device_set_carrier() -> carrier_changed() -> nm_device_queue_state() In _set_state_full(state=UNAVAILABLE) after bringing the interface up we also call nm_device_cleanup() which clears the enqueued state change to DISCONNECTED. When this happens, the device remains in UNAVAILABLE and never gets activated even if it was ready. This was observed with macsec interfaces, but in theory can happen with all those interfaces that get carrier immediately after being brought up. Avoid this issue by not checking the carrier synchronously from _set_state_full(). The carrier change event will be processed in the next asynchronous invocation of device_link_changed(). https://bugzilla.redhat.com/show_bug.cgi?id=2122564
-rw-r--r--src/core/devices/nm-device.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/devices/nm-device.c b/src/core/devices/nm-device.c
index c482c265e5..7783a82e68 100644
--- a/src/core/devices/nm-device.c
+++ b/src/core/devices/nm-device.c
@@ -15858,7 +15858,7 @@ _set_state_full(NMDevice *self, NMDeviceState state, NMDeviceStateReason reason,
if (priv->sys_iface_state == NM_DEVICE_SYS_IFACE_STATE_MANAGED) {
if (old_state == NM_DEVICE_STATE_UNMANAGED || priv->firmware_missing) {
- if (!nm_device_bring_up_full(self, TRUE, TRUE, &no_firmware) && no_firmware)
+ if (!nm_device_bring_up_full(self, TRUE, FALSE, &no_firmware) && no_firmware)
_LOGW(LOGD_PLATFORM, "firmware may be missing.");
nm_device_set_firmware_missing(self, no_firmware ? TRUE : FALSE);
}