Skip to content

Commit

Permalink
Fix build when configured with -DOPENSSL_USE_IPV6=0
Browse files Browse the repository at this point in the history
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 #21495)
  • Loading branch information
tom-cosgrove-arm authored and hlandau committed Jul 21, 2023
1 parent 1e2e683 commit 9c8d04d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions ssl/quic/quic_channel.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
}
Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit 9c8d04d

Please sign in to comment.