From: Benjamin Berg Date: Wed, 18 Jun 2025 12:35:24 +0000 (+0200) Subject: BSS: Drop AP MLD MAC address from return parameters for MLE parsing X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=884d231b260451756b197bff29f729632974ef05;p=thirdparty%2Fhostap.git BSS: Drop AP MLD MAC address from return parameters for MLE parsing The AP MLD MAC address 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 --- diff --git a/tests/test-bss.c b/tests/test-bss.c index fd3ab1e08..ac9fab864 100644 --- a/tests/test-bss.c +++ b/tests/test-bss.c @@ -60,7 +60,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; @@ -83,7 +82,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 d7a1b1aa5..db73bfacf 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 b75ae06b7..fd560a9a8 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 2c9360b70..555023776 100644 --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c @@ -1179,7 +1179,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) @@ -1898,7 +1898,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 47c965bfd..a2901b96f 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,7 @@ 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);