[PATCH] Do not retry scan after failure if operating in ap_mode

pasi.sjoholm at jolla.com pasi.sjoholm
Tue Aug 4 15:42:35 PDT 2015


From: Pasi Sj?holm <pasi.sjoholm at jollamobile.com>

Commit 2d9c99e37b29a639dafa431df38e1586a31ba887 introduced
a regression while running in ap_mode together with ap_scan
configured with value of 2.

Retrying caused following path to be called:
wpa_supplicant_req_scan()->wpa_supplicant_scan()->
wpa_supplicant_assoc_try()->wpa_supplicant_associate()->
wpa_supplicant_create_ap()

Which eventually teared down the currently configured
ap_mode by calling wpa_supplicant_ap_deinit().

Signed-off-by: Pasi Sj?holm <pasi.sjoholm at jollamobile.com>
---
 wpa_supplicant/scan.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c
index 8d0d1a5..cb42456 100644
--- a/wpa_supplicant/scan.c
+++ b/wpa_supplicant/scan.c
@@ -186,6 +186,9 @@ static void wpas_trigger_scan_cb(struct wpa_radio_work *work, int deinit)
 		if (wpa_s->disconnected)
 			retry = 0;
 
+		if (wpa_s->last_ssid && wpa_s->last_ssid->mode == WPAS_MODE_AP)
+			retry = 0;
+
 		wpa_supplicant_notify_scanning(wpa_s, 0);
 		wpas_notify_scan_done(wpa_s, 0);
 		if (wpa_s->wpa_state == WPA_SCANNING)
-- 
2.1.4




More information about the Hostap mailing list