[PATCH] honor explicit scan requests when disconnected

Dan Williams dcbw
Sat Jan 12 22:46:38 PST 2008

Even when disconnected, wpa_supplicant should still scan when explicitly
requested to do so via a control interface.  Otherwise, no scans will be
performed after a 'disconnect' command until either a reconnection or a
new network block is selected.  Automatic scanning should rightly be
disabled, but explicit requests should not.

Fix (but not the patch) applies to both 0.6.x and 0.5.x.

diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c
index 06736ba..527323f 100644
--- a/wpa_supplicant/scan.c
+++ b/wpa_supplicant/scan.c
@@ -46,7 +46,7 @@ static void wpa_supplicant_scan(void *eloop_ctx, void *timeout_ctx)
 	struct wpa_ssid *ssid;
 	int enabled, scan_req = 0, ret;
-	if (wpa_s->disconnected)
+	if (wpa_s->disconnected && !wpa_s->scan_req)
 	enabled = 0;

More information about the Hostap mailing list