feilx-zhang / opendpi

Automatically exported from code.google.com/p/opendpi
GNU Lesser General Public License v3.0
0 stars 0 forks source link

Cant compile Netfilter wrapper 1.2 for kernel 2.6.39-ARCH #17

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hi, I tried to compile opendpi-netfilter-wrapper-1.2 into kernel 2.6.39 for 
archlinux , when make ,the following error occurred:

.../opendpi-netfilter-wrapper-1.2/wrapper # make
make -C ipt
make[1]: Entering directory 
`/usr/local/src/opendpi-netfilter-wrapper-1.2/wrapper/ipt'
if test -d opendpi_cpy; then \
        cp /usr/local/src/opendpi-1.3.0/src/* opendpi_cpy -R; \
else \
        mkdir opendpi_cpy; \
        cp /usr/local/src/opendpi-1.3.0/src/* opendpi_cpy -R; \
fi
make libxt_opendpi.so
make[2]: Entering directory 
`/usr/local/src/opendpi-netfilter-wrapper-1.2/wrapper/ipt'
make[2]: `libxt_opendpi.so' is up to date.
make[2]: Leaving directory 
`/usr/local/src/opendpi-netfilter-wrapper-1.2/wrapper/ipt'
rm -r opendpi_cpy
make[1]: Leaving directory 
`/usr/local/src/opendpi-netfilter-wrapper-1.2/wrapper/ipt'
make -C src
make[1]: Entering directory 
`/usr/local/src/opendpi-netfilter-wrapper-1.2/wrapper/src'
if test -d opendpi_cpy; then \
        cp /usr/local/src/opendpi-1.3.0/src/* opendpi_cpy -R; \
else \
        mkdir opendpi_cpy; \
        cp /usr/local/src/opendpi-1.3.0/src/* opendpi_cpy -R; \
fi
make -C /lib/modules/2.6.39-ARCH/build M=$PWD;
make[2]: Entering directory `/usr/src/linux-2.6.39-ARCH'
  LD      /usr/local/src/opendpi-netfilter-wrapper-1.2/wrapper/src/built-in.o
  CC [M]  /usr/local/src/opendpi-netfilter-wrapper-1.2/wrapper/src/main.o
/usr/local/src/opendpi-netfilter-wrapper-1.2/wrapper/src/main.c:457:52: 
warning: ‘struct xt_match_param’ declared inside parameter list [enabled by 
default]
/usr/local/src/opendpi-netfilter-wrapper-1.2/wrapper/src/main.c:457:52: 
warning: its scope is only this definition or declaration, which is probably 
not what you want [enabled by default]
/usr/local/src/opendpi-netfilter-wrapper-1.2/wrapper/src/main.c: In function 
‘opendpi_mt’:
/usr/local/src/opendpi-netfilter-wrapper-1.2/wrapper/src/main.c:466:44: error: 
dereferencing pointer to incomplete type
/usr/local/src/opendpi-netfilter-wrapper-1.2/wrapper/src/main.c:475:2: warning: 
passing argument 1 of ‘nf_ct_is_untracked’ from incompatible pointer type 
[enabled by default]
include/net/netfilter/nf_conntrack.h:306:19: note: expected ‘const struct 
nf_conn *’ but argument is of type ‘const struct sk_buff *’
/usr/local/src/opendpi-netfilter-wrapper-1.2/wrapper/src/main.c: At top level:
/usr/local/src/opendpi-netfilter-wrapper-1.2/wrapper/src/main.c:623:2: warning: 
initialization from incompatible pointer type [enabled by default]
/usr/local/src/opendpi-netfilter-wrapper-1.2/wrapper/src/main.c:623:2: warning: 
(near initialization for ‘opendpi_mt_reg.match’) [enabled by default]
/usr/local/src/opendpi-netfilter-wrapper-1.2/wrapper/src/main.c:624:2: warning: 
initialization from incompatible pointer type [enabled by default]
/usr/local/src/opendpi-netfilter-wrapper-1.2/wrapper/src/main.c:624:2: warning: 
(near initialization for ‘opendpi_mt_reg.checkentry’) [enabled by default]
make[3]: *** [/usr/local/src/opendpi-netfilter-wrapper-1.2/wrapper/src/main.o] 
Error 1
make[2]: *** [_module_/usr/local/src/opendpi-netfilter-wrapper-1.2/wrapper/src] 
Error 2
make[2]: Leaving directory `/usr/src/linux-2.6.39-ARCH'
make[1]: *** [all] Error 2
make[1]: Leaving directory 
`/usr/local/src/opendpi-netfilter-wrapper-1.2/wrapper/src'
make: *** [all] Error 2

anybody help me? Thanks in advance!

Original issue reported on code.google.com by ZongSh...@gmail.com on 28 Jul 2011 at 6:59

GoogleCodeExporter commented 9 years ago
In one of the last kernel patches structures xt_match_param and xt_target_param 
were combined in struct xt_action_param, so you should replace xt_match_param 
with xt_action_param. I've tested it in the same kernel.

Original comment by tapa...@gmail.com on 29 Jul 2011 at 1:58

GoogleCodeExporter commented 9 years ago
Hi,tapa...,I appreciate your help ,all that compiled successfully, but when I 
insert the xt_opendip module into kernel,it failed, as the following output 
shows:

wrapper$ OPENDPI_PATH=/usr/local/src/opendpi-1.3.0 make
.......
  LD [M]  /usr/local/src/opendpi-netfilter-wrapper-1.2/wrapper/src/xt_opendpi.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /usr/local/src/opendpi-netfilter-wrapper-1.2/wrapper/src/xt_opendpi.mod.o
  LD [M]  /usr/local/src/opendpi-netfilter-wrapper-1.2/wrapper/src/xt_opendpi.ko
make[2]: Leaving directory `/usr/src/linux-2.6.39-ARCH'
rm -r opendpi_cpy
make[1]: Leaving directory 
`/usr/local/src/opendpi-netfilter-wrapper-1.2/wrapper/src'

wrapper$ make modules_install
make -C src modules_install
make[1]: Entering directory 
`/usr/local/src/opendpi-netfilter-wrapper-1.2/wrapper/src'
make -C /lib/modules/2.6.39-ARCH/build M=$PWD modules_install;
make[2]: Entering directory `/usr/src/linux-2.6.39-ARCH'
  INSTALL /usr/local/src/opendpi-netfilter-wrapper-1.2/wrapper/src/xt_opendpi.ko
  DEPMOD  2.6.39-ARCH
make[2]: Leaving directory `/usr/src/linux-2.6.39-ARCH'
depmod -a;
make[1]: Leaving directory 
`/usr/local/src/opendpi-netfilter-wrapper-1.2/wrapper/src'

##### cause "/lib/xtables" or  "/usr/lib/xtables" doesn't exist on my 
archlinux, I copied "libxt_opendpi.so" to "/usr/lib/iptables/"
wrapper$ cp ipt/libxt_opendpi.so /usr/lib/iptables/ 

wrapper$ modprobe xt_opendpi
FATAL: Error inserting xt_opendpi 
(/lib/modules/2.6.39-ARCH/extra/xt_opendpi.ko): Device or resource busy 

wrapper$ modinfo xt_opendpi 
filename:       /lib/modules/2.6.39-ARCH/extra/xt_opendpi.ko
alias:          ipt_opendpi
description:    OpenDPI wrapper
author:         Gerardo E. Gidoni <gerel@gnu.org>
license:        GPL
depends:        nf_conntrack,x_tables
vermagic:       2.6.39-ARCH SMP preempt mod_unload 

wrapper$ lsmod
......
nf_conntrack           59492  5 
nf_conntrack_netlink,iptable_nat,nf_nat,nf_conntrack_ipv4,xt_state
iptable_filter          1528  1 
ip_tables              16743  3 iptable_mangle,iptable_nat,iptable_filter
x_tables               17603  15 
xt_dscp,xt_comment,xt_limit,xt_mark,xt_NFQUEUE,xt_DSCP,xt_tcpudp,xt_multiport,ip
t_LOG,iptable_mangle,iptable_nat,ipt_REJECT,xt_state,iptable_filter,ip_tables
......

So,I have no idea what happened ?

Original comment by ZongSh...@gmail.com on 11 Aug 2011 at 8:04