From patchwork Mon Apr 29 11:51:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Berg X-Patchwork-Id: 1928951 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=mwS6s+sE; 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=AmVQqfvR; 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 4VShXV4jYZz23tY 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=kdHGwofmiuecCEdl8wFkDj5tdRKJS/WIPrUcoIkW2NQ=; b=mwS6s+sEJrxURy LvpD2fUa+m7ysPSBZ5M1sIkpisJxCGorLt5TCG7zTw+yaez2F5WGhKhs+PAQRTiIDOy8pXVuubL+f hyKmsC5CPuvRvo60P5NA1Fs888WtqN2+rL5t7A3Z9/51jTZ2R8ZEvIoOf74AD6ylZl2wNZ43lDcGQ D7sLb10pA5jVz+A2JqcdreGWKoM8a3MUmtC3xB/yvSI1lJb2xTnewH0Rb6TvZoCeSvDYC3tcgIa/t uWv1KSaF8cm874JXXDvYKBzRC4LQsR4lbUx9+MEvPACv2vy2ggZBoFsujQUSgZLRDs5ETn7eNlTnj xEMwSOAnFklPVX2eTYhQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s1PYW-00000002XFv-0IuH; Mon, 29 Apr 2024 11:52:24 +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-00000002X8W-3OUX for hostap@lists.infradead.org; Mon, 29 Apr 2024 11:52:14 +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=WPXE0RH3V9sOym5ZBVg43G+VQGe542e4R/b9pnisLrA=; t=1714391531; x=1715601131; b=AmVQqfvREFlZS3tcphuGIEME2DffPmBvLTZaZGTW48lDwZB O8S1lGn+MaqrIZgXsS/Sh3JquTgs1Z1EFyhp2UbEKFp9Ad3XXM0IHwG0d5oI8h9SrQ8Vo6m6XwAfY qSQpfZOKKOun/jZ3wxggyMeyF8GsL143lsuuy2jfTs4lraSBGsKnOMpvcswQdadCCmyAT/UKj4sp6 uL4nvN0cJgA0oN/Qze5bu3T4LCUoaiEirTPcVmdFa8r7CJrlSqsKzNB+ZoVDOMYnApPVZCHU8bZwb J0S7xW9L/J7my6pMFZB2zcRukKUWkqTWaJiEigj9kltItyxk/GZhhH3tPZxFU30w==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.97) (envelope-from ) id 1s1PYH-0000000CNIg-2eu3; Mon, 29 Apr 2024 13:52:09 +0200 From: benjamin@sipsolutions.net To: hostap@lists.infradead.org Cc: Benjamin Berg Subject: [PATCH 06/16] WNM: Swap logic in wnm_is_bss_excluded to allow more checks Date: Mon, 29 Apr 2024 13:51:47 +0200 Message-ID: <20240429115157.211073-7-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_045212_235387_4D4B90BF X-CRM114-Status: GOOD ( 10.40 ) 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 Following commits will move more checks into wnm_is_bss_excluded, prepare for that by changing the logical flow so that further checks can be inserted. Signed-off-by: Benjamin Berg --- wpa_supplicant/wnm_sta.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) 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 Following commits will move more checks into wnm_is_bss_excluded, prepare for that by changing the logical flow so that further checks can be inserted. Signed-off-by: Benjamin Berg --- wpa_supplicant/wnm_sta.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/wpa_supplicant/wnm_sta.c b/wpa_supplicant/wnm_sta.c index d3bc03202..7283ff47c 100644 --- a/wpa_supplicant/wnm_sta.c +++ b/wpa_supplicant/wnm_sta.c @@ -2056,19 +2056,20 @@ void wnm_clear_coloc_intf_reporting(struct wpa_supplicant *wpa_s) bool wnm_is_bss_excluded(struct wpa_supplicant *wpa_s, struct wpa_bss *bss) { - if (!(wpa_s->wnm_mode & WNM_BSS_TM_REQ_DISASSOC_IMMINENT)) - return false; - /* * In case disassociation imminent is set, do no try to use a BSS to * which we are connected. */ - 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_disassoc_addr)) - return true; + if (wpa_s->wnm_mode & WNM_BSS_TM_REQ_DISASSOC_IMMINENT) { + 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_disassoc_addr)) + return true; + } } return false;