我想第一次测试一个过滤modbus协议的旧iptables模块,我使用旧的fedora 7来避免兼容性问题,我在配置内核中激活模块,但当我试图做一个make,我有一些与skbuff.h库函数有关的问题:
[root@localhost linux-2.6.38.4]# make
CHK include/linux/version.h
CHK include/generated/utsrelease.h
CALL scripts/checksyscalls.sh
CHK include/generated/compile.h
CC [M] net/ipv4/netfilter/ipt_modbus.o
net/ipv4/netfilter/ipt_modbus.c:18: warning: data definition has no type or storage class
net/ipv4/netfilter/ipt_modbus.c:18: warning: type defaults to ‘int’ in declaration of ‘EXPORT_NO_SYMBOLS’
net/ipv4/netfilter/ipt_modbus.c: In function ‘length_check’:
net/ipv4/netfilter/ipt_modbus.c:61: warning: suggest parentheses around && within ||
net/ipv4/netfilter/ipt_modbus.c: In function ‘match’:
net/ipv4/netfilter/ipt_modbus.c:141: error: ‘const struct sk_buff’ has no member named ‘nh’
net/ipv4/netfilter/ipt_modbus.c:138: warning: unused variable ‘data’
net/ipv4/netfilter/ipt_modbus.c: In function ‘checkentry’:
net/ipv4/netfilter/ipt_modbus.c:194: error: implicit declaration of function ‘IPT_ALIGN’
net/ipv4/netfilter/ipt_modbus.c:187: warning: unused variable ‘modbusinfo’
net/ipv4/netfilter/ipt_modbus.c: At top level:
net/ipv4/netfilter/ipt_modbus.c:202: error: variable ‘modbus_match’ has initializer but incomplete type
net/ipv4/netfilter/ipt_modbus.c:202: error: extra brace group at end of initializer
net/ipv4/netfilter/ipt_modbus.c:202: error: (near initialization for ‘modbus_match’)
net/ipv4/netfilter/ipt_modbus.c:202: warning: excess elements in struct initializer
net/ipv4/netfilter/ipt_modbus.c:202: warning: (near initialization for ‘modbus_match’)
net/ipv4/netfilter/ipt_modbus.c:202: warning: excess elements in struct initializer
net/ipv4/netfilter/ipt_modbus.c:202: warning: (near initialization for ‘modbus_match’)
net/ipv4/netfilter/ipt_modbus.c:202: warning: excess elements in struct initializer
net/ipv4/netfilter/ipt_modbus.c:202: warning: (near initialization for ‘modbus_match’)
net/ipv4/netfilter/ipt_modbus.c:202: warning: excess elements in struct initializer
net/ipv4/netfilter/ipt_modbus.c:202: warning: (near initialization for ‘modbus_match’)
net/ipv4/netfilter/ipt_modbus.c:202: warning: excess elements in struct initializer
net/ipv4/netfilter/ipt_modbus.c:202: warning: (near initialization for ‘modbus_match’)
net/ipv4/netfilter/ipt_modbus.c:202: warning: excess elements in struct initializer
net/ipv4/netfilter/ipt_modbus.c:202: warning: (near initialization for ‘modbus_match’)
net/ipv4/netfilter/ipt_modbus.c: In function ‘init’:
net/ipv4/netfilter/ipt_modbus.c:206: error: implicit declaration of function ‘ipt_register_match’
net/ipv4/netfilter/ipt_modbus.c: In function ‘cleanup’:
net/ipv4/netfilter/ipt_modbus.c:211: error: implicit declaration of function ‘ipt_unregister_match’
make[3]: *** [net/ipv4/netfilter/ipt_modbus.o] Error 1
make[2]: *** [net/ipv4/netfilter] Error 2
make[1]: *** [net/ipv4] Error 2
make: *** [net] Error 2
[root@localhost linux-2.6.38.4]#
将第一个错误分为第141行的行:
iph = skb->nh.iph;
我搜索过,我确实发现skbuff.h中有一些变化,某些功能不再可用。 这是显示我的iptabe模块https://github.com/kinger1172/ralink_rt5350/blob/1efdc7986ae8b0fb6780311c9e7eea2bd161828f/SDK_4_0_0_0/RT288x_SDK/source/linux-2.4.x/net/ipv4/netfilter/ipt_modbus.c
的文件的源我无法更新我的内核,因为该模块将无法工作,所以如果有人有想法或补丁来解决这个问题,我会很高兴。