From patchwork Tue Nov 28 10:14:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrei Otcheretianski X-Patchwork-Id: 1868868 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=LW7jGwDC; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=KDmhAH9L; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Sf9jg66q0z1yRy for ; Tue, 28 Nov 2023 03:17: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:Message-ID:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=1F4on79yTSRGSM4S+RDqrPwhrf4cyGekKk2EHhbFCRY=; b=LW7jGwDCkBxZXF FfD3PHwoi5CWFl+qx8gnr25CiR5rjbERE2PRcXYZ/Rp8UZANSkjvyWBNA+WlNN8oLQZnUtEKepMLH r8UUNGanVixIy7cSaEORVu+Yrt62QwIc6azJw2zqZFW7pMbqtbgMh1UTvqvchKYIzz9/JkpDePoK9 17cX/rIOuZZyyRQeb+n9cdPd/VN2gtp6xTuYVLBzKTJ++rEaVBgZQTceYtP3fH8fpL6BlAcHKLyO8 rUmNWcooXcCYB6WKxyaXiMvT4xz0cHSkx40bgM5uLEMAnP2SPkUVQfDCOjl4scr7zXWae5Oe5AYj2 FGyGLptSHQHXj03pOevw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r7eHu-002wWV-2S; Mon, 27 Nov 2023 16:16:46 +0000 Received: from mgamail.intel.com ([192.198.163.7]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r7eHo-002wTD-2h for hostap@lists.infradead.org; Mon, 27 Nov 2023 16:16:42 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1701101801; x=1732637801; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=LIvQk/cHtryeJujusriS5Ui4ED1cE52AHFbm+DACiTM=; b=KDmhAH9LHW4M3XFuVz+0r/67glkvxZ52BAleYVi/KC7lA2FTq1/+2DmW m5SgQa5eCCJoRJdT2gjAhQU9qsuagCop5ansb3wKjbP9IdKV4Abe09w/J l4uS9DZNkQ7s4x16zDOlVCbuvRFMJl2R205iNB7qFcqm8aX2MozG/hKM1 YRzUr2GzkAaWd5rezK+D9QAKuaR594E4rNuU9A9Ncfmk2Oe7wchAHkYYV vlRb+NIZe+dE8FyUn7nxadb4N0rq9Pyem1j17FLe9vV/vEm42rThnF2x6 NEzBcsQfzieoViBYzG+ECjQ4tHKdSvtUIMSXKBAxYt/lLpWQHHIvLc/Nh Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10907"; a="14292846" X-IronPort-AV: E=Sophos;i="6.04,231,1695711600"; d="scan'208";a="14292846" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Nov 2023 08:16:00 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10907"; a="1015614928" X-IronPort-AV: E=Sophos;i="6.04,231,1695711600"; d="scan'208";a="1015614928" Received: from unknown (HELO WEIS0042.iil.intel.com) ([10.12.217.211]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Nov 2023 08:15:58 -0800 From: Andrei Otcheretianski To: hostap@lists.infradead.org Cc: Ilan Peer Subject: [PATCH 1/2] AP: MLD: Do not modify flags for link stations Date: Tue, 28 Nov 2023 12:14:09 +0200 Message-ID: <20231128101410.1931280-1-andrei.otcheretianski@intel.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231127_081640_930277_C74CD3EB X-CRM114-Status: GOOD ( 15.92 ) X-Spam-Score: 2.1 (++) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Ilan Peer All the station flags other than WPA_STA_SHORT_PREAMBLE are relevant only for the MLD station and not to the link stations (as these flags are related to the MLD state and not the link state). Content analysis details: (2.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record 2.5 DATE_IN_FUTURE_12_24 Date: is 12 to 24 hours after Received: date -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 -0.2 DKIMWL_WL_HIGH DKIMwl.org - High trust sender X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Ilan Peer All the station flags other than WPA_STA_SHORT_PREAMBLE are relevant only for the MLD station and not to the link stations (as these flags are related to the MLD state and not the link state). As for the WPA_STA_SHORT_PREAMBLE, since the station is an EHT station, it must have short preamble. Thus, do not propagate the flags change for link stations to the driver. Signed-off-by: Ilan Peer --- src/ap/ap_drv_ops.c | 50 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c index 8f9cc5b360..d303f932f7 100644 --- a/src/ap/ap_drv_ops.c +++ b/src/ap/ap_drv_ops.c @@ -265,9 +265,41 @@ int hostapd_set_ap_wps_ie(struct hostapd_data *hapd) } +static bool hostapd_sta_is_link_sta(struct hostapd_data *hapd, + struct sta_info *sta) +{ + bool is_link_sta = false; + +#ifdef CONFIG_IEEE80211BE + if (hapd->conf->mld_ap && sta->mld_info.mld_sta && + sta->mld_assoc_link_id != hapd->mld_link_id) + is_link_sta = true; +#endif /* CONFIG_IEEE80211BE */ + + return is_link_sta; +} + + int hostapd_set_authorized(struct hostapd_data *hapd, struct sta_info *sta, int authorized) { + bool is_link_sta = hostapd_sta_is_link_sta(hapd, sta); + + wpa_printf(MSG_DEBUG, + "hostapd_set_authorized: authorized=%u", authorized); + + /* + * The WPA_STA_AUTHORIZED flag is relevant only for the MLD station and + * not to the link stations (as the authorization is done between the + * MLD peers). Thus, do not propagate the change to the driver for the + * link stations. + */ + if (is_link_sta) { + wpa_printf(MSG_DEBUG, + "hostapd_set_authorized: link station. No update"); + return 0; + } + if (authorized) { return hostapd_sta_set_flags(hapd, sta->addr, hostapd_sta_flags_to_drv( @@ -284,8 +316,26 @@ int hostapd_set_authorized(struct hostapd_data *hapd, int hostapd_set_sta_flags(struct hostapd_data *hapd, struct sta_info *sta) { int set_flags, total_flags, flags_and, flags_or; + bool is_link_sta = hostapd_sta_is_link_sta(hapd, sta); + total_flags = hostapd_sta_flags_to_drv(sta->flags); set_flags = WPA_STA_SHORT_PREAMBLE | WPA_STA_WMM | WPA_STA_MFP; + + /* + * All the station flags other than WPA_STA_SHORT_PREAMBLE are relevant + * only for the MLD station and not to the link stations (as these flags + * are related to the MLD state and not the link state). + * As for the WPA_STA_SHORT_PREAMBLE, since the station is an EHT + * station, it must have short preamble. + * Thus, do not propagate the change to the driver for the link + * stations. + */ + if (is_link_sta) { + wpa_printf(MSG_DEBUG, + "hostapd_set_sta_flags: link station. No update"); + return 0; + } + if (((!hapd->conf->ieee802_1x && !hapd->conf->wpa) || sta->auth_alg == WLAN_AUTH_FT) && sta->flags & WLAN_STA_AUTHORIZED) From patchwork Tue Nov 28 10:14:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrei Otcheretianski X-Patchwork-Id: 1868867 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=nHBhwzkW; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=LhRqZtBQ; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Sf9jh0qPsz23m6 for ; Tue, 28 Nov 2023 03:17: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:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=2JLhWRvRtTeu3Sk/9M+qobql4P646Zfyb2+VXp6HBsE=; b=nHBhwzkWAaxYcJ gLLkudjIqZOeW40K9bCQjWbGq+itps8D4saPkY5VZ3ha9f+be6a8ZHGEM+9PZKdvDhbzsuMSD/v1h KCsnibxmjMrFXlZP6eNUGa8KlFS6MhlQRKg8OTyKcD8NF+drwT093XhSiGPIhP723v8PNCAgoThQd iq9suN3Ex9pkQVGmg7ar8ljolRV4V3fd5AD3y8b+xAl2p5bPJA0OTRJyeLMAqADXHB4ZUUPTRCX/W k2TMjGTfYBKJdHwZ7jWa1rMKOe3NwD4qXqNBEpMXCjrwKfVGWhd7eOsKHM8nLiCVr/u69iMUf6xYJ VNzVSc6OCTNeez2mp9Ng==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r7eHt-002wWC-1i; Mon, 27 Nov 2023 16:16:45 +0000 Received: from mgamail.intel.com ([192.198.163.7]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r7eHo-002wTq-2h for hostap@lists.infradead.org; Mon, 27 Nov 2023 16:16:42 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1701101801; x=1732637801; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=8IqWyGZQuen7FHxx/FjYTxvWl286gUJpLQZ+dSSQuL0=; b=LhRqZtBQjlvbx2J+p7mR8Q6uhIb7ShBMflftOemU/pfNNx2FocEzm34M 10rKCbmtuXFejYEi9lzTNcRzfuv7KFSmwLMQ3i6SCZ2Ek6KYTKgAktMRf DHL9p3X/bR/7J0eq3lh+pReOxtafbGafbVwAAIjk2caa9eKSTszxSYIM5 yu8ddE3mIZ2/wMy8P7NW5NT6MTG6iOpQJE0231lhG+evV/1MaIjDI7pbx G+k+oG0fer/4+IOcCYXO7msVuVCx/hBtCiK0Bt+EZm7YTaylev+lDMTnU jAqbtrPVGqwSKZegq4FiPY+1Umh9hBSTTuojRt1s9US5HI/9YBeMBV59/ w==; X-IronPort-AV: E=McAfee;i="6600,9927,10907"; a="14292898" X-IronPort-AV: E=Sophos;i="6.04,231,1695711600"; d="scan'208";a="14292898" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Nov 2023 08:16:12 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10907"; a="1015614949" X-IronPort-AV: E=Sophos;i="6.04,231,1695711600"; d="scan'208";a="1015614949" Received: from unknown (HELO WEIS0042.iil.intel.com) ([10.12.217.211]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Nov 2023 08:16:06 -0800 From: Andrei Otcheretianski To: hostap@lists.infradead.org Cc: Ilan Peer Subject: [PATCH 2/2] AP: Always include WPA_STA_AUTHORIZED in station flags mask Date: Tue, 28 Nov 2023 12:14:10 +0200 Message-ID: <20231128101410.1931280-2-andrei.otcheretianski@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231128101410.1931280-1-andrei.otcheretianski@intel.com> References: <20231128101410.1931280-1-andrei.otcheretianski@intel.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231127_081640_929918_A267A3C4 X-CRM114-Status: GOOD ( 10.29 ) X-Spam-Score: 2.1 (++) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Ilan Peer As otherwise, the underlying driver would not handle a change in the 'authorized' state. Signed-off-by: Ilan Peer --- src/ap/ap_drv_ops.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) Content analysis details: (2.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record 2.5 DATE_IN_FUTURE_12_24 Date: is 12 to 24 hours after Received: date -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 -0.2 DKIMWL_WL_HIGH DKIMwl.org - High trust sender X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Ilan Peer As otherwise, the underlying driver would not handle a change in the 'authorized' state. Signed-off-by: Ilan Peer --- src/ap/ap_drv_ops.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c index d303f932f7..f4e1dd9269 100644 --- a/src/ap/ap_drv_ops.c +++ b/src/ap/ap_drv_ops.c @@ -319,7 +319,8 @@ int hostapd_set_sta_flags(struct hostapd_data *hapd, struct sta_info *sta) bool is_link_sta = hostapd_sta_is_link_sta(hapd, sta); total_flags = hostapd_sta_flags_to_drv(sta->flags); - set_flags = WPA_STA_SHORT_PREAMBLE | WPA_STA_WMM | WPA_STA_MFP; + set_flags = WPA_STA_SHORT_PREAMBLE | WPA_STA_WMM | WPA_STA_MFP | + WPA_STA_AUTHORIZED; /* * All the station flags other than WPA_STA_SHORT_PREAMBLE are relevant @@ -336,10 +337,6 @@ int hostapd_set_sta_flags(struct hostapd_data *hapd, struct sta_info *sta) return 0; } - if (((!hapd->conf->ieee802_1x && !hapd->conf->wpa) || - sta->auth_alg == WLAN_AUTH_FT) && - sta->flags & WLAN_STA_AUTHORIZED) - set_flags |= WPA_STA_AUTHORIZED; flags_or = total_flags & set_flags; flags_and = total_flags | ~set_flags; return hostapd_sta_set_flags(hapd, sta->addr, total_flags,