From 9772af66ba0135ba3b57e7cc197e6b653494a36b Mon Sep 17 00:00:00 2001 From: Neelansh Mittal Date: Fri, 20 Mar 2015 00:32:44 +0530 Subject: [PATCH] Interworking: Prevent scan during ANQP fetch and Interworking select 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 --- wpa_supplicant/ctrl_iface.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c index 4ebc3a143..75aeb4cfb 100644 --- a/wpa_supplicant/ctrl_iface.c +++ b/wpa_supplicant/ctrl_iface.c @@ -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;