summaryrefslogtreecommitdiff
path: root/packages/net-misc/dhcpcd/files/a7dccb87f6bcd7e59b29e96d0d554448e8462d25.patch
blob: 185f00c455629b004bd200971dbd1f04501d2cc9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
From a7dccb87f6bcd7e59b29e96d0d554448e8462d25 Mon Sep 17 00:00:00 2001
From: Peter Bui <pbui@nd.edu>
Date: Sat, 19 Oct 2019 10:20:38 -0400
Subject: [PATCH] Fix building on systems with musl
Upstream: Yes, https://github.com/rsmarples/dhcpcd/commit/91792b015b249d0a3e229c3b56586c378cf9fe90

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.
---
 src/if-linux.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/if-linux.c b/src/if-linux.c
index fd472785..218335ee 100644
--- a/src/if-linux.c
+++ b/src/if-linux.c
@@ -46,7 +46,11 @@
 
 #include <arpa/inet.h>
 #include <net/if.h>
+#if defined(__GLIBC__)
 #include <netinet/if_ether.h>
+#else
+#include <linux/if_arp.h>
+#endif
 #include <netinet/in_systm.h>
 #include <netinet/in.h>
 #include <net/route.h>