aabc / ipt-netflow

Netflow iptables module for Linux kernel (official)
https://github.com/aabc/ipt-netflow
506 stars 129 forks source link

time_val error #152

Closed dryukov closed 4 years ago

dryukov commented 4 years ago

Not compile:

./configure --ipt-inc=./../iptables-1.8.2/include --kdir=/root/linux-5.8.13 --kver=5.8.13

Module version: 2.5.1 Kernel version: 5.8.13 (requested) Kernel sources: /root/linux-5.8.13 (requested) Checking for presence of include/linux/netfilter.h... Yes netfilter.h uses CONFIG_NF_NAT_NEEDED... No Checking for presence of include/linux/llist.h... Yes Checking for presence of include/linux/grsecurity.h... No Iptables binary version: 1.8.2 (nf_tables) (detected from /usr/sbin/iptables) pkg-config for version 1.8.2 (nf_tables) exists: No (reported: 1.8.2) Check for working gcc: Yes (gcc) Checking for presence of xtables.h... Yes (using ipt-inc) Iptables include flags: -I./../iptables-1.8.2/include (user specified) Iptables module path: /usr/lib/x86_64-linux-gnu/xtables (from libxtables.so, from binary) Searching for net-snmp-config... Yes /usr/bin/net-snmp-config Searching for net-snmp agent... Yes. Checking for DKMS... Yes. Creating Makefile.. done.

If you need some options enabled run ./configure --help Now run: make all install

make

./gen_compat_def > compat_def.h Test symbol xt_family linux/netfilter_ipv4/ip_tables.h declared Test struct timeval linux/ktime.h declared Test struct proc_ops linux/proc_fs.h declared Test symbol synchronize_sched linux/rcupdate.h declared Test symbol nf_bridge_info_get linux/netfilter_bridge.h declared Compiling for kernel 5.8.13 make -C /root/linux-5.8.13 M=/root/ipt-netflow-master modules CONFIG_DEBUG_INFO=y make[1]: вход в каталог «/root/linux-5.8.13» CC [M] /root/ipt-netflow-master/ipt_NETFLOW.o In file included from /root/ipt-netflow-master/ipt_NETFLOW.c:76: /root/ipt-netflow-master/compat.h:707:43: warning: ‘struct timeval’ declared inside parameter list will not be visible outside of this definition or declaration static inline void do_gettimeofday(struct timeval tv) ^~~ /root/ipt-netflow-master/compat.h: In function ‘do_gettimeofday’: /root/ipt-netflow-master/compat.h:711:4: error: dereferencing pointer to incomplete type ‘struct timeval’ tv->tv_sec = ts64.tv_sec; ^~ /root/ipt-netflow-master/ipt_NETFLOW.c: In function ‘netflow_export_pdu_v5’: /root/ipt-netflow-master/ipt_NETFLOW.c:2652:17: error: storage size of ‘tv’ isn’t known struct timeval tv; ^~ /root/ipt-netflow-master/ipt_NETFLOW.c:2652:17: warning: unused variable ‘tv’ [-Wunused-variable] /root/ipt-netflow-master/ipt_NETFLOW.c: In function ‘netflow_export_pdu_v9’: /root/ipt-netflow-master/ipt_NETFLOW.c:2736:17: error: storage size of ‘tv’ isn’t known struct timeval tv; ^~ /root/ipt-netflow-master/ipt_NETFLOW.c:2736:17: warning: unused variable ‘tv’ [-Wunused-variable] /root/ipt-netflow-master/ipt_NETFLOW.c: In function ‘netflow_export_pdu_ipfix’: /root/ipt-netflow-master/ipt_NETFLOW.c:2770:17: error: storage size of ‘tv’ isn’t known struct timeval tv; ^~ /root/ipt-netflow-master/ipt_NETFLOW.c:2770:17: warning: unused variable ‘tv’ [-Wunused-variable] /root/ipt-netflow-master/ipt_NETFLOW.c: In function ‘timeout_rate_j’: /root/ipt-netflow-master/ipt_NETFLOW.c:3680:10: error: variable ‘tv’ has initializer but incomplete type struct timeval tv = { .tv_sec = timeout_rate 60, .tv_usec = 0 }; ^~~ /root/ipt-netflow-master/ipt_NETFLOW.c:3680:26: error: ‘struct timeval’ has no member named ‘tv_sec’ struct timeval tv = { .tv_sec = timeout_rate 60, .tv_usec = 0 }; ^~ /root/ipt-netflow-master/ipt_NETFLOW.c:3680:35: warning: excess elements in struct initializer struct timeval tv = { .tv_sec = timeout_rate 60, .tv_usec = 0 }; ^~~~ /root/ipt-netflow-master/ipt_NETFLOW.c:3680:35: note: (near initialization for ‘tv’) /root/ipt-netflow-master/ipt_NETFLOW.c:3680:55: error: ‘struct timeval’ has no member named ‘tv_usec’ struct timeval tv = { .tv_sec = timeout_rate 60, .tv_usec = 0 }; ^~~ /root/ipt-netflow-master/ipt_NETFLOW.c:3680:65: warning: excess elements in struct initializer struct timeval tv = { .tv_sec = timeout_rate 60, .tv_usec = 0 }; ^ /root/ipt-netflow-master/ipt_NETFLOW.c:3680:65: note: (near initialization for ‘tv’) /root/ipt-netflow-master/ipt_NETFLOW.c:3680:18: error: storage size of ‘tv’ isn’t known struct timeval tv = { .tv_sec = timeout_rate 60, .tv_usec = 0 }; ^~ /root/ipt-netflow-master/ipt_NETFLOW.c:3683:14: error: implicit declaration of function ‘timeval_to_jiffies’; did you mean ‘nsecs_to_jiffies’? [-Werror=implicit-function-declaration] t_rate_j = timeval_to_jiffies(&tv); ^~~~~~ nsecs_to_jiffies /root/ipt-netflow-master/ipt_NETFLOW.c:3680:18: warning: unused variable ‘tv’ [-Wunused-variable] struct timeval tv = { .tv_sec = timeout_rate 60, .tv_usec = 0 }; ^~ /root/ipt-netflow-master/ipt_NETFLOW.c: In function ‘ipt_netflow_fini’: /root/ipt-netflow-master/ipt_NETFLOW.c:5792:2: error: implicit declaration of function ‘synchronize_sched’; did you mean ‘synchronize_net’? [-Werror=implicit-function-declaration] synchronize_sched(); ^~~~~ synchronize_net cc1: some warnings being treated as errors make[2]: [scripts/Makefile.build:281: /root/ipt-netflow-master/ipt_NETFLOW.o] Ошибка 1 make[1]: [Makefile:1752: /root/ipt-netflow-master] Ошибка 2 make[1]: выход из каталога «/root/linux-5.8.13» make: *** [Makefile:25: ipt_NETFLOW.ko] Ошибка 2

=============== if remark in ./compat_def.h // struct timeval is declared in <linux/ktime.h> //#define HAVE_TIMEVAL

report:

make

Compiling for kernel 5.8.13 make -C /root/linux-5.8.13 M=/root/ipt-netflow-master modules CONFIG_DEBUG_INFO=y make[1]: вход в каталог «/root/linux-5.8.13» CC [M] /root/ipt-netflow-master/ipt_NETFLOW.o /root/ipt-netflow-master/ipt_NETFLOW.c: In function ‘ipt_netflow_fini’: /root/ipt-netflow-master/ipt_NETFLOW.c:5792:2: error: implicit declaration of function ‘synchronize_sched’; did you mean ‘synchronize_net’? [-Werror=implicit-function-declaration] synchronize_sched(); ^~~~~ synchronize_net cc1: some warnings being treated as errors make[2]: [scripts/Makefile.build:281: /root/ipt-netflow-master/ipt_NETFLOW.o] Ошибка 1 make[1]: [Makefile:1752: /root/ipt-netflow-master] Ошибка 2 make[1]: выход из каталога «/root/linux-5.8.13» make: *** [Makefile:25: ipt_NETFLOW.ko] Ошибка 2

(((((

aabc commented 4 years ago

Pls, try version from git.

dryukov commented 4 years ago

Me remark in ./compat_def.h two lines //#define HAVE_TIMEVAL //#define RCU___xxxxxxxxx compile succress. Thx.