]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
WPS: Force disconnection after provisioning step
authorJouni Malinen <jouni.malinen@atheros.com>
Tue, 6 Jul 2010 19:56:02 +0000 (12:56 -0700)
committerJouni Malinen <j@w1.fi>
Sun, 18 Jul 2010 23:08:52 +0000 (16:08 -0700)
This works around some problems where the station is unable to disconnect
for some reason (e.g., if EAP-Failure gets dropped).

src/ap/ieee802_1x.c

index b8676ed634bab05751b4e159a0236ed51e06c7df..4ab100150c456bf22e979e7a8f655a46e51a2298 100644 (file)
@@ -1978,4 +1978,23 @@ static void ieee802_1x_finished(struct hostapd_data *hapd,
                               HOSTAPD_LEVEL_DEBUG,
                               "Added PMKSA cache entry (IEEE 802.1X)");
        }
+
+#ifdef CONFIG_WPS
+       if (!success && (sta->flags & WLAN_STA_WPS)) {
+               /*
+                * Many devices require deauthentication after WPS provisioning
+                * and some may not be be able to do that themselves, so
+                * disconnect the client here.
+                */
+               wpa_printf(MSG_DEBUG, "WPS: Force disconnection after "
+                          "EAP-Failure");
+               /* Add a small sleep to increase likelihood of previously
+                * requested EAP-Failure TX getting out before this should the
+                * driver reorder operations.
+                */
+               os_sleep(0, 10000);
+               ap_sta_disconnect(hapd, sta, sta->addr,
+                                 WLAN_REASON_PREV_AUTH_NOT_VALID);
+       }
+#endif /* CONFIG_WPS */
 }