Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Achou.Wang
accel-ppp
提交
5927a85e
A
accel-ppp
项目概览
Achou.Wang
/
accel-ppp
通知
6
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
accel-ppp
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
5927a85e
编写于
11月 30, 2010
作者:
D
Dmitry Kozlov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ppp: use atomic increment as session generation procedure
radius: DM/CoA: skip unauthorized sessions in session search procedure
上级
2f29e750
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
6 addition
and
10 deletion
+6
-10
accel-pptpd/ppp/ppp.c
accel-pptpd/ppp/ppp.c
+4
-10
accel-pptpd/radius/radius.c
accel-pptpd/radius/radius.c
+2
-0
未找到文件。
accel-pptpd/ppp/ppp.c
浏览文件 @
5927a85e
...
...
@@ -30,8 +30,7 @@ __export LIST_HEAD(ppp_list);
static
LIST_HEAD
(
layers
);
int
__export
sock_fd
;
static
spinlock_t
seq_lock
=
SPINLOCK_INITIALIZER
;
static
uint64_t
seq
;
static
unsigned
long
long
seq
;
struct
ppp_stat_t
ppp_stat
;
...
...
@@ -70,10 +69,7 @@ static void generate_sessionid(struct ppp_t *ppp)
{
unsigned
long
long
sid
;
spin_lock
(
&
seq_lock
);
seq
++
;
sid
=
seq
;
spin_unlock
(
&
seq_lock
);
sid
=
__sync_add_and_fetch
(
&
seq
,
1
);
sprintf
(
ppp
->
sessionid
,
"%016llx"
,
sid
);
}
...
...
@@ -589,14 +585,13 @@ struct ppp_layer_data_t *ppp_find_layer_data(struct ppp_t *ppp, struct ppp_layer
static
void
save_seq
(
void
)
{
FILE
*
f
;
unsigned
long
long
sid
=
seq
;
char
*
opt
=
conf_get_opt
(
"ppp"
,
"seq-file"
);
if
(
!
opt
)
opt
=
"/var/run/accel-pptp/seq"
;
f
=
fopen
(
opt
,
"w"
);
if
(
f
)
{
fprintf
(
f
,
"%llu"
,
s
id
);
fprintf
(
f
,
"%llu"
,
s
eq
);
fclose
(
f
);
}
}
...
...
@@ -605,7 +600,6 @@ static void __init init(void)
{
char
*
opt
;
FILE
*
f
;
unsigned
long
long
sid
;
sock_fd
=
socket
(
AF_INET
,
SOCK_DGRAM
,
0
);
if
(
sock_fd
<
0
)
{
...
...
@@ -623,7 +617,7 @@ static void __init init(void)
f
=
fopen
(
opt
,
"r"
);
if
(
f
)
{
fscanf
(
f
,
"%llu"
,
&
s
id
);
fscanf
(
f
,
"%llu"
,
&
s
eq
);
seq
=
sid
;
fclose
(
f
);
}
else
...
...
accel-pptpd/radius/radius.c
浏览文件 @
5927a85e
...
...
@@ -254,6 +254,8 @@ struct radius_pd_t *rad_find_session(const char *sessionid, const char *username
pthread_rwlock_rdlock
(
&
sessions_lock
);
list_for_each_entry
(
rpd
,
&
sessions
,
entry
)
{
if
(
!
rpd
->
ppp
->
username
)
continue
;
if
(
sessionid
&&
strcmp
(
sessionid
,
rpd
->
ppp
->
sessionid
))
continue
;
if
(
username
&&
strcmp
(
username
,
rpd
->
ppp
->
username
))
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录