summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/bio/b_sock.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/bio/b_sock.c')
-rw-r--r--src/lib/libcrypto/bio/b_sock.c29
1 files changed, 28 insertions, 1 deletions
diff --git a/src/lib/libcrypto/bio/b_sock.c b/src/lib/libcrypto/bio/b_sock.c
index 12b0a53a81..d47310d650 100644
--- a/src/lib/libcrypto/bio/b_sock.c
+++ b/src/lib/libcrypto/bio/b_sock.c
@@ -551,7 +551,30 @@ int BIO_socket_ioctl(int fd, long type, void *arg)
551#ifdef __DJGPP__ 551#ifdef __DJGPP__
552 i=ioctlsocket(fd,type,(char *)arg); 552 i=ioctlsocket(fd,type,(char *)arg);
553#else 553#else
554 i=ioctlsocket(fd,type,arg); 554# if defined(OPENSSL_SYS_VMS)
555 /* 2011-02-18 SMS.
556 * VMS ioctl() can't tolerate a 64-bit "void *arg", but we
557 * observe that all the consumers pass in an "unsigned long *",
558 * so we arrange a local copy with a short pointer, and use
559 * that, instead.
560 */
561# if __INITIAL_POINTER_SIZE == 64
562# define ARG arg_32p
563# pragma pointer_size save
564# pragma pointer_size 32
565 unsigned long arg_32;
566 unsigned long *arg_32p;
567# pragma pointer_size restore
568 arg_32p = &arg_32;
569 arg_32 = *((unsigned long *) arg);
570# else /* __INITIAL_POINTER_SIZE == 64 */
571# define ARG arg
572# endif /* __INITIAL_POINTER_SIZE == 64 [else] */
573# else /* defined(OPENSSL_SYS_VMS) */
574# define ARG arg
575# endif /* defined(OPENSSL_SYS_VMS) [else] */
576
577 i=ioctlsocket(fd,type,ARG);
555#endif /* __DJGPP__ */ 578#endif /* __DJGPP__ */
556 if (i < 0) 579 if (i < 0)
557 SYSerr(SYS_F_IOCTLSOCKET,get_last_socket_error()); 580 SYSerr(SYS_F_IOCTLSOCKET,get_last_socket_error());
@@ -660,6 +683,7 @@ int BIO_get_accept_socket(char *host, int bind_mode)
660 * note that commonly IPv6 wildchard socket can service 683 * note that commonly IPv6 wildchard socket can service
661 * IPv4 connections just as well... */ 684 * IPv4 connections just as well... */
662 memset(&hint,0,sizeof(hint)); 685 memset(&hint,0,sizeof(hint));
686 hint.ai_flags = AI_PASSIVE;
663 if (h) 687 if (h)
664 { 688 {
665 if (strchr(h,':')) 689 if (strchr(h,':'))
@@ -672,7 +696,10 @@ int BIO_get_accept_socket(char *host, int bind_mode)
672#endif 696#endif
673 } 697 }
674 else if (h[0]=='*' && h[1]=='\0') 698 else if (h[0]=='*' && h[1]=='\0')
699 {
700 hint.ai_family = AF_INET;
675 h=NULL; 701 h=NULL;
702 }
676 } 703 }
677 704
678 if ((*p_getaddrinfo.f)(h,p,&hint,&res)) break; 705 if ((*p_getaddrinfo.f)(h,p,&hint,&res)) break;