aboutsummaryrefslogtreecommitdiffstats
path: root/hostapd
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2008-01-13 01:43:17 (GMT)
committerJouni Malinen <j@w1.fi>2008-01-13 01:43:17 (GMT)
commitbf817611705b1091b1e78894f633e83e9d4d3be6 (patch)
tree1ef2d5f5d443dbc8a4fd3523541850a017d2f1dc /hostapd
parent4f0909b24c0e52e8c538e3e870d1eeae955c1d99 (diff)
downloadhostap-history-bf817611705b1091b1e78894f633e83e9d4d3be6.zip
hostap-history-bf817611705b1091b1e78894f633e83e9d4d3be6.tar.gz
hostap-history-bf817611705b1091b1e78894f633e83e9d4d3be6.tar.bz2
madwifi: Work around bogus IEEE80211_IOCTL_GETWPAIE data if no WPA/RSN IE
madwifi driver 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. This is needed to cleanly handle WPS association that does not include WPA/RSN IE. If the bogus data starts with a matching IE type field, the association is still likely to fail, but at least it is much less likely to happen now.
Diffstat (limited to 'hostapd')
-rw-r--r--hostapd/driver_madwifi.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/hostapd/driver_madwifi.c b/hostapd/driver_madwifi.c
index 84adf16..2ccffeb 100644
--- a/hostapd/driver_madwifi.c
+++ b/hostapd/driver_madwifi.c
@@ -801,12 +801,22 @@ madwifi_process_wpa_ie(struct madwifi_driver_data *drv, struct sta_info *sta)
printf("Failed to get WPA/RSN information element.\n");
return -1; /* XXX not right */
}
+ wpa_hexdump(MSG_MSGDUMP, "madwifi req WPA IE",
+ ie.wpa_ie, IEEE80211_MAX_OPT_IE);
+ wpa_hexdump(MSG_MSGDUMP, "madwifi req RSN IE",
+ ie.rsn_ie, IEEE80211_MAX_OPT_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. */
+ if (iebuf[0] != WLAN_EID_VENDOR_SPECIFIC)
+ iebuf[1] = 0;
#ifdef MADWIFI_NG
if (iebuf[1] == 0 && ie.rsn_ie[1] > 0) {
/* madwifi-ng svn #1453 added rsn_ie. Use it, if wpa_ie was not
* set. This is needed for WPA2. */
iebuf = ie.rsn_ie;
+ if (iebuf[0] != WLAN_EID_RSN)
+ iebuf[1] = 0;
}
#endif /* MADWIFI_NG */
ielen = iebuf[1];