AP MLD: Set link address only when non-AP MLD is not added to driver

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>
This commit is contained in:
Michael-CY Lee 2024-02-15 15:36:41 +08:00 committed by Jouni Malinen
parent 16abdac809
commit b653420a23

View 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));