From: Benjamin Berg <benjamin.berg@xxxxxxxxx> The AP MLD ADDR is already parsed out when updating the BSS and stored within the structure. As such, there is no point in parsing it out again and adding a separate argument just for that. Signed-off-by: Benjamin Berg <benjamin.berg@xxxxxxxxx> --- tests/test-bss.c | 3 +-- wpa_supplicant/bss.c | 7 ------- wpa_supplicant/bss.h | 1 - wpa_supplicant/events.c | 4 ++-- wpa_supplicant/sme.c | 5 +++-- 5 files changed, 6 insertions(+), 14 deletions(-) diff --git a/tests/test-bss.c b/tests/test-bss.c index 3c72f10106..0b82bd6e9d 100644 --- a/tests/test-bss.c +++ b/tests/test-bss.c @@ -62,7 +62,6 @@ void test_parse_basic_ml(struct wpa_supplicant *wpa_s, u8 mld_id, u8 ies[sizeof(rnr_ie) + sizeof(ml_ie_mld_id) + sizeof(mbssid_idx_ie)]; } bss; - u8 ap_mld_addr[ETH_ALEN]; u16 missing_links; u8 ret; bool nontransmitted; @@ -85,7 +84,7 @@ void test_parse_basic_ml(struct wpa_supplicant *wpa_s, u8 mld_id, bss.bss.ie_len += sizeof(mbssid_idx_ie); } - ret = wpa_bss_parse_basic_ml_element(wpa_s, &bss.bss, ap_mld_addr, + ret = wpa_bss_parse_basic_ml_element(wpa_s, &bss.bss, &missing_links, NULL, &nontransmitted); diff --git a/wpa_supplicant/bss.c b/wpa_supplicant/bss.c index fa5323468d..711dc7db26 100644 --- a/wpa_supplicant/bss.c +++ b/wpa_supplicant/bss.c @@ -1791,7 +1791,6 @@ wpa_bss_validate_rsne_ml(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid, * wpa_bss_parse_basic_ml_element - Parse the Basic Multi-Link element * @wpa_s: Pointer to wpa_supplicant data * @bss: BSS table entry - * @mld_addr: AP MLD address (or %NULL) * @link_info: Array to store link information (or %NULL), * should be initialized and #MAX_NUM_MLD_LINKS elements long * @missing_links: Result bitmask of links that were not discovered (or %NULL) @@ -1812,7 +1811,6 @@ wpa_bss_validate_rsne_ml(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid, */ int wpa_bss_parse_basic_ml_element(struct wpa_supplicant *wpa_s, struct wpa_bss *bss, - u8 *ap_mld_addr, u16 *missing_links, struct wpa_ssid *ssid, bool *nontransmitted) @@ -1919,11 +1917,6 @@ int wpa_bss_parse_basic_ml_element(struct wpa_supplicant *wpa_s, if (ml_basic_common_info->len < sizeof(*ml_basic_common_info) + pos) goto out; - /* Get the MLD address and MLD link ID */ - if (ap_mld_addr) - os_memcpy(ap_mld_addr, ml_basic_common_info->mld_addr, - ETH_ALEN); - link_id = ml_basic_common_info->variable[0] & EHT_ML_LINK_ID_MSK; bss->mld_link_id = link_id; diff --git a/wpa_supplicant/bss.h b/wpa_supplicant/bss.h index b75ae06b7a..fd560a9a8d 100644 --- a/wpa_supplicant/bss.h +++ b/wpa_supplicant/bss.h @@ -219,7 +219,6 @@ void calculate_update_time(const struct os_reltime *fetch_time, int wpa_bss_parse_basic_ml_element(struct wpa_supplicant *wpa_s, struct wpa_bss *bss, - u8 *ap_mld_addr, u16 *missing_links, struct wpa_ssid *ssid, bool *nontransmitted); diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c index 39a4e0b226..fe9e358f5d 100644 --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c @@ -1176,7 +1176,7 @@ static bool wpas_valid_ml_bss(struct wpa_supplicant *wpa_s, struct wpa_bss *bss) { u16 removed_links; - if (wpa_bss_parse_basic_ml_element(wpa_s, bss, NULL, NULL, NULL, NULL)) + if (wpa_bss_parse_basic_ml_element(wpa_s, bss, NULL, NULL, NULL)) return true; if (!bss->valid_links) @@ -1895,7 +1895,7 @@ static int wpa_supplicant_connect_ml_missing(struct wpa_supplicant *wpa_s, (wpa_s->drv_flags & WPA_DRIVER_FLAGS_SME))) return 0; - if (wpa_bss_parse_basic_ml_element(wpa_s, selected, NULL, + if (wpa_bss_parse_basic_ml_element(wpa_s, selected, &missing_links, ssid, &nontransmitted) || !missing_links) diff --git a/wpa_supplicant/sme.c b/wpa_supplicant/sme.c index 47c965bfdc..d32d315766 100644 --- a/wpa_supplicant/sme.c +++ b/wpa_supplicant/sme.c @@ -528,6 +528,7 @@ static void wpas_sme_set_mlo_links(struct wpa_supplicant *wpa_s, { u8 i; + os_memcpy(wpa_s->ap_mld_addr, bss->mld_addr, ETH_ALEN); wpa_s->valid_links = 0; wpa_s->mlo_assoc_link_id = bss->mld_link_id; @@ -613,8 +614,8 @@ static void sme_send_authentication(struct wpa_supplicant *wpa_s, os_memset(¶ms, 0, sizeof(params)); if ((wpa_s->drv_flags2 & WPA_DRIVER_FLAGS2_MLO) && - !wpa_bss_parse_basic_ml_element(wpa_s, bss, wpa_s->ap_mld_addr, - NULL, ssid, NULL) && + !wpa_bss_parse_basic_ml_element(wpa_s, bss, NULL, + ssid, NULL) && bss->valid_links) { wpa_printf(MSG_DEBUG, "MLD: In authentication"); wpas_sme_set_mlo_links(wpa_s, bss, ssid); -- 2.49.0 _______________________________________________ Hostap mailing list Hostap@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/hostap