From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=none (p=none dis=none) header.from=gibson.dropbear.id.au Authentication-Results: passt.top; dkim=pass (2048-bit key; secure) header.d=gibson.dropbear.id.au header.i=@gibson.dropbear.id.au header.a=rsa-sha256 header.s=202512 header.b=ddBi57GA; dkim-atps=neutral Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id 17F425A0271 for ; Thu, 11 Dec 2025 04:54:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202512; t=1765425278; bh=ulKAoSVphI1rxN0rTY17bqp6IEkII4djaFR0Gi24G/Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ddBi57GAPrC8rWR+lk/4FMRZxsI2tc3YcEVJfH5gZNZZZ7QCqIl8hz1s1ALVTUvdF 7fnbhg27BFpqERCOlzFJglNFXgAPzwqN7PUvK1+oq4tAppJxijEti2G88TKdxUyCJ6 qt8dZx+2bdGOrkBIt3UQLXJufjwZacIPOCuFLjH3OhC6haEJ7OZnsHw2OmPVa4zYpj P8ojP3lwLbLko/DNynRh/5Q7Eq2LbdkHftZQu+TCVaqFCqFC240PERgvmmnwQ6sErL se03vhWPSkvu9XuTsdH1gFrvi16MK5dnbNbq20oih01sXxEdpfZTiKyx9+9qy/AtkD lldzAMsJD65EQ== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4dRdy60hcQz4wDs; Thu, 11 Dec 2025 14:54:38 +1100 (AEDT) From: David Gibson To: Stefano Brivio , passt-dev@passt.top Subject: [PATCH v2 1/3] tcp: Suppress new instance of cppcheck bug 14191 Date: Thu, 11 Dec 2025 14:54:34 +1100 Message-ID: <20251211035436.2844623-2-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251211035436.2844623-1-david@gibson.dropbear.id.au> References: <20251211035436.2844623-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: WEG4DBM4QMIGJKH7ZERG23EZKBOWUNOU X-Message-ID-Hash: WEG4DBM4QMIGJKH7ZERG23EZKBOWUNOU X-MailFrom: dgibson@gandalf.ozlabs.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Laurent Vivier , David Gibson X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Laurent Vivier ee9b2361d ("cppcheck: Suppress a buggy cppcheck warning") added a a suppression for a cppchec bug, since filed (and fixed) in upstream cppcheck as https://trac.cppcheck.net/ticket/14191. 9139e60fd ("tcp: Acknowledge everything if it looks like bulk traffic, not interactive") introduced a new point which triggers the same cppcheck bug. Add a suppression for the new instance. This is a revision of Laurent's earlier patch, updating the comments to make the connection between the two instances clear, and adding unmatchedSuppression so it doesn't cause a bogus warning with unaffected cppcheck versions. Signed-off-by: Laurent Vivier Signed-off-by: David Gibson --- tcp.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tcp.c b/tcp.c index 7c721b4b..1711bcc7 100644 --- a/tcp.c +++ b/tcp.c @@ -1132,6 +1132,11 @@ int tcp_update_seqack_wnd(const struct ctx *c, struct tcp_tap_conn *conn, return 0; } + /* This trips a cppcheck bug in some versions, including + * cppcheck 2.18.3. + * https://trac.cppcheck.net/ticket/14191 + */ + /* cppcheck-suppress [uninitvar,unmatchedSuppression] */ if ((unsigned)SNDBUF_GET(conn) > (long long)tinfo->tcpi_rtt * tinfo->tcpi_delivery_rate / 1000 / 1000 * @@ -1143,10 +1148,7 @@ int tcp_update_seqack_wnd(const struct ctx *c, struct tcp_tap_conn *conn, /* Fall back to acknowledging everything we got */ conn->seq_ack_to_tap = conn->seq_from_tap; } else { - /* This trips a cppcheck bug in some versions, including - * cppcheck 2.18.3. - * https://sourceforge.net/p/cppcheck/discussion/general/thread/fecde59085/ - */ + /* cppcheck bug 14191 again, see above */ /* cppcheck-suppress [uninitvar,unmatchedSuppression] */ conn->seq_ack_to_tap = tinfo->tcpi_bytes_acked + conn->seq_init_from_tap; -- 2.52.0