summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2011-05-25 12:36:50 +0000
committerDr. Stephen Henson <steve@openssl.org>2011-05-25 12:36:50 +0000
commitdda8dcd2c0f9e00ae6e203ad1c0314bc654e0db3 (patch)
tree1017c6a8e3b6192a59fff6d673a7c186d26b99a9
parent16646b001814179f59e20d797c3c6cbcac7fa3a7 (diff)
PR: 2512
Submitted by: Robin Seggelmann <seggelmann@fh-muenster.de> Reviewed by: steve Fix BIO_accept so it can be bound to IPv4 or IPv6 sockets consistently.
-rw-r--r--crypto/bio/b_sock.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/crypto/bio/b_sock.c b/crypto/bio/b_sock.c
index 54112e6ebe..d47310d650 100644
--- a/crypto/bio/b_sock.c
+++ b/crypto/bio/b_sock.c
@@ -683,6 +683,7 @@ int BIO_get_accept_socket(char *host, int bind_mode)
* note that commonly IPv6 wildchard socket can service
* IPv4 connections just as well... */
memset(&hint,0,sizeof(hint));
+ hint.ai_flags = AI_PASSIVE;
if (h)
{
if (strchr(h,':'))
@@ -695,7 +696,10 @@ int BIO_get_accept_socket(char *host, int bind_mode)
#endif
}
else if (h[0]=='*' && h[1]=='\0')
+ {
+ hint.ai_family = AF_INET;
h=NULL;
+ }
}
if ((*p_getaddrinfo.f)(h,p,&hint,&res)) break;