diff options
author | Benjamin Berg <benjamin.berg@intel.com> | 2023-06-18 21:49:46 +0300 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2023-06-19 12:05:30 +0200 |
commit | eeec7574ec3c03c69adc99492df74dc1cc0ebd63 (patch) | |
tree | 097d2a1b7a87f89586edba317e313f636d3fc9a9 /net/mac80211 | |
parent | ce6e1f600b0cfc563a7d607de702262a58cd835d (diff) | |
download | lwn-eeec7574ec3c03c69adc99492df74dc1cc0ebd63.tar.gz lwn-eeec7574ec3c03c69adc99492df74dc1cc0ebd63.zip |
wifi: ieee80211: add helper to validate ML element type and size
The helper functions to retrieve the EML capabilities and medium
synchronization delay both assume that the type is correct. Instead of
assuming the length is correct and still checking the type, add a new
helper to check both and don't do any verification.
Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230618214435.1b50e7a3b3cf.I9385514d8eb6d6d3c82479a6fa732ef65313e554@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r-- | net/mac80211/mlme.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index b8f8220cd9ff..30588703ffd3 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -4852,7 +4852,8 @@ static int ieee80211_prep_channel(struct ieee80211_sub_if_data *sdata, /* data + 1 / datalen - 1 since it's an extended element */ if (eht_ml_elem && - ieee80211_mle_size_ok(eht_ml_elem->data + 1, + ieee80211_mle_type_ok(eht_ml_elem->data + 1, + IEEE80211_ML_CONTROL_TYPE_BASIC, eht_ml_elem->datalen - 1)) { sdata->vif.cfg.eml_cap = ieee80211_mle_get_eml_cap(eht_ml_elem->data + 1); |