From patchwork Wed May 11 20:49:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aloka Dixit X-Patchwork-Id: 1629757 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=WiyZApNa; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=quicinc.com header.i=@quicinc.com header.a=rsa-sha256 header.s=qcdkim header.b=Kw26bakm; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4Kz6XD1K73z9sFs for ; Thu, 12 May 2022 06:51:40 +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:References:In-Reply-To: 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: List-Owner; bh=mAb1XDnuzOoMhWds2a6DZlsZ1tbWowLUqee9lfkWoTg=; b=WiyZApNa3T9JPK zPgtR7vAv1/SMhhzTD83RmXUskpnaxSbdi1d08sMSRZMHJ3QaeG2oIQVwC6pyxIHtRNNG0KWaN9nJ 9Sb1nB6w8CJhn0BCNP9CakHEsNsow0wsIACmEtDfmoc+pXrYgeXXiE6cs/sPg7FPrJ8o9Ajv5inrf epS4Fi4GUP6Dc6y99V2oFgxBSWzfxqcb6kViOJuibxzgRPEFP/VQ0uKZJX2zNT6txk2mht1CB4/pe lg8H2kk+lyBDzRHcCoIHamxlLedKeBFxBY4rGOYuXjZbm3OCKR52D+MGh4U/K58EzSx19CDTcwY0+ XqslW7vwt4Qu8GHpq6RA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1notIT-008Zxt-3j; Wed, 11 May 2022 20:51:01 +0000 Received: from alexa-out-sd-01.qualcomm.com ([199.106.114.38]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1notHH-008ZYk-11 for hostap@lists.infradead.org; Wed, 11 May 2022 20:49:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1652302187; x=1683838187; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Dv3F8O5Yn2fGVEIDXAe3whJ7/oPPZawuqpNBv2DT4HI=; b=Kw26bakmMqfDzy/MqYPqYAHcX78HNBG+bRMg6v3ynJg5iQR3a14kCJ6E TwCAcopEMyZ+hD0IOnPWIweaOO9lZALKnlOjEo5OKYUY6BY5SvG9gHTFX Perxn0AO07U4gIypspep9Ff/Jj+BUdupd96kh0Rdzt26aBCyLdBWUvxrw U=; Received: from unknown (HELO ironmsg03-sd.qualcomm.com) ([10.53.140.143]) by alexa-out-sd-01.qualcomm.com with ESMTP; 11 May 2022 13:49:43 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg03-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 May 2022 13:49:43 -0700 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Wed, 11 May 2022 13:49:42 -0700 Received: from alokad-linux.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Wed, 11 May 2022 13:49:42 -0700 From: Aloka Dixit To: , CC: John Crispin , Aloka Dixit Subject: [PATCH v2 01/11] mbssid: add new configuration option Date: Wed, 11 May 2022 13:49:21 -0700 Message-ID: <20220511204931.25069-2-quic_alokad@quicinc.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220511204931.25069-1-quic_alokad@quicinc.com> References: <20220511204931.25069-1-quic_alokad@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220511_134947_182113_C11E6E7C X-CRM114-Status: GOOD ( 17.31 ) X-Spam-Score: -2.5 (--) 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: John Crispin Add configuration option 'mbssid' used to enable multiple BSSID (MBSSID) and enhanced multiple BSSID advertisements (EMA) features. Add macros for the valid values. Content analysis details: (-2.5 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [199.106.114.38 listed in list.dnswl.org] -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: John Crispin Add configuration option 'mbssid' used to enable multiple BSSID (MBSSID) and enhanced multiple BSSID advertisements (EMA) features. Add macros for the valid values. Reject the configuration if any of the BSSes have hidden SSID enabled. Signed-off-by: John Crispin Co-developed-by: Aloka Dixit Signed-off-by: Aloka Dixit --- v2: Single option for MBSSID and EMA. Moved the description in hostapd.conf at the bottom. Addition to disallow hidden SSID. hostapd/config_file.c | 9 +++++++ hostapd/hostapd.conf | 58 +++++++++++++++++++++++++++++++++++++++++++ src/ap/ap_config.c | 6 +++++ src/ap/ap_config.h | 4 +++ 4 files changed, 77 insertions(+) diff --git a/hostapd/config_file.c b/hostapd/config_file.c index 8a86ce08bae4..64ef8729bde2 100644 --- a/hostapd/config_file.c +++ b/hostapd/config_file.c @@ -3629,6 +3629,15 @@ static int hostapd_config_fill(struct hostapd_config *conf, return 1; } bss->unsol_bcast_probe_resp_interval = val; + } else if (os_strcmp(buf, "mbssid") == 0) { + int mbssid = atoi(pos); + if (mbssid < 0 || mbssid > ENHANCED_MBSSID_ENABLED) { + wpa_printf(MSG_ERROR, + "Line %d: invalid mbssid (%d): '%s'.", + line, mbssid, pos); + return 1; + } + conf->mbssid = mbssid; #endif /* CONFIG_IEEE80211AX */ } else if (os_strcmp(buf, "max_listen_interval") == 0) { bss->max_listen_interval = atoi(pos); diff --git a/hostapd/hostapd.conf b/hostapd/hostapd.conf index f37d5634b1b5..868b5a8f5fec 100644 --- a/hostapd/hostapd.conf +++ b/hostapd/hostapd.conf @@ -3106,3 +3106,61 @@ own_ip_addr=127.0.0.1 #bss=wlan0_1 #bssid=00:13:10:95:fe:0b # ... +# +# Multiple BSSID Advertisement in 802.11ax +# IEEE Std 802.11ax-2021 added a feature where instead of multiple interfaces +# on a common radio transmitting individual beacons, those can form a set with +# a common beacon is transmitted for all. The interface which is brought up +# first is called as the transmitting profile of the MBSSID set which transmits +# the beacons. The remaining interfaces are called as the non-transmitting +# profiles and these are advertised inside the multiple BSSID element in the +# beacons and probe response frames. +# The transmitting interface is visible to all clients in the vicinity, however +# the clients which do not support parsing of the multiple BSSID element will +# not be able to connect to the non-transmitting interfaces. +# +# Enhanced Multiple BSSID Advertisements (EMA) +# When enabled, the non-transmitting interfaces are split into multiple +# beacons. The number of beacons required to cover all the non-transmitting +# profiles is called as the profile periodicity. +# +# Refer to IEEE Std 802.11-2020 for details regarding the procedure and +# required MAC address assignment. +# +# Following configuration is per radio. +# 0 = Disabled (Default) +# 1 = Multiple BSSID advertisements enabled. +# 2 = Enhanced multiple BSSID advertisements enabled. +#mbssid=0 +# +# The transmitting interface should be added with 'interface' option while +# the non-transmitting interfaces should be added using 'bss' option. +# Security configuration should be added separately per interface, if required. +# +# Example: +#mbssid=2 +#interface=wlan2 +#ctrl_interface=/var/run/hostapd +#wpa_passphrase=0123456789 +#ieee80211w=2 +#sae_pwe=1 +#auth_algs=1 +#wpa=2 +#wpa_pairwise=CCMP +#ssid= +#bridge=br-lan +#wpa_key_mgmt=SAE +#bssid=00:03:7f:12:84:84 +# +#bss=wlan2-1 +#ctrl_interface=/var/run/hostapd +#wpa_passphrase=0123456789 +#ieee80211w=2 +#sae_pwe=1 +#auth_algs=1 +#wpa=2 +#wpa_pairwise=CCMP +#ssid= +#bridge=br-lan +#wpa_key_mgmt=SAE +#bssid=00:03:7f:12:84:85 diff --git a/src/ap/ap_config.c b/src/ap/ap_config.c index 1c229c6c78ae..5947927d09fa 100644 --- a/src/ap/ap_config.c +++ b/src/ap/ap_config.c @@ -1447,6 +1447,12 @@ static int hostapd_config_check_bss(struct hostapd_bss_config *bss, } #endif /* CONFIG_IEEE80211BE */ + if (full_config && bss->ignore_broadcast_ssid && conf->mbssid) { + wpa_printf(MSG_ERROR, + "Hidden SSID is not suppored when MBSSID is enabled"); + return -1; + } + return 0; } diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h index 805ea93df731..d09b5f85990d 100644 --- a/src/ap/ap_config.h +++ b/src/ap/ap_config.h @@ -1139,6 +1139,10 @@ struct hostapd_config { #define CH_SWITCH_EHT_ENABLED BIT(0) #define CH_SWITCH_EHT_DISABLED BIT(1) unsigned int ch_switch_eht_config; + +#define MBSSID_ENABLED 1 +#define ENHANCED_MBSSID_ENABLED 2 + u8 mbssid; }; From patchwork Wed May 11 20:49:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aloka Dixit X-Patchwork-Id: 1629752 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=hG1BBExV; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=quicinc.com header.i=@quicinc.com header.a=rsa-sha256 header.s=qcdkim header.b=BdxQhCIf; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4Kz6WK5b9cz9sFs for ; Thu, 12 May 2022 06:50:53 +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:References:In-Reply-To: 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: List-Owner; bh=JOoOOygdg44IfI4nY79FtBtL1/uese/WKxK5ULTlxYQ=; b=hG1BBExVuy/t9U 2KnlG2Km3n+w9qKUqjeJirLuqL9Ee1ukQen7itM5eDSGQmP3nxldObZmvoinOmK7K39TbCg5jLXJc tzuYZ0TKX/d2SH6jfA/Al04GlazjNd9WBydKE+4ihbisdR2OoGLIbhbt/a+KVdEO/6AoTbFhsy2l1 ZNOOerhAiGL4UiUHlpPWrL0q4hBe2ZBXzgaDSYUFZfjHbDfvkO477zbXAfO549rzfOzCJWeEyemlg uW17k9oypdzhnKZqelSxZ6qIaqkYAmg1dwOMv0++QRWr9BQS9ZhTfamL7t3TxBw/qSgJWI5AMDwjO NG/vQVFqf77BmYXmN+pA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1notHS-008ZdK-0g; Wed, 11 May 2022 20:49:58 +0000 Received: from alexa-out-sd-02.qualcomm.com ([199.106.114.39]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1notHF-008ZXZ-Cz for hostap@lists.infradead.org; Wed, 11 May 2022 20:49:46 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1652302185; x=1683838185; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=mBosdFzay7cqGpf5LY3DTcYv9YNqddgo4xtF+BMCdgE=; b=BdxQhCIf4C7bWmmc7uyrEkmY08jj5PYnj4gW+nuXSGh3BfW0XQ/+f3Hz vM9o5mxwi+l84w4tVZR9sU4c3SVgzsUyFCcjXbl37kOz0136/AVz0tgU8 rrkREW7mCWsIgJDhq5Au2+RmrHGtUKZMNZfx0eYWtH4He+pxNFy8A7JZp I=; Received: from unknown (HELO ironmsg-SD-alpha.qualcomm.com) ([10.53.140.30]) by alexa-out-sd-02.qualcomm.com with ESMTP; 11 May 2022 13:49:43 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg-SD-alpha.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 May 2022 13:49:43 -0700 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Wed, 11 May 2022 13:49:43 -0700 Received: from alokad-linux.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Wed, 11 May 2022 13:49:43 -0700 From: Aloka Dixit To: , CC: Aloka Dixit Subject: [PATCH v2 02/11] mbssid: retrieve driver capabilities Date: Wed, 11 May 2022 13:49:22 -0700 Message-ID: <20220511204931.25069-3-quic_alokad@quicinc.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220511204931.25069-1-quic_alokad@quicinc.com> References: <20220511204931.25069-1-quic_alokad@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220511_134945_511047_08C0DA46 X-CRM114-Status: GOOD ( 13.11 ) X-Spam-Score: -2.5 (--) 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: Retrieve driver capabilities for maximum number of interfaces for MBSSID and maximum allowed profile periodicity for enhanced MBSSID advertisements. Signed-off-by: Aloka Dixit --- v2: Moved changes in driver_nl80211_capa.c to this patch instead of a separate one. Content analysis details: (-2.5 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [199.106.114.39 listed in list.dnswl.org] -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 Retrieve driver capabilities for maximum number of interfaces for MBSSID and maximum allowed profile periodicity for enhanced MBSSID advertisements. Signed-off-by: Aloka Dixit --- v2: Moved changes in driver_nl80211_capa.c to this patch instead of a separate one. hostapd/main.c | 3 +++ src/ap/hostapd.h | 5 +++++ src/drivers/driver.h | 5 +++++ src/drivers/driver_nl80211_capa.c | 27 +++++++++++++++++++++++++++ 4 files changed, 40 insertions(+) diff --git a/hostapd/main.c b/hostapd/main.c index 21932d1bea06..e13e1665b6ce 100644 --- a/hostapd/main.c +++ b/hostapd/main.c @@ -241,6 +241,9 @@ static int hostapd_driver_init(struct hostapd_iface *iface) wpa_printf(MSG_ERROR, "set_wowlan failed"); } os_free(triggs); + + iface->mbssid_max_interfaces = capa.mbssid_max_interfaces; + iface->ema_max_periodicity = capa.ema_max_periodicity; } return 0; diff --git a/src/ap/hostapd.h b/src/ap/hostapd.h index 297faaf1409c..36c6a8b21d08 100644 --- a/src/ap/hostapd.h +++ b/src/ap/hostapd.h @@ -625,6 +625,11 @@ struct hostapd_iface { /* Previous WMM element information */ struct hostapd_wmm_ac_params prev_wmm[WMM_AC_NUM]; + /* Maximum number of interfaces supported for MBSSID advertisements */ + u8 mbssid_max_interfaces; + /* Maximum profile periodicity for enhanced MBSSID advertisements */ + u8 ema_max_periodicity; + int (*enable_iface_cb)(struct hostapd_iface *iface); int (*disable_iface_cb)(struct hostapd_iface *iface); }; diff --git a/src/drivers/driver.h b/src/drivers/driver.h index 677b729d5d4a..39a2e6387d8a 100644 --- a/src/drivers/driver.h +++ b/src/drivers/driver.h @@ -2179,6 +2179,11 @@ struct wpa_driver_capa { /* Maximum number of supported CSA counters */ u16 max_csa_counters; + + /* Maximum number of interfaces supported for MBSSID advertisements */ + u8 mbssid_max_interfaces; + /* Maximum profile periodicity for enhanced MBSSID advertisements */ + u8 ema_max_periodicity; }; diff --git a/src/drivers/driver_nl80211_capa.c b/src/drivers/driver_nl80211_capa.c index a0803bad046a..00c6d5d82335 100644 --- a/src/drivers/driver_nl80211_capa.c +++ b/src/drivers/driver_nl80211_capa.c @@ -850,6 +850,30 @@ err: } +static void wiphy_info_mbssid(struct wpa_driver_capa *cap, struct nlattr *attr) +{ + struct nlattr *config[NL80211_MBSSID_CONFIG_ATTR_MAX + 1]; + + if (nla_parse_nested(config, NL80211_MBSSID_CONFIG_ATTR_MAX, attr, + NULL)) + return; + + if (!config[NL80211_MBSSID_CONFIG_ATTR_MAX_INTERFACES]) + return; + + cap->mbssid_max_interfaces = + nla_get_u8(config[NL80211_MBSSID_CONFIG_ATTR_MAX_INTERFACES]); + + if (config[NL80211_MBSSID_CONFIG_ATTR_MAX_EMA_PROFILE_PERIODICITY]) + cap->ema_max_periodicity = + nla_get_u8(config[NL80211_MBSSID_CONFIG_ATTR_MAX_EMA_PROFILE_PERIODICITY]); + + wpa_printf(MSG_DEBUG, + "multiple_bssid: max interfaces %u, max profile periodicity %u\n", + cap->mbssid_max_interfaces, cap->ema_max_periodicity); +} + + static int wiphy_info_handler(struct nl_msg *msg, void *arg) { struct nlattr *tb[NL80211_ATTR_MAX + 1]; @@ -1081,6 +1105,9 @@ static int wiphy_info_handler(struct nl_msg *msg, void *arg) if (tb[NL80211_ATTR_WIPHY_SELF_MANAGED_REG]) capa->flags |= WPA_DRIVER_FLAGS_SELF_MANAGED_REGULATORY; + if (tb[NL80211_ATTR_MBSSID_CONFIG]) + wiphy_info_mbssid(capa, tb[NL80211_ATTR_MBSSID_CONFIG]); + return NL_SKIP; } From patchwork Wed May 11 20:49:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aloka Dixit X-Patchwork-Id: 1629751 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=D2rbkE0r; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=quicinc.com header.i=@quicinc.com header.a=rsa-sha256 header.s=qcdkim header.b=k6CPLgMy; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4Kz6WJ5nwdz9sFs for ; Thu, 12 May 2022 06:50:52 +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:References:In-Reply-To: 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: List-Owner; bh=XsgSjK/NG842dP6Dg5MH3HAv0AzoKgxHQ2N66CTssrg=; b=D2rbkE0rclOrMr dvbH7iprXKQB7cLk0JvkyhAFE00VpjvoMHQdgcR+I8dxdZsujRp7PAvxsY0gMHRNkPZ4y3Nav+zoV sWCB3T9XeL8QQEGL15lg1Eq7RGgl/pQ8RYt08wA4Oe1o6YtZXeU8z+2vuHx5YeVjuH1BhtzRRNywG tml4XltZEwUalMb2bMPYszbP4w/qXk/desT8kcC4/0/GHR6nDDnWR6pJFR0ByhnUE422Ed2Sxrf27 ZzHvmlXUnGpPAL2NzIsB/jjEUgxm0gSweg5nNaVZZw7Mxpx/vR/YBKBevJgLu7q6PO51AM45mR4Sj 2jH/Cm5nNUIrQW1MEGaQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1notHZ-008Zei-Ts; Wed, 11 May 2022 20:50:05 +0000 Received: from alexa-out.qualcomm.com ([129.46.98.28]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1notHF-008ZXd-HU for hostap@lists.infradead.org; Wed, 11 May 2022 20:49:48 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1652302185; x=1683838185; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=2eS0EXt17Wyb3HpreW7quUOTH55Jy6cZ+IS2V1+nreo=; b=k6CPLgMyO+kDTxumjDhm2eXkxlcAGqDPq6nTDETXBVLOtwltQjzj/ZIi 0Mw6aGFoNmCkkkjQc6p9FVZskSjgS/A4ts8bcQ5KcfLxJWG5bDKRHHAci zl18LKGR17DzXJg1ZWbfzxK7hshhpjljefuo3tPOyeT0PXFO+Xz2xadMz 8=; Received: from ironmsg07-lv.qualcomm.com ([10.47.202.151]) by alexa-out.qualcomm.com with ESMTP; 11 May 2022 13:49:44 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg07-lv.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 May 2022 13:49:44 -0700 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Wed, 11 May 2022 13:49:43 -0700 Received: from alokad-linux.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Wed, 11 May 2022 13:49:43 -0700 From: Aloka Dixit To: , CC: Aloka Dixit Subject: [PATCH v2 03/11] mbssid: configure all BSSes before beacon setup Date: Wed, 11 May 2022 13:49:23 -0700 Message-ID: <20220511204931.25069-4-quic_alokad@quicinc.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220511204931.25069-1-quic_alokad@quicinc.com> References: <20220511204931.25069-1-quic_alokad@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220511_134945_657327_10DCBEDE X-CRM114-Status: GOOD ( 21.15 ) X-Spam-Score: -0.9 (/) 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: When multiple BSSID advertisements feature is enabled in 802.11ax mode or later, beacons are not transmitted per interface, instead only one of the interfaces transmits beacon(s) which include one or [...] Content analysis details: (-0.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [129.46.98.28 listed in list.dnswl.org] -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 When multiple BSSID advertisements feature is enabled in 802.11ax mode or later, beacons are not transmitted per interface, instead only one of the interfaces transmits beacon(s) which include one or more multiple BSSID elements with configuration for the remaining interfaces on the same radio. Change the existing logic such that all configuration details for all the interfaces is available while building the beacon for the transmitting interface itself. Do not change the flow for the cases where multiple BSSID advertisements are not enabled. Signed-off-by: Aloka Dixit --- v2: Kept only beacon start related code in the new function. src/ap/hostapd.c | 49 ++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 41 insertions(+), 8 deletions(-) diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c index f6fe8a8a03b5..39340864edc4 100644 --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c @@ -1103,19 +1103,37 @@ static int db_table_create_radius_attributes(sqlite3 *db) #endif /* CONFIG_NO_RADIUS */ +static int hostapd_start_beacon(struct hostapd_data *hapd) +{ + struct hostapd_bss_config *conf = hapd->conf; + + if (!conf->start_disabled && ieee802_11_set_beacon(hapd) < 0) + return -1; + + if (hapd->driver && hapd->driver->set_operstate) + hapd->driver->set_operstate(hapd->drv_priv, 1); + + return 0; +} /** * hostapd_setup_bss - Per-BSS setup (initialization) * @hapd: Pointer to BSS data * @first: Whether this BSS is the first BSS of an interface; -1 = not first, * but interface may exist + * @start_beacon: Whether beacons should be configured and transmission started + * at this time. This is used when MBSSID IE is enabled where the + * information regarding all BSSes should be retrieved before configuring + * the beacons. The calling functions are responsible to configure the + * beacon explicitly if this is set to 'false'. * * This function is used to initialize all per-BSS data structures and * resources. This gets called in a loop for each BSS when an interface is * initialized. Most of the modules that are initialized here will be * deinitialized in hostapd_cleanup(). */ -static int hostapd_setup_bss(struct hostapd_data *hapd, int first) +static int hostapd_setup_bss(struct hostapd_data *hapd, int first, + bool start_beacon) { struct hostapd_bss_config *conf = hapd->conf; u8 ssid[SSID_MAX_LEN + 1]; @@ -1387,9 +1405,6 @@ static int hostapd_setup_bss(struct hostapd_data *hapd, int first) return -1; } - if (!conf->start_disabled && ieee802_11_set_beacon(hapd) < 0) - return -1; - if (flush_old_stations && !conf->start_disabled && conf->broadcast_deauth) { u8 addr[ETH_ALEN]; @@ -1408,8 +1423,8 @@ static int hostapd_setup_bss(struct hostapd_data *hapd, int first) if (hapd->wpa_auth && wpa_init_keys(hapd->wpa_auth) < 0) return -1; - if (hapd->driver && hapd->driver->set_operstate) - hapd->driver->set_operstate(hapd->drv_priv, 1); + if (start_beacon) + return hostapd_start_beacon(hapd); return 0; } @@ -2134,7 +2149,7 @@ static int hostapd_setup_interface_complete_sync(struct hostapd_iface *iface, hapd = iface->bss[j]; if (j) os_memcpy(hapd->own_addr, prev_addr, ETH_ALEN); - if (hostapd_setup_bss(hapd, j == 0)) { + if (hostapd_setup_bss(hapd, j == 0, !iface->conf->mbssid)) { for (;;) { hapd = iface->bss[j]; hostapd_bss_deinit_no_free(hapd); @@ -2148,6 +2163,24 @@ static int hostapd_setup_interface_complete_sync(struct hostapd_iface *iface, if (is_zero_ether_addr(hapd->conf->bssid)) prev_addr = hapd->own_addr; } + + if (hapd->iconf->mbssid) { + for (j = 0; j < iface->num_bss; j++) { + hapd = iface->bss[j]; + if (hostapd_start_beacon(hapd)) { + for (;;) { + hapd = iface->bss[j]; + hostapd_bss_deinit_no_free(hapd); + hostapd_free_hapd_data(hapd); + if (j == 0) + break; + j--; + } + goto fail; + } + } + } + hapd = iface->bss[0]; hostapd_tx_queue_params(iface); @@ -3029,7 +3062,7 @@ int hostapd_add_iface(struct hapd_interfaces *interfaces, char *buf) if (start_ctrl_iface_bss(hapd) < 0 || (hapd_iface->state == HAPD_IFACE_ENABLED && - hostapd_setup_bss(hapd, -1))) { + hostapd_setup_bss(hapd, -1, true))) { hostapd_cleanup(hapd); hapd_iface->bss[hapd_iface->num_bss - 1] = NULL; hapd_iface->conf->num_bss--; From patchwork Wed May 11 20:49:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aloka Dixit X-Patchwork-Id: 1629763 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=jGrkbq+j; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=quicinc.com header.i=@quicinc.com header.a=rsa-sha256 header.s=qcdkim header.b=VhFMAdH5; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4Kz6ZL5jqdz9sFs for ; Thu, 12 May 2022 06:53:30 +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:References:In-Reply-To: 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: List-Owner; bh=COrSM+k9EC8zd3wOzsDr6EZO1NzkHa2vLvYPnOpWv7k=; b=jGrkbq+jYntEVU 5zJlVXEehqiJwCV1WPpFnmuQm508kooQl6OYzK6J866JHP/d7QIlcTdiznUl7zZmnwbyCRiNI2uZG 9e7RDaN2DAeRZk1/JaYwalvPgYQqTTnp9BgNzfgYKOJESunCwhjGPMObSqadOnL08j6wOUPU/6MaB 9wQd0wYtYZ0BHMZQ4JAfXXfBu927M/Io2DKOaBlU/R26+4egWw9+phDr1ym/jKcpdmnA8zOzfTxcc rHfoCnm5vZF7OS+6tCRGo00L4BdtNyRTInE4g+5VP1hwWrOjn6MUEOjQGj2/TLZsndYLwOekmFvNL deoQnhFC94TzfKFaQBFw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1notK4-008ao5-8B; Wed, 11 May 2022 20:52:40 +0000 Received: from alexa-out-sd-01.qualcomm.com ([199.106.114.38]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1notHK-008ZYk-9Y for hostap@lists.infradead.org; Wed, 11 May 2022 20:49:52 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1652302190; x=1683838190; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ewijNDekEBoLULqAN0RO6fKIyLq0PB4BXvxy2G4YAj4=; b=VhFMAdH5SSkzatUEm4HLrGn2zW8ouC2vZcKoHM8Jsdmy3D7e3LAv1Jty Ki4HxNgTYWW13YlseIrhwlMywJ6vC9MAkUcrlJv3pZeSBRNFvOrmmxT8J PPGVtGOvKnL55syMElZufSy+RBvOIRpVVsT9mI3Hz3q25AC8xOMHq2fdp I=; Received: from unknown (HELO ironmsg04-sd.qualcomm.com) ([10.53.140.144]) by alexa-out-sd-01.qualcomm.com with ESMTP; 11 May 2022 13:49:44 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg04-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 May 2022 13:49:44 -0700 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Wed, 11 May 2022 13:49:44 -0700 Received: from alokad-linux.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Wed, 11 May 2022 13:49:43 -0700 From: Aloka Dixit To: , CC: John Crispin , Aloka Dixit Subject: [PATCH v2 04/11] mbssid: add multiple BSSID elements Date: Wed, 11 May 2022 13:49:24 -0700 Message-ID: <20220511204931.25069-5-quic_alokad@quicinc.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220511204931.25069-1-quic_alokad@quicinc.com> References: <20220511204931.25069-1-quic_alokad@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220511_134950_400271_7D316D72 X-CRM114-Status: GOOD ( 21.24 ) X-Spam-Score: -2.5 (--) 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: John Crispin Add multiple BSSID element data as per IEEE Std 802.11ax-2021, 9.4.2.45. Split the BSSes into multiple elements if the data does not fit in the 255 bytes allowed for a single element. Content analysis details: (-2.5 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [199.106.114.38 listed in list.dnswl.org] -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: John Crispin Add multiple BSSID element data as per IEEE Std 802.11ax-2021, 9.4.2.45. Split the BSSes into multiple elements if the data does not fit in the 255 bytes allowed for a single element. Store the total count of elements created and the offset to the start of each element in the provided buffer. Set the DTIM periods of non-transmitted profiles equal to the EMA profile periodicity if those are not a multiple of the latter already as recommended in IEEE P802.11ax/D8.0, October 2020, Multiple BSSID configuration examples, AA.1 Introduction. Signed-off-by: John Crispin Co-developed-by: Aloka Dixit Signed-off-by: Aloka Dixit --- v2: Merged code for EMA DTIM periods in this patch. Modified functions to static if applicable. src/ap/ieee802_11.c | 215 +++++++++++++++++++++++++++++++++++ src/ap/ieee802_11.h | 4 + src/common/ieee802_11_defs.h | 2 + 3 files changed, 221 insertions(+) diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c index aa26ad4effd9..ce01fae2872d 100644 --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c @@ -3970,6 +3970,23 @@ static void handle_auth(struct hostapd_data *hapd, } +static u8 hostapd_max_bssid_indicator(struct hostapd_data *hapd) +{ + size_t num_bss_nontx; + u8 max_bssid_ind = 0; + + if (!hapd->iconf->mbssid || hapd->iface->num_bss <= 1) + return 0; + + num_bss_nontx = hapd->iface->num_bss - 1; + while (num_bss_nontx > 0) { + max_bssid_ind++; + num_bss_nontx >>= 1; + } + return max_bssid_ind; +} + + int hostapd_get_aid(struct hostapd_data *hapd, struct sta_info *sta) { int i, j = 32, aid; @@ -7546,4 +7563,202 @@ u8 * hostapd_eid_rnr(struct hostapd_data *hapd, u8 *eid, u32 type) return eid; } + +static size_t hostapd_eid_mbssid_elem_len(struct hostapd_data *hapd, + u32 frame_type, size_t *bss_index) +{ + size_t len = 3, i; + + for (i = *bss_index; i < hapd->iface->num_bss; i++) { + struct hostapd_data *bss = hapd->iface->bss[i]; + const u8 *auth, *rsn, *rsnx; + size_t nontx_profile_len, auth_len; + + if (!bss || !bss->conf || !bss->started) + continue; + + /* + * Sublement ID: 1 byte + * Length: 1 byte + * Nontransmitted capabilities: 4 bytes + * SSID element: 2 + variable + * Multiple BSSID Index Element: 3 bytes (+2 bytes in beacons) + * Fixed length = 1 + 1 + 4 + 2 + 3 = 11 + */ + nontx_profile_len = 11 + bss->conf->ssid.ssid_len; + + if (frame_type == WLAN_FC_STYPE_BEACON) + nontx_profile_len += 2; + + auth = wpa_auth_get_wpa_ie(bss->wpa_auth, &auth_len); + if (auth) { + rsn = get_ie(auth, auth_len, WLAN_EID_RSN); + if (rsn) + nontx_profile_len += (2 + rsn[1]); + + rsnx = get_ie(auth, auth_len, WLAN_EID_RSNX); + if (rsnx) + nontx_profile_len += (2 + rsnx[1]); + } + + if ((len + nontx_profile_len) > 255) + goto mbssid_too_big; + + len += nontx_profile_len; + } + +mbssid_too_big: + *bss_index = i; + return len; +} + + +size_t hostapd_eid_mbssid_len(struct hostapd_data *hapd, u32 frame_type, + u8 *elem_count) +{ + size_t len = 0, bss_index = 1; + + if (!hapd->iconf->mbssid || hapd->iface->num_bss <= 1 || + (frame_type != WLAN_FC_STYPE_BEACON && + frame_type != WLAN_FC_STYPE_PROBE_RESP)) + return 0; + + if (frame_type == WLAN_FC_STYPE_BEACON) { + if (!elem_count) { + wpa_printf(MSG_ERROR, + "MBSSID: Insufficient data for beacons"); + return 0; + } + *elem_count = 0; + } + + while (bss_index < hapd->iface->num_bss) { + len += hostapd_eid_mbssid_elem_len(hapd, frame_type, + &bss_index); + + if (frame_type == WLAN_FC_STYPE_BEACON) + *elem_count += 1; + } + return len; +} + + +static u8 * hostapd_eid_mbssid_elem(struct hostapd_data *hapd, u8 *eid, u8 *end, + u32 frame_type, u8 max_bssid_indicator, + size_t *bss_index, u8 elem_count) +{ + size_t i; + u8 *eid_len_offset, *max_bssid_indicator_offset; + + *eid++ = WLAN_EID_MULTIPLE_BSSID; + eid_len_offset = eid++; + max_bssid_indicator_offset = eid++; + + for (i = *bss_index; i < hapd->iface->num_bss; i++) { + struct hostapd_data *bss = hapd->iface->bss[i]; + struct hostapd_bss_config *conf; + u8 *eid_len_pos, *nontx_bss_start = eid; + const u8 *auth, *rsn, *rsnx; + size_t auth_len = 0; + u16 capab_info; + + if (!bss || !bss->conf || !bss->started) + continue; + conf = bss->conf; + + *eid++ = WLAN_EID_SUBELEMENT_NONTRANSMITTED_BSSID_PROFILE; + eid_len_pos = eid++; + + *eid++ = WLAN_EID_NONTRANSMITTED_BSSID_CAPA; + *eid++ = sizeof(capab_info); + capab_info = host_to_le16(hostapd_own_capab_info(bss)); + os_memcpy(eid, (const void *)&capab_info, sizeof(capab_info)); + eid += sizeof(capab_info); + + *eid++ = WLAN_EID_SSID; + *eid++ = conf->ssid.ssid_len; + os_memcpy(eid, conf->ssid.ssid, conf->ssid.ssid_len); + eid += conf->ssid.ssid_len; + + *eid++ = WLAN_EID_MULTIPLE_BSSID_INDEX; + if (frame_type == WLAN_FC_STYPE_BEACON) { + *eid++ = 3; + *eid++ = i; + if (hapd->iconf->mbssid == ENHANCED_MBSSID_ENABLED && + (conf->dtim_period % elem_count)) + conf->dtim_period = elem_count; + *eid++ = conf->dtim_period; + *eid++ = 0xFF; + } else { + *eid++ = 1; + *eid++ = i; + } + + auth = wpa_auth_get_wpa_ie(bss->wpa_auth, &auth_len); + if (auth) { + rsn = get_ie(auth, auth_len, WLAN_EID_RSN); + if (rsn) { + os_memcpy(eid, rsn, 2 + rsn[1]); + eid += (2 + rsn[1]); + } + + rsnx = get_ie(auth, auth_len, WLAN_EID_RSNX); + if (rsnx) { + os_memcpy(eid, rsnx, 2 + rsnx[1]); + eid += (2 + rsnx[1]); + } + } + + *eid_len_pos = (eid - eid_len_pos) - 1; + + if (((eid - eid_len_offset) - 1) > 255) { + eid = nontx_bss_start; + goto mbssid_too_big; + } + } + +mbssid_too_big: + *bss_index = i; + *max_bssid_indicator_offset = max_bssid_indicator; + if (*max_bssid_indicator_offset < 1) + *max_bssid_indicator_offset = 1; + *eid_len_offset = (eid - eid_len_offset) - 1; + return eid; +} + + +u8 * hostapd_eid_mbssid(struct hostapd_data *hapd, u8 *eid, u8 *end, + u32 frame_type, u8 elem_count, u8 **elem_offset) +{ + size_t bss_index = 1; + u8 elem_index = 0; + + if (!hapd->iconf->mbssid || hapd->iface->num_bss <= 1 || + (frame_type != WLAN_FC_STYPE_BEACON && + frame_type != WLAN_FC_STYPE_PROBE_RESP)) + return eid; + + if (frame_type == WLAN_FC_STYPE_BEACON && !elem_offset) { + wpa_printf(MSG_ERROR, "MBSSID: Insufficient data for beacons"); + return eid; + } + + while (bss_index < hapd->iface->num_bss) { + if (frame_type == WLAN_FC_STYPE_BEACON) { + if (elem_index == elem_count) { + wpa_printf(MSG_WARNING, + "MBSSID: More number of elements than provided array"); + break; + } + + elem_offset[elem_index] = eid; + elem_index = elem_index + 1; + } + eid = hostapd_eid_mbssid_elem(hapd, eid, end, frame_type, + hostapd_max_bssid_indicator(hapd), + &bss_index, elem_count); + } + return eid; +} + #endif /* CONFIG_NATIVE_WINDOWS */ diff --git a/src/ap/ieee802_11.h b/src/ap/ieee802_11.h index fa1f47b957e4..1c545eff23e6 100644 --- a/src/ap/ieee802_11.h +++ b/src/ap/ieee802_11.h @@ -214,5 +214,9 @@ u16 copy_sta_eht_capab(struct hostapd_data *hapd, struct sta_info *sta, enum ieee80211_op_mode opmode, const u8 *he_capab, size_t he_capab_len, const u8 *eht_capab, size_t eht_capab_len); +size_t hostapd_eid_mbssid_len(struct hostapd_data *hapd, u32 frame_type, + u8 *elem_count); +u8 * hostapd_eid_mbssid(struct hostapd_data *hapd, u8 *eid, u8 *end, + u32 frame_type, u8 elem_count, u8 **elem_offset); #endif /* IEEE802_11_H */ diff --git a/src/common/ieee802_11_defs.h b/src/common/ieee802_11_defs.h index ffa93f320f3d..8588832674a8 100644 --- a/src/common/ieee802_11_defs.h +++ b/src/common/ieee802_11_defs.h @@ -496,6 +496,8 @@ #define WLAN_EID_EXT_TID_TO_LINK_MAPPING 109 #define WLAN_EID_EXT_MULTI_LINK_TRAFFIC_INDICATION 110 +#define WLAN_EID_SUBELEMENT_NONTRANSMITTED_BSSID_PROFILE 0 + /* Extended Capabilities field */ #define WLAN_EXT_CAPAB_20_40_COEX 0 #define WLAN_EXT_CAPAB_GLK 1 From patchwork Wed May 11 20:49:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aloka Dixit X-Patchwork-Id: 1629761 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=hDPFrxuL; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=quicinc.com header.i=@quicinc.com header.a=rsa-sha256 header.s=qcdkim header.b=Ysa74G+m; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4Kz6YL63yqz9sFs for ; Thu, 12 May 2022 06:52:38 +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:References:In-Reply-To: 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: List-Owner; bh=V8A2fQc0QTKNzVZtwQGN7WNskAreOov92YFJo5jPORE=; b=hDPFrxuL15w69p x1Yt2Mvd62XZRvqb7XjutTC6KNzsUAIpplCGwYkFnupGd6XuO9o3v7A/pppwQTaW4F7W/6FsMOVUb 8VOWS0nEaOB6X9DHfcflStkBPbmdOtiMhWncsNmE3qHy3qUakgahMirtHcWdKT78QObBdfZ05/mvP +xfDPupf+jQ3NYKjlPFtiNRiHao3/HGtq+0stBB+wWUsCbGVunWUEMbSSs5NwdYscUgDv0OYpPJZG Lc6QFsUJFCCCIkKhDs83VhRMT43sE8VDYX1wMfgriwhDOXxea0j9SRM+fBD9ONVVeH9NV8ONux0bk s33Dk1yYcGVrPdmd//5w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1notJP-008aSp-5c; Wed, 11 May 2022 20:51:59 +0000 Received: from alexa-out-sd-01.qualcomm.com ([199.106.114.38]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1notHK-008Zap-Ew for hostap@lists.infradead.org; Wed, 11 May 2022 20:49:52 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1652302190; x=1683838190; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=D1HfmFCjqiSYvJ6JvFVIdKuO/QYIETpedh/Ktr4Nlfo=; b=Ysa74G+m/knF85Z2EY0ot0YPeCDOIqWXHLUgKsVkhXjYxuqBWKxmv5yo ZDXSVcyRDCTqST5A0XiuMZ5tLoWFSWpH3zdBIsn45GMjWwsxSfjid/laf DcCEGXUoisL1fmNw5pbs3IlPscTQfHyTfBWmPybyvSY7gd2NPMkRwFy+4 4=; Received: from unknown (HELO ironmsg03-sd.qualcomm.com) ([10.53.140.143]) by alexa-out-sd-01.qualcomm.com with ESMTP; 11 May 2022 13:49:45 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg03-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 May 2022 13:49:45 -0700 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Wed, 11 May 2022 13:49:44 -0700 Received: from alokad-linux.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Wed, 11 May 2022 13:49:44 -0700 From: Aloka Dixit To: , CC: John Crispin , Sowmiya Sree Elavalagan , Aloka Dixit Subject: [PATCH v2 05/11] mbssid: add non-inheritance element Date: Wed, 11 May 2022 13:49:25 -0700 Message-ID: <20220511204931.25069-6-quic_alokad@quicinc.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220511204931.25069-1-quic_alokad@quicinc.com> References: <20220511204931.25069-1-quic_alokad@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220511_134950_659802_3D0DB045 X-CRM114-Status: GOOD ( 16.25 ) X-Spam-Score: -2.5 (--) 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: John Crispin Add data as per IEEE Std 802.11-2020 section 9.4.2.240. Current implementation is added for the security and extended supported rates only. For the extended rates element, add a new member 'xrates_supported' which is set to 1 only if hostapd_eid_ext_supp_rates() returns success. Without this change, there are cases where this function ret [...] Content analysis details: (-2.5 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [199.106.114.38 listed in list.dnswl.org] -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: John Crispin Add data as per IEEE Std 802.11-2020 section 9.4.2.240. Current implementation is added for the security and extended supported rates only. For the extended rates element, add a new member 'xrates_supported' which is set to 1 only if hostapd_eid_ext_supp_rates() returns success. Without this change, there are cases where this function returns before adding the element for the transmitting interface resulting in incorrect addition of this element inside the MBSSID non-inheritance element. Signed-off-by: John Crispin Co-developed-by: Sowmiya Sree Elavalagan Signed-off-by: Sowmiya Sree Elavalagan Co-developed-by: Aloka Dixit Signed-off-by: Aloka Dixit --- v2: Added support for extended rates. src/ap/ap_config.h | 1 + src/ap/ieee802_11.c | 41 ++++++++++++++++++++++++++++++++++-- src/common/ieee802_11_defs.h | 1 + 3 files changed, 41 insertions(+), 2 deletions(-) diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h index d09b5f85990d..f0969b1cee99 100644 --- a/src/ap/ap_config.h +++ b/src/ap/ap_config.h @@ -913,6 +913,7 @@ struct hostapd_bss_config { u8 ext_capa[EXT_CAPA_MAX_LEN]; u8 rnr; + bool xrates_supported; }; /** diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c index ce01fae2872d..41bc450dc168 100644 --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c @@ -165,6 +165,7 @@ u8 * hostapd_eid_ext_supp_rates(struct hostapd_data *hapd, u8 *eid) int i, num, count; int h2e_required; + hapd->conf->xrates_supported = 0; if (hapd->iface->current_rates == NULL) return eid; @@ -214,6 +215,7 @@ u8 * hostapd_eid_ext_supp_rates(struct hostapd_data *hapd, u8 *eid) *pos++ = 0x80 | BSS_MEMBERSHIP_SELECTOR_SAE_H2E_ONLY; } + hapd->conf->xrates_supported = 1; return pos; } @@ -7567,12 +7569,14 @@ u8 * hostapd_eid_rnr(struct hostapd_data *hapd, u8 *eid, u32 type) static size_t hostapd_eid_mbssid_elem_len(struct hostapd_data *hapd, u32 frame_type, size_t *bss_index) { + struct hostapd_data *tx_bss = hostapd_mbssid_get_tx_bss(hapd); size_t len = 3, i; for (i = *bss_index; i < hapd->iface->num_bss; i++) { struct hostapd_data *bss = hapd->iface->bss[i]; - const u8 *auth, *rsn, *rsnx; + const u8 *auth, *rsn = NULL, *rsnx = NULL; size_t nontx_profile_len, auth_len; + u8 ie_count = 0; if (!bss || !bss->conf || !bss->started) continue; @@ -7600,6 +7604,16 @@ static size_t hostapd_eid_mbssid_elem_len(struct hostapd_data *hapd, if (rsnx) nontx_profile_len += (2 + rsnx[1]); } + if (!rsn && hostapd_wpa_ie(tx_bss, WLAN_EID_RSN)) + ie_count++; + if (!rsnx && hostapd_wpa_ie(tx_bss, WLAN_EID_RSNX)) + ie_count++; + if (bss->conf->xrates_supported) + nontx_profile_len += 8; + else if (hapd->conf->xrates_supported) + ie_count++; + if (ie_count) + nontx_profile_len += (4 + ie_count); if ((len + nontx_profile_len) > 255) goto mbssid_too_big; @@ -7647,6 +7661,7 @@ static u8 * hostapd_eid_mbssid_elem(struct hostapd_data *hapd, u8 *eid, u8 *end, u32 frame_type, u8 max_bssid_indicator, size_t *bss_index, u8 elem_count) { + struct hostapd_data *tx_bss = hostapd_mbssid_get_tx_bss(hapd); size_t i; u8 *eid_len_offset, *max_bssid_indicator_offset; @@ -7658,7 +7673,8 @@ static u8 * hostapd_eid_mbssid_elem(struct hostapd_data *hapd, u8 *eid, u8 *end, struct hostapd_data *bss = hapd->iface->bss[i]; struct hostapd_bss_config *conf; u8 *eid_len_pos, *nontx_bss_start = eid; - const u8 *auth, *rsn, *rsnx; + const u8 *auth, *rsn = NULL, *rsnx = NULL; + u8 ie_count = 0, non_inherit_ie[3]; size_t auth_len = 0; u16 capab_info; @@ -7708,6 +7724,27 @@ static u8 * hostapd_eid_mbssid_elem(struct hostapd_data *hapd, u8 *eid, u8 *end, eid += (2 + rsnx[1]); } } + if (!rsn && hostapd_wpa_ie(tx_bss, WLAN_EID_RSN)) { + non_inherit_ie[ie_count] = WLAN_EID_RSN; + ie_count++; + } + if (!rsnx && hostapd_wpa_ie(tx_bss, WLAN_EID_RSNX)) { + non_inherit_ie[ie_count] = WLAN_EID_RSNX; + ie_count++; + } + if (hapd->conf->xrates_supported && + !bss->conf->xrates_supported) { + non_inherit_ie[ie_count] = WLAN_EID_EXT_SUPP_RATES; + ie_count++; + } + if (ie_count) { + *eid++ = WLAN_EID_EXTENSION; + *eid++ = 2 + ie_count; + *eid++ = WLAN_EID_EXT_NON_INHERITANCE; + *eid++ = ie_count; + os_memcpy(eid, non_inherit_ie, ie_count); + eid += ie_count; + } *eid_len_pos = (eid - eid_len_pos) - 1; diff --git a/src/common/ieee802_11_defs.h b/src/common/ieee802_11_defs.h index 8588832674a8..28c1ac526443 100644 --- a/src/common/ieee802_11_defs.h +++ b/src/common/ieee802_11_defs.h @@ -481,6 +481,7 @@ #define WLAN_EID_EXT_SPATIAL_REUSE 39 #define WLAN_EID_EXT_COLOR_CHANGE_ANNOUNCEMENT 42 #define WLAN_EID_EXT_OCV_OCI 54 +#define WLAN_EID_EXT_NON_INHERITANCE 56 #define WLAN_EID_EXT_SHORT_SSID_LIST 58 #define WLAN_EID_EXT_HE_6GHZ_BAND_CAP 59 #define WLAN_EID_EXT_EDMG_CAPABILITIES 61 From patchwork Wed May 11 20:49:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aloka Dixit X-Patchwork-Id: 1629754 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=vGCJ6sat; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=quicinc.com header.i=@quicinc.com header.a=rsa-sha256 header.s=qcdkim header.b=qJsd2pNO; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4Kz6Wd52nxz9sFs for ; Thu, 12 May 2022 06:51:09 +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:References:In-Reply-To: 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: List-Owner; bh=A1TNBArNLc0mN3HwmvzsDy04RsVUyEz21ozV/rnfsa8=; b=vGCJ6sat1MCUrC MGOlGdrTwO5f4Lak6tAqf+eNyFIHPa+ttZsWsZtw9i//ac7s0PEtmKZrcXwK9IBcf+e40B4hzegxt oMbX1cwePX+4iCrDU+5kTCJchbob+V35W+5bISCcy9fSTS2cfq3a61vuVPfo6jEr6gIfRZwv0qbWb sIOsgWJ0XIZRmIcdkTvh9uOGCZzkQdNbG8ViRSZp1E8vuuCY74MuEYkBxXOck2mKcyz5no/2daSmI zujwKou4Miv3uclr0oaILeW8I/bk4gqhCj8Pl0WZ/qPz4Hl2gVRiKETe43HXMRu+/SJ/Je9OFp/Kt JnhCllfacHd+9xY1V0JA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1notHq-008Zhy-Ac; Wed, 11 May 2022 20:50:22 +0000 Received: from alexa-out.qualcomm.com ([129.46.98.28]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1notHF-008ZXx-LY for hostap@lists.infradead.org; Wed, 11 May 2022 20:49:49 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1652302186; x=1683838186; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=MdKpYrrw34G8n6S4SC1KCQv0R3NTg7DzTwaICJTAYdg=; b=qJsd2pNOtOW7xblZoNcaYrqGvCoRLA2Zdm2gHKdbMZvfyBLpjJD/kRqr SVPq4lFT+NO7z/CtsLTXsK/a/AGJuFyVKi3puS2Jpnt0MCId8TNa7UwoL ymB1lUb9RqNuERGqqxrDUdomMqHlQjajaPBBYbbtPrP+lVMiNAIzv92N6 I=; Received: from ironmsg-lv-alpha.qualcomm.com ([10.47.202.13]) by alexa-out.qualcomm.com with ESMTP; 11 May 2022 13:49:45 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg-lv-alpha.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 May 2022 13:49:45 -0700 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Wed, 11 May 2022 13:49:44 -0700 Received: from alokad-linux.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Wed, 11 May 2022 13:49:44 -0700 From: Aloka Dixit To: , CC: John Crispin , Aloka Dixit Subject: [PATCH v2 06/11] mbssid: configure parameters and element data Date: Wed, 11 May 2022 13:49:26 -0700 Message-ID: <20220511204931.25069-7-quic_alokad@quicinc.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220511204931.25069-1-quic_alokad@quicinc.com> References: <20220511204931.25069-1-quic_alokad@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220511_134945_789256_CBEBA452 X-CRM114-Status: GOOD ( 20.56 ) X-Spam-Score: -0.9 (/) 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: John Crispin Add helper functions to retrieve the context for the transmitting interfaces of the MBSSID set and the index of a given BSS. Set device parameters - BSS index and the transmitting BSS. Content analysis details: (-0.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [129.46.98.28 listed in list.dnswl.org] -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: John Crispin Add helper functions to retrieve the context for the transmitting interfaces of the MBSSID set and the index of a given BSS. Set device parameters - BSS index and the transmitting BSS. Include multiple BSSID elements in beacon and probe response frames. Signed-off-by: John Crispin Co-developed-by: Aloka Dixit Signed-off-by: Aloka Dixit --- v2: Checks for error conditions before setting any driver parameters. src/ap/beacon.c | 80 ++++++++++++++++++++++++++++++++++++++++++-- src/ap/hostapd.c | 23 +++++++++++++ src/ap/hostapd.h | 2 ++ src/drivers/driver.h | 36 ++++++++++++++++++++ 4 files changed, 138 insertions(+), 3 deletions(-) diff --git a/src/ap/beacon.c b/src/ap/beacon.c index 58872bfdab71..b2619bf40fe8 100644 --- a/src/ap/beacon.c +++ b/src/ap/beacon.c @@ -462,6 +462,55 @@ static u8 * hostapd_eid_supported_op_classes(struct hostapd_data *hapd, u8 *eid) } +static int ieee802_11_build_ap_params_mbssid(struct hostapd_data *hapd, + struct wpa_driver_ap_params *params) +{ + struct hostapd_iface *iface = hapd->iface; + struct hostapd_data *tx_bss; + size_t len; + u8 elem_count = 0, *elem = NULL, **elem_offset = NULL, *end; + + if (!iface->mbssid_max_interfaces || + iface->num_bss > iface->mbssid_max_interfaces || + (iface->conf->mbssid == ENHANCED_MBSSID_ENABLED && + !iface->ema_max_periodicity)) + goto fail; + + tx_bss = hostapd_mbssid_get_tx_bss(hapd); + len = hostapd_eid_mbssid_len(tx_bss, WLAN_FC_STYPE_BEACON, &elem_count); + if (!len || (iface->conf->mbssid == ENHANCED_MBSSID_ENABLED && + elem_count > iface->ema_max_periodicity)) + goto fail; + + elem = os_zalloc(len); + if (!elem) + goto fail; + + elem_offset = os_zalloc(elem_count * sizeof(u8 *)); + if (!elem_offset) + goto fail; + + end = hostapd_eid_mbssid(tx_bss, elem, elem + len, WLAN_FC_STYPE_BEACON, + elem_count, elem_offset); + + params->mbssid_tx_iface = tx_bss->conf->iface; + params->mbssid_index = hostapd_mbssid_get_bss_index(hapd); + params->mbssid_elem = elem; + params->mbssid_elem_len = end - elem; + params->mbssid_elem_count = elem_count; + params->mbssid_elem_offset = elem_offset; + if (iface->conf->mbssid == ENHANCED_MBSSID_ENABLED) + params->ema = true; + + return 0; + +fail: + os_free(elem); + wpa_printf(MSG_ERROR, "MBSSID: Configuration failed"); + return -1; +} + + static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd, const struct ieee80211_mgmt *req, int is_p2p, size_t *resp_len, @@ -471,6 +520,8 @@ static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd, u8 *pos, *epos, *csa_pos; size_t buflen; + hapd = hostapd_mbssid_get_tx_bss(hapd); + #define MAX_PROBERESP_LEN 768 buflen = MAX_PROBERESP_LEN; #ifdef CONFIG_WPS @@ -517,6 +568,7 @@ static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd, } #endif /* CONFIG_IEEE80211BE */ + buflen += hostapd_eid_mbssid_len(hapd, WLAN_FC_STYPE_PROBE_RESP, NULL); buflen += hostapd_eid_rnr_len(hapd, WLAN_FC_STYPE_PROBE_RESP); buflen += hostapd_mbo_ie_len(hapd); buflen += hostapd_eid_owe_trans_len(hapd); @@ -588,6 +640,8 @@ static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd, pos = hostapd_eid_supported_op_classes(hapd, pos); pos = hostapd_eid_ht_capabilities(hapd, pos); pos = hostapd_eid_ht_operation(hapd, pos); + pos = hostapd_eid_mbssid(hapd, pos, epos, WLAN_FC_STYPE_PROBE_RESP, 0, + NULL); pos = hostapd_eid_ext_capab(hapd, pos); @@ -1141,6 +1195,11 @@ void handle_probe_req(struct hostapd_data *hapd, } #endif /* CONFIG_TESTING_OPTIONS */ + /* Do not send probe response from a non-transmitting multiple BSSID + * profile unless the probe request is directed at that paticular BSS */ + if (hapd != hostapd_mbssid_get_tx_bss(hapd) && res != EXACT_SSID_MATCH) + return; + wpa_msg_ctrl(hapd->msg_ctx, MSG_INFO, RX_PROBE_REQUEST "sa=" MACSTR " signal=%d", MAC2STR(mgmt->sa), ssi_signal); @@ -1167,7 +1226,8 @@ void handle_probe_req(struct hostapd_data *hapd, hapd->cs_c_off_ecsa_proberesp; } - ret = hostapd_drv_send_mlme(hapd, resp, resp_len, noack, + ret = hostapd_drv_send_mlme(hostapd_mbssid_get_tx_bss(hapd), resp, + resp_len, noack, csa_offs_len ? csa_offs : NULL, csa_offs_len, 0); @@ -1512,7 +1572,11 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd, #ifdef NEED_AP_MLME u16 capab_info; u8 *pos, *tailpos, *tailend, *csa_pos; +#endif /* NEED_AP_MLME */ + + os_memset(params, 0, sizeof(*params)); +#ifdef NEED_AP_MLME #define BEACON_HEAD_BUF_SIZE 256 #define BEACON_TAIL_BUF_SIZE 512 head = os_zalloc(BEACON_HEAD_BUF_SIZE); @@ -1649,9 +1713,16 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd, tailpos = hostapd_eid_supported_op_classes(hapd, tailpos); tailpos = hostapd_eid_ht_capabilities(hapd, tailpos); tailpos = hostapd_eid_ht_operation(hapd, tailpos); - tailpos = hostapd_eid_ext_capab(hapd, tailpos); + if (hapd->iconf->mbssid && hapd->iconf->num_bss > 1 && + ieee802_11_build_ap_params_mbssid(hapd, params)) { + os_free(head); + os_free(tail); + wpa_printf(MSG_ERROR, "Failed to set beacon data"); + return -1; + } + /* * TODO: Time Advertisement element should only be included in some * DTIM Beacon frames. @@ -1772,7 +1843,6 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd, resp = hostapd_probe_resp_offloads(hapd, &resp_len); #endif /* NEED_AP_MLME */ - os_memset(params, 0, sizeof(*params)); params->head = (u8 *) head; params->head_len = head_len; params->tail = tail; @@ -1875,6 +1945,10 @@ void ieee802_11_free_ap_params(struct wpa_driver_ap_params *params) params->head = NULL; os_free(params->proberesp); params->proberesp = NULL; + os_free(params->mbssid_elem); + params->mbssid_elem = NULL; + os_free(params->mbssid_elem_offset); + params->mbssid_elem_offset = NULL; #ifdef CONFIG_FILS os_free(params->fd_frame_tmpl); params->fd_frame_tmpl = NULL; diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c index 39340864edc4..eb059c508fbc 100644 --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c @@ -91,6 +91,29 @@ int hostapd_for_each_interface(struct hapd_interfaces *interfaces, } +struct hostapd_data * hostapd_mbssid_get_tx_bss(struct hostapd_data *hapd) +{ + if (hapd->iconf->mbssid) + return hapd->iface->bss[0]; + + return hapd; +} + + +int hostapd_mbssid_get_bss_index(struct hostapd_data *hapd) +{ + if (hapd->iconf->mbssid) { + size_t i; + + for (i = 1; i < hapd->iface->num_bss; i++) + if (hapd->iface->bss[i] == hapd) + return i; + } + + return 0; +} + + void hostapd_reconfig_encryption(struct hostapd_data *hapd) { if (hapd->wpa_auth) diff --git a/src/ap/hostapd.h b/src/ap/hostapd.h index 36c6a8b21d08..a210a5f68da1 100644 --- a/src/ap/hostapd.h +++ b/src/ap/hostapd.h @@ -723,6 +723,8 @@ struct hostapd_data * hostapd_get_iface(struct hapd_interfaces *interfaces, void hostapd_event_sta_opmode_changed(struct hostapd_data *hapd, const u8 *addr, enum smps_mode smps_mode, enum chan_width chan_width, u8 rx_nss); +struct hostapd_data * hostapd_mbssid_get_tx_bss(struct hostapd_data *hapd); +int hostapd_mbssid_get_bss_index(struct hostapd_data *hapd); #ifdef CONFIG_FST void fst_hostapd_fill_iface_obj(struct hostapd_data *hapd, diff --git a/src/drivers/driver.h b/src/drivers/driver.h index 39a2e6387d8a..d7511130ee18 100644 --- a/src/drivers/driver.h +++ b/src/drivers/driver.h @@ -1618,6 +1618,42 @@ struct wpa_driver_ap_params { * Unsolicited broadcast Probe Response template length */ size_t unsol_bcast_probe_resp_tmpl_len; + + /** + * mbssid_tx_iface - Transmitting interface of the MBSSID set + */ + const char *mbssid_tx_iface; + + /** + * mbssid_index - The index of this BSS in the MBSSID set + */ + unsigned int mbssid_index; + + /** + * mbssid_elem - Buffer containing all MBSSID elements + */ + u8 *mbssid_elem; + + /** + * mbssid_elem_len - Total length of all MBSSID elements + */ + size_t mbssid_elem_len; + + /** + * mbssid_elem_count - The number of MBSSID elements + */ + u8 mbssid_elem_count; + + /** + * mbssid_elem_offset - Offsets to elements in mbssid_elem. + * Kernel will use these offsets to generate multiple BSSID beacons. + */ + u8 **mbssid_elem_offset; + + /** + * ema - Enhanced MBSSID advertisements support. + */ + bool ema; }; struct wpa_driver_mesh_bss_params { From patchwork Wed May 11 20:49:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aloka Dixit X-Patchwork-Id: 1629755 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=U+eAqipt; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=quicinc.com header.i=@quicinc.com header.a=rsa-sha256 header.s=qcdkim header.b=Dd26JiQQ; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4Kz6Wq11ZDz9sFs for ; Thu, 12 May 2022 06:51:19 +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:References:In-Reply-To: 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: List-Owner; bh=gQviBTatKGxF88f4il86BVjoCAe5/0d0aLZV94nLKC4=; b=U+eAqipt02x9fr Unvg19swAPq7sP91GdiB6UcLW18xzJTE4L/MX0ZFgeiSzux+Z5WUQLlmnukZbkJyE/A+YlOAJjGEE w8A+eK0OMawSx51tLrcO+7ZNx8NBddSTbNgEyiUp6UeoMULgVIHDR53O/v/YxtDsaoXNcvgg3FcEZ VahZ8H5JoEDi3vXerFlKAGgP8je4gK8P3IhpKKXLR16Npp2yrAZlX1531gAe59IAFYd4pP7UNn6XU wAEQxoSSVJXj8IyxmPAOXdJJMyqIr/tIoELNuAiCgkpKcdOBL6gMygL39A0fnLZa0JDOx+PC8RpXy feh+znLMsA8Emu045gGQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1notI0-008ZlW-9N; Wed, 11 May 2022 20:50:32 +0000 Received: from alexa-out-sd-02.qualcomm.com ([199.106.114.39]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1notHH-008ZXZ-1N for hostap@lists.infradead.org; Wed, 11 May 2022 20:49:48 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1652302186; x=1683838186; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=wpN0GnXZjB7BY2Q2qIsZnFEVL9OFN8xQd0i5PiwE+GU=; b=Dd26JiQQrea4TgJW0gXl5U+ba7AHk7Be36LSojqlXhN9TibBttWSQuON A60xAb0eFui5Q12QRlUfXhAFVlq20jKbyo9HFOGhg5TIQXYXUyP9v85Wz IdjTs1/k8SLHcCi+Q4M35znKeVEeP2WJ5OGQ5GYJD6VaVD2Ds4cAPskIv c=; Received: from unknown (HELO ironmsg-SD-alpha.qualcomm.com) ([10.53.140.30]) by alexa-out-sd-02.qualcomm.com with ESMTP; 11 May 2022 13:49:46 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg-SD-alpha.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 May 2022 13:49:46 -0700 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Wed, 11 May 2022 13:49:45 -0700 Received: from alokad-linux.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Wed, 11 May 2022 13:49:45 -0700 From: Aloka Dixit To: , CC: Aloka Dixit Subject: [PATCH v2 08/11] mbssid: add MBSSID configuration element Date: Wed, 11 May 2022 13:49:28 -0700 Message-ID: <20220511204931.25069-9-quic_alokad@quicinc.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220511204931.25069-1-quic_alokad@quicinc.com> References: <20220511204931.25069-1-quic_alokad@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220511_134947_175305_540D5EFE X-CRM114-Status: GOOD ( 13.30 ) X-Spam-Score: -2.5 (--) 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: Add multiple BSSID configuration element data as per IEEE Std 802.11ax-2021, section 9.4.2.260 when enhanced multiple BSSID advertisements (EMA) are enabled. This element informs the clients about the [...] Content analysis details: (-2.5 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [199.106.114.39 listed in list.dnswl.org] -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 Add multiple BSSID configuration element data as per IEEE Std 802.11ax-2021, section 9.4.2.260 when enhanced multiple BSSID advertisements (EMA) are enabled. This element informs the clients about the EMA profile periodicity of the multiple BSSID set. Signed-off-by: Aloka Dixit --- src/ap/beacon.c | 18 +++++++++++++++--- src/common/ieee802_11_defs.h | 1 + 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/ap/beacon.c b/src/ap/beacon.c index 57e342c0855b..8af7d032b35f 100644 --- a/src/ap/beacon.c +++ b/src/ap/beacon.c @@ -463,12 +463,14 @@ static u8 * hostapd_eid_supported_op_classes(struct hostapd_data *hapd, u8 *eid) static int ieee802_11_build_ap_params_mbssid(struct hostapd_data *hapd, - struct wpa_driver_ap_params *params) + struct wpa_driver_ap_params *params, + u8 **eid) { struct hostapd_iface *iface = hapd->iface; struct hostapd_data *tx_bss; size_t len; u8 elem_count = 0, *elem = NULL, **elem_offset = NULL, *end; + u8 *tailpos = *eid; if (!iface->mbssid_max_interfaces || iface->num_bss > iface->mbssid_max_interfaces || @@ -499,8 +501,15 @@ static int ieee802_11_build_ap_params_mbssid(struct hostapd_data *hapd, params->mbssid_elem_len = end - elem; params->mbssid_elem_count = elem_count; params->mbssid_elem_offset = elem_offset; - if (iface->conf->mbssid == ENHANCED_MBSSID_ENABLED) + if (iface->conf->mbssid == ENHANCED_MBSSID_ENABLED) { params->ema = true; + *tailpos++ = WLAN_EID_EXTENSION; + *tailpos++ = 3; + *tailpos++ = WLAN_EID_EXT_MULTIPLE_BSSID_CONFIGURATION; + *tailpos++ = iface->num_bss; + *tailpos++ = params->mbssid_elem_count; + *eid = tailpos; + } return 0; @@ -1633,6 +1642,9 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd, } #endif /* CONFIG_IEEE80211BE */ + if (hapd->iconf->mbssid == ENHANCED_MBSSID_ENABLED && + hapd == hostapd_mbssid_get_tx_bss(hapd)) + tail_len += 5; /* Multiple BSSID Configuration element */ tail_len += hostapd_eid_rnr_len(hapd, WLAN_FC_STYPE_BEACON); tail_len += hostapd_mbo_ie_len(hapd); tail_len += hostapd_eid_owe_trans_len(hapd); @@ -1722,7 +1734,7 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd, tailpos = hostapd_eid_ext_capab(hapd, tailpos); if (hapd->iconf->mbssid && hapd->iconf->num_bss > 1) { - if (ieee802_11_build_ap_params_mbssid(hapd, params)) { + if (ieee802_11_build_ap_params_mbssid(hapd, params, &tailpos)) { os_free(head); os_free(tail); wpa_printf(MSG_ERROR, "Failed to set beacon data"); diff --git a/src/common/ieee802_11_defs.h b/src/common/ieee802_11_defs.h index 28c1ac526443..26b4970fff20 100644 --- a/src/common/ieee802_11_defs.h +++ b/src/common/ieee802_11_defs.h @@ -481,6 +481,7 @@ #define WLAN_EID_EXT_SPATIAL_REUSE 39 #define WLAN_EID_EXT_COLOR_CHANGE_ANNOUNCEMENT 42 #define WLAN_EID_EXT_OCV_OCI 54 +#define WLAN_EID_EXT_MULTIPLE_BSSID_CONFIGURATION 55 #define WLAN_EID_EXT_NON_INHERITANCE 56 #define WLAN_EID_EXT_SHORT_SSID_LIST 58 #define WLAN_EID_EXT_HE_6GHZ_BAND_CAP 59 From patchwork Wed May 11 20:49:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aloka Dixit X-Patchwork-Id: 1629758 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=VSTUqo8+; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=quicinc.com header.i=@quicinc.com header.a=rsa-sha256 header.s=qcdkim header.b=xmYD06sM; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4Kz6Xf5gZBz9sFs for ; Thu, 12 May 2022 06:52:02 +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:References:In-Reply-To: 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: List-Owner; bh=9/C3lq6RUrwx7uc0DATfUfBgfcU0yMrcBDXMpuLZ5Fw=; b=VSTUqo8+5yi+Xw gvQr6HFlUO0M7L4gjMe0zRZ3/DzghA2EPkDtbehrFEIpMtqnRFkXtwPyIgw3AQHvhQfIW8KyerVvg g9ue61W7IwvfGKlZrzvfM82h4lIPGLDKbgQT3FRxSNduSdmRAIFRgKh/26y0943JKrfkPpx/6GTLh lZK2Pc4pscpvDSAhlD5fxxyDqErObPSZQspFOzsByzeZCcasS1D703HH+wXIHqz/46xx3+kkB/eji mvGRWf/X+O04/DSwctCTOyQRsf3kvTleuEGHnWXTwQvQOSTUVsEwx+D1gA1LoQJe3ik7V4jqjF+7n J5GwNWeJJmZ7NbCxM7WA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1notIk-008a7o-49; Wed, 11 May 2022 20:51:18 +0000 Received: from alexa-out-sd-02.qualcomm.com ([199.106.114.39]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1notHH-008ZZA-8U for hostap@lists.infradead.org; Wed, 11 May 2022 20:49:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1652302187; x=1683838187; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=v2TFFmVPWO28WgODfWiZROnM4bM+ZEY1UUUiBvDFaSQ=; b=xmYD06sMSU4fpHQR5jqXR0aJcInyhEJLqE/hWYcVumdiIddNF8k8XHzE EBeG6oX58yQD2TjOO2tRaab4u4VtFOisyXS8bzkQevB53b7XcA7Rh+On+ JGcu1QaC33B5UkzaObpWtFmBvLbSpI2FdEdgWnJ2qV6uUhsI4tdETEiuD 4=; Received: from unknown (HELO ironmsg01-sd.qualcomm.com) ([10.53.140.141]) by alexa-out-sd-02.qualcomm.com with ESMTP; 11 May 2022 13:49:46 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg01-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 May 2022 13:49:46 -0700 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Wed, 11 May 2022 13:49:46 -0700 Received: from alokad-linux.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Wed, 11 May 2022 13:49:46 -0700 From: Aloka Dixit To: , CC: John Crispin , Aloka Dixit Subject: [PATCH v2 10/11] mbssid: make the AID space shared Date: Wed, 11 May 2022 13:49:30 -0700 Message-ID: <20220511204931.25069-11-quic_alokad@quicinc.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220511204931.25069-1-quic_alokad@quicinc.com> References: <20220511204931.25069-1-quic_alokad@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220511_134947_389466_A9BA3CD4 X-CRM114-Status: GOOD ( 10.79 ) X-Spam-Score: -2.5 (--) 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: John Crispin As described in IEEE Std 802.11-2020 11.1.3.8 Multiple BSSID procedure, set the lowest AID value assigned to any client equal to 2^n, where n is the maximum BSSID indicator of the MBSSID set. Content analysis details: (-2.5 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [199.106.114.39 listed in list.dnswl.org] -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: John Crispin As described in IEEE Std 802.11-2020 11.1.3.8 Multiple BSSID procedure, set the lowest AID value assigned to any client equal to 2^n, where n is the maximum BSSID indicator of the MBSSID set. Signed-off-by: John Crispin Co-developed-by: Aloka Dixit Signed-off-by: Aloka Dixit --- src/ap/ieee802_11.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c index bcdd032e15bf..486dc9dbb7fd 100644 --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c @@ -4014,7 +4014,10 @@ int hostapd_get_aid(struct hostapd_data *hapd, struct sta_info *sta) } if (j == 32) return -1; - aid = i * 32 + j + 1; + aid = i * 32 + j; + + aid += (1 << hostapd_max_bssid_indicator(hapd)); + if (aid > 2007) return -1; From patchwork Wed May 11 20:49:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aloka Dixit X-Patchwork-Id: 1629759 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=cVtpN35O; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=quicinc.com header.i=@quicinc.com header.a=rsa-sha256 header.s=qcdkim header.b=IvKyfcci; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4Kz6Xt562cz9sFs for ; Thu, 12 May 2022 06:52:14 +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:References:In-Reply-To: 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: List-Owner; bh=233QjW1uIEnWU1mLEVzyev1WFext5TR/xFSe841bAac=; b=cVtpN35OtWzNmk mzKivA4r7KUswUpfcUt0Yuu9H9jViLcde5i5aU0P7oEoECqWpdYjj0HBxhcbY/WuypmWHK4NvOpJT qNZlxPiTNWIYnIAdDpAZwvdBIo5H3h7ddGebq0zR86KGEDaepYFWv/viwBTl1Bd1wbG9KjszkINCR L8v7wx8pC+4ppy3ghB8qGkiPcXHemBsfZgkgi7fgYvDOKseZHfSwtK1r1sBlTyjjnd6jXx1BM7RCA 8v/oDilK6WhxZ30h/3jU9iJJxgryvKLq7i9oQu7K8jsoEHm+Gps+LG2b28CnxOzgKa7x/WY672mWa GLEErSmxWJZcHRePNT+Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1notJ0-008aHC-DR; Wed, 11 May 2022 20:51:34 +0000 Received: from alexa-out-sd-02.qualcomm.com ([199.106.114.39]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1notHI-008ZXZ-UV for hostap@lists.infradead.org; Wed, 11 May 2022 20:49:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1652302188; x=1683838188; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=4d3aNLj1OG8SyBRNxKSaLXtVbrjOxKVg+jb1preyCsQ=; b=IvKyfcci8uEQlCakqIYH//oMiQR4Zr6rEZcCFBIAMyimaXW66ybJvpNs 9PmaD6nMTDg1GOrjLfdjutGEMIti0cBm4rRdLSP6Ui9Kebblf7RWhM+EE zTqnheCpmWHUUQClPCGbJtFC3pL5zaYa7QuwXHLo5FM+3o0gncfyfRGvY s=; Received: from unknown (HELO ironmsg-SD-alpha.qualcomm.com) ([10.53.140.30]) by alexa-out-sd-02.qualcomm.com with ESMTP; 11 May 2022 13:49:47 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg-SD-alpha.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 May 2022 13:49:47 -0700 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Wed, 11 May 2022 13:49:46 -0700 Received: from alokad-linux.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Wed, 11 May 2022 13:49:46 -0700 From: Aloka Dixit To: , CC: John Crispin , Aloka Dixit Subject: [PATCH v2 11/11] mbssid: add nl80211 support Date: Wed, 11 May 2022 13:49:31 -0700 Message-ID: <20220511204931.25069-12-quic_alokad@quicinc.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220511204931.25069-1-quic_alokad@quicinc.com> References: <20220511204931.25069-1-quic_alokad@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220511_134949_099296_3643CC1A X-CRM114-Status: GOOD ( 13.08 ) X-Spam-Score: -2.5 (--) 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: John Crispin Send MBSSID and EMA configuration parameters to kernel. Signed-off-by: John Crispin Co-developed-by: Aloka Dixit Signed-off-by: Aloka Dixit --- v2: Added 'return -1' instead of 'goto fa [...] Content analysis details: (-2.5 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [199.106.114.39 listed in list.dnswl.org] -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: John Crispin Send MBSSID and EMA configuration parameters to kernel. Signed-off-by: John Crispin Co-developed-by: Aloka Dixit Signed-off-by: Aloka Dixit --- v2: Added 'return -1' instead of 'goto fail' in nl80211_mbssid(). src/drivers/driver_nl80211.c | 52 ++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 0127a6be28ed..d092f26fe713 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -4535,6 +4535,55 @@ static int nl80211_unsol_bcast_probe_resp(struct i802_bss *bss, #endif /* CONFIG_IEEE80211AX */ +static int nl80211_mbssid(struct nl_msg *msg, + struct wpa_driver_ap_params *params) +{ + struct nlattr *config, *elems; + int ifidx; + + if (!params->mbssid_tx_iface) + return 0; + + config = nla_nest_start(msg, NL80211_ATTR_MBSSID_CONFIG); + if (!config) + return -1; + + nla_put_u8(msg, NL80211_MBSSID_CONFIG_ATTR_INDEX, params->mbssid_index); + if (params->mbssid_tx_iface) { + ifidx = if_nametoindex(params->mbssid_tx_iface); + if (ifidx <= 0) + return -1; + nla_put_u32(msg, + NL80211_MBSSID_CONFIG_ATTR_TX_IFINDEX, + ifidx); + } + + if (params->ema) + nla_put_flag(msg, NL80211_MBSSID_CONFIG_ATTR_EMA); + + nla_nest_end(msg, config); + + if (params->mbssid_elem_count && params->mbssid_elem_len && + params->mbssid_elem_offset && *params->mbssid_elem_offset) { + u8 i, **offs = params->mbssid_elem_offset; + + elems = nla_nest_start(msg, NL80211_ATTR_MBSSID_ELEMS); + if (!elems) + return -1; + + for (i = 0; i < params->mbssid_elem_count - 1; i++) + nla_put(msg, i + 1, offs[i + 1] - offs[i], offs[i]); + + nla_put(msg, i + 1, + *offs + params->mbssid_elem_len - offs[i], + offs[i]); + + nla_nest_end(msg, elems); + } + return 0; +} + + static int wpa_driver_nl80211_set_ap(void *priv, struct wpa_driver_ap_params *params) { @@ -4829,6 +4878,9 @@ static int wpa_driver_nl80211_set_ap(void *priv, if (params->unsol_bcast_probe_resp_interval && nl80211_unsol_bcast_probe_resp(bss, msg, params) < 0) goto fail; + + if (nl80211_mbssid(msg, params) < 0) + goto fail; #endif /* CONFIG_IEEE80211AX */ #ifdef CONFIG_SAE