aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/sme.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2012-12-22 17:17:15 (GMT)
committerJouni Malinen <j@w1.fi>2012-12-22 17:17:15 (GMT)
commit03e47c9c3a616cd7ef474498aa390438a93ad577 (patch)
tree3d7915b6c0e346a9d0b67222031d08c9102a67f8 /wpa_supplicant/sme.c
parenta5e1eb2092953e4a7717a547cbe0ccb2457e6ce0 (diff)
downloadhostap-03e47c9c3a616cd7ef474498aa390438a93ad577.zip
hostap-03e47c9c3a616cd7ef474498aa390438a93ad577.tar.gz
hostap-03e47c9c3a616cd7ef474498aa390438a93ad577.tar.bz2
Share a single function for building extended capabilities element
This makes it easier to update extended capabilities for all uses within wpa_supplicant. Signed-hostap: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'wpa_supplicant/sme.c')
-rw-r--r--wpa_supplicant/sme.c23
1 files changed, 7 insertions, 16 deletions
diff --git a/wpa_supplicant/sme.c b/wpa_supplicant/sme.c
index 885219f..77ad1d2 100644
--- a/wpa_supplicant/sme.c
+++ b/wpa_supplicant/sme.c
@@ -94,7 +94,8 @@ static void sme_send_authentication(struct wpa_supplicant *wpa_s,
#endif /* CONFIG_IEEE80211R */
int i, bssid_changed;
struct wpabuf *resp = NULL;
- u32 ext_capab;
+ u8 ext_capab[10];
+ int ext_capab_len;
if (bss == NULL) {
wpa_msg(wpa_s, MSG_ERROR, "SME: No scan result available for "
@@ -309,26 +310,16 @@ static void sme_send_authentication(struct wpa_supplicant *wpa_s,
}
#endif /* CONFIG_HS20 */
- ext_capab = 0;
-#ifdef CONFIG_INTERWORKING
- if (wpa_s->conf->interworking)
- ext_capab |= BIT(31); /* Interworking */
-#endif /* CONFIG_INTERWORKING */
-#ifdef CONFIG_WNM
- ext_capab |= BIT(17); /* WNM-Sleep Mode */
-#endif /* CONFIG_WNM */
-
- if (ext_capab) {
+ ext_capab_len = wpas_build_ext_capab(wpa_s, ext_capab);
+ if (ext_capab_len > 0) {
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,
+ os_memmove(pos + ext_capab_len, 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;
- WPA_PUT_LE32(pos, ext_capab);
+ wpa_s->sme.assoc_req_ie_len += ext_capab_len;
+ os_memcpy(pos, ext_capab, ext_capab_len);
}
#ifdef CONFIG_SAE