From nobody Fri Nov 24 16:37:57 2023 X-Original-To: dev-commits-src-all@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 4ScLJ54BJBz52PfM; Fri, 24 Nov 2023 16:37: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 4ScLJ53TQKz3Xk2; Fri, 24 Nov 2023 16:37:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1700843877; 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=x7x9pqj58nohW/VoWSjBBohDc42PvDYHrWwmVQlc5Oo=; b=wqHuDNhMBxn9iICdwTWFMYxe8yFZ7Vt1pY8dVXCp/vge7fIDpPXvQw6AQMu7h/h9FrKDdT VGQVN4IkdCbt7VUrkF4xD2GAQKNprDp4zB4deMs/skfgkPWUOiYCkjtkcQV08NYHCRynVE hyuZK3H2MVXKT3LvCuA9uDwz+9TDNxIcVMmH5EOIRKzf8BhBHjaDWgzFN9sQ8v3226uC/H JOus5UjwBaHktTzzPVifMBTZe5CGkvuiLg682lv01JMZS57+YECHBbKyRsXTTCUmIkQXMm RLuz+EwZs+MpFwR6C2hH8txXzdtGiUuqAQz/R0M9qFLgtxOyx44PZiCANya/1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1700843877; 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=x7x9pqj58nohW/VoWSjBBohDc42PvDYHrWwmVQlc5Oo=; b=FxhP93zLRD5M3seeTXOFJGL15ofMcpAtJKcrz2YKzBmk1H1HybPorYPIZxjWcgBTNBlam0 +dMaq8ZEOwhGRAUahCYYUIu2lnjglmE3I21GXoXt0C/6WvVm2qBjtANgIIyVy5r2PAGTSU VyWyZH4LUgr+kwAqQWu0G9ouceSJtdSA1uw7y5OOab7UTnj84L414DFs6Qw+528MxXMHH7 4GKk3O+EGQdOHlu8wQNfuPwEyPfG1N013JRUZwqwPqC9uHTY3c/yFWHEM/tRoKsunyG0ut oc3YWy1uRUfb8EFmQLqgGZPcEgj407o8YHp4QAQS+FZMBgtZG2vun5aKvIo99A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1700843877; a=rsa-sha256; cv=none; b=JVIv26Fk4e5pjipYzVNkao3kgxDYjfIsBBotR2xVePfCKkMzxCcAshAATak8Ir8oYcFYcY mmpQAwGElQnTq/xcFihlyqi5/mIytw3LKHSA+3eWQhL7Qi8DAtcCPkhLmTlW0pM1hwRoX2 JzaB2cwkYNEwwlheVb7JWAMJGwFXIDzM5OlJVBTqtAcZLlNY9b7PY1TmdeDsvzDqV0vpvq l3ubMKjvL1SGw61UFG+Sz06Kc49ShZMWgQ6t4pWGX5fnfzZA4SHIYSOe2pIWCvqSs+PGg6 7LOdY3ebbv52JJm6dLtpbcDpOui5wcPFh4HQihIFyWDnY23KDJenv59xEs4ygg== 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 4ScLJ52Y0hzrlH; Fri, 24 Nov 2023 16:37: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 3AOGbvMw067832; Fri, 24 Nov 2023 16:37:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3AOGbvtu067829; Fri, 24 Nov 2023 16:37:57 GMT (envelope-from git) Date: Fri, 24 Nov 2023 16:37:57 GMT Message-Id: <202311241637.3AOGbvtu067829@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 34c7691f5320 - stable/14 - ktls tests: Relax error checking for shutdown(2) a bit List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 34c7691f532064c5a3d61a115b4ea086b2da3179 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=34c7691f532064c5a3d61a115b4ea086b2da3179 commit 34c7691f532064c5a3d61a115b4ea086b2da3179 Author: Mark Johnston AuthorDate: 2023-11-17 14:29:28 +0000 Commit: Mark Johnston CommitDate: 2023-11-24 16:37:46 +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 (cherry picked from commit b08a9b86f581edf09c5a2729d877a0204499685b) --- 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);