From: David Woodhouse Date: Tue, 27 Apr 2021 23:10:31 +0000 (+0100) Subject: Abort if PPP transport is closed in PPPS_ESTABLISH X-Git-Tag: v8.20~253 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=6a4220b714559dafe39ecd4ee128c1b7958ab3bf;p=users%2Fdwmw2%2Fopenconnect.git Abort if PPP transport is closed in PPPS_ESTABLISH The Fortinet server just closes the connection on us when it screws up reconnection and thinks it can't allocate an IP address. Don't retry ad infinitum; give up. Signed-off-by: David Woodhouse --- diff --git a/ppp.c b/ppp.c index 6526b0f2..753a3b22 100644 --- a/ppp.c +++ b/ppp.c @@ -1367,6 +1367,11 @@ static int ppp_mainloop(struct openconnect_info *vpninfo, int dtls, * the protocol to handle any magic required to reopen it. */ dtls_close(vpninfo); } else { + if (ppp->ppp_state == PPPS_ESTABLISH) { + vpn_progress(vpninfo, PRG_ERR, _("Failed to establish PPP\n")); + vpninfo->quit_reason = "Failed to establish PPP"; + return -EPERM; + } ret = ssl_reconnect(vpninfo); if (ret) { vpn_progress(vpninfo, PRG_ERR, _("Reconnect failed\n"));