coova / coova-chilli

CoovaChilli is an open-source software access controller for captive portal hotspots.
Other
518 stars 260 forks source link

Chilli not builds for new Kernel #291

Closed alex-eri closed 8 years ago

alex-eri commented 8 years ago
OpenWrt-libtool: compile:  mips-openwrt-linux-musl-gcc -DHAVE_CONFIG_H -I. -I.. -I../json -I/home/eri/openwrt/staging_dir/target-mips_34kc_musl-1.1.15/usr/include -I/home/eri/openwrt/staging_dir/target-mips_34kc_musl-1.1.15/include -I/home/eri/openwrt/staging_dir/toolchain-mips_34kc_gcc-5.3.0_musl-1.1.15/usr/include -I/home/eri/openwrt/staging_dir/toolchain-mips_34kc_gcc-5.3.0_musl-1.1.15/include/fortify -I/home/eri/openwrt/staging_dir/toolchain-mips_34kc_gcc-5.3.0_musl-1.1.15/include -D_GNU_SOURCE -Wall -Werror -fno-builtin -fno-strict-aliasing -fomit-frame-pointer -funroll-loops -pipe -I../bstring -DDEFCHILLICONF=\"/etc/chilli.conf\" -DDEFPIDFILE=\"/var/run/chilli.pid\" -DDEFSTATEDIR=\"/var/run\" -DSBINDIR=\"/usr/sbin\" -Os -pipe -mno-branch-likely -mips32r2 -mtune=34kc -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -mips16 -minterlink-mips16 -iremap /home/eri/openwrt/build_dir/target-mips_34kc_musl-1.1.15/coova-chilli-2016:coova-chilli-2016 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -fpic -MT chilli.lo -MD -MP -MF .deps/chilli.Tpo -c chilli.c  -fPIC -DPIC -o .libs/chilli.o
In file included from /home/eri/openwrt/staging_dir/toolchain-mips_34kc_gcc-5.3.0_musl-1.1.15/include/net/ethernet.h:10:0,
                 from system.h:173,
                 from chilli.h:24,
                 from chilli.c:21:
/home/eri/openwrt/staging_dir/toolchain-mips_34kc_gcc-5.3.0_musl-1.1.15/include/netinet/if_ether.h:97:8: error: redefinition of 'struct ethhdr'
 struct ethhdr {
        ^
In file included from system.h:124:0,
                 from chilli.h:24,
                 from chilli.c:21:
/home/eri/openwrt/staging_dir/toolchain-mips_34kc_gcc-5.3.0_musl-1.1.15/include/linux/if_ether.h:140:8: note: originally defined here
 struct ethhdr {
        ^
Makefile:936: recipe for target 'chilli.lo' failed
nzamps commented 8 years ago

Try patching system.h:

--- a/src/system.h
+++ b/src/system.h
@@ -117,18 +117,6 @@
 #include <inttypes.h>
 #endif

-#if defined(__linux__)
-#include <asm/types.h>
-#include <linux/if.h>
-#include <linux/if_packet.h>
-#include <linux/if_ether.h>
-#include <linux/if_tun.h>
-#include <linux/netlink.h>
-#include <linux/rtnetlink.h>
-#ifndef HAVE_SYS_UN_H
-#include <linux/un.h>
-#endif
-
 #ifdef HAVE_SYS_SYSINFO_H
 #include <sys/sysinfo.h>
 #else
@@ -244,6 +232,20 @@
 #include <unistd.h>
 #include <errno.h>

+#if defined(__linux__)
+#include <asm/types.h>
+#include <linux/if.h>
+#include <linux/if_packet.h>
+#include <linux/if_ether.h>
+#include <linux/if_tun.h>
+#include <linux/netlink.h>
+#include <linux/rtnetlink.h>
+#include <linux/if_vlan.h>
+#include <linux/sockios.h>
+#ifndef HAVE_SYS_UN_H
+#include <linux/un.h>
+#endif
+
 int safe_accept(int fd, struct sockaddr *sa, socklen_t *lenptr);
 int safe_select(int nfds, fd_set *readfds, fd_set *writefds,
        fd_set *exceptfds, struct timeval *timeout);
alex-eri commented 8 years ago
*** src/system.h~   2016-09-26 21:27:12.000000000 +0300
--- src/system.h    2016-10-13 02:46:26.996070770 +0300
***************
*** 121,127 ****
--- 121,129 ----
  #include <asm/types.h>
  #include <linux/if.h>
  #include <linux/if_packet.h>
+ #ifndef _UAPI_LINUX_IF_ETHER_H
  #include <linux/if_ether.h>
+ #endif
  #include <linux/if_tun.h>
  #include <linux/netlink.h>
  #include <linux/rtnetlink.h>
***************
*** 169,175 ****
  #include <net/if_tun.h>
  #endif

! #ifdef HAVE_NET_ETHERNET_H
  #include <net/ethernet.h>
  #endif

--- 171,177 ----
  #include <net/if_tun.h>
  #endif

! #if defined(HAVE_NET_ETHERNET_H) && !defined(__linux__)
  #include <net/ethernet.h>
  #endif

Patched in this way chilli builds, but no iptables exten in build dir...

wait... module exist at another dir.. no /usr/lib/iptables/lib* , but xtables in /lib exists

alex-eri commented 8 years ago

@nzamps tryed yours. Now many errors with linux/if.h