From 7937f571305b950f11ddc470fbec9d83e0cc1d74 Mon Sep 17 00:00:00 2001 From: Guillaume Nault Date: Tue, 8 Apr 2014 23:15:42 +0200 Subject: l2tp: allow CDN reception with no Session ID If a peer needs to disconnect a session for which it didn't receive any reply, it sends a CDN with no Session ID. In this case, the Assigned Session ID AVP is the only data that can be used to find out which session has to be closed. Though it isn't supported for now, let's accept and ack these messages. Session will be deleted on our side thanks to the establishment timer. Signed-off-by: Guillaume Nault --- accel-pppd/ctrl/l2tp/l2tp.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'accel-pppd/ctrl/l2tp') diff --git a/accel-pppd/ctrl/l2tp/l2tp.c b/accel-pppd/ctrl/l2tp/l2tp.c index 97164746..635c296f 100644 --- a/accel-pppd/ctrl/l2tp/l2tp.c +++ b/accel-pppd/ctrl/l2tp/l2tp.c @@ -3723,6 +3723,21 @@ static int l2tp_recv_CDN(struct l2tp_sess_t *sess, return 0; } +static int l2tp_tunnel_recv_CDN(struct l2tp_conn_t *conn, + const struct l2tp_packet_t *pack) +{ + if (conn->state != STATE_ESTB) { + log_tunnel(log_warn, conn, "discarding unexpected CDN\n"); + + return 0; + } + + log_tunnel(log_warn, conn, "discarding CDN with no Session ID:" + " disconnecting sessions using Assigned Session ID is currently not supported\n"); + + return 0; +} + static int l2tp_recv_WEN(struct l2tp_sess_t *sess, const struct l2tp_packet_t *pack) { @@ -3907,6 +3922,8 @@ static void l2tp_tunnel_recv(struct l2tp_conn_t *conn, l2tp_recv_ICRQ(conn, pack); break; case Message_Type_Call_Disconnect_Notify: + l2tp_tunnel_recv_CDN(conn, pack); + break; case Message_Type_Outgoing_Call_Reply: case Message_Type_Outgoing_Call_Connected: case Message_Type_Incoming_Call_Reply: -- cgit v1.2.3