diff options
author | Matt Caswell <matt@openssl.org> | 2014-12-02 11:16:35 +0000 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2014-12-03 09:43:49 +0000 |
commit | a900b3b51c31cccdb1881180d011628b1db42fec (patch) | |
tree | dd2179ca6ec9e140a7a542a5422cd6b1c99fbb42 /ssl | |
parent | 82d7247fc5feca45c9a3526582912ccfe8e5f96a (diff) |
Only use the fallback mtu after 2 unsuccessful retransmissions if it is less
than the mtu we are already using
Reviewed-by: Tim Hudson <tjh@openssl.org>
(cherry picked from commit 047f21593eebbc617a410a208ded01e65ca11028)
Diffstat (limited to 'ssl')
-rw-r--r-- | ssl/d1_lib.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ssl/d1_lib.c b/ssl/d1_lib.c index 00417c61ad..813d9c72a5 100644 --- a/ssl/d1_lib.c +++ b/ssl/d1_lib.c @@ -428,13 +428,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) |