From patchwork Wed Mar 2 22:26: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: 1600112 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=lKI7/Ayb; 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=UVKyvxQM; 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 (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4K89VM03dgz9s1l for ; Thu, 3 Mar 2022 10:36:10 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=o7hT940jjm/zjlRmYopGEivJ7hbHlLhycZkoBU1Updw=; b=lKI7/Ayb5dI/lz hZLpMPOe+roCYmz1y3DYLcTiMAS9PYc+dchb+2uKk0farznzK7YFxf9XAFhN4/OG6pIwJA/LqWUYm pXbE556GxIS9WiMf/EIsJiI55W9x55KagDTukDM830O8hrGEUpYnCU1B+qILkM2uxqnzEvdjFu8UU /hPgDwQOLose8gByy/QfKUpkH8FD5DT5CThYwu9WwNOo6/f48J930WUtJWCG+LJ0r9FxR8u28xuIa wLouK8Ue0HdQ2oBsOa8JJjKdMfBwG6wv9cc08nhfEtCLNLqxXikeUxivSSrXJ89EMdVHYRWOtj+AH 3QeP4J2XQUSQW8hmXqYQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nPYUj-004i8A-8K; Wed, 02 Mar 2022 23:34:57 +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 1nPXQo-004Yh5-3Z for hostap@lists.infradead.org; Wed, 02 Mar 2022 22:26:51 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1646260010; x=1677796010; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=4QM+GMpdoZ83r0WZ/XcaHZBmMRJBmiUNvYKDbipcwF0=; b=UVKyvxQM/4QlxQ8diDiHg8OXnUYLhDZoc0ysphKydRi0n/oWsiQoJ56f CMGlZaVkcVhKqgtONZn7dg/bfbDnNl0ykMfne4j5Oo7VIFW1pA9i9WLqD MCFoACiFVKQE0hJjmLG4P7+7Md/7V6QVX0QKsiMlnxTsFfgScBBXLds0p c=; Received: from unknown (HELO ironmsg-SD-alpha.qualcomm.com) ([10.53.140.30]) by alexa-out-sd-01.qualcomm.com with ESMTP; 02 Mar 2022 14:26:45 -0800 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; 02 Mar 2022 14:26:45 -0800 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.15; Wed, 2 Mar 2022 14:26:45 -0800 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.15; Wed, 2 Mar 2022 14:26:44 -0800 From: Aloka Dixit To: , Subject: [PATCH 01/13] mbssid: add configuration options Date: Wed, 2 Mar 2022 14:26:22 -0800 Message-ID: <20220302222634.22185-2-quic_alokad@quicinc.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220302222634.22185-1-quic_alokad@quicinc.com> References: <20220302222634.22185-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-20220302_142650_225061_BF53B217 X-CRM114-Status: GOOD ( 14.28 ) 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 options to enable multiple BSSID (MBSSID) and enhanced multiple BSSID advertisements (EMA). MBSSID enablement is mandatory to enable EMA. Signed-off-by: John Crispin Co-developed-by: Aloka Dixit Co-developed-by: Aloka Dixit Signed-off-by: Aloka Dixit 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 options to enable multiple BSSID (MBSSID) and enhanced multiple BSSID advertisements (EMA). MBSSID enablement is mandatory to enable EMA. Signed-off-by: John Crispin Co-developed-by: Aloka Dixit Co-developed-by: Aloka Dixit Signed-off-by: Aloka Dixit --- hostapd/config_file.c | 4 ++++ hostapd/hostapd.conf | 10 ++++++++++ src/ap/ap_config.c | 5 +++++ src/ap/ap_config.h | 2 ++ 4 files changed, 21 insertions(+) diff --git a/hostapd/config_file.c b/hostapd/config_file.c index d416e5b771ee..5a5dc7d9e19f 100644 --- a/hostapd/config_file.c +++ b/hostapd/config_file.c @@ -4734,6 +4734,10 @@ static int hostapd_config_fill(struct hostapd_config *conf, return 1; } else if (os_strcmp(buf, "rnr") == 0) { bss->rnr = atoi(pos); + } else if (os_strcmp(buf, "mbssid") == 0) { + conf->mbssid = atoi(pos); + } else if (os_strcmp(buf, "ema") == 0) { + conf->ema = atoi(pos); } else { wpa_printf(MSG_ERROR, "Line %d: unknown configuration item '%s'", diff --git a/hostapd/hostapd.conf b/hostapd/hostapd.conf index 9b0c809ea73f..b1664c82da2d 100644 --- a/hostapd/hostapd.conf +++ b/hostapd/hostapd.conf @@ -973,6 +973,16 @@ wmm_ac_vo_acm=0 # Valid range: 0..20 TUs; default is 0 (disabled) #unsol_bcast_probe_resp_interval=0 +# Multiple BSSID element support in beacon and probe response frames. +# 0 = Disabled +# 1 = Enabled +#mbssid=0 + +# Enhanced multiple BSSID advertisements support in beacons. +# 0 = Disabled +# 1 = Enabled +#ema=0 + ##### IEEE 802.1X-2004 related configuration ################################## # Require IEEE 802.1X authorization diff --git a/src/ap/ap_config.c b/src/ap/ap_config.c index 86b6e097cf89..91f9253ce6f1 100644 --- a/src/ap/ap_config.c +++ b/src/ap/ap_config.c @@ -1500,6 +1500,11 @@ int hostapd_config_check(struct hostapd_config *conf, int full_config) return -1; } + if (!conf->mbssid && conf->ema) { + wpa_printf(MSG_ERROR, "mbssid must be enabled to enable ema"); + return -1; + } + for (i = 0; i < conf->num_bss; i++) { if (hostapd_config_check_bss(conf->bss[i], conf, full_config)) return -1; diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h index 1e21f7c96380..c9a15dac097d 100644 --- a/src/ap/ap_config.h +++ b/src/ap/ap_config.h @@ -1107,6 +1107,8 @@ struct hostapd_config { unsigned int airtime_update_interval; #define AIRTIME_MODE_MAX (__AIRTIME_MODE_MAX - 1) #endif /* CONFIG_AIRTIME_POLICY */ + u8 mbssid; + u8 ema; }; From patchwork Wed Mar 2 22:26: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: 1600113 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=yCpmBe3n; 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=iXzPqWKC; 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 (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4K89VP2VkYz9sFr for ; Thu, 3 Mar 2022 10:36:13 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=TPCTuX0L/DNMw41+113oglv+zMdpWuX6Da+m/fX94Ns=; b=yCpmBe3n4VXr5T 27eBsQnWpM/mW0kfPzFAfQRLpykW0QoHBe4mN62jGm//YWPSB850uU5QhRsWO0EY6a8VFJPqfz9oM 9VXXJGRFgl5nDehk+ZKVugKAYgYbELDC1hirbZajQAlks15AR2nkj4RiB6agMJipMYQqrHVCo3O3R /kinRqYS8LK+2LOIKwGUVQXxtRsld0EOGwyVyMEpMjA/8+rDQXXEUbXfHhXeDQUyP4PptX1wRlNX1 5KVbcnoWYb5xBYTCM78Aufs1CVyPHQf+zY7lJYhOwIEnbs0EsJPTO5nkVOPksw09ADmfc5KxLOAew CJLmfayjZxmwSuLS0qSQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nPYUr-004i8u-Kx; Wed, 02 Mar 2022 23:35: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 1nPXR6-004YkZ-9A for hostap@lists.infradead.org; Wed, 02 Mar 2022 22:27:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1646260028; x=1677796028; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=ZG5WMbF309Mwaig8GJastxbC3zst3WtAtIkLPLfUKRo=; b=iXzPqWKCyPa4iyg/p5offd2i+yVE2ABjDlgVptKn0USpbt9KQ0MJC/aq srM6WIUrhr/0I0lg4FTUcWSmeChSLfKv6tCuuLhmWO58SpHjdS1NtueM5 kYiWPpBorO0DeeOavfMr3metGByYFnGQIEYN6A/0AeccJ2cvSj3zfHEYt 4=; Received: from ironmsg08-lv.qualcomm.com ([10.47.202.152]) by alexa-out.qualcomm.com with ESMTP; 02 Mar 2022 14:27:06 -0800 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg08-lv.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Mar 2022 14:27:06 -0800 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.15; Wed, 2 Mar 2022 14:26:45 -0800 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.15; Wed, 2 Mar 2022 14:26:45 -0800 From: Aloka Dixit To: , Subject: [PATCH 02/13] mbssid: retrieve driver capabilities Date: Wed, 2 Mar 2022 14:26:23 -0800 Message-ID: <20220302222634.22185-3-quic_alokad@quicinc.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220302222634.22185-1-quic_alokad@quicinc.com> References: <20220302222634.22185-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-20220302_142708_379535_BFCD4004 X-CRM114-Status: GOOD ( 10.97 ) 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 --- hostapd/main.c | 3 +++ src/ap/hostapd.h | 5 +++++ src/drivers/driver.h | 5 +++++ 3 files changed, 13 insertions(+) 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 [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-Mailman-Approved-At: Wed, 02 Mar 2022 15:34:45 -0800 X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Retrieve driver capabilities for maximum number of interfaces for MBSSID and maximum allowed profile periodicity for enhanced MBSSID advertisements. Signed-off-by: Aloka Dixit --- hostapd/main.c | 3 +++ src/ap/hostapd.h | 5 +++++ src/drivers/driver.h | 5 +++++ 3 files changed, 13 insertions(+) diff --git a/hostapd/main.c b/hostapd/main.c index c9ec38d19f88..19db9bc446e3 100644 --- a/hostapd/main.c +++ b/hostapd/main.c @@ -240,6 +240,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 f3ca7529ac96..def0971cc11f 100644 --- a/src/ap/hostapd.h +++ b/src/ap/hostapd.h @@ -596,6 +596,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 ebc550fbe630..cf0f2180e704 100644 --- a/src/drivers/driver.h +++ b/src/drivers/driver.h @@ -2141,6 +2141,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; }; From patchwork Wed Mar 2 22:26: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: 1600120 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=QFE3hEGd; 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=cJG+9njX; 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 (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4K89Wk0YvJz9s1l for ; Thu, 3 Mar 2022 10:37:22 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=G0g1fB5YvYOTRkzcJlmAcu3bMW9Mjs5jfsChtpg+5tI=; b=QFE3hEGdOruHhA cldtzgfam/n//uvPLaYN5Jjq67ibmVq1ZhkX6sFV6TriPQBRf6WlpfFcVHmnwA3vkCagEJGzt/Lzw Fl9ABjoz9NILZLKnuPNIR13Cqr/ah49S1EX1p9UFNagD4inMho9CxytSlBVBzMVDZq6O3pwuGFTju y71rTN6QSaJ6TdQE1tj1YjOjLBF51nat2JNBop0OfgTFm1sTEiNErz8qHuxIzdWRTucdly34eG13X yG3ck2Ivnb44VGGJ1DdPaoxOS7kzRVHVUcVMKPZf1sTvbZIB2Gt/++jKeVAXTBXbl7s4pmQJV3wwK GFIj1Sca38tyqmms555w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nPYW4-004iTZ-A1; Wed, 02 Mar 2022 23:36:20 +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 1nPXR9-004Ylt-Eo for hostap@lists.infradead.org; Wed, 02 Mar 2022 22:27:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1646260031; x=1677796031; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=kJkQ1Q9+yCPCJOaGLmtSZYl/7CNv3Tb6FjKyiMmzuqg=; b=cJG+9njXR8/8txJZfObsRGiVfsa5nCPq4L4Dh1W01iZxn63jqi+OZ7h8 2msIyd6p68kdy5t8hCluexOJnySSWzpJoBrrS0+hNqYfQRJ5gBiJii6Z7 4KKSHsNwXsnhlXy+IgeA+/VH5kSBJLmhnTdjUu0ysjKnZP44si1ZyNfvF 8=; Received: from ironmsg08-lv.qualcomm.com ([10.47.202.152]) by alexa-out.qualcomm.com with ESMTP; 02 Mar 2022 14:27:06 -0800 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg08-lv.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Mar 2022 14:27:06 -0800 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.15; Wed, 2 Mar 2022 14:26:46 -0800 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.15; Wed, 2 Mar 2022 14:26:45 -0800 From: Aloka Dixit To: , Subject: [PATCH 03/13] mbssid: configure all BSSes before beacon setup Date: Wed, 2 Mar 2022 14:26:24 -0800 Message-ID: <20220302222634.22185-4-quic_alokad@quicinc.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220302222634.22185-1-quic_alokad@quicinc.com> References: <20220302222634.22185-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-20220302_142711_593678_A57B326E X-CRM114-Status: GOOD ( 19.62 ) 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: With existing design, the transmitted beacon is set before RSN information element is formed for any nontransmitted profile hence the beacon has these profiles with open encryption. It also sets wrong [...] 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 [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-Mailman-Approved-At: Wed, 02 Mar 2022 15:34:45 -0800 X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org With existing design, the transmitted beacon is set before RSN information element is formed for any nontransmitted profile hence the beacon has these profiles with open encryption. It also sets wrong DTIM period, profile periodicity values until all non-transmitting BSSes are up. Retrieve configurations for all nontransmitted profiles before setting the beacon to ensures that beacons reflect correct information. Signed-off-by: Aloka Dixit --- src/ap/hostapd.c | 90 ++++++++++++++++++++++++++++++++++-------------- 1 file changed, 64 insertions(+), 26 deletions(-) diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c index 4b88641a2dde..14b608e67c23 100644 --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c @@ -1095,19 +1095,59 @@ static int db_table_create_radius_attributes(sqlite3 *db) #endif /* CONFIG_NO_RADIUS */ +static int hostapd_set_beacon(struct hostapd_data *hapd) +{ + struct hostapd_bss_config *conf = hapd->conf; + int flush_old_stations = 1; + +#ifdef CONFIG_MESH + if ((hapd->conf->mesh & MESH_ENABLED) && hapd->iface->mconf == NULL) + flush_old_stations = 0; +#endif /* CONFIG_MESH */ + + 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]; + + /* Should any previously associated STA not have noticed that + * the AP had stopped and restarted, send one more + * deauthentication notification now that the AP is ready to + * operate. */ + wpa_dbg(hapd->msg_ctx, MSG_DEBUG, + "Deauthenticate all stations at BSS start"); + os_memset(addr, 0xff, ETH_ALEN); + hostapd_drv_sta_deauth(hapd, addr, + WLAN_REASON_PREV_AUTH_NOT_VALID); + } + + 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); + + 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 + * @set_beacon: Whether beacon should be set. When MBSSID IE is enabled, + * information regarding all BSSes should be retrieved before setting + * beacons. * * 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 set_beacon) { struct hostapd_bss_config *conf = hapd->conf; u8 ssid[SSID_MAX_LEN + 1]; @@ -1379,29 +1419,8 @@ 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]; - - /* Should any previously associated STA not have noticed that - * the AP had stopped and restarted, send one more - * deauthentication notification now that the AP is ready to - * operate. */ - wpa_dbg(hapd->msg_ctx, MSG_DEBUG, - "Deauthenticate all stations at BSS start"); - os_memset(addr, 0xff, ETH_ALEN); - hostapd_drv_sta_deauth(hapd, addr, - WLAN_REASON_PREV_AUTH_NOT_VALID); - } - - 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 (set_beacon) + return hostapd_set_beacon(hapd); return 0; } @@ -2112,7 +2131,8 @@ 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, + (hapd->iconf->mbssid ? 0 : 1))) { for (;;) { hapd = iface->bss[j]; hostapd_bss_deinit_no_free(hapd); @@ -2126,6 +2146,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_set_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); @@ -3007,7 +3045,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, 1))) { hostapd_cleanup(hapd); hapd_iface->bss[hapd_iface->num_bss - 1] = NULL; hapd_iface->conf->num_bss--; From patchwork Wed Mar 2 22:26: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: 1600117 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=KMfejsic; 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=plq2B08J; 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 (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4K89Vj1xJYz9s1l for ; Thu, 3 Mar 2022 10:36:29 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=hT8p0mhtvPFR38gRYCkK9FMWuyphruUZTQf55dX45fQ=; b=KMfejsictl8Uvr sEhLtG/0WDKApu8sxb0tDm5eQIGc1dOvHP+uQ7gwUn5Ftby6Y2HIelmDJjOGggqY7vFRdbscxqHbH Sstd1IOMCdXEctHK08sTBAaVJdMmDSIHzQdPG1nzloEq1zL9S1mBSPIor8I+dPwPVRmh9n96uwDzn yIYcqOTgr/JUw5vR6Np3Tpcqhv8H6t5F05ngPQxTA0H/6KAN8VLlbTT3x+5ZrOWho9nL5XFAsT/ON /mw9lyXg1S/F8jP1B/zRRIo3cH14v+o0Vpi82UVao2yEebsV42Qw0fsCV05ur+OWBcOysRbmplDY4 Tu8mf/eYgJpbWs5Qb2Ew==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nPYVJ-004iD5-1n; Wed, 02 Mar 2022 23:35:33 +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 1nPXR9-004YkZ-8p for hostap@lists.infradead.org; Wed, 02 Mar 2022 22:27:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1646260031; x=1677796031; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=EOf5yO5PO7Vas9t3UWiEeYKLa0azX1vq6phFKff4+uo=; b=plq2B08JcBHyHuuLTi5jZzNMW+6nnFFUtmVSfgdheQOVlIwRDQGGomuW 1Ok/5R+Z+kdl/JiZy/JSXE1Zl49NpWjNS2rHXr4WT59WM5vrnX1VrLgCG zZuVcwk+Ai4cL9UzhlwJ3kee9sv6GFnudSmDukM2YvyZn2Gyt/OKeeQgs g=; Received: from ironmsg08-lv.qualcomm.com ([10.47.202.152]) by alexa-out.qualcomm.com with ESMTP; 02 Mar 2022 14:27:06 -0800 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg08-lv.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Mar 2022 14:27:06 -0800 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.15; Wed, 2 Mar 2022 14:26:46 -0800 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.15; Wed, 2 Mar 2022 14:26:46 -0800 From: Aloka Dixit To: , Subject: [PATCH 04/13] mbssid: get and set configuration parameters Date: Wed, 2 Mar 2022 14:26:25 -0800 Message-ID: <20220302222634.22185-5-quic_alokad@quicinc.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220302222634.22185-1-quic_alokad@quicinc.com> References: <20220302222634.22185-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-20220302_142711_409535_B87ADE57 X-CRM114-Status: GOOD ( 18.02 ) 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 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, transmitting BSS and total number of BSS in 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 [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-Mailman-Approved-At: Wed, 02 Mar 2022 15:34:45 -0800 X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org 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, transmitting BSS and total number of BSS in the MBSSID set. Signed-off-by: John Crispin Co-developed-by: Aloka Dixit Signed-off-by: Aloka Dixit --- src/ap/beacon.c | 33 +++++++++++++++++++++++++++++++-- src/ap/hostapd.c | 23 +++++++++++++++++++++++ src/ap/hostapd.h | 2 ++ src/drivers/driver.h | 15 +++++++++++++++ 4 files changed, 71 insertions(+), 2 deletions(-) diff --git a/src/ap/beacon.c b/src/ap/beacon.c index 8cd1c417043e..1d70cb2ead2c 100644 --- a/src/ap/beacon.c +++ b/src/ap/beacon.c @@ -428,6 +428,32 @@ static u8 * hostapd_eid_supported_op_classes(struct hostapd_data *hapd, u8 *eid) } +static void hostapd_set_mbssid_beacon(struct hostapd_data *hapd, + struct wpa_driver_ap_params *params) +{ + struct hostapd_iface *iface = hapd->iface; + + if (!iface->conf->mbssid || iface->num_bss == 1) + return; + + if (!iface->mbssid_max_interfaces) { + wpa_printf(MSG_DEBUG, + "MBSSID: Driver doesn't support multi-BSSID advertisements"); + return; + } else if (iface->num_bss > iface->mbssid_max_interfaces) { + wpa_printf(MSG_DEBUG, + "MBSSID: Driver supports maximum %u interfaces for multi-BSSID advertisements", + iface->mbssid_max_interfaces); + return; + } + + params->mbssid_tx_iface = hostapd_mbssid_get_tx_bss(hapd)->conf->iface; + params->mbssid_index = hostapd_mbssid_get_bss_index(hapd); + params->mbssid_count = iface->num_bss; + return; +} + + static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd, const struct ieee80211_mgmt *req, int is_p2p, size_t *resp_len) @@ -1149,7 +1175,6 @@ static u8 * hostapd_probe_resp_offloads(struct hostapd_data *hapd, /* Generate a Probe Response template for the non-P2P case */ return hostapd_gen_probe_resp(hapd, NULL, 0, resp_len); } - #endif /* NEED_AP_MLME */ @@ -1432,7 +1457,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); @@ -1556,6 +1585,7 @@ 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); + hostapd_set_mbssid_beacon(hapd, params); tailpos = hostapd_eid_ext_capab(hapd, tailpos); @@ -1662,7 +1692,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; diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c index 14b608e67c23..9ca4ffa31d94 100644 --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c @@ -87,6 +87,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 def0971cc11f..4e9046efa879 100644 --- a/src/ap/hostapd.h +++ b/src/ap/hostapd.h @@ -691,6 +691,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 cf0f2180e704..0527f120287b 100644 --- a/src/drivers/driver.h +++ b/src/drivers/driver.h @@ -1582,6 +1582,21 @@ 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 set + */ + const char *mbssid_tx_iface; + + /** + * mbssid_index - The index of this BSS in the group + */ + unsigned int mbssid_index; + + /** + * mbssid_count - Total number of BSSs in the group + */ + unsigned int mbssid_count; }; struct wpa_driver_mesh_bss_params { From patchwork Wed Mar 2 22:26: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: 1600118 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=c7rztV1t; 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=x6exc9bq; 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 (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4K89Vv0XGrz9s1l for ; Thu, 3 Mar 2022 10:36:39 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=UT+QwF13ijKiBiSUtA8v9TmsYDPIGgo45rLke0mSfJw=; b=c7rztV1tGLjPdd ij37Iw9XdJVrGbhtK3wDnTHZQ1IF8YNmePfg6qSVVna/kPlunC9MrRhvaiiXYtx3dQ1uJdKC1PBkL fDadqA6nqxaB/XsyCWnDx855QNUW1AgFIYwrZHbCRMo1eESVVJdISEtU+GmTwRhEA4Wn/BS0Xcye9 5ckPZnTYzJQt8E5a1cMta/Eh8LDIL3au8KmHLyoZ5iaJGVvmAWRCesBaBAr7qXBXvArevY+2MYfr0 0zOh8URczqOLXKVjEbG0//1L5Yy2woH9GDMKkIaV48rCtk1wfaBa70Z/y0xTWPzSvvbqSjdx9rL1z e51stWmsZAy7xoyh8Y+g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nPYVW-004iHY-CF; Wed, 02 Mar 2022 23:35:46 +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 1nPXR9-004Yl7-8s for hostap@lists.infradead.org; Wed, 02 Mar 2022 22:27:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1646260031; x=1677796031; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=M7+7fLHjAP44E125WDnh0YHIfErFXZjnWC1KpXt3tmc=; b=x6exc9bqTq0hixb4mg/QU8ZeYuU8fQiEoumAk3MrMlBDzTtO6Rk3TqrD ay/bXnbVIjQXsaMl//dpqHiSrv0sLInm8YzPBprNQT9ySPNAhc2Mkh3rK M0OcvUvlYiwFPQWzvNSr6ejz2/P7RSVYh6j4mdsaRI2BN6ETRwxN3EGya o=; Received: from ironmsg08-lv.qualcomm.com ([10.47.202.152]) by alexa-out.qualcomm.com with ESMTP; 02 Mar 2022 14:27:06 -0800 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg08-lv.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Mar 2022 14:27:06 -0800 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.15; Wed, 2 Mar 2022 14:26:46 -0800 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.15; Wed, 2 Mar 2022 14:26:46 -0800 From: Aloka Dixit To: , Subject: [PATCH 05/13] mbssid: add multiple BSSID elements Date: Wed, 2 Mar 2022 14:26:26 -0800 Message-ID: <20220302222634.22185-6-quic_alokad@quicinc.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220302222634.22185-1-quic_alokad@quicinc.com> References: <20220302222634.22185-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-20220302_142711_470068_99CC9F06 X-CRM114-Status: GOOD ( 24.62 ) 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 9.4.2.45 Multiple BSSID element. Include this element in beacons and probe response frames when mbssid is enabled. Split the BSSes into multiple elements if the da [...] 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 [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-Mailman-Approved-At: Wed, 02 Mar 2022 15:34:45 -0800 X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: John Crispin Add data as per IEEE Std 802.11-2020 9.4.2.45 Multiple BSSID element. Include this element in beacons and probe response frames when mbssid is enabled. Split the BSSes into multiple elements if the data does not fit in 255 bytes allowed for a single element. Add support for enhanced multiple BSSID advertisements (EMA) by sending offsets to the start of each MBSSID element to nl80211. Mac80211 generates different EMA beacons by including only one multiple BSSID element in each beacon frame. Signed-off-by: John Crispin Co-developed-by: Aloka Dixit Signed-off-by: Aloka Dixit --- src/ap/beacon.c | 66 ++++++++++- src/ap/ieee802_11.c | 212 +++++++++++++++++++++++++++++++++++ src/ap/ieee802_11.h | 5 +- src/common/ieee802_11_defs.h | 2 + src/drivers/driver.h | 27 +++++ 5 files changed, 309 insertions(+), 3 deletions(-) diff --git a/src/ap/beacon.c b/src/ap/beacon.c index 1d70cb2ead2c..3d45f4a69f2c 100644 --- a/src/ap/beacon.c +++ b/src/ap/beacon.c @@ -432,6 +432,9 @@ static void hostapd_set_mbssid_beacon(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 num_mbssid = 0, *end; if (!iface->conf->mbssid || iface->num_bss == 1) return; @@ -447,9 +450,54 @@ static void hostapd_set_mbssid_beacon(struct hostapd_data *hapd, return; } - params->mbssid_tx_iface = hostapd_mbssid_get_tx_bss(hapd)->conf->iface; + tx_bss = hostapd_mbssid_get_tx_bss(hapd); + params->mbssid_tx_iface = tx_bss->conf->iface; params->mbssid_index = hostapd_mbssid_get_bss_index(hapd); params->mbssid_count = iface->num_bss; + + len = hostapd_eid_mbssid_len(tx_bss, WLAN_FC_STYPE_BEACON, &num_mbssid); + if (hapd->iconf->ema) { + if (!iface->ema_max_periodicity) { + wpa_printf(MSG_DEBUG, + "MBSSID: Driver doesn't support enhanced multiple BSSID advertisements"); + return; + } + if (num_mbssid > iface->ema_max_periodicity) { + wpa_printf(MSG_DEBUG, + "MBSSID: Driver supports maximum %u EMA profile periodicity", + iface->ema_max_periodicity); + return; + } + params->ema = 1; + } + + if (hapd != tx_bss || !num_mbssid) + return; + + params->mbssid_elem_count = num_mbssid; + params->mbssid_elem = os_zalloc(len); + if (!params->mbssid_elem) { + wpa_printf(MSG_ERROR, + "Memory allocation failed for multiple BSSID elements"); + return; + } + + params->mbssid_elem_offset = os_zalloc(params->mbssid_elem_count * + sizeof(u8 *)); + if (!params->mbssid_elem_offset) { + wpa_printf(MSG_ERROR, + "MBSSID: Memory allocation failed for multiple BSSID element offsets"); + os_free(params->mbssid_elem); + params->mbssid_elem = NULL; + return; + } + + end = hostapd_eid_mbssid(tx_bss, params->mbssid_elem, + params->mbssid_elem + len, + WLAN_FC_STYPE_BEACON, + params->mbssid_elem_count, + params->mbssid_elem_offset); + params->mbssid_elem_len = end - params->mbssid_elem; return; } @@ -462,8 +510,11 @@ 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 if (hapd->wps_probe_resp_ie) buflen += wpabuf_len(hapd->wps_probe_resp_ie); @@ -495,6 +546,7 @@ static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd, } #endif /* CONFIG_IEEE80211AX */ + 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); @@ -563,6 +615,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); @@ -1100,6 +1154,9 @@ void handle_probe_req(struct hostapd_data *hapd, } #endif /* CONFIG_TESTING_OPTIONS */ + 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); @@ -1126,7 +1183,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); @@ -1794,6 +1852,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/ieee802_11.c b/src/ap/ieee802_11.c index 6140a492c88b..7534fd027ec0 100644 --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c @@ -3956,6 +3956,23 @@ static void handle_auth(struct hostapd_data *hapd, } +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; @@ -7450,4 +7467,199 @@ 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) +{ + 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; + *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); + } + return eid; +} + #endif /* CONFIG_NATIVE_WINDOWS */ diff --git a/src/ap/ieee802_11.h b/src/ap/ieee802_11.h index c59ad5e38e92..37df3faa724c 100644 --- a/src/ap/ieee802_11.h +++ b/src/ap/ieee802_11.h @@ -119,8 +119,11 @@ u8 * hostapd_eid_time_zone(struct hostapd_data *hapd, u8 *eid); int hostapd_update_time_adv(struct hostapd_data *hapd); void hostapd_client_poll_ok(struct hostapd_data *hapd, const u8 *addr); u8 * hostapd_eid_bss_max_idle_period(struct hostapd_data *hapd, u8 *eid); - int auth_sae_init_committed(struct hostapd_data *hapd, struct sta_info *sta); +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); #ifdef CONFIG_SAE void sae_clear_retransmit_timer(struct hostapd_data *hapd, struct sta_info *sta); diff --git a/src/common/ieee802_11_defs.h b/src/common/ieee802_11_defs.h index 928b53500c5c..cd4d60a77d26 100644 --- a/src/common/ieee802_11_defs.h +++ b/src/common/ieee802_11_defs.h @@ -490,6 +490,8 @@ #define WLAN_EID_EXT_ANTI_CLOGGING_TOKEN 93 #define WLAN_EID_EXT_PASN_PARAMS 100 +#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 diff --git a/src/drivers/driver.h b/src/drivers/driver.h index 0527f120287b..a8f675633c0d 100644 --- a/src/drivers/driver.h +++ b/src/drivers/driver.h @@ -1597,6 +1597,33 @@ struct wpa_driver_ap_params { * mbssid_count - Total number of BSSs in the group */ unsigned int mbssid_count; + + /** + * mbssid_elem - Buffer containing all multiple BSSID elements + */ + u8 *mbssid_elem; + + /** + * mbssid_elem_len - Total length of all multiple BSSID elements + */ + size_t mbssid_elem_len; + + /** + * mbssid_elem_count - The number of multiple bssid 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 multi-bssid advertisements support. + */ + u8 ema; + }; struct wpa_driver_mesh_bss_params { From patchwork Wed Mar 2 22:26:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aloka Dixit X-Patchwork-Id: 1600121 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=Y5pmX03H; 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=BPKzQWuP; 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 (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4K89X66DKCz9s1l for ; Thu, 3 Mar 2022 10:37:42 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=m2KzoOCYEvJCk91YHntvlAZs5Adrjan6nb7M8WKZGc0=; b=Y5pmX03H8AyVZn XCFuChHPaNFUfZaHUTF6pcBvAFjEtZX3hIZ21xhXzClBhAVVx/eVWV5Xh5LA16kt97Fj5dZ8CVjiA ynRcRvJxDuTyw8RtiTdGkk+YNXpi3B1yranaZvDop3ShyQ15/9hcZt7NqQpw8LkJOoMgDUCX9nt3y F/Dc1YY8rQ65N614AhLiKij5T3q9dfvrheOHaShYp0dsVvCSrrjzM3EI+ImoCWVUceoxFapU98G09 6qC0W3jWCvs8ig9Ca/QnpcfW5jBipZHA8Jp3a5s396UDk1Kccuxe+tiw06qJao412dM6cJaWXtvgH ETJRnhDCDgWmE4ZnTzfA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nPYWK-004iZx-TD; Wed, 02 Mar 2022 23:36:36 +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 1nPXRB-004Yl7-N4 for hostap@lists.infradead.org; Wed, 02 Mar 2022 22:27:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1646260034; x=1677796034; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=OTpU8Sn2gMB1nbxtIW7TdKj9eDCVVxWflewxDlrmi7g=; b=BPKzQWuPxeytVeX91AoPBfohrxZ9SlVzVoumSCaVBwcc0KTDsl/MQwxI A5onj71qZpysOp2nmqdhLsMRPGr69wRAPO+Q1vUgTuR5vD+SOPZfNCriM i9c0ELpQVxrCW+QS736h6x4OdU9va88swwrBuMHuofG1CQ4LSXXWKQLcl A=; Received: from ironmsg08-lv.qualcomm.com ([10.47.202.152]) by alexa-out.qualcomm.com with ESMTP; 02 Mar 2022 14:27:06 -0800 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg08-lv.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Mar 2022 14:27:06 -0800 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.15; Wed, 2 Mar 2022 14:26:47 -0800 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.15; Wed, 2 Mar 2022 14:26:46 -0800 From: Aloka Dixit To: , Subject: [PATCH 06/13] mbssid: add MBSSID configuration element Date: Wed, 2 Mar 2022 14:26:27 -0800 Message-ID: <20220302222634.22185-7-quic_alokad@quicinc.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220302222634.22185-1-quic_alokad@quicinc.com> References: <20220302222634.22185-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-20220302_142713_829989_CFAE2F97 X-CRM114-Status: GOOD ( 14.54 ) 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 data as per IEEE Std 802.11ax-2021 9.4.2.260 Multiple BSSID Configuration element when enhanced multiple BSSID advertisements (EMA) are enabled. This element informs the clients about the EMA prof [...] 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 [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-Mailman-Approved-At: Wed, 02 Mar 2022 15:34:45 -0800 X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Add data as per IEEE Std 802.11ax-2021 9.4.2.260 Multiple BSSID Configuration element when enhanced multiple BSSID advertisements (EMA) are enabled. This element informs the clients about the EMA profile periodicity of the multiple BSSID set. Co-developed-by: John Crispin Signed-off-by: John Crispin Signed-off-by: Aloka Dixit --- src/ap/beacon.c | 35 +++++++++++++++++++++++------------ src/common/ieee802_11_defs.h | 1 + 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/src/ap/beacon.c b/src/ap/beacon.c index 3d45f4a69f2c..b2b2bfa8babe 100644 --- a/src/ap/beacon.c +++ b/src/ap/beacon.c @@ -428,8 +428,9 @@ static u8 * hostapd_eid_supported_op_classes(struct hostapd_data *hapd, u8 *eid) } -static void hostapd_set_mbssid_beacon(struct hostapd_data *hapd, - struct wpa_driver_ap_params *params) +static u8 * hostapd_set_mbssid_beacon(struct hostapd_data *hapd, + struct wpa_driver_ap_params *params, + u8 *eid) { struct hostapd_iface *iface = hapd->iface; struct hostapd_data *tx_bss; @@ -437,17 +438,17 @@ static void hostapd_set_mbssid_beacon(struct hostapd_data *hapd, u8 num_mbssid = 0, *end; if (!iface->conf->mbssid || iface->num_bss == 1) - return; + return eid; if (!iface->mbssid_max_interfaces) { wpa_printf(MSG_DEBUG, "MBSSID: Driver doesn't support multi-BSSID advertisements"); - return; + return eid; } else if (iface->num_bss > iface->mbssid_max_interfaces) { wpa_printf(MSG_DEBUG, "MBSSID: Driver supports maximum %u interfaces for multi-BSSID advertisements", iface->mbssid_max_interfaces); - return; + return eid; } tx_bss = hostapd_mbssid_get_tx_bss(hapd); @@ -460,26 +461,26 @@ static void hostapd_set_mbssid_beacon(struct hostapd_data *hapd, if (!iface->ema_max_periodicity) { wpa_printf(MSG_DEBUG, "MBSSID: Driver doesn't support enhanced multiple BSSID advertisements"); - return; + return eid; } if (num_mbssid > iface->ema_max_periodicity) { wpa_printf(MSG_DEBUG, "MBSSID: Driver supports maximum %u EMA profile periodicity", iface->ema_max_periodicity); - return; + return eid; } params->ema = 1; } if (hapd != tx_bss || !num_mbssid) - return; + return eid; params->mbssid_elem_count = num_mbssid; params->mbssid_elem = os_zalloc(len); if (!params->mbssid_elem) { wpa_printf(MSG_ERROR, "Memory allocation failed for multiple BSSID elements"); - return; + return eid; } params->mbssid_elem_offset = os_zalloc(params->mbssid_elem_count * @@ -489,7 +490,7 @@ static void hostapd_set_mbssid_beacon(struct hostapd_data *hapd, "MBSSID: Memory allocation failed for multiple BSSID element offsets"); os_free(params->mbssid_elem); params->mbssid_elem = NULL; - return; + return eid; } end = hostapd_eid_mbssid(tx_bss, params->mbssid_elem, @@ -498,7 +499,15 @@ static void hostapd_set_mbssid_beacon(struct hostapd_data *hapd, params->mbssid_elem_count, params->mbssid_elem_offset); params->mbssid_elem_len = end - params->mbssid_elem; - return; + + if (hapd->iconf->ema) { + *eid++ = WLAN_EID_EXTENSION; + *eid++ = 3; + *eid++ = WLAN_EID_EXT_MULTIPLE_BSSID_CONFIGURATION; + *eid++ = iface->num_bss; + *eid++ = params->mbssid_elem_count; + } + return eid; } @@ -1558,6 +1567,8 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd, } #endif /* CONFIG_IEEE80211AX */ + if (hapd->iconf->ema) + 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); @@ -1643,7 +1654,7 @@ 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); - hostapd_set_mbssid_beacon(hapd, params); + tailpos = hostapd_set_mbssid_beacon(hapd, params, tailpos); tailpos = hostapd_eid_ext_capab(hapd, tailpos); diff --git a/src/common/ieee802_11_defs.h b/src/common/ieee802_11_defs.h index cd4d60a77d26..f0003655a002 100644 --- a/src/common/ieee802_11_defs.h +++ b/src/common/ieee802_11_defs.h @@ -480,6 +480,7 @@ #define WLAN_EID_EXT_HE_MU_EDCA_PARAMS 38 #define WLAN_EID_EXT_SPATIAL_REUSE 39 #define WLAN_EID_EXT_OCV_OCI 54 +#define WLAN_EID_EXT_MULTIPLE_BSSID_CONFIGURATION 55 #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 Mar 2 22:26: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: 1600115 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=R8XVa0JM; 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=aoElpJO8; 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 (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4K89VQ26MZz9s1l for ; Thu, 3 Mar 2022 10:36:14 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=e6KobeeVCPYnhE2MprU2BNNQBqMM4/MXSLfRjaiQMvQ=; b=R8XVa0JM24eWLf IfL/bcXzZtLztBQN+BvSlADBVdjBpW4AX4Xx4Eh+8QmbqtL6KnFZCYw3ZvdTvaWWKy+t1dDucGbyB BvhhOsaUyyDo6AFyoLcFZXypco2PExsqQolazQj2j3irNeGJDazn7af1v6TC+sBttQ4EzAi1n9PvK 4ulOGVpvO5NwcdVOvZdasq8+6GrkTKCRMbJhn1dcDJmlmBNffpU5kHZzHpBrZ4EBbIhrOqVE4QLOp CzjJEmEZuvJowfbmliV4X5TC9S2z4vlXTFdcSqySLrwgOwyIfaR6X2kmgloBIe0gqmnur833J6us8 1ljP8tK6GU9Mz6E493LA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nPYV8-004iAN-Hn; Wed, 02 Mar 2022 23:35: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 1nPXR7-004YkZ-LW for hostap@lists.infradead.org; Wed, 02 Mar 2022 22:27:11 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1646260030; x=1677796030; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=R0Qh454W2PzY76sf/bDOI049iLml+VWbK053qqo/QOo=; b=aoElpJO8MGHUGCpeIW3TcYqpGAs8YtQn0iwXe1vw3Nt6H/ojGypnztwP lV/3OxJtOKFpJVuncY3JIXachHcoDARLj6/8ZNN6AUtrKTZWZEMs3Ihoi YKEf/QCJBC5sOATR5sJx6MHNxIiIRpXVWrXQPV7gzqzG3ZffIPaQNlq+q w=; Received: from ironmsg08-lv.qualcomm.com ([10.47.202.152]) by alexa-out.qualcomm.com with ESMTP; 02 Mar 2022 14:27:06 -0800 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg08-lv.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Mar 2022 14:27:06 -0800 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.15; Wed, 2 Mar 2022 14:26:47 -0800 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.15; Wed, 2 Mar 2022 14:26:47 -0800 From: Aloka Dixit To: , Subject: [PATCH 07/13] mbssid: add non-inheritance element Date: Wed, 2 Mar 2022 14:26:28 -0800 Message-ID: <20220302222634.22185-8-quic_alokad@quicinc.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220302222634.22185-1-quic_alokad@quicinc.com> References: <20220302222634.22185-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-20220302_142709_770403_08C070D9 X-CRM114-Status: GOOD ( 13.16 ) 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 9.4.2.240 Non-Inheritance element if the transmitted profile is secured but non-transmitted profiles use open security. Signed-off-by: John Crispin Co-developed-by: Sowmiya Sree Elavalagan Signed-off-by: Sowmiya Sree Elavalagan Co-developed-by: [...] 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 [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-Mailman-Approved-At: Wed, 02 Mar 2022 15:34:45 -0800 X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: John Crispin Add data as per IEEE Std 802.11-2020 9.4.2.240 Non-Inheritance element if the transmitted profile is secured but non-transmitted profiles use open security. 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 --- src/ap/ieee802_11.c | 30 ++++++++++++++++++++++++++++-- src/common/ieee802_11_defs.h | 1 + 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c index 7534fd027ec0..4daf442bb242 100644 --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c @@ -7471,12 +7471,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; @@ -7504,6 +7506,12 @@ 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 (ie_count) + nontx_profile_len += (4 + ie_count); if ((len + nontx_profile_len) > 255) goto mbssid_too_big; @@ -7551,6 +7559,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) { + struct hostapd_data *tx_bss = hostapd_mbssid_get_tx_bss(hapd); size_t i; u8 *eid_len_offset, *max_bssid_indicator_offset; @@ -7562,7 +7571,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[2]; size_t auth_len = 0; u16 capab_info; @@ -7609,6 +7619,22 @@ 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 (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 f0003655a002..4747714e3219 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_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 #define WLAN_EID_EXT_EDMG_CAPABILITIES 61 From patchwork Wed Mar 2 22:26:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aloka Dixit X-Patchwork-Id: 1600119 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=wwfjYgvf; 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=kB2DjnxL; 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 (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4K89WP5ZfWz9s1l for ; Thu, 3 Mar 2022 10:37:05 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=wRMO5df6n527xKXVqkzW6gmREItZ1NZLvOytVh9JTVU=; b=wwfjYgvf8rpvjn 6YQSetrKgzB//MqRKWBtjnA/kbZziwd7T6y+Fjs6v8GGSBJGBs58qUZ6tvla9MuAWQKkoaokG96BT IBi2gzRsr6gk5uRwzj7cbBw0LeU6cIBjL302CvGuxzAoj865Ld+0DzgcfPyWsixVHboSVgJDV0kIt UhKqSuH+/nrFCeSyzHvvWdrNTcmq/CnRkB9wFV8SVnXHoe/oikfXDWeG4xCV7iagmM9/6+EoNNKG4 Q8RInfuM+sVBjw4GglD1hlD+yyMdLjI3GOZfZ25s/by9/RjDT7D/8y9dN8HhTNjiISRvI2yFOMefB 5DAy5gMHYGcalwjfV1jw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nPYVm-004iN5-Ax; Wed, 02 Mar 2022 23:36:02 +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 1nPXRB-004YkZ-1q for hostap@lists.infradead.org; Wed, 02 Mar 2022 22:27:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1646260033; x=1677796033; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=S1hBcqnSSedpfIs9tVTaFoY63YDyAXNKORwpb4OQFIk=; b=kB2DjnxLOPp36/Doe9yXzOT3shelPWp1r39N52ulD8MciwE+IXT71lgx PmcTj99F0NEbrUSaM8Cu/HpGs2jua/z7OuawQGHAot4ylz7KWZDzr0eAD IzFDdeaNshiCf9lNtALv3SeBSuwhbF0WM5t8QeNS5tdAJTJDa1KV2GR3m 0=; Received: from ironmsg08-lv.qualcomm.com ([10.47.202.152]) by alexa-out.qualcomm.com with ESMTP; 02 Mar 2022 14:27:06 -0800 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg08-lv.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Mar 2022 14:27:06 -0800 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.15; Wed, 2 Mar 2022 14:26:47 -0800 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.15; Wed, 2 Mar 2022 14:26:47 -0800 From: Aloka Dixit To: , Subject: [PATCH 08/13] mbssid: make the AID space shared Date: Wed, 2 Mar 2022 14:26:29 -0800 Message-ID: <20220302222634.22185-9-quic_alokad@quicinc.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220302222634.22185-1-quic_alokad@quicinc.com> References: <20220302222634.22185-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-20220302_142713_160460_0679867A X-CRM114-Status: GOOD ( 10.70 ) 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 [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-Mailman-Approved-At: Wed, 02 Mar 2022 15:34:45 -0800 X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org 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 4daf442bb242..33db7b411a8a 100644 --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c @@ -3998,7 +3998,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 Mar 2 22:26: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: 1600116 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=MtiCB6yu; 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=tGkL6tG4; 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 (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4K89VR36S7z9s1l for ; Thu, 3 Mar 2022 10:36:15 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=3HxDp5YJ0t37sk4zSkZd5gpKawb3ckqF/tpIrBVbBHg=; b=MtiCB6yu4dDVIk eEWp82ZXJW3yZOpuBe0dvl6Ly1WiX1omqscelztAuTiFFOZRy8At4SafeoKegAiKcKnDrv5SJgydL fIBe62daZHgG7F7asLHsSWtYBtg+XvCn2X9UY3XJ7sgm3xHir52XquoAIvDTrQjLoiwjZGEEbrmXp sRymoVDXzpWAvPayMRcxY+1UjGWKHxkoVHIpDe/gXuol/zxY4IRISqN6suSJtiQgvZpxZB1vdv2Ko NmV9ICCO/Tcam1uqBp+os1Wd91ScuUnpa03ZGgsFfgUzEjaoWBJfS8wsBQuz8l9JH1+quDQk2wR7I QxBOY6M9abu4+5eC/G+g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nPYUz-004i9c-WF; Wed, 02 Mar 2022 23:35:14 +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 1nPXR7-004Yl7-R5 for hostap@lists.infradead.org; Wed, 02 Mar 2022 22:27:11 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1646260030; x=1677796030; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=mewq03tEgAdgmttVGM2yNyUlIwShOFBe9mkaUG2u6Tg=; b=tGkL6tG4G0A0xEvk41cpC9RoHpIPAgl61U9NhqcP5Nxakvz3u+LL4vUs uJwVEGeXho+BxFhhWR7V4SioJcJq/K1kVRwh6Q3QVetmQc9IuuFkwglqV kbAgQ6QYz70wPTrQuFVHFYNynqiWNR+5K0xT4SviWHl0KE9JfYgi30Sx/ c=; Received: from ironmsg08-lv.qualcomm.com ([10.47.202.152]) by alexa-out.qualcomm.com with ESMTP; 02 Mar 2022 14:27:06 -0800 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg08-lv.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Mar 2022 14:27:06 -0800 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.15; Wed, 2 Mar 2022 14:26:48 -0800 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.15; Wed, 2 Mar 2022 14:26:47 -0800 From: Aloka Dixit To: , Subject: [PATCH 09/13] mbssid: set extended capabilities Date: Wed, 2 Mar 2022 14:26:30 -0800 Message-ID: <20220302222634.22185-10-quic_alokad@quicinc.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220302222634.22185-1-quic_alokad@quicinc.com> References: <20220302222634.22185-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-20220302_142709_945123_38A7163B X-CRM114-Status: GOOD ( 12.20 ) 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: Set extended capabilities as described in IEEE Std 802.11-2020 section 9.4.2.26 Extended Capabilities element. Co-developed-by: John Crispin Signed-off-by: John Crispin Signed-off-by: Aloka Dixit --- src/ap/beacon.c | 38 ++++++++++++++++++++++++++ [...] 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 [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-Mailman-Approved-At: Wed, 02 Mar 2022 15:34:45 -0800 X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Set extended capabilities as described in IEEE Std 802.11-2020 section 9.4.2.26 Extended Capabilities element. Co-developed-by: John Crispin Signed-off-by: John Crispin Signed-off-by: Aloka Dixit --- src/ap/beacon.c | 38 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/src/ap/beacon.c b/src/ap/beacon.c index b2b2bfa8babe..be0f0658155a 100644 --- a/src/ap/beacon.c +++ b/src/ap/beacon.c @@ -511,12 +511,41 @@ static u8 * hostapd_set_mbssid_beacon(struct hostapd_data *hapd, } +static u8 * hostapd_ext_capab_mbssid(struct hostapd_data *hapd, u8 *eid, + u8 *eid_ext_cap, u8 ema_periodicity) +{ + size_t len; + + if (eid == eid_ext_cap) + return eid; + + len = eid_ext_cap[1]; + eid_ext_cap += 2; + + if (!hapd->iconf->mbssid && len >= 3) + eid_ext_cap[2] &= ~0x40; + + if (!hapd->iconf->ema && len >= 11) + eid_ext_cap[10] &= ~0x08; + + if (hapd->iconf->mbssid && ema_periodicity <= 1) { + while (len < 11) { + *eid++ = 0x00; + len++; + } + eid_ext_cap[10] |= 0x01; + } + + return eid; +} + + static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd, const struct ieee80211_mgmt *req, int is_p2p, size_t *resp_len) { struct ieee80211_mgmt *resp; - u8 *pos, *epos, *csa_pos; + u8 *pos, *epos, *csa_pos, *ext_cap_pos; size_t buflen; hapd = hostapd_mbssid_get_tx_bss(hapd); @@ -627,7 +656,9 @@ static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd, pos = hostapd_eid_mbssid(hapd, pos, epos, WLAN_FC_STYPE_PROBE_RESP, 0, NULL); + ext_cap_pos = pos; pos = hostapd_eid_ext_capab(hapd, pos); + pos = hostapd_ext_capab_mbssid(hapd, pos, ext_cap_pos, 1); pos = hostapd_eid_time_adv(hapd, pos); pos = hostapd_eid_time_zone(hapd, pos); @@ -1523,7 +1554,7 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd, size_t resp_len = 0; #ifdef NEED_AP_MLME u16 capab_info; - u8 *pos, *tailpos, *tailend, *csa_pos; + u8 *pos, *tailpos, *tailend, *csa_pos, *ext_cap_pos; #endif /* NEED_AP_MLME */ os_memset(params, 0, sizeof(*params)); @@ -1656,7 +1687,10 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd, tailpos = hostapd_eid_ht_operation(hapd, tailpos); tailpos = hostapd_set_mbssid_beacon(hapd, params, tailpos); + ext_cap_pos = tailpos; tailpos = hostapd_eid_ext_capab(hapd, tailpos); + tailpos = hostapd_ext_capab_mbssid(hapd, tailpos, ext_cap_pos, + params->mbssid_elem_count); /* * TODO: Time Advertisement element should only be included in some From patchwork Wed Mar 2 22:26: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: 1600122 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=fRm9Z5Y8; 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=CpRlj4ny; 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 (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4K89XP4tRsz9s1l for ; Thu, 3 Mar 2022 10:37:57 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=DDH/eJvM7jIQiq65qNOaGvfBXd6/IS/9mWNsCDY7ATk=; b=fRm9Z5Y8/9Zeds mK9FKe7Q6gLlSbKnp0Rghmtld+KcfBy/xmsMBMvtacfU/n8J4GeYYrpefZcGug/qLrSrd+Q/Cv/fr UU8GDPzewLBctnGqwtR6AuVPFVnHXSXXDeLz0K4qxuchrBZqshzvXO7HRGRXblEcEasXRqq0NT5I3 q71hJ7hSC5qlfavbhjabXqLDV5+0V57WgkBqFIRLvpwGmqJDUfLFVbhfOFS6FkRzK/VKKha+4k9rN BuJa4vkDuv2zNjohQ+kM+n+py14y9lwOHvAxgaBxqbhbPBZ9r0uZIJZcfNu3SFqi1Vp2P7h/i30ue Ng07DyFeWiLfCP9tVjcA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nPYWf-004igo-2w; Wed, 02 Mar 2022 23:36:57 +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 1nPXRC-004YkZ-Hy for hostap@lists.infradead.org; Wed, 02 Mar 2022 22:27:16 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1646260035; x=1677796035; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=EnDO48unpvM8W3t4AyPH4bmvJ+m8IlGlB5wco7VdsaE=; b=CpRlj4nyAqQRVrxFcai6XjKLlIPvPL7LM6wp/0WB5Snlf6o2Fty8gQEP dWkw1DfEyPIsVOHzqXudh4rdiqNsY/x3AsEOrFLYrveoUdQ5Z21zSiJAv TLFzj/q+1PRcsI/OmbP7MOjqhwcMx7Rl28vNDvS10jAHUHr5oA7jdjwcd U=; Received: from ironmsg08-lv.qualcomm.com ([10.47.202.152]) by alexa-out.qualcomm.com with ESMTP; 02 Mar 2022 14:27:06 -0800 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg08-lv.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Mar 2022 14:27:06 -0800 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.15; Wed, 2 Mar 2022 14:26:48 -0800 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.15; Wed, 2 Mar 2022 14:26:48 -0800 From: Aloka Dixit To: , Subject: [PATCH 10/13] mbssid: DTIM period configuration for EMA AP Date: Wed, 2 Mar 2022 14:26:31 -0800 Message-ID: <20220302222634.22185-11-quic_alokad@quicinc.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220302222634.22185-1-quic_alokad@quicinc.com> References: <20220302222634.22185-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-20220302_142714_670082_A79F8395 X-CRM114-Status: GOOD ( 10.75 ) 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: 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 BS [...] 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 [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-Mailman-Approved-At: Wed, 02 Mar 2022 15:34:45 -0800 X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org 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: Aloka Dixit --- src/ap/ieee802_11.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c index 33db7b411a8a..3365b48fa639 100644 --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c @@ -7560,7 +7560,7 @@ size_t hostapd_eid_mbssid_len(struct hostapd_data *hapd, u32 frame_type, 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) + size_t *bss_index, u8 elem_count) { struct hostapd_data *tx_bss = hostapd_mbssid_get_tx_bss(hapd); size_t i; @@ -7601,6 +7601,9 @@ static u8 * hostapd_eid_mbssid_elem(struct hostapd_data *hapd, u8 *eid, u8 *end, if (frame_type == WLAN_FC_STYPE_BEACON) { *eid++ = 3; *eid++ = i; + if (hapd->iconf->ema && + (conf->dtim_period % elem_count)) + conf->dtim_period = elem_count; *eid++ = conf->dtim_period; *eid++ = 0xFF; } else { @@ -7686,7 +7689,7 @@ u8 * hostapd_eid_mbssid(struct hostapd_data *hapd, u8 *eid, u8 *end, } eid = hostapd_eid_mbssid_elem(hapd, eid, end, frame_type, hostapd_max_bssid_indicator(hapd), - &bss_index); + &bss_index, elem_count); } return eid; } From patchwork Wed Mar 2 22:26:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aloka Dixit X-Patchwork-Id: 1600123 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=Y9FnFRqE; 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=GG5Hp0+f; 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 (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4K89Y15TDlz9s1l for ; Thu, 3 Mar 2022 10:38:29 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=7jceaEtK/I0ZL8F4TI4+8EgHcRTAKZXsgFwZ6ZSzzvc=; b=Y9FnFRqEszSmeq 5giGcr1JUOrAzKd1sQlwjta1Nf+8NYhNkAV1fkoie0Uy10OOVE24hvJkh4EhVlyadZpMfyYhMifl7 kl0r1uC+C1DE3/Ndd67HG5JgkA9Xy7IKkTY05HuSYpNChrjATrYKZK+Xuy0WWb93K4gGBXo5j9lwU 5Qc/mEryvahcmU9bzwQUouYYVlBUwrBtGEzwHb4JueJ/1ENS/lVB3SO6WNT7dtXIxFypyhb4v8vTD 3doNaoEN9Y23/1Go4AV0OK3hghp9sZnYZUWMr1l9Wv40LzRS+vUVDxk/G1bysoxv8BBwgIbBcbLnR Bm8rWyys+wn1iGIwuf4Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nPYX6-004ipA-Qf; Wed, 02 Mar 2022 23:37:25 +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 1nPXRC-004Ylt-R4 for hostap@lists.infradead.org; Wed, 02 Mar 2022 22:27:16 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1646260035; x=1677796035; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=AlEbFAvI0fgritSAznCMNG9nbpvdPs1SQCUB543lO/s=; b=GG5Hp0+frtqjDV5Cz5VCyELi+y/pNYjrEmo70apHoDcHLiGOdWKFEGDB vJGi0XjlT1aB81Y9BQn5E+PbLq2zs7ZSd/oqowpO6dzE1nt2z8xcENvSr A838uHCoCbYVr8VtLyidBbDSY7vfGwoDqUZ8OCwd0x41RTkTPz6dt4sL7 c=; Received: from ironmsg08-lv.qualcomm.com ([10.47.202.152]) by alexa-out.qualcomm.com with ESMTP; 02 Mar 2022 14:27:06 -0800 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg08-lv.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Mar 2022 14:27:06 -0800 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.15; Wed, 2 Mar 2022 14:26:48 -0800 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.15; Wed, 2 Mar 2022 14:26:48 -0800 From: Aloka Dixit To: , Subject: [PATCH 11/13] mbssid: hidden SSID support Date: Wed, 2 Mar 2022 14:26:32 -0800 Message-ID: <20220302222634.22185-12-quic_alokad@quicinc.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220302222634.22185-1-quic_alokad@quicinc.com> References: <20220302222634.22185-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-20220302_142715_006382_2E529766 X-CRM114-Status: GOOD ( 16.14 ) 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: Hidden nontransmitted BSSID profiles will be included in the beacons and probe responses but SSID value will be removed or set to all zeros depending on the configured value of 'ignore_broadcast_ssid' [...] 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 [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-Mailman-Approved-At: Wed, 02 Mar 2022 15:34:45 -0800 X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Hidden nontransmitted BSSID profiles will be included in the beacons and probe responses but SSID value will be removed or set to all zeros depending on the configured value of 'ignore_broadcast_ssid'. If complete profiles are omitted, clients cannot stay connected to the AP. For unicast probe requests with SSID set to a hidden nontransmitted BSS, complete SSID should be included in the response. Co-developed-by: Sowmiya Sree Elavalagan Signed-off-by: Sowmiya Sree Elavalagan Signed-off-by: Aloka Dixit --- src/ap/beacon.c | 25 +++++++++++++++++++------ src/ap/ieee802_11.c | 24 +++++++++++++++++++----- 2 files changed, 38 insertions(+), 11 deletions(-) diff --git a/src/ap/beacon.c b/src/ap/beacon.c index be0f0658155a..5f22dfc8cde2 100644 --- a/src/ap/beacon.c +++ b/src/ap/beacon.c @@ -547,6 +547,7 @@ static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd, struct ieee80211_mgmt *resp; u8 *pos, *epos, *csa_pos, *ext_cap_pos; size_t buflen; + struct hostapd_data *hapd_probed = hapd; hapd = hostapd_mbssid_get_tx_bss(hapd); @@ -584,7 +585,8 @@ static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd, } #endif /* CONFIG_IEEE80211AX */ - buflen += hostapd_eid_mbssid_len(hapd, WLAN_FC_STYPE_PROBE_RESP, NULL); + buflen += hostapd_eid_mbssid_len(hapd_probed, 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); @@ -612,9 +614,20 @@ static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd, pos = resp->u.probe_resp.variable; *pos++ = WLAN_EID_SSID; - *pos++ = hapd->conf->ssid.ssid_len; - os_memcpy(pos, hapd->conf->ssid.ssid, hapd->conf->ssid.ssid_len); - pos += hapd->conf->ssid.ssid_len; + if (hapd->conf->ignore_broadcast_ssid && hapd != hapd_probed) { + if (hapd->conf->ignore_broadcast_ssid == 2) { + *pos++ = hapd->conf->ssid.ssid_len; + os_memset(pos, 0, hapd->conf->ssid.ssid_len); + pos += hapd->conf->ssid.ssid_len; + } else { + *pos++ = 0; /* empty SSID */ + } + } else { + *pos++ = hapd->conf->ssid.ssid_len; + os_memcpy(pos, hapd->conf->ssid.ssid, + hapd->conf->ssid.ssid_len); + pos += hapd->conf->ssid.ssid_len; + } /* Supported rates */ pos = hostapd_eid_supp_rates(hapd, pos); @@ -653,8 +666,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_mbssid(hapd_probed, pos, epos, + WLAN_FC_STYPE_PROBE_RESP, 0, NULL); ext_cap_pos = pos; pos = hostapd_eid_ext_capab(hapd, pos); diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c index 3365b48fa639..36d6831b2376 100644 --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c @@ -7490,11 +7490,16 @@ static size_t hostapd_eid_mbssid_elem_len(struct hostapd_data *hapd, * Sublement ID: 1 byte * Length: 1 byte * Nontransmitted capabilities: 4 bytes - * SSID element: 2 + variable + * SSID element: 2 + variable (except for hidden BSS) * 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; + nontx_profile_len = 11; + + if (!bss->conf->ignore_broadcast_ssid || + bss->conf->ignore_broadcast_ssid == 2 || + (frame_type == WLAN_FC_STYPE_PROBE_RESP && bss == hapd)) + nontx_profile_len += bss->conf->ssid.ssid_len; if (frame_type == WLAN_FC_STYPE_BEACON) nontx_profile_len += 2; @@ -7593,9 +7598,18 @@ static u8 * hostapd_eid_mbssid_elem(struct hostapd_data *hapd, u8 *eid, u8 *end, 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; + if (!conf->ignore_broadcast_ssid || + (frame_type == WLAN_FC_STYPE_PROBE_RESP && bss == hapd)) { + *eid++ = conf->ssid.ssid_len; + os_memcpy(eid, conf->ssid.ssid, conf->ssid.ssid_len); + eid += conf->ssid.ssid_len; + } else if (conf->ignore_broadcast_ssid == 2) { + *eid++ = conf->ssid.ssid_len; + os_memset(eid, 0, conf->ssid.ssid_len); + eid += conf->ssid.ssid_len; + } else { + *eid++ = 0; + } *eid++ = WLAN_EID_MULTIPLE_BSSID_INDEX; if (frame_type == WLAN_FC_STYPE_BEACON) { From patchwork Wed Mar 2 22:26:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aloka Dixit X-Patchwork-Id: 1600124 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=YsXOQs68; 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=SWLSG02H; 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 (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4K89Yx5j3kz9s1l for ; Thu, 3 Mar 2022 10:39:17 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=QjJAtyk+NDgWNCP04NBrW0P0rQdE/EXpNMsvXF52YHk=; b=YsXOQs68p+PCai EIppi8/isIsp/RrfRUesMp9ODxNhgxlostutczZ17h5NnywPVxVVTwKnAipGzJaqoWRXwcnDXbiE2 4G6z+Iv5uOp1+vYuUatJcNgjPgxiONemXaKxQFZTLpQfViRcVXAFM9O12tY3xd5IkbXyN01/uNiPZ metl5j7csxHnWclbLxmPhczLtqUvLWKdeckoj+Q0Dy2cTGiH29hEOdCs94azasrGmRwGwY1L6IpxP T57cL4IcfeKtmk5sDqzcCa6ZgTLRZbeJm7fwdmWkcFNqWbV7Vj0tqNkhpwUZWxF9v2OLPYjseK8qY 8Q5hoWEMLig61Qy2XNNQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nPYXy-004j9U-T3; Wed, 02 Mar 2022 23:38:19 +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 1nPXRD-004Yl7-Df for hostap@lists.infradead.org; Wed, 02 Mar 2022 22:27:17 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1646260035; x=1677796035; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=TXWk8eGUza/0Gp/lk4tiQNKPb2yBPVhTwBsJ8qAcCAU=; b=SWLSG02HgrG0QWysGR6JHg61pgZBR7a96/wNdfFleK+LP3yTbniR/rBR RaK4j7lNaDwlVRQTb4BYVZBxm2l4gN74WSwQnMsFqcTZutcSPr4SHM6jM HjDKNDM9IeFE86iEas+BOo912yX+IAGr2RW4/0fNSzCPdv65kvtFhi4/h 0=; Received: from ironmsg08-lv.qualcomm.com ([10.47.202.152]) by alexa-out.qualcomm.com with ESMTP; 02 Mar 2022 14:27:06 -0800 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg08-lv.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Mar 2022 14:27:06 -0800 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.15; Wed, 2 Mar 2022 14:26:49 -0800 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.15; Wed, 2 Mar 2022 14:26:48 -0800 From: Aloka Dixit To: , Subject: [PATCH 12/13] mbssid: process known BSSID element Date: Wed, 2 Mar 2022 14:26:33 -0800 Message-ID: <20220302222634.22185-13-quic_alokad@quicinc.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220302222634.22185-1-quic_alokad@quicinc.com> References: <20220302222634.22185-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-20220302_142715_581932_0AFBBB31 X-CRM114-Status: GOOD ( 15.78 ) 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: Process the known BSSID elements if included by non-AP stations. The format is described in IEEE Std 802.11ax-2021 9.4.2.261. Non-AP stations may include this element in directed probe requests to indicate which of the multiple BSSIDs they have already discovered. AP should exclude these profiles from the probe response. 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 [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-Mailman-Approved-At: Wed, 02 Mar 2022 15:34:45 -0800 X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Process the known BSSID elements if included by non-AP stations. The format is described in IEEE Std 802.11ax-2021 9.4.2.261. Non-AP stations may include this element in directed probe requests to indicate which of the multiple BSSIDs they have already discovered. AP should exclude these profiles from the probe response. Signed-off-by: Aloka Dixit --- src/ap/beacon.c | 21 +++++++++++++-------- src/ap/ieee802_11.c | 31 +++++++++++++++++++++++++------ src/ap/ieee802_11.h | 6 ++++-- src/common/ieee802_11_common.c | 4 ++++ src/common/ieee802_11_common.h | 2 ++ src/common/ieee802_11_defs.h | 1 + 6 files changed, 49 insertions(+), 16 deletions(-) diff --git a/src/ap/beacon.c b/src/ap/beacon.c index 5f22dfc8cde2..76b93f5ef6ce 100644 --- a/src/ap/beacon.c +++ b/src/ap/beacon.c @@ -456,7 +456,8 @@ static u8 * hostapd_set_mbssid_beacon(struct hostapd_data *hapd, params->mbssid_index = hostapd_mbssid_get_bss_index(hapd); params->mbssid_count = iface->num_bss; - len = hostapd_eid_mbssid_len(tx_bss, WLAN_FC_STYPE_BEACON, &num_mbssid); + len = hostapd_eid_mbssid_len(tx_bss, WLAN_FC_STYPE_BEACON, &num_mbssid, + NULL, 0); if (hapd->iconf->ema) { if (!iface->ema_max_periodicity) { wpa_printf(MSG_DEBUG, @@ -497,7 +498,7 @@ static u8 * hostapd_set_mbssid_beacon(struct hostapd_data *hapd, params->mbssid_elem + len, WLAN_FC_STYPE_BEACON, params->mbssid_elem_count, - params->mbssid_elem_offset); + params->mbssid_elem_offset, NULL, 0); params->mbssid_elem_len = end - params->mbssid_elem; if (hapd->iconf->ema) { @@ -542,7 +543,8 @@ static u8 * hostapd_ext_capab_mbssid(struct hostapd_data *hapd, u8 *eid, static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd, const struct ieee80211_mgmt *req, - int is_p2p, size_t *resp_len) + int is_p2p, size_t *resp_len, + const u8 *known_bss, u8 known_bss_len) { struct ieee80211_mgmt *resp; u8 *pos, *epos, *csa_pos, *ext_cap_pos; @@ -586,7 +588,7 @@ static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd, #endif /* CONFIG_IEEE80211AX */ buflen += hostapd_eid_mbssid_len(hapd_probed, WLAN_FC_STYPE_PROBE_RESP, - NULL); + NULL, known_bss, known_bss_len); buflen += hostapd_eid_rnr_len(hapd, WLAN_FC_STYPE_PROBE_RESP); buflen += hostapd_mbo_ie_len(hapd); buflen += hostapd_eid_owe_trans_len(hapd); @@ -667,7 +669,8 @@ static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd, pos = hostapd_eid_ht_capabilities(hapd, pos); pos = hostapd_eid_ht_operation(hapd, pos); pos = hostapd_eid_mbssid(hapd_probed, pos, epos, - WLAN_FC_STYPE_PROBE_RESP, 0, NULL); + WLAN_FC_STYPE_PROBE_RESP, 0, NULL, + known_bss, known_bss_len); ext_cap_pos = pos; pos = hostapd_eid_ext_capab(hapd, pos); @@ -1214,7 +1217,8 @@ void handle_probe_req(struct hostapd_data *hapd, " signal=%d", MAC2STR(mgmt->sa), ssi_signal); resp = hostapd_gen_probe_resp(hapd, mgmt, elems.p2p != NULL, - &resp_len); + &resp_len, elems.mbssid_known_bss, + elems.mbssid_known_bss_len); if (resp == NULL) return; @@ -1284,7 +1288,7 @@ static u8 * hostapd_probe_resp_offloads(struct hostapd_data *hapd, "this"); /* Generate a Probe Response template for the non-P2P case */ - return hostapd_gen_probe_resp(hapd, NULL, 0, resp_len); + return hostapd_gen_probe_resp(hapd, NULL, 0, resp_len, NULL, 0); } #endif /* NEED_AP_MLME */ @@ -1301,7 +1305,8 @@ static u8 * hostapd_unsol_bcast_probe_resp(struct hostapd_data *hapd, hapd->conf->unsol_bcast_probe_resp_interval; return hostapd_gen_probe_resp(hapd, NULL, 0, - ¶ms->unsol_bcast_probe_resp_tmpl_len); + ¶ms->unsol_bcast_probe_resp_tmpl_len, + NULL, 0); } #endif /* CONFIG_IEEE80211AX */ diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c index 36d6831b2376..9a189d733487 100644 --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c @@ -7472,7 +7472,9 @@ 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) + u32 frame_type, size_t *bss_index, + const u8 *known_bss, + size_t known_bss_len) { struct hostapd_data *tx_bss = hostapd_mbssid_get_tx_bss(hapd); size_t len = 3, i; @@ -7483,6 +7485,12 @@ static size_t hostapd_eid_mbssid_elem_len(struct hostapd_data *hapd, size_t nontx_profile_len, auth_len; u8 ie_count = 0; + if (known_bss && (known_bss_len > (i / 8))) { + known_bss = &known_bss[i / 8]; + if (*known_bss & (u8)(BIT(i % 8))) + continue; + } + if (!bss || !bss->conf || !bss->started) continue; @@ -7534,7 +7542,8 @@ mbssid_too_big: size_t hostapd_eid_mbssid_len(struct hostapd_data *hapd, u32 frame_type, - u8 *elem_count) + u8 *elem_count, const u8 *known_bss, + size_t known_bss_len) { size_t len = 0, bss_index = 1; @@ -7554,7 +7563,8 @@ size_t hostapd_eid_mbssid_len(struct hostapd_data *hapd, u32 frame_type, while (bss_index < hapd->iface->num_bss) { len += hostapd_eid_mbssid_elem_len(hapd, frame_type, - &bss_index); + &bss_index, known_bss, + known_bss_len); if (frame_type == WLAN_FC_STYPE_BEACON) *elem_count += 1; @@ -7565,7 +7575,8 @@ size_t hostapd_eid_mbssid_len(struct hostapd_data *hapd, u32 frame_type, 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 *bss_index, u8 elem_count, + const u8 *known_bss, size_t known_bss_len) { struct hostapd_data *tx_bss = hostapd_mbssid_get_tx_bss(hapd); size_t i; @@ -7584,6 +7595,12 @@ static u8 * hostapd_eid_mbssid_elem(struct hostapd_data *hapd, u8 *eid, u8 *end, size_t auth_len = 0; u16 capab_info; + if (known_bss && (known_bss_len > (i / 8))) { + known_bss = &known_bss[i / 8]; + if (*known_bss & (u8)(BIT(i % 8))) + continue; + } + if (!bss || !bss->conf || !bss->started) continue; conf = bss->conf; @@ -7675,7 +7692,8 @@ mbssid_too_big: u8 * hostapd_eid_mbssid(struct hostapd_data *hapd, u8 *eid, u8 *end, - u32 frame_type, u8 elem_count, u8 **elem_offset) + u32 frame_type, u8 elem_count, u8 **elem_offset, + const u8 *known_bss, size_t known_bss_len) { size_t bss_index = 1; u8 elem_index = 0; @@ -7703,7 +7721,8 @@ u8 * hostapd_eid_mbssid(struct hostapd_data *hapd, u8 *eid, u8 *end, } eid = hostapd_eid_mbssid_elem(hapd, eid, end, frame_type, hostapd_max_bssid_indicator(hapd), - &bss_index, elem_count); + &bss_index, elem_count, + known_bss, known_bss_len); } return eid; } diff --git a/src/ap/ieee802_11.h b/src/ap/ieee802_11.h index 37df3faa724c..e75ff4ee861f 100644 --- a/src/ap/ieee802_11.h +++ b/src/ap/ieee802_11.h @@ -121,9 +121,11 @@ void hostapd_client_poll_ok(struct hostapd_data *hapd, const u8 *addr); u8 * hostapd_eid_bss_max_idle_period(struct hostapd_data *hapd, u8 *eid); int auth_sae_init_committed(struct hostapd_data *hapd, struct sta_info *sta); size_t hostapd_eid_mbssid_len(struct hostapd_data *hapd, u32 frame_type, - u8 *elem_count); + u8 *elem_count, const u8 *known_bss, + size_t known_bss_len); u8 * hostapd_eid_mbssid(struct hostapd_data *hapd, u8 *eid, u8 *end, - u32 frame_type, u8 elem_count, u8 **elem_offset); + u32 frame_type, u8 elem_count, u8 **elem_offset, + const u8 *known_bss, size_t known_bss_len); #ifdef CONFIG_SAE void sae_clear_retransmit_timer(struct hostapd_data *hapd, struct sta_info *sta); diff --git a/src/common/ieee802_11_common.c b/src/common/ieee802_11_common.c index 5b74ddcdf62b..3ff111ce3fa7 100644 --- a/src/common/ieee802_11_common.c +++ b/src/common/ieee802_11_common.c @@ -307,6 +307,10 @@ static int ieee802_11_parse_extension(const u8 *pos, size_t elen, elems->pasn_params = pos; elems->pasn_params_len = elen; break; + case WLAN_EID_EXT_KNOWN_BSSID: + elems->mbssid_known_bss = pos; + elems->mbssid_known_bss_len = elen; + break; default: if (show_errors) { wpa_printf(MSG_MSGDUMP, diff --git a/src/common/ieee802_11_common.h b/src/common/ieee802_11_common.h index e4e4c613e9c6..a62ea5901f82 100644 --- a/src/common/ieee802_11_common.h +++ b/src/common/ieee802_11_common.h @@ -117,6 +117,7 @@ struct ieee802_11_elems { const u8 *sae_pk; const u8 *s1g_capab; const u8 *pasn_params; + const u8 *mbssid_known_bss; u8 ssid_len; u8 supp_rates_len; @@ -171,6 +172,7 @@ struct ieee802_11_elems { u8 short_ssid_list_len; u8 sae_pk_len; u8 pasn_params_len; + u8 mbssid_known_bss_len; struct mb_ies_info mb_ies; struct frag_ies_info frag_ies; diff --git a/src/common/ieee802_11_defs.h b/src/common/ieee802_11_defs.h index 4747714e3219..8657ce697d7c 100644 --- a/src/common/ieee802_11_defs.h +++ b/src/common/ieee802_11_defs.h @@ -482,6 +482,7 @@ #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_KNOWN_BSSID 57 #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 Mar 2 22:26:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aloka Dixit X-Patchwork-Id: 1600125 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=EYQPPabY; 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=fzJgu59n; 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 (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4K89bN1VyXz9s1l for ; Thu, 3 Mar 2022 10:40:32 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=d5tXfR2+9NpjcQl/KCYDCj7zoxUPJOVsLWaPcOXNS24=; b=EYQPPabY6lP4dh AMkQhe+XEn8VlH2zJlhASTfVJVRok7ocxowYRWrzdN3q4t86m+tmaGHSbJyOpyH1ddFIQ/LdTxa72 eHAGdeirZJyD600wm8Yak0vxR06zJKF9tNlxjopQFG5m7DZND3Ly7abDv13WkpzX/DIBm9cT/kO5g yITqJiA712aEl68f3iZeWIkGeZH9gMXMX5Ch6vBEX/yQHZXmVG2NqGuiPgOlMznzfk78P1/tmNIiB zN7RA9GSSkcB7Ri44iHO0T/KsbuQ3EdkhaoSjGzljjGI3CrGhRXnUtlpOpc02hJJtozi2KB4TNc/F 2PTpQ1XlyvfiLSFH+/TQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nPYZ1-004jYE-7U; Wed, 02 Mar 2022 23:39:24 +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 1nPXRE-004YkZ-Il for hostap@lists.infradead.org; Wed, 02 Mar 2022 22:27:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1646260037; x=1677796037; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=H6XIC7cIMRu2LBy7cMTypbW0RRPkdpJ0qYwfR8EuMTQ=; b=fzJgu59nZyRQopGsEemIJC3MYhRjOtECsIs3ustT+k/37xHpZNov3gNV Pc/HIbGPLWpW8zdg+O0oUgfI3J9CUFwud3zvngN0UHvUj/A/qifqTDDoB Xhlr2126fIx8frzU6GMlX78vGOqsRAvIPwYJmGTXf8072BEYmk3Urqh+u 8=; Received: from ironmsg08-lv.qualcomm.com ([10.47.202.152]) by alexa-out.qualcomm.com with ESMTP; 02 Mar 2022 14:27:06 -0800 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg08-lv.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Mar 2022 14:27:06 -0800 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.15; Wed, 2 Mar 2022 14:26:49 -0800 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.15; Wed, 2 Mar 2022 14:26:49 -0800 From: Aloka Dixit To: , Subject: [PATCH 13/13] mbssid: add nl80211 support Date: Wed, 2 Mar 2022 14:26:34 -0800 Message-ID: <20220302222634.22185-14-quic_alokad@quicinc.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220302222634.22185-1-quic_alokad@quicinc.com> References: <20220302222634.22185-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-20220302_142716_700461_547724E3 X-CRM114-Status: GOOD ( 14.71 ) 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 --- src/drivers/driver_nl80211.c | 53 +++++++ [...] 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 [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-Mailman-Approved-At: Wed, 02 Mar 2022 15:34:45 -0800 X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org 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 --- src/drivers/driver_nl80211.c | 53 ++++++++++++++++++++++++++++++- src/drivers/driver_nl80211_capa.c | 26 +++++++++++++++ 2 files changed, 78 insertions(+), 1 deletion(-) diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 0b3c79411099..8dfb3224e06e 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -4533,6 +4533,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; + + config = nla_nest_start(msg, NL80211_ATTR_MBSSID_CONFIG); + if (!config) + goto fail; + + 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) + goto fail; + 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) + goto fail; + + 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; + +fail: + return -1; +} + + static int wpa_driver_nl80211_set_ap(void *priv, struct wpa_driver_ap_params *params) { @@ -4841,6 +4890,9 @@ static int wpa_driver_nl80211_set_ap(void *priv, goto fail; #endif /* CONFIG_FILS */ + if (params->mbssid_count && nl80211_mbssid(msg, params) < 0) + goto fail; + ret = send_and_recv_msgs_connect_handle(drv, msg, bss, 1); if (ret) { wpa_printf(MSG_DEBUG, "nl80211: Beacon set failed: %d (%s)", @@ -5439,7 +5491,6 @@ const char * nl80211_iftype_str(enum nl80211_iftype mode) } } - static int nl80211_create_iface_once(struct wpa_driver_nl80211_data *drv, const char *ifname, enum nl80211_iftype iftype, diff --git a/src/drivers/driver_nl80211_capa.c b/src/drivers/driver_nl80211_capa.c index 200c545c2b70..5a0760a4a5ef 100644 --- a/src/drivers/driver_nl80211_capa.c +++ b/src/drivers/driver_nl80211_capa.c @@ -846,6 +846,29 @@ 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]; @@ -1077,6 +1100,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; }