From patchwork Mon Apr 29 11:51:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Berg X-Patchwork-Id: 1928946 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=tA4hLu3r; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=sipsolutions.net header.i=@sipsolutions.net header.a=rsa-sha256 header.s=mail header.b=qQHVaa8v; 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 4VShXV4Rwvz23tX for ; Mon, 29 Apr 2024 21:52:41 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=GVOh1yxD3O6sIJNP9oBywjscgPaZNU1DSiqEElrEXvk=; b=tA4hLu3rskeVJs yg/p8yQ7XhviQAEV7HCHV4jvWFowfCbFEw1o8PcbbAQ+VhVcwxXGGCsaifJkeccX+Ela7EWtKXZn3 PfwgaCGtTW2iYXTS5CRWIys5dYUhG2/5R31vykv/oKI4UFU5a6rkCqMNPzc0zvpjjhXnNE6yHtl76 3UdjW3hEDGx8pZ3gI1lytqnDpf7wIfU+8vxdq+l8JyMbZKW08pU//6h+0cPqSLb09ulu0Fcn90ch+ w6wOF8kiH0vCD5IJbxyDMBc5voTQrsFpsYNd/rnouw6xSlzEX2oUeU+GXGYjnCZUgf4P2L07lG8lb w5AiSCJgdASovROFpGxQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s1PYM-00000002XBB-266W; Mon, 29 Apr 2024 11:52:14 +0000 Received: from s3.sipsolutions.net ([2a01:4f8:242:246e::2] helo=sipsolutions.net) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s1PYJ-00000002X7p-0Q7i for hostap@lists.infradead.org; Mon, 29 Apr 2024 11:52:12 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Content-Type:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-To: Resent-Cc:Resent-Message-ID; bh=+CQ5IP0Ipb2INkYGa/Zt2VlII+bIIx9CmUcJpe3whA0=; t=1714391527; x=1715601127; b=qQHVaa8vUfqbtDH3iKnpbWqNlWilRkay7MWMWWEYbzrXAhx bBnE4mi2hK07Z/yk1Nil9HFvS1CuRQ5HcjaESe3RBEcSF8H+d0Bj/lBAUqOda68eZbXBkgHB+Wg1S 2IZJ/ASOxBsAS2TFOBVRnbdox0SkA6NBwiedz4itUk3Wn5OijXBSsdwPvLzqOEOrglqXlJRVC/LEA uDzbAT2LaGeuuaox4eJf2tINEAnzxHNgYCKzu3GqW10VQcRmJ/Lb78aQf5PSnh80gVEwHTPT2pB25 d0Mbe3wz5GvwXOwx5w1rD4dbkNGqGjiSpOVYFrxYbuOf0BVniE/Do3gzUyRdvuow==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.97) (envelope-from ) id 1s1PYD-0000000CNIg-1Jv6; Mon, 29 Apr 2024 13:52:05 +0200 From: benjamin@sipsolutions.net To: hostap@lists.infradead.org Cc: Benjamin Berg Subject: [PATCH 02/16] WNM: Store whether disassociation address is an MLD Address Date: Mon, 29 Apr 2024 13:51:43 +0200 Message-ID: <20240429115157.211073-3-benjamin@sipsolutions.net> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240429115157.211073-1-benjamin@sipsolutions.net> References: <20240429115157.211073-1-benjamin@sipsolutions.net> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240429_045211_381309_B2B3F131 X-CRM114-Status: GOOD ( 12.95 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Benjamin Berg Commit 17a2aa822c26 ("WNM: Follow BTM procedure if the last link is dropped") added code to store either the MLD address or BSSID when being diassociated. However, it did not save which one was stored [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Benjamin Berg Commit 17a2aa822c26 ("WNM: Follow BTM procedure if the last link is dropped") added code to store either the MLD address or BSSID when being diassociated. However, it did not save which one was stored making the tests later on awkward. Store whether it was an MLD address or not and then do the test accordingly. Signed-off-by: Benjamin Berg --- wpa_supplicant/wnm_sta.c | 19 +++++++++++-------- wpa_supplicant/wpa_supplicant_i.h | 3 ++- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/wpa_supplicant/wnm_sta.c b/wpa_supplicant/wnm_sta.c index a383ed803..015a1948e 100644 --- a/wpa_supplicant/wnm_sta.c +++ b/wpa_supplicant/wnm_sta.c @@ -1495,12 +1495,17 @@ static void ieee802_11_rx_bss_trans_mgmt_req(struct wpa_supplicant *wpa_s, /* The last link is being removed (which must be the assoc link) */ wpa_s->wnm_link_removal = true; - os_memcpy(wpa_s->wnm_dissoc_addr, + wpa_s->wnm_disassoc_mld = false; + os_memcpy(wpa_s->wnm_disassoc_addr, wpa_s->links[wpa_s->mlo_assoc_link_id].bssid, ETH_ALEN); + } else if (wpa_s->valid_links) { + wpa_s->wnm_disassoc_mld = true; + os_memcpy(wpa_s->wnm_disassoc_addr, wpa_s->ap_mld_addr, + ETH_ALEN); } else { - os_memcpy(wpa_s->wnm_dissoc_addr, wpa_s->valid_links ? - wpa_s->ap_mld_addr : wpa_s->bssid, ETH_ALEN); + wpa_s->wnm_disassoc_mld = false; + os_memcpy(wpa_s->wnm_disassoc_addr, wpa_s->bssid, ETH_ALEN); } if (disassoc_imminent) { @@ -2066,13 +2071,11 @@ bool wnm_is_bss_excluded(struct wpa_supplicant *wpa_s, struct wpa_bss *bss) * In case disassociation imminent is set, do no try to use a BSS to * which we are connected. */ - if (wpa_s->wnm_link_removal || - !(wpa_s->drv_flags2 & WPA_DRIVER_FLAGS2_MLO) || - is_zero_ether_addr(bss->mld_addr)) { - if (ether_addr_equal(bss->bssid, wpa_s->wnm_dissoc_addr)) + if (!wpa_s->wnm_disassoc_mld) { + if (ether_addr_equal(bss->bssid, wpa_s->wnm_disassoc_addr)) return true; } else { - if (ether_addr_equal(bss->mld_addr, wpa_s->wnm_dissoc_addr)) + if (ether_addr_equal(bss->mld_addr, wpa_s->wnm_disassoc_addr)) return true; } diff --git a/wpa_supplicant/wpa_supplicant_i.h b/wpa_supplicant/wpa_supplicant_i.h index 6019fd1e1..d4a1284c3 100644 --- a/wpa_supplicant/wpa_supplicant_i.h +++ b/wpa_supplicant/wpa_supplicant_i.h @@ -1306,7 +1306,8 @@ struct wpa_supplicant { u8 wnm_num_neighbor_report; u8 wnm_mode; bool wnm_link_removal; - u8 wnm_dissoc_addr[ETH_ALEN]; + bool wnm_disassoc_mld; + u8 wnm_disassoc_addr[ETH_ALEN]; u16 wnm_dissoc_timer; u8 wnm_bss_termination_duration[12]; struct neighbor_report *wnm_neighbor_report_elements;