aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2016-01-04 21:37:43 (GMT)
committerJouni Malinen <j@w1.fi>2016-01-04 21:37:43 (GMT)
commite9ccfc38fd0cf319919994adf93098b632be11d9 (patch)
tree328cf2c6ad910395e03df0c15a8bb38657be0bb5
parentde8a45b6cee9757da6516c07780c572ae75d5bf0 (diff)
downloadhostap-e9ccfc38fd0cf319919994adf93098b632be11d9.zip
hostap-e9ccfc38fd0cf319919994adf93098b632be11d9.tar.gz
hostap-e9ccfc38fd0cf319919994adf93098b632be11d9.tar.bz2
Clear wpa_supplicant state to DISCONNECTED on FLUSH command
It was possible for the FLUSH command to trigger auto connect mechanism to schedule a new scan in 100 ms. This is not desired since all the network profiles will be removed immediately and the scan or an attempt to reconnect would not be of any benefit here. Such a scan in 100 ms can cause issues for cases where multiple test sequences are run back to back, so prevent this by clearing wpa_supplicant state to DISCONNECTED (which avoids scheduling of the 100 ms scan trigger on disconnection) if the state was AUTHENTICATING or higher when the FLUSH command was issued. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
-rw-r--r--wpa_supplicant/ctrl_iface.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c
index 10d86f5..848f323 100644
--- a/wpa_supplicant/ctrl_iface.c
+++ b/wpa_supplicant/ctrl_iface.c
@@ -6973,6 +6973,14 @@ static void wpa_supplicant_ctrl_iface_flush(struct wpa_supplicant *wpa_s)
wpas_abort_ongoing_scan(wpa_s);
+ if (wpa_s->wpa_state >= WPA_AUTHENTICATING) {
+ /*
+ * Avoid possible auto connect re-connection on getting
+ * disconnected due to state flush.
+ */
+ wpa_supplicant_set_state(wpa_s, WPA_DISCONNECTED);
+ }
+
#ifdef CONFIG_P2P
wpas_p2p_cancel(p2p_wpa_s);
p2p_ctrl_flush(p2p_wpa_s);