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)
(cherry picked from commit
b8472b4e67ec7ad49254821f2da578ce588df4e6)
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;