[PATCH] cstp: Don't call dtls_reconnect() when DTLS is disabled

Kevin Cernekee cernekee at gmail.com
Fri Mar 21 00:41:51 EDT 2014


dtls_reconnect() will change dtls_state from DTLS_DISABLED to
DTLS_SLEEPING.  This generates a bunch of spurious "No DTLS address"
errors.

Signed-off-by: Kevin Cernekee <cernekee at gmail.com>
---
 cstp.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/cstp.c b/cstp.c
index 209894d..fb801ab 100644
--- a/cstp.c
+++ b/cstp.c
@@ -911,7 +911,8 @@ int cstp_mainloop(struct openconnect_info *vpninfo, int *timeout)
 	do_dtls_reconnect:
 		/* succeeded, let's rekey DTLS, if it is not rekeying
 		 * itself. */
-		if (vpninfo->dtls_times.rekey_method == REKEY_NONE) {
+		if (vpninfo->dtls_state != DTLS_DISABLED &&
+		    vpninfo->dtls_times.rekey_method == REKEY_NONE) {
 			dtls_reconnect(vpninfo);
 		}
 
-- 
1.7.9.5




More information about the openconnect-devel mailing list