From: Dr. Stephen Henson Date: Tue, 6 Apr 2010 12:29:21 +0000 (+0000) Subject: PR: 2223 X-Git-Tag: OpenSSL_1_0_0a~60 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=e995d5044ea62c3dcd7a3566068ade1754f47ebd;p=oweals%2Fopenssl.git PR: 2223 Submitted By: Robin Seggelmann Fixes for DTLS timeout bug --- diff --git a/ssl/d1_lib.c b/ssl/d1_lib.c index eeffce3ccc..96b220e87c 100644 --- a/ssl/d1_lib.c +++ b/ssl/d1_lib.c @@ -283,6 +283,16 @@ struct timeval* dtls1_get_timeout(SSL *s, struct timeval* timeleft) timeleft->tv_usec += 1000000; } + /* If remaining time is less than 15 ms, set it to 0 + * to prevent issues because of small devergences with + * socket timeouts. + */ + if (timeleft->tv_sec == 0 && timeleft->tv_usec < 15000) + { + memset(timeleft, 0, sizeof(struct timeval)); + } + + return timeleft; }