coova / coova-chilli

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

openwrt :: option ENABLE_CHILLIREDIR error about USING_IPC_UNIX not set #456

Open keulu opened 6 years ago

keulu commented 6 years ago

well well well

after i patched my files with that patch : https://github.com/coova/coova-chilli/issues/200

chilli failed to compile and say error about USING_IPC_UNIX, so i checked all i can found on openwrt (ipcrm and ipcs busybox (nothing work))

if I hard write it to code in config.h (L 507 after define USING_IPC_MSG 1 just define USING_IPC_UNIX 1), new error : struct redir_t has no member redir_t->msgid

in redir.h L.235:

#if defined(USING_IPC_UNIX)
  int msgfd
#else
  int msgid
#endif

if i switch them, error about msgfd, if i don't touch anything, error about msgid.

so i remove the defined check and declare msgfd and msgid as a part of struct redir_t

coova compile. alleluia

ooooopppps.... no portal anymore.

Tue Oct 9 16:40:50 2018 local6.err coova-chilli[2494]: chilli.c: 7656: 22 (Invalid argument) msgrcv() failed!

so... my changes broke coova. or ipc is missing.

i don't know what to install for using uamregex option. i don't know if this option is working. what is the equivalent of IPC on openwrt ? how coova check this var ? what's the next steps for doing this option work ?

xOneca commented 6 years ago

USING_IPC_MSG should only be defined if you configure with --with-ipc-msg. And if that is not defined, USING_IPC_UNIX will be defined in src/system.h.

What is the exact error the compiler throws?

keulu commented 6 years ago

don't touch anything :

make package/coova-chilli/{clean,compile}
 make[1] package/coova-chilli/clean
 make[2] -C feeds/packages/net/coova-chilli clean
 make[1] package/coova-chilli/compile
 make[2] -C package/libs/toolchain compile
 make[2] -C package/firmware/linux-firmware compile
 make[2] -C package/firmware/prism54-firmware compile
 make[2] -C package/kernel/linux compile
 make[2] -C package/libs/libjson-c compile
 make[2] -C package/network/utils/iptables compile
 make[2] -C package/libs/openssl compile
 make[2] -C feeds/packages/net/coova-chilli compile
make -r package/coova-chilli/compile: build failed. Please re-run make with -j1 V=s to see what's going on
/home/keulu/Work/iwibox/hardware/linksys_wrt1200ac_17.01.2/include/toplevel.mk:198 : la recette pour la cible « package/coova-chilli/compile » a échouée
make: *** [package/coova-chilli/compile] Erreur 1

Error : 

libtool: compile:  mips-openwrt-linux-musl-gcc -DHAVE_CONFIG_H -I. -I.. -I/var/firmware/openwrt/staging_dir/target-mips_34kc_musl-1.1.11/usr/include -I/var/firmware/openwrt/staging_dir/target-mips_34kc_musl-1.1.11/include -I/var/firmware/openwrt/staging_dir/toolchain-mips_34kc_gcc-5.2.0_musl-1.1.11/usr/include -I/var/firmware/openwrt/staging_dir/toolchain-mips_34kc_gcc-5.2.0_musl-1.1.11/include/fortify -I/var/firmware/openwrt/staging_dir/toolchain-mips_34kc_gcc-5.2.0_musl-1.1.11/include -D_GNU_SOURCE -Wall -Werror -fno-builtin -fno-strict-aliasing -O2 -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 -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -mips16 -minterlink-mips16 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -fpic -MT options.lo -MD -MP -MF .deps/options.Tpo -c options.c  -fPIC -DPIC -o .libs/options.o
options.c: In function 'options_fromfd':
options.c:381:48: error: 'regex_t {aka struct re_pattern_buffer}' has no member named 'allocated'
     if (_options.regex_pass_throughs[i].re_host.allocated)
                                                ^
options.c:383:48: error: 'regex_t {aka struct re_pattern_buffer}' has no member named 'allocated'
     if (_options.regex_pass_throughs[i].re_path.allocated)
                                                ^
options.c:385:46: error: 'regex_t {aka struct re_pattern_buffer}' has no member named 'allocated'
     if (_options.regex_pass_throughs[i].re_qs.allocated)

Apply the patch

make V=s package/coova-chilli/compile
[...]
main-redir.c:29:2: error: #error This requires the UNIX IPC method
 #error This requires the UNIX IPC method
  ^
main-redir.c: In function 'sock_redir_getstate':
main-redir.c:170:53: error: 'struct options_t' has no member named 'unixipc'
   statedir_file(filedest, sizeof(filedest), _options.unixipc, "chilli.ipc");

found the exact command from config.log

  $ ./configure --target=arm-openwrt-linux --host=arm-openwrt-linux --build=x86_64-linux-gnu --program-prefix= --program-suffix= --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --libexecdir=/usr/lib --sysconfdir=/etc --datadir=/usr/share --localstatedir=/var --mandir=/usr/man --infodir=/usr/info --enable-chilliquery --enable-leakybucket --enable-uamanyip --enable-uamuiport --enable-accounting-onoff --enable-tap --enable-tcpreset --enable-radproxy --enable-json --enable-debug --enable-dhcpradius --enable-wpad --enable-gardenaccounting --disable-gardenext --disable-inspect --enable-coa --disable-dhcpopt --disable-debug2 --disable-sessgarden --disable-sessproxy --disable-sessdhcp --disable-sessdns --disable-chillixml --disable-proxyvsa --enable-dnslog --disable-ipwhitelist --enable-uamdomainfile --disable-redirdnsreq --enable-ieee8021q --enable-largelimits --with-openssl --without-matrixssl --without-cyassl --without-matrixssl-cli --without-nfqueue --without-avl --with-nfcoova --with-sfhash --without-lookup3 --without-patricia --disable-authedallowed --with-ipv6 --without-pcap --without-curl --without-mmap --without-poll --with-ipc-msg --enable-binstatusfile --enable-statusfile --enable-chilliproxy --enable-multiroute --enable-multilan --disable-chilliradsec --enable-chilliredir --disable-chilliscript --enable-cluster --enable-sessionstate --enable-sessionid --enable-apsessionid --enable-coovachilliconfig --disable-mdns --disable-netbios --enable-ieee8023 --disable-pppoe --disable-l2tpppp --disable-eapol --disable-miniportal --disable-miniconfig --enable-ewtapi --enable-libjson --disable-ssdp --enable-layer3 --disable-modules --disable-extadmvsa --disable-redirinject --disable-netnat --enable-useragent --enable-acceptlanguage --disable-location --disable-forcedns

as you can see in this command, i have : --with-ipc-msg & --enable-chilliredir

and got a same error with : --without-ipc-msg & --enable-chilliredir

in src/options.h L.406

#ifdef USING_IPC_UNIX
  char *unixipc;
#endif

so unixipc is well defined but only if USING_IPC_UNIX definition is set. So i think that definition is never set correctly.