summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Nault <g.nault@alphalink.fr>2013-03-15 21:48:31 +0100
committerKozlov Dmitry <xeb@mail.ru>2013-03-16 08:34:46 +0400
commitb95734f0b939697e504747c4abb69d599fe45ad3 (patch)
treefc119e3c4e351bc9d03c88826e883b087c7e114b
parent23eb9d4294a70ae725718ccd46ef04a01657d6b2 (diff)
downloadaccel-ppp-b95734f0b939697e504747c4abb69d599fe45ad3.tar.gz
accel-ppp-b95734f0b939697e504747c4abb69d599fe45ad3.zip
l2tp: Notify peer upon tunnel/session timeout
If tunnel or session establishment timeout expires, send StopCCN or CDN to notify peer before closing tunnel/session. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
-rw-r--r--accel-pppd/ctrl/l2tp/l2tp.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/accel-pppd/ctrl/l2tp/l2tp.c b/accel-pppd/ctrl/l2tp/l2tp.c
index 87c12678..958eeb4f 100644
--- a/accel-pppd/ctrl/l2tp/l2tp.c
+++ b/accel-pppd/ctrl/l2tp/l2tp.c
@@ -794,7 +794,8 @@ static void l2tp_session_timeout(struct triton_timer_t *t)
timeout_timer);
log_ppp_debug("l2tp: session timeout\n");
- l2tp_session_free(sess);
+ if (l2tp_session_disconnect(sess, 10, 0) < 0)
+ log_session(log_error, sess, "session disconnection failed\n");
}
static struct l2tp_sess_t *l2tp_tunnel_new_session(struct l2tp_conn_t *conn)
@@ -1337,8 +1338,11 @@ static void l2tp_rtimeout(struct triton_timer_t *t)
static void l2tp_timeout(struct triton_timer_t *t)
{
- struct l2tp_conn_t *conn = container_of(t, typeof(*conn), timeout_timer);
+ struct l2tp_conn_t *conn = container_of(t, typeof(*conn),
+ timeout_timer);
+
log_ppp_debug("l2tp: timeout\n");
+ l2tp_tunnel_disconnect(conn, 1, 0);
l2tp_tunnel_free(conn);
}