Commit 2423b5f0 authored by Tomas Mraz's avatar Tomas Mraz Committed by Richard Levitte
Browse files

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: default avatarKurt Roeckx <kurt@roeckx.be>
Reviewed-by: default avatarRichard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/8550)

(cherry picked from commit b8472b4e)
parent a88bafcd
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -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;