]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
nl80211: Do not indicate scan started event on scan_for_auth
authorJouni Malinen <jouni@qca.qualcomm.com>
Tue, 18 Mar 2014 20:45:07 +0000 (22:45 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 18 Mar 2014 20:48:44 +0000 (22:48 +0200)
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 <jouni@qca.qualcomm.com>
src/drivers/driver_nl80211.c

index d60f95b6a84a9f3e87d2fce3db8d3aa09ddefe48..dcd002e4c8a2f0105f884f7e95b455fcfbe96552 100644 (file)
@@ -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: