summaryrefslogtreecommitdiff
path: root/accel-pppd/ctrl/l2tp/l2tp.c
diff options
context:
space:
mode:
authorGuillaume Nault <g.nault@alphalink.fr>2014-04-08 22:52:42 +0200
committerDmitry Kozlov <xeb@mail.ru>2014-04-11 06:47:26 +0400
commit411c4f943bdfdc8ebb79582d17e93923109c95b0 (patch)
tree4df680d227ef3a448638fa3c24480463acc75707 /accel-pppd/ctrl/l2tp/l2tp.c
parentba47f76156c7fbffe09c2f09fa41eb72aa5c06fd (diff)
downloadaccel-ppp-411c4f943bdfdc8ebb79582d17e93923109c95b0.tar.gz
accel-ppp-411c4f943bdfdc8ebb79582d17e93923109c95b0.zip
l2tp: don't free tunnel immediately upon message handling errors
Upon failure, l2tp_recv_SCCRP() and l2tp_recv_SCCCN() disconnect their tunnel, which is then immediately deleted by l2tp_conn_read(). Deleting the tunnel isn't necessary at this stage and prevents retransmission of the disconnection message if it gets lost. Same applies to unknown message types with M bit set. This path avoids immediate tunnel deletion, thus allowing the disconnection process to handle acknowledgments from peer and to retransmit messages if necessary. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
Diffstat (limited to 'accel-pppd/ctrl/l2tp/l2tp.c')
-rw-r--r--accel-pppd/ctrl/l2tp/l2tp.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/accel-pppd/ctrl/l2tp/l2tp.c b/accel-pppd/ctrl/l2tp/l2tp.c
index dc11b42..086d2a8 100644
--- a/accel-pppd/ctrl/l2tp/l2tp.c
+++ b/accel-pppd/ctrl/l2tp/l2tp.c
@@ -3723,12 +3723,10 @@ static int l2tp_conn_read(struct triton_md_handler_t *h)
switch (msg_type->val.uint16) {
case Message_Type_Start_Ctrl_Conn_Reply:
- if (l2tp_recv_SCCRP(conn, pack))
- goto drop;
+ l2tp_recv_SCCRP(conn, pack);
break;
case Message_Type_Start_Ctrl_Conn_Connected:
- if (l2tp_recv_SCCCN(conn, pack))
- goto drop;
+ l2tp_recv_SCCCN(conn, pack);
break;
case Message_Type_Stop_Ctrl_Conn_Notify:
l2tp_recv_StopCCN(conn, pack);
@@ -3771,7 +3769,6 @@ static int l2tp_conn_read(struct triton_md_handler_t *h)
" %i, disconnecting tunnel\n",
msg_type->val.uint16);
l2tp_tunnel_disconnect(conn, 2, 8);
- goto drop;
} else
log_tunnel(log_warn, conn,
"discarding unknown message type %i\n",