diff options
author | Thomas Haller <thaller@redhat.com> | 2017-01-27 13:52:26 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2017-02-10 14:40:23 +0100 |
commit | 11744b090ea0f6e7d1f71c936e76588b4c7ea347 (patch) | |
tree | f0ce0c994251ad44929104b22d54eb86d173dae8 | |
parent | 95a95b3e480244f79623246e41cab33865fe40c3 (diff) | |
download | NetworkManager-11744b090ea0f6e7d1f71c936e76588b4c7ea347.tar.gz |
device: add pending-action "recheck-available"
Startup-complete means that all devices have settled in a state
and no further activation is pending. When we have a recheck-available
scheduled, we clearly should not yet declare startup-complete.
Add a new pending-action "recheck-available" to avoid:
<info> [1485520408.3920] device (wlp2s0): supplicant interface state: starting -> ready
<debug> [1485520408.3920] device[0x563abbcca400] (wlp2s0): remove_pending_action (0): 'waiting for supplicant'
<info> [1485520408.3920] manager: startup complete
<debug> [1485520408.3924] device[0x563abbcca400] (wlp2s0): add_pending_action (1): 'queued state change to disconnected'
-rw-r--r-- | src/devices/nm-device.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index f2c41e1c0e..f9509eaa66 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -143,6 +143,7 @@ NM_GOBJECT_PROPERTIES_DEFINE (NMDevice, #define PENDING_ACTION_DHCP4 "dhcp4" #define PENDING_ACTION_DHCP6 "dhcp6" #define PENDING_ACTION_AUTOCONF6 "autoconf6" +#define PENDING_ACTION_RECHECK_AVAILABLE "recheck-available" #define DHCP_RESTART_TIMEOUT 120 #define DHCP_NUM_TRIES_MAX 3 @@ -3921,6 +3922,9 @@ recheck_available (gpointer user_data) priv->recheck_available.unavailable_reason = NM_DEVICE_STATE_REASON_NONE; } + if (priv->recheck_available.call_id == 0) + nm_device_remove_pending_action (self, PENDING_ACTION_RECHECK_AVAILABLE, TRUE); + return G_SOURCE_REMOVE; } @@ -3933,8 +3937,12 @@ nm_device_queue_recheck_available (NMDevice *self, priv->recheck_available.available_reason = available_reason; priv->recheck_available.unavailable_reason = unavailable_reason; - if (!priv->recheck_available.call_id) + if (!priv->recheck_available.call_id) { priv->recheck_available.call_id = g_idle_add (recheck_available, self); + nm_device_add_pending_action (self, PENDING_ACTION_RECHECK_AVAILABLE, + FALSE /* cannot assert, because of how recheck_available() first clears + the call-id and postpones removing the pending-action. */); + } } void |