mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-02 22:54:52 +00:00
ktls tests: Relax error checking for shutdown(2) a bit
In my test suite runs I occasionally see shutdown(2) fail with ECONNRESET rather than ENOTCONN. soshutdown(2) will return ENOTCONN if the socket has been disconnected (synchronized by the socket lock), and tcp_usr_shutdown() will return ECONNRESET if the inpcb has been dropped (synchronized by the inpcb lock). I think it's possible to pass the first check in soshutdown() but fail the second check in tcp_usr_shutdown(), so modify the KTLS tests to permit this. Reviewed by: jhb MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D42277
This commit is contained in:
parent
1965dd85c3
commit
b08a9b86f5
|
@ -1904,10 +1904,13 @@ test_ktls_receive_bad_size(const atf_tc_t *tc, struct tls_enable *en,
|
|||
/*
|
||||
* The other end may notice the error and drop the connection
|
||||
* before this executes resulting in shutdown() failing with
|
||||
* ENOTCONN. Ignore this error if it occurs.
|
||||
* either ENOTCONN or ECONNRESET. Ignore this error if it
|
||||
* occurs.
|
||||
*/
|
||||
if (shutdown(sockets[1], SHUT_WR) != 0)
|
||||
ATF_REQUIRE_ERRNO(ENOTCONN, true);
|
||||
if (shutdown(sockets[1], SHUT_WR) != 0) {
|
||||
ATF_REQUIRE_MSG(errno == ENOTCONN || errno == ECONNRESET,
|
||||
"shutdown() failed: %s", strerror(errno));
|
||||
}
|
||||
|
||||
ktls_receive_tls_error(sockets[0], EMSGSIZE);
|
||||
|
||||
|
|
Loading…
Reference in a new issue