1 --- hostapd-0.4.7/driver_madwifi.c 2006-01-30 10:00:44.199096000 -0800
2 +++ hostapd-0.4.7-new/driver_madwifi.c 2006-01-30 10:05:55.925511000 -0800
4 struct hostapd_data *hapd = drv->hapd;
5 struct ieee80211req_wpaie ie;
10 * Fetch negotiated WPA/RSN parameters from the system.
12 printf("Failed to get WPA/RSN information element.\n");
13 return -1; /* XXX not right */
15 - ielen = ie.wpa_ie[1];
17 + if ((ie.wpa_ie[1] == 0) && (ie.rsn_ie[1] == 0)){
18 printf("No WPA/RSN information element for station!?\n");
19 return -1; /* XXX not right */
21 + ielen = ie.rsn_ie[1];
23 - res = wpa_validate_wpa_ie(hapd, sta, ie.wpa_ie, ielen,
24 - ie.wpa_ie[0] == WLAN_EID_RSN ?
25 - HOSTAPD_WPA_VERSION_WPA2 : HOSTAPD_WPA_VERSION_WPA);
26 - if (res != WPA_IE_OK) {
27 - printf("WPA/RSN information element rejected? (res %u)\n", res);
30 + res = wpa_validate_wpa_ie(hapd, sta, ie.rsn_ie, ielen,
31 + HOSTAPD_WPA_VERSION_WPA2);
32 + if (res != WPA_IE_OK){
33 + // now look for WPA IE
34 + ielen = ie.wpa_ie[1];
36 + res = wpa_validate_wpa_ie(hapd, sta, ie.wpa_ie, ielen,
37 + HOSTAPD_WPA_VERSION_WPA);
38 + if (res != WPA_IE_OK) {
39 + printf("WPA/RSN information element rejected? (res %u)\n", res);
46 sta->wpa_ie = malloc(ielen);
47 if (sta->wpa_ie == NULL) {
48 printf("No memory to save WPA/RSN information element!\n");
51 - memcpy(sta->wpa_ie, ie.wpa_ie, ielen);
53 + memcpy(sta->wpa_ie, ie.rsn_ie, ielen);
55 + memcpy(sta->wpa_ie, ie.wpa_ie, ielen);
56 sta->wpa_ie_len = ielen;