From 3448534c7fc579793840af199ae97f8184e99aa1 Mon Sep 17 00:00:00 2001 From: Guillaume Nault Date: Tue, 8 Apr 2014 22:53:22 +0200 Subject: l2tp: delete tunnel in l2tp_recv_StopCCN() Now that l2tp_tunnel_free() can be called directly inside the main reception loop, let l2tp_recv_StopCCN() delete the tunnel itself. This avoids special handling in l2tp_conn_read(). Signed-off-by: Guillaume Nault --- accel-pppd/ctrl/l2tp/l2tp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'accel-pppd') diff --git a/accel-pppd/ctrl/l2tp/l2tp.c b/accel-pppd/ctrl/l2tp/l2tp.c index 8addf16..e6ec075 100644 --- a/accel-pppd/ctrl/l2tp/l2tp.c +++ b/accel-pppd/ctrl/l2tp/l2tp.c @@ -2746,6 +2746,8 @@ static int l2tp_recv_StopCCN(struct l2tp_conn_t *conn, if (l2tp_send_ZLB(conn) < 0) log_tunnel(log_warn, conn, "acknowledging StopCCN failed\n"); + l2tp_tunnel_free(conn); + return -1; } @@ -3732,7 +3734,7 @@ static int l2tp_conn_read(struct triton_md_handler_t *h) break; case Message_Type_Stop_Ctrl_Conn_Notify: l2tp_recv_StopCCN(conn, pack); - goto drop; + break; case Message_Type_Hello: l2tp_recv_HELLO(conn, pack); break; -- cgit v1.2.3