From patchwork Thu Feb 15 07:36:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael-CY Lee X-Patchwork-Id: 1899208 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=KPBZ0E8G; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=mediatek.com header.i=@mediatek.com header.a=rsa-sha256 header.s=dk header.b=XnY/185J; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Tb7Hl0CnGz23gM for ; Thu, 15 Feb 2024 19:18:43 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:CC :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=MdDROr81/89/dE7L6Baisai+PcH/GR/f/ImMVl9vx2s=; b=KPBZ0E8GRrywJU jU3b7oKZmgn0YTvOVSW3zLuUedzUh1A3Ay9mZx3Kh4/2oR2iSX62nxHtHFuN0yeUkpUdRwUQnRmRO vlcd5xYZsl0I4pYEIHkHpV3ia4rZWssYJ2676cq8yk7sJQeGY905/xcIIFAyglSrxTh71oRNCxSWW sxf9EXdNxswABqDjIHgBYI3uR+sdasHF0DVBWVPLOxfsKPeKuK5X5we22eME0v3Qq9/8ce0SzMwZo +mH/ovnHqywaLdmTF/q+g73NxOMiE0K8zyA5V3JDCAwBwuQ27dhPxRYHRcDltWAkOdkkBbGSs6kwM IGHHexqVy0FHa6nuy8BA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1raWwc-0000000FJJD-0cgK; Thu, 15 Feb 2024 08:18:10 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1raWIr-0000000FFQN-3hxj for hostap@lists.infradead.org; Thu, 15 Feb 2024 07:37:07 +0000 X-UUID: 020339e4cbd511ee9a263b4415211400-20240215 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:Message-ID:Date:Subject:CC:To:From; bh=Tt/YpoX3Vd3qsBC5eP+8S1vvtaofex1GfIlx1PNidnI=; b=XnY/185J/f4cQpKt4aJIhaqeaNzQkfzj573s8TQX56g2hBla2LcGT5LTfKIpRcZ9spyfygd2A60EWWdvRiTR3om1/tK/mv9ExsFQoplV83z7nuZqlBm1YcAJG4kwlJk10N//V4A9HJe8QeOMCC1TgUFjVasnCdKRUsG9targvOk=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.37,REQID:36c56735-2f12-4d7d-90bc-b42d36690bfd,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:6f543d0,CLOUDID:5dda6980-4f93-4875-95e7-8c66ea833d57,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:0,File:nil,RT:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0,LES:1, SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0 X-CID-BVR: 0,NGT X-CID-BAS: 0,NGT,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-UUID: 020339e4cbd511ee9a263b4415211400-20240215 Received: from mtkmbs13n2.mediatek.inc [(172.21.101.108)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1478807948; Thu, 15 Feb 2024 00:37:01 -0700 Received: from mtkmbs11n2.mediatek.inc (172.21.101.187) by MTKMBS14N1.mediatek.inc (172.21.101.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Thu, 15 Feb 2024 15:36:50 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs11n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Thu, 15 Feb 2024 15:36:50 +0800 From: Michael-CY Lee To: Jouni Malinen CC: Felix Fietkau , , Evelyn Tsai , Money Wang , "Michael-CY Lee" Subject: [PATCH] AP MLD: set the link address only when the non-AP MLD is not added to the driver Date: Thu, 15 Feb 2024 15:36:41 +0800 Message-ID: <20240215073641.31093-1-michael-cy.lee@mediatek.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 X-TM-AS-Product-Ver: SMEX-14.0.0.3152-9.1.1006-23728.005 X-TM-AS-Result: No-10--1.137900-8.000000 X-TMASE-MatchedRID: ob7JVM1aSSwEQqIqKFLtThokisCyVCexFJFr2qlKix8GW3hFnC9N1XxY l4wQVUvHM4MQqDQo18HhW/zFBw7jtYqWws9vyPBrA9lly13c/gH0O7M3lSnTW57oC1rVz/uNo8W MkQWv6iXBcIE78YqRWvcUt5lc1lLgjMejjvPkBr5MM+e1UgdWWUk/ovjpTf/K+ObVShQBQRmv0+ tCkEwqnuxgcM1towyuTS7RmJ+DOH45Ijq7yB9hLNFOKerPrs219ayZ9zI4MrF5lSmbrC6fdtr/T o2FgNrjDLMIOOVTHz2nbLeYgH6K31Zca9RSYo/b X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--1.137900-8.000000 X-TMASE-Version: SMEX-14.0.0.3152-9.1.1006-23728.005 X-TM-SNTS-SMTP: 5C9275E6326E7CF10BE01E3B94C42435CB6FE63617DE4DA5D28493EEE29EA01E2000:8 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240214_233705_948153_788F0667 X-CRM114-Status: GOOD ( 13.57 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: 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->ml [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay lines -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Mailman-Approved-At: Thu, 15 Feb 2024 00:18:07 -0800 X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org 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 --- src/ap/ieee802_11.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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));