From: Matt Caswell Date: Tue, 2 Dec 2014 11:16:35 +0000 (+0000) Subject: Only use the fallback mtu after 2 unsuccessful retransmissions if it is less X-Git-Tag: OpenSSL_1_0_2~148 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=dfa2762bba9c372a488ec4bcb17e69ce45974768;p=oweals%2Fopenssl.git Only use the fallback mtu after 2 unsuccessful retransmissions if it is less than the mtu we are already using Reviewed-by: Tim Hudson (cherry picked from commit 047f21593eebbc617a410a208ded01e65ca11028) --- diff --git a/ssl/d1_lib.c b/ssl/d1_lib.c index 31208b7d7a..0a4d790dd6 100644 --- a/ssl/d1_lib.c +++ b/ssl/d1_lib.c @@ -475,13 +475,17 @@ void dtls1_stop_timer(SSL *s) int dtls1_check_timeout_num(SSL *s) { + unsigned int mtu; + s->d1->timeout.num_alerts++; /* Reduce MTU after 2 unsuccessful retransmissions */ if (s->d1->timeout.num_alerts > 2 && !(SSL_get_options(s) & SSL_OP_NO_QUERY_MTU)) { - s->d1->mtu = BIO_ctrl(SSL_get_wbio(s), BIO_CTRL_DGRAM_GET_FALLBACK_MTU, 0, NULL); + mtu = BIO_ctrl(SSL_get_wbio(s), BIO_CTRL_DGRAM_GET_FALLBACK_MTU, 0, NULL); + if(mtu < s->d1->mtu) + s->d1->mtu = mtu; } if (s->d1->timeout.num_alerts > DTLS1_TMO_ALERT_COUNT)