Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Achou.Wang
accel-ppp
提交
939e9524
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,体验更适合开发者的 AI 搜索 >>
提交
939e9524
编写于
3月 04, 2018
作者:
V
Vladislav Grishenko
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix possible null pointer dereferences
上级
5ccf2f04
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
13 addition
and
6 deletion
+13
-6
accel-pppd/ctrl/ipoe/dhcpv4.c
accel-pppd/ctrl/ipoe/dhcpv4.c
+3
-1
accel-pppd/ctrl/l2tp/l2tp.c
accel-pppd/ctrl/l2tp/l2tp.c
+1
-1
accel-pppd/lua/session.c
accel-pppd/lua/session.c
+4
-2
accel-pppd/radius/backup.c
accel-pppd/radius/backup.c
+5
-2
未找到文件。
accel-pppd/ctrl/ipoe/dhcpv4.c
浏览文件 @
939e9524
...
...
@@ -1145,7 +1145,7 @@ void dhcpv4_reserve_ip(struct dhcpv4_serv *serv, uint32_t ip)
struct
dhcpv4_packet
*
dhcpv4_clone_radius
(
struct
rad_packet_t
*
rad
)
{
struct
dhcpv4_packet
*
pkt
=
dhcpv4_packet_alloc
();
uint8_t
*
ptr
=
pkt
->
data
,
*
endptr
=
ptr
+
BUF_SIZE
;
uint8_t
*
ptr
,
*
endptr
;
struct
dhcpv4_option
*
opt
;
struct
rad_attr_t
*
attr
;
...
...
@@ -1153,6 +1153,8 @@ struct dhcpv4_packet *dhcpv4_clone_radius(struct rad_packet_t *rad)
return
NULL
;
pkt
->
refs
=
1
;
ptr
=
pkt
->
data
;
endptr
=
ptr
+
BUF_SIZE
;
list_for_each_entry
(
attr
,
&
rad
->
attrs
,
entry
)
{
if
(
attr
->
vendor
&&
attr
->
vendor
->
id
==
VENDOR_DHCP
&&
attr
->
attr
->
id
<
256
)
{
...
...
accel-pppd/ctrl/l2tp/l2tp.c
浏览文件 @
939e9524
...
...
@@ -3119,7 +3119,7 @@ static int rescode_get_data(const struct l2tp_attr_t *result_attr,
return
2
;
*
err_msg
=
_malloc
(
msglen
+
1
);
if
(
err_msg
)
{
if
(
*
err_msg
)
{
memcpy
(
*
err_msg
,
resavp
->
error_msg
,
msglen
);
(
*
err_msg
)[
msglen
]
=
'\0'
;
}
...
...
accel-pppd/lua/session.c
浏览文件 @
939e9524
...
...
@@ -217,11 +217,12 @@ static int session_rx_bytes(lua_State *L)
{
struct
ap_session
*
ses
=
luaL_checkudata
(
L
,
1
,
LUA_AP_SESSION
);
uint64_t
gword_sz
=
(
uint64_t
)
UINT32_MAX
+
1
;
uint64_t
bytes
=
gword_sz
*
ses
->
acct_input_gigawords
+
ses
->
acct_rx_bytes
;
uint64_t
bytes
;
if
(
!
ses
)
return
0
;
bytes
=
gword_sz
*
ses
->
acct_input_gigawords
+
ses
->
acct_rx_bytes
;
lua_pushnumber
(
L
,
bytes
);
return
1
;
...
...
@@ -231,11 +232,12 @@ static int session_tx_bytes(lua_State *L)
{
struct
ap_session
*
ses
=
luaL_checkudata
(
L
,
1
,
LUA_AP_SESSION
);
uint64_t
gword_sz
=
(
uint64_t
)
UINT32_MAX
+
1
;
uint64_t
bytes
=
gword_sz
*
ses
->
acct_output_gigawords
+
ses
->
acct_tx_bytes
;
uint64_t
bytes
;
if
(
!
ses
)
return
0
;
bytes
=
gword_sz
*
ses
->
acct_output_gigawords
+
ses
->
acct_tx_bytes
;
lua_pushnumber
(
L
,
bytes
);
return
1
;
...
...
accel-pppd/radius/backup.c
浏览文件 @
939e9524
...
...
@@ -30,8 +30,8 @@
static
int
session_save
(
struct
ap_session
*
ses
,
struct
backup_mod
*
m
)
{
struct
radius_pd_t
*
rpd
=
find_pd
(
ses
);
uint64_t
session_timeout
=
ses
->
start_time
+
rpd
->
session_timeout
.
expire_tv
.
tv_sec
;
uint32_t
idle_timeout
=
rpd
->
idle_timeout
.
period
/
1000
;
uint64_t
session_timeout
;
uint32_t
idle_timeout
;
if
(
!
rpd
)
return
0
;
...
...
@@ -39,6 +39,9 @@ static int session_save(struct ap_session *ses, struct backup_mod *m)
if
(
!
rpd
->
authenticated
)
return
-
2
;
session_timeout
=
ses
->
start_time
+
rpd
->
session_timeout
.
expire_tv
.
tv_sec
;
idle_timeout
=
rpd
->
idle_timeout
.
period
/
1000
;
add_tag
(
RAD_TAG_INTERIM_INTERVAL
,
&
rpd
->
acct_interim_interval
,
4
);
if
(
rpd
->
session_timeout
.
tpd
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录