From 10737aba2235cbb03968997d991087e579ee828d Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sat, 3 Nov 2012 13:50:17 +0200 Subject: [PATCH] Handle assoc reject events without wpa_supplicant SME If the driver indicates the association (or authentication) was rejected, wpa_supplicant should handle this connection failure similarly to other cases. Previously, this was only handled with drivers that use wpa_supplicant SME. In case of cfg80211-based drivers, a rejected association was actually already handled since cfg80211 generates a deauthentication event after indicating connection failure. However, rejected authentication resulted in wpa_supplicant waiting for authentication timeout to expire which is unnecessary long wait. Fix this by calling wpas_connection_failed() to use the common mechanism to reschedule a new connection attempt with the previously attempted BSSID blacklisted. Signed-hostap: Jouni Malinen --- wpa_supplicant/events.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c index 53b8338b2..1aa9c2109 100644 --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c @@ -2524,6 +2524,13 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event, data->assoc_reject.status_code); if (wpa_s->drv_flags & WPA_DRIVER_FLAGS_SME) sme_event_assoc_reject(wpa_s, data); + else { + const u8 *bssid = data->assoc_reject.bssid; + if (bssid == NULL || is_zero_ether_addr(bssid)) + bssid = wpa_s->pending_bssid; + wpas_connection_failed(wpa_s, bssid); + wpa_supplicant_mark_disassoc(wpa_s); + } break; case EVENT_AUTH_TIMED_OUT: if (wpa_s->drv_flags & WPA_DRIVER_FLAGS_SME)