[PATCH] wpa_supplicant: fix 2 bugs in cancel sched scan

Ilan Peer ilan.peer
Sun Nov 3 05:26:53 PST 2013


From: David Spinadel <david.spinadel at intel.com>

Cancel scheduled scan even if not scanning on the current interface,
and do that only on interfaces that is scanning.

Signed-hostap: David Spinadel <david.spinadel at intel.com>

---
 wpa_supplicant/scan.c |   15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c
index 0549656..8eb6046 100644
--- a/wpa_supplicant/scan.c
+++ b/wpa_supplicant/scan.c
@@ -1238,12 +1238,12 @@ void wpa_supplicant_cancel_sched_scan(struct wpa_supplicant *wpa_s)
 	struct wpa_supplicant *iface;
 	const char *rn, *rn2;
 
-	if (!wpa_s->sched_scanning)
-		return;
-
-	wpa_dbg(wpa_s, MSG_DEBUG, "Cancelling sched scan");
-	eloop_cancel_timeout(wpa_supplicant_sched_scan_timeout, wpa_s, NULL);
-	wpa_supplicant_stop_sched_scan(wpa_s);
+	if (wpa_s->sched_scanning) {
+		wpa_dbg(wpa_s, MSG_DEBUG, "Cancelling sched scan");
+		eloop_cancel_timeout(wpa_supplicant_sched_scan_timeout, wpa_s,
+				     NULL);
+		wpa_supplicant_stop_sched_scan(wpa_s);
+	}
 
 	/* Cancel scheduled scan on other interfaces */
 	if (!wpa_s->driver->get_radio_name)
@@ -1255,7 +1255,8 @@ void wpa_supplicant_cancel_sched_scan(struct wpa_supplicant *wpa_s)
 		return;
 
 	for (iface = wpa_s->global->ifaces; iface; iface = iface->next) {
-		if (iface == wpa_s || !iface->driver->get_radio_name)
+		if (iface == wpa_s || !iface->driver->get_radio_name ||
+		    !iface->sched_scanning)
 			continue;
 
 		rn2 = iface->driver->get_radio_name(iface->drv_priv);
-- 
1.7.10.4




More information about the Hostap mailing list