Re: [OpenWrt-Devel] [PATCH RFC firewall3] musl-compat: avoid kernel header conflicts
On Mon, 7 Nov 2016 07:39:19 +0100 Ralph Sennhauserwrote: > On Sun, 6 Nov 2016 19:07:01 +0100 > Szabolcs Nagy wrote: > > > * Ralph Sennhauser [2016-11-06 10:59:43 > > +0100]: > > > 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. > > > > can you check if > > http://www.openwall.com/lists/musl/2016/10/18/1 > > works for you? > > Hi > > That is an interesting find. It won't be able to magically fix all the > packages but could help a lot in fixing them in a cleaner manner. Will > take me a while to have a in depth look at this one and it's impact. > Thou as it's suggested by Rich Felker I guess investing some of my > time wont be wasted. > > Thanks > Ralph Hi, Tested musl commit 04983f227238 (make netinet/in.h suppress clashing definitions from kernel headers) and a patch by Felix Janda https://lkml.org/lkml/2016/11/11/210 . This fixes arptables and conntrack-tools for kernels 4.8 and later. For netifd, ebtables and ppp this fixes the netinet/in.h related issues without reordering of any headers. Ralph ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH RFC firewall3] musl-compat: avoid kernel header conflicts
On Sun, 6 Nov 2016 19:07:01 +0100 Szabolcs Nagywrote: > * Ralph Sennhauser [2016-11-06 10:59:43 > +0100]: > > 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. > > can you check if > http://www.openwall.com/lists/musl/2016/10/18/1 > works for you? Hi That is an interesting find. It won't be able to magically fix all the packages but could help a lot in fixing them in a cleaner manner. Will take me a while to have a in depth look at this one and it's impact. Thou as it's suggested by Rich Felker I guess investing some of my time wont be wasted. Thanks Ralph ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH RFC firewall3] musl-compat: avoid kernel header conflicts
Hi Jo On Sun, 6 Nov 2016 20:48:58 +0100 Jo-Philipp Wichwrote: > Hi again, > > > Will see if I find another solution... > > I managed to find a solution that works for me on a Linux 4.6.0 system > with glibc, a Linux 4.6.0 system with unpatched musl and a Linux 4.4 > system with patched kernel headers. > Well, this doesn't make it less dubious of a hack but as I'm the one who ultimately suggested such no complaints from me. Thanks for making it glibc compatible. > I pushed this change along with a few others that should aid in > portability to the repository now. > > Feedback appreciated. > > ~ Jo About xt_id, that's how I'd have done it from the start, so thumbs up on that one. Even less vendor lock-in. In fact after the last weeks changes you can take firewall3 to pretty much any Linux distro and it still be useful, well, while iptables still lasts that is. Ralph ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH RFC firewall3] musl-compat: avoid kernel header conflicts
Hi again, > Will see if I find another solution... I managed to find a solution that works for me on a Linux 4.6.0 system with glibc, a Linux 4.6.0 system with unpatched musl and a Linux 4.4 system with patched kernel headers. I pushed this change along with a few others that should aid in portability to the repository now. Feedback appreciated. ~ Jo ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH RFC firewall3] musl-compat: avoid kernel header conflicts
* Ralph Sennhauser[2016-11-06 10:59:43 +0100]: > 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. can you check if http://www.openwall.com/lists/musl/2016/10/18/1 works for you? ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH RFC firewall3] musl-compat: avoid kernel header conflicts
Hi Ralph, unfortunately this breaks building on a glibc system for me: -- 8< -- $ make [ 7%] Building C object CMakeFiles/firewall3.dir/iptables.c.o In file included from /usr/include/linux/netfilter_ipv4.h:8:0, from /usr/include/linux/netfilter_ipv4/ip_tables.h:21, from /usr/include/libiptc/libiptc.h:12, from /home/jow/devel/firewall3.git/iptables.h:29, from /home/jow/devel/firewall3.git/iptables.c:19: /usr/include/linux/netfilter.h:75:18: error: field ‘in6’ has incomplete type struct in6_addr in6; ^~~ In file included from /usr/include/libiptc/libip6tc.h:12:0, from /home/jow/devel/firewall3.git/iptables.h:30, from /home/jow/devel/firewall3.git/iptables.c:19: /usr/include/linux/netfilter_ipv6/ip6_tables.h:63:18: error: field ‘src’ has incomplete type struct in6_addr src, dst; ^~~ /usr/include/linux/netfilter_ipv6/ip6_tables.h:63:23: error: field ‘dst’ has incomplete type struct in6_addr src, dst; ^~~ /usr/include/linux/netfilter_ipv6/ip6_tables.h:65:18: error: field ‘smsk’ has incomplete type struct in6_addr smsk, dmsk; ^~~~ /usr/include/linux/netfilter_ipv6/ip6_tables.h:65:24: error: field ‘dmsk’ has incomplete type struct in6_addr smsk, dmsk; ^~~~ In file included from /home/jow/devel/firewall3.git/iptables.h:38:0, from /home/jow/devel/firewall3.git/iptables.c:19: /home/jow/devel/firewall3.git/options.h:182:19: error: field ‘v6’ has incomplete type struct in6_addr v6; ^~ /home/jow/devel/firewall3.git/options.h:187:19: error: field ‘v6’ has incomplete type struct in6_addr v6; ^~ /home/jow/devel/firewall3.git/iptables.c: In function ‘rule_print6’: /home/jow/devel/firewall3.git/iptables.c:1131:48: error: invalid application of ‘sizeof’ to incomplete type ‘struct in6_addr’ if (memcmp(>ipv6.src, _any, sizeof(struct in6_addr))) ^~ /home/jow/devel/firewall3.git/iptables.c:1141:48: error: invalid application of ‘sizeof’ to incomplete type ‘struct in6_addr’ if (memcmp(>ipv6.dst, _any, sizeof(struct in6_addr))) ^~ CMakeFiles/firewall3.dir/build.make:350: recipe for target 'CMakeFiles/firewall3.dir/iptables.c.o' failed make[2]: *** [CMakeFiles/firewall3.dir/iptables.c.o] Error 1 CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/firewall3.dir/all' failed make[1]: *** [CMakeFiles/firewall3.dir/all] Error 2 Makefile:127: recipe for target 'all' failed make: *** [all] Error 2 -- >8 -- It seems that glibc stops declaring "struct in6_addr" itself as soon as one of "_UAPI_LINUX_IN6_H", "_UAPI_IPV6_H", "_LINUX_IN6_H" or "_IPV6_H" is defined and the kernel obviously does not define that struct either if its own guard is defined. Will see if I find another solution... ~ Jo ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel