免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2504 | 回复: 2
打印 上一主题 下一主题

ipp2p模块无所加载,各位帮忙看下。 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-07-24 21:10 |只看该作者 |倒序浏览
系统为AS4

[root@as4 src]# uname -r
2.6.9-42.ELsmp
[root@as4 src]# iptables -V
iptables v1.2.11


下载ipp2p-0.8.1_rc1.tar.gz  iptables-1.2.11.tar 到/usr/src目录
然后分别解压ipp2p-0.8.1_rc1.tar.gz  iptables-1.2.11.tar

进入cd ipp2p-0.8.1_rc1目录,更改
[root@as4 ipp2p-0.8.1_rc1]# cat Makefile
ifneq ($(KERNELRELEASE),)
obj-m := ipt_ipp2p.o

else

KERNEL_SRC ?= $(firstword $(wildcard /lib/modules/$(shell uname -r)/build /usr/src/linux))
ifeq ($(KERNEL_SRC),)
$(error You need to define KERNEL_SRC)
endif

ifneq ($wildcard $(KERNEL_SRC)/include/linux/modversions.h),)
MODVERSIONS = -DMODVERSIONS
endif

_KVER = $(strip $(shell cat $(KERNEL_SRC)/Makefile | grep -e '^VERSION' | cut -d"=" -f2))
_KPL = $(strip $(shell cat $(KERNEL_SRC)/Makefile | grep -e '^PATCHLEVEL' | cut -d"=" -f2))
_KSUB = $(strip $(shell cat $(KERNEL_SRC)/Makefile | grep -e '^SUBLEVEL' | cut -d"=" -f2))
KERNEL_SERIES=$(_KVER).$(_KPL)

ifeq ($(KERNEL_SERIES), 2.6)
        TARGET=ipt_ipp2p.ko
else
        TARGET=ipt_ipp2p.o
endif

SED = sed
IPTABLES_BIN = iptables

ifndef $(IPTABLES_SRC)
IPTVER ?= \
        $(shell $(IPTABLES_BIN) --version | $(SED) -e 's/^iptables v//')
IPTABLES_SRC = $(wildcard /usr/src/iptables-$(IPTVER))
endif

ifeq ($(IPTABLES_SRC),)
IPTABLES_SRC = /usr/src/iptables-1.2.11  更改此处
endif

IPTABLES_INCLUDE = -I$(IPTABLES_SRC)/include
IPTABLES_VERSION = $(shell cat $(IPTABLES_SRC)/Makefile | grep -e '^IPTABLES_VERSION:=' | cut -d"=" -f2)
IPTABLES_OPTION = -DIPTABLES_VERSION=\"$(IPTABLES_VERSION)\"

CC = gcc
CFLAGS = -O3 -Wall



all: modules libipt_ipp2p.so

modules: $(TARGET)

ipt_ipp2p.o: ipt_ipp2p.h ipt_ipp2p.c
        $(CC) $(CFLAGS) -I$(KERNEL_SRC)/include -c ipt_ipp2p.c -D__KERNEL__ -DMODULE $(MODVERSIONS)

ipt_ipp2p.ko: ipt_ipp2p.h ipt_ipp2p.c
        $(MAKE) -C $(KERNEL_SRC) SUBDIRS=$(PWD) modules


libipt_ipp2p.so: libipt_ipp2p.c ipt_ipp2p.h
        $(CC) $(CFLAGS) $(IPTABLES_OPTION) $(IPTABLES_INCLUDE) -fPIC -c libipt_ipp2p.c
        ld -shared -o libipt_ipp2p.so libipt_ipp2p.o

clean:
        -rm -f *.o *.so *.ko .*.cmd *.mod.c
endif

然后 make
生成以下文件:
COPYING      ipt_ipp2p.h   ipt_ipp2p.mod.c  ipt_ipp2p.o     libipt_ipp2p.o   Makefile
ipt_ipp2p.c  ipt_ipp2p.ko  ipt_ipp2p.mod.o  libipt_ipp2p.c  libipt_ipp2p.so  README

然后 cp ipt_ipp2p.ko /lib/modules/

加载[root@as4 ipp2p-0.8.1_rc1]# insmod /lib/modules/ipt_ipp2p.ko
insmod: error inserting '/lib/modules/ipt_ipp2p.ko': -1 Invalid module format就这里出错了。
我换成最新的IPP2P也不行,不会是2。6。9不支持吧。

论坛徽章:
0
2 [报告]
发表于 2007-07-25 09:15 |只看该作者
没有回复。大家都没遇到这种问题吗?

论坛徽章:
0
3 [报告]
发表于 2007-08-01 21:19 |只看该作者
可以insmod ipt_ipp2p.ko  
但还是不能insmod ipt_ipp2p.o  
错误提示跟你的一样 ,不知怎么解决
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP