]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
QUIC TSERVER: Use a random port in the tserver test
authorHugo Landau <hlandau@openssl.org>
Tue, 2 May 2023 17:21:07 +0000 (18:21 +0100)
committerHugo Landau <hlandau@openssl.org>
Wed, 24 May 2023 09:34:47 +0000 (10:34 +0100)
Fixes nondeterministic failures where BIO_bind would fail on some
platforms.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20856)

test/quic_tserver_test.c

index e9ae4703b2069c96cc4969c6e2a3b7467bbcd6b4..cc412eafd0f5524e524675ea5bf87ce9a101b078 100644 (file)
@@ -64,7 +64,6 @@ static int do_test(int use_thread_assist, int use_fake_time, int use_inject)
     union BIO_sock_info_u s_info = {0};
     SSL_CTX *c_ctx = NULL;
     SSL *c_ssl = NULL;
-    short port = 8186;
     int c_connected = 0, c_write_done = 0, c_begin_read = 0, s_read_done = 0;
     int c_wait_eos = 0, c_done_eos = 0;
     int c_start_idle_test = 0, c_done_idle_test = 0;
@@ -89,8 +88,7 @@ static int do_test(int use_thread_assist, int use_fake_time, int use_inject)
     if (!TEST_ptr(s_addr_ = BIO_ADDR_new()))
         goto err;
 
-    if (!TEST_true(BIO_ADDR_rawmake(s_addr_, AF_INET, &ina, sizeof(ina),
-                                    htons(port))))
+    if (!TEST_true(BIO_ADDR_rawmake(s_addr_, AF_INET, &ina, sizeof(ina), 0)))
         goto err;
 
     if (!TEST_true(BIO_bind(s_fd, s_addr_, 0)))