diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2012-03-06 13:45:47 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2012-03-06 13:45:47 +0000 |
commit | b2a2c6af2a73ef99ef6d0033c5c43e968a3cb2e1 (patch) | |
tree | a568183aee21ffb0d8caf1017fd49b85d246bd44 /crypto/bio | |
parent | 272993bac46e94a7d3a78e050cec6d5ca29c38ec (diff) |
PR: 2755
Submitted by: Robin Seggelmann <seggelmann@fh-muenster.de>
Reduce MTU after failed transmissions.
Diffstat (limited to 'crypto/bio')
-rw-r--r-- | crypto/bio/bio.h | 1 | ||||
-rw-r--r-- | crypto/bio/bss_dgram.c | 21 |
2 files changed, 22 insertions, 0 deletions
diff --git a/crypto/bio/bio.h b/crypto/bio/bio.h index 6b2daa1f10..03bd3b2875 100644 --- a/crypto/bio/bio.h +++ b/crypto/bio/bio.h @@ -145,6 +145,7 @@ extern "C" { /* #endif */ #define BIO_CTRL_DGRAM_QUERY_MTU 40 /* as kernel for current MTU */ +#define BIO_CTRL_DGRAM_GET_FALLBACK_MTU 47 #define BIO_CTRL_DGRAM_GET_MTU 41 /* get cached value for MTU */ #define BIO_CTRL_DGRAM_SET_MTU 42 /* set cached value for * MTU. want to use this diff --git a/crypto/bio/bss_dgram.c b/crypto/bio/bss_dgram.c index bfbcf9b5f8..437a050004 100644 --- a/crypto/bio/bss_dgram.c +++ b/crypto/bio/bss_dgram.c @@ -494,6 +494,27 @@ static long dgram_ctrl(BIO *b, int cmd, long num, void *ptr) ret = 0; #endif break; + case BIO_CTRL_DGRAM_GET_FALLBACK_MTU: + switch (data->peer.sa.sa_family) + { + case AF_INET: + ret = 576 - 20 - 8; + break; +#if OPENSSL_USE_IPV6 + case AF_INET6: +#ifdef IN6_IS_ADDR_V4MAPPED + if (IN6_IS_ADDR_V4MAPPED(&data->peer.sa_in6.sin6_addr)) + ret = 576 - 20 - 8; + else +#endif + ret = 1280 - 40 - 8; + break; +#endif + default: + ret = 576 - 20 - 8; + break; + } + break; case BIO_CTRL_DGRAM_GET_MTU: return data->mtu; break; |