From nobody Fri Nov 17 14:32:56 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SWzs5291Qz512rd; Fri, 17 Nov 2023 14:32:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SWzs51VwSz4Cp7; Fri, 17 Nov 2023 14:32:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1700231577; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dvRu8TcT0FRJUoMXY+Gv58n1y7LEVbWSJ2ywG4ULWB0=; b=fIlwmubU8HqPWFHOGBDYALSTZhyuQq0RoHVsFUUZSstFY7cBqz+Fg3R1Fl8/I625cOhGdY M1CmxixroofiHwzYBc/KebG+6I0O3EaAzy9ymdMrNClJRqq/tGwGmL23J7g7Wb6drYWW8o ahngUvF4HtAgCjO6kGUet7xHoyV/hI/WIeJdLzDn4XU6kPK0Qnc6AeAX9WXlGdTUlIBIKs zqkNj0RPZdnV9dEPc/xYpVjP62+hiP7Vi91dQZpaRBrFOsNEpSxD+qPTKQO5b7JU1PjCv0 0ZZ4zuDrZjGEXH4dhgCRqBmwxgGneDN+iN8wlChajhETbz43KMIq3TPapFebHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1700231577; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dvRu8TcT0FRJUoMXY+Gv58n1y7LEVbWSJ2ywG4ULWB0=; b=o4dw2jNah/3TVtvKaqYDdT3rvpL7GOT6q8YJ2DPA6qsag2XPM7yX4SiSCtl9RI6LVpjDcc efrDqCADqs95hlk8zsEN4Tm0Z2Ipu2PbcauTEQgr9x9+eFPlXboESFz0T6jowcwszfvyaK pgB6oQxTS7/wJ9FY/GcmgaENS3BHRkiIIBqADdXdrZ/gq0v/IsbGUw27UUCFFmIR32jtNH iQNuuFELGsgv0fY6y8vFYtq2z7GA3ZdplPN0yQW3sIrP1OtNAbEh7zoH0+32Nca52jI+YU ekkn1F7iV3ma9YTKw5wbfYucVHzWjFZr0wBA9UF/9mUvoWL7u6MLNZzUn9WpuQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1700231577; a=rsa-sha256; cv=none; b=GwZqkvb7tXwHYQkjm4NMYlMi+BLZXBVYotzlHxPAXJTZPQ7MyE9qxWdFNbKJFlLfPCpPbe f2BBbELsVkH39fLtagVuz9AMMjeHJqtWc98UQsDj8lTWhYv+SlM6hn9UVDHy2C79BmPH3h auwJOd4LTxgbysdbZmVP9Lcui1OzHiBhuRE84DWZrEyfUWDaOSiawMGVLmse4pkWNZw0Bv 5OJQkvbSxglXhZbfiPMyj4/upI9mhVrCYn3EtZ/bVQvt60PrfDLum22olT9jd8tTsM3/yO K351v5/RUkOSRkwHn0QJnZq96TR2U2/qhJE62CxQv7LK3LcwZFR2Ql/KMsBZBg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SWzs50J7wzmrD; Fri, 17 Nov 2023 14:32:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3AHEWu0E023504; Fri, 17 Nov 2023 14:32:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3AHEWuPc023501; Fri, 17 Nov 2023 14:32:56 GMT (envelope-from git) Date: Fri, 17 Nov 2023 14:32:56 GMT Message-Id: <202311171432.3AHEWuPc023501@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: b08a9b86f581 - main - ktls tests: Relax error checking for shutdown(2) a bit List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b08a9b86f581edf09c5a2729d877a0204499685b Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=b08a9b86f581edf09c5a2729d877a0204499685b commit b08a9b86f581edf09c5a2729d877a0204499685b Author: Mark Johnston AuthorDate: 2023-11-17 14:29:28 +0000 Commit: Mark Johnston 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);