diff mbox series

scan: Use normal scans after connection failure

Message ID 20190403151719.12165-3-andrei.otcheretianski@intel.com
State Accepted
Headers show
Series scan: Use normal scans after connection failure | expand

Commit Message

Otcheretianski, Andrei April 3, 2019, 3:17 p.m. UTC
From: Ilan Peer <ilan.peer@intel.com>

In case of connection attempt failure, set 'normal_scans'
to zero, as otherwise it is possible that scheduled scan
would be used and not normal scan, which might delay the
next connection attempt.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
---
 wpa_supplicant/wpa_supplicant.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Jouni Malinen April 6, 2019, 3:50 p.m. UTC | #1
On Wed, Apr 03, 2019 at 06:17:13PM +0300, Andrei Otcheretianski wrote:
> In case of connection attempt failure, set 'normal_scans'
> to zero, as otherwise it is possible that scheduled scan
> would be used and not normal scan, which might delay the
> next connection attempt.

Thanks, applied.
diff mbox series

Patch

diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index 7c9f58105f..0784a3aece 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -6737,6 +6737,9 @@  void wpas_connection_failed(struct wpa_supplicant *wpa_s, const u8 *bssid)
 	 * TODO: if more than one possible AP is available in scan results,
 	 * could try the other ones before requesting a new scan.
 	 */
+
+	/* speed up the connection attempt with normal scan */
+	wpa_s->normal_scans = 0;
 	wpa_supplicant_req_scan(wpa_s, timeout / 1000,
 				1000 * (timeout % 1000));
 }