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=kIMlbeut; dkim-atps=neutral Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id E64B95A0625 for ; Tue, 09 Dec 2025 23:56:02 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202512; t=1765320959; bh=Of5jjDoddAvn99YtIdpjP+80k33jRnOT1/9cEZVzvdo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=kIMlbeutkxpjt5fyXVO2I9Mq/ljT03XGFaTSZTBa8/WH1VXShE+DSE08AfivfgH9M zdjev6RBpMitwzcPvRSMuMcCBVO+kP+0GeuK6yaeUCK4jmHqEL+7eYrsAEDog3nf24 lm7KwNyikROB+8ERgY7BV0uFVuedT7QG9oXFjt9H+7DWqJSel0KFtiiTK/1pfmoXNY 8D+SXHAyq83tOWLHJtyV58ecxCsMzPHImfoy/5qJUyaY4En0Z69v3QtbHjSns0Yl7H s9DR4BR63xg++0XP/I5MgywfWcgztDC6rHdtXRd2SZom2yaketDufVFCDCpXJuIy18 Qg+t6e8dZD3fQ== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4dQvMz2HG7z4wD0; Wed, 10 Dec 2025 09:55:59 +1100 (AEDT) Date: Wed, 10 Dec 2025 09:55:40 +1100 From: David Gibson To: Laurent Vivier Subject: Re: [PATCH] tcp: Suppress false positive cppcheck warning in tcp_update_seqack_wnd() Message-ID: References: <20251209134904.3237912-1-lvivier@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="SJMNt7c/F5IGbr8W" Content-Disposition: inline In-Reply-To: <20251209134904.3237912-1-lvivier@redhat.com> Message-ID-Hash: KRAQVCHBWMT3L2DEGYWCJZH72HSMCC7W X-Message-ID-Hash: KRAQVCHBWMT3L2DEGYWCJZH72HSMCC7W 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: passt-dev@passt.top 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: --SJMNt7c/F5IGbr8W Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Dec 09, 2025 at 02:49:04PM +0100, Laurent Vivier wrote: > Cppcheck doesn't track that tinfo is reassigned to &tinfo_new when NULL, > leading to a false uninitvar warning at line 1099. Add inline > suppression. I think this is the same cppcheck bug as I encountered, a dozen or so lines below this. See https://sourceforge.net/p/cppcheck/discussion/general/thread/fecde59085/ and/or https://trac.cppcheck.net/ticket/14191 >=20 > Signed-off-by: Laurent Vivier > --- > tcp.c | 1 + > 1 file changed, 1 insertion(+) >=20 > diff --git a/tcp.c b/tcp.c > index 17fda5dcd7db..8dabfd3042d2 100644 > --- a/tcp.c > +++ b/tcp.c > @@ -1132,6 +1132,7 @@ int tcp_update_seqack_wnd(const struct ctx *c, stru= ct tcp_tap_conn *conn, > return 0; > } > =20 > + /* cppcheck-suppress uninitvar */ Like the other case, I think we'll need unmatchedSuppression here, or we'll get the unmatched suppression warning once using a fixed version of cppcheck. Possibly also with earlier cppcheck versions that didn't trip on this. > if ((unsigned)SNDBUF_GET(conn) > (long long)tinfo->tcpi_rtt * > tinfo->tcpi_delivery_rate / > 1000 / 1000 * > --=20 > 2.51.1 >=20 --=20 David Gibson (he or they) | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you, not the other way | around. http://www.ozlabs.org/~dgibson --SJMNt7c/F5IGbr8W Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmk4qNoACgkQzQJF27ox 2GdzNA//TbBAI9Pr86fLMSr9OpbC+vMHxO5KNCkPcRjdSo7C44mjB2vthJcCps/k nOTFprE6CYItS1UmU7aKzpUv2wCrX7xvb4fMv5DiHnIMBtY0yOUAo0kFfyX/oPgv /8fpwu1Hhk4H99ZEJh30uC02CqQJIzl6acWxaJIj/wIOqjs8mDSnkqIaw7x9Qn82 JUp5scVBqEIy2if6vXYA0J9vSATck5RioE7Ou4WRb1Tcq10bMa9EaqLW4sdZqxG2 NABto4Z/5x8OoqM+1HZlbuADG4vfQtW4fwpM2MChHcuerqr1s9pU59qwqCI7y/I7 LJFGR1iz5wHqO41llZTMrEI59eRaTVawcveTJUj8UBGqVcynbaLP30rjKf61pyq9 wOlLqDxf6s6FnkgJu6k6JF2zcLGpyNwtSJVOgK8ari7frXvbjKu5qLeB98DQtA5B RIZl5X0SJhWSGG3pUjzFdpx4FSVPWeCE7BtuBUnGfI/CrRTdv3zMeYyTfjf04/2s RwN7UBb9usBYLEPKg1Mm1Iiy0Yk70v1R0TktKTI+m+7yfl2Lb1MR3YMHJw08ioKQ YVNhPtCbS0ApXYiIlN6JYB7M5uXm3t2bbpmDtvsvK7zoVwzvmFVAddexV1ORRtql u1nGAp40FxkcqtKwlNKJrxOV6C3793wiS3Vy++JV7DQEfopfHrE= =ShOu -----END PGP SIGNATURE----- --SJMNt7c/F5IGbr8W--