b3353e
From a3f4cd5019b60649f6eb216ebe99caa43cd96f8e Mon Sep 17 00:00:00 2001
b3353e
From: Daiki Ueno <dueno@redhat.com>
b3353e
Date: Mon, 26 Apr 2021 14:40:17 +0200
b3353e
Subject: [PATCH] BIO_lookup_ex: use AI_ADDRCONFIG only if explicit host name
b3353e
 is given
b3353e
b3353e
The flag only affects which record types are queried (A or AAAA, or
b3353e
both), and when node is NULL, it prevents getaddrinfo returning the
b3353e
right address associated with the loopback interface.
b3353e
b3353e
Signed-off-by: Daiki Ueno <dueno@redhat.com>
b3353e
---
b3353e
 crypto/bio/b_addr.c | 2 +-
b3353e
 1 file changed, 1 insertion(+), 1 deletion(-)
b3353e
b3353e
diff --git a/crypto/bio/b_addr.c b/crypto/bio/b_addr.c
b3353e
index b023bbda40..ea15601f3d 100644
b3353e
--- a/crypto/bio/b_addr.c
b3353e
+++ b/crypto/bio/b_addr.c
b3353e
@@ -689,7 +689,7 @@ int BIO_lookup_ex(const char *host, const char *service, int lookup_type,
b3353e
         hints.ai_protocol = protocol;
b3353e
 # ifdef AI_ADDRCONFIG
b3353e
 #  ifdef AF_UNSPEC
b3353e
-        if (family == AF_UNSPEC)
b3353e
+        if (host != NULL && family == AF_UNSPEC)
b3353e
 #  endif
b3353e
             hints.ai_flags |= AI_ADDRCONFIG;
b3353e
 # endif
b3353e
-- 
b3353e
2.30.2
b3353e