From patchwork Tue Jul 25 07:16:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manaswini Paluri X-Patchwork-Id: 1812253 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org 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=) 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=P68UrVxr; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=quicinc.com header.i=@quicinc.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=OLjkF1Iw; dkim-atps=neutral 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 (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4R97fm2nHcz1ydq for ; Tue, 25 Jul 2023 17:18:24 +1000 (AEST) 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=mKIwGSHAuM/EV1cK+aiUsBSJShMFBmfYnS1sVcqyB18=; b=P68UrVxr9Y1UMF uImWHvdP/uEJpPoo3eZkyamF34qE84IVf/j6BKl0QQtqxzc8h1CwU9kflnt6FUYEc4cxv6mSEG/h8 6F/N+6RcqwBqa+7MzJ6RKlLqDMIg5ueXIUvjDIdgwGtb5KvZ5oWgQNWLHkpkq3m9RhAOfylo191dF iENAV8gysK3ftw9tIPhxIYd3NvO4S8AnTesoZF4CWiS8AKKtjrlHD3TvqdTiiZ45c5ofoCzjZ3gxy MlMKbLpz+JnH80I86HmA602FlIyPQLftYi0xuyH7mmdlchrjMvc5rjPeOgHVfVDU+tZc5o70k3Dva mgT7lnT/LFQ6KK5qntZA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qOCIP-006Ymr-0B; Tue, 25 Jul 2023 07:17:25 +0000 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qOCIK-006YjT-0B for hostap@lists.infradead.org; Tue, 25 Jul 2023 07:17:21 +0000 Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 36P3wGu0026412; Tue, 25 Jul 2023 07:17:18 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : mime-version : content-type; s=qcppdkim1; bh=GaUcKM+gX4Y6Mtzkqw7rKmexqBjerdo6REW33pqrrgY=; b=OLjkF1Iw1q4C2decWbrH547zGDVy7BGjcNkm82557QJJgeAs1q0TM2BRNNc+aD+01cp4 IqBJkDckTlVIwqR4SRzhMJgXRY0FI3JKVzYf1Ry9O/S4YwvdtgP5hqrI6A1ygOVgrC9c p4UHd3ggFeFV1qbFxe1jaAz5wWGEv2qDcWOuPdGhc+Av/Ni1c3mCLGjGMlG8Yt3cunfa Mt3cJQAdLmS2VHyRFZT4vJ4f9yGtXcX9xbi4gfG1A2Xh1MSYXIqb04L5JqzX3HmTWy+p 80D7AuUFY+7Yc/ZTEERb6lJdB4uSxJFTVoIszkoHaBqySW1YmVVQuvqeCKU8v8scaFb7 xA== Received: from nasanppmta03.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3s1qa3t89c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 25 Jul 2023 07:17:17 +0000 Received: from nasanex01a.na.qualcomm.com (nasanex01a.na.qualcomm.com [10.52.223.231]) by NASANPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 36P7HG3c017638 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 25 Jul 2023 07:17:16 GMT Received: from hu-mpaluri-hyd.qualcomm.com (10.80.80.8) by nasanex01a.na.qualcomm.com (10.52.223.231) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.30; Tue, 25 Jul 2023 00:17:14 -0700 From: Manaswini Paluri To: CC: , , , Subject: [PATCH v2 1/2] AP: Add configuration option to specify the desired MLD address Date: Tue, 25 Jul 2023 12:46:57 +0530 Message-ID: <20230725071658.15731-1-quic_mpaluri@quicinc.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nasanex01a.na.qualcomm.com (10.52.223.231) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: DOaMJb07d4vLblAazHpfR5kM1lfQxI9H X-Proofpoint-GUID: DOaMJb07d4vLblAazHpfR5kM1lfQxI9H X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-07-25_02,2023-07-24_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 phishscore=0 malwarescore=0 suspectscore=0 clxscore=1015 mlxlogscore=999 priorityscore=1501 mlxscore=0 adultscore=0 spamscore=0 lowpriorityscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2306200000 definitions=main-2307250064 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230725_001720_208217_30F0769B X-CRM114-Status: GOOD ( 27.37 ) 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: From: Ilan Peer Add mld_addr configuration option to set MLD address. The already existing bssid configuration option can be used to control the MLD link addresses. Signed-off-by: Ilan Peer Signed-off-by: Andrei Otcheretianski Signed-off-by: Manaswini Paluri --- v2: - Add documenta [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 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 From: Ilan Peer Add mld_addr configuration option to set MLD address. The already existing bssid configuration option can be used to control the MLD link addresses. Signed-off-by: Ilan Peer Signed-off-by: Andrei Otcheretianski Signed-off-by: Manaswini Paluri --- v2: - Add documentation for the new conf parameter mld_addr in hostapd.conf - Update comments for the changes done in hostapd_driver_init() - Move BSSID empty check to separate patch - Remove duplicate link MAC address randomization --- hostapd/config_file.c | 6 ++++++ hostapd/hostapd.conf | 6 ++++++ hostapd/main.c | 20 +++++++++++++++++--- src/ap/ap_config.h | 3 +++ 4 files changed, 32 insertions(+), 3 deletions(-) diff --git a/hostapd/config_file.c b/hostapd/config_file.c index 412ca8a9f..d76a1a462 100644 --- a/hostapd/config_file.c +++ b/hostapd/config_file.c @@ -4776,6 +4776,12 @@ static int hostapd_config_fill(struct hostapd_config *conf, bss->mld_ap = !!atoi(pos); } else if (os_strcmp(buf, "mld_id") == 0) { bss->mld_id = atoi(pos); + } else if (os_strcmp(buf, "mld_addr") == 0) { + if (hwaddr_aton(pos, bss->mld_addr)) { + wpa_printf(MSG_ERROR, + "Line %d: invalid mld_addr", line); + return 1; + } #endif /* CONFIG_IEEE80211BE */ } else { wpa_printf(MSG_ERROR, diff --git a/hostapd/hostapd.conf b/hostapd/hostapd.conf index 30fb06d1c..c4e5d58f2 100644 --- a/hostapd/hostapd.conf +++ b/hostapd/hostapd.conf @@ -1048,6 +1048,12 @@ wmm_ac_vo_acm=0 # MLD ID - Affiliated MLD ID #mld_id=1 +# AP MLD ADDRESS - AP MLD MAC address of this AP +# The configured address will be set as interface hardware address and used as +# AP MLD MAC address. If not set current interface hardware address will be used +# as AP MLD MAC address. +#mld_addr=02:03:04:05:06:07 + ##### IEEE 802.1X-2004 related configuration ################################## # Require IEEE 802.1X authorization diff --git a/hostapd/main.c b/hostapd/main.c index aebdffd1f..ac9a47a48 100644 --- a/hostapd/main.c +++ b/hostapd/main.c @@ -242,6 +242,16 @@ static int hostapd_driver_init(struct hostapd_iface *iface) break; } params.bssid = b; +#ifdef CONFIG_IEEE80211BE + /* + * Use the configured MLD address as interface hardware address if this + * AP is part of an AP MLD. + */ + if (!is_zero_ether_addr(hapd->conf->mld_addr) && + hapd->conf->mld_ap) + params.bssid = hapd->conf->mld_addr; +#endif /* CONFIG_IEEE80211BE */ + params.ifname = hapd->conf->iface; params.driver_params = hapd->iconf->driver_params; params.use_pae_group_addr = hapd->conf->use_pae_group_addr; @@ -270,14 +280,18 @@ static int hostapd_driver_init(struct hostapd_iface *iface) #ifdef CONFIG_IEEE80211BE /* * This is the first interface added to the AP MLD, so have the - * interface hardware address be the MLD address and set a link address - * to this interface. + * interface hardware address be the MLD address, while the link address + * would be derived from the original interface address if BSSID is not + * configured, and otherwise it would be the configured BSSID. */ if (hapd->conf->mld_ap) { os_memcpy(hapd->mld_addr, hapd->own_addr, ETH_ALEN); - random_mac_addr_keep_oui(hapd->own_addr); hapd->mld_next_link_id = 0; hapd->mld_link_id = hapd->mld_next_link_id++; + if (!b) + random_mac_addr_keep_oui(hapd->own_addr); + else + os_memcpy(hapd->own_addr, b, ETH_ALEN); } setup_mld: diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h index 777aa5af0..83fdbaad1 100644 --- a/src/ap/ap_config.h +++ b/src/ap/ap_config.h @@ -944,6 +944,9 @@ struct hostapd_bss_config { /* The MLD ID to which the AP MLD is affiliated with */ u8 mld_id; + + /* The AP's MLD address within the MLD AP */ + u8 mld_addr[ETH_ALEN]; #endif /* CONFIG_IEEE80211BE */ };