aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/bio/b_sock.c
diff options
context:
space:
mode:
authorAndy Polyakov <appro@openssl.org>2006-01-02 16:05:26 +0000
committerAndy Polyakov <appro@openssl.org>2006-01-02 16:05:26 +0000
commitea558241e08c575cfea49732b19eaf14bae9e672 (patch)
tree861dd085a453549ad55b8f5f724d9d3f7211d04e /crypto/bio/b_sock.c
parent61aa2134a48a6a436f498cc69ce895cd8456e080 (diff)
downloadopenssl-ea558241e08c575cfea49732b19eaf14bae9e672.tar.gz
Refine login in b_sock.c.
Diffstat (limited to 'crypto/bio/b_sock.c')
-rw-r--r--crypto/bio/b_sock.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/crypto/bio/b_sock.c b/crypto/bio/b_sock.c
index bbf627de55..fd45bec331 100644
--- a/crypto/bio/b_sock.c
+++ b/crypto/bio/b_sock.c
@@ -640,7 +640,21 @@ 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));
- if (h && strchr(h,':')) hint.ai_family = AF_INET6;
+ if (h)
+ {
+ if (strchr(h,':'))
+ {
+ if (h[1]=='\0') h=NULL;
+#ifdef AF_INET6
+ hint.ai_family = AF_INET6;
+#else
+ h=NULL;
+#endif
+ }
+ else if (h[0]=='*' && h[1]=='\0')
+ h=NULL;
+ }
+
if ((*getaddrinfo.f)(h,p,&hint,&res)) break;
server = *res->ai_addr;
(*freeaddrinfo.f)(res);