summaryrefslogtreecommitdiff
path: root/accel-pppd
diff options
context:
space:
mode:
authorGuillaume Nault <g.nault@alphalink.fr>2014-03-28 21:05:52 +0100
committerDmitry Kozlov <xeb@mail.ru>2014-04-01 06:48:02 +0400
commitd8fb53e618e6cc191c226ece0320116e293f3d84 (patch)
tree70cd3e50a3839fa36b7d343ef3a138571d0d4f6b /accel-pppd
parentddeee1ee45e0704c432f2d430231729421f27b0f (diff)
downloadaccel-ppp-d8fb53e618e6cc191c226ece0320116e293f3d84.tar.gz
accel-ppp-d8fb53e618e6cc191c226ece0320116e293f3d84.zip
l2tp: delete tunnel/session connection timeout after expiration
Tunnel and session establishment timers should to be unset after they expire. Otherwise, they may uselessly expire again while disconnection is performed. While here, rename l2tp_timeout() to l2tp_tunnel_timeout() for consistency with its session counterpart. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
Diffstat (limited to 'accel-pppd')
-rw-r--r--accel-pppd/ctrl/l2tp/l2tp.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/accel-pppd/ctrl/l2tp/l2tp.c b/accel-pppd/ctrl/l2tp/l2tp.c
index 1dc0666..a425627 100644
--- a/accel-pppd/ctrl/l2tp/l2tp.c
+++ b/accel-pppd/ctrl/l2tp/l2tp.c
@@ -156,7 +156,7 @@ static uint16_t l2tp_tid;
static mempool_t l2tp_conn_pool;
static mempool_t l2tp_sess_pool;
-static void l2tp_timeout(struct triton_timer_t *t);
+static void l2tp_tunnel_timeout(struct triton_timer_t *t);
static void l2tp_rtimeout(struct triton_timer_t *t);
static void l2tp_send_HELLO(struct triton_timer_t *t);
static int l2tp_tunnel_send(struct l2tp_conn_t *conn,
@@ -1044,6 +1044,7 @@ static void l2tp_session_timeout(struct triton_timer_t *t)
struct l2tp_sess_t *sess = container_of(t, typeof(*sess),
timeout_timer);
+ triton_timer_del(t);
log_session(log_info1, sess, "session establishment timeout,"
" disconnecting session\n");
l2tp_session_disconnect(sess, 10, 0);
@@ -1303,7 +1304,7 @@ static struct l2tp_conn_t *l2tp_tunnel_alloc(const struct sockaddr_in *peer,
conn->ctx.before_switch = log_switch;
conn->ctx.close = l2tp_conn_close;
conn->hnd.read = l2tp_conn_read;
- conn->timeout_timer.expire = l2tp_timeout;
+ conn->timeout_timer.expire = l2tp_tunnel_timeout;
conn->timeout_timer.period = conf_timeout * 1000;
conn->rtimeout_timer.expire = l2tp_rtimeout;
conn->rtimeout_timer.period = conf_rtimeout * 1000;
@@ -1673,11 +1674,12 @@ static void l2tp_rtimeout(struct triton_timer_t *t)
}
}
-static void l2tp_timeout(struct triton_timer_t *t)
+static void l2tp_tunnel_timeout(struct triton_timer_t *t)
{
struct l2tp_conn_t *conn = container_of(t, typeof(*conn),
timeout_timer);
+ triton_timer_del(t);
log_tunnel(log_info1, conn, "tunnel establishment timeout,"
" disconnecting tunnel\n");
l2tp_tunnel_disconnect(conn, 1, 0);