[PATCH 1/2] Clear WiFi requested_scan if suppl goes INACTIVE



It's possible for wpa_supplicant to transition to INACTIVE
state with an outstanding requested_scan pending.  This can
lead to a stall condition where scanning no longer occurs.

Gbp-Pq: Name Clear-WiFi-requested_scan-if-suppl-goes-INACTIVE.patch
---
 src/devices/wifi/nm-device-wifi.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/src/devices/wifi/nm-device-wifi.c b/src/devices/wifi/nm-device-wifi.c
index bacd5e6..f6325a6 100644
--- a/src/devices/wifi/nm-device-wifi.c
+++ b/src/devices/wifi/nm-device-wifi.c
@@ -1903,6 +1903,21 @@ supplicant_iface_state_cb (NMSupplicantInterface *iface,
                else
                        _LOGI (LOGD_DEVICE | LOGD_WIFI, "supplicant interface keeps failing, giving up");
                break;
+       case NM_SUPPLICANT_INTERFACE_STATE_INACTIVE:
+               if (old_state == NM_SUPPLICANT_INTERFACE_STATE_SCANNING) {
+                       nm_log_warn (LOGD_HW | LOGD_WIFI, "(%s): supplicant state: SCANNING -> INACTIVE",
+                                                nm_device_get_iface (NM_DEVICE (self)));
+
+                       if (priv->requested_scan) {
+                               nm_log_dbg (LOGD_WIFI_SCAN, "(%s): clearing requested_scan",
+                                                       nm_device_get_iface (NM_DEVICE (self)));
+
+                               priv->requested_scan = FALSE;
+                       }
+
+                       cancel_pending_scan (self);
+                       request_wireless_scan (self, NULL);
+               }
        default:
                break;
        }
-- 
2.7.4



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]