mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-22 15:47:37 +00:00
ktls_tests: Ignore errors from close for receive error tests.
For tests that send invalid data to a TLS socket to trigger read errors the kernel may end up dropping the connection before close is called at the conclusion of the test resulting in spurious ECONNRESET errors from close. Ignore any errors from close for these tests. PR: 268390 Reported by: olivier, Michal Gulbicki <michalx.gulbicki@intel.com> Reviewed by: markj Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D37717
This commit is contained in:
parent
f0c143b356
commit
3845cce70d
@ -284,6 +284,14 @@ close_sockets(int sv[2])
|
||||
ATF_REQUIRE(close(sv[0]) == 0);
|
||||
}
|
||||
|
||||
static void
|
||||
close_sockets_ignore_errors(int sv[2])
|
||||
{
|
||||
if (sv[0] != sv[1])
|
||||
close(sv[1]);
|
||||
close(sv[0]);
|
||||
}
|
||||
|
||||
static void
|
||||
fd_set_blocking(int fd)
|
||||
{
|
||||
@ -1643,7 +1651,7 @@ test_ktls_receive_corrupted_record(const atf_tc_t *tc, struct tls_enable *en,
|
||||
free(outbuf);
|
||||
free(plaintext);
|
||||
|
||||
close_sockets(sockets);
|
||||
close_sockets_ignore_errors(sockets);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -1729,7 +1737,7 @@ test_ktls_receive_truncated_record(const atf_tc_t *tc, struct tls_enable *en,
|
||||
free(outbuf);
|
||||
free(plaintext);
|
||||
|
||||
close_sockets(sockets);
|
||||
close_sockets_ignore_errors(sockets);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -1771,7 +1779,7 @@ test_ktls_receive_bad_major(const atf_tc_t *tc, struct tls_enable *en,
|
||||
free(outbuf);
|
||||
free(plaintext);
|
||||
|
||||
close_sockets(sockets);
|
||||
close_sockets_ignore_errors(sockets);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -1813,7 +1821,7 @@ test_ktls_receive_bad_minor(const atf_tc_t *tc, struct tls_enable *en,
|
||||
free(outbuf);
|
||||
free(plaintext);
|
||||
|
||||
close_sockets(sockets);
|
||||
close_sockets_ignore_errors(sockets);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -1856,7 +1864,7 @@ test_ktls_receive_bad_type(const atf_tc_t *tc, struct tls_enable *en,
|
||||
free(outbuf);
|
||||
free(plaintext);
|
||||
|
||||
close_sockets(sockets);
|
||||
close_sockets_ignore_errors(sockets);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -1905,7 +1913,7 @@ test_ktls_receive_bad_size(const atf_tc_t *tc, struct tls_enable *en,
|
||||
|
||||
free(outbuf);
|
||||
|
||||
close_sockets(sockets);
|
||||
close_sockets_ignore_errors(sockets);
|
||||
}
|
||||
|
||||
#define TLS_10_TESTS(M) \
|
||||
|
Loading…
Reference in New Issue
Block a user