summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2018-11-15 15:36:44 +0100
committerThomas Haller <thaller@redhat.com>2018-11-15 15:36:49 +0100
commitaae6846d20b4557d5642c2ed291a1b1a8c300b15 (patch)
tree9c7f080faacb999d37e1939aa2f3f5e18436cf33
parente179202e47b78cf04dd84536581f29162b7e740b (diff)
downloadNetworkManager-aae6846d20b4557d5642c2ed291a1b1a8c300b15.tar.gz
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).
-rw-r--r--src/devices/nm-device.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index 82dd4482c1..ff082b3d84 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -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)) {