aboutsummaryrefslogtreecommitdiffstats
path: root/src/drivers/driver_atheros.c
diff options
context:
space:
mode:
authorJouni Malinen <jouni.malinen@atheros.com>2010-09-25 00:01:03 (GMT)
committerJouni Malinen <j@w1.fi>2010-09-25 00:01:03 (GMT)
commit12970f8a5798870b1f7f1c9958f1780921b04232 (patch)
tree390ae3351908c7ae474b6ca382048021512879ad /src/drivers/driver_atheros.c
parent6d1031b97166cec52915f31eb13ccd3a9b92ec9e (diff)
downloadhostap-12970f8a5798870b1f7f1c9958f1780921b04232.zip
hostap-12970f8a5798870b1f7f1c9958f1780921b04232.tar.gz
hostap-12970f8a5798870b1f7f1c9958f1780921b04232.tar.bz2
atheros: Prefer WSC IE in (Re)Association Request frame
This is needed to work properly with WPS stations that may include both WPA/RSN IE and WSC IE when associating for WPS provisioning.
Diffstat (limited to 'src/drivers/driver_atheros.c')
-rw-r--r--src/drivers/driver_atheros.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/drivers/driver_atheros.c b/src/drivers/driver_atheros.c
index c0dd731..27107aa 100644
--- a/src/drivers/driver_atheros.c
+++ b/src/drivers/driver_atheros.c
@@ -799,6 +799,10 @@ madwifi_new_sta(struct madwifi_driver_data *drv, u8 addr[IEEE80211_ADDR_LEN])
ie.wpa_ie, IEEE80211_MAX_OPT_IE);
wpa_hexdump(MSG_MSGDUMP, "madwifi req RSN IE",
ie.rsn_ie, IEEE80211_MAX_OPT_IE);
+#ifdef ATH_WPS_IE
+ wpa_hexdump(MSG_MSGDUMP, "madwifi req WPS IE",
+ ie.wps_ie, IEEE80211_MAX_OPT_IE);
+#endif /* ATH_WPS_IE */
iebuf = ie.wpa_ie;
/* madwifi seems to return some random data if WPA/RSN IE is not set.
* Assume the IE was not included if the IE type is unknown. */
@@ -813,6 +817,16 @@ madwifi_new_sta(struct madwifi_driver_data *drv, u8 addr[IEEE80211_ADDR_LEN])
}
ielen = iebuf[1];
+
+#ifdef ATH_WPS_IE
+ /* if WPS IE is present, preference is given to WPS */
+ if (ie.wps_ie &&
+ (ie.wps_ie[1] > 0 && (ie.wps_ie[0] == WLAN_EID_VENDOR_SPECIFIC))) {
+ iebuf = ie.wps_ie;
+ ielen = ie.wps_ie[1];
+ }
+#endif /* ATH_WPS_IE */
+
if (ielen == 0)
iebuf = NULL;
else