wifi: fix missing pending-action-remove for "scan"
<warn> [1467730406.7343] device (wlp3s0): add_pending_action (2): scan already pending
file devices/nm-device.c: line 10443 (nm_device_add_pending_action): should not be reached
Fixes: eed8fd2e43
This commit is contained in:
@@ -256,6 +256,24 @@ supplicant_interface_acquire (NMDeviceWifi *self)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_requested_scan_set (NMDeviceWifi *self, gboolean value)
|
||||||
|
{
|
||||||
|
NMDeviceWifiPrivate *priv;
|
||||||
|
|
||||||
|
value = !!value;
|
||||||
|
|
||||||
|
priv = NM_DEVICE_WIFI_GET_PRIVATE (self);
|
||||||
|
if (priv->requested_scan == value)
|
||||||
|
return;
|
||||||
|
|
||||||
|
priv->requested_scan = value;
|
||||||
|
if (value)
|
||||||
|
nm_device_add_pending_action ((NMDevice *) self, "scan", TRUE);
|
||||||
|
else
|
||||||
|
nm_device_remove_pending_action ((NMDevice *) self, "scan", TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
supplicant_interface_release (NMDeviceWifi *self)
|
supplicant_interface_release (NMDeviceWifi *self)
|
||||||
{
|
{
|
||||||
@@ -265,10 +283,7 @@ supplicant_interface_release (NMDeviceWifi *self)
|
|||||||
|
|
||||||
priv = NM_DEVICE_WIFI_GET_PRIVATE (self);
|
priv = NM_DEVICE_WIFI_GET_PRIVATE (self);
|
||||||
|
|
||||||
if (priv->requested_scan) {
|
_requested_scan_set (self, FALSE);
|
||||||
priv->requested_scan = FALSE;
|
|
||||||
nm_device_remove_pending_action (NM_DEVICE (self), "scan", TRUE);
|
|
||||||
}
|
|
||||||
|
|
||||||
nm_clear_g_source (&priv->pending_scan_id);
|
nm_clear_g_source (&priv->pending_scan_id);
|
||||||
|
|
||||||
@@ -1403,8 +1418,7 @@ request_wireless_scan (NMDeviceWifi *self, GVariant *scan_options)
|
|||||||
if (nm_supplicant_interface_request_scan (priv->sup_iface, ssids)) {
|
if (nm_supplicant_interface_request_scan (priv->sup_iface, ssids)) {
|
||||||
/* success */
|
/* success */
|
||||||
backoff = TRUE;
|
backoff = TRUE;
|
||||||
priv->requested_scan = TRUE;
|
_requested_scan_set (self, TRUE);
|
||||||
nm_device_add_pending_action (NM_DEVICE (self), "scan", TRUE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ssids)
|
if (ssids)
|
||||||
@@ -1486,10 +1500,7 @@ supplicant_iface_scan_done_cb (NMSupplicantInterface *iface,
|
|||||||
priv->last_scan = nm_utils_get_monotonic_timestamp_s ();
|
priv->last_scan = nm_utils_get_monotonic_timestamp_s ();
|
||||||
schedule_scan (self, success);
|
schedule_scan (self, success);
|
||||||
|
|
||||||
if (priv->requested_scan) {
|
_requested_scan_set (self, FALSE);
|
||||||
priv->requested_scan = FALSE;
|
|
||||||
nm_device_remove_pending_action (NM_DEVICE (self), "scan", TRUE);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@@ -2024,7 +2035,7 @@ supplicant_iface_state_cb (NMSupplicantInterface *iface,
|
|||||||
_LOGI (LOGD_DEVICE | LOGD_WIFI, "supplicant interface keeps failing, giving up");
|
_LOGI (LOGD_DEVICE | LOGD_WIFI, "supplicant interface keeps failing, giving up");
|
||||||
break;
|
break;
|
||||||
case NM_SUPPLICANT_INTERFACE_STATE_INACTIVE:
|
case NM_SUPPLICANT_INTERFACE_STATE_INACTIVE:
|
||||||
priv->requested_scan = FALSE;
|
_requested_scan_set (self, FALSE);
|
||||||
nm_clear_g_source (&priv->pending_scan_id);
|
nm_clear_g_source (&priv->pending_scan_id);
|
||||||
request_wireless_scan (self, NULL);
|
request_wireless_scan (self, NULL);
|
||||||
break;
|
break;
|
||||||
|
Reference in New Issue
Block a user