From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id 42B4C5A004E for ; Thu, 06 Jun 2024 05:22:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202312; t=1717644173; bh=Lfy8a0QtWKZblq4RFl34w7iiIEOfZJyg5rIDNhYa4Ig=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=q4+4XRER4hUF9rQJqGsc1CpaM+XCC50Uv7J0Bp+HgLAdqdo3kkbczykc3AOLLhbPR 9/EtAgX9ddjv3EB+I9uXNMtmzzP1XHLVcqmg8iqdd+wSUAz/D9vLHQ1GsueRHgXzz6 vaH0FfmgTfLiPUzwcTGlVInDRZ+iMiWNXEycmDiV+puHCCM+31bGNeC7prsTzyBZm4 WqWeB6RHMVrLcnCkInnAlTl+usr3YWfY++0t3CxUkwJ6zb0DDivpZBlgQc1fi79Uu+ 2FJpIGTC6xadWPAwU6+yArn8FuaMbTsG1jAGYSnXXhGQLx7q7gjASYizAmPZcM9pNf f3KFGXIEnnx2A== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4VvqQj37Qvz4wcC; Thu, 6 Jun 2024 13:22:53 +1000 (AEST) Date: Thu, 6 Jun 2024 12:41:06 +1000 From: David Gibson To: passt-dev@passt.top, Stefano Brivio Subject: Re: [PATCH v6] tcp: Make pointer const in tcp_revert_seq Message-ID: References: <20240606020305.4125785-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="PuNW1JmU/gtX5m3r" Content-Disposition: inline In-Reply-To: <20240606020305.4125785-1-david@gibson.dropbear.id.au> Message-ID-Hash: BQ6VCRK7ZZCS3C2KDN7WVPMOYFMOYR27 X-Message-ID-Hash: BQ6VCRK7ZZCS3C2KDN7WVPMOYFMOYR27 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: jmaloy@redhat.com 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: --PuNW1JmU/gtX5m3r Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jun 06, 2024 at 12:03:05PM +1000, David Gibson wrote: > The th pointer could be const, which causes a cppcheck warning on at least > some cppcheck versions (e.g. Cppcheck 2.13.0 in Fedora 40). >=20 > Fixes: e84a01e94 "tcp: move seq_to_tap update to when frame is queued" >=20 > Signed-off-by: David Gibson Heh, then I updated and the new cppcheck found some more errors. I'll repost this along with the remaining fixes. > --- > tcp.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/tcp.c b/tcp.c > index 89a5b19a..ff1198dd 100644 > --- a/tcp.c > +++ b/tcp.c > @@ -1261,8 +1261,8 @@ static void tcp_revert_seq(struct tcp_tap_conn **co= nns, struct iovec (*frames)[T > int i; > =20 > for (i =3D 0; i < num_frames; i++) { > + const struct tcphdr *th =3D frames[i][TCP_IOV_PAYLOAD].iov_base; > struct tcp_tap_conn *conn =3D conns[i]; > - struct tcphdr *th =3D frames[i][TCP_IOV_PAYLOAD].iov_base; > uint32_t seq =3D ntohl(th->seq); > =20 > if (SEQ_LE(conn->seq_to_tap, seq)) --=20 David Gibson | 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 --PuNW1JmU/gtX5m3r Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmZhIb0ACgkQzQJF27ox 2Gdi4w//Y4UsfOUUDx8kU9C6O3Lzim1kyzIBYjcWT9ah1G/RB/2gnbWU0UpX+TMn LGngbSE2yPOYp86WsYyp1a0Sv6hFnt7HBC6yImmIJmYn6g0M1Nozke1xxb1a1ciO aqac3q4Zs51sJXfMtx9OSQAPFhwhU7tVZKWgGBoTmBHTnn/nym9wMdwyV9KYbu2u VXXasEktxUcywGN1MKFB7jTHReXUsLKuQIU9m503UWC2ExwZaSbZQmCcxbs0H99J OyQYaD+3DWPlX0NkaLXZo0fu+SXvVGWdbRFStAj4eqz7QNi+yEy1lDQisTpog3GP KqkR7H7oT92nUespJ3hv2m77+MS76ypuISZcqLaKLRiFLHGyQj56xUvz77F0+V6Y kAYFDBXBlaNpauJCqgbhMfebfa4sI1lJNyItGjTLuHiRBog1S48wddrcvVCC6CbD LWPDl7RrMsG8DGzpBwQr/Lw9aFxYZ9RsasavKmJ/yBQIdQUkWu9DZ6PTLPV9PGdc e1FGT6sJnDiMq1qre4JNQGPNVoydihG7tNe4r+NHxt/0TEoKoKIGItPUcJeba6/y Il7HPlQaaaz/J8nls+ZYB9kv49bVrcjFcgY+sQ5xBejQ+0tdI8IG2IafypOhDPDk Mp1Ef/lgGzFkzSfAv7//xfbIQx6ZdI8qXA/KQ5FXg8nGCSATzq0= =C24F -----END PGP SIGNATURE----- --PuNW1JmU/gtX5m3r--