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>
This commit is contained in:
Jouni Malinen 2016-01-04 23:37:43 +02:00 committed by Jouni Malinen
parent de8a45b6ce
commit e9ccfc38fd

View File

@ -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);