diff mbox series

[56/76] wifi: mac80211: consider EHT element size in assoc request

Message ID 20220713114425.1002d927b883.Id031d730eddd29d80c86071d5c3b548c1a81ca61@changeid
State New
Headers show
Series wifi: more MLO work | expand

Commit Message

Johannes Berg July 13, 2022, 9:44 a.m. UTC
From: Johannes Berg <johannes.berg@intel.com>

We need to consider the (maximum) size of the EHT element
we'll add for the association request, otherwise we may run
out of space.

Fixes: 820acc810fb6 ("mac80211: Add EHT capabilities to association/probe request")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 net/mac80211/mlme.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index b56f2cefee44..f83d361ad50d 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -987,6 +987,9 @@  static int ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata)
 				sizeof(struct ieee80211_he_mcs_nss_supp) +
 				IEEE80211_HE_PPE_THRES_MAX_LEN +
 			2 + 1 + sizeof(struct ieee80211_he_6ghz_capa) +
+			2 + 1 + sizeof(struct ieee80211_eht_cap_elem) + /* EHT */
+			sizeof(struct ieee80211_eht_mcs_nss_supp) +
+			IEEE80211_EHT_PPE_THRES_MAX_LEN +
 			assoc_data->ie_len + /* extra IEs */
 			(assoc_data->fils_kek_len ? 16 /* AES-SIV */ : 0) +
 			9 + /* WMM */