device: ignore "carrier-wait" when device is already activated

nm_device_has_pending_action_reason() marks the device as busy, which in
turn delays "startup-complete" and NetworkManager-wait-online.service.

A device which has no carrier but is otherwise in activated state, is
clearly ready. I didn't test this, but I presume that can easily be the
case with static IP configuration (which can activate without the device
having carrier).
This commit is contained in:
Thomas Haller 2018-11-15 15:36:44 +01:00
parent e179202e47
commit aae6846d20

View file

@ -14097,8 +14097,18 @@ nm_device_has_pending_action_reason (NMDevice *self)
{
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
if (priv->pending_actions)
if (priv->pending_actions) {
if ( !priv->pending_actions->next
&& nm_device_get_state (self) == NM_DEVICE_STATE_ACTIVATED
&& nm_streq (priv->pending_actions->data, NM_PENDING_ACTION_CARRIER_WAIT)) {
/* if the device is already in activated state, and the only reason
* why it appears still busy is "carrier-wait", then we are already complete. */
return NULL;
}
return priv->pending_actions->data;
}
if ( nm_device_is_real (self)
&& nm_device_get_unmanaged_flags (self, NM_UNMANAGED_PLATFORM_INIT)) {