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.
This commit is contained in:
parent
7832d6ab1c
commit
44ddb27fa6
@ -683,6 +683,7 @@ int BIO_get_accept_socket(char *host, int bind_mode)
|
|||||||
* note that commonly IPv6 wildchard socket can service
|
* note that commonly IPv6 wildchard socket can service
|
||||||
* IPv4 connections just as well... */
|
* IPv4 connections just as well... */
|
||||||
memset(&hint,0,sizeof(hint));
|
memset(&hint,0,sizeof(hint));
|
||||||
|
hint.ai_flags = AI_PASSIVE;
|
||||||
if (h)
|
if (h)
|
||||||
{
|
{
|
||||||
if (strchr(h,':'))
|
if (strchr(h,':'))
|
||||||
@ -695,7 +696,10 @@ int BIO_get_accept_socket(char *host, int bind_mode)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else if (h[0]=='*' && h[1]=='\0')
|
else if (h[0]=='*' && h[1]=='\0')
|
||||||
|
{
|
||||||
|
hint.ai_family = AF_INET;
|
||||||
h=NULL;
|
h=NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((*p_getaddrinfo.f)(h,p,&hint,&res)) break;
|
if ((*p_getaddrinfo.f)(h,p,&hint,&res)) break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user