From 594b67df7ca923d13265906a71fbbf748273a5f5 Mon Sep 17 00:00:00 2001 From: Jussi Kukkonen Date: Mon, 23 Jan 2017 17:41:39 +0200 Subject: [PATCH] Fix compile on musl with kernel 4.9 headers Kernel headers break when musl defines IFF_LOWER_UP. While waiting for more proper fix in musl, add a hack to connman. Upstream-Status: Inappropriate [Workaround] Signed-off-by: Jussi Kukkonen Signed-off-by: Maxin B. John --- src/6to4.c | 4 ++++ src/firewall-iptables.c | 4 ++++ src/firewall-nftables.c | 3 +++ src/iptables.c | 4 ++++ 4 files changed, 15 insertions(+) diff --git a/src/6to4.c b/src/6to4.c index 71a2882..1938afb 100644 --- a/src/6to4.c +++ b/src/6to4.c @@ -24,6 +24,10 @@ #include #endif +/* hack to make sure kernel headers understand that libc (musl) + does define IFF_LOWER_UP et al. */ +#define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 0 + #include #include #include diff --git a/src/firewall-iptables.c b/src/firewall-iptables.c index 45943a8..e04bb91 100644 --- a/src/firewall-iptables.c +++ b/src/firewall-iptables.c @@ -23,6 +23,10 @@ #include #endif +/* hack to make sure kernel headers understand that libc (musl) + does define IFF_LOWER_UP et al. */ +#define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 0 + #include #include diff --git a/src/firewall-nftables.c b/src/firewall-nftables.c index 2503ee2..583d1c4 100644 --- a/src/firewall-nftables.c +++ b/src/firewall-nftables.c @@ -30,6 +30,9 @@ #ifdef HAVE_CONFIG_H #include #endif +/* hack to make sure kernel headers understand that libc (musl) + does define IFF_LOWER_UP et al. */ +#define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 0 #include #include diff --git a/src/iptables.c b/src/iptables.c index 82e3ac4..46ad9e2 100644 --- a/src/iptables.c +++ b/src/iptables.c @@ -23,6 +23,10 @@ #include #endif +/* hack to make sure kernel headers understand that libc (musl) + does define IFF_LOWER_UP et al. */ +#define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 0 + #include #include #include -- 2.4.0