Interworking: Prevent scan during ANQP fetch and Interworking select
authorNeelansh Mittal <neelansh@qti.qualcomm.com>
Thu, 19 Mar 2015 19:02:44 +0000 (00:32 +0530)
committerJouni Malinen <j@w1.fi>
Fri, 20 Mar 2015 13:56:48 +0000 (15:56 +0200)
Reject external scan request while either ANQP fetch or Interworking
select is in progress. Not doing so could lead to a situation in which
Interworking automatic network selection does not get triggered because
of a new scan result event forcing the ANQP fetch cycle to be disrupted
and restarted all over again. Interworking automatic network selection
is only triggered when AQNP fetch cycle, that is, ANQP exchange with
every Interworking capable BSS in the current BSS list, is completed.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
wpa_supplicant/ctrl_iface.c

index 4ebc3a1..75aeb4c 100644 (file)
@@ -6943,6 +6943,15 @@ static void wpas_ctrl_scan(struct wpa_supplicant *wpa_s, char *params,
                return;
        }
 
+#ifdef CONFIG_INTERWORKING
+       if (wpa_s->fetch_anqp_in_progress || wpa_s->network_select) {
+               wpa_printf(MSG_DEBUG,
+                          "Interworking select in progress - reject new scan");
+               *reply_len = os_snprintf(reply, reply_size, "FAIL-BUSY\n");
+               return;
+       }
+#endif /* CONFIG_INTERWORKING */
+
        if (params) {
                if (os_strncasecmp(params, "TYPE=ONLY", 9) == 0)
                        scan_only = 1;