From: Kiran Kumar Lokere Date: Thu, 9 Feb 2023 08:25:30 +0000 (-0800) Subject: TDLS: Copy peer's EHT capabilities X-Git-Tag: hostap_2_11~985 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a41c8dbdd84e54c580d9f8f419f3411fa4d78720;p=thirdparty%2Fhostap.git TDLS: Copy peer's EHT capabilities This is needed to be able to configure the STA entry into the driver with the information for EHT. Signed-off-by: Jouni Malinen --- diff --git a/src/rsn_supp/tdls.c b/src/rsn_supp/tdls.c index 47953b427..8eb74ac22 100644 --- a/src/rsn_supp/tdls.c +++ b/src/rsn_supp/tdls.c @@ -139,6 +139,8 @@ struct wpa_tdls_peer { struct ieee80211_he_capabilities *he_capabilities; size_t he_capab_len; struct ieee80211_he_6ghz_band_cap *he_6ghz_band_capabilities; + struct ieee80211_eht_capabilities *eht_capabilities; + size_t eht_capab_len; u8 qos_info; @@ -718,6 +720,8 @@ static void wpa_tdls_peer_clear(struct wpa_sm *sm, struct wpa_tdls_peer *peer) peer->he_capabilities = NULL; os_free(peer->he_6ghz_band_capabilities); peer->he_6ghz_band_capabilities = NULL; + os_free(peer->eht_capabilities); + peer->eht_capabilities = NULL; os_free(peer->ext_capab); peer->ext_capab = NULL; os_free(peer->supp_channels); @@ -1752,6 +1756,29 @@ static int copy_peer_ext_capab(const struct wpa_eapol_ie_parse *kde, } +static int copy_peer_eht_capab(const struct wpa_eapol_ie_parse *kde, + struct wpa_tdls_peer *peer) +{ + if (!kde->eht_capabilities) { + wpa_printf(MSG_DEBUG, "TDLS: No EHT capabilities received"); + return 0; + } + + os_free(peer->eht_capabilities); + peer->eht_capab_len = 0; + peer->eht_capabilities = os_memdup(kde->eht_capabilities, + kde->eht_capab_len); + if (!peer->eht_capabilities) + return -1; + + peer->eht_capab_len = kde->eht_capab_len; + wpa_hexdump(MSG_DEBUG, "TDLS: Peer EHT capabilities", + peer->eht_capabilities, peer->eht_capab_len); + + return 0; +} + + static int copy_peer_wmm_capab(const struct wpa_eapol_ie_parse *kde, struct wpa_tdls_peer *peer) { @@ -1980,6 +2007,9 @@ static int wpa_tdls_process_tpk_m1(struct wpa_sm *sm, const u8 *src_addr, copy_peer_he_6ghz_band_capab(&kde, peer) < 0) goto error; + if (copy_peer_eht_capab(&kde, peer) < 0) + goto error; + if (copy_peer_ext_capab(&kde, peer) < 0) goto error; @@ -2390,6 +2420,9 @@ static int wpa_tdls_process_tpk_m2(struct wpa_sm *sm, const u8 *src_addr, copy_peer_he_6ghz_band_capab(&kde, peer) < 0) goto error; + if (copy_peer_eht_capab(&kde, peer) < 0) + goto error; + if (copy_peer_ext_capab(&kde, peer) < 0) goto error;