Patchwork ctrl_iface: check for ongoing sched_scan on SCAN command

login
register
mail settings
Submitter Arik Nemtsov
Date Dec. 9, 2012, 9:27 a.m.
Message ID <1355045256-19990-1-git-send-email-arik@wizery.com>
Download mbox | patch
Permalink /patch/204692/
State Accepted
Commit d125df25e41eba7d815873ab73d415e237584c72
Headers show

Comments

Arik Nemtsov - Dec. 9, 2012, 9:27 a.m.
From: Eliad Peller <eliad@wizery.com>

The first "if" in the SCAN command handling didn't
check properly for sched_scan, causing the sched_scan
and scan to run concurrently, instead of cancelling
the ongoing sched scan (which is handled by the
"else if" later).

Signed-hostap: Eliad Peller <eliad@wizery.com>
---
 wpa_supplicant/ctrl_iface.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Jouni Malinen - Dec. 23, 2012, 10:54 a.m.
On Sun, Dec 09, 2012 at 11:27:36AM +0200, Arik Nemtsov wrote:
> The first "if" in the SCAN command handling didn't
> check properly for sched_scan, causing the sched_scan
> and scan to run concurrently, instead of cancelling
> the ongoing sched scan (which is handled by the
> "else if" later).

Thanks, applied.

Patch

diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c
index 5bfa890..82d05fd 100644
--- a/wpa_supplicant/ctrl_iface.c
+++ b/wpa_supplicant/ctrl_iface.c
@@ -5079,7 +5079,7 @@  char * wpa_supplicant_ctrl_iface_process(struct wpa_supplicant *wpa_s,
 		if (wpa_s->wpa_state == WPA_INTERFACE_DISABLED)
 			reply_len = -1;
 		else {
-			if (!wpa_s->scanning &&
+			if (!wpa_s->sched_scanning && !wpa_s->scanning &&
 			    ((wpa_s->wpa_state <= WPA_SCANNING) ||
 			     (wpa_s->wpa_state == WPA_COMPLETED))) {
 				wpa_s->normal_scans = 0;