From: Stefano Brivio <sbrivio@redhat.com>
To: David Gibson <david@gibson.dropbear.id.au>
Cc: passt-dev@passt.top, Laurent Vivier <lvivier@redhat.com>,
omni <omni+alpine@hack.org>
Subject: Re: [PATCH] tcp: Fix build against musl, __sum16 comes from linux/types.h
Date: Thu, 31 Oct 2024 07:56:06 +0100 [thread overview]
Message-ID: <20241031075606.7d89109d@elisabeth> (raw)
In-Reply-To: <ZyLQnqzF954qo5Ms@zatzit>
On Thu, 31 Oct 2024 11:34:38 +1100
David Gibson <david@gibson.dropbear.id.au> wrote:
> On Wed, Oct 30, 2024 at 09:50:10PM +0100, Stefano Brivio wrote:
> > ...so we need to include that header explicitly. For some reason, it
> > works without it when building against glibc.
>
> Presumably because glibc indirectly imports linux/types.h at some
> point.
>
> But, I think there's a better way to fix this. We use __sum16 because
> it's the type of the checksum field in the linux/tcp.h version of
> struct tcphdr. But we've recently changed to using the netinet/tcp.h
> version, which just uses a plain uint16_t. We should change to match,
> and this will go away.
True, but I thought we would want to keep the 'bitwise' attribute that
comes with __sum16. On the other hand, I see it's only used by
sparse(1), not by gcc itself:
https://gcc.gnu.org/legacy-ml/gcc-help/2008-03/msg00267.html
so it's rather pointless outside the kernel and we can drop it as well.
I'll change checksum pointers to uint16_t *.
--
Stefano
prev parent reply other threads:[~2024-10-31 6:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-30 20:50 [PATCH] tcp: Fix build against musl, __sum16 comes from linux/types.h Stefano Brivio
2024-10-31 0:34 ` David Gibson
2024-10-31 6:56 ` Stefano Brivio [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241031075606.7d89109d@elisabeth \
--to=sbrivio@redhat.com \
--cc=david@gibson.dropbear.id.au \
--cc=lvivier@redhat.com \
--cc=omni+alpine@hack.org \
--cc=passt-dev@passt.top \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://passt.top/passt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).