提交 44ddb27f 编写于 作者: D Dr. Stephen Henson

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.
上级 7832d6ab
......@@ -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,8 +696,11 @@ 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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册