From 1b5df9e591d9e97b69d7b2b69c295a5365f389c9 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Tue, 18 Mar 2014 22:45:07 +0200 Subject: [PATCH] nl80211: Do not indicate scan started event on scan_for_auth The scan_for_auth workaround for cfg80211 missing a BSS entry for the target BSS during authentication uses a single channel scan controlled within driver_nl80211.c. This operation does not indicate EVENT_SCAN_RESULTS to the upper layer code. However, it did report EVENT_SCAN_STARTED and this resulted in the radio work protection code assuming that an external program triggered a scan, but that scan never completed. This resulted in all new radio work items getting stuck waiting for this scan to complete. Fix this by handling the scan_for_auth situation consistently within driver_nl80211.c by filtering both the EVENT_SCAN_STARTED and EVENT_SCAN_RESULTS. Signed-off-by: Jouni Malinen --- src/drivers/driver_nl80211.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index d60f95b6a..dcd002e4c 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -2900,6 +2900,16 @@ static void do_process_drv_event(struct i802_bss *bss, int cmd, case NL80211_CMD_TRIGGER_SCAN: wpa_dbg(drv->ctx, MSG_DEBUG, "nl80211: Scan trigger"); drv->scan_state = SCAN_STARTED; + if (drv->scan_for_auth) { + /* + * Cannot indicate EVENT_SCAN_STARTED here since we skip + * EVENT_SCAN_RESULTS in scan_for_auth case and the + * upper layer implementation could get confused about + * scanning state. + */ + wpa_printf(MSG_DEBUG, "nl80211: Do not indicate scan-start event due to internal scan_for_auth"); + break; + } wpa_supplicant_event(drv->ctx, EVENT_SCAN_STARTED, NULL); break; case NL80211_CMD_START_SCHED_SCAN: