From patchwork Wed Jul 24 17:37:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Berg X-Patchwork-Id: 1964403 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=N0nu7F2G; 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=r5QJrpfu; 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 4WTh714rZGz1ybY for ; Thu, 25 Jul 2024 03:37:47 +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: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=t6qDvKISjb7VFNa2tV9hA5z82/8/8hkFTDp93jODSM8=; b=N0nu7F2G+mMbNt ToIXX/ywnMHbBqO0l0cEO0UDteczaEUXZW8EvffvU+AtfnSAPmgq2le0aNOPSMhA2V6GQF7r5I5g0 JbimSLUPtOll9hC9ekCiCc2RJMvqTtXoTuR8Sje1uDTeO7dIQWS3KbyBp5lcLj2+efhkaJJKUgWxx /c6AxWOFiSxhqInbwtFlu3Oi2I/2eZdD1Ws+DwPkvS3Sr602VuWtEr4xcqXkZFqmiKqRSu/so7LUG j4Mrq5+Q+fdxx57wbCT59ikonHioOpAR7Kj4ghioHfjn0KA3u42NlNrA7p/Omy9tcN5MtjesIAJSA hpRAK1MFpMDNkcnGzPww==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sWfvS-0000000G6kq-1crS; Wed, 24 Jul 2024 17:37:18 +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 1sWfvO-0000000G6jE-0k9i for hostap@lists.infradead.org; Wed, 24 Jul 2024 17:37:15 +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: 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:In-Reply-To:References; bh=NFVeoujraV+ZNmieI43RBdUj0xXNKCDcaZbF9+l/uXU=; t=1721842632; x=1723052232; b=r5QJrpful1+cUtI4olMtsHPLWTWAvBJ752RkRr5X8fhR4+k+6oEwLraGwgOlwA7vmt1JUWNtaeT e4rvDji0iko5QHZs+5CYrcckbv2b2Q1pLtySjfgjqg0l/AUEA1/f6xkhXy14Zu/tbTiSy4DZtKa+H Y7COjD4CGy0RXXWviVLg4CxkRzAYvBO25oyH6ENAwWbyyGZ8G+PmcSsXzgF8FmsSf3ZLM9mvDVI7G kcTHevJ/Q7MV4/7k3WdnXNTc7pxTjbkHrsPbzbL/09HlYMI+oJiVq2Tk0jBo+XTfXX50E5lRdHdN1 vnKlRNsw9miAbv+h0Vsu+94rFgUtBmm1JfXQ==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.97) (envelope-from ) id 1sWfvI-0000000E5md-2zxi; Wed, 24 Jul 2024 19:37:08 +0200 From: Johannes Berg To: hostap@lists.infradead.org Cc: Johannes Berg Subject: [PATCH] hostapd: fix BSS parameters change count on link removal Date: Wed, 24 Jul 2024 19:37:07 +0200 Message-ID: <20240724193706.1ee90d20aeed.Ie6d04c0a58c6fc17d44706c18e3b16dd27ab631b@changeid> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240724_103714_522974_A528B654 X-CRM114-Status: UNSURE ( 9.73 ) X-CRM114-Notice: Please train this message. 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: Johannes Berg The value currently is simply incremented, but it must not reach 255 and rather wrap around from 254 to 0, since in the Reduced Neighbor Report 255 means unknown. Fix that. Content analysis details: (-2.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from 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_AU Message has a valid DKIM or DK signature from author's domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 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: Johannes Berg The value currently is simply incremented, but it must not reach 255 and rather wrap around from 254 to 0, since in the Reduced Neighbor Report 255 means unknown. Fix that. Fixes: d95838b7932b ("AP: Add support for testing ML link removal") Signed-off-by: Johannes Berg --- src/ap/hostapd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c index a05de030d91f..a0ac3a857823 100644 --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c @@ -440,6 +440,8 @@ int hostapd_link_remove(struct hostapd_data *hapd, u32 count) hapd->eht_mld_link_removal_count = count; hapd->eht_mld_bss_param_change++; + if (hapd->eht_mld_bss_param_change == 255) + hapd->eht_mld_bss_param_change = 0; eloop_register_timeout(0, TU_TO_USEC(hapd->iconf->beacon_int), hostapd_link_remove_timeout_handler,