From: Jouni Malinen Date: Fri, 1 Nov 2013 10:44:52 +0000 (+0200) Subject: AOSP: Skip wpa_supplicant_scan if wpa_s->scanning X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5b32b500e54b1fc2d0cd094b2eec920dca0d0768;p=thirdparty%2Fhostap.git AOSP: Skip wpa_supplicant_scan if wpa_s->scanning This came in as a part of this commit: commit 5887a9d552f3d9d612011daba073e076daab5b2a Author: Dmitry Shmidt Date: Fri Sep 14 10:47:43 2012 -0700 wpa_supplicant: Skip unnecessary scan attempts Change-Id: Ieea8843c0fcb063dbb1df56e5cdf3fbdd0590cd4 Signed-off-by: Dmitry Shmidt --- diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c index 04e8fa6ca..c526e46a4 100644 --- a/wpa_supplicant/scan.c +++ b/wpa_supplicant/scan.c @@ -565,7 +565,13 @@ static void wpa_supplicant_scan(void *eloop_ctx, void *timeout_ctx) wpas_p2p_continue_after_scan(wpa_s); return; } - +#ifdef ANDROID + if (wpa_s->scanning) { + /* If we are already in scanning state, we shall ignore this new scan request*/ + wpa_dbg(wpa_s, MSG_DEBUG, "Skip scan - already scanning"); + return; + } +#endif if (!wpa_supplicant_enabled_networks(wpa_s) && wpa_s->scan_req == NORMAL_SCAN_REQ) { wpa_dbg(wpa_s, MSG_DEBUG, "No enabled networks - do not scan");