mirror of
https://github.com/openssl/openssl.git
synced 2024-11-27 05:21:51 +08:00
Use AI_ADDRCONFIG hint with getaddrinfo if available.
This prevents failure of openssl s_server socket binding to wildcard address on hosts with disabled IPv6. Reviewed-by: Kurt Roeckx <kurt@roeckx.be> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8550)
This commit is contained in:
parent
0770c88215
commit
b8472b4e67
@ -683,6 +683,12 @@ int BIO_lookup_ex(const char *host, const char *service, int lookup_type,
|
||||
hints.ai_family = family;
|
||||
hints.ai_socktype = socktype;
|
||||
hints.ai_protocol = protocol;
|
||||
#ifdef AI_ADDRCONFIG
|
||||
#ifdef AF_UNSPEC
|
||||
if (family == AF_UNSPEC)
|
||||
#endif
|
||||
hints.ai_flags |= AI_ADDRCONFIG;
|
||||
#endif
|
||||
|
||||
if (lookup_type == BIO_LOOKUP_SERVER)
|
||||
hints.ai_flags |= AI_PASSIVE;
|
||||
|
Loading…
Reference in New Issue
Block a user