- 论坛徽章:
- 0
|
终于编译通过了
对源代码进行了修改,现把修改的部分贴上
- diff -dru ipp2p-0.99.6-r1/Makefile ipp2p-0.99.6-r1.new/Makefile
- --- ipp2p-0.99.6-r1/Makefile 2007-11-23 18:16:57.000000000 +0800
- +++ ipp2p-0.99.6-r1.new/Makefile 2007-11-26 13:20:47.000000000 +0800
- @@ -2,7 +2,7 @@
- obj-m := ipt_ipp2p.o
- else
- -KERNEL_SRC = /usr/src/linux
- +KERNEL_SRC = ../linux-2.6.22.8
- #KERNEL_SRC ?= $(firstword $(wildcard /lib/modules/$(shell uname -r)/build /usr/src/linux))
- ifeq ($(KERNEL_SRC),)
- $(error You need to define KERNEL_SRC)
- @@ -28,7 +28,7 @@
- ifndef $(IPTABLES_SRC)
- IPTVER = \
- $(shell $(IPTABLES_BIN) --version | $(SED) -e 's/^iptables v//')
- -IPTABLES_SRC = $(wildcard /usr/src/iptables-$(IPTVER))
- +IPTABLES_SRC = $(wildcard ../iptables-$(IPTVER))
- #IPTABLES_SRC = /var/tmp/portage/net-firewall/iptables-1.3.8-r1/work/iptables-1.3.8
- endif
- @@ -46,7 +46,7 @@
- IPTABLES_OPTION = -DIPTABLES_VERSION=\"$(IPTABLES_VERSION)\"
- CC = gcc
- -CFLAGS = -O3 -Wall
- +CFLAGS = -O2 -Wall
- all: modules libipt_ipp2p.so
- diff -dru ipp2p-0.99.6-r1/libipt_ipp2p.c ipp2p-0.99.6-r1.new/libipt_ipp2p.c
- --- ipp2p-0.99.6-r1/libipt_ipp2p.c 2007-11-21 14:19:05.000000000 +0800
- +++ ipp2p-0.99.6-r1.new/libipt_ipp2p.c 2007-11-26 14:20:15.000000000 +0800
- @@ -67,23 +67,24 @@
- static void
- -init(struct ipt_entry_match *m, unsigned int *nfcache)
- +init(struct ipt_entry_match *m)
- {
- struct ipt_p2p_info *info = (struct ipt_p2p_info *)m->data;
- - *nfcache |= NFC_UNKNOWN;
- +// *nfcache |= NFC_UNKNOWN;
- /*init the module with default values*/
- info->cmd = 0;
- info->debug = 0;
- + memset(info, 0, sizeof(struct ipt_p2p_info));
- +
- }
- static int
- parse(int c, char **argv, int invert, unsigned int *flags,
- - const struct ipt_entry *entry,
- - unsigned int *nfcache,
- + const void *entry,
- struct ipt_entry_match **match)
- {
- struct ipt_p2p_info *info = (struct ipt_p2p_info *)(*match)->data;
- @@ -341,7 +342,7 @@
- static void
- -print(const struct ipt_ip *ip,
- +print(const void *ip,
- const struct ipt_entry_match *match,
- int numeric)
- {
- @@ -375,7 +376,7 @@
- static void
- -save(const struct ipt_ip *ip, const struct ipt_entry_match *match)
- +save(const void *ip, const struct ipt_entry_match *match)
- {
- struct ipt_p2p_info *info = (struct ipt_p2p_info *)match->data;
复制代码
配置文件部分的差异可以不考虑,主要是那些函数定义部分的参数,我是参考set模块改写的,现在能够正常编译并运行 |
|