Skip to contentSkip to conversation

dhcp: include if_arp.h from libc instead of linux headers

PATCH Applied Martin Hundebøll 2 participants 2 messages Jul 12, 2018

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 dhcp: include if_arp.h from libc instead of linux headers

Compilation with musl libc fails due to redefinition of 'struct arp{req,req_old,hdr}' in linux/if_arp.h, since it is already defined and included in net/if_arp.h (through net/ethernet.h -> net/if_ether.h).

The only symbols used from if_arp.h is ARPHRD_ETHER, so it should be safe to avoid the compile error by including the if_arp.h header from the c-library instead.

---

Changes in v2:
- Rebased on master
- Removed signed-of-by

 ell/dhcp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
ell/dhcp.c +1 -1
index 6c90370..0d99f74 100644
@@ -27,7 +27,7 @@
 #include <netinet/ip.h>
 #include <net/ethernet.h>
 #include <linux/types.h>
-#include <linux/if_arp.h>
+#include <net/if_arp.h>
 #include <errno.h>
 #include <time.h>
 
Signature · 1 line
2.18.0
#1 lore raw

Hi Martin,

Quoted 8 lines · Martin Hundebøll

Compilation with musl libc fails due to redefinition of 'struct arp{req,req_old,hdr}' in linux/if_arp.h, since it is already defined and included in net/if_arp.h (through net/ethernet.h -> net/if_ether.h).

The only symbols used from if_arp.h is ARPHRD_ETHER, so it should be safe to avoid the compile error by including the if_arp.h header from the c-library instead.

Applied, thanks.

Regards,
-Denis