aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/sme.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2012-06-25 11:23:25 (GMT)
committerJouni Malinen <j@w1.fi>2012-06-25 11:23:25 (GMT)
commitc1c023429b8e839bfb6505c224ae74fd3f1ae7ad (patch)
tree32fd7ade30bee9a589c8c590f2393dcbaf71f3d5 /wpa_supplicant/sme.c
parent5bda43cdeec1c0dc34ba0f465499bb525fdd541a (diff)
downloadhostap-c1c023429b8e839bfb6505c224ae74fd3f1ae7ad.zip
hostap-c1c023429b8e839bfb6505c224ae74fd3f1ae7ad.tar.gz
hostap-c1c023429b8e839bfb6505c224ae74fd3f1ae7ad.tar.bz2
Set state to DISCONNECTED on auth/assoc failures
Some of the authentication/association failure paths left wpa_state to its previous value. This can result in unexpected behavior when wpa_supplicant tries to find an AP to connect to since the uncleared state can result the in the selected BSS being ignored if it is same as the previously used BSS. This could happen, e.g., when wpa_supplicant SME was used and the AP rejected authentication. Fix this by explicitly setting state to DISCONNECTED on auth/assoc failures that did not yet do this. Signed-hostap: Jouni Malinen <j@w1.fi> intended-for: hostap-1
Diffstat (limited to 'wpa_supplicant/sme.c')
-rw-r--r--wpa_supplicant/sme.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/wpa_supplicant/sme.c b/wpa_supplicant/sme.c
index 1586a5a..c7187e4 100644
--- a/wpa_supplicant/sme.c
+++ b/wpa_supplicant/sme.c
@@ -332,6 +332,7 @@ void sme_event_auth(struct wpa_supplicant *wpa_s, union wpa_event_data *data)
wpa_s->sme.auth_alg == data->auth.auth_type ||
wpa_s->current_ssid->auth_alg == WPA_AUTH_ALG_LEAP) {
wpas_connection_failed(wpa_s, wpa_s->pending_bssid);
+ wpa_supplicant_set_state(wpa_s, WPA_DISCONNECTED);
return;
}
@@ -448,6 +449,7 @@ void sme_associate(struct wpa_supplicant *wpa_s, enum wpas_mode mode,
wpa_msg(wpa_s, MSG_INFO, "SME: Association request to the "
"driver failed");
wpas_connection_failed(wpa_s, wpa_s->pending_bssid);
+ wpa_supplicant_set_state(wpa_s, WPA_DISCONNECTED);
os_memset(wpa_s->pending_bssid, 0, ETH_ALEN);
return;
}