[分享]drcom-1.4.4发布,解决新内核不能上网问题

头像
reshine
帖子: 91
注册时间: 2006-04-29 1:43
送出感谢: 0
接收感谢: 0
联系:

[分享]drcom-1.4.4发布,解决新内核不能上网问题

#1

帖子 reshine » 2008-04-12 23:08

新版本发布了,解决了2.6.24及以上内核不能使用drcom上网的问题。
http://sourceforge.net/projects/drcom-client

重要变化:
=========


注意:在新的/etc/drcom.conf中,正确填写

except=

很重要!!! 这里必须把所有不需要验证的网址(也就是所有内网范围)列出来。格式见下面的解释。



配置文件:
=========

从1.4.0开始,/etc/drcom.conf的内容有所变化,增加了device和except两个配置选项,
mac和nic0选项也不再需要填写。

device指明通往外网的网卡的名字。
except指明不需要进行用户验证的网络地址(用“网络地址/网络掩码”的形式,用逗号隔开),
通常,except应该列出内网的地址。

如下例:
device=eth0
except=10.0.0.0/255.0.0.0, 192.168.0.0/255.255.0.0, 172.16.0.0/255.240.0.0, 127.0.0.0/255.0.0.0



概述:
=====

在本程序的1.3.x版本中,我们使用security_ops来截获socket创建的机制,
来为每个TCP/UDP连接加入验证服务器需要的验证信息。
但是,Linux内核从2.6.24开始,不再EXPORT_SYMBOL(security_ops),
因此,我们就不再能够使用这种方法。

从1.4.x开始,我们转而采用netfilter hooks。
一方面,这个做法避免了以后依赖于内核EXPORT_SYMBOL的困境,
另一方面,这个做法带来了另外的好处,就是可以使用NAT/Masquerade来共享上网。
附件
drcom-1.4.4.tar.gz
源码包
(41.92 KiB) 下载 704 次
头像
imagelife
帖子: 251
注册时间: 2007-10-07 11:56
来自: 湖南
送出感谢: 0
接收感谢: 0

#2

帖子 imagelife » 2008-04-13 10:14

好,辛苦lz了。
头像
syrano
帖子: 4313
注册时间: 2007-10-06 18:40
送出感谢: 0
接收感谢: 5 次

#3

帖子 syrano » 2008-04-13 12:01

太好了.
Brilliant!
guoyulv
帖子: 7
注册时间: 2007-12-18 15:39
送出感谢: 0
接收感谢: 0

#4

帖子 guoyulv » 2008-04-13 19:17

:lol:
弱弱的问句...
3.53能用这样的方法上网么?
头像
reshine
帖子: 91
注册时间: 2006-04-29 1:43
送出感谢: 0
接收感谢: 0
联系:

#5

帖子 reshine » 2008-04-14 0:24

不清楚,我学校用的版本是3.46
LaoLiulaoliu
帖子: 131
注册时间: 2006-10-25 17:50
来自: 南京
送出感谢: 0
接收感谢: 0
联系:

[讨论]

#6

帖子 LaoLiulaoliu » 2008-04-17 5:50

I am using Gentoo.The kernel is 2.6.24-r4
The problem is I can not use it.
是楼主写的这个软件吗?我把error贴出来
make[1]: Entering directory `/home/uncompressed/drcom-1.4.4/drcomc'
CC drcomc.c
CC ../utils/utils.c
LD drcomc
make[1]: Leaving directory `/home/uncompressed/drcom-1.4.4/drcomc'
make[1]: Entering directory `/home/uncompressed/drcom-1.4.4/drcomd'
CC drcomd.c
CC kmodule.c
CC signal.c
CC dialog.c
CC keepalive.c
CC login.c
CC logout.c
CC md5.c
CC misc.c
CC passwd.c
CC readconf.c
CC watchport.c
CC log.c
LD drcomd
make[1]: Leaving directory `/home/uncompressed/drcom-1.4.4/drcomd'
make[1]: Entering directory `/home/uncompressed/drcom-1.4.4/kmod'
make -C /lib/modules/2.6.24-gentoo-r4/build M=/home/uncompressed/drcom-1.4.4/kmod modules
make[2]: Entering directory `/usr/src/linux-2.6.24-gentoo-r4'
CC [M] /home/uncompressed/drcom-1.4.4/kmod/drcom.o
/home/uncompressed/drcom-1.4.4/kmod/drcom.c: In function ‘sack_adjust’:
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:435: error: implicit declaration of function ‘nf_proto_csum_replace4’
/home/uncompressed/drcom-1.4.4/kmod/drcom.c: In function ‘tcp_sack_adjust’:
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:450: error: implicit declaration of function ‘skb_make_writable’
/home/uncompressed/drcom-1.4.4/kmod/drcom.c: At top level:
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:928: error: variable ‘preroute_hook_ops’ has initializer but incomplete type
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:929: error: unknown field ‘hook’ specified in initializer
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:929: warning: excess elements in struct initializer
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:929: warning: (near initialization for ‘preroute_hook_ops’)
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:930: error: unknown field ‘owner’ specified in initializer
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:930: warning: excess elements in struct initializer
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:930: warning: (near initialization for ‘preroute_hook_ops’)
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:931: error: unknown field ‘pf’ specified in initializer
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:931: warning: excess elements in struct initializer
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:931: warning: (near initialization for ‘preroute_hook_ops’)
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:932: error: unknown field ‘hooknum’ specified in initializer
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:932: warning: excess elements in struct initializer
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:932: warning: (near initialization for ‘preroute_hook_ops’)
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:933: error: unknown field ‘priority’ specified in initializer
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:933: warning: excess elements in struct initializer
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:933: warning: (near initialization for ‘preroute_hook_ops’)
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:936: error: variable ‘postroute_hook_ops’ has initializer but incomplete type
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:937: error: unknown field ‘hook’ specified in initializer
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:937: warning: excess elements in struct initializer
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:937: warning: (near initialization for ‘postroute_hook_ops’)
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:938: error: unknown field ‘owner’ specified in initializer
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:938: warning: excess elements in struct initializer
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:938: warning: (near initialization for ‘postroute_hook_ops’)
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:939: error: unknown field ‘pf’ specified in initializer
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:939: warning: excess elements in struct initializer
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:939: warning: (near initialization for ‘postroute_hook_ops’)
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:940: error: unknown field ‘hooknum’ specified in initializer
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:940: warning: excess elements in struct initializer
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:940: warning: (near initialization for ‘postroute_hook_ops’)
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:941: error: unknown field ‘priority’ specified in initializer
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:941: warning: excess elements in struct initializer
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:941: warning: (near initialization for ‘postroute_hook_ops’)
/home/uncompressed/drcom-1.4.4/kmod/drcom.c: In function ‘conn_hooks_init’:
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:986: error: implicit declaration of function ‘nf_register_hook’
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:1001: error: implicit declaration of function ‘nf_unregister_hook’
/home/uncompressed/drcom-1.4.4/kmod/drcom.c: At top level:
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:1143: error: variable ‘conn_so_ops’ has initializer but incomplete type
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:1144: error: unknown field ‘pf’ specified in initializer
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:1144: warning: excess elements in struct initializer
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:1144: warning: (near initialization for ‘conn_so_ops’)
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:1145: error: unknown field ‘set_optmin’ specified in initializer
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:1145: warning: excess elements in struct initializer
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:1145: warning: (near initialization for ‘conn_so_ops’)
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:1146: error: unknown field ‘set_optmax’ specified in initializer
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:1146: warning: excess elements in struct initializer
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:1146: warning: (near initialization for ‘conn_so_ops’)
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:1147: error: unknown field ‘set’ specified in initializer
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:1147: warning: excess elements in struct initializer
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:1147: warning: (near initialization for ‘conn_so_ops’)
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:1148: error: unknown field ‘owner’ specified in initializer
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:1148: warning: excess elements in struct initializer
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:1148: warning: (near initialization for ‘conn_so_ops’)
/home/uncompressed/drcom-1.4.4/kmod/drcom.c: In function ‘init’:
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:1159: error: implicit declaration of function ‘nf_register_sockopt’
/home/uncompressed/drcom-1.4.4/kmod/drcom.c: In function ‘fini’:
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:1172: error: implicit declaration of function ‘nf_unregister_sockopt’
make[3]: *** [/home/uncompressed/drcom-1.4.4/kmod/drcom.o] Error 1
make[2]: *** [_module_/home/uncompressed/drcom-1.4.4/kmod] Error 2
make[2]: Leaving directory `/usr/src/linux-2.6.24-gentoo-r4'
make[1]: *** [default] Error 2
make[1]: Leaving directory `/home/uncompressed/drcom-1.4.4/kmod'
make: *** [all] Error 1
头像
syrano
帖子: 4313
注册时间: 2007-10-06 18:40
送出感谢: 0
接收感谢: 5 次

Re: [讨论]

#7

帖子 syrano » 2008-04-17 12:34

ls装了编译环境了吗?
头像
qiang_liu8183
论坛版主
帖子: 10688
注册时间: 2006-09-10 22:36
来自: 北京
送出感谢: 2 次
接收感谢: 6 次

#8

帖子 qiang_liu8183 » 2008-04-17 13:09

:D
看破、放下、自在、随缘、念佛
真诚、清净、平等、正觉、慈悲
LaoLiulaoliu
帖子: 131
注册时间: 2006-10-25 17:50
来自: 南京
送出感谢: 0
接收感谢: 0
联系:

#9

帖子 LaoLiulaoliu » 2008-04-17 22:03

我是gentoo,还要问什么编译环境。
头像
reshine
帖子: 91
注册时间: 2006-04-29 1:43
送出感谢: 0
接收感谢: 0
联系:

#10

帖子 reshine » 2008-04-18 0:06

抱歉,这个程序不是我写的。
LS的问题我也不知道是怎么回事 :oops:
any comments please goto wheelz at <kernel.zeng@gmail.com>
头像
syrano
帖子: 4313
注册时间: 2007-10-06 18:40
送出感谢: 0
接收感谢: 5 次

Re: [讨论]

#11

帖子 syrano » 2008-04-18 12:45

LaoLiulaoliu 写了:I am using Gentoo.The kernel is 2.6.24-r4
The problem is I can not use it.
是楼主写的这个软件吗?我把error贴出来
make[1]: Entering directory `/home/uncompressed/drcom-1.4.4/drcomc'
CC drcomc.c
CC ../utils/utils.c
LD drcomc
make[1]: Leaving directory `/home/uncompressed/drcom-1.4.4/drcomc'
make[1]: Entering directory `/home/uncompressed/drcom-1.4.4/drcomd'
CC drcomd.c
CC kmodule.c
CC signal.c
CC dialog.c
CC keepalive.c
CC login.c
CC logout.c
CC md5.c
CC misc.c
CC passwd.c
CC readconf.c
CC watchport.c
CC log.c
LD drcomd
make[1]: Leaving directory `/home/uncompressed/drcom-1.4.4/drcomd'
make[1]: Entering directory `/home/uncompressed/drcom-1.4.4/kmod'
make -C /lib/modules/2.6.24-gentoo-r4/build M=/home/uncompressed/drcom-1.4.4/kmod modules
make[2]: Entering directory `/usr/src/linux-2.6.24-gentoo-r4'
CC [M] /home/uncompressed/drcom-1.4.4/kmod/drcom.o
/home/uncompressed/drcom-1.4.4/kmod/drcom.c: In function ‘sack_adjust’:
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:435: error: implicit declaration of function ‘nf_proto_csum_replace4’
/home/uncompressed/drcom-1.4.4/kmod/drcom.c: In function ‘tcp_sack_adjust’:
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:450: error: implicit declaration of function ‘skb_make_writable’
/home/uncompressed/drcom-1.4.4/kmod/drcom.c: At top level:
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:928: error: variable ‘preroute_hook_ops’ has initializer but incomplete type
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:929: error: unknown field ‘hook’ specified in initializer
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:929: warning: excess elements in struct initializer
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:929: warning: (near initialization for ‘preroute_hook_ops’)
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:930: error: unknown field ‘owner’ specified in initializer
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:930: warning: excess elements in struct initializer
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:930: warning: (near initialization for ‘preroute_hook_ops’)
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:931: error: unknown field ‘pf’ specified in initializer
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:931: warning: excess elements in struct initializer
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:931: warning: (near initialization for ‘preroute_hook_ops’)
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:932: error: unknown field ‘hooknum’ specified in initializer
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:932: warning: excess elements in struct initializer
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:932: warning: (near initialization for ‘preroute_hook_ops’)
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:933: error: unknown field ‘priority’ specified in initializer
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:933: warning: excess elements in struct initializer
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:933: warning: (near initialization for ‘preroute_hook_ops’)
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:936: error: variable ‘postroute_hook_ops’ has initializer but incomplete type
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:937: error: unknown field ‘hook’ specified in initializer
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:937: warning: excess elements in struct initializer
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:937: warning: (near initialization for ‘postroute_hook_ops’)
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:938: error: unknown field ‘owner’ specified in initializer
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:938: warning: excess elements in struct initializer
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:938: warning: (near initialization for ‘postroute_hook_ops’)
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:939: error: unknown field ‘pf’ specified in initializer
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:939: warning: excess elements in struct initializer
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:939: warning: (near initialization for ‘postroute_hook_ops’)
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:940: error: unknown field ‘hooknum’ specified in initializer
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:940: warning: excess elements in struct initializer
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:940: warning: (near initialization for ‘postroute_hook_ops’)
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:941: error: unknown field ‘priority’ specified in initializer
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:941: warning: excess elements in struct initializer
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:941: warning: (near initialization for ‘postroute_hook_ops’)
/home/uncompressed/drcom-1.4.4/kmod/drcom.c: In function ‘conn_hooks_init’:
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:986: error: implicit declaration of function ‘nf_register_hook’
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:1001: error: implicit declaration of function ‘nf_unregister_hook’
/home/uncompressed/drcom-1.4.4/kmod/drcom.c: At top level:
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:1143: error: variable ‘conn_so_ops’ has initializer but incomplete type
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:1144: error: unknown field ‘pf’ specified in initializer
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:1144: warning: excess elements in struct initializer
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:1144: warning: (near initialization for ‘conn_so_ops’)
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:1145: error: unknown field ‘set_optmin’ specified in initializer
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:1145: warning: excess elements in struct initializer
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:1145: warning: (near initialization for ‘conn_so_ops’)
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:1146: error: unknown field ‘set_optmax’ specified in initializer
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:1146: warning: excess elements in struct initializer
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:1146: warning: (near initialization for ‘conn_so_ops’)
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:1147: error: unknown field ‘set’ specified in initializer
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:1147: warning: excess elements in struct initializer
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:1147: warning: (near initialization for ‘conn_so_ops’)
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:1148: error: unknown field ‘owner’ specified in initializer
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:1148: warning: excess elements in struct initializer
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:1148: warning: (near initialization for ‘conn_so_ops’)
/home/uncompressed/drcom-1.4.4/kmod/drcom.c: In function ‘init’:
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:1159: error: implicit declaration of function ‘nf_register_sockopt’
/home/uncompressed/drcom-1.4.4/kmod/drcom.c: In function ‘fini’:
/home/uncompressed/drcom-1.4.4/kmod/drcom.c:1172: error: implicit declaration of function ‘nf_unregister_sockopt’
make[3]: *** [/home/uncompressed/drcom-1.4.4/kmod/drcom.o] Error 1
make[2]: *** [_module_/home/uncompressed/drcom-1.4.4/kmod] Error 2
make[2]: Leaving directory `/usr/src/linux-2.6.24-gentoo-r4'
make[1]: *** [default] Error 2
make[1]: Leaving directory `/home/uncompressed/drcom-1.4.4/kmod'
make: *** [all] Error 1
貌似是缺少内核选项preroute_hook_ops 和conn_so_ops
把内核config这俩个选项的值改成Y或M
然后重新编译内核.
LaoLiulaoliu
帖子: 131
注册时间: 2006-10-25 17:50
来自: 南京
送出感谢: 0
接收感谢: 0
联系:

#12

帖子 LaoLiulaoliu » 2008-04-18 18:35

请问syrano叔叔,你是怎么知道preroute_hook_ops and conn_so_ops内核选项编译后使得/usr/include/linux里面产生头文件,并且这些头文件可以让nf_proto_csum_replace4和skb_make_writable 。。。等函数调用的呢
头像
syrano
帖子: 4313
注册时间: 2007-10-06 18:40
送出感谢: 0
接收感谢: 5 次

#13

帖子 syrano » 2008-04-18 21:05

ls看一下这两个选项有没有编译
CONFIG_SECURITY=y
CONFIG_SECURITY_NETWORK=y
LaoLiulaoliu
帖子: 131
注册时间: 2006-10-25 17:50
来自: 南京
送出感谢: 0
接收感谢: 0
联系:

#14

帖子 LaoLiulaoliu » 2008-04-18 22:30

你没看吗,已经用netfilter hooks,我加入
CONFIG_SECURITY=y
CONFIG_SECURITY_NETWORK=y
也没有用.

还有,内核里没有preroute_hook_ops 和conn_so_ops
LaoLiulaoliu
帖子: 131
注册时间: 2006-10-25 17:50
来自: 南京
送出感谢: 0
接收感谢: 0
联系:

#15

帖子 LaoLiulaoliu » 2008-04-19 12:28

回复

回到 “校园网拨号”