blob: bf3b86d863c9a0884ae614bec907a91c819698f6 [file] [log] [blame]
Brad Bishop6e60e8b2018-02-01 10:27:11 -05001From c8bfad4ee9d2c505c00ccbb8b2139543b5ad6fcb Mon Sep 17 00:00:00 2001
2From: Jussi Kukkonen <jussi.kukkonen@intel.com>
3Date: Mon, 23 Jan 2017 17:41:39 +0200
4Subject: [PATCH] Fix compile on musl with kernel 4.9 headers
5
6Kernel headers break when musl defines IFF_LOWER_UP. While
7waiting for more proper fix in musl, add a hack to connman.
8
9Upstream-Status: Inappropriate [Workaround]
10Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
11---
12 src/6to4.c | 4 ++++
13 src/firewall.c | 4 ++++
14 src/iptables.c | 4 ++++
15 3 files changed, 12 insertions(+)
16
17diff --git a/src/6to4.c b/src/6to4.c
18index 71a2882..1938afb 100644
19--- a/src/6to4.c
20+++ b/src/6to4.c
21@@ -24,6 +24,10 @@
22 #include <config.h>
23 #endif
24
25+/* hack to make sure kernel headers understand that libc (musl)
26+ does define IFF_LOWER_UP et al. */
27+#define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 0
28+
29 #include <errno.h>
30 #include <stdio.h>
31 #include <stdlib.h>
32diff --git a/src/firewall.c b/src/firewall.c
33index c440df6..c83def9 100644
34--- a/src/firewall.c
35+++ b/src/firewall.c
36@@ -23,6 +23,10 @@
37 #include <config.h>
38 #endif
39
40+/* hack to make sure kernel headers understand that libc (musl)
41+ does define IFF_LOWER_UP et al. */
42+#define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 0
43+
44 #include <errno.h>
45
46 #include <xtables.h>
47diff --git a/src/iptables.c b/src/iptables.c
48index 82e3ac4..46ad9e2 100644
49--- a/src/iptables.c
50+++ b/src/iptables.c
51@@ -23,6 +23,10 @@
52 #include <config.h>
53 #endif
54
55+/* hack to make sure kernel headers understand that libc (musl)
56+ does define IFF_LOWER_UP et al. */
57+#define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 0
58+
59 #include <getopt.h>
60 #include <stdlib.h>
61 #include <stdio.h>
62--
632.1.4
64