Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Achou.Wang
accel-ppp
提交
b4d2b981
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 搜索 >>
提交
b4d2b981
编写于
1月 26, 2013
作者:
K
Kozlov Dmitry
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Revert "ipoe: insert opt82 to each relay packet"
This reverts commit
cde7ee4d
.
上级
cde7ee4d
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
17 addition
and
24 deletion
+17
-24
accel-pppd/ctrl/ipoe/dhcpv4.c
accel-pppd/ctrl/ipoe/dhcpv4.c
+4
-14
accel-pppd/ctrl/ipoe/dhcpv4.h
accel-pppd/ctrl/ipoe/dhcpv4.h
+2
-4
accel-pppd/ctrl/ipoe/ipoe.c
accel-pppd/ctrl/ipoe/ipoe.c
+11
-6
未找到文件。
accel-pppd/ctrl/ipoe/dhcpv4.c
浏览文件 @
b4d2b981
...
@@ -891,7 +891,7 @@ void dhcpv4_relay_free(struct dhcpv4_relay *r, struct triton_context_t *ctx)
...
@@ -891,7 +891,7 @@ void dhcpv4_relay_free(struct dhcpv4_relay *r, struct triton_context_t *ctx)
}
}
}
}
int
dhcpv4_relay_send
(
struct
dhcpv4_relay
*
relay
,
struct
dhcpv4_packet
*
request
,
uint32_t
server_id
,
const
char
*
agent_circuit_id
,
const
char
*
agent_remote_id
)
int
dhcpv4_relay_send
(
struct
dhcpv4_relay
*
relay
,
struct
dhcpv4_packet
*
request
,
uint32_t
server_id
)
{
{
int
n
;
int
n
;
int
len
=
request
->
ptr
-
request
->
data
;
int
len
=
request
->
ptr
-
request
->
data
;
...
@@ -899,9 +899,6 @@ int dhcpv4_relay_send(struct dhcpv4_relay *relay, struct dhcpv4_packet *request,
...
@@ -899,9 +899,6 @@ int dhcpv4_relay_send(struct dhcpv4_relay *relay, struct dhcpv4_packet *request,
struct
dhcpv4_option
*
opt
=
NULL
;
struct
dhcpv4_option
*
opt
=
NULL
;
uint32_t
_server_id
;
uint32_t
_server_id
;
if
(
!
request
->
relay_agent
&&
dhcpv4_packet_insert_opt82
(
request
,
agent_circuit_id
,
agent_remote_id
))
return
-
1
;
request
->
hdr
->
giaddr
=
relay
->
giaddr
;
request
->
hdr
->
giaddr
=
relay
->
giaddr
;
if
(
server_id
)
{
if
(
server_id
)
{
...
@@ -931,8 +928,7 @@ int dhcpv4_relay_send(struct dhcpv4_relay *relay, struct dhcpv4_packet *request,
...
@@ -931,8 +928,7 @@ int dhcpv4_relay_send(struct dhcpv4_relay *relay, struct dhcpv4_packet *request,
}
}
int
dhcpv4_relay_send_release
(
struct
dhcpv4_relay
*
relay
,
uint8_t
*
chaddr
,
uint32_t
xid
,
uint32_t
ciaddr
,
int
dhcpv4_relay_send_release
(
struct
dhcpv4_relay
*
relay
,
uint8_t
*
chaddr
,
uint32_t
xid
,
uint32_t
ciaddr
,
struct
dhcpv4_option
*
client_id
,
struct
dhcpv4_option
*
relay_agent
,
struct
dhcpv4_option
*
client_id
,
struct
dhcpv4_option
*
relay_agent
)
const
char
*
agent_circuit_id
,
const
char
*
agent_remote_id
)
{
{
struct
dhcpv4_packet
*
pack
;
struct
dhcpv4_packet
*
pack
;
int
n
,
len
;
int
n
,
len
;
...
@@ -963,14 +959,8 @@ int dhcpv4_relay_send_release(struct dhcpv4_relay *relay, uint8_t *chaddr, uint3
...
@@ -963,14 +959,8 @@ int dhcpv4_relay_send_release(struct dhcpv4_relay *relay, uint8_t *chaddr, uint3
if
(
relay_agent
&&
dhcpv4_packet_add_opt
(
pack
,
82
,
relay_agent
->
data
,
relay_agent
->
len
))
if
(
relay_agent
&&
dhcpv4_packet_add_opt
(
pack
,
82
,
relay_agent
->
data
,
relay_agent
->
len
))
goto
out_err
;
goto
out_err
;
else
if
(
!
relay_agent
)
{
pack
->
ptr
++
;
*
pack
->
ptr
=
255
;
pack
->
ptr
++
;
if
(
dhcpv4_packet_insert_opt82
(
pack
,
agent_circuit_id
,
agent_remote_id
))
goto
out_err
;
pack
->
ptr
--
;
}
*
pack
->
ptr
++
=
255
;
len
=
pack
->
ptr
-
pack
->
data
;
len
=
pack
->
ptr
-
pack
->
data
;
...
...
accel-pppd/ctrl/ipoe/dhcpv4.h
浏览文件 @
b4d2b981
...
@@ -105,11 +105,9 @@ void dhcpv4_free(struct dhcpv4_serv *);
...
@@ -105,11 +105,9 @@ void dhcpv4_free(struct dhcpv4_serv *);
struct
dhcpv4_relay
*
dhcpv4_relay_create
(
const
char
*
addr
,
const
char
*
giaddr
,
struct
triton_context_t
*
ctx
,
triton_event_func
recv
);
struct
dhcpv4_relay
*
dhcpv4_relay_create
(
const
char
*
addr
,
const
char
*
giaddr
,
struct
triton_context_t
*
ctx
,
triton_event_func
recv
);
void
dhcpv4_relay_free
(
struct
dhcpv4_relay
*
,
struct
triton_context_t
*
);
void
dhcpv4_relay_free
(
struct
dhcpv4_relay
*
,
struct
triton_context_t
*
);
int
dhcpv4_relay_send
(
struct
dhcpv4_relay
*
relay
,
struct
dhcpv4_packet
*
request
,
uint32_t
server_id
,
int
dhcpv4_relay_send
(
struct
dhcpv4_relay
*
relay
,
struct
dhcpv4_packet
*
request
,
uint32_t
server_id
);
const
char
*
agent_circuit_id
,
const
char
*
agent_remote_id
);
int
dhcpv4_relay_send_release
(
struct
dhcpv4_relay
*
relay
,
uint8_t
*
chaddr
,
uint32_t
xid
,
uint32_t
ciaddr
,
int
dhcpv4_relay_send_release
(
struct
dhcpv4_relay
*
relay
,
uint8_t
*
chaddr
,
uint32_t
xid
,
uint32_t
ciaddr
,
struct
dhcpv4_option
*
client_id
,
struct
dhcpv4_option
*
relay_agent
,
struct
dhcpv4_option
*
client_id
,
struct
dhcpv4_option
*
relay_agent
);
const
char
*
agent_circuit_id
,
const
char
*
agent_remote_id
);
int
dhcpv4_send_reply
(
int
msg_type
,
struct
dhcpv4_serv
*
serv
,
struct
dhcpv4_packet
*
req
,
uint32_t
yiaddr
,
uint32_t
siaddr
,
uint32_t
mask
,
int
lease_time
,
struct
dhcpv4_packet
*
relay_reply
);
int
dhcpv4_send_reply
(
int
msg_type
,
struct
dhcpv4_serv
*
serv
,
struct
dhcpv4_packet
*
req
,
uint32_t
yiaddr
,
uint32_t
siaddr
,
uint32_t
mask
,
int
lease_time
,
struct
dhcpv4_packet
*
relay_reply
);
int
dhcpv4_send_nak
(
struct
dhcpv4_serv
*
serv
,
struct
dhcpv4_packet
*
req
);
int
dhcpv4_send_nak
(
struct
dhcpv4_serv
*
serv
,
struct
dhcpv4_packet
*
req
);
...
...
accel-pppd/ctrl/ipoe/ipoe.c
浏览文件 @
b4d2b981
...
@@ -401,7 +401,12 @@ static void ipoe_session_start(struct ipoe_session *ses)
...
@@ -401,7 +401,12 @@ static void ipoe_session_start(struct ipoe_session *ses)
}
}
if
(
ses
->
dhcpv4_request
&&
ses
->
serv
->
dhcpv4_relay
)
{
if
(
ses
->
dhcpv4_request
&&
ses
->
serv
->
dhcpv4_relay
)
{
dhcpv4_relay_send
(
ses
->
serv
->
dhcpv4_relay
,
ses
->
dhcpv4_request
,
ses
->
relay_server_id
,
ses
->
serv
->
ifname
,
conf_agent_remote_id
);
if
(
!
ses
->
dhcpv4_request
->
relay_agent
&&
dhcpv4_packet_insert_opt82
(
ses
->
dhcpv4_request
,
ses
->
serv
->
ifname
,
conf_agent_remote_id
))
{
ap_session_terminate
(
&
ses
->
ses
,
TERM_NAS_ERROR
,
0
);
return
;
}
dhcpv4_relay_send
(
ses
->
serv
->
dhcpv4_relay
,
ses
->
dhcpv4_request
,
ses
->
relay_server_id
);
ses
->
timer
.
expire
=
ipoe_session_timeout
;
ses
->
timer
.
expire
=
ipoe_session_timeout
;
ses
->
timer
.
expire_tv
.
tv_sec
=
conf_offer_timeout
;
ses
->
timer
.
expire_tv
.
tv_sec
=
conf_offer_timeout
;
...
@@ -583,7 +588,7 @@ static void __ipoe_session_activate(struct ipoe_session *ses)
...
@@ -583,7 +588,7 @@ static void __ipoe_session_activate(struct ipoe_session *ses)
static
void
ipoe_session_activate
(
struct
ipoe_session
*
ses
)
static
void
ipoe_session_activate
(
struct
ipoe_session
*
ses
)
{
{
if
(
ses
->
serv
->
dhcpv4_relay
)
if
(
ses
->
serv
->
dhcpv4_relay
)
dhcpv4_relay_send
(
ses
->
serv
->
dhcpv4_relay
,
ses
->
dhcpv4_request
,
ses
->
relay_server_id
,
ses
->
serv
->
ifname
,
conf_agent_remote_id
);
dhcpv4_relay_send
(
ses
->
serv
->
dhcpv4_relay
,
ses
->
dhcpv4_request
,
ses
->
relay_server_id
);
else
else
__ipoe_session_activate
(
ses
);
__ipoe_session_activate
(
ses
);
}
}
...
@@ -603,7 +608,7 @@ static void ipoe_session_keepalive(struct dhcpv4_packet *pack)
...
@@ -603,7 +608,7 @@ static void ipoe_session_keepalive(struct dhcpv4_packet *pack)
ses
->
xid
=
ses
->
dhcpv4_request
->
hdr
->
xid
;
ses
->
xid
=
ses
->
dhcpv4_request
->
hdr
->
xid
;
if
(
ses
->
ses
.
state
==
AP_STATE_ACTIVE
&&
ses
->
serv
->
dhcpv4_relay
)
{
if
(
ses
->
ses
.
state
==
AP_STATE_ACTIVE
&&
ses
->
serv
->
dhcpv4_relay
)
{
dhcpv4_relay_send
(
ses
->
serv
->
dhcpv4_relay
,
ses
->
dhcpv4_request
,
ses
->
relay_server_id
,
ses
->
serv
->
ifname
,
conf_agent_remote_id
);
dhcpv4_relay_send
(
ses
->
serv
->
dhcpv4_relay
,
ses
->
dhcpv4_request
,
ses
->
relay_server_id
);
return
;
return
;
}
}
...
@@ -680,7 +685,7 @@ static void ipoe_session_finished(struct ap_session *s)
...
@@ -680,7 +685,7 @@ static void ipoe_session_finished(struct ap_session *s)
dhcpv4_put_ip
(
ses
->
serv
->
dhcpv4
,
ses
->
yiaddr
);
dhcpv4_put_ip
(
ses
->
serv
->
dhcpv4
,
ses
->
yiaddr
);
if
(
ses
->
relay_addr
&&
ses
->
serv
->
dhcpv4_relay
)
if
(
ses
->
relay_addr
&&
ses
->
serv
->
dhcpv4_relay
)
dhcpv4_relay_send_release
(
ses
->
serv
->
dhcpv4_relay
,
ses
->
hwaddr
,
ses
->
xid
,
ses
->
yiaddr
,
ses
->
client_id
,
ses
->
relay_agent
,
ses
->
serv
->
ifname
,
conf_agent_remote_id
);
dhcpv4_relay_send_release
(
ses
->
serv
->
dhcpv4_relay
,
ses
->
hwaddr
,
ses
->
xid
,
ses
->
yiaddr
,
ses
->
client_id
,
ses
->
relay_agent
);
if
(
ses
->
ifcfg
)
if
(
ses
->
ifcfg
)
ipoe_ifcfg_del
(
ses
);
ipoe_ifcfg_del
(
ses
);
...
@@ -857,7 +862,7 @@ static void ipoe_recv_dhcpv4(struct dhcpv4_serv *dhcpv4, struct dhcpv4_packet *p
...
@@ -857,7 +862,7 @@ static void ipoe_recv_dhcpv4(struct dhcpv4_serv *dhcpv4, struct dhcpv4_packet *p
if
(
pack
->
server_id
==
ses
->
siaddr
)
if
(
pack
->
server_id
==
ses
->
siaddr
)
dhcpv4_send_nak
(
dhcpv4
,
pack
);
dhcpv4_send_nak
(
dhcpv4
,
pack
);
else
if
(
ses
->
serv
->
dhcpv4_relay
)
else
if
(
ses
->
serv
->
dhcpv4_relay
)
dhcpv4_relay_send
(
ses
->
serv
->
dhcpv4_relay
,
pack
,
0
,
ses
->
serv
->
ifname
,
conf_agent_remote_id
);
dhcpv4_relay_send
(
ses
->
serv
->
dhcpv4_relay
,
pack
,
0
);
ap_session_terminate
(
&
ses
->
ses
,
TERM_USER_REQUEST
,
0
);
ap_session_terminate
(
&
ses
->
ses
,
TERM_USER_REQUEST
,
0
);
}
else
{
}
else
{
...
@@ -890,7 +895,7 @@ static void ipoe_recv_dhcpv4(struct dhcpv4_serv *dhcpv4, struct dhcpv4_packet *p
...
@@ -890,7 +895,7 @@ static void ipoe_recv_dhcpv4(struct dhcpv4_serv *dhcpv4, struct dhcpv4_packet *p
}
}
if
(
pack
->
msg_type
==
DHCPDECLINE
&&
ses
->
serv
->
dhcpv4_relay
)
if
(
pack
->
msg_type
==
DHCPDECLINE
&&
ses
->
serv
->
dhcpv4_relay
)
dhcpv4_relay_send
(
ses
->
serv
->
dhcpv4_relay
,
pack
,
0
,
ses
->
serv
->
ifname
,
conf_agent_remote_id
);
dhcpv4_relay_send
(
ses
->
serv
->
dhcpv4_relay
,
pack
,
0
);
ap_session_terminate
(
&
ses
->
ses
,
TERM_USER_REQUEST
,
0
);
ap_session_terminate
(
&
ses
->
ses
,
TERM_USER_REQUEST
,
0
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录