[openssl] OpenSSL_1_1_1-stable update

tmraz at fedoraproject.org tmraz at fedoraproject.org
Mon Jun 10 14:29:45 UTC 2019


The branch OpenSSL_1_1_1-stable has been updated
       via  81ce7cc8d6d4377c1a3aa22247e9889ef287005f (commit)
      from  247b8a0b7d784821590898a1f0534af92ec238eb (commit)


- Log -----------------------------------------------------------------
commit 81ce7cc8d6d4377c1a3aa22247e9889ef287005f
Author: Tomas Mraz <tmraz at fedoraproject.org>
Date:   Fri Jun 7 11:34:42 2019 +0200

    BIO_lookup_ex: Retry with AI_ADDRCONFIG cleared if getaddrinfo fails
    
    The lookup for ::1 with getaddrinfo() might return error even if
    the ::1 would work if AI_ADDRCONFIG flag is used.
    
    Fixes: #9053
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/9108)
    
    (cherry picked from commit 3f91ede9aea70774d9b5d509bc76d484ebaff6aa)

-----------------------------------------------------------------------

Summary of changes:
 crypto/bio/b_addr.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/crypto/bio/b_addr.c b/crypto/bio/b_addr.c
index f295b76..5ce473e 100644
--- a/crypto/bio/b_addr.c
+++ b/crypto/bio/b_addr.c
@@ -696,6 +696,7 @@ int BIO_lookup_ex(const char *host, const char *service, int lookup_type,
         /* Note that |res| SHOULD be a 'struct addrinfo **' thanks to
          * macro magic in bio_lcl.h
          */
+      retry:
         switch ((gai_ret = getaddrinfo(host, service, &hints, res))) {
 # ifdef EAI_SYSTEM
         case EAI_SYSTEM:
@@ -706,6 +707,19 @@ int BIO_lookup_ex(const char *host, const char *service, int lookup_type,
         case 0:
             ret = 1;             /* Success */
             break;
+# if (defined(EAI_FAMILY) || defined(EAI_ADDRFAMILY)) && defined(AI_ADDRCONFIG)
+#  ifdef EAI_FAMILY
+        case EAI_FAMILY:
+#  endif
+#  ifdef EAI_ADDRFAMILY
+        case EAI_ADDRFAMILY:
+#  endif
+            if (hints.ai_flags & AI_ADDRCONFIG) {
+                hints.ai_flags &= ~AI_ADDRCONFIG;
+                goto retry;
+            }
+            /* fall through */
+# endif
         default:
             BIOerr(BIO_F_BIO_LOOKUP_EX, ERR_R_SYS_LIB);
             ERR_add_error_data(1, gai_strerror(gai_ret));


More information about the openssl-commits mailing list