diff options
author | Guillaume Nault <g.nault@alphalink.fr> | 2013-03-25 12:47:28 +0100 |
---|---|---|
committer | Dmitry Kozlov <xeb@mail.ru> | 2013-03-28 07:16:19 +0400 |
commit | f6e23c2c28d5f36efe2a99eaccba2e6f7eae80b2 (patch) | |
tree | 1fd92b5ce6d6bb550e027826b1a4f2465275f338 /accel-pppd/ctrl/l2tp | |
parent | 64a6e32c38df52282c83282e636c8a7cf7851da1 (diff) | |
download | accel-ppp-f6e23c2c28d5f36efe2a99eaccba2e6f7eae80b2.tar.gz accel-ppp-f6e23c2c28d5f36efe2a99eaccba2e6f7eae80b2.zip |
l2tp: Handle WEN messages
Implement minimal WEN messages processing, so that they get properly
acknowledged.
Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
Diffstat (limited to 'accel-pppd/ctrl/l2tp')
-rw-r--r-- | accel-pppd/ctrl/l2tp/l2tp.c | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/accel-pppd/ctrl/l2tp/l2tp.c b/accel-pppd/ctrl/l2tp/l2tp.c index 2ffe074..bfc3ab1 100644 --- a/accel-pppd/ctrl/l2tp/l2tp.c +++ b/accel-pppd/ctrl/l2tp/l2tp.c @@ -2870,6 +2870,26 @@ static int l2tp_recv_CDN(struct l2tp_sess_t *sess, return 0; } +static int l2tp_recv_WEN(struct l2tp_conn_t *conn, + const struct l2tp_packet_t *pack) +{ + if (!conn->lns_mode) { + log_tunnel(log_warn, conn, "discarding unexpected WEN\n"); + return 0; + } + + if (conf_verbose) + log_tunnel(log_info1, conn, "handling WEN\n"); + + if (l2tp_send_ZLB(conn) < 0) { + log_tunnel(log_error, conn, "impossible to handle WEN:" + " sending ZLB failed\n"); + return -1; + } + + return 0; +} + static int l2tp_recv_SLI(struct l2tp_conn_t *conn, const struct l2tp_packet_t *pack) { @@ -3150,13 +3170,15 @@ static int l2tp_conn_read(struct triton_md_handler_t *h) l2tp_packet_free(pack); } continue; + case Message_Type_WAN_Error_Notify: + l2tp_recv_WEN(conn, pack); + break; case Message_Type_Set_Link_Info: l2tp_recv_SLI(conn, pack); break; case Message_Type_Start_Ctrl_Conn_Request: - case Message_Type_WAN_Error_Notify: - if (conf_verbose) - log_warn("l2tp: unexpected Message-Type %i\n", msg_type->val.uint16); + log_tunnel(log_warn, conn, + "discarding unexpected SCCRQ\n"); break; default: if (msg_type->M) { |