Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <c2673fb5-763d-4925-8592-426b7be7c780@windriver.com>
Date: Wed, 15 Oct 2025 11:31:45 +0800
From: ChenQi <Qi.Chen@...driver.com>
To: Rich Felker <dalias@...c.org>
Cc: "musl@...ts.openwall.com" <musl@...ts.openwall.com>
Subject: Re: [PATCH 2/2] include/netinet/if_ether.h: guard ethhdr
 definition to better work with other header files

On 10/15/25 00:53, Rich Felker wrote:
> On Thu, Oct 09, 2025 at 02:53:13AM +0000, Chen, Qi wrote:
>> Hi Rich,
>>
>> The problem is about the re-definition of 'struct ethhdr'.
>>
>> For example, a header also defines 'struct ethhdr' and
>> __UAPI_DEF_ETHHDR, and it's included *before* our
>> <netinet/if_ether.h>, then the unconditional definition of 'struct
>> ethhdr' in this header will be treated as an error.
>>
>> Some background info:
>> I was making systemd to compile with musl. I got this re-definition
>> error. I checked the headers and thought that for different headers
>> to work together, the definition of this 'struct ethhdr' needs to be
>> guarded by the same macro.
> It's intentional that we don't support getting definitions for the
> libc types from kernel headers. They may have subtle mismatches that
> could break things. For example some types in the kernel are
> known-wrong, like struct msghdr, and others have members that are the
> same size/representation but different type (like long long vs
> int64_t).
>
> For the most part conflicting kernel headers shouldn't be used in
> userspace. In cases where they should/need to be used, they should be
> used either in separate translation units or included after the libc
> headers.
>
> This is documented in the original commit which added the __UAPI
> macros, 04983f2272382af92eb8f8838964ff944fbb8258.
>
> Rich

Thanks a lot for the information.

I'll drop this patch and fix things in systemd recipe in Yocto.

Regards,
Qi

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.