- 论坛徽章:
- 0
|
报错了
内核版本 2.6.18-8.el5
我的Makefile 文件内容如下
[root@hw ipp2p-0.99.16]# more Makefile
ifneq ($(KERNELRELEASE),)
obj-m := ipt_ipp2p.o
else
KERNEL_SRC = /usr/src/kernels/2.6.18-8.el5-i686/
#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))
IPTABLES_SRC = /lib/iptables
endif
ifeq ($(IPTABLES_SRC),)
$(warning You need to install iptables sources and maybe set IPTABLES_SRC)
endif
IPTABLES_INCLUDE = -I$(IPTABLES_SRC)/include
ifneq ($(IPTVER),)
IPTABLES_VERSION = $(IPTVER)
else
IPTABLES_VERSION = $(shell cat $(IPTABLES_SRC)/Makefile | grep -e '^IPTABLES_VERSION:=' | cut -d"=" -f2)
endif
IPTABLES_OPTION = -DIPTABLES_VERSION=\"$(IPTABLES_VERSION)\"
#CC = x86_64-pc-linux-gnu-gcc-4.1.2
#CFLAGS = -march=k8 -msse3 -O2 -pipe -Wall
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) M=$(PWD) modules
libipt_ipp2p.so: libipt_ipp2p.c ipt_ipp2p.h
$(CC) $(CFLAGS) $(IPTABLES_OPTION) $(IPTABLES_INCLUDE) -fPIC -c libipt_ipp2p.c
$(CC) -shared -o libipt_ipp2p.so libipt_ipp2p.o
install:
cp ipt_ipp2p.ko /lib/modules/$(shell uname -r)/kernel/net/ipv4/netfilter/
cp libipt_ipp2p.so /lib/iptables/
depmod -a
clean:
-rm -rf *.o *.so *.ko .*.cmd *.mod.c .tmp_versions *~
endif
[root@hw ipp2p-0.99.16]#
然后我make
报错内容如下
[root@hw ipp2p-0.99.16]# make
make -C /usr/src/kernels/2.6.18-8.el5-i686/ M=/root/iptables/ipp2p-0.99.16 modules
make[1]: Entering directory `/usr/src/kernels/2.6.18-8.el5-i686'
CC [M] /root/iptables/ipp2p-0.99.16/ipt_ipp2p.o
In file included from /root/iptables/ipp2p-0.99.16/ipt_ipp2p.c:6:
include/net/netfilter/nf_conntrack_core.h:42: 警告:‘struct nf_conntrack_tuple’ 在形参表内部声明
include/net/netfilter/nf_conntrack_core.h:42: 警告:它的作用域仅限于此定义或声明,这可能并不是您想要的
include/net/netfilter/nf_conntrack_core.h:48: 警告:‘struct nf_conntrack_tuple’ 在形参表内部声明
include/net/netfilter/nf_conntrack_core.h:53: 警告:‘struct nf_conn’ 在形参表内部声明
include/net/netfilter/nf_conntrack_core.h:53: 警告:‘struct nf_conntrack_tuple’ 在形参表内部声明
include/net/netfilter/nf_conntrack_core.h: 在函数 ‘nf_conntrack_confirm’ 中:
include/net/netfilter/nf_conntrack_core.h:64: 错误:隐式声明函数 ‘nf_ct_is_confirmed’
include/net/netfilter/nf_conntrack_core.h:66: 错误:隐式声明函数 ‘nf_ct_deliver_cached_events’
/root/iptables/ipp2p-0.99.16/ipt_ipp2p.c: 在函数 ‘match’ 中:
/root/iptables/ipp2p-0.99.16/ipt_ipp2p.c:815: 错误:‘ctinfo’ 的存储大小未知
/root/iptables/ipp2p-0.99.16/ipt_ipp2p.c:836: 错误:隐式声明函数 ‘nf_ct_get’
/root/iptables/ipp2p-0.99.16/ipt_ipp2p.c:836: 警告:赋值时将整数赋给指针,未作类型转换
/root/iptables/ipp2p-0.99.16/ipt_ipp2p.c:841: 错误:提领指向不完全类型的指针
/root/iptables/ipp2p-0.99.16/ipt_ipp2p.c:841: 错误:‘IP_CT_DIR_ORIGINAL’ 未声明 (在此函数内第一次使用)
/root/iptables/ipp2p-0.99.16/ipt_ipp2p.c:841: 错误:(即使在一个函数内多次出现,每个未声明的标识符在其
/root/iptables/ipp2p-0.99.16/ipt_ipp2p.c:841: 错误:所在的函数内只报告一次。)
/root/iptables/ipp2p-0.99.16/ipt_ipp2p.c:841: 错误:提领指向不完全类型的指针
/root/iptables/ipp2p-0.99.16/ipt_ipp2p.c:841: 错误:‘IP_CT_DIR_REPLY’ 未声明 (在此函数内第一次使用)
/root/iptables/ipp2p-0.99.16/ipt_ipp2p.c:842: 错误:提领指向不完全类型的指针
/root/iptables/ipp2p-0.99.16/ipt_ipp2p.c:844: 错误:提领指向不完全类型的指针
/root/iptables/ipp2p-0.99.16/ipt_ipp2p.c:845: 错误:提领指向不完全类型的指针
/root/iptables/ipp2p-0.99.16/ipt_ipp2p.c:847: 错误:提领指向不完全类型的指针
/root/iptables/ipp2p-0.99.16/ipt_ipp2p.c:847: 错误:提领指向不完全类型的指针
/root/iptables/ipp2p-0.99.16/ipt_ipp2p.c:847: 错误:提领指向不完全类型的指针
/root/iptables/ipp2p-0.99.16/ipt_ipp2p.c:878: 错误:提领指向不完全类型的指针
/root/iptables/ipp2p-0.99.16/ipt_ipp2p.c:900: 错误:提领指向不完全类型的指针
/root/iptables/ipp2p-0.99.16/ipt_ipp2p.c:815: 警告:未使用的变量 ‘ctinfo’
/root/iptables/ipp2p-0.99.16/ipt_ipp2p.c: 在函数 ‘init’ 中:
/root/iptables/ipp2p-0.99.16/ipt_ipp2p.c:962: 错误:隐式声明函数 ‘need_conntrack’
make[2]: *** [/root/iptables/ipp2p-0.99.16/ipt_ipp2p.o] 错误 1
make[1]: *** [_module_/root/iptables/ipp2p-0.99.16] 错误 2
make[1]: Leaving directory `/usr/src/kernels/2.6.18-8.el5-i686'
make: *** [ipt_ipp2p.ko] 错误 2
我的iptables是安装系统时候自带的
iptables 1.3.5
请大家帮忙看看,谢谢 |
|