static void parse_basic_ml(const u8 *ie, size_t len, bool ap,
struct wlantest_sta *sta)
{
- const u8 *pos, *end, *ci_end, *info_end;
+ const u8 *pos, *end, *ci_end, *info_end, *li_end;
u16 ctrl, eml, cap;
const struct element *elem;
+ wpa_hexdump(MSG_MSGDUMP, "Basic MLE", ie, len);
pos = ie;
end = ie + len;
ci_end = pos + len;
pos++;
+ wpa_hexdump(MSG_MSGDUMP, "Basic MLE - Common Info", pos, ci_end - pos);
wpa_printf(MSG_DEBUG, "MLD MAC Address: " MACSTR, MAC2STR(pos));
if (!ap && sta && is_zero_ether_addr(sta->mld_mac_addr)) {
os_memcpy(sta->mld_mac_addr, pos, ETH_ALEN);
}
/* Link Info */
+ wpa_hexdump(MSG_MSGDUMP, "Basic MLE - Link Info", pos, end - pos);
- for_each_element(elem, pos, end - pos) {
+ li_end = end;
+ for_each_element(elem, pos, li_end - pos) {
u8 link_id;
if (elem->id != EHT_ML_SUB_ELEM_PER_STA_PROFILE) {
"Truncated Per-STA Profile subelement");
continue;
}
+ wpa_hexdump(MSG_MSGDUMP, "Basic MLE - Per-STA Profile",
+ pos, end - pos);
ctrl = WPA_GET_LE16(pos);
pos += 2;
}
+static void parse_basic_ml_elems(struct ieee802_11_elems *elems, bool ap,
+ struct wlantest_sta *sta)
+{
+ struct wpabuf *mlbuf;
+
+ mlbuf = ieee802_11_defrag_mle(elems, MULTI_LINK_CONTROL_TYPE_BASIC);
+ if (mlbuf) {
+ parse_basic_ml(wpabuf_head(mlbuf), wpabuf_len(mlbuf), ap, sta);
+ wpabuf_free(mlbuf);
+ }
+}
+
+
static void rx_mgmt_beacon(struct wlantest *wt, const u8 *data, size_t len)
{
const struct ieee80211_mgmt *mgmt;
if (trans == 1) {
if (elems.basic_mle)
- parse_basic_ml(elems.basic_mle, elems.basic_mle_len,
- false, sta);
+ parse_basic_ml_elems(&elems, false, sta);
sta->key_mgmt = parse.key_mgmt;
sta->pairwise_cipher = parse.pairwise_cipher;
if (parse.fte_snonce)
" from Association Request (assoc link)",
bss->link_id, MAC2STR(mgmt->sa));
}
- parse_basic_ml(elems.basic_mle, elems.basic_mle_len, false,
- sta);
+ parse_basic_ml_elems(&elems, false, sta);
dump_mld_info(wt, sta);
}
}
aid & 0x3fff);
ml = get_ml_ie(ies, ies_len, MULTI_LINK_CONTROL_TYPE_BASIC);
- if (ml)
- parse_basic_ml(ml + 3, ml[1], true, NULL);
+ if (ml &&
+ ieee802_11_parse_elems(ies, ies_len, &elems, 0) != ParseFailed)
+ parse_basic_ml_elems(&elems, true, NULL);
if (sta->auth_alg == WLAN_AUTH_FILS_SK) {
const u8 *session, *frame_ad, *frame_ad_end, *encr_end;
" from Reassociation Request (assoc link)",
bss->link_id, MAC2STR(mgmt->sa));
}
- parse_basic_ml(elems.basic_mle, elems.basic_mle_len, false,
- sta);
+ parse_basic_ml_elems(&elems, false, sta);
dump_mld_info(wt, sta);
}
aid & 0x3fff);
ml = get_ml_ie(ies, ies_len, MULTI_LINK_CONTROL_TYPE_BASIC);
- if (ml)
- parse_basic_ml(ml + 3, ml[1], true, NULL);
+ if (ml &&
+ ieee802_11_parse_elems(ies, ies_len, &elems, 0) != ParseFailed)
+ parse_basic_ml_elems(&elems, true, NULL);
if (sta->auth_alg == WLAN_AUTH_FILS_SK) {
const u8 *session, *frame_ad, *frame_ad_end, *encr_end;