]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Fix build when configured with -DOPENSSL_USE_IPV6=0
authorTom Cosgrove <tom.cosgrove@arm.com>
Wed, 19 Jul 2023 11:59:36 +0000 (12:59 +0100)
committerHugo Landau <hlandau@openssl.org>
Fri, 21 Jul 2023 14:19:13 +0000 (15:19 +0100)
Change-Id: I57723835b0a7d20609d8c4ed2988123f975a927d

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21495)

ssl/quic/quic_channel.c

index 6b009acfdecb536b7f469d5f8508a13d8de53645..1e6a29a706c9aeb37e6f970a3a3d0a42ffab8460 100644 (file)
@@ -1826,11 +1826,13 @@ static int bio_addr_eq(const BIO_ADDR *a, const BIO_ADDR *b)
                            &b->s_in.sin_addr,
                            sizeof(a->s_in.sin_addr))
                 && a->s_in.sin_port == b->s_in.sin_port;
+#if OPENSSL_USE_IPV6
         case AF_INET6:
             return !memcmp(&a->s_in6.sin6_addr,
                            &b->s_in6.sin6_addr,
                            sizeof(a->s_in6.sin6_addr))
                 && a->s_in6.sin6_port == b->s_in6.sin6_port;
+#endif
         default:
             return 0; /* not supported */
     }
@@ -1879,8 +1881,12 @@ static void ch_rx_handle_packet(QUIC_CHANNEL *ch)
      */
     if (!ch->is_server
         && ch->qrx_pkt->peer != NULL
-        && (BIO_ADDR_family(&ch->cur_peer_addr) == AF_INET
-            || BIO_ADDR_family(&ch->cur_peer_addr) == AF_INET6)
+        && (
+               BIO_ADDR_family(&ch->cur_peer_addr) == AF_INET
+#if OPENSSL_USE_IPV6
+            || BIO_ADDR_family(&ch->cur_peer_addr) == AF_INET6
+#endif
+        )
         && !bio_addr_eq(ch->qrx_pkt->peer, &ch->cur_peer_addr))
         return;