From nobody Tue Dec 20 19:38:57 2022 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 4Nc6MP5gV2z1GmvB; Tue, 20 Dec 2022 19:38: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 4Nc6MP57hSz489L; Tue, 20 Dec 2022 19:38:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1671565137; 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=fzAfo0wx6AJxC5VhdPR0M1SAmzZ+VI6hsWknHWGI0u4=; b=qR/RV+vV6r8SQMIQJ9Xrk09sH4dmjVf6vdcOCSr1NEPlsx5FBfVx4AQpYmKR3V4gM33fFp YaW2/yxJmvccy4oBFNzjdHx+BctW9V65Cu2ZOLKH+tcAOC9eaHDEskmZGosSdWMDZbuyo2 BXfUisUTZMtx2Hh25NE4Bbe2RPe5M/wJBVTkoqhrte4s5v3A7TbP2l8uLbWAZQ6i+rzWCT E0Pc0ioE4p4nRe2pZc0rxYWzUpn7gJjNPI4bgnXh2/Sz0zogXrXzbQJVV8DaAFMEQwQjTe nDaDYTmTKjbONYTuhED+CK7wH8e03P6m6ehBUofol5N6tAfZ2oNgH1tbQsmSag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1671565137; 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=fzAfo0wx6AJxC5VhdPR0M1SAmzZ+VI6hsWknHWGI0u4=; b=Wur03S6ilPIIV2UJViSr1sJphy/VShKLqXcRshn6nDtGosUWbRntzEwnAYSLnRuM4UMBkM Bl8aDYEpTjFMbAlwp9u6Nh+P1Zdr5mbGILNeK20Gmrtsl2eFQ+y7Y1RDMaxH3muAnhDhyI NCp9t3AkMU2wMZDDdMJkSV1qi5fOqQ5aW3RPpRK0F1IWRQJkrmj5+BnuF5et1jXDwVhMS+ WEKScGITexEed4Mt20nykddPyaWsuMeWyEI+77wv+w3u5JcQb935Vb4n31podal82oGimx 3W1gnCj3FgRbCfVt9IxmaeUrmmSHMj0vZzaEwkqy58C7G1qcF4ZUym3fvTD6rA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1671565137; a=rsa-sha256; cv=none; b=eNuXbloUqmxYlZ5y6tFGqwJSE9D9TkcXNDHWWFUj8KONGxalsU+iAXdlJIJ1oTtIGPcpM+ bcutIn23WWzuKmKyJJbNoBBMcay8vzsqLwDRRKl++JeY0Yit0M/k6+k2EeLwdyiW3YCc4S 9tzODr3ofXC1kRU8+UanHu4iQHaiqhJ1kzdyetOGlEFuZ7zgQzp2C8hkj6inBjzu7e+o5a flxNJCOp0vneGoKEOPtiIu6iWcDJkwNi0OmiGVc7sMLFDYMgrZYBxDtYCfSjOQdFPUzmZH ToFoW9dvHU9xKti98M0nJGWM0gi0A6NRd+yraM+DA39RbJcVXFzlZrcr4z44Mw== 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 4Nc6MP3xGLzmxJ; Tue, 20 Dec 2022 19:38:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 2BKJcvmK094489; Tue, 20 Dec 2022 19:38:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2BKJcvnf094488; Tue, 20 Dec 2022 19:38:57 GMT (envelope-from git) Date: Tue, 20 Dec 2022 19:38:57 GMT Message-Id: <202212201938.2BKJcvnf094488@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 3845cce70dfe - main - ktls_tests: Ignore errors from close for receive error tests. 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3845cce70dfea11775f7ccff5290e67ade2f13aa Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=3845cce70dfea11775f7ccff5290e67ade2f13aa commit 3845cce70dfea11775f7ccff5290e67ade2f13aa Author: John Baldwin AuthorDate: 2022-12-20 19:38:28 +0000 Commit: John Baldwin CommitDate: 2022-12-20 19:38:28 +0000 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 Reviewed by: markj Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D37717 --- tests/sys/kern/ktls_test.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/tests/sys/kern/ktls_test.c b/tests/sys/kern/ktls_test.c index 85998fcbdf80..60f2218ae5f2 100644 --- a/tests/sys/kern/ktls_test.c +++ b/tests/sys/kern/ktls_test.c @@ -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) \