From nobody Tue May 17 02:08:30 2022 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 BA23E1AD8932; Tue, 17 May 2022 02:08:30 +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 4L2KKV4snZz4jZ6; Tue, 17 May 2022 02:08:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1652753310; 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=2LSorOREiVt1h7i6gNnINor9C1d1mykwBBZrzwPo800=; b=FYDXp+NCAaTE1nE1/mAgTSm4gJVemMW6Tz2OPFqTTluw15yje+Herfv7bbc0gGNRxwhXJn 8VlRkpDstPGSEl3ogY/sWsq+tF+1Do3M8TG5EluXeSVOq3nVExRbY3MMg7BZtepDGqpSzx /YhA7TWYv3ShBwze3cnf4aqsgFzWDAZ7aux4CE+neS2CjV/9h7uL2Gu2QY/K1dDvJdGTb0 /ZKD5i53ZFFsrSN/YMKpNwGzuSd/my3thzEHni3M6yhmfMbv9NiiwPVK4Pc9h1K3xhXnrD hODHw0ChGmkh96mqivMyu3vq63Uw4M5LzywTGN2s5pya9HJCREtcw1Rw9rEs9A== 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 86E543E08; Tue, 17 May 2022 02:08:30 +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 24H28UZt072291; Tue, 17 May 2022 02:08:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 24H28UiU072290; Tue, 17 May 2022 02:08:30 GMT (envelope-from git) Date: Tue, 17 May 2022 02:08:30 GMT Message-Id: <202205170208.24H28UiU072290@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: aa9f97af93fc - main - tests/unix_dgram: account for size of sender address in the filling cycle 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: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: aa9f97af93fc9df5596654fc11f2720878c81e1a Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1652753310; 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=2LSorOREiVt1h7i6gNnINor9C1d1mykwBBZrzwPo800=; b=GdeUkXGS/WkWPkVjAEI0qIHyAiaA3S01nik6HNUP3V1TRlThn/Dmbih9huLO/QZrMfLu7y 7I4OgJzGuF43e+kkClO8k4p5HnXdAjBPu+2nsjz5og1rdvJRTPZQwPOL9oeSo60J1WXEe8 HYb3gk/Kgd04tyPziBmKAD8agnZiqcOJ5rDHuX6ZyPYtJeQju3n6x8xRfnID5rGhzwqcY1 ki7QL5zKBg+FF3M7zR5G8BkUWU9jcHhP7xpaUvUHeFni2gEPq8cy9SUS6tZGo5pc1ycMSW GOLNBejQA5/TW7hhqMPGOE/Nnt1lLCFBKFCtpWoCwHL8NEY30CwJI79N91DNeA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1652753310; a=rsa-sha256; cv=none; b=NZeBy1iu5QMpoxsoCKW393g/gXzl+8xuvY/mWA4qqxjrE+ik6nRVqOj/8l2ChwFeURTnB3 8l2ETMQUeMnbv5ktw3eHzdzFr+6p4/1QbS85qg77VjyyEiQLmo2qpooO0F+sOwxE6vRCKO UF6gTNzOZ7AcRQgZOSiSQu5PcZzcsb8ZmaSkqt2tqG2rbkIIWAejuWEfCOpGiqfoHjurVM ZZ3tQfFktwfycxTLZYlBXbeaZcXVG+1Y+VmMYXuuakGrtDqHK18i8BaES3kdfgkmPfCj1b gnG+7+6mnfy8O5etK7f+W+BwM03Lwia5YWV08lvNEAz4vtUbHuYOvnXzf6Ew+w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=aa9f97af93fc9df5596654fc11f2720878c81e1a commit aa9f97af93fc9df5596654fc11f2720878c81e1a Author: Gleb Smirnoff AuthorDate: 2022-05-17 02:04:02 +0000 Commit: Gleb Smirnoff CommitDate: 2022-05-17 02:08:21 +0000 tests/unix_dgram: account for size of sender address in the filling cycle This fixes test failure with large net.local.dgram.recvspace values. --- tests/sys/kern/unix_dgram.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/sys/kern/unix_dgram.c b/tests/sys/kern/unix_dgram.c index 66a9ab6092ee..4bcb84587f46 100644 --- a/tests/sys/kern/unix_dgram.c +++ b/tests/sys/kern/unix_dgram.c @@ -54,6 +54,9 @@ static struct sigaction sigact = { /* * Fill socket to a state when next send(len) would fail. + * + * Note that every datagram is prepended with sender address, + * size of struct sockaddr. */ static void fill(int fd, void *buf, ssize_t len) @@ -64,7 +67,9 @@ fill(int fd, void *buf, ssize_t len) ATF_REQUIRE(sysctlbyname("net.local.dgram.recvspace", &recvspace, &llen, NULL, 0) == 0); - for (sent = 0; sent + len < (ssize_t)recvspace; sent += len) + for (sent = 0; + sent + len + sizeof(struct sockaddr) < recvspace; + sent += len + sizeof(struct sockaddr)) ATF_REQUIRE(send(fd, buf, len, 0) == len); }