]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Handle assoc reject events without wpa_supplicant SME
authorJouni Malinen <j@w1.fi>
Sat, 3 Nov 2012 11:50:17 +0000 (13:50 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 3 Nov 2012 11:50:17 +0000 (13:50 +0200)
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 <j@w1.fi>

wpa_supplicant/events.c

index 53b8338b2a8b4380449b3f9847271cff63939da5..1aa9c2109c007271e53c0185d77f2c510e45eb4f 100644 (file)
@@ -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)