]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
BSS: Drop AP MLD MAC address from return parameters for MLE parsing
authorBenjamin Berg <benjamin.berg@intel.com>
Wed, 18 Jun 2025 12:35:24 +0000 (14:35 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 2 Oct 2025 16:40:17 +0000 (19:40 +0300)
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 <benjamin.berg@intel.com>
tests/test-bss.c
wpa_supplicant/bss.c
wpa_supplicant/bss.h
wpa_supplicant/events.c
wpa_supplicant/sme.c

index fd3ab1e08148f3996fea3b7df422fae89b45b718..ac9fab864bb46b0041a13b574a788e7f1ac6dfec 100644 (file)
@@ -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);
 
index d7a1b1aa5c6fba5f0831ec0cb91eeb7f71427c23..db73bfacf3e8efb02c451c581831fee9dfc4f5bc 100644 (file)
@@ -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;
index b75ae06b7a193db0aaaf18b6d006336993da9d6c..fd560a9a8d9721c8bc030f915942470aa62f670c 100644 (file)
@@ -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);
index 2c9360b7049027d88ed34ef868cb9dd6a803ed9b..555023776fed82daefe44d6e31ead7f4d1a044a0 100644 (file)
@@ -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)
index 47c965bfdc70f96075f98fc4477b4069b77209ce..a2901b96f197ed05bace65d5462e179f01fa5b97 100644 (file)
@@ -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(&params, 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);