diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2009-05-15 23:07:59 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2009-05-15 23:07:59 +0000 |
commit | e1a2bfaaa6dc99ff99e4d181a59d450ab6d233e8 (patch) | |
tree | 24301a093b5ab6314f464cab2ca2621afbfecd6c /crypto | |
parent | 48f48d96ceb5a7e721f53dc09556e52fa45bb145 (diff) |
Update from HEAD.
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/bio/bss_dgram.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/crypto/bio/bss_dgram.c b/crypto/bio/bss_dgram.c index 2aac67b090..20241500fa 100644 --- a/crypto/bio/bss_dgram.c +++ b/crypto/bio/bss_dgram.c @@ -70,7 +70,9 @@ #include <sys/timeb.h> #endif +#ifdef OPENSSL_SYS_LINUX #define IP_MTU 14 /* linux is lame */ +#endif #ifdef WATT32 #define sock_write SockWrite /* Watt-32 uses same names */ @@ -334,22 +336,26 @@ static long dgram_ctrl(BIO *b, int cmd, long num, void *ptr) break; #endif case BIO_CTRL_DGRAM_QUERY_MTU: - sockopt_len = sizeof(sockopt_val); +#ifdef IP_MTU + sockopt_len = sizeof(sockopt_val); if ((ret = getsockopt(b->num, IPPROTO_IP, IP_MTU, (void *)&sockopt_val, &sockopt_len)) < 0 || sockopt_val < 0) { ret = 0; } else { - data->mtu = sockopt_val; + data->mtu = sockopt_val - 20 - 8; /* Subtract IP and UDP header */ ret = data->mtu; } +#else + ret = 0; +#endif break; case BIO_CTRL_DGRAM_GET_MTU: return data->mtu; break; case BIO_CTRL_DGRAM_SET_MTU: - data->mtu = num; - ret = num; + data->mtu = num - 20 - 8; /* Subtract IP and UDP header */ + ret = data->mtu; break; case BIO_CTRL_DGRAM_SET_CONNECTED: to = (struct sockaddr *)ptr; |