Add Extended Capability element to AssocReq for Interworking

If Interworking is enabled, add Extended Capability element to
(Re)Association Request frames to indicate support for Interworking.
This commit is contained in:
Jouni Malinen 2011-10-16 19:04:46 +03:00 committed by Jouni Malinen
parent 46ee0427b1
commit 92cbcf9128
2 changed files with 34 additions and 0 deletions

View File

@ -237,6 +237,24 @@ void sme_authenticate(struct wpa_supplicant *wpa_s,
}
#endif /* CONFIG_P2P */
#ifdef CONFIG_INTERWORKING
if (wpa_s->conf->interworking) {
u8 *pos = wpa_s->sme.assoc_req_ie;
if (wpa_s->sme.assoc_req_ie_len > 0 && pos[0] == WLAN_EID_RSN)
pos += 2 + pos[1];
os_memmove(pos + 6, pos,
wpa_s->sme.assoc_req_ie_len -
(pos - wpa_s->sme.assoc_req_ie));
wpa_s->sme.assoc_req_ie_len += 6;
*pos++ = WLAN_EID_EXT_CAPAB;
*pos++ = 4;
*pos++ = 0x00;
*pos++ = 0x00;
*pos++ = 0x00;
*pos++ = 0x80; /* Bit 31 - Interworking */
}
#endif /* CONFIG_INTERWORKING */
wpa_supplicant_cancel_sched_scan(wpa_s);
wpa_supplicant_cancel_scan(wpa_s);

View File

@ -1289,6 +1289,22 @@ void wpa_supplicant_associate(struct wpa_supplicant *wpa_s,
}
#endif /* CONFIG_P2P */
#ifdef CONFIG_INTERWORKING
if (wpa_s->conf->interworking) {
u8 *pos = wpa_ie;
if (wpa_ie_len > 0 && pos[0] == WLAN_EID_RSN)
pos += 2 + pos[1];
os_memmove(pos + 6, pos, wpa_ie_len - (pos - wpa_ie));
wpa_ie_len += 6;
*pos++ = WLAN_EID_EXT_CAPAB;
*pos++ = 4;
*pos++ = 0x00;
*pos++ = 0x00;
*pos++ = 0x00;
*pos++ = 0x80; /* Bit 31 - Interworking */
}
#endif /* CONFIG_INTERWORKING */
wpa_clear_keys(wpa_s, bss ? bss->bssid : NULL);
use_crypt = 1;
cipher_pairwise = cipher_suite2driver(wpa_s->pairwise_cipher);