- 论坛徽章:
- 0
|
本帖最后由 pkxpp 于 2011-06-28 11:23 编辑
最近在安装PF_RING,但是老是装不上,我是照着一个很详细的帖子做的,下载内核以及补丁,然后编译内核一直不能通过。有个错误是ip_defrag的错误,后面还说一些函数没定义之类的。网上有个帖子最后是换了个版本2.6.18的,但是我换了几个,都还是这个问题。
这主要是什么原因?
希望高手帮助解决,或者有什么好的建议。
多谢了!
【补充】
我是按照网上的步骤(CentOS,Linux内核2.6.18-194.el5):
uname -r 显示2.6.25-14.fc9.i686,修改版本
./mkpatch.sh 下载版本内核
zcat linux-2.6.25-1-686-smp-PF_RING.patch.gz | patch -p0 ,给 linux-2.6.25/ 下的源码打补丁
cd linux-2.6.25
vi Makefile 在这个地方加上一个自定义的后缀(比如-PF_RING):
EXTRAVERSION = -PF_RING
配置并编译内核!(灰色指令是可选的)
make mrproper # (不建议)清除以前编译的内核文件。因为是新解压的,保持原始状态就好,不建议用这个
make oldconfig # 读取当前内核的配置(相当重要,这步能省好多配置工作,而且保证生成的.config能直接使用)
# 其间会提示 PF_RING xxxx [N/y/m/?] (NEW) ,注意按y选择把PF_RING给加进去,其他的选择按回车默认即可
# 不过注意,如果编译的内核版本较当前的新,会有很多(NEW)标记的提示,此时要是找不到PF_RING,建议先全部回车跳过
make menuconfig # 如果之前把PF_RING也跳过了,这里可以进去重新选上
以上的准备工作都能够完成,但是在接下来的make这里却出现了错误:
CC [M] net/ring/ring_packet.o
net/ring/ring_packet.c:159: error: conflicting types for 'p_defrag'
include/net/ip.h:323: error: previous declaration of 'ip_defrag'was here
net/ring/ring_packet.c: In function 'ring_gather_frags':
net/ring/ring_packet.c:273: warning: implicit declaration of function 'ip_hdr'
net/ring/ring_packet.c:273: warning: passing argument 1 of 'ip_send_check'makes
pointer from integer without a cast
net/ring/ring_packet.c: In function 'ring_proc_init':
net/ring/ring_packet.c:527: error: 'init_net'undeclared (first use in this function)
net/ring/ring_packet.c:527: error: (Each undeclared identifier is reported only once
net/ring/ring_packet.c:527: error: for each function it appears in.)
net/ring/ring_packet.c: In function 'ring_proc_term':
net/ring/ring_packet.c:559: error: 'init_net'undeclared (first use in this function)
net/ring/ring_packet.c: In function 'skb_ring_handler':
net/ring/ring_packet.c:1897: error: 'struct sk_buff'has no member named 'iif'
net/ring/ring_packet.c:1924: warning: implicit declaration of function 'skb_reset_network_header'
net/ring/ring_packet.c:1925: warning: implicit declaration of function 'skb_reset_transport_header'
net/ring/ring_packet.c:1926: warning: implicit declaration of function 'skb_set_network_header'
net/ring/ring_packet.c:1928: warning: assignment makes pointer from integer without a cast
net/ring/ring_packet.c:1984: error: 'struct skb_timeval'has no member named 'tv64'
net/ring/ring_packet.c:1986: error: 'struct skb_timeval'has no member named 'tv64'
net/ring/ring_packet.c: In function 'buffer_ring_handler':
net/ring/ring_packet.c:2105: error: 'struct skb_timeval'has no member named 'tv64'
net/ring/ring_packet.c: At top level:
net/ring/ring_packet.c:2259: warning: 'struct net'declared inside parameter list
net/ring/ring_packet.c:2259: warning: its scope is only this definition or declaration, which is probably not what you want
net/ring/ring_packet.c: In function 'ring_create':
net/ring/ring_packet.c:2280: warning: passing argument 1 of 'sk_alloc'makes integer from pointer without a cast
net/ring/ring_packet.c:2280: warning: passing argument 3 of 'sk_alloc'makes pointer from integer without a cast
net/ring/ring_packet.c:2280: warning: passing argument 4 of 'sk_alloc'makes integer from pointer without a cast
net/ring/ring_packet.c: In function 'ring_bind':
net/ring/ring_packet.c:2612: error: 'init_net'undeclared (first use in this function)
net/ring/ring_packet.c:2613: error: too many arguments to function /__dev_get_by_name'
net/ring/ring_packet.c: In function 'ring_setsockopt':
net/ring/ring_packet.c:3374: error: 'init_net'undeclared (first use in this function)
net/ring/ring_packet.c:3375: error: too many arguments to function 'dev_get_by_name'
net/ring/ring_packet.c:3523: error: too many arguments to function 'dev_get_by_name'
net/ring/ring_packet.c: At top level:
net/ring/ring_packet.c:4073: warning: initialization from incompatible pointer type
make[2]: *** [net/ring/ring_packet.o] Error 1
make[1]: *** [net/ring] Error 2
make: *** [net] Error 2 |
|