coova / coova-chilli

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

Comiple Error Ubuntu 19.10 #501

Open NielCybersense opened 4 years ago

NielCybersense commented 4 years ago

Hi Im new to all of this and im trying to setup coovachilli on Ubuntu 19.10 and get the following:

make  all-recursive
make[1]: Entering directory '/root/coova-chilli'
Making all in bstring
make[2]: Entering directory '/root/coova-chilli/bstring'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/root/coova-chilli/bstring'
Making all in src
make[2]: Entering directory '/root/coova-chilli/src'
make[3]: Entering directory '/root/coova-chilli/src'
depbase=`echo chilli.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
/bin/bash ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. -I../json    -D_GNU_SOURCE -Wall -Werror -fno-builtin -fno-strict-aliasing -fomit-frame-pointer -funroll-loops -pipe -I../bstring -DDEFCHILLICONF='"/usr/etc/chilli.conf"' -DDEFPIDFILE='"/usr/var/run/chilli.pid"' -DDEFSTATEDIR='"/usr/var/run"' -DSBINDIR='"/usr/sbin"'    -g -O2 -MT chilli.lo -MD -MP -MF $depbase.Tpo -c -o chilli.lo chilli.c &&\
mv -f $depbase.Tpo $depbase.Plo
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I../json -D_GNU_SOURCE -Wall -Werror -fno-builtin -fno-strict-aliasing -fomit-frame-pointer -funroll-loops -pipe -I../bstring -DDEFCHILLICONF=\"/usr/etc/chilli.conf\" -DDEFPIDFILE=\"/usr/var/run/chilli.pid\" -DDEFSTATEDIR=\"/usr/var/run\" -DSBINDIR=\"/usr/sbin\" -g -O2 -MT chilli.lo -MD -MP -MF .deps/chilli.Tpo -c chilli.c  -fPIC -DPIC -o .libs/chilli.o
chilli.c: In function ‘leaky_bucket’:
chilli.c:647:30: error: taking address of packed member of ‘struct session_state’ may result in an unaligned pointer value [-Werror=address-of-packed-member]
  647 |   timediff = mainclock_diffd(&conn->s_state.last_bw_time);
      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~
chilli.c: In function ‘uam_msg’:
chilli.c:6077:34: error: taking address of packed member of ‘struct redir_msg_data’ may result in an unaligned pointer value [-Werror=address-of-packed-member]
 6077 |   if (ippool_getip(ippool, &ipm, &msg->mdata.address.sin_addr)) {
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
chilli.c: In function ‘find_app_conn’:
chilli.c:6201:38: error: taking address of packed member of ‘struct cmdsock_request’ may result in an unaligned pointer value [-Werror=address-of-packed-member]
 6201 |     appconn = dhcp_get_appconn_ip(0, &req->ip);
      |                                      ^~~~~~~~
chilli.c: In function ‘redir_msg’:
chilli.c:7125:10: error: taking address of packed member of ‘struct redir_msg_data’ may result in an unaligned pointer value [-Werror=address-of-packed-member]
 7125 |          &msg.mdata.address,
      |          ^~~~~~~~~~~~~~~~~~
chilli.c:7126:10: error: taking address of packed member of ‘struct redir_msg_data’ may result in an unaligned pointer value [-Werror=address-of-packed-member]
 7126 |          &msg.mdata.baddress,
      |          ^~~~~~~~~~~~~~~~~~~
In file included from /usr/include/string.h:494,
                 from system.h:31,
                 from chilli.h:24,
                 from chilli.c:21:
In function ‘strncpy’,
    inlined from ‘cb_radius_auth_conf’ at chilli.c:4618:4:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:10: error: ‘__builtin___strncpy_chk’ output may be truncated copying between 0 and 29 bytes from a string of length 252 [-Werror=stringop-truncation]
  106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[3]: *** [Makefile:968: chilli.lo] Error 1
make[3]: Leaving directory '/root/coova-chilli/src'
make[2]: *** [Makefile:1011: all-recursive] Error 1
make[2]: Leaving directory '/root/coova-chilli/src'
make[1]: *** [Makefile:417: all-recursive] Error 1
make[1]: Leaving directory '/root/coova-chilli'
make: *** [Makefile:345: all] Error 2
ghaberek commented 4 years ago

I think these are more related to new default warnings in recent versions of GCC.

You can pass "no-" options in via CFLAGS to ignore these errors:

make CFLAGS="-Wno-error=stringop-truncation -Wno-error=address-of-packed-member"
Madcat148 commented 3 years ago

I think these are more related to new default warnings in recent versions of GCC.

You can pass "no-" options in via CFLAGS to ignore these errors:

make CFLAGS="-Wno-error=stringop-truncation -Wno-error=address-of-packed-member"

Works for Ubuntu Server 20.04.1 LTS