diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2005-04-27 16:27:14 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2005-04-27 16:27:14 +0000 |
commit | 6c61726b2af78a1985178d31e551351231b54b10 (patch) | |
tree | a8dbb193224405b5a6900138c9649c8a59ab0d6f /crypto/bio | |
parent | cd202fe2f9d3cd44c361ba56b158ef400a75dc39 (diff) |
Lots of Win32 fixes for DTLS.
1. "unsigned long long" isn't portable changed: to BN_ULLONG.
2. The LL prefix isn't allowed in VC++ but it isn't needed where it is used.
2. Avoid lots of compiler warnings about signed/unsigned mismatches.
3. Include new library directory pqueue in mk1mf build system.
4. Update symbols.
Diffstat (limited to 'crypto/bio')
-rw-r--r-- | crypto/bio/bss_dgram.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/crypto/bio/bss_dgram.c b/crypto/bio/bss_dgram.c index fa6d27adc7..a0cb29b3dc 100644 --- a/crypto/bio/bss_dgram.c +++ b/crypto/bio/bss_dgram.c @@ -64,8 +64,6 @@ #define USE_SOCKETS #include "cryptlib.h" -#include <sys/socket.h> - #include <openssl/bio.h> #define IP_MTU 14 /* linux is lame */ @@ -174,13 +172,18 @@ static int dgram_read(BIO *b, char *out, int outl) bio_dgram_data *data = (bio_dgram_data *)b->ptr; struct sockaddr peer; - socklen_t peerlen = sizeof(peer); + int peerlen = sizeof(peer); if (out != NULL) { clear_socket_error(); memset(&peer, 0x00, peerlen); - ret=recvfrom(b->num,out,outl,0,&peer,&peerlen); + /* Last arg in recvfrom is signed on some platforms and + * unsigned on others. It is of type socklen_t on some + * but this is not universal. Cast to (void *) to avoid + * compiler warnings. + */ + ret=recvfrom(b->num,out,outl,0,&peer,(void *)&peerlen); if ( ! data->connected && ret > 0) BIO_ctrl(b, BIO_CTRL_DGRAM_CONNECT, 0, &peer); @@ -303,7 +306,7 @@ static long dgram_ctrl(BIO *b, int cmd, long num, void *ptr) #endif case BIO_CTRL_DGRAM_QUERY_MTU: sockopt_len = sizeof(sockopt_val); - if ((ret = getsockopt(b->num, IPPROTO_IP, IP_MTU, &sockopt_val, + if ((ret = getsockopt(b->num, IPPROTO_IP, IP_MTU, (void *)&sockopt_val, &sockopt_len)) < 0 || sockopt_val < 0) { ret = 0; } else @@ -345,7 +348,7 @@ static long dgram_ctrl(BIO *b, int cmd, long num, void *ptr) break; case BIO_CTRL_DGRAM_GET_RECV_TIMEOUT: if ( getsockopt(b->num, SOL_SOCKET, SO_RCVTIMEO, - ptr, (socklen_t *)&ret) < 0) + ptr, (void *)&ret) < 0) { perror("getsockopt"); ret = -1; } break; case BIO_CTRL_DGRAM_SET_SEND_TIMEOUT: @@ -355,7 +358,7 @@ static long dgram_ctrl(BIO *b, int cmd, long num, void *ptr) break; case BIO_CTRL_DGRAM_GET_SEND_TIMEOUT: if ( getsockopt(b->num, SOL_SOCKET, SO_SNDTIMEO, - ptr, (socklen_t *)&ret) < 0) + ptr, (void *)&ret) < 0) { perror("getsockopt"); ret = -1; } break; case BIO_CTRL_DGRAM_GET_SEND_TIMER_EXP: @@ -369,6 +372,7 @@ static long dgram_ctrl(BIO *b, int cmd, long num, void *ptr) else ret = 0; break; +#ifdef EMSGSIZE case BIO_CTRL_DGRAM_MTU_EXCEEDED: if ( data->_errno == EMSGSIZE) { @@ -378,6 +382,7 @@ static long dgram_ctrl(BIO *b, int cmd, long num, void *ptr) else ret = 0; break; +#endif default: ret=0; break; |