On Mon, Aug 19, 2024 at 07:24:06PM +0200, Pablo Neira Ayuso wrote: > On Tue, Jul 09, 2024 at 01:05:45PM +0000, Joshua Lant wrote: > > Error compiling with musl-libc: > > The commit hash 810f8568f44f5863c2350a39f4f5c8d60f762958 introduces the > > netinet/ether.h header into xtables.h, which causes an error due to the > > redefinition of the ethhdr struct, defined in linux/if_ether.h and > > netinet/ether.h. > > > > This is is a known issue with musl-libc, with kernel headers providing > > guards against this happening when glibc is used: > > https://wiki.musl-libc.org/faq (Q: Why am I getting “error: redefinition > > of struct ethhdr/tcphdr/etc”?) > > > > The only value used from netinet/ether.h is ETH_ALEN, which is already set > > manually in libxtables/xtables.c. Move this definition to the header and > > eliminate the inclusion of netinet/if_ether.h. > > Any chance that musl headers are being used so this can be autodetected? > Then, no option to pass -D__UAPI_DEF_ETHHDR=0 is required. To clarify, what I mean is if it is possible to autodetect that musl headers are used, then add this definition. I'd prefer no new --option as you propose is required to handle this.