From 3ecd0e3cc75b6ed011100dfd32cf6422889d7520 Mon Sep 17 00:00:00 2001 From: Vladislav Grishenko Date: Thu, 2 Feb 2017 18:19:05 +0500 Subject: sstp: allow 3 nak replies per 3.3.5.2.2 --- accel-pppd/ctrl/sstp/sstp.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'accel-pppd/ctrl') diff --git a/accel-pppd/ctrl/sstp/sstp.c b/accel-pppd/ctrl/sstp/sstp.c index b78ecc68..92a662e9 100644 --- a/accel-pppd/ctrl/sstp/sstp.c +++ b/accel-pppd/ctrl/sstp/sstp.c @@ -57,6 +57,7 @@ struct sstp_conn_t { #endif int state; int sstp_state; + int nak_sent; int hello_sent; // int bypass_auth:1; @@ -647,6 +648,12 @@ static int sstp_msg_call_connect_request(struct sstp_conn_t *conn) return 0; } if (ntohs(msg->attr.protocol_id) != SSTP_ENCAPSULATED_PROTOCOL_PPP) { + if (conn->nak_sent++ == 3) { + log_ppp_warn("sstp: nak limit reached\n"); + conn->sstp_state = STATE_CALL_ABORT_IN_PROGRESS_1; + if (send_sstp_msg_call_abort(conn)) + return -1; + } else if (send_sstp_msg_call_connect_nak(conn)) return -1; return 0; -- cgit v1.2.3