aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <jouni.malinen@atheros.com>2010-07-06 19:56:02 (GMT)
committerJouni Malinen <j@w1.fi>2010-09-05 14:23:08 (GMT)
commitb2f70aa2ea790399e235b8184d4db2538df6d0d8 (patch)
treec1204d6d0de412bcb8799575fb9b4b3893ef2896
parent4fcd811d508750d028c959db0753c57c2c4f3e42 (diff)
downloadhostap-07-b2f70aa2ea790399e235b8184d4db2538df6d0d8.zip
hostap-07-b2f70aa2ea790399e235b8184d4db2538df6d0d8.tar.gz
hostap-07-b2f70aa2ea790399e235b8184d4db2538df6d0d8.tar.bz2
WPS: Force disconnection after provisioning step
This works around some problems where the station is unable to disconnect for some reason (e.g., if EAP-Failure gets dropped). (cherry picked from commit 32397063032b28a255daca42f8902a3e7e202dd9)
-rw-r--r--src/ap/ieee802_1x.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/ap/ieee802_1x.c b/src/ap/ieee802_1x.c
index b8676ed..4ab1001 100644
--- a/src/ap/ieee802_1x.c
+++ b/src/ap/ieee802_1x.c
@@ -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 */
}