ipt-ratelimit icon indicating copy to clipboard operation
ipt-ratelimit copied to clipboard

Error while "make all install" on Debian 12

Open alekskomp opened this issue 2 years ago • 2 comments

Hi. Trying to install on Debian 12 beta

# make all install
make -C /lib/modules/6.1.0-8-amd64/build/ M=/root/ipt-ratelimit-0.3.2 modules CONFIG_DEBUG_INFO=y
make[1]: Entering directory '/usr/src/linux-headers-6.1.0-8-amd64'
  CC [M]  /root/ipt-ratelimit-0.3.2/xt_ratelimit.o
/root/ipt-ratelimit-0.3.2/xt_ratelimit.c: In function ‘ratelimit_proc_open’:
/root/ipt-ratelimit-0.3.2/xt_ratelimit.c:318:31: error: implicit declaration of function ‘PDE_DATA’; did you mean ‘NODE_DATA’? [-Werror=implicit-function-declaration]
  318 |                 sf->private = PDE_DATA(inode);
      |                               ^~~~~~~~
      |                               NODE_DATA
/root/ipt-ratelimit-0.3.2/xt_ratelimit.c:318:29: warning: assignment to ‘void *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
  318 |                 sf->private = PDE_DATA(inode);
      |                             ^
/root/ipt-ratelimit-0.3.2/xt_ratelimit.c: In function ‘ratelimit_proc_write’:
/root/ipt-ratelimit-0.3.2/xt_ratelimit.c:623:42: warning: initialization of ‘struct xt_ratelimit_htable *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
  623 |         struct xt_ratelimit_htable *ht = PDE_DATA(file_inode(file));
      |                                          ^~~~~~~~
/root/ipt-ratelimit-0.3.2/xt_ratelimit.c: In function ‘parse_rule’:
/root/ipt-ratelimit-0.3.2/xt_ratelimit.c:530:37: warning: this statement may fall through [-Wimplicit-fallthrough=]
  530 |                                 val = val / 8 + (val / 8 / 2);
      |                                 ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
/root/ipt-ratelimit-0.3.2/xt_ratelimit.c:532:25: note: here
  532 |                         case 1:
      |                         ^~~~
/root/ipt-ratelimit-0.3.2/xt_ratelimit.c:534:37: warning: this statement may fall through [-Wimplicit-fallthrough=]
  534 |                                 val *= 2;
      |                                 ~~~~^~~~
/root/ipt-ratelimit-0.3.2/xt_ratelimit.c:536:25: note: here
  536 |                         case 2:
      |                         ^~~~
cc1: some warnings being treated as errors
make[2]: *** [/usr/src/linux-headers-6.1.0-8-common/scripts/Makefile.build:255: /root/ipt-ratelimit-0.3.2/xt_ratelimit.o] Error 1
make[1]: *** [/usr/src/linux-headers-6.1.0-8-common/Makefile:2037: /root/ipt-ratelimit-0.3.2] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-6.1.0-8-amd64'
make: *** [Makefile:12: xt_ratelimit.ko] Error 2
# uname -a
Linux  6.1.0-8-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.25-1 (2023-04-22) x86_64 GNU/Linux

Should i try version 0.3.3?

alekskomp avatar May 10 '23 16:05 alekskomp

Got this with version 0.3.3

# make all install 
make -C /lib/modules/6.1.0-8-amd64/build/ M=/root/ipt-ratelimit-0.3.3 modules
make[1]: Entering directory '/usr/src/linux-headers-6.1.0-8-amd64'
  CC [M]  /root/ipt-ratelimit-0.3.3/xt_ratelimit.o
/root/ipt-ratelimit-0.3.3/xt_ratelimit.c: In function ‘parse_rule’:
/root/ipt-ratelimit-0.3.3/xt_ratelimit.c:530:37: warning: this statement may fall through [-Wimplicit-fallthrough=]
  530 |                                 val = val / 8 + (val / 8 / 2);
      |                                 ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
/root/ipt-ratelimit-0.3.3/xt_ratelimit.c:532:25: note: here
  532 |                         case 1:
      |                         ^~~~
/root/ipt-ratelimit-0.3.3/xt_ratelimit.c:534:37: warning: this statement may fall through [-Wimplicit-fallthrough=]
  534 |                                 val *= 2;
      |                                 ~~~~^~~~
/root/ipt-ratelimit-0.3.3/xt_ratelimit.c:536:25: note: here
  536 |                         case 2:
      |                         ^~~~
  MODPOST /root/ipt-ratelimit-0.3.3/Module.symvers
  CC [M]  /root/ipt-ratelimit-0.3.3/xt_ratelimit.mod.o
  LD [M]  /root/ipt-ratelimit-0.3.3/xt_ratelimit.ko
  BTF [M] /root/ipt-ratelimit-0.3.3/xt_ratelimit.ko
Skipping BTF generation for /root/ipt-ratelimit-0.3.3/xt_ratelimit.ko due to unavailability of vmlinux
make[1]: Leaving directory '/usr/src/linux-headers-6.1.0-8-amd64'
sync
gcc -O2 -Wall -Wunused -fPIC   -o libxt_ratelimit_sh.o -c libxt_ratelimit.c
gcc -shared -o libxt_ratelimit.so libxt_ratelimit_sh.o
/usr/bin/ld: libxt_ratelimit_sh.o: in function `_init':
libxt_ratelimit.c:(.text+0x210): multiple definition of `_init'; /usr/lib/gcc/x86_64-linux-gnu/12/../../../x86_64-linux-gnu/crti.o:(.init+0x0): first defined here
collect2: error: ld returned 1 exit status
make: *** [Makefile:19: libxt_ratelimit.so] Error 1
rm libxt_ratelimit_sh.o

alekskomp avatar May 11 '23 11:05 alekskomp

pr: https://github.com/aabc/ipt-ratelimit/pull/27

manchelsi avatar Jul 14 '23 06:07 manchelsi