mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2024-12-01 03:38:21 -05:00
Do not set own_disconnect_req flag if not connected
This fixes some issues where a disconnection event may get ignored if an earlier operation to remove or disable a network resulted in an attempt to disconnect event though no connection was in place. wpa_s->current_ssid != NULL alone is not sufficient to determine that there will be a driver event notifying completion of such disconnection request. Set own_disconnect_req to 1 only if wpa_s->wpa_state is also indicating that there is a connection or an attempt to complete one. This showed up in a failure, e.g., when running the hwsim test case scan_int followed by ap_vlan_wpa2_psk_radius_required where the latter ended up not processing a connection failure event and getting stuck not trying to run a new scan and connection attempt. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
parent
8d2ed87d82
commit
e66bcedd3e
@ -2876,6 +2876,7 @@ static int wpa_supplicant_ctrl_iface_remove_network(
|
||||
#endif /* CONFIG_SME */
|
||||
wpa_sm_set_config(wpa_s->wpa, NULL);
|
||||
eapol_sm_notify_config(wpa_s->eapol, NULL, NULL);
|
||||
if (wpa_s->wpa_state >= WPA_AUTHENTICATING)
|
||||
wpa_s->own_disconnect_req = 1;
|
||||
wpa_supplicant_deauthenticate(
|
||||
wpa_s, WLAN_REASON_DEAUTH_LEAVING);
|
||||
@ -2923,6 +2924,7 @@ static int wpa_supplicant_ctrl_iface_remove_network(
|
||||
wpa_sm_set_config(wpa_s->wpa, NULL);
|
||||
eapol_sm_notify_config(wpa_s->eapol, NULL, NULL);
|
||||
|
||||
if (wpa_s->wpa_state >= WPA_AUTHENTICATING)
|
||||
wpa_s->own_disconnect_req = 1;
|
||||
wpa_supplicant_deauthenticate(wpa_s,
|
||||
WLAN_REASON_DEAUTH_LEAVING);
|
||||
|
@ -873,6 +873,7 @@ int wpa_supplicant_reload_configuration(struct wpa_supplicant *wpa_s)
|
||||
|
||||
eapol_sm_invalidate_cached_session(wpa_s->eapol);
|
||||
if (wpa_s->current_ssid) {
|
||||
if (wpa_s->wpa_state >= WPA_AUTHENTICATING)
|
||||
wpa_s->own_disconnect_req = 1;
|
||||
wpa_supplicant_deauthenticate(wpa_s,
|
||||
WLAN_REASON_DEAUTH_LEAVING);
|
||||
@ -2604,6 +2605,7 @@ void wpa_supplicant_select_network(struct wpa_supplicant *wpa_s,
|
||||
int disconnected = 0;
|
||||
|
||||
if (ssid && ssid != wpa_s->current_ssid && wpa_s->current_ssid) {
|
||||
if (wpa_s->wpa_state >= WPA_AUTHENTICATING)
|
||||
wpa_s->own_disconnect_req = 1;
|
||||
wpa_supplicant_deauthenticate(
|
||||
wpa_s, WLAN_REASON_DEAUTH_LEAVING);
|
||||
|
Loading…
Reference in New Issue
Block a user