]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
AP MLD: Set link address only when non-AP MLD is not added to driver
authorMichael-CY Lee <michael-cy.lee@mediatek.com>
Thu, 15 Feb 2024 07:36:41 +0000 (15:36 +0800)
committerJouni Malinen <j@w1.fi>
Sun, 3 Mar 2024 19:33:46 +0000 (21:33 +0200)
Once the non-AP MLD is added to the driver, the driver handles the
address translation so that hostapd receives Management frames with
SA/DA being translated into MLD MAC addresses.

If the Authentication frmae is retransmitted with transaction being 1,
SA of the retransmitted Authentication frame is translated into the MLD
MAC address by the driver, and then in the function handle_auth(),
sta->mld_info.links[].peer_addr would be replaced by the MLD MAC address
even though it is supposed to be the link address.

Therefore, update the MLD information only when the STA has not yet been
added into the driver to avoid replacing the previously determined link
address with the MLD MAC address.

Fixes: bcbe80a66 ("AP: MLO: Handle Multi-Link element during authentication")
Signed-off-by: Michael-CY Lee <michael-cy.lee@mediatek.com>
src/ap/ieee802_11.c

index 8b8c1f09584050263f11841cae9bde472b095793..41508ff509c00959480347662bc908a4fd9d4cd2 100644 (file)
@@ -3078,7 +3078,12 @@ static void handle_auth(struct hostapd_data *hapd,
        }
 
 #ifdef CONFIG_IEEE80211BE
-       if (auth_transaction == 1) {
+       /* Set the non-AP MLD information based on the initial Authentication
+        * frame. Once the STA entry has been added to the driver, the driver
+        * will translate addresses in the frame and we need to avoid overriding
+        * peer_addr based on mgmt->sa which would have been translated to the
+        * MLD MAC address. */
+       if (!sta->added_unassoc && auth_transaction == 1) {
                ap_sta_free_sta_profile(&sta->mld_info);
                os_memset(&sta->mld_info, 0, sizeof(sta->mld_info));