Fall back to SSL if DTLS dies
authorDavid Woodhouse <David.Woodhouse@intel.com>
Tue, 23 Sep 2008 23:31:49 +0000 (16:31 -0700)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Tue, 23 Sep 2008 23:31:49 +0000 (16:31 -0700)
dtls.c

diff --git a/dtls.c b/dtls.c
index e5bfd15..aa38ec3 100644 (file)
--- a/dtls.c
+++ b/dtls.c
@@ -271,7 +271,10 @@ int dtls_mainloop(struct anyconnect_info *vpninfo, int *timeout)
                if (now > overdue) {
                        fprintf(stderr, "DTLS Dead Peer Detection detected dead peer!\n");
                        /* FIXME: Can we call fack to SSL instead? */
-                       vpninfo->quit_reason = "DTLS DPD detected dead peer";
+                       SSL_free(vpninfo->dtls_ssl);
+                       close(vpninfo->dtls_fd);
+                       vpninfo->dtls_ssl = NULL;
+                       vpninfo->dtls_fd = -1;
                        return 1;
                }
                if (now >= due) {