ipt-netflow
ipt-netflow copied to clipboard
Compile error for 4.14 (on MIPS)
It compiles fine in master branch at 5f188b7b4b0dfc9b9b4445700ad02d0078198bb7 but we get a compile error using master branch as 6a55739a9bf9fb890dbd1aa338057f394b766ab8
# ./configure --kdir=/tmp/kernel --ipt-bin=/tmp/vroot/sbin/iptables --ipt-lib=/tmp/vroot/lib/xtables --ipt-inc=/tmp/vroot/include --enable-natevents --enable-snmp-rules --enable-macaddress --enable-vlan --enable-direction --enable-sampler --enable-sampler=hash --enable-rand-tpl-id --enable-aggregation --enable-physdev && make ARCH=mips CROSS_COMPILE=$ARCH-linux-gnu- all
Module version: 2.6-4-g9ed5788
Kernel version: 4.14.54-UBNT (sources)
Kernel sources: /tmp/kernel (requested)
Checking for presence of include/linux/netfilter.h... Yes
netfilter.h uses CONFIG_NF_NAT_NEEDED... Yes
Checking for presence of include/linux/llist.h... Yes
Checking for presence of include/linux/grsecurity.h... No
Iptables binary version: 1.4.21 (detected from /tmp/vroot/sbin/iptables)
pkg-config for version 1.4.21 exists: No
Check for working gcc: Yes (gcc)
Checking for presence of xtables.h... Yes (using ipt-inc)
Iptables include flags: -I/tmp/vroot/include (user specified)
Iptables module path: /tmp/vroot/lib/xtables (user specified)
Searching for net-snmp-config... Yes /usr/bin/net-snmp-config
Searching for net-snmp agent... Yes.
Checking for DKMS... No. (It may be useful to install it.)
!
! DKMS is method of installing kernel modules, that will
! automatically recompile module after kernel upgrade.
!
! To install it under Debian simply run this:
! root# apt-get install dkms
!
Creating Makefile.. done.
If you need some options enabled run ./configure --help
Now run: make all install
./gen_compat_def > compat_def.h
Test function xt_family linux/netfilter_ipv4/ip_tables.h declared
Test struct timeval linux/ktime.h declared
Test struct proc_ops linux/proc_fs.h undeclared
Test function synchronize_sched linux/rcupdate.h declared
Test function nf_bridge_info_get linux/netfilter_bridge.h undeclared
Test struct vlan_dev_priv linux/if_vlan.h declared
Test function put_unaligned_be24 asm/unaligned.h undeclared
Test function totalram_pages linux/mm.h undeclared
Test symbol totalram_pages linux/mm.h declared
Compiling 2.6-4-g9ed5788 for kernel 4.14.54-UBNT
make -C /tmp/kernel M=/tmp/ipt-netflow modules
make[1]: Entering directory '/tmp/kernel'
WARNING: Symbol version dump ./Module.symvers
is missing; modules will have no dependencies and modversions.
CC [M] /tmp/ipt-netflow/ipt_NETFLOW.o
/tmp/ipt-netflow/ipt_NETFLOW.c: In function 'nf_seq_show':
/tmp/ipt-netflow/ipt_NETFLOW.c:762:39: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'long long int' [-Wformat=]
seq_printf(seq, " Flows selected %lu, discarded %lu.",
^
/tmp/ipt-netflow/ipt_NETFLOW.c:762:54: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'long long int' [-Wformat=]
seq_printf(seq, " Flows selected %lu, discarded %lu.",
^
/tmp/ipt-netflow/ipt_NETFLOW.c:766:39: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'long long int' [-Wformat=]
seq_printf(seq, " Flows selected %lu.", atomic64_read(&flows_selected));
^
/tmp/ipt-netflow/ipt_NETFLOW.c: In function 'netflow_target':
/tmp/ipt-netflow/ipt_NETFLOW.c:5307:7: error: implicit declaration of function 'nf_bridge_info_get' [-Werror=implicit-function-declaration]
if (nf_bridge_info_get(skb) && nf_bridge_info_get(skb)->physdev) \
^
/tmp/ipt-netflow/ipt_NETFLOW.c:5312:3: note: in expansion of macro 'copy_dev'
copy_dev(nf->o_ifphys, physoutdev, if_out);
^~~~~~~~
/tmp/ipt-netflow/ipt_NETFLOW.c:5307:57: error: invalid type argument of '->' (have 'int')
if (nf_bridge_info_get(skb) && nf_bridge_info_get(skb)->physdev) \
^
/tmp/ipt-netflow/ipt_NETFLOW.c:5312:3: note: in expansion of macro 'copy_dev'
copy_dev(nf->o_ifphys, physoutdev, if_out);
^~~~~~~~
/tmp/ipt-netflow/ipt_NETFLOW.c:5308:46: error: invalid type argument of '->' (have 'int')
out = resolve_snmp(nf_bridge_info_get(skb)->physdev); \
^
/tmp/ipt-netflow/ipt_NETFLOW.c:5312:3: note: in expansion of macro 'copy_dev'
copy_dev(nf->o_ifphys, physoutdev, if_out);
^~~~~~~~
/tmp/ipt-netflow/ipt_NETFLOW.c:5307:57: error: invalid type argument of '->' (have 'int')
if (nf_bridge_info_get(skb) && nf_bridge_info_get(skb)->physdev) \
^
/tmp/ipt-netflow/ipt_NETFLOW.c:5313:3: note: in expansion of macro 'copy_dev'
copy_dev(nf->i_ifphys, physindev, if_in);
^~~~~~~~
/tmp/ipt-netflow/ipt_NETFLOW.c:5308:46: error: invalid type argument of '->' (have 'int')
out = resolve_snmp(nf_bridge_info_get(skb)->physdev); \
^
/tmp/ipt-netflow/ipt_NETFLOW.c:5313:3: note: in expansion of macro 'copy_dev'
copy_dev(nf->i_ifphys, physindev, if_in);
^~~~~~~~
In file included from ./include/linux/printk.h:7:0,
from ./include/linux/kernel.h:14,
from ./include/linux/list.h:9,
from ./include/linux/module.h:9,
from /tmp/ipt-netflow/ipt_NETFLOW.c:22:
/tmp/ipt-netflow/ipt_NETFLOW.c: In function 'ipt_netflow_init':
./include/linux/kern_levels.h:5:18: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'unsigned int' [-Wformat=]
#define KERN_SOH "\001" /* ASCII Start Of Header */
^
./include/linux/kern_levels.h:14:19: note: in expansion of macro 'KERN_SOH'
#define KERN_INFO KERN_SOH "6" /* informational */
^~~~~~~~
/tmp/ipt-netflow/ipt_NETFLOW.c:5626:9: note: in expansion of macro 'KERN_INFO'
printk(KERN_INFO "ipt_NETFLOW: hashsize %u (%luK)\n", hashsize,
^~~~~~~~~
cc1: some warnings being treated as errors
scripts/Makefile.build:334: recipe for target '/tmp/ipt-netflow/ipt_NETFLOW.o' failed
make[2]: *** [/tmp/ipt-netflow/ipt_NETFLOW.o] Error 1
Makefile:1523: recipe for target '_module_/tmp/ipt-netflow' failed
make[1]: *** [_module_/tmp/ipt-netflow] Error 2
make[1]: Leaving directory '/tmp/kernel'
Makefile:26: recipe for target 'ipt_NETFLOW.ko' failed
make: *** [ipt_NETFLOW.ko] Error 2
Here is the kernel config. kernel_config.txt
Thanks for the report! Oh, this is MIPS!
BTW, what distro it is?
Debian stretch
Thanks. I wonder if I should put my effort into it. You are first mipsel user. Even if I fix cross-compiling I will be not completely sure it's working since I don't even have mipsel hardware and won't be able to fix actual bugs.
This issue will be fixed after applying PR #216 and #217