From: Jouni Malinen Date: Fri, 12 Dec 2014 10:11:14 +0000 (+0200) Subject: Reject new SCAN commands if there is a pending request X-Git-Tag: hostap_2_4~750 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e69ae5ff319f549635a87c844b8a4f20c7289ca2;p=thirdparty%2Fhostap.git Reject new SCAN commands if there is a pending request FAIL-BUSY was already returned for the case where a scan had been started, but with the radio work design, it would have been possible to schedule multiple scan requests if a non-scan radio work was in progress. Multiple back-to-back scans are not usually very helpful, so reject this type of cases where the SCAN command would be used to build such a sequence. Signed-off-by: Jouni Malinen --- diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c index c9eb56d9a..c8dc97d16 100644 --- a/wpa_supplicant/ctrl_iface.c +++ b/wpa_supplicant/ctrl_iface.c @@ -6286,6 +6286,13 @@ static void wpas_ctrl_scan(struct wpa_supplicant *wpa_s, char *params, return; } + if (radio_work_pending(wpa_s, "scan")) { + wpa_printf(MSG_DEBUG, + "Pending scan scheduled - reject new request"); + *reply_len = os_snprintf(reply, reply_size, "FAIL-BUSY\n"); + return; + } + if (params) { if (os_strncasecmp(params, "TYPE=ONLY", 9) == 0) scan_only = 1;