[LEDE-DEV] [PATCH RFC firewall3] musl-compat: avoid kernel header conflicts

Ralph Sennhauser ralph.sennhauser at gmail.com
Sun Nov 6 01:59:43 PST 2016


The conflict between Musls net/if.h and linux/if.h is an old well known
one and taken care of by a series of linux-headers patches in OpenWrt.
Since Linux 4.8-rc5 Firewall3 also indirectly pulls in linux/in.h and
linux/in6.h leading to new conflicts.

As Firewall3 is fine with just the libc headers prevent inclusion of the
corresponding kernel headers.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser at gmail.com>
---

Jo,

this certainly isn't the most elegant solution but at least it's immediately
obvious what it is about.

Firewall3 is one of only a few remaining packages still having issues with Musl
and vanilla kernel and apart from netifd the only significant one in base. So
fixing this issue one way or another is desirable.

This is also the last issue that needs to be addressed for me to run vanilla
Firewall3 again.

Ralph


 iptables.h | 3 +++
 options.h  | 2 ++
 2 files changed, 5 insertions(+)

diff --git a/iptables.h b/iptables.h
index bcd302d..8e0089e 100644
--- a/iptables.h
+++ b/iptables.h
@@ -19,6 +19,9 @@
 #ifndef __FW3_IPTABLES_H
 #define __FW3_IPTABLES_H
 
+#define _LINUX_IF_H
+#define _LINUX_IN_H
+#define _LINUX_IN6_H
 #include <libiptc/libiptc.h>
 #include <libiptc/libip6tc.h>
 #include <xtables.h>
diff --git a/options.h b/options.h
index 6c9c0b2..307c5af 100644
--- a/options.h
+++ b/options.h
@@ -32,6 +32,8 @@
 #include <netdb.h>
 #include <arpa/inet.h>
 #include <sys/socket.h>
+#define _LINUX_IN_H
+#define _LINUX_IN6_H
 #include <netinet/in.h>
 #include <netinet/ether.h>
 
-- 
2.7.3




More information about the Lede-dev mailing list