Date: Fri, 17 Nov 2023 14:32:56 GMT From: Mark Johnston <markj@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: b08a9b86f581 - main - ktls tests: Relax error checking for shutdown(2) a bit Message-ID: <202311171432.3AHEWuPc023501@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=b08a9b86f581edf09c5a2729d877a0204499685b commit b08a9b86f581edf09c5a2729d877a0204499685b Author: Mark Johnston <markj@FreeBSD.org> AuthorDate: 2023-11-17 14:29:28 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2023-11-17 14:31:21 +0000 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 --- tests/sys/kern/ktls_test.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/sys/kern/ktls_test.c b/tests/sys/kern/ktls_test.c index a3d0c17d6d62..f57ae74112a2 100644 --- a/tests/sys/kern/ktls_test.c +++ b/tests/sys/kern/ktls_test.c @@ -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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202311171432.3AHEWuPc023501>