From: Peter Bui Date: Sun, 20 Oct 2019 21:15:08 +0000 (-0400) Subject: Fix building on systems with musl (#10) X-Git-Tag: v8.1.2~46 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=73e19e9886f1e2493d049327a5c853cd975d5a7d;p=thirdparty%2Fdhcpcd.git Fix building on systems with musl (#10) musl has its own definition of struct ethhdr, so only include netinet/if_ether.h on systems with GLIBC. For the ARPHDR constants, we must include linux/if_arp.h instead. --- diff --git a/src/if-linux.c b/src/if-linux.c index fd472785..3ee6c5c9 100644 --- a/src/if-linux.c +++ b/src/if-linux.c @@ -46,11 +46,19 @@ #include #include -#include #include #include #include +/* musl has its own definition of struct ethhdr, so only include + * netinet/if_ether.h on systems with GLIBC. For the ARPHRD constants, + * we must include linux/if_arp.h instead. */ +#if defined(__GLIBC__) +#include +#else +#include +#endif + #include #include #include