diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2012-03-06 13:47:27 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2012-03-06 13:47:27 +0000 |
commit | 25bfdca16a70f38a6df9fc213a255fe6b6947fcc (patch) | |
tree | 5eaf11ad186bf74fe0a996b7383869431584e9b5 /ssl | |
parent | 9c284f96517d6f9956bf4d7f73971e7a5d410263 (diff) |
PR: 2755
Submitted by: Robin Seggelmann <seggelmann@fh-muenster.de>
Reduce MTU after failed transmissions.
Diffstat (limited to 'ssl')
-rw-r--r-- | ssl/d1_both.c | 4 | ||||
-rw-r--r-- | ssl/d1_lib.c | 5 |
2 files changed, 7 insertions, 2 deletions
diff --git a/ssl/d1_both.c b/ssl/d1_both.c index 48db246424..de8bab873f 100644 --- a/ssl/d1_both.c +++ b/ssl/d1_both.c @@ -227,14 +227,14 @@ int dtls1_do_write(SSL *s, int type) unsigned int len, frag_off, mac_size, blocksize; /* AHA! Figure out the MTU, and stick to the right size */ - if ( ! (SSL_get_options(s) & SSL_OP_NO_QUERY_MTU)) + if (s->d1->mtu < dtls1_min_mtu() && !(SSL_get_options(s) & SSL_OP_NO_QUERY_MTU)) { s->d1->mtu = BIO_ctrl(SSL_get_wbio(s), BIO_CTRL_DGRAM_QUERY_MTU, 0, NULL); /* I've seen the kernel return bogus numbers when it doesn't know * (initial write), so just make sure we have a reasonable number */ - if ( s->d1->mtu < dtls1_min_mtu()) + if (s->d1->mtu < dtls1_min_mtu()) { s->d1->mtu = 0; s->d1->mtu = dtls1_guess_mtu(s->d1->mtu); diff --git a/ssl/d1_lib.c b/ssl/d1_lib.c index e205b5c6e5..f4bfd29afd 100644 --- a/ssl/d1_lib.c +++ b/ssl/d1_lib.c @@ -424,6 +424,11 @@ int dtls1_handle_timeout(SSL *s) state->timeout.read_timeouts = 1; } + if (state->timeout_duration > 2) + { + s->d1->mtu = BIO_ctrl(SSL_get_wbio(s), BIO_CTRL_DGRAM_GET_FALLBACK_MTU, 0, NULL); + } + #ifndef OPENSSL_NO_HEARTBEATS if (s->tlsext_hb_pending) { |