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=202410 header.b=RheTgfzO; dkim-atps=neutral Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id C77AB5A004E for ; Sat, 02 Nov 2024 04:31:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202410; t=1730518274; bh=gzWzuUCNsuQp3t1AGcHzxkbdkEs2ljmSNyYdMh4W+Cw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=RheTgfzO4J01vn2AIFVRwi5nBkKst0Mkb6qXOJUzTii34jPiLHjzwiHGoFoy2xUM1 joqq8+P6x5frAOdPL+MDxfxLNcdEsgO4cGXEXHfoY0QTzqWC5kAmM9D5dqmFdQDnaz X3WN0rd7gjxrQnEVAZipnM64/o4cVxQloqc5y2GaCER2yofw7/5QE71Hn5VxDMn0Sn VlyyEy1j1yssrCwkhx5hQZBNl52WWct9QlkxP9XG4Hu4TSB3Lllt3fRwT3pC5Qf8xX dXPzHRg95FU13UYKGV+9PQFnCMe+oF2AaZa9U/1a67yv8WLy+AGfEcoe+rqAgRnhTO fHKuia0CrWKDQ== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4XgNYZ0y7Mz4x2g; Sat, 2 Nov 2024 14:31:14 +1100 (AEDT) Date: Sat, 2 Nov 2024 14:29:07 +1100 From: David Gibson To: Stefano Brivio Subject: Re: [PATCH v2] tcp: Fix build against musl, __sum16 comes from linux/types.h Message-ID: References: <20241031071432.536227-1-sbrivio@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="MdQd1ryNVXUj5SQu" Content-Disposition: inline In-Reply-To: <20241031071432.536227-1-sbrivio@redhat.com> Message-ID-Hash: NPWGHUBDGHVPXZDINKX3THHAL2VNZYCW X-Message-ID-Hash: NPWGHUBDGHVPXZDINKX3THHAL2VNZYCW 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, Laurent Vivier , omni 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: --MdQd1ryNVXUj5SQu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Oct 31, 2024 at 08:14:32AM +0100, Stefano Brivio wrote: > Use a plain uint16_t instead and avoid including one extra header: > the 'bitwise' attribute of __sum16 is just used by sparse(1). >=20 > Reported-by: omni > Fixes: 3d484aa37090 ("tcp: Update TCP checksum using an iovec array") > Signed-off-by: Stefano Brivio Reviewed-by: David Gibson > --- > v2: Use uint16_t instead of including linux/types.h >=20 > tcp.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) >=20 > diff --git a/tcp.c b/tcp.c > index 4e0a17e..56ceba6 100644 > --- a/tcp.c > +++ b/tcp.c > @@ -766,7 +766,7 @@ static void tcp_update_check_tcp4(const struct iphdr = *iph, > struct in_addr saddr =3D { .s_addr =3D iph->saddr }; > struct in_addr daddr =3D { .s_addr =3D iph->daddr }; > size_t check_ofs; > - __sum16 *check; > + uint16_t *check; > int check_idx; > uint32_t sum; > char *ptr; > @@ -797,7 +797,7 @@ static void tcp_update_check_tcp4(const struct iphdr = *iph, > return; > } > =20 > - check =3D (__sum16 *)ptr; > + check =3D (uint16_t *)ptr; > =20 > *check =3D 0; > *check =3D csum_iov(iov, iov_cnt, l4offset, sum); > @@ -816,7 +816,7 @@ static void tcp_update_check_tcp6(const struct ipv6hd= r *ip6h, > { > uint16_t l4len =3D ntohs(ip6h->payload_len); > size_t check_ofs; > - __sum16 *check; > + uint16_t *check; > int check_idx; > uint32_t sum; > char *ptr; > @@ -848,7 +848,7 @@ static void tcp_update_check_tcp6(const struct ipv6hd= r *ip6h, > return; > } > =20 > - check =3D (__sum16 *)ptr; > + check =3D (uint16_t *)ptr; > =20 > *check =3D 0; > *check =3D csum_iov(iov, iov_cnt, l4offset, sum); --=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 --MdQd1ryNVXUj5SQu Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmclnHQACgkQzQJF27ox 2GfwgA/8DzO8rXOWVyBCItzjPyZpDoVjKIQ6Q7HHAUvpLN8eHrryY7V2U0jmtKuu Bv1lMErTTI+LHOYo8j0ixI8WTNjEcmkGLWU3KnLMSyNektep70qVETAGsjLa6v1/ bJM33r1dbjXWibPw+R8HXPsJmSJEe8hcNHtKunhfFAAf3vJsc6KvPK1fpQ+/1c/X 9qfXCZlnmkpS++GSsaPqP3dE7zNRffg7FgDAaDbRuk8pl4+8TLDFH94PiZTOidp8 c5VMwKK29gAz/FAJenA27ZExNQYlCHbsTYfZEaLOKkrSbgsmUTANbusStDIBWHaz mdoYDg74dme8mh/cYyAZ6br1gXuSYjr2b3BqDd8AiR9EyWoUg84M+Dv25VYYm/VQ S00EIcZrX4CmPF9MPmmMTer2ffQ/JIyi5XPz3w9yfKXPytN/EG/4Uv6p6lkoUS9z bAqKVJ9BReMR21VxIjNhrZ8lHpE3TSxDB3XZSbt9kBtqFWvjBvCuvhZczPSoV8WT zbwD+5TZiRkqHoRoq98Qbz4My1fG6vj+Tjrk8MCsA4skhJbteA4O19+4DBvTjw2r Y4qKwdf3aHE6Gn+rsi5zUi9IdbKHtPnIRKd+FkPCfbkEWcHaVMpddCD9kynAECpO 1kBkpgdYpcV+YkUeJqpJYfMO2+9kpSVQYyAM6nl5xYMEhP6Awj0= =cAEr -----END PGP SIGNATURE----- --MdQd1ryNVXUj5SQu--