summaryrefslogtreecommitdiff
path: root/accel-pppd/ctrl
diff options
context:
space:
mode:
authorGuillaume Nault <g.nault@alphalink.fr>2014-04-08 23:15:42 +0200
committerDmitry Kozlov <xeb@mail.ru>2014-04-11 06:47:58 +0400
commit7937f571305b950f11ddc470fbec9d83e0cc1d74 (patch)
treea64f7df943ce2b751430d1440fda6c833acae074 /accel-pppd/ctrl
parent19cff977b7c249e69626bce816baac3eb7a71d3f (diff)
downloadaccel-ppp-7937f571305b950f11ddc470fbec9d83e0cc1d74.tar.gz
accel-ppp-7937f571305b950f11ddc470fbec9d83e0cc1d74.zip
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 <g.nault@alphalink.fr>
Diffstat (limited to 'accel-pppd/ctrl')
-rw-r--r--accel-pppd/ctrl/l2tp/l2tp.c17
1 files changed, 17 insertions, 0 deletions
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: