From: Dr. Stephen Henson Date: Fri, 15 May 2009 23:07:41 +0000 (+0000) Subject: Update from HEAD. X-Git-Tag: OpenSSL_1_0_0-beta3~82 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=019b3f3e5a180946f29120ed0c589b9be67478ce;p=oweals%2Fopenssl.git Update from HEAD. --- diff --git a/crypto/bio/bss_dgram.c b/crypto/bio/bss_dgram.c index 173d871f56..1e4666822f 100644 --- a/crypto/bio/bss_dgram.c +++ b/crypto/bio/bss_dgram.c @@ -70,7 +70,9 @@ #include #endif +#ifdef OPENSSL_SYS_LINUX #define IP_MTU 14 /* linux is lame */ +#endif #ifdef WATT32 #define sock_write SockWrite /* Watt-32 uses same names */ @@ -401,22 +403,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;