···
1
-
http://www.openwall.com/lists/musl/2018/01/06/3
3
-
Date: Sat, 6 Jan 2018 23:32:52 +0100
4
-
From: Hauke Mehrtens <hauke@...ke-m.de>
5
-
To: musl@...ts.openwall.com
6
-
Cc: felix.janda@...teo.de,
7
-
Hauke Mehrtens <hauke@...ke-m.de>
8
-
Subject: [PATCH v2] Add additional uapi guards for Linux kernel header files
10
-
With Linux kernel 4.16 it will be possible to guard more parts of the
11
-
Linux header files from a libc. Make use of this in musl to guard all
12
-
the structures and other definitions from the Linux header files which
13
-
are also defined by the header files provided by musl. This will make
14
-
musl compile with the unmodified Linux kernel user space headers.
16
-
This extends the definitions done in commit 04983f227238 ("make
17
-
netinet/in.h suppress clashing definitions from kernel headers")
19
-
The needed patches were recently accepted into the netdev tree and will be integrated in Linux 4.16:
20
-
https://patchwork.ozlabs.org/patch/854342/
21
-
https://patchwork.ozlabs.org/patch/855293/
23
-
include/net/if.h | 7 +++++++
24
-
include/netinet/if_ether.h | 1 +
25
-
include/sys/xattr.h | 2 ++
26
-
3 files changed, 10 insertions(+)
28
-
diff --git a/include/net/if.h b/include/net/if.h
29
-
index 2f2fcc10..0ee48cd7 100644
30
-
--- a/include/net/if.h
31
-
+++ b/include/net/if.h
32
-
@@ -125,6 +125,13 @@ struct ifconf {
33
-
#define ifc_req ifc_ifcu.ifcu_req
34
-
#define _IOT_ifconf _IOT(_IOTS(struct ifconf),1,0,0,0,0)
36
-
+#define __UAPI_DEF_IF_IFCONF 0
37
-
+#define __UAPI_DEF_IF_IFMAP 0
38
-
+#define __UAPI_DEF_IF_IFNAMSIZ 0
39
-
+#define __UAPI_DEF_IF_IFREQ 0
40
-
+#define __UAPI_DEF_IF_NET_DEVICE_FLAGS 0
41
-
+#define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 0
46
-
diff --git a/include/netinet/if_ether.h b/include/netinet/if_ether.h
47
-
index d9a131aa..c2c6e944 100644
48
-
--- a/include/netinet/if_ether.h
49
-
+++ b/include/netinet/if_ether.h
50
-
@@ -133,5 +133,6 @@ do { \
51
-
(enaddr)[5] = ((uint8_t *)ipaddr)[3]; \
54
-
+#define __UAPI_DEF_ETHHDR 0
57
-
diff --git a/include/sys/xattr.h b/include/sys/xattr.h
58
-
index 6479fcc6..52e3dd89 100644
59
-
--- a/include/sys/xattr.h
60
-
+++ b/include/sys/xattr.h
61
-
@@ -24,6 +24,8 @@ int removexattr(const char *, const char *);
62
-
int lremovexattr(const char *, const char *);
63
-
int fremovexattr(int, const char *);
65
-
+#define __UAPI_DEF_XATTR 0