diff options
author | Richard Levitte <levitte@openssl.org> | 2023-03-07 15:21:16 +0100 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2023-03-07 15:24:54 +0100 |
commit | 12c4e67675e691d7556a526aa062effff05a6532 (patch) | |
tree | a9bc1d1c027fcd49b146eb3159f9af838e7a603a /test/bio_dgram_test.c | |
parent | a8681703d48d062c2fc1736179218063275f8e33 (diff) |
test//bio_dgram_test.c: Skip test when BIO_bind() fails
This test isn't supposed to test BIO_bind() itself, so we can be a bit
sloppy and assume that it fails because the attempted binding is not
supported on the platform where this is run. For example, BIO_bind()
fails when it's given an IPv6 address and the platform where this is
run doesn't support that address family.
In a case like this, it's sensible enough to simply skip the test when
BIO_bind() fails.
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20449)
Diffstat (limited to 'test/bio_dgram_test.c')
-rw-r--r-- | test/bio_dgram_test.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/bio_dgram_test.c b/test/bio_dgram_test.c index e925942a44..0e2fb53103 100644 --- a/test/bio_dgram_test.c +++ b/test/bio_dgram_test.c @@ -175,11 +175,11 @@ static int test_bio_dgram_impl(int af, int use_local) if (!TEST_int_ge(fd2, 0)) goto err; - if (!TEST_int_gt(BIO_bind(fd1, addr1, 0), 0)) - goto err; - - if (!TEST_int_gt(BIO_bind(fd2, addr2, 0), 0)) + if (BIO_bind(fd1, addr1, 0) <= 0 + || BIO_bind(fd2, addr2, 0) <= 0) { + testresult = TEST_skip("BIO_bind() failed - assuming it's an unavailable address family"); goto err; + } info1.addr = addr1; if (!TEST_int_gt(BIO_sock_info(fd1, BIO_SOCK_INFO_ADDRESS, &info1), 0)) |