isaacpittman-hitachi / rpms / openssl

Forked from rpms/openssl 2 years ago
Clone

Blame SOURCES/openssl-1.1.1-addrconfig.patch

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