[openssl] master update

Richard Levitte levitte at openssl.org
Wed Nov 25 05:11:02 UTC 2020


The branch master has been updated
       via  403ef8cea73e9b4924dce39e3706778618507cd6 (commit)
      from  ee8252847d1ccf39a48ab382971f8f18ac3f4089 (commit)


- Log -----------------------------------------------------------------
commit 403ef8cea73e9b4924dce39e3706778618507cd6
Author: Richard Levitte <levitte at openssl.org>
Date:   Mon Nov 23 09:12:47 2020 +0100

    APPS: Guard use of IPv6 functions and constants with a check of AF_INET6
    
    Fixes #13482
    
    Reviewed-by: Matt Caswell <matt at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/13484)

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

Summary of changes:
 apps/lib/s_socket.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/apps/lib/s_socket.c b/apps/lib/s_socket.c
index 890bd39414..65d56c0991 100644
--- a/apps/lib/s_socket.c
+++ b/apps/lib/s_socket.c
@@ -166,7 +166,9 @@ int init_client(int *sock, const char *host, const char *port,
     if (*sock == INVALID_SOCKET) {
         if (bindaddr != NULL && !found) {
             BIO_printf(bio_err, "Can't bind %saddress for %s%s%s\n",
+#ifdef AF_INET6
                        BIO_ADDRINFO_family(res) == AF_INET6 ? "IPv6 " :
+#endif
                        BIO_ADDRINFO_family(res) == AF_INET ? "IPv4 " :
                        BIO_ADDRINFO_family(res) == AF_UNIX ? "unix " : "",
                        bindhost != NULL ? bindhost : "",
@@ -243,6 +245,7 @@ int do_server(int *accept_sock, const char *host, const char *port,
     sock_protocol = BIO_ADDRINFO_protocol(res);
     sock_address = BIO_ADDRINFO_address(res);
     next = BIO_ADDRINFO_next(res);
+#ifdef AF_INET6
     if (sock_family == AF_INET6)
         sock_options |= BIO_SOCK_V6_ONLY;
     if (next != NULL
@@ -257,6 +260,7 @@ int do_server(int *accept_sock, const char *host, const char *port,
             sock_options &= ~BIO_SOCK_V6_ONLY;
         }
     }
+#endif
 
     asock = BIO_socket(sock_family, sock_type, sock_protocol, 0);
     if (asock == INVALID_SOCKET


More information about the openssl-commits mailing list