From: Michael Tuexen Date: Mon, 18 Mar 2013 14:30:38 +0000 (+0000) Subject: Avoid unnecessary fragmentation. X-Git-Tag: OpenSSL_0_9_8za~67 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=05689a132cbb40800677486317c0694fa65fd118;p=oweals%2Fopenssl.git Avoid unnecessary fragmentation. (cherry picked from commit 80ccc66d7eedb2d06050130c77c482ae1584199a) --- diff --git a/ssl/d1_both.c b/ssl/d1_both.c index 4481c55051..445470bb43 100644 --- a/ssl/d1_both.c +++ b/ssl/d1_both.c @@ -313,9 +313,10 @@ int dtls1_do_write(SSL *s, int type) s->init_off -= DTLS1_HM_HEADER_LENGTH; s->init_num += DTLS1_HM_HEADER_LENGTH; - /* write atleast DTLS1_HM_HEADER_LENGTH bytes */ - if ( len <= DTLS1_HM_HEADER_LENGTH) - len += DTLS1_HM_HEADER_LENGTH; + if ( s->init_num > curr_mtu) + len = curr_mtu; + else + len = s->init_num; } dtls1_fix_message_header(s, frag_off,