[PATCH 3/3] wpa_supplicant: cancel scan work when starting a connection

Ilan Peer ilan.peer at intel.com
Thu Mar 27 02:58:34 EDT 2014


Cancel a pending scan work if a connection is started, as otherwise
the connection flow would be blocked until the scan is complete.

Signed-off-by: Ilan Peer <ilan.peer at intel.com>
---
 wpa_supplicant/wpa_supplicant.c |   10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index 14b084a..a3000bc 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -1406,6 +1406,16 @@ void wpa_supplicant_associate(struct wpa_supplicant *wpa_s,
 
 	if ((wpa_s->drv_flags & WPA_DRIVER_FLAGS_SME) &&
 	    ssid->mode == IEEE80211_MODE_INFRA) {
+		if (radio_work_pending(wpa_s, "scan")) {
+			/*
+			 * Starting a connection flow. Remove any scan work that
+			 * might delay the connection.
+			 */
+			wpa_dbg(wpa_s, MSG_DEBUG,
+				"Remove previous pending scan work");
+			radio_remove_works(wpa_s, "scan", 0);
+		}
+
 		sme_authenticate(wpa_s, bss, ssid);
 		return;
 	}
-- 
1.7.10.4



More information about the HostAP mailing list