diff --git a/src/core/devices/nm-device-private.h b/src/core/devices/nm-device-private.h index eaf03392c9..c597e05260 100644 --- a/src/core/devices/nm-device-private.h +++ b/src/core/devices/nm-device-private.h @@ -38,7 +38,10 @@ gboolean nm_device_set_ip_ifindex(NMDevice *self, int ifindex); gboolean nm_device_set_ip_iface(NMDevice *self, const char *iface); gboolean nm_device_bring_up(NMDevice *self); -gboolean nm_device_bring_up_full(NMDevice *self, gboolean block, gboolean *no_firmware); +gboolean nm_device_bring_up_full(NMDevice *self, + gboolean block, + gboolean update_carrier, + gboolean *no_firmware); void nm_device_take_down(NMDevice *self, gboolean block); diff --git a/src/core/devices/nm-device.c b/src/core/devices/nm-device.c index bcf8fd5e84..c482c265e5 100644 --- a/src/core/devices/nm-device.c +++ b/src/core/devices/nm-device.c @@ -9752,7 +9752,7 @@ activate_stage2_device_config(NMDevice *self) _routing_rules_sync(self, NM_TERNARY_TRUE); if (!nm_device_sys_iface_state_is_external_or_assume(self)) { - if (!nm_device_bring_up_full(self, FALSE, &no_firmware)) { + if (!nm_device_bring_up_full(self, FALSE, TRUE, &no_firmware)) { nm_device_state_changed(self, NM_DEVICE_STATE_FAILED, no_firmware ? NM_DEVICE_STATE_REASON_FIRMWARE_MISSING @@ -14029,7 +14029,10 @@ carrier_detect_wait(NMDevice *self) } gboolean -nm_device_bring_up_full(NMDevice *self, gboolean block, gboolean *no_firmware) +nm_device_bring_up_full(NMDevice *self, + gboolean block, + gboolean update_carrier, + gboolean *no_firmware) { gboolean device_is_up = FALSE; NMDeviceCapabilities capabilities; @@ -14056,8 +14059,8 @@ nm_device_bring_up_full(NMDevice *self, gboolean block, gboolean *no_firmware) return FALSE; } - /* Store carrier immediately. */ - nm_device_set_carrier_from_platform(self); + if (update_carrier) + nm_device_set_carrier_from_platform(self); device_is_up = nm_device_is_up(self); if (block && !device_is_up) { @@ -14099,7 +14102,7 @@ nm_device_bring_up_full(NMDevice *self, gboolean block, gboolean *no_firmware) gboolean nm_device_bring_up(NMDevice *self) { - return nm_device_bring_up_full(self, TRUE, NULL); + return nm_device_bring_up_full(self, TRUE, TRUE, NULL); } void @@ -15855,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, &no_firmware) && no_firmware) + if (!nm_device_bring_up_full(self, TRUE, TRUE, &no_firmware) && no_firmware) _LOGW(LOGD_PLATFORM, "firmware may be missing."); nm_device_set_firmware_missing(self, no_firmware ? TRUE : FALSE); } diff --git a/src/core/devices/wifi/nm-device-wifi.c b/src/core/devices/wifi/nm-device-wifi.c index aa587ba686..171743d075 100644 --- a/src/core/devices/wifi/nm-device-wifi.c +++ b/src/core/devices/wifi/nm-device-wifi.c @@ -3591,7 +3591,7 @@ set_enabled(NMDevice *device, gboolean enabled) if (state != NM_DEVICE_STATE_UNAVAILABLE) _LOGW(LOGD_CORE, "not in expected unavailable state!"); - if (!nm_device_bring_up_full(NM_DEVICE(self), TRUE, &no_firmware)) { + if (!nm_device_bring_up_full(NM_DEVICE(self), TRUE, TRUE, &no_firmware)) { _LOGD(LOGD_WIFI, "enable blocked by failure to bring device up"); if (no_firmware)