]> www.infradead.org Git - users/dwmw2/openconnect.git/commitdiff
Add 'attempt-reconnect' vpnc-script reason
authorDavid Woodhouse <dwmw2@infradead.org>
Tue, 15 Jan 2019 15:16:08 +0000 (17:16 +0200)
committerDavid Woodhouse <dwmw2@infradead.org>
Wed, 16 Jan 2019 08:37:02 +0000 (10:37 +0200)
In https://gitlab.com/openconnect/openconnect/issues/17 we think we need
to give the vpnc-script a chance to reinstate the host route to the VPN
server before we can reconnect.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
ssl.c
www/changelog.xml

diff --git a/ssl.c b/ssl.c
index 29250a09bb6d89f30a3da91632db388fe36ebd79..eb32f38011eccf7379337f8a62892b1dd6ab651e 100644 (file)
--- a/ssl.c
+++ b/ssl.c
@@ -1012,7 +1012,12 @@ int ssl_reconnect(struct openconnect_info *vpninfo)
        free(vpninfo->tun_pkt);
        vpninfo->tun_pkt = NULL;
 
-       while ((ret = vpninfo->proto->tcp_connect(vpninfo))) {
+       while (1) {
+               script_config_tun(vpninfo, "attempt-reconnect");
+               ret = vpninfo->proto->tcp_connect(vpninfo);
+               if (!ret)
+                       break;
+
                if (timeout <= 0)
                        return ret;
                if (ret == -EPERM) {
index 2b57db93e4291ed495b51fb021f3a9125c48457c..2ae897388602e974df98d0a148fc6ceea8593cc5 100644 (file)
@@ -21,6 +21,7 @@
        <li>Fix GnuTLS builds without libtasn1.</li>
        <li>Fix DTLS support with OpenSSL 1.1.1+.</li>
        <li>Add Cisco-compatible DTLSv1.2 support.</li>
+       <li>Invoke script with <tt>reason=attempt-reconnect</tt> before doing so.</li>
      </ul><br/>
   </li>
   <li><b><a href="ftp://ftp.infradead.org/pub/openconnect/openconnect-8.01.tar.gz">OpenConnect v8.01</a></b>