From patchwork Mon Dec 25 17:42:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrei Otcheretianski X-Patchwork-Id: 1880153 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=win28PNc; 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=glrvlz6V; 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 4SzQLh4fZcz23dL for ; Tue, 26 Dec 2023 04:46:19 +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=gCWaZN3eDWV401kXkbB4NKm7TjPwqkCfoduJ0G1ifwc=; b=win28PNcJCGlPO PgxhQs9FfZ0DlwwTtDx/e8MCvW6CcAqa+KadYWQSkPYFFM++8wU1HjHlqF72wR7bvNzi0A8FFIRVu HgW24nFlfwM6Cpk3+QZCLVd+4kAVPLGAXcOcNlVVBmw+7ND2FCb05UVMontihxoui4B0pWwwH3mY5 85kFfMVTjJMcaNKmM4cQWlUwTJIHFSoP2CRIw9K7nkxnMRXvKUFGj4eiyxQupJd1sMojl52f6PwLo 6cbY+qO87b9zCwcuLYdT/pUCfi/m/YGE8cZgnXhheobR3dwGcTBD+Irh60blkZiiuwpexAkg5dw+/ qwrNCo13qnbr8OyfoCcA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rHp0o-00B8fI-06; Mon, 25 Dec 2023 17:45:10 +0000 Received: from mgamail.intel.com ([198.175.65.13]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rHp0j-00B8eG-1y for hostap@lists.infradead.org; Mon, 25 Dec 2023 17:45:07 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1703526305; x=1735062305; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=vaQQmsM+ZnhQU1Gwj537CSQB3N53CLBOOy7k9eTEs1c=; b=glrvlz6V50wUbfwR5GUshQiqj+LAmC4jouZarMfI1Bg/feP4FZHvGWbK BmVwG1pgCi0Jc0jHkqkXKe7mDNsjZYX6yXqpLAIfHufqFQjJi9wCooD5x epRS7TPUsvQKusfFvpdBsV3QS5UYscqhLTynDt3I0vG3vXg4WUNAxky7E ztf3m3UeedM+tWFz3Y1PSomuW91B9/E8sZykCfSjeAWZoBb0K1YvpYHgA 9DCphjPSpCX2KskcQkOeYPIRp1gfsb5eYHBMK6VIHtTlQjWRk7DlWHNZY GYuOCAJWyMS6b4GAIAAWHavb+Zp6TSWdb64mPK4BlbZVT+snh7vnuyaIp Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10934"; a="3381652" X-IronPort-AV: E=Sophos;i="6.04,303,1695711600"; d="scan'208";a="3381652" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Dec 2023 09:43:33 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10934"; a="901229277" X-IronPort-AV: E=Sophos;i="6.04,303,1695711600"; d="scan'208";a="901229277" Received: from unknown (HELO WEIS0042.iil.intel.com) ([10.12.217.211]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Dec 2023 09:43:31 -0800 From: Andrei Otcheretianski To: hostap@lists.infradead.org Cc: Ilan Peer Subject: [PATCH 1/6] AP: Unify code handling deauthentication/disassociation Date: Mon, 25 Dec 2023 19:42:58 +0200 Message-ID: <20231225174303.4066419-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-20231225_094505_747941_8A66EBF2 X-CRM114-Status: GOOD ( 10.09 ) X-Spam-Score: -0.4 (/) 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 And avoid unnecessary code duplication. Signed-off-by: Ilan Peer --- src/ap/sta_info.c | 64 +++++++++++++++++++++++ 1 file changed, 32 insertions(+), 32 deletions(-) Content analysis details: (-0.4 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 -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 And avoid unnecessary code duplication. Signed-off-by: Ilan Peer --- src/ap/sta_info.c | 64 +++++++++++++++++++++++------------------------ 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/src/ap/sta_info.c b/src/ap/sta_info.c index 1bd6c07e91..31fc0cc242 100644 --- a/src/ap/sta_info.c +++ b/src/ap/sta_info.c @@ -846,29 +846,18 @@ static void ap_sta_disassoc_cb_timeout(void *eloop_ctx, void *timeout_ctx) } -void ap_sta_disassociate(struct hostapd_data *hapd, struct sta_info *sta, - u16 reason) +static void ap_sta_disconnect_common(struct hostapd_data *hapd, + struct sta_info *sta, u32 timeout) { - wpa_printf(MSG_DEBUG, "%s: disassociate STA " MACSTR, - hapd->conf->iface, MAC2STR(sta->addr)); sta->last_seq_ctrl = WLAN_INVALID_MGMT_SEQ; - if (hapd->iface->current_mode && - hapd->iface->current_mode->mode == HOSTAPD_MODE_IEEE80211AD) { - /* Skip deauthentication in DMG/IEEE 802.11ad */ - sta->flags &= ~(WLAN_STA_AUTH | WLAN_STA_ASSOC | - WLAN_STA_ASSOC_REQ_OK); - sta->timeout_next = STA_REMOVE; - } else { - sta->flags &= ~(WLAN_STA_ASSOC | WLAN_STA_ASSOC_REQ_OK); - sta->timeout_next = STA_DEAUTH; - } + ap_sta_set_authorized(hapd, sta, 0); hostapd_set_sta_flags(hapd, sta); - wpa_printf(MSG_DEBUG, "%s: reschedule ap_handle_timer timeout " - "for " MACSTR " (%d seconds - " - "AP_MAX_INACTIVITY_AFTER_DISASSOC)", - __func__, MAC2STR(sta->addr), - AP_MAX_INACTIVITY_AFTER_DISASSOC); + + wpa_printf(MSG_DEBUG, + "reschedule ap_handle_timer timeout (%u sec) for " MACSTR, + MAC2STR(sta->addr), timeout); + eloop_cancel_timeout(ap_handle_timer, hapd, sta); eloop_register_timeout(AP_MAX_INACTIVITY_AFTER_DISASSOC, 0, ap_handle_timer, hapd, sta); @@ -883,6 +872,27 @@ void ap_sta_disassociate(struct hostapd_data *hapd, struct sta_info *sta, #endif /* CONFIG_IEEE80211BE */ sta->wpa_sm = NULL; +} + + +void ap_sta_disassociate(struct hostapd_data *hapd, struct sta_info *sta, + u16 reason) +{ + wpa_printf(MSG_DEBUG, "%s: disassociate STA " MACSTR, + hapd->conf->iface, MAC2STR(sta->addr)); + + if (hapd->iface->current_mode && + hapd->iface->current_mode->mode == HOSTAPD_MODE_IEEE80211AD) { + /* Skip deauthentication in DMG/IEEE 802.11ad */ + sta->flags &= ~(WLAN_STA_AUTH | WLAN_STA_ASSOC | + WLAN_STA_ASSOC_REQ_OK); + sta->timeout_next = STA_REMOVE; + } else { + sta->flags &= ~(WLAN_STA_ASSOC | WLAN_STA_ASSOC_REQ_OK); + sta->timeout_next = STA_DEAUTH; + } + + ap_sta_disconnect_common(hapd, sta, AP_MAX_INACTIVITY_AFTER_DISASSOC); sta->disassoc_reason = reason; sta->flags |= WLAN_STA_PENDING_DISASSOC_CB; @@ -918,21 +928,11 @@ void ap_sta_deauthenticate(struct hostapd_data *hapd, struct sta_info *sta, wpa_printf(MSG_DEBUG, "%s: deauthenticate STA " MACSTR, hapd->conf->iface, MAC2STR(sta->addr)); - sta->last_seq_ctrl = WLAN_INVALID_MGMT_SEQ; + sta->flags &= ~(WLAN_STA_AUTH | WLAN_STA_ASSOC | WLAN_STA_ASSOC_REQ_OK); - ap_sta_set_authorized(hapd, sta, 0); - hostapd_set_sta_flags(hapd, sta); + sta->timeout_next = STA_REMOVE; - wpa_printf(MSG_DEBUG, "%s: reschedule ap_handle_timer timeout " - "for " MACSTR " (%d seconds - " - "AP_MAX_INACTIVITY_AFTER_DEAUTH)", - __func__, MAC2STR(sta->addr), - AP_MAX_INACTIVITY_AFTER_DEAUTH); - eloop_cancel_timeout(ap_handle_timer, hapd, sta); - eloop_register_timeout(AP_MAX_INACTIVITY_AFTER_DEAUTH, 0, - ap_handle_timer, hapd, sta); - accounting_sta_stop(hapd, sta); - ieee802_1x_free_station(hapd, sta); + ap_sta_disconnect_common(hapd, sta, AP_MAX_INACTIVITY_AFTER_DEAUTH); sta->deauth_reason = reason; sta->flags |= WLAN_STA_PENDING_DEAUTH_CB; From patchwork Mon Dec 25 17:42:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrei Otcheretianski X-Patchwork-Id: 1880154 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=O6yicwVj; 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=CxYykvIN; 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 4SzQLh3cppz1ydZ for ; Tue, 26 Dec 2023 04:46:19 +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=zolQS/IEMn9h2xou7lsLZH+5lclgF/LAVjZBDfT+uoo=; b=O6yicwVjKHKzss PNI1UGm933He5ei9SxX2WJJEkW0rpb48VWJV1yM77zaFKnZWNWniDsPO+dRxg8cYFVAhr/NYeo6HD K1VHFjatk1UbIXkztO39ifaKOkY9q46czm01kFL7i190Eyll8XYrbl+izFM/RE7SCAfrb+5Con21f aSO02UXAaUBs8ST/tgLgXHtB+mztM2nXQfI73WKV9+xgpCPIrMsk4nzonb4X/88uckmmkS8qAfNvw Ckr4Z6x8mkMbbBweexKb+aweGA2nUNQUug5GUZQlklN3W/Y8/uBZ+x5ZlIS9b+1aQO6Xzkt4tBwvP LyGFl0wyfCleJ6HQorNw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rHp0p-00B8gz-0I; Mon, 25 Dec 2023 17:45:11 +0000 Received: from mgamail.intel.com ([198.175.65.13]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rHp0l-00B8eG-0M for hostap@lists.infradead.org; Mon, 25 Dec 2023 17:45:08 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1703526307; x=1735062307; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=QwIXYIfdvVrSpvFSZoshOOa+dBTIw3EsTo71PGCSkZU=; b=CxYykvINV9P0VeNizqgWP6WfGbsjZIw3XTdBAhdVj1oP8IAZAnQ1W0aj QggKdIM+tYkzxiubI5x/NmKFOHNNVj1BvcROBEw2XgV6Fyv5sFK2bTb2F 026imG5QztHJ0Zp7h5J1tUhXTpLYvDMyWA9BH7dgC835VKMoe61Z8TXPS 6RRxUyyHmEOnNyWFbhYWPdWoiG+Yo6jNgUzGaoMiqtmZ6EEWCH92iheXf KPhmqWDB7JKKlA7Rp3F9SYis9yOc96S9v7KWhS2tuKzuHw6KN1nx4oDQ0 sxXrvVIy8AE3BnMcrdaremOy2xDJ/oTqLb+62vESfPvGqhS+dsx8+FaZ3 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10934"; a="3381653" X-IronPort-AV: E=Sophos;i="6.04,303,1695711600"; d="scan'208";a="3381653" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Dec 2023 09:43:37 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10934"; a="901229284" X-IronPort-AV: E=Sophos;i="6.04,303,1695711600"; d="scan'208";a="901229284" Received: from unknown (HELO WEIS0042.iil.intel.com) ([10.12.217.211]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Dec 2023 09:43:34 -0800 From: Andrei Otcheretianski To: hostap@lists.infradead.org Cc: Ilan Peer Subject: [PATCH 2/6] AP: MLD: Fix station lookup in hostapd_ml_get_assoc_sta() Date: Mon, 25 Dec 2023 19:42:59 +0200 Message-ID: <20231225174303.4066419-2-andrei.otcheretianski@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231225174303.4066419-1-andrei.otcheretianski@intel.com> References: <20231225174303.4066419-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-20231225_094507_198363_89A61250 X-CRM114-Status: GOOD ( 11.06 ) X-Spam-Score: -0.4 (/) 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 If the station is not an MLO station do not attempt to find the association station and return false. Signed-off-by: Ilan Peer --- src/ap/ieee802_11.c | 5 +++++ 1 file changed, 5 insertions(+) Content analysis details: (-0.4 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 -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 If the station is not an MLO station do not attempt to find the association station and return false. Signed-off-by: Ilan Peer --- src/ap/ieee802_11.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c index a939ad35e2..95b43029bb 100644 --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c @@ -5739,6 +5739,9 @@ hostapd_ml_get_assoc_sta(struct hostapd_data *hapd, struct sta_info *sta, struct hostapd_data *other_hapd = NULL; struct sta_info *tmp_sta; + if (!sta->mld_info.mld_sta) + return NULL; + *assoc_hapd = hapd; /* The station is the one on which the association was performed */ @@ -5787,6 +5790,8 @@ static bool hostapd_ml_handle_disconnect(struct hostapd_data *hapd, * the information about all the other links. */ assoc_sta = hostapd_ml_get_assoc_sta(hapd, sta, &assoc_hapd); + if (!assoc_sta) + return false; for (link_id = 0; link_id < MAX_NUM_MLD_LINKS; link_id++) { for (i = 0; i < assoc_hapd->iface->interfaces->count; i++) { From patchwork Mon Dec 25 17:43:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrei Otcheretianski X-Patchwork-Id: 1880155 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=rNb4KY+C; 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=XUHTueXq; 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 4SzQLh4ZNqz23dK for ; Tue, 26 Dec 2023 04:46:19 +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=5tOAxxiBkVEacR4aaQD5Fl+PzX4/6GGv6/zNELiA1pY=; b=rNb4KY+C9KK/cJ CHkxufB/dNMpqAwv2GC5QfzusE2WXZduHlzVOtpCh+di/dJeO5DSYruIvuskwMhXdKyWKIgJwRLGp IKrzVox8cpLOK7vbIyAo4lE4RlkEt/4fEPmIj7Bvx0r9kBRmLwWHNOVVYdUNCiyW0v+KbE2GVeoQj J/EXxt6F3KTaSnXivKsvWJzZWGKUgXretQuZYFVrMIggxkRT610a3JSRpgdR3kfj4lNk/GRZz6GJI mDJhIQaC/DIhi1V60dtLf9XY+a2K5FvfjCHnwoTkpQd+nkWJ0v+CJ/QxLs2yEowEWEMAUCT6PPdYP f35vRbf9nZtDnuvKYHjQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rHp0q-00B8hE-0J; Mon, 25 Dec 2023 17:45:12 +0000 Received: from mgamail.intel.com ([198.175.65.13]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rHp0l-00B8em-0u for hostap@lists.infradead.org; Mon, 25 Dec 2023 17:45:08 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1703526307; x=1735062307; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=HiNQscu6Z5w1tdkzOOg5G/d0TAlAs9KR8lZ4y24PdP4=; b=XUHTueXqoO8isM8BCsWyi8ZnRlVxDuABAcfFyYwsrUTpPG2Q0mxjyDYd HvkVyV7rjhYFsQMNUZD8dsLyx0UCKruSr29yFqMUxz7wMQMz+AwXRNmew kTr6ui+z8d3XwgNAUVQmrAvoyzwn08mMhm3Tx1ydITXcptv8T4KXivk1r aR/el7NG8yygGUHiwstij5GxinnNcoJQwwAvaZps6KreBGJB1F4kGE1vt LBxh20u1hw2mc4MTnZVZpU3GuTzVTeMJ9ad5zQPNtq0fW6ugIQKaDDLiS 5Hri0JQR/dsUzyoO771gH7VYXAbR9ju3cSicYAT8Np2M/bKI8jqIFoey6 g==; X-IronPort-AV: E=McAfee;i="6600,9927,10934"; a="3381655" X-IronPort-AV: E=Sophos;i="6.04,303,1695711600"; d="scan'208";a="3381655" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Dec 2023 09:43:38 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10934"; a="901229287" X-IronPort-AV: E=Sophos;i="6.04,303,1695711600"; d="scan'208";a="901229287" Received: from unknown (HELO WEIS0042.iil.intel.com) ([10.12.217.211]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Dec 2023 09:43:37 -0800 From: Andrei Otcheretianski To: hostap@lists.infradead.org Cc: Ilan Peer Subject: [PATCH 3/6] AP: Move hostapd_ml_get_assoc_sta() to shared Date: Mon, 25 Dec 2023 19:43:00 +0200 Message-ID: <20231225174303.4066419-3-andrei.otcheretianski@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231225174303.4066419-1-andrei.otcheretianski@intel.com> References: <20231225174303.4066419-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-20231225_094507_358517_7F4FFDF4 X-CRM114-Status: GOOD ( 16.00 ) X-Spam-Score: -0.4 (/) 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 So it could be used from different contexts. Signed-off-by: Ilan Peer --- src/ap/ieee802_11.c | 47 src/ap/ieee802_11.h | 4 +++- src/ap/ieee802_11_shared.c | 41 ++++++++++++++++++++++++ [...] Content analysis details: (-0.4 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 -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 So it could be used from different contexts. Signed-off-by: Ilan Peer --- src/ap/ieee802_11.c | 47 -------------------------------------- src/ap/ieee802_11.h | 4 +++- src/ap/ieee802_11_shared.c | 41 +++++++++++++++++++++++++++++++++ 3 files changed, 44 insertions(+), 48 deletions(-) diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c index 95b43029bb..9a8fad9f30 100644 --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c @@ -85,12 +85,6 @@ static void handle_auth(struct hostapd_data *hapd, int rssi, int from_queue); static int add_associated_sta(struct hostapd_data *hapd, struct sta_info *sta, int reassoc); -#ifdef CONFIG_IEEE80211BE -static struct sta_info * -hostapd_ml_get_assoc_sta(struct hostapd_data *hapd, struct sta_info *sta, - struct hostapd_data **assoc_hapd); -#endif /* CONFIG_IEEE80211BE */ - u8 * hostapd_eid_multi_ap(struct hostapd_data *hapd, u8 *eid) { @@ -5731,47 +5725,6 @@ static void hostapd_disassoc_sta(struct hostapd_data *hapd, } -#ifdef CONFIG_IEEE80211BE -static struct sta_info * -hostapd_ml_get_assoc_sta(struct hostapd_data *hapd, struct sta_info *sta, - struct hostapd_data **assoc_hapd) -{ - struct hostapd_data *other_hapd = NULL; - struct sta_info *tmp_sta; - - if (!sta->mld_info.mld_sta) - return NULL; - - *assoc_hapd = hapd; - - /* The station is the one on which the association was performed */ - if (sta->mld_assoc_link_id == hapd->mld_link_id) - return sta; - - other_hapd = hostapd_mld_get_link_bss(hapd, sta->mld_assoc_link_id); - if (!other_hapd) { - wpa_printf(MSG_DEBUG, "MLD: No link match for link_id=%u", - sta->mld_assoc_link_id); - return sta; - } - - /* - * Iterate over the stations and find the one with the matching link ID - * and association ID. - */ - for (tmp_sta = other_hapd->sta_list; tmp_sta; tmp_sta = tmp_sta->next) { - if (tmp_sta->mld_assoc_link_id == sta->mld_assoc_link_id && - tmp_sta->aid == sta->aid) { - *assoc_hapd = other_hapd; - return tmp_sta; - } - } - - return sta; -} -#endif /* CONFIG_IEEE80211BE */ - - static bool hostapd_ml_handle_disconnect(struct hostapd_data *hapd, struct sta_info *sta, const struct ieee80211_mgmt *mgmt, diff --git a/src/ap/ieee802_11.h b/src/ap/ieee802_11.h index 3f89874e23..485ea04e5c 100644 --- a/src/ap/ieee802_11.h +++ b/src/ap/ieee802_11.h @@ -255,5 +255,7 @@ const char * sae_get_password(struct hostapd_data *hapd, struct sta_info *sta, const char *rx_id, struct sae_password_entry **pw_entry, struct sae_pt **s_pt, const struct sae_pk **s_pk); - +struct sta_info * hostapd_ml_get_assoc_sta(struct hostapd_data *hapd, + struct sta_info *sta, + struct hostapd_data **assoc_hapd); #endif /* IEEE802_11_H */ diff --git a/src/ap/ieee802_11_shared.c b/src/ap/ieee802_11_shared.c index eaeeba43e8..c2d38e7151 100644 --- a/src/ap/ieee802_11_shared.c +++ b/src/ap/ieee802_11_shared.c @@ -1148,3 +1148,44 @@ u16 check_ext_capab(struct hostapd_data *hapd, struct sta_info *sta, return WLAN_STATUS_SUCCESS; } + + +struct sta_info * hostapd_ml_get_assoc_sta(struct hostapd_data *hapd, + struct sta_info *sta, + struct hostapd_data **assoc_hapd) +{ +#ifdef CONFIG_IEEE80211BE + struct hostapd_data *other_hapd = NULL; + struct sta_info *tmp_sta; + + if (!sta->mld_info.mld_sta) + return NULL; + + *assoc_hapd = hapd; + + /* The station is the one on which the association was performed */ + if (sta->mld_assoc_link_id == hapd->mld_link_id) + return sta; + + other_hapd = hostapd_mld_get_link_bss(hapd, sta->mld_assoc_link_id); + if (!other_hapd) { + wpa_printf(MSG_DEBUG, "MLD: No link match for link_id=%u", + sta->mld_assoc_link_id); + return sta; + } + + /* + * Iterate over the stations and find the one with the matching link ID + * and association ID. + */ + for (tmp_sta = other_hapd->sta_list; tmp_sta; tmp_sta = tmp_sta->next) { + if (tmp_sta->mld_assoc_link_id == sta->mld_assoc_link_id && + tmp_sta->aid == sta->aid) { + *assoc_hapd = other_hapd; + return tmp_sta; + } + } +#endif /* CONFIG_IEEE80211BE */ + + return sta; +} From patchwork Mon Dec 25 17:43:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrei Otcheretianski X-Patchwork-Id: 1880158 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=K/+mfVk/; 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=g039LmL5; 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 4SzQLn5R5Xz1ydZ for ; Tue, 26 Dec 2023 04:46:25 +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=FIMCkWPvNdY0d+cKrJ+C5ygsMe+c5La2GtcwPUSBKh0=; b=K/+mfVk/6H2a57 ZvLOG5+tOkvcNaT5ua0joiXi66fEkN1EEmRZssc0DqX+RdPqGj6TFYsbui3ZGEF/w+JR0vUfste+8 yVZ2a5b1pi1KdEPg17luDFaXFq/JGaoHkNFpGczmjUnL1rwuEjTVo0vLCB3/qjQNR6J6yyYERm2p2 U3OnkSaOa45GWeYSGcoR+/PPbszNY1Iqtwy9h0MxRLyzOLOd6oYBDqhEDiFUjfsjlLJYeQDeirNNx n8rimCOZPV8Qa4ndfZHV79SK1CvE9+JkkoLjRpKEnM06YnbX6qh42xos5xzorgI0weYuOpfu47/zO ds84ey7uWACZ2AO18O0w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rHp0r-00B8hb-0l; Mon, 25 Dec 2023 17:45:13 +0000 Received: from mgamail.intel.com ([198.175.65.13]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rHp0m-00B8eG-1G for hostap@lists.infradead.org; Mon, 25 Dec 2023 17:45:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1703526308; x=1735062308; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=eGsBpyQ98709rjbQJsGHbceIwSw7+rNB34/ZdKtm+vw=; b=g039LmL5oM9v6locxv18FXzWbcuXwimvtysuNk6+Ie5Q2uUqlJ9Q9cBe T5BmWSB9VpuPMPLmVOUltbsHOmU4feDuqVFYVQeeUxiWfhNiCjgvTvOP4 WE5aRytJ/feYbko+98lmdTIT11+71mgN/4uJw0NMUoRPxOE4YFhnnvTWq SN1OA9TPjPaN2Bzo5utju8xG/aLcQPjQ4dSrelyE/mp/7mYjSCv2olTy5 iiM9SqzO3sfmIQTYbLi+Oe4y75kDAQewCnHbCHQ3gNKgroZnzcosmMIb7 ssXE6ZXbYuXtsmorV/eDE/qa932+QS83vG1By9yphigld+NcJre544qoW w==; X-IronPort-AV: E=McAfee;i="6600,9927,10934"; a="3381658" X-IronPort-AV: E=Sophos;i="6.04,303,1695711600"; d="scan'208";a="3381658" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Dec 2023 09:43:40 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10934"; a="901229291" X-IronPort-AV: E=Sophos;i="6.04,303,1695711600"; d="scan'208";a="901229291" Received: from unknown (HELO WEIS0042.iil.intel.com) ([10.12.217.211]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Dec 2023 09:43:38 -0800 From: Andrei Otcheretianski To: hostap@lists.infradead.org Cc: Ilan Peer Subject: [PATCH 4/6] AP: Support deauthenticate/disassociate with MLD Date: Mon, 25 Dec 2023 19:43:01 +0200 Message-ID: <20231225174303.4066419-4-andrei.otcheretianski@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231225174303.4066419-1-andrei.otcheretianski@intel.com> References: <20231225174303.4066419-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-20231225_094508_478806_773B34BA X-CRM114-Status: GOOD ( 15.27 ) X-Spam-Score: -0.4 (/) 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 When requested to deauthenticate/disassociate a station also handle the corresponding MLD stations. Signed-off-by: Ilan Peer --- src/ap/sta_info.c | 106 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 102 insertions(+), 4 deletions(-) Content analysis details: (-0.4 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 -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 When requested to deauthenticate/disassociate a station also handle the corresponding MLD stations. Signed-off-by: Ilan Peer --- src/ap/sta_info.c | 106 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 102 insertions(+), 4 deletions(-) diff --git a/src/ap/sta_info.c b/src/ap/sta_info.c index 31fc0cc242..db2e8ca26c 100644 --- a/src/ap/sta_info.c +++ b/src/ap/sta_info.c @@ -875,8 +875,8 @@ static void ap_sta_disconnect_common(struct hostapd_data *hapd, } -void ap_sta_disassociate(struct hostapd_data *hapd, struct sta_info *sta, - u16 reason) +static void ap_sta_handle_disassociate(struct hostapd_data *hapd, + struct sta_info *sta, u16 reason) { wpa_printf(MSG_DEBUG, "%s: disassociate STA " MACSTR, hapd->conf->iface, MAC2STR(sta->addr)); @@ -915,8 +915,8 @@ static void ap_sta_deauth_cb_timeout(void *eloop_ctx, void *timeout_ctx) } -void ap_sta_deauthenticate(struct hostapd_data *hapd, struct sta_info *sta, - u16 reason) +static void ap_sta_handle_deauthenticate(struct hostapd_data *hapd, + struct sta_info *sta, u16 reason) { if (hapd->iface->current_mode && hapd->iface->current_mode->mode == HOSTAPD_MODE_IEEE80211AD) { @@ -943,6 +943,104 @@ void ap_sta_deauthenticate(struct hostapd_data *hapd, struct sta_info *sta, } +static bool ap_sta_ml_disconnect(struct hostapd_data *hapd, + struct sta_info *sta, u16 reason, + bool disassoc) +{ +#ifdef CONFIG_IEEE80211BE + struct hostapd_data *assoc_hapd, *tmp_hapd; + struct sta_info *assoc_sta; + u8 i, link_id; + + if (!hostapd_is_mld_ap(hapd)) + return false; + + /* + * Get the station on which the association was performed, as it holds + * the information about all the other links + */ + assoc_sta = hostapd_ml_get_assoc_sta(hapd, sta, &assoc_hapd); + if (!assoc_sta) + return false; + + for (link_id = 0; link_id < MAX_NUM_MLD_LINKS; link_id++) { + for (i = 0; i < assoc_hapd->iface->interfaces->count; i++) { + struct sta_info *tmp_sta; + + if (!assoc_sta->mld_info.links[link_id].valid) + continue; + + tmp_hapd = + assoc_hapd->iface->interfaces->iface[i]->bss[0]; + + if (!tmp_hapd->conf->mld_ap || + assoc_hapd->conf->mld_id != tmp_hapd->conf->mld_id) + continue; + + for (tmp_sta = tmp_hapd->sta_list; tmp_sta; + tmp_sta = tmp_sta->next) { + /* + * handle the station on which the association + * was done only after all other link station + * are removed. Since there is a only a single + * station per hapd with the same association + * link simply break; + */ + if (tmp_sta == assoc_sta) + break; + + if (tmp_sta->mld_assoc_link_id != + assoc_sta->mld_assoc_link_id || + tmp_sta->aid != assoc_sta->aid) + continue; + + if (disassoc) + ap_sta_handle_disassociate(tmp_hapd, + tmp_sta, + reason); + else + ap_sta_handle_deauthenticate(tmp_hapd, + tmp_sta, + reason); + + break; + } + } + } + + /* disconnect the station on which the association was performed */ + if (disassoc) + ap_sta_handle_disassociate(assoc_hapd, assoc_sta, reason); + else + ap_sta_handle_deauthenticate(assoc_hapd, assoc_sta, reason); + + return true; +#else + return false; +#endif /* CONFIG_IEEE80211BE */ +} + + +void ap_sta_disassociate(struct hostapd_data *hapd, struct sta_info *sta, + u16 reason) +{ + if (ap_sta_ml_disconnect(hapd, sta, reason, true)) + return; + + ap_sta_handle_disassociate(hapd, sta, reason); +} + + +void ap_sta_deauthenticate(struct hostapd_data *hapd, struct sta_info *sta, + u16 reason) +{ + if (ap_sta_ml_disconnect(hapd, sta, reason, false)) + return; + + ap_sta_handle_deauthenticate(hapd, sta, reason); +} + + #ifdef CONFIG_WPS int ap_sta_wps_cancel(struct hostapd_data *hapd, struct sta_info *sta, void *ctx) From patchwork Mon Dec 25 17:43:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrei Otcheretianski X-Patchwork-Id: 1880156 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=Z2T1nv7V; 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=LzyEyukG; 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 4SzQLj1xl7z23dN for ; Tue, 26 Dec 2023 04:46:19 +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=ZwsO7vgNxeX3rcWFUgCPugL8iOMmTPQaIyoZJkcaxDM=; b=Z2T1nv7VhhPF4j x5Yrlky6tQI7FvhLGxgO1EbmuC+S9PS9ngG59QTV9odWrX+P+wDuirgsH97OHhLsh7ihWYXl1tjuz TM3CztwnXa9gFcVbSPJoU6N7q9ToQVC9h/pxE6zPhn8TwRzmgKXldEiNtQ+gUTDjOcPGL36bWDhqd krIIBVlkCPCZ5AkQ5TtCWXaURelykhSB5Jp79RBTXiVO9r+oACRltq23ydopWINzibz7Q6oW+coA/ pYq42QZv4VKAeaN52el2sAUtW6D28m2m+SClf8HL2fR1O0f3/JaBYoJzguDZcg0hFQpSK9/S81eUL +1z2OsW+lcwDr1zO0UOQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rHp0s-00B8hy-11; Mon, 25 Dec 2023 17:45:14 +0000 Received: from mgamail.intel.com ([198.175.65.13]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rHp0m-00B8fO-1m for hostap@lists.infradead.org; Mon, 25 Dec 2023 17:45:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1703526308; x=1735062308; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=g6oW6Pm961xBroQexkZg/JTGFw/ocaHe3y131mAihZk=; b=LzyEyukGacWhhOG4IOSVPdOWYeUVxtC9u60+e1nUMTmRI5+xRaTwGuBg OV2k2PwYIk9v68GOkSa1iK3N/mV9aDu1kXNLI7xG7Xu2DUc5jc2UC1jcJ /4l4NuSFFAUFObXJe3dGDOYn3m54LbW6OeQxfLDyRlQThE1aGfvW0O5tP I6LUfA6ItYT0bb5u+twqvi4oft8bpoZzjv/G6j4SEIv/sb9/BBpZEu8zv gXxWBkpA5MemBFKeWRYmEa0iwy2a05ZDtchZ9wUZQFcspEZ68mjQG6MrS lUEYoxilsWxUg501H6QGtY0Lkjx5zp1YlfEQQ71DXL2vf2xabDIgswgM+ Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10934"; a="3381660" X-IronPort-AV: E=Sophos;i="6.04,303,1695711600"; d="scan'208";a="3381660" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Dec 2023 09:43:44 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10934"; a="901229300" X-IronPort-AV: E=Sophos;i="6.04,303,1695711600"; d="scan'208";a="901229300" Received: from unknown (HELO WEIS0042.iil.intel.com) ([10.12.217.211]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Dec 2023 09:43:41 -0800 From: Andrei Otcheretianski To: hostap@lists.infradead.org Cc: Ilan Peer , Andrei Otcheretianski Subject: [PATCH 5/6] AP: Remove link stations on a new station authentication Date: Mon, 25 Dec 2023 19:43:02 +0200 Message-ID: <20231225174303.4066419-5-andrei.otcheretianski@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231225174303.4066419-1-andrei.otcheretianski@intel.com> References: <20231225174303.4066419-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-20231225_094508_634085_25CA0B6D X-CRM114-Status: GOOD ( 11.41 ) X-Spam-Score: -0.4 (/) 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 When a station tries to authenticate to an AP that hosts a MLD AP, need to remove all station instances from all APs. Signed-off-by: Ilan Peer Signed-off-by: Andrei Otcheretianski --- src/ap/sta_info.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 [...] Content analysis details: (-0.4 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 -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 When a station tries to authenticate to an AP that hosts a MLD AP, need to remove all station instances from all APs. Signed-off-by: Ilan Peer Signed-off-by: Andrei Otcheretianski --- src/ap/sta_info.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/src/ap/sta_info.c b/src/ap/sta_info.c index db2e8ca26c..b224ef955a 100644 --- a/src/ap/sta_info.c +++ b/src/ap/sta_info.c @@ -1715,6 +1715,35 @@ int ap_sta_pending_delayed_1x_auth_fail_disconnect(struct hostapd_data *hapd, } +#ifdef CONFIG_IEEE80211BE +static void ap_sta_remove_link_sta(struct hostapd_data *hapd, + struct sta_info *sta) +{ + struct hostapd_data *tmp_hapd; + unsigned int i, j; + + for_each_mld_link(tmp_hapd, i, j, hapd->iface->interfaces, + hapd->conf->mld_id) { + struct sta_info *tmp_sta; + + if (hapd == tmp_hapd) + continue; + + for (tmp_sta = tmp_hapd->sta_list; tmp_sta; + tmp_sta = tmp_sta->next) { + if (tmp_sta == sta || + os_memcmp(tmp_sta->addr, sta->addr, + ETH_ALEN)) + continue; + + ap_free_sta(tmp_hapd, tmp_sta); + break; + } + } +} +#endif /* CONFIG_IEEE80211BE */ + + int ap_sta_re_add(struct hostapd_data *hapd, struct sta_info *sta) { const u8 *mld_link_addr = NULL; @@ -1734,7 +1763,14 @@ int ap_sta_re_add(struct hostapd_data *hapd, struct sta_info *sta) mld_link_sta = sta->mld_assoc_link_id != mld_link_id; mld_link_addr = sta->mld_info.links[mld_link_id].peer_addr; + + /* + * In case the AP hosts an MLD AP, need to remove the station + * from all relevant links/APs. + */ + ap_sta_remove_link_sta(hapd, sta); } + #endif /* CONFIG_IEEE80211BE */ ap_sta_set_authorized(hapd, sta, 0); From patchwork Mon Dec 25 17:43:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrei Otcheretianski X-Patchwork-Id: 1880157 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=gTTKF+k8; 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=ga6cORO7; 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 4SzQLh3j3tz23dC for ; Tue, 26 Dec 2023 04:46:18 +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=FltORI+TDdZ3j1OxkjMY8FIghOv+yYUS2aV4p1j4iSg=; b=gTTKF+k8fh9h0W 93gUdrlFUg7dGHNJM3WvROXUpw7edyXdmkxVOIby+yw+8LYfDVK6eSfst0CANh39GdmDJ5r6Kimqz nXSsf820/sj2r5X+DpiGlx3WgYI3VuNnk8rHp+wd/qzCBTuJl1fydrbCXmdOZWNhLWlfSj+Iv43iN wuzlWaAQOG0ZlGP2vFnjPnm9kwCdzKbwKHZ1Pie8tFMTLf5wi3hNeXtpSGhwXE/s3FobHgmZa1Upk GS8OTV0oTuroDRal+I6tRYOotXdO4qd61xT7nLRlp/V/ohKgLm8UUNaFrdXKy08wa6+9cax2dcZTl s+NwrJh1nHdpdXS4dw5g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rHp0t-00B8iE-0x; Mon, 25 Dec 2023 17:45:15 +0000 Received: from mgamail.intel.com ([198.175.65.13]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rHp0m-00B8em-3D for hostap@lists.infradead.org; Mon, 25 Dec 2023 17:45:10 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1703526309; x=1735062309; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=tCB3rmSEbS+++lyR9AvWEEm4ZcEu5sCOSAyM0IzVdNA=; b=ga6cORO7FiZYTheS4fuI52CtawpZ/TDVs2mIttU1zZXFAVzCfleoH6yc ikAGUCEGvHmCfrFAEsOGO8eABseogl1jvOhYukGP5x9qancGw5TRRpENN Jxgt2cEwEcBr2z26PP3tigF2iCEXZqIGFLYMSO4Ni/9Md9jk/TneZ3WQ8 L+gO8iFnsnZcb6rpnwAUk5XMEDJCQQM1exe/WqLrOGfA9EashsvMRJ4Gl Qc6vX4fKzFb98JBeLhe580G3Dgi5yxRo2qWBNvL4TKmpWKJ5TiMcYyRon Ch7G4XQ0u/Oc9q9PN5CRlTbuX4GVcfHfZf/LFDSR3DNGQIFNePORcYmLl Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10934"; a="3381665" X-IronPort-AV: E=Sophos;i="6.04,303,1695711600"; d="scan'208";a="3381665" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Dec 2023 09:43:45 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10934"; a="901229305" X-IronPort-AV: E=Sophos;i="6.04,303,1695711600"; d="scan'208";a="901229305" Received: from unknown (HELO WEIS0042.iil.intel.com) ([10.12.217.211]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Dec 2023 09:43:44 -0800 From: Andrei Otcheretianski To: hostap@lists.infradead.org Cc: Ilan Peer Subject: [PATCH 6/6] tests: Add MLD tests for deauthentication and disassociation Date: Mon, 25 Dec 2023 19:43:03 +0200 Message-ID: <20231225174303.4066419-6-andrei.otcheretianski@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231225174303.4066419-1-andrei.otcheretianski@intel.com> References: <20231225174303.4066419-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-20231225_094509_076630_4C99C13F X-CRM114-Status: UNSURE ( 8.28 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.4 (/) 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 Verifying that the station can successfully associate again after being deauthenticated or disassociated. Signed-off-by: Ilan Peer --- tests/hwsim/test_eht.py | 48 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) Content analysis details: (-0.4 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 -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 Verifying that the station can successfully associate again after being deauthenticated or disassociated. Signed-off-by: Ilan Peer --- tests/hwsim/test_eht.py | 48 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/tests/hwsim/test_eht.py b/tests/hwsim/test_eht.py index e46f92d35f..0b48e89496 100644 --- a/tests/hwsim/test_eht.py +++ b/tests/hwsim/test_eht.py @@ -1308,3 +1308,51 @@ def test_eht_6ghz_320mhz_2(dev, apdev): def test_eht_6ghz_320mhz_3(dev, apdev): """EHT with 320 MHz channel width on 6 GHz center 31 primary 37""" _test_eht_6ghz(dev, apdev, 37, 137, 31) + +def _eht_mld_disconnect(dev, apdev, disassoc=True): + with HWSimRadio(use_mlo=True) as (hapd0_radio, hapd0_iface), \ + HWSimRadio(use_mlo=True) as (wpas_radio, wpas_iface): + + wpas = WpaSupplicant(global_iface='/tmp/wpas-wlan5') + wpas.interface_add(wpas_iface) + + ssid = "mld_ap_owe_two_link" + params = eht_mld_ap_wpa2_params(ssid, key_mgmt="OWE", mfp="2") + hapd0 = eht_mld_enable_ap(hapd0_iface, params) + + params['channel'] = '6' + hapd1 = eht_mld_enable_ap(hapd0_iface, params) + + wpas.connect(ssid, scan_freq="2412 2437", key_mgmt="OWE", ieee80211w="2") + eht_verify_status(wpas, hapd0, 2412, 20, is_ht=True, mld=True, valid_links=3, + active_links=3) + eht_verify_wifi_version(wpas) + traffic_test(wpas, hapd0) + + if disassoc: + cmd = "DISASSOCIATE " + else: + cmd = "DEAUTHENTICATE " + + cmd += wpas.own_addr() + for i in range(0, 3): + time.sleep(1) + + if "OK" not in hapd0.request(cmd): + raise Exception("Failed to request: " + cmd) + + wpas.wait_disconnected(timeout=1) + wpas.wait_connected(timeout=5) + + eht_verify_status(wpas, hapd0, 2412, 20, is_ht=True, mld=True, valid_links=3, + active_links=3) + eht_verify_wifi_version(wpas) + traffic_test(wpas, hapd0) + +def test_eht_mld_disassociate(dev, apdev): + """EHT MLD with two links. Disassociate and reconnect""" + _eht_mld_disconnect(dev, apdev, disassoc=True) + +def test_eht_mld_deauthenticate(dev, apdev): + """EHT MLD with two links. Deauthenticate and reconnect""" + _eht_mld_disconnect(dev, apdev, disassoc=False)