diff mbox series

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

Message ID 20240215073641.31093-1-michael-cy.lee@mediatek.com
State Accepted
Headers show
Series AP MLD: set the link address only when the non-AP MLD is not added to the driver | expand

Commit Message

Michael-CY Lee Feb. 15, 2024, 7:36 a.m. UTC
Once the non-AP MLD is added to the driver, the driver handles the
address translation so that hostapd receives mgmt. with SA/DA being
translated into MLD addresses.

If the authentication request is re-transmitted with transaction being 1,
SA of the re-transmitted request is translated into MLD address by the
driver, and then in the function handle_auth(),
sta->mld_info.links[].peer_addr is replaced by the MLD address.

Therefore, only when the STA is not added into the driver that the link
address can be set.

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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jouni Malinen March 3, 2024, 7:56 p.m. UTC | #1
On Thu, Feb 15, 2024 at 03:36:41PM +0800, Michael-CY Lee wrote:
> Once the non-AP MLD is added to the driver, the driver handles the
> address translation so that hostapd receives mgmt. with SA/DA being
> translated into MLD addresses.
> 
> If the authentication request is re-transmitted with transaction being 1,
> SA of the re-transmitted request is translated into MLD address by the
> driver, and then in the function handle_auth(),
> sta->mld_info.links[].peer_addr is replaced by the MLD address.
> 
> Therefore, only when the STA is not added into the driver that the link
> address can be set.

Thanks, applied.

> diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
> @@ -3077,7 +3077,7 @@ static void handle_auth(struct hostapd_data *hapd,
>  #ifdef CONFIG_IEEE80211BE
> -	if (auth_transaction == 1) {
> +	if (!sta->added_unassoc) {
>  		ap_sta_free_sta_profile(&sta->mld_info);
>  		os_memset(&sta->mld_info, 0, sizeof(sta->mld_info));

Though, I left that auth_transaction == 1 as an additional condition
here instead of fully replacing it.
diff mbox series

Patch

diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
index 7fb49a4b4..9b6a8d0fa 100644
--- a/src/ap/ieee802_11.c
+++ b/src/ap/ieee802_11.c
@@ -3077,7 +3077,7 @@  static void handle_auth(struct hostapd_data *hapd,
 	}
 
 #ifdef CONFIG_IEEE80211BE
-	if (auth_transaction == 1) {
+	if (!sta->added_unassoc) {
 		ap_sta_free_sta_profile(&sta->mld_info);
 		os_memset(&sta->mld_info, 0, sizeof(sta->mld_info));