]> www.infradead.org Git - users/dwmw2/openconnect.git/commitdiff
Abort if PPP transport is closed in PPPS_ESTABLISH
authorDavid Woodhouse <dwmw2@infradead.org>
Tue, 27 Apr 2021 23:10:31 +0000 (00:10 +0100)
committerDavid Woodhouse <dwmw2@infradead.org>
Tue, 27 Apr 2021 23:10:31 +0000 (00:10 +0100)
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 <dwmw2@infradead.org>
ppp.c

diff --git a/ppp.c b/ppp.c
index 6526b0f262bc7eef8db8511592ee91a9f2ce421b..753a3b22bb746e7ecb230b4f2d8e649d7675da16 100644 (file)
--- 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"));