From 3368044035e0fe284099d9e6ab14286462daf0f2 Mon Sep 17 00:00:00 2001 From: Guillaume Nault Date: Wed, 6 Feb 2013 17:29:19 +0100 Subject: l2tp: No automatic CDN before cancelling sessions This patch removes the automatic sending of a CDN message when cancelling creation of new sessions. This is necessary in order to give the possibility for a tunnel to create (and possibly cancel) new sessions on its own (e.g. for placing outgoing calls). In such cases, sending a CDN message would not make sense if the session gets cancelled before any creation message was sent. Signed-off-by: Guillaume Nault --- accel-pppd/ctrl/l2tp/l2tp.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/accel-pppd/ctrl/l2tp/l2tp.c b/accel-pppd/ctrl/l2tp/l2tp.c index 15887972..13eb695a 100644 --- a/accel-pppd/ctrl/l2tp/l2tp.c +++ b/accel-pppd/ctrl/l2tp/l2tp.c @@ -539,10 +539,8 @@ static int l2tp_tunnel_confirm_session(struct l2tp_sess_t *sess) return 0; } -static int l2tp_tunnel_cancel_session(struct l2tp_sess_t *sess, - uint16_t res, uint16_t err) +static int l2tp_tunnel_cancel_session(struct l2tp_sess_t *sess) { - l2tp_send_CDN(sess, res, err); tdelete(sess, &sess->paren_conn->sessions, sess_cmp); if (sess->ctrl.calling_station_id) _free(sess->ctrl.calling_station_id); @@ -1217,7 +1215,8 @@ static int l2tp_recv_ICRQ(struct l2tp_conn_t *conn, struct l2tp_packet_t *pack) return 0; out_reject: - l2tp_tunnel_cancel_session(sess, res, err); + l2tp_send_CDN(sess, res, err); + l2tp_tunnel_cancel_session(sess); return -1; } -- cgit v1.2.3