Commit d18125b6 authored by Benjamin Berg's avatar Benjamin Berg Committed by Johannes Berg

wifi: cfg80211: parse all ML elements in an ML probe response

A probe response from a transmitting AP in an Multi-BSSID setup will
contain more than one Multi-Link element. Most likely, only one of these
elements contains per-STA profiles.

Fixes: 2481b5da ("wifi: cfg80211: handle BSS data contained in ML probe responses")
Signed-off-by: default avatarBenjamin Berg <benjamin.berg@intel.com>
Signed-off-by: default avatarMiri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240102213313.6635eb152735.I94289002d4a2f7b6b44dfa428344854e37b0b29c@changeidSigned-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 2a0698f8
...@@ -2617,10 +2617,12 @@ cfg80211_tbtt_info_for_mld_ap(const u8 *ie, size_t ielen, u8 mld_id, u8 link_id, ...@@ -2617,10 +2617,12 @@ cfg80211_tbtt_info_for_mld_ap(const u8 *ie, size_t ielen, u8 mld_id, u8 link_id,
return 0; return 0;
} }
static void cfg80211_parse_ml_sta_data(struct wiphy *wiphy, static void
struct cfg80211_inform_single_bss_data *tx_data, cfg80211_parse_ml_elem_sta_data(struct wiphy *wiphy,
struct cfg80211_bss *source_bss, struct cfg80211_inform_single_bss_data *tx_data,
gfp_t gfp) struct cfg80211_bss *source_bss,
const struct element *elem,
gfp_t gfp)
{ {
struct cfg80211_inform_single_bss_data data = { struct cfg80211_inform_single_bss_data data = {
.drv_data = tx_data->drv_data, .drv_data = tx_data->drv_data,
...@@ -2629,7 +2631,6 @@ static void cfg80211_parse_ml_sta_data(struct wiphy *wiphy, ...@@ -2629,7 +2631,6 @@ static void cfg80211_parse_ml_sta_data(struct wiphy *wiphy,
.bss_source = BSS_SOURCE_STA_PROFILE, .bss_source = BSS_SOURCE_STA_PROFILE,
}; };
struct ieee80211_multi_link_elem *ml_elem; struct ieee80211_multi_link_elem *ml_elem;
const struct element *elem;
struct cfg80211_mle *mle; struct cfg80211_mle *mle;
u16 control; u16 control;
u8 ml_common_len; u8 ml_common_len;
...@@ -2640,15 +2641,7 @@ static void cfg80211_parse_ml_sta_data(struct wiphy *wiphy, ...@@ -2640,15 +2641,7 @@ static void cfg80211_parse_ml_sta_data(struct wiphy *wiphy,
const u8 *pos; const u8 *pos;
u8 i; u8 i;
if (!source_bss) if (!ieee80211_mle_size_ok(elem->data + 1, elem->datalen - 1))
return;
if (tx_data->ftype != CFG80211_BSS_FTYPE_PRESP)
return;
elem = cfg80211_find_ext_elem(WLAN_EID_EXT_EHT_MULTI_LINK,
tx_data->ie, tx_data->ielen);
if (!elem || !ieee80211_mle_size_ok(elem->data + 1, elem->datalen - 1))
return; return;
ml_elem = (void *)elem->data + 1; ml_elem = (void *)elem->data + 1;
...@@ -2823,6 +2816,25 @@ static void cfg80211_parse_ml_sta_data(struct wiphy *wiphy, ...@@ -2823,6 +2816,25 @@ static void cfg80211_parse_ml_sta_data(struct wiphy *wiphy,
kfree(mle); kfree(mle);
} }
static void cfg80211_parse_ml_sta_data(struct wiphy *wiphy,
struct cfg80211_inform_single_bss_data *tx_data,
struct cfg80211_bss *source_bss,
gfp_t gfp)
{
const struct element *elem;
if (!source_bss)
return;
if (tx_data->ftype != CFG80211_BSS_FTYPE_PRESP)
return;
for_each_element_extid(elem, WLAN_EID_EXT_EHT_MULTI_LINK,
tx_data->ie, tx_data->ielen)
cfg80211_parse_ml_elem_sta_data(wiphy, tx_data, source_bss,
elem, gfp);
}
struct cfg80211_bss * struct cfg80211_bss *
cfg80211_inform_bss_data(struct wiphy *wiphy, cfg80211_inform_bss_data(struct wiphy *wiphy,
struct cfg80211_inform_bss *data, struct cfg80211_inform_bss *data,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment