]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
AP MLD: Do not store per-supplicant AP MLD MAC address information
authorJouni Malinen <quic_jouni@quicinc.com>
Mon, 22 Apr 2024 10:31:43 +0000 (13:31 +0300)
committerJouni Malinen <j@w1.fi>
Mon, 22 Apr 2024 11:38:59 +0000 (14:38 +0300)
There is no need to store the AP MLD MAC address within per-supplicant
data structure in struct wpa_state_machine since that MLD MAC address is
available from the generic authenticator data in struct
wpa_authenticator.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
src/ap/drv_callbacks.c
src/ap/ieee802_11.c
src/ap/wpa_auth.c
src/ap/wpa_auth.h
src/ap/wpa_auth_i.h

index e026d9a6e05b9648d915294cc2e2d8a4c366b380..25e008ad25da074e16ad3a9232eb3fb4a99ad6a7 100644 (file)
@@ -517,7 +517,7 @@ int hostapd_notif_assoc(struct hostapd_data *hapd, const u8 *addr,
                if (ap_sta_is_mld(hapd, sta)) {
                        wpa_printf(MSG_DEBUG,
                                   "MLD: Set ML info in RSN Authenticator");
-                       wpa_auth_set_ml_info(sta->wpa_sm, hapd->mld->mld_addr,
+                       wpa_auth_set_ml_info(sta->wpa_sm,
                                             sta->mld_assoc_link_id,
                                             &sta->mld_info);
                }
index a2b02ee015eb273e3732d48ef5cc1b5d2aacaed7..4fd86b715a7b2fb24e6547acae8974d44454b8c3 100644 (file)
@@ -3763,7 +3763,7 @@ u16 owe_process_rsn_ie(struct hostapd_data *hapd,
        }
 #ifdef CONFIG_IEEE80211BE
        if (ap_sta_is_mld(hapd, sta))
-               wpa_auth_set_ml_info(sta->wpa_sm, hapd->mld->mld_addr,
+               wpa_auth_set_ml_info(sta->wpa_sm,
                                     sta->mld_assoc_link_id, &sta->mld_info);
 #endif /* CONFIG_IEEE80211BE */
        rsn_ie -= 2;
@@ -4056,7 +4056,6 @@ static int __check_assoc_ies(struct hostapd_data *hapd, struct sta_info *sta,
                                   "MLD: %s ML info in RSN Authenticator",
                                   init ? "Set" : "Reset");
                        wpa_auth_set_ml_info(sta->wpa_sm,
-                                            hapd->mld->mld_addr,
                                             sta->mld_assoc_link_id,
                                             info);
                }
index 9b6e6430ab4a0e1eb676333eb0b2f5aae8437971..2b985ad10b7e61149bc01763d488d509bbaa41b0 100644 (file)
@@ -90,7 +90,7 @@ static const u8 * wpa_auth_get_aa(const struct wpa_state_machine *sm)
 {
 #ifdef CONFIG_IEEE80211BE
        if (sm->mld_assoc_link_id >= 0)
-               return sm->own_mld_addr;
+               return sm->wpa_auth->mld_addr;
 #endif /* CONFIG_IEEE80211BE */
        return sm->wpa_auth->addr;
 }
@@ -2806,7 +2806,7 @@ SM_STATE(WPA_PTK, PTKSTART)
                           "RSN: MLD: Add MAC Address KDE: kde_len=%zu",
                           kde_len);
                wpa_add_kde(buf + kde_len, RSN_KEY_DATA_MAC_ADDR,
-                           sm->own_mld_addr, ETH_ALEN, NULL, 0);
+                           sm->wpa_auth->mld_addr, ETH_ALEN, NULL, 0);
                kde_len += 2 + RSN_SELECTOR_LEN + ETH_ALEN;
        }
 #endif /* CONFIG_IEEE80211BE */
@@ -4441,7 +4441,7 @@ static u8 * wpa_auth_ml_kdes(struct wpa_state_machine *sm, u8 *pos)
 
        wpa_printf(MSG_DEBUG, "RSN: MLD: Adding MAC Address KDE");
        pos = wpa_add_kde(pos, RSN_KEY_DATA_MAC_ADDR,
-                         sm->own_mld_addr, ETH_ALEN, NULL, 0);
+                         sm->wpa_auth->mld_addr, ETH_ALEN, NULL, 0);
 
        for (link_id = 0; link_id < MAX_NUM_MLD_LINKS; link_id++) {
                if (!sm->mld_links[link_id].valid)
@@ -7114,7 +7114,7 @@ void wpa_auth_sta_radius_psk_resp(struct wpa_state_machine *sm, bool success)
 }
 
 
-void wpa_auth_set_ml_info(struct wpa_state_machine *sm, const u8 *mld_addr,
+void wpa_auth_set_ml_info(struct wpa_state_machine *sm,
                          u8 mld_assoc_link_id, struct mld_info *info)
 {
 #ifdef CONFIG_IEEE80211BE
@@ -7130,7 +7130,6 @@ void wpa_auth_set_ml_info(struct wpa_state_machine *sm, const u8 *mld_addr,
        wpa_auth_logger(sm->wpa_auth, wpa_auth_get_spa(sm), LOGGER_DEBUG,
                        "MLD: Initialization");
 
-       os_memcpy(sm->own_mld_addr, mld_addr, ETH_ALEN);
        os_memcpy(sm->peer_mld_addr, info->common_info.mld_addr, ETH_ALEN);
 
        sm->mld_assoc_link_id = mld_assoc_link_id;
@@ -7176,7 +7175,7 @@ void wpa_auth_set_ml_info(struct wpa_state_machine *sm, const u8 *mld_addr,
                        wpa_printf(MSG_ERROR,
                                   "Unable to find authenticator object for ML STA "
                                   MACSTR " on link " MACSTR " link id %d",
-                                  MAC2STR(sm->own_mld_addr),
+                                  MAC2STR(sm->wpa_auth->mld_addr),
                                   MAC2STR(sm_link->own_addr),
                                   link_id);
        }
index 117ac1d48bf0e14e79c9474fc8a87bad32f5c76f..a8f2fc62285f7ed008e2cad09a36bdda4df9b4a7 100644 (file)
@@ -646,7 +646,7 @@ void wpa_auth_set_ocv_override_freq(struct wpa_authenticator *wpa_auth,
 
 void wpa_auth_sta_radius_psk_resp(struct wpa_state_machine *sm, bool success);
 
-void wpa_auth_set_ml_info(struct wpa_state_machine *sm, const u8 *mld_addr,
+void wpa_auth_set_ml_info(struct wpa_state_machine *sm,
                          u8 mld_assoc_link_id, struct mld_info *info);
 void wpa_auth_ml_get_rsn_info(struct wpa_authenticator *a,
                              struct wpa_auth_ml_link_rsn_info *info);
index ac45cc413eb6ac1ee501d077d81905f32388c7ed..07204c7c48cc9552ca84814d62e77f7ca7e641a7 100644 (file)
@@ -172,7 +172,6 @@ struct wpa_state_machine {
 #endif /* CONFIG_TESTING_OPTIONS */
 
 #ifdef CONFIG_IEEE80211BE
-       u8 own_mld_addr[ETH_ALEN];
        u8 peer_mld_addr[ETH_ALEN];
        s8 mld_assoc_link_id;
        u8 n_mld_affiliated_links;