From nobody Mon Jul 7 00:06:21 2025 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 4bb4KB1VwLz60hrf; Mon, 07 Jul 2025 00:06:22 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bb4KB0jG5z43yd; Mon, 07 Jul 2025 00:06:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751846782; 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=YzpUpKjXngahm3dHptPK4XUnmKz6cYX1QB2v8+VEWGI=; b=F3werYCWYuAYAFkyNCr5AYAE9aYtOrW9mEdSYK3dty2F/K+b5TOL9/1Clsh9kWHZFQD6qy Dm7GSZ1rL2T3j4eCEvkA5oPb+MysJ3lIdm2BN2xOyOiIKW6EECTu3Ki2079aIWASj9Htkx GtpvZd/HHNIeGgRiHCZLXeeDRfFkglZVw6H4yAMkNmjuZ8xWkQK9Qcz+5swdZbOS2ipzel 6qvfjUxA3rdyUI8FMr8h981ShW0tq1mXm6QGdryRejkUHYdmvgfvJygxLqxJk7yiDEz9qI lzQGI5QwPKgtgV8yqPu8WI/i8UF8EUqnLpaeRzgL/VJI9WFsEHvPAIvfZdai5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751846782; 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=YzpUpKjXngahm3dHptPK4XUnmKz6cYX1QB2v8+VEWGI=; b=DpdaEF28nFQIjYm48fkNIP4KBQHtLMBTfWhW/r8s2ysxoEFh0ljdmSZMokK2zjF4z5pe8I 8XHfJ6Iqq4IzOJLDvyqxRPtD7rwDKc79+XHMPc0PwZ5J+brV+eBBRZPGHGbsJmi0BgADsR 98yuklqyMHyAV7ATnlAMAaQs5t4/Hv+nfvsGh40kuzq+trl+g3IgfzykQIP2j3C+pkOTxU brFgVHJ+EERbqZFDRpIvBmj8C2cqZU9j3g9L1v9EfplynJdUDjE0Q0i895WtQhmmrK7Cvz mBRhcEtANAwvoVgrPXHD27P2RwqRpnY+PGHZecaEFzFDlk4LRmHI0rENAdOe9Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751846782; a=rsa-sha256; cv=none; b=snqD1fC6XMy9sbF52ZMkPBP3d1MJzhH2fNIJV1TP+EgRPbnk0dxNq1NMQ7mWJgB8tzZZpW medQsjVsFMNZv9AATKGmArJkDqkBmThCda0cemCfN+UAwVfnE9ONNKkzEkwLm+e9rJSfyp ux9F98RH0nM7k99SqpAqOiL1HwYc4kcbJe3MqtMz+v8G3+6TODv/Y2eAz7SmYCYszugEsv hozhjkk3TlrCba6Tt/tJNE/ToiZ0lyqdJawDLT5ox9IG5BHhflOgTVPh7DelAc0ibCs4w0 bKy8UDgIrfdZ3/SCfwwqfrW9kdXi7RGcpD0aBhgjVuMnqGRtM+EJMwbjdqlNYw== 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 4bb4KB0FTszBXg; Mon, 07 Jul 2025 00:06:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56706LIi024195; Mon, 7 Jul 2025 00:06:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56706Ln5024192; Mon, 7 Jul 2025 00:06:21 GMT (envelope-from git) Date: Mon, 7 Jul 2025 00:06:21 GMT Message-Id: <202507070006.56706Ln5024192@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Cox Subject: git: 6a7761b4d27c - main - amd64 pmap: convert panics to KASSERTs 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: alc X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6a7761b4d27c99b3b548f2d948b88bf1430ee636 Auto-Submitted: auto-generated The branch main has been updated by alc: URL: https://cgit.FreeBSD.org/src/commit/?id=6a7761b4d27c99b3b548f2d948b88bf1430ee636 commit 6a7761b4d27c99b3b548f2d948b88bf1430ee636 Author: Alan Cox AuthorDate: 2025-07-06 17:42:08 +0000 Commit: Alan Cox CommitDate: 2025-07-07 00:03:28 +0000 amd64 pmap: convert panics to KASSERTs With the recent changes to pmap_demote_DMAP(), the calls to pmap_demote_pdpe() and pmap_demote_pde_mpte() should never fail, so we change the associated panics to KASSERTs. Reviewed by: kib, markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D51180 --- sys/amd64/amd64/pmap.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index cae5436a1ff2..9c985df13ddf 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -9991,7 +9991,7 @@ pmap_demote_DMAP(vm_paddr_t base, vm_size_t len, bool invalidate) pd_entry_t *pde; vm_offset_t va; vm_page_t m, mpte; - bool changed; + bool changed, rv __diagused; if (len == 0) return; @@ -10021,8 +10021,8 @@ pmap_demote_DMAP(vm_paddr_t base, vm_size_t len, bool invalidate) if ((*pdpe & X86_PG_V) == 0) panic("pmap_demote_DMAP: invalid PDPE"); if ((*pdpe & PG_PS) != 0) { - if (!pmap_demote_pdpe(kernel_pmap, pdpe, va, m)) - panic("pmap_demote_DMAP: PDPE failed"); + rv = pmap_demote_pdpe(kernel_pmap, pdpe, va, m); + KASSERT(rv, ("pmap_demote_DMAP: PDPE failed")); changed = true; m = NULL; } @@ -10033,9 +10033,9 @@ pmap_demote_DMAP(vm_paddr_t base, vm_size_t len, bool invalidate) if ((*pde & PG_PS) != 0) { mpte->pindex = pmap_pde_pindex(va); pmap_pt_page_count_adj(kernel_pmap, 1); - if (!pmap_demote_pde_mpte(kernel_pmap, pde, va, - NULL, mpte)) - panic("pmap_demote_DMAP: PDE failed"); + rv = pmap_demote_pde_mpte(kernel_pmap, pde, va, + NULL, mpte); + KASSERT(rv, ("pmap_demote_DMAP: PDE failed")); changed = true; mpte = NULL; } From nobody Mon Jul 7 04:09:58 2025 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 4bb9kG5X21z61DcS; Mon, 07 Jul 2025 04:09:58 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bb9kG4Yjbz3TLm; Mon, 07 Jul 2025 04:09:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751861398; 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=4RNH2yP8VDzXrbxrGF85XFa1W6b32zu14nbae0xOhtE=; b=uEi5Wy86IeX7jG8G99mQYy/EU4PtzTkz/TjILdEJ4B8QJPK3KiejYsUYgTsdo1ngJXpCzB DuhlnPY6fJTJHtUG+d2U2yzpyEXsUcuY4pw8AnbnHNkXDpjvC8yRC22MZ23DYp6/myLvju lzrN9JZ9nJcSmSgA3BqueGQRSHUZ060CpcuRhkn1qne26HKDrVVGJN3/rRzLNtxMAY7cU5 Uy0/4E/ESXEaeZEjeUrA8YCS5HjYhe3TuARrs6APhwDLUlEHdIIZE7r5+eqXMtEomokt34 BCUU12xwAJN1B2K+Q6CE0oZq6/y5+bIudImfoG5HlfG/8nGj4ILwqmJf5UF74Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751861398; 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=4RNH2yP8VDzXrbxrGF85XFa1W6b32zu14nbae0xOhtE=; b=jZcp/0lxbJeyCNJm6W19f46pyYmknuHvpl689T/tfJGB5NAzDNJlDUwjP9Xyh3V4CHy3lN p4KCkT8kH6UGGef5YbH5vPqs/bB/khcpWRsQDiRNJMiMIBBlVl4CsuUDok9ktECXcBSNfy ATK9oU5E4ztlBL+COxj8VwyhTJmVFBiyJD5GIxQnfIhOhmoeN6y0KWraKVYZOebO5f3R3M Q2rXsC89S0w9rSwbu/lccfWUP73VPdKoAyFW/EsyQ7VLimxkoaPSWgbj0HOFVHUoP4VWZJ mfURnoOGaieo8MiBOlMMd1Fqzs2FCr4Qte2KWRqhQmzCLXZMmAxof7oIb6C8JA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751861398; a=rsa-sha256; cv=none; b=aT1Rzn89hBJ5F0KoxVoMbxdNqjFTNvTIy48Kce5gBDEu56Vb0ZwX2v1QiBWmDvkHGjkinM teF1gbklQI5cAAz9aFy0Mbarhq1zeYqs9h6ECd+027aMYl2tG5K83+BQm/DQIHu79RSfsS 3Yy6XHNw/EyEpyBgsAFtBlXViTzIpcwCaiA8hplnzxpbo647PuI63ENsUPhT6ktMhZ8fo7 jx6yy0mVPXrHoEZNT4Et+gUys2if58xYLV9vtbpFqADeLZpfb006d20N12tLemrf1q5vFZ 9biYvvuCoA0IixkNuwQST+x0g/weId4590Y8eej4OaK77MQau4fgpUGQzcNkNQ== 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 4bb9kG49JNzbvx; Mon, 07 Jul 2025 04:09:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56749wrw075883; Mon, 7 Jul 2025 04:09:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56749waZ075880; Mon, 7 Jul 2025 04:09:58 GMT (envelope-from git) Date: Mon, 7 Jul 2025 04:09:58 GMT Message-Id: <202507070409.56749waZ075880@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ahmad Khalifa Subject: git: e05999a8c5a9 - main - amd64: move efi_map_regs definition 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vexeduxr X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e05999a8c5a9bfb2f5c91fbc1dc397d46eed5bbb Auto-Submitted: auto-generated The branch main has been updated by vexeduxr: URL: https://cgit.FreeBSD.org/src/commit/?id=e05999a8c5a9bfb2f5c91fbc1dc397d46eed5bbb commit e05999a8c5a9bfb2f5c91fbc1dc397d46eed5bbb Author: Ahmad Khalifa AuthorDate: 2025-07-07 04:07:15 +0000 Commit: Ahmad Khalifa CommitDate: 2025-07-07 04:07:15 +0000 amd64: move efi_map_regs definition Since efi_map_regs is used in machdep.c, efirt being compiled as a module causes it to be left undefined. Fixes: 85dcdb7aad85498b3f497b8752e69b8612b27cb7 Noticed by: kib Reviewed by: kib, markj Approved by: imp (mentor) Differential Revision: https://reviews.freebsd.org/D51183 --- sys/amd64/amd64/efirt_machdep.c | 2 -- sys/amd64/amd64/machdep.c | 6 ++++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/amd64/amd64/efirt_machdep.c b/sys/amd64/amd64/efirt_machdep.c index f70e235a0150..fe5d60c978dd 100644 --- a/sys/amd64/amd64/efirt_machdep.c +++ b/sys/amd64/amd64/efirt_machdep.c @@ -63,8 +63,6 @@ 1u << EFI_MD_TYPE_FIRMWARE \ ) -uint32_t efi_map_regs; - static pml5_entry_t *efi_pml5; static pml4_entry_t *efi_pml4; static vm_object_t obj_1t1_pt; diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c index 1e8f9b22bd19..f46462b39fa3 100644 --- a/sys/amd64/amd64/machdep.c +++ b/sys/amd64/amd64/machdep.c @@ -188,6 +188,12 @@ struct init_ops init_ops = { */ vm_paddr_t efi_systbl_phys; +/* + * Bitmap of extra EFI memory region types that should be preserved and mapped + * during runtime services calls. + */ +uint32_t efi_map_regs; + /* Intel ICH registers */ #define ICH_PMBASE 0x400 #define ICH_SMI_EN ICH_PMBASE + 0x30 From nobody Mon Jul 7 06:50:56 2025 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 4bbFJ06xk3z60rCp; Mon, 07 Jul 2025 06:50:56 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbFJ05dl0z3T7d; Mon, 07 Jul 2025 06:50:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751871056; 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=1koXvX2Vj38o4zmz4H7Bpq+pl5yp2k2oahJ6QwnGRAA=; b=uUw1/bODnlfFASszvKxCIwvd0Zsvm8WJXKyjIqJkInhMj5xknxbXutvn4dwc21LtSaxefz NmTZqaeJH5kkrKWJxzag2/DGt04tmESnsrD+gatmtZ0AfCesGvYBh2oQmLltO0boYy2FY4 Eu/m0w0kV1iPeqfoZVQGVXhvxKELmdCjopQP5C1VOC+VQyrAmkCwkIs6xUXexav1FO55f8 oWlCCA470gu2yD3b4j+SPFGAAd6G7v/VW6X3CfBzBgKLyEyvbpf4kSbj5/OzGFyLyxp1J7 biV8YJzkukaf536l4ERjkeX1tanAC/oantczqCD/o8tPpkekIi3v+lu8vYFk/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751871056; 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=1koXvX2Vj38o4zmz4H7Bpq+pl5yp2k2oahJ6QwnGRAA=; b=d46Dqwkm8/0LnmWpJyff1l7KUNrZ+LyG4dyOX7qiij2VL8rjrUX4xiJZ4WtpFT106saV5t 0sfJDlKi3xUH+7ACP+7ojfVtO+fRS0boDWu2IHBoeAqiNN1kd8quTqLMgYpQpLm82Rfebl o++yF2i5h94TC8iE8ohhHzOvDkryT1IFeE+xzLZXPqAwMVuP1di/PA2s9yAXrTuQvkZvlA /R/2AL8hZNLohwkh2vDUomvNW5jBY3MIb3XR3pdDJiP07gNuhex/IiSoW8/Cwwgc/HDUQB svkWeFRWXgZTpkvw1x+4gqNHTloM8uh8zVwvNP2csCxMdDV2ML/9JnXaud9gvg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751871056; a=rsa-sha256; cv=none; b=f6Q2Cpm0KdTRyKYy2AUyA2g99Bmjs23vp4LHQSSB97HSPqbslhp8BDu+cneO66J8si0+V9 zWfpQv7p90eIJdro6My+rLRfK1LNotD1Eas9H1VkBqtOwOSD22B7wS3Uwj2pgfsvV8MyjX MIi8ogEK5GihWAmZrFE8DM1aiH6HWo/8lsfc5Yg2A/a+v6KLukF61hEXmuuT6ifCFJkXP0 zpc0UUHPcgXnCEZzvjPIf68yQXg1cPTZ5hD585ruytVsSzamSOhV22PB+70BNbWhmO6Br+ 6daywMUP7xi+l/Ta4IhXZsxFCqG8Zl1HWxK9NEdlP0exBCOcek5l4NoMQPgaRg== 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 4bbFJ05FDwzgy1; Mon, 07 Jul 2025 06:50:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5676ouaG089016; Mon, 7 Jul 2025 06:50:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5676oudE089013; Mon, 7 Jul 2025 06:50:56 GMT (envelope-from git) Date: Mon, 7 Jul 2025 06:50:56 GMT Message-Id: <202507070650.5676oudE089013@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 07948e050808 - main - net80211: regdomain: ETSI: add missing 11a and 11na entries 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 07948e050808158567c0ca7d345ad035115c0d88 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=07948e050808158567c0ca7d345ad035115c0d88 commit 07948e050808158567c0ca7d345ad035115c0d88 Author: Bjoern A. Zeeb AuthorDate: 2025-07-05 01:47:13 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-07-07 06:49:02 +0000 net80211: regdomain: ETSI: add missing 11a and 11na entries The frequency range 5745-5865 (channels 149-173) wrongly has a VHT160 channel listed (going up to 5885/177 which is not avail in ETSI) but no 11a, 11na listed. Add the 11a and 11na in addition to the 11ac 20/40 and 80. Turns out the VHT40 entry for 5805-5845 was also missing. We already had the neccessary setting for taiwan, so just adjust the freqband ref. The problem is that without the 11a base channel ieee80211_find_channel() in ieee80211_lookup_channel_rxstatus() will fail and sta_recv_mgmt() will not get the correct channel but will use ic->ic_curchan (which is not updated on scan offloading) and the scan result entry will be added as channel 1. Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: adrian (previous version) Differential Revision: https://reviews.freebsd.org/D51163 --- lib/lib80211/regdomain.xml | 44 ++++++++++++++++++++++++++++++++++++-------- 1 file changed, 36 insertions(+), 8 deletions(-) diff --git a/lib/lib80211/regdomain.xml b/lib/lib80211/regdomain.xml index 9116e54c31cf..16b74445f429 100644 --- a/lib/lib80211/regdomain.xml +++ b/lib/lib80211/regdomain.xml @@ -494,6 +494,10 @@ IEEE80211_CHAN_PASSIVE IEEE80211_CHAN_DFS + + + 13 + @@ -548,6 +552,14 @@ IEEE80211_CHAN_PASSIVE IEEE80211_CHAN_DFS + + + 13 + + + + 13 + @@ -645,7 +657,7 @@ IEEE80211_CHAN_DFS - + 13 IEEE80211_CHAN_HT40 IEEE80211_CHAN_VHT40 @@ -658,13 +670,6 @@ IEEE80211_CHAN_VHT80 IEEE80211_CHAN_DFS - - - 13 - IEEE80211_CHAN_HT40 - IEEE80211_CHAN_VHT160 - IEEE80211_CHAN_DFS - @@ -2304,6 +2309,29 @@ 20 20 IEEE80211_CHAN_A + + 5745 + 5865 + 20 + 20 + IEEE80211_CHAN_A + + + 5745 + 5865 + 20 + 20 + IEEE80211_CHAN_A + IEEE80211_CHAN_HT20 + + + 5745 + 5845 + 40 + 20 + IEEE80211_CHAN_A + IEEE80211_CHAN_HT40 + 5660 5700 20 20 From nobody Mon Jul 7 10:06:48 2025 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 4bbKf02wWqz61JjG; Mon, 07 Jul 2025 10:06:48 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbKf02NRtz3drb; Mon, 07 Jul 2025 10:06:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751882808; 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=5YHuSVJzdpqlurqztWWVXTT1TE6DwJu9Q95ISWBUAZQ=; b=xpYUqpalITkvEByjdeVH2QBs15QmsKPJhYxyFRIWiLYDU0QAV/olUDKNFo2BEWzJv+nzTx Kfpq0yJdfLamRhihCdevjLdybFX0JYgPyzC1UDmdRVaDjNwGULwgxKzsufhYafiVao77T6 pU6c+wrHUuoSgs+xWtUMnTifZ+712Q9DkKvx5l47pfU8OyDinLHKokGNvFpN+VqE0wh34t Bs6LovmI9Ll6Hl3ugTlh7SUZ4av8+vpDAz+vpnqg+F/98pQKFp8BhEB6a/PGgS8imZTIZ9 o5/hZd3A3vsUsmhBmbppACKpVZfy8lMCvFRIqjqDpKwH5JVeVFp2QA2DOx11kQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751882808; 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=5YHuSVJzdpqlurqztWWVXTT1TE6DwJu9Q95ISWBUAZQ=; b=KfNkZcUcP2QlJnA99mnGKUwPhFWE+cSMph3SiQt28h+N4UKZLyUEc4Ou7bjsXJVq7qJmsO +1qIWJXsM/VxNGR821PIPuJ4plncc/8/wZX3MvhIfEE6EgJqYJtbg+c8J6caiBHogcNFBk jVTJ9n7qgNmGRX5kXZ0A6r5KhIZHCrZNGBWLor/EDVmOmLECD4NvEk1UPQe4gpmD2/olVd n7oQeI8b+sRA6RwsnBTqRwp00/MpKzaOZpHrJrUtEk5/IkfN5baYUMxDd0VogJBgoWduub 0CzRN/07g/iqSLE4beFgcVbICINsHmzL/+oQCtnFg207R2gQiK7G5okkfUeL6A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751882808; a=rsa-sha256; cv=none; b=AAph3gxXx/s6r71K7YapGVNrYHJnk2QtwESnBvsHfnE2qc4dJFUw/BUDEaQrqC/nImZVa4 uv/H32yYgM7mkzis5Tu2C6vABGGuoQd/0GgmrFGnkBcFMSKFCO4XCc/OPLDuizRoEnmEzJ s8PbHhSZ1GktARnJacA5InqJGUbLF4jMZWXBD3HpxgZVCPNA2WsVlZR4aMGL72TlNSg6Ji sBUFMKOefOSSvlD14tzZMSXC7txAkUHX+JdOfhKFkJ8L6J/u/T3d+Jk4QmUr823/CEITMK uTC+e5lN4jS52GFerlkTm5j6E7LUbULJiGCYGxGqKPrOF995TPu23V26L77heg== 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 4bbKf01PqrzmKQ; Mon, 07 Jul 2025 10:06:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567A6mSe053093; Mon, 7 Jul 2025 10:06:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567A6mZi053090; Mon, 7 Jul 2025 10:06:48 GMT (envelope-from git) Date: Mon, 7 Jul 2025 10:06:48 GMT Message-Id: <202507071006.567A6mZi053090@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 72652c93e396 - stable/14 - git-blame-ignore-revs: bpf: Some style and white space cleanup 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 72652c93e39695dc86814aa0ed99957015ed3b90 Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=72652c93e39695dc86814aa0ed99957015ed3b90 commit 72652c93e39695dc86814aa0ed99957015ed3b90 Author: Zhenlei Huang AuthorDate: 2024-09-20 10:09:13 +0000 Commit: Zhenlei Huang CommitDate: 2025-07-07 10:00:27 +0000 git-blame-ignore-revs: bpf: Some style and white space cleanup Hash is updated to match MFC commit. (cherry picked from commit 99215a19448343574ff615e382b2525cec597fe7) --- .git-blame-ignore-revs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index ee6fb2d39f52..095b030b32a0 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -12,6 +12,8 @@ 49066283a4c1fc5c9d6c4cbee00cc941f4b09792 # bin/ps whitespace cleanup ad94fb48d8bda7cfaec68b3c7897594991b474bc +# style and whitespace fixes for bpf +f97d0c91eefc8568a11ad47f910cdd9dc7826a72 # sort OptionalObsoleteFiles.inc blocks e027fb0ee8d767f577a1c6f73506128beb6384ef 084cbd8c7283952d68f2c40e27e900fe0af5d97e From nobody Mon Jul 7 10:06:49 2025 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 4bbKf14fvvz61J2x; Mon, 07 Jul 2025 10:06:49 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbKf11qSzz3djk; Mon, 07 Jul 2025 10:06:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751882809; 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=TpSWNQyuNdQ/8xdw3U/6NFmzJ12vZ47tQaoD8P8ZENg=; b=iOfNaL2IQoIGGAsit9ymR+ATgU+PdDvIma7xCUMSZBaBbjyGANENLcwdUfUwWX4wco13oy 4FrHbo7Kjx7oOTLu4izd2G06f49+zQgWGZg0xwmD1RBPGPzJtSh9t+WQl1M4Vp6z1Wno9v GHg93Yl7lRJNtkXdpeCwrVX+fv/vzsPiGN/UgkJS1KZcQYHgNGfJ9mo70YWWx92SzvmEPP EFHbdfVh/iufGhfcAr+W38iilQmNkoxgspvrXBdp8YuttvTP/G/8uxW/ilGW3jJj8XIqVr OVUvNzHZFfbwGjAIl8LXbs9A91RPDwN0Yh6TQrHQL14gGlerLPIeRIt7Mi7/Pw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751882809; 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=TpSWNQyuNdQ/8xdw3U/6NFmzJ12vZ47tQaoD8P8ZENg=; b=EbYl/Z+lgf7itfgsChHYGPblJX+bQr0+mWBRCFNAh/HukV7j1VuwrnsyGlPGS5wgo5Gtkh SdTzQCgxB09cXDQ0/CNi2AOytD8XYr3f/KcjSGspWDN4Z6f5HcZ26cjp6BBF6GQddrY3sn e7P5U/OM4Z5X1mKbPi99z0pto0Lza3yxcGi+dXsJyZfU0KkgaAepFVvxkCKQJ5/m5HbGzr uF5sA4BR0HtQ1t2nlF9nkF/r+1/cu+EoWL99BOAOfgDRwl0cmgnBRidQ3sCrP07wVXwNhp zLxpoF7SGAL2OEvwmTH3xEuRLGPOYT/grFmPw/6ZfRq7L3RfXVftICCnnYMkMg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751882809; a=rsa-sha256; cv=none; b=ruy6sbaxXXjHgr1TxjOA6hqptX6ik7FBn4MPBwFty4RG5PSPf7affUv6UglLV4veAiGWZN W8MADYd8e9mvacjCof44A6WBX6oSVbzpemqb1+CQS8CdfUerv32iWSp6VS9+wVQLjic9IF UR6ZqHNfk6h/BGX2/kJnYIeJMr6JYTTAto/GcjNB4eB0UlBPA9VJeztZkwuVdfZoVjUrU9 7apLTVzkU6VzmdxV6rPbw19hjrpf61vfkMoJ4TQPNxvRcKCxrxYO1v1V/6EfrCFUVItBLI NLF6R/KA6sCjqP119ahXtLXWCo4KDwcrpk7FBT3YypGKFNamRCnKV9udgVnXjg== 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 4bbKf11RLYzmKR; Mon, 07 Jul 2025 10:06:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567A6nv7053127; Mon, 7 Jul 2025 10:06:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567A6nV6053124; Mon, 7 Jul 2025 10:06:49 GMT (envelope-from git) Date: Mon, 7 Jul 2025 10:06:49 GMT Message-Id: <202507071006.567A6nV6053124@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: f0931a31f536 - stable/14 - git-blame-ignore-revs: iflib: Many style fixes 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f0931a31f536eb5af7d2cb3242008133ba38dbea Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=f0931a31f536eb5af7d2cb3242008133ba38dbea commit f0931a31f536eb5af7d2cb3242008133ba38dbea Author: Zhenlei Huang AuthorDate: 2024-09-22 02:09:29 +0000 Commit: Zhenlei Huang CommitDate: 2025-07-07 10:00:28 +0000 git-blame-ignore-revs: iflib: Many style fixes Hash is updated to match MFC commit. (cherry picked from commit 0ca553d761e5832ad6ff6fab0a3b896c8fe9d813) --- .git-blame-ignore-revs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 095b030b32a0..2217c5610011 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -12,6 +12,8 @@ 49066283a4c1fc5c9d6c4cbee00cc941f4b09792 # bin/ps whitespace cleanup ad94fb48d8bda7cfaec68b3c7897594991b474bc +# style fixes for iflib +647860bff21446419dee923b07490fd4a6cd181a # style and whitespace fixes for bpf f97d0c91eefc8568a11ad47f910cdd9dc7826a72 # sort OptionalObsoleteFiles.inc blocks From nobody Mon Jul 7 10:06:50 2025 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 4bbKf256mHz61J2y; Mon, 07 Jul 2025 10:06:50 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbKf232vpz3djq; Mon, 07 Jul 2025 10:06:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751882810; 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=5XtvKr+C0oeZe8gtM2uY4uK3/emDu0J0P65PXMOGYF8=; b=ek8elVoOhIas7MxL3zPGwE+ELAkTkqmfcQyHkCAxTWTTKRkL+Z4//gu8VmmIBdTBZi/NtE N2UtjXtmx/ocFmFIvStDIt6u1+KIGWIn9LXpDwKR4AqKf0JfClf3dH9J24PXQJ5G03E9Nw RFVFjQ4j+8Q69rHwX8nvQnVFmoCYGTHIk4qFPbQhdaJDuG/rfNWU2YDh7LqCBc0hE61+AS 3hNI51zCYd1cdXd9BqbTXH28fip6At6u/ZLfQnksyzs19akdQig6QZIYYK4rxKi4zdvPqP jIx51PJR3LtJkZaobAMYlq5oQWZ9JCnydOFSyl6Hv1LbIMLJdwcbxcwoFJNc9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751882810; 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=5XtvKr+C0oeZe8gtM2uY4uK3/emDu0J0P65PXMOGYF8=; b=uvKErimOw6RpVBHVIFJA6py2FnwRp881KNXONXF8ZrAJy26KtkoNvCLd6rK+hZ2RhnJ/U+ oDFpXNZc8+AsLPeQMqzUEcZD1/k7Ex+49yRNzTikqK0D1v6CFQG+lEBNJjiKrgV2IGJ+dY fQQCHacyHKtTdOhRDJWLtwcnIWFdgR1JYqEFNsg1eQ8qL0J5vDFHua/5VzhlDKk2ciZTmK hwM4gweiqmpGc/j1CAOH4QhxQ+Bx7DUUfmgoz/9aVckwijdcb0SaArwMImDmFc6tuKkxOw oui935KwXb9ZbIdf0P8Mo09R3c/XjulVsLZ68SHNh3BTD7MyLavLdC846OoGIw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751882810; a=rsa-sha256; cv=none; b=FG+YlWBBKZ3D9dteQJg1qtWkgplJtTFK6Lb9AUbo1qH/UAbgblmwCd5yrDnIpBJ8hIH/KX 5xCgxaehUEPUupv0Y9xDonR2OoaSu43bSNfegzjZMDqX8otWtUUX8YZNs9ojKlR4jsGceA rxw4+aHPz2hZVsS8hDql6L0KztSliEECDHQGLEN0tKXMHMREEtV369LpiWmhyHOQ/PlVRs R3YHhzi79wppu1parUteXyCwCEop0o+WH+tKYrsJRbWZEsiZKq/JJMnTxM+1hhBb7sE9mt CXtL7RZ6c6NTffVlRNW95px3xOqJUUsAQA21Mp04zQX3WdZEiFu9U0ZfdlscGQ== 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 4bbKf22fxVzmsD; Mon, 07 Jul 2025 10:06:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567A6oIQ053161; Mon, 7 Jul 2025 10:06:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567A6oiW053158; Mon, 7 Jul 2025 10:06:50 GMT (envelope-from git) Date: Mon, 7 Jul 2025 10:06:50 GMT Message-Id: <202507071006.567A6oiW053158@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 8ba6d328fdf8 - stable/14 - git-blame-ignore-revs: sys/sys/kernel.h: Various whitespace fixes 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8ba6d328fdf85f9d048092533125421ef2fcf8e5 Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=8ba6d328fdf85f9d048092533125421ef2fcf8e5 commit 8ba6d328fdf85f9d048092533125421ef2fcf8e5 Author: Zhenlei Huang AuthorDate: 2024-12-06 11:41:34 +0000 Commit: Zhenlei Huang CommitDate: 2025-07-07 10:00:28 +0000 git-blame-ignore-revs: sys/sys/kernel.h: Various whitespace fixes Hash is updated to match MFC commit. (cherry picked from commit 99f7c0550433782cd228b518173cca5d23998c36) --- .git-blame-ignore-revs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 2217c5610011..9f873aadd745 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -12,6 +12,8 @@ 49066283a4c1fc5c9d6c4cbee00cc941f4b09792 # bin/ps whitespace cleanup ad94fb48d8bda7cfaec68b3c7897594991b474bc +# whitespace fixes for sys/sys/kernel.h +3f879ed6eee9618ff7611f5de7a73868ef0cebb9 # style fixes for iflib 647860bff21446419dee923b07490fd4a6cd181a # style and whitespace fixes for bpf From nobody Mon Jul 7 10:06:51 2025 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 4bbKf40n9sz61JbY; Mon, 07 Jul 2025 10:06:52 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbKf33hJVz3drj; Mon, 07 Jul 2025 10:06:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751882811; 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=wMFJyEW+0Ym+oDdmVIbpJrEll/epM1znA2Qf4qFIPVI=; b=KVpppKXtGagIqeIE6KzKDy5C+xVtGrnwKD0RrUimSj6oOAYQW3mcoOuWK9IMPF6JNiPYsy OBCbvJy9TcN15lYCBZ89uO3eK+RDjUlVYfDf2bkrBGXf9RjeuZYTfDE8ZDmh1JdQHTMbx0 Vqc8xiq4ZBZOK661OLXYUj+WG8ZxLQsVHoUysKz+q09igLAx7xHGfEFFQBE6GImhMPbEjr iENZOHw+GFwPffLp30hMN4wEcRcYDwGAgAiwUuH/NYpdYyBaHl5sIcboL5ZEYYVS/LamQL aH2e1l9nffDvSLwMEh2KTFoy/wOwdgsYpgOlXgPAaBXS5FP0aMTlj8+gtHzvpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751882811; 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=wMFJyEW+0Ym+oDdmVIbpJrEll/epM1znA2Qf4qFIPVI=; b=S0I4I3VEZy3MBbdfBPIO8UL6He29I5SzkAHmI8pwaFoJJbcSTp2HgXpq18Xnnw4r5xKLg8 2gDS5oPTKfw6VHE2hUjxmrq7gzH7hdRW6trviXgBuWdGPFaCYTqj2tukDODJRcYYGcJsaR 0pUG9GA0TpksXkzjf1lLqxT4wLat0TUJJisscfbLA8qVqmYbexFM/U7ucrdzDHuRPi27P7 qLJ2s3AArooAPvLk3yo3KL/5Dj35DohCM7Dco1uLY8gJRo6HlulRjicqtRsW4ijTzdTk7M 3B4n8qoY2t2cmDByvFiuMbF53TZNLd1RWjk1RtoegCeYNmWAUoDPp4gZ4yqiXw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751882811; a=rsa-sha256; cv=none; b=FBgigv/a3RNE8qNokXczhnMQDm3QOXdSyOixwMRrmBXMRz8T0YsBv2dvknGIjQy4UEpDjB /BFbxvGyuI2uWLo/DSew48yWd0WsJQpl1ApOr4uxmje5+WACZlBB+K8JI/aIf4RNr+zn4M dWk4i7cNPBelQtm4QoYMLTh3RZGcLcucZHVro5eYWP8dIv+9wEQAMKHOxDu8e9cR+Qb0w6 dbs2aIkSlifQv0scFKEncaEtMXQm+KDoQOeg1eyfYplN4rcW+pmM63CDuNd9mZCdLu5+RY zk7wAVcIDu6+CZSCf/4Ctardot4jk6aNhHUM0BLB6F1NDGOCHspVw1uml+IHmA== 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 4bbKf33H87zmcr; Mon, 07 Jul 2025 10:06:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567A6pZU053195; Mon, 7 Jul 2025 10:06:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567A6pxr053192; Mon, 7 Jul 2025 10:06:51 GMT (envelope-from git) Date: Mon, 7 Jul 2025 10:06:51 GMT Message-Id: <202507071006.567A6pxr053192@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 839b9596b35d - stable/14 - axgbe: Fix setting promisc mode 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 839b9596b35d516f6df444898f477cfb3d00a8db Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=839b9596b35d516f6df444898f477cfb3d00a8db commit 839b9596b35d516f6df444898f477cfb3d00a8db Author: Zhenlei Huang AuthorDate: 2024-10-12 13:56:56 +0000 Commit: Zhenlei Huang CommitDate: 2025-07-07 10:00:29 +0000 axgbe: Fix setting promisc mode Ethernet drivers should respect IFF_PROMISC rather than IFF_PPROMISC. The latter is for user-requested promisc mode, it implies the former but not vice versa. Some in-kernel components such as if_bridge(4) and bpf(4) will set promisc mode for interfaces on-demand. While here, update the debugging message to be not confusing. This was spotted while reviewing markj@ 's work D46524. Test from Franco shows that the interface seems to be unconditionally initialized to promisc mode regardless of this fix. That needs further investigation. Reviewed by: markj, Franco Fichtner Tested by: Franco Fichtner MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D46794 (cherry picked from commit c7a2636889a649985e323de23fe495608b6fe483) --- sys/dev/axgbe/if_axgbe_pci.c | 10 ++++++---- sys/dev/axgbe/xgbe-dev.c | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/sys/dev/axgbe/if_axgbe_pci.c b/sys/dev/axgbe/if_axgbe_pci.c index 5922e29d33a8..ee800011ff24 100644 --- a/sys/dev/axgbe/if_axgbe_pci.c +++ b/sys/dev/axgbe/if_axgbe_pci.c @@ -2318,11 +2318,11 @@ axgbe_if_promisc_set(if_ctx_t ctx, int flags) axgbe_printf(1, "%s: MAC_PFR 0x%x drv_flags 0x%x if_flags 0x%x\n", __func__, XGMAC_IOREAD(pdata, MAC_PFR), if_getdrvflags(ifp), - if_getflags(ifp)); + flags); - if (if_getflags(ifp) & IFF_PPROMISC) { + if (flags & IFF_PROMISC) { - axgbe_printf(1, "User requested to enter promisc mode\n"); + axgbe_printf(1, "Requested to enter promisc mode\n"); if (XGMAC_IOREAD_BITS(pdata, MAC_PFR, PR) == 1) { axgbe_printf(1, "Already in promisc mode\n"); @@ -2331,10 +2331,11 @@ axgbe_if_promisc_set(if_ctx_t ctx, int flags) axgbe_printf(1, "Entering promisc mode\n"); XGMAC_IOWRITE_BITS(pdata, MAC_PFR, PR, 1); + /* Disable VLAN filtering */ XGMAC_IOWRITE_BITS(pdata, MAC_PFR, VTFE, 0); } else { - axgbe_printf(1, "User requested to leave promisc mode\n"); + axgbe_printf(1, "Requested to leave promisc mode\n"); if (XGMAC_IOREAD_BITS(pdata, MAC_PFR, PR) == 0) { axgbe_printf(1, "Already not in promisc mode\n"); @@ -2343,6 +2344,7 @@ axgbe_if_promisc_set(if_ctx_t ctx, int flags) axgbe_printf(1, "Leaving promisc mode\n"); XGMAC_IOWRITE_BITS(pdata, MAC_PFR, PR, 0); + /* Enable VLAN filtering */ XGMAC_IOWRITE_BITS(pdata, MAC_PFR, VTFE, 1); } diff --git a/sys/dev/axgbe/xgbe-dev.c b/sys/dev/axgbe/xgbe-dev.c index 786e04930780..9f974112c2ba 100644 --- a/sys/dev/axgbe/xgbe-dev.c +++ b/sys/dev/axgbe/xgbe-dev.c @@ -971,7 +971,7 @@ xgbe_config_rx_mode(struct xgbe_prv_data *pdata) { unsigned int pr_mode, am_mode; - pr_mode = ((if_getflags(pdata->netdev) & IFF_PPROMISC) != 0); + pr_mode = ((if_getflags(pdata->netdev) & IFF_PROMISC) != 0); am_mode = ((if_getflags(pdata->netdev) & IFF_ALLMULTI) != 0); xgbe_set_promiscuous_mode(pdata, pr_mode); From nobody Mon Jul 7 10:06:52 2025 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 4bbKf465g0z61J37; Mon, 07 Jul 2025 10:06:52 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbKf44StQz3dZq; Mon, 07 Jul 2025 10:06:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751882812; 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=F8+D38bQ4xI3bPzBPwAyn4tUzu2bHkjyMC3BQZsX7gM=; b=TlQiItOBw4jgVr7/ELPXnTERtMB8nnbmavK2R0P2+YpcD3YOtuhLf1TFqSQxxNugiDLV0Q jHdDL0inxbCgZL7t/Ecc15oPFBDCDmdP+a9WF/nxoDtYwP+B7nAVdULMsccXu1BWCzUfn0 YkbQd0mzwjjhzvit2vSKWMf4eA7KSocV8I73lKvXJWjgbgdpvZQBUGLUNj0a8O8iJTL67f G/j3UBuD266Hajcb/k3MQDZBOBoPNkZhX7L4VsOuaDGN6pEBewQh3aVSLQCbVkC4pJlRtR D6usL/0+3ZEoSCBH2Jr31ZHuG2fY1iZTxi4l7E8nWgzHQriI87UevPN4FKuLjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751882812; 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=F8+D38bQ4xI3bPzBPwAyn4tUzu2bHkjyMC3BQZsX7gM=; b=GD++Nn3Xu+J1Q1ldEFAVyRNK3Uc72iomwXDZ+wvnekJtsNVnHL5ZOy5sX+rlr1eiCWQnSN Y8g5M/UOKsQFY2v2lkj7lTH/HNIzek6x99zg9Wituq1a60k7i/ClkKIvqjlqsyxhb+urA9 Z9aaY4dxsZqIWx5pazJMeE6zWh7YAvOI/1Xre0IJGLZTeqSow12l+Ns/XnFRp+coMVGO4h FVhUt64+hOKIe3aPmIELhC8bo33CpdTa+U2yCdtof35IRqRD3fzmcaQXRm/aUwKiRfJjuS KbBUc6zQJbsO12XMf4TDJtLgV4/OP5+uYtv3WnjxRNyWWx7CyDqxbku3Q+oUkQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751882812; a=rsa-sha256; cv=none; b=rTQZNb55FcmUHKP5rh5Q6khBcDuslilayn/leWg+MF9q0Fo/yrHs7fXW+peCzlRd7s4ZQz LXu8wagc7NGJhqhWwgC+3iIf/rcMnA4IBBX7wLMVevcOqk0SD06HWUQWkJiPw7CVyT0rEc K1Se1DLychb6ZY1TMfKQ57vBLNHEH4J1JoxmZVQHz33RAEWNPJVK1F7C6x0DO85+fPd/CP Hje2GGR1MnCW0Pv2K7KBKvcOOxc9OO33lMQyDdxRS3fmRqhRYRB1d7ZokAmAos/PfN3r4+ jeDGKeSURUdU/sX9qX5Po1SEEuZAzrN9Xg8IyqA3RTnOPrk54qj+H1tuKgti7A== 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 4bbKf43tSCzmcs; Mon, 07 Jul 2025 10:06:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567A6qpF053235; Mon, 7 Jul 2025 10:06:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567A6qfo053232; Mon, 7 Jul 2025 10:06:52 GMT (envelope-from git) Date: Mon, 7 Jul 2025 10:06:52 GMT Message-Id: <202507071006.567A6qfo053232@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: f5195b1a63df - stable/14 - netinet6: Remove a set but not used global variable in6_maxmtu 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f5195b1a63df2c84d05b29a908e96c107f86a029 Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=f5195b1a63df2c84d05b29a908e96c107f86a029 commit f5195b1a63df2c84d05b29a908e96c107f86a029 Author: Zhenlei Huang AuthorDate: 2025-05-21 10:09:01 +0000 Commit: Zhenlei Huang CommitDate: 2025-07-07 10:00:29 +0000 netinet6: Remove a set but not used global variable in6_maxmtu and its setter in6_setmaxmtu(). This variable was introduced by the KAME projec [1]. It holds the max IPv6 MTU through all the interfaces, but is never used anywhere. [1] 82cd038d51e2 KAME netinet6 basic part(no IPsec,no V6 Multicast Forwarding, no UDP/TCP for IPv6 yet) Reviewed by: glebius MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D49357 (cherry picked from commit e64fe5ad3a23a9f471ebf11e04e490588913c7af) --- sys/netinet6/in6.c | 25 ------------------------- sys/netinet6/in6_ifattach.c | 6 ------ sys/netinet6/in6_var.h | 4 ---- sys/netinet6/nd6.c | 4 ---- sys/netinet6/nd6_rtr.c | 8 ++------ 5 files changed, 2 insertions(+), 45 deletions(-) diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c index 60497ae29852..0e2c19efe9d5 100644 --- a/sys/netinet6/in6.c +++ b/sys/netinet6/in6.c @@ -2114,31 +2114,6 @@ in6if_do_dad(struct ifnet *ifp) return (1); } -/* - * Calculate max IPv6 MTU through all the interfaces and store it - * to in6_maxmtu. - */ -void -in6_setmaxmtu(void) -{ - struct epoch_tracker et; - unsigned long maxmtu = 0; - struct ifnet *ifp; - - NET_EPOCH_ENTER(et); - CK_STAILQ_FOREACH(ifp, &V_ifnet, if_link) { - /* this function can be called during ifnet initialization */ - if (!ifp->if_afdata[AF_INET6]) - continue; - if ((ifp->if_flags & IFF_LOOPBACK) == 0 && - IN6_LINKMTU(ifp) > maxmtu) - maxmtu = IN6_LINKMTU(ifp); - } - NET_EPOCH_EXIT(et); - if (maxmtu) /* update only when maxmtu is positive */ - V_in6_maxmtu = maxmtu; -} - /* * Provide the length of interface identifiers to be used for the link attached * to the given interface. The length should be defined in "IPv6 over diff --git a/sys/netinet6/in6_ifattach.c b/sys/netinet6/in6_ifattach.c index fe421c02513f..01d7925de43d 100644 --- a/sys/netinet6/in6_ifattach.c +++ b/sys/netinet6/in6_ifattach.c @@ -71,8 +71,6 @@ #include #include -VNET_DEFINE(unsigned long, in6_maxmtu) = 0; - #ifdef IP6_AUTO_LINKLOCAL VNET_DEFINE(int, ip6_auto_linklocal) = IP6_AUTO_LINKLOCAL; #else @@ -732,10 +730,6 @@ in6_ifattach(struct ifnet *ifp, struct ifnet *altifp) else ifa_free(&ia->ia_ifa); } - - /* update dynamically. */ - if (V_in6_maxmtu < ifp->if_mtu) - V_in6_maxmtu = ifp->if_mtu; } /* diff --git a/sys/netinet6/in6_var.h b/sys/netinet6/in6_var.h index 3d037bc644d8..e99e796a3140 100644 --- a/sys/netinet6/in6_var.h +++ b/sys/netinet6/in6_var.h @@ -551,9 +551,6 @@ do { \ ((ifp)->if_afdata[AF_INET6]))->in6_ifstat[ \ offsetof(struct in6_ifstat, tag) / sizeof(uint64_t)], 1);\ } while (/*CONSTCOND*/ 0) - -VNET_DECLARE(unsigned long, in6_maxmtu); -#define V_in6_maxmtu VNET(in6_maxmtu) #endif /* _KERNEL */ /* @@ -877,7 +874,6 @@ void in6_domifdetach(struct ifnet *, void *); int in6_domifmtu(struct ifnet *); struct rib_head *in6_inithead(uint32_t fibnum); void in6_detachhead(struct rib_head *rh); -void in6_setmaxmtu(void); int in6_if2idlen(struct ifnet *); struct in6_ifaddr *in6ifa_ifpforlinklocal(struct ifnet *, int); struct in6_ifaddr *in6ifa_ifpwithaddr(struct ifnet *, const struct in6_addr *); diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c index 887da1ebe21a..6ec5a8b54cf4 100644 --- a/sys/netinet6/nd6.c +++ b/sys/netinet6/nd6.c @@ -379,10 +379,6 @@ nd6_setmtu0(struct ifnet *ifp, struct nd_ifinfo *ndi) "new link MTU on %s (%lu) is too small for IPv6\n", if_name(ifp), (unsigned long)ndi->maxmtu); } - - if (ndi->maxmtu > V_in6_maxmtu) - in6_setmaxmtu(); /* check all interfaces just in case */ - } void diff --git a/sys/netinet6/nd6_rtr.c b/sys/netinet6/nd6_rtr.c index 845f9094f4c4..c145af7d3ffc 100644 --- a/sys/netinet6/nd6_rtr.c +++ b/sys/netinet6/nd6_rtr.c @@ -553,12 +553,8 @@ nd6_ra_input(struct mbuf *m, int off, int icmp6len) maxmtu = (ndi->maxmtu && ndi->maxmtu < ifp->if_mtu) ? ndi->maxmtu : ifp->if_mtu; if (mtu <= maxmtu) { - int change = (ndi->linkmtu != mtu); - - ndi->linkmtu = mtu; - if (change) { - /* in6_maxmtu may change */ - in6_setmaxmtu(); + if (ndi->linkmtu != mtu) { + ndi->linkmtu = mtu; rt_updatemtu(ifp); } } else { From nobody Mon Jul 7 10:06:54 2025 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 4bbKf71w4Jz61J3D; Mon, 07 Jul 2025 10:06:55 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbKf668jHz3dmM; Mon, 07 Jul 2025 10:06:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751882814; 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=c2gvONFzybyh1GnIxRsvLCAstGR9vCg4LzyUhztHR2o=; b=lRxyQVSVpGjz8X4VXzrMW1EwfNnB1EiqlJCV1AG1RM15+02SzMIPN3guGUm8/zmnbbtOzH NHNg+NMfkPWq7DqcA7ATOW8KRbZi/R6bYGGNmhLO0NUzG0NFEPmiDDNoPcdcFYAyeACCaD CRpjiwTXjC2inCGJmlGXfDdKdgYA/MYgEDMFw0dgbh5rBO7LTtbSgEAI0VLvsN9tp9RmV2 mdF+LULhvUxbIWTpCGnHwyvCIFePeot52E8jaSev2Gmkk5PxuXcURkP+m9qfOyEiZ5umvk NbULbTjO4sBUSlPVV738F7KUvQzfY6xgIGKmxNs6R7XZ0JOJBBgs1lVGC5TIMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751882814; 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=c2gvONFzybyh1GnIxRsvLCAstGR9vCg4LzyUhztHR2o=; b=mtrLIsejRlj9xtyRTkPnpPOzW7FYKZjQiHS4b9M5Z8tUKz0hjiiYG0tND11oX5DrqPp+FM Mz2RMpCRVg7qH0iNopdBAedq+L+wwOJ9Jk7MdW/yICcU2pCvDktSf3AM4nNfBzAk9wd6El MMmFr+JEV92SsNBnZX/R946eXwnRu51kcqU+n49fqpVMctZl8iXafxUpoKVSh+wisQFMSd gT/KHd9H9HEstZMATsP5LCNZwwEPHjlK8cnSuHx6Efih1yWp4Ke+4kSHVocJ+SBLqrak57 PO7bEhP0TOWiZVb1TdhDaU+Om7/BWpa5fodBnnLSsaQSBHHcuOY/Pzeml5va6A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751882814; a=rsa-sha256; cv=none; b=eYbDwm6D64glsQtz/j3t2gVywWAhTegVl3GBl7+uzqFaNxLu1uGQDzu4nRnhExCfaybx3+ SWFxFSp0HQgxIAc+9/9q9Rwy6OGqG1a8/1dO2iIJlEKSPxmGQmhus287dQlWKCF6wFpxcr TEJIFU6YCM2jIUfPWVE4zZ7anPgmAU1VvW8Ls27DqUlvQJavYOehZHvebXSmOQBaUkSuFY BGfj4TBJ4oE8dgWzTMSNtjyDexG/fVCMmtWI1JjPW8Hux0yHf4OyV6Tkus1c/bTnSJDuMx h3767pYq1uqAg3wgYgFMV8dq4Lrg9Es8KYMwa8mLRcYQ7QbX1jIgcdfbdx/8PQ== 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 4bbKf65lyBzmct; Mon, 07 Jul 2025 10:06:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567A6sNq053311; Mon, 7 Jul 2025 10:06:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567A6srb053308; Mon, 7 Jul 2025 10:06:54 GMT (envelope-from git) Date: Mon, 7 Jul 2025 10:06:54 GMT Message-Id: <202507071006.567A6srb053308@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 2466a1871154 - stable/14 - ifnet: Initialize the address family dependent data region earlier 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 2466a18711548113d3ca4c61ccc7d6717adb6ade Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=2466a18711548113d3ca4c61ccc7d6717adb6ade commit 2466a18711548113d3ca4c61ccc7d6717adb6ade Author: Zhenlei Huang AuthorDate: 2025-05-22 15:00:05 +0000 Commit: Zhenlei Huang CommitDate: 2025-07-07 10:03:58 +0000 ifnet: Initialize the address family dependent data region earlier if_link_ifnet() adds the interface to the global network interface list, and it is a natural synchronization point. With this change, any threads that obtain the reference of the interface via ifunit(), ifunit_ref() etc., will be guaranteed to see the address family dependent data rightly. The issue [1] reported by Mike Belanger also hints the potential race. MFC note: this change depends on e64fe5ad3a23, as calculating the max IPv6 MTU through all the interfaces requires the current interface to be added to the global network interface list firstly. [1] https://lists.freebsd.org/archives/freebsd-net/2025-May/006817.html Reviewed by: glebius MFC after: 1 month MFC with: e64fe5ad3a23 netinet6: Remove a set but not used global variable in6_maxmtu Differential Revision: https://reviews.freebsd.org/D49358 (cherry picked from commit 098b5d4dc744283a90b2d80c11395ecc18a84084) --- sys/net/if.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/net/if.c b/sys/net/if.c index b4ffa9883efc..a0570aed32e9 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -948,11 +948,11 @@ if_attach_internal(struct ifnet *ifp, bool vmove) } #endif - if_link_ifnet(ifp); - if (domain_init_status >= 2) if_attachdomain1(ifp); + if_link_ifnet(ifp); + EVENTHANDLER_INVOKE(ifnet_arrival_event, ifp); if (IS_DEFAULT_VNET(curvnet)) devctl_notify("IFNET", ifp->if_xname, "ATTACH", NULL); From nobody Mon Jul 7 10:06:53 2025 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 4bbKf60w9Zz61JjR; Mon, 07 Jul 2025 10:06:54 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbKf55CHmz3dcx; Mon, 07 Jul 2025 10:06:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751882813; 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=Jc4JoTMjzBWgWZVgy8EJklpdtk1Qhp5P8YIV+HvySu8=; b=uRcwk8al+3KCtHn4+LWXPZooQYaF+36qU6XYt7MSWIXQJENXHomKo70nDMlKlC0ec4IrjW qWNNkH99hQFiAAlm0PYN+EMuJPooZEIQb7TJhcknV6m54+MQbSSi1zC8pXUTWT1zyA4FM6 kcCs0OzaEv/VROCyyJlGMmsLCVfcCwQPDUSxTL7DjlJYSkXWU59M72oq/1JjtncRxeW6kv T7OT+EBf1rdLQvDbm+oMfePlaw/vXHvSP/0YZF3sBmx0SEzS7LJR2bBI6aK3MciMjy/zrp 7U8FnaZrxu+ngWjP7PtK9qvF1o3GtSnL8lfPUOwYy6aW0FrUZIZQbnvORy4rWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751882813; 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=Jc4JoTMjzBWgWZVgy8EJklpdtk1Qhp5P8YIV+HvySu8=; b=AxRHmp5bnlDdQMRjZgi3Iq6X3uKCqqvh9lqV64gLd/B05h+NCGo4L7y5M0xND6+vh6K3xv seeUPnOLUq7yGnicdpiwNpoFEZPW32e/P+NEwM6fE4WDS0f4oSYGrGrG2ZEa0W0RhyTABG R2MrdCb7/ue4dLddQIzIOdXqZDhnQ/J1gTVPCIhqq8pexwQPaVlYwB2PpxKDTMHcuzWQ0A bK+/JffsnPpCyk9+BTw1p5ivw7hP23cfuRh6s7sR5v3CTT/jAzn1iA97GaLBQQGVrTpZMt HePNcAL9HWq3skFcCDZA1QHP3+LXnHDjlWgDeR5y6sRRMtGyjDYi5w7jMAHxcA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751882813; a=rsa-sha256; cv=none; b=Zb3GlUqIW4ADeuv1PLDwrW6+cz2gOIC47zKl+JudID8g4Unu1s2FH69JDyXt6JBOVbF6Vt fgeMF4n1PTzVFmqC91s87XdlGuBOhwalmcn5GQ5jZkhH4/dok0CiI4Vr+EsCp7gpZE92cG GNg8OjVzGUx6Ggglscq+uwhz3ix/7SX6Y/dDIcuvKy0Qo43hrN38izJ3gaLmRpZzudE+sk riLKJKf9eBcvw9Z7sgnxkPDChDgBOdD55WakSma/nHk+BJuKgE+exDvmm9ZXnY1oXFRmTv haVz3bx6phnG3Y2SwJpwdBE7tI1dVxMippAAGHKhfMLkpyqftuGPlsA2WjQ9qA== 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 4bbKf54nzHzmsF; Mon, 07 Jul 2025 10:06:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567A6rxw053276; Mon, 7 Jul 2025 10:06:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567A6rgu053273; Mon, 7 Jul 2025 10:06:53 GMT (envelope-from git) Date: Mon, 7 Jul 2025 10:06:53 GMT Message-Id: <202507071006.567A6rgu053273@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 077895676d3b - stable/14 - UPDATING: Add an entry for the removal of in6_maxmtu 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 077895676d3baf62a6d2e50626faaaa3e7ef2473 Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=077895676d3baf62a6d2e50626faaaa3e7ef2473 commit 077895676d3baf62a6d2e50626faaaa3e7ef2473 Author: Zhenlei Huang AuthorDate: 2025-05-21 10:11:03 +0000 Commit: Zhenlei Huang CommitDate: 2025-07-07 10:03:54 +0000 UPDATING: Add an entry for the removal of in6_maxmtu (cherry picked from commit c485a58f51608e5473d8580ebd4bf9f4f42fab1a) --- UPDATING | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/UPDATING b/UPDATING index c19d5db50b7c..c1778cc50d83 100644 --- a/UPDATING +++ b/UPDATING @@ -12,6 +12,14 @@ Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before updating system packages and/or ports. +20250707: + Commit f5195b1a63df removed in6_maxmtu and its setter in6_setmaxmtu(). + in6_maxmtu is used to store the max IPv6 MTU of all interfaces, + however it does not have any in-tree consumers since the introduction + from the KAME project. The removal should have little impact, and the + max IPv6 MTU can be easily retrieved by iterating over all the attached + interface if 3rd party modules need it. + 20250419: LinuxKPI alloc routines were changed to return physically contiguous memory where expected. These changes may require out-of-tree drivers From nobody Mon Jul 7 10:06:56 2025 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 4bbKf92Nrjz61Jbh; Mon, 07 Jul 2025 10:06: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbKf90jH3z3f0S; Mon, 07 Jul 2025 10:06:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751882817; 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=27T0tW68OntwsERozscl6wrRuUO9K456jEo2FDP6Q18=; b=Wh5RDO/AplYajY4mfZaGHGao/hG+U7vLfIgNiXuwnGtoWY1xqp/YDcn8WmJZG5lc9ny61/ yV8uAYILG6g82ndU1NBXvH4Khlu1fAjONUExZIVdrQ2ikyXCDZXbwqfYO+gO6LmuMrT27/ 26zsgA9Fjie7jtbeqYZ82+pjRlekyUNuiMxA7jBI2oq2X34aEZJQypg3SKC7ZWsHIZowiA 4NGt2he0t2ST4MZv021cEu7k/c2PMjTlIGOSLFeW9la0ml8/SKB3iDrwuxXrmAWoOh1U7k 4WZN+cdxfaZchMVbClB42O3hggoF8vHrP0/Ee40Lf++Q80/ZzDVH8tOl7wknMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751882817; 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=27T0tW68OntwsERozscl6wrRuUO9K456jEo2FDP6Q18=; b=n6JaMquBEowLTeL4+y1t2vRTVgCoC4gQHJMWVLjH1Weyq/KCX6qIldp+JLdJ71E6Se82s8 jL3dXz5UUQcYnetRlczANjVE7D8ow0/6RLUfLo/FsY7HCBMoHBGJNVmh4rTqs6VUPNbLCW 8yn8V7uqW8Y8LcfjThJSp5vLZ4S8yBEE6AIRI1zEfneUEero9zzGuRsw0q9RKPAesRdY3M hZGLQH6NEkQLOMl01sd8FKCYhDMMICM2fF6gDools3+rmzT4Pkm6MhEBJ+B8ZWGEytdYgA 6nDrl9HBS1LnsGO2w36CpSUBDiVj5L7SQBCUT9aRxbGIQKyIjzbtQ+QrWXAlvQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751882817; a=rsa-sha256; cv=none; b=kxELKLfzbfbGSHHp2mIuqEMTJHboRQix1s0fIpKLuoW/IVTbMNEO5cAFwGkYdXyCGmHCXl B/EtSish+9t+aq3+Gshr6jP+jte8wuXuQy5Heiqor2cVFqECTUbCHakoXV6UFbQY14vznn VJwLhlM6vbv0UX+i+X59qMxXPjzi2MYQjl3koFXokADFvb1d8yWXq+2UjGXjMqMPMb/awr jl0FCWcRpoKx6fVI+NssncCu0ZQITOeOc0c6K2/CqYKpIbp+q/Njnse7AyhSs5YD/ubjCH aMYLHvY0Abm8nzTy26qWpRPle3RbW06aGG2e+I7Pr9WJSTk7p/D0gdAUzC6cUg== 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 4bbKf90JNWzmvB; Mon, 07 Jul 2025 10:06:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567A6uFO053381; Mon, 7 Jul 2025 10:06:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567A6u9P053378; Mon, 7 Jul 2025 10:06:56 GMT (envelope-from git) Date: Mon, 7 Jul 2025 10:06:56 GMT Message-Id: <202507071006.567A6u9P053378@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: a2989d11eabe - stable/14 - iflib: Some style(9) tweaks 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a2989d11eabeb869b8c845a097d4214755d9a99f Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=a2989d11eabeb869b8c845a097d4214755d9a99f commit a2989d11eabeb869b8c845a097d4214755d9a99f Author: Zhenlei Huang AuthorDate: 2025-06-06 10:04:42 +0000 Commit: Zhenlei Huang CommitDate: 2025-07-07 10:03:59 +0000 iflib: Some style(9) tweaks Prefer tab over eight whitespaces for indentation, and four spaces as second level idents. MFC after: 3 days (cherry picked from commit 721e783a2a3316826f92fb44c931e28163118b3f) --- sys/net/iflib.c | 208 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 104 insertions(+), 104 deletions(-) diff --git a/sys/net/iflib.c b/sys/net/iflib.c index 12acdcd4f868..dc93da722ef4 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -196,7 +196,7 @@ struct iflib_ctx { uint8_t ifc_sysctl_separate_txrx; uint8_t ifc_sysctl_use_logical_cores; uint16_t ifc_sysctl_extra_msix_vectors; - bool ifc_cpus_are_physical_cores; + bool ifc_cpus_are_physical_cores; qidx_t ifc_sysctl_ntxds[8]; qidx_t ifc_sysctl_nrxds[8]; @@ -281,16 +281,16 @@ iflib_get_extra_msix_vectors_sysctl(if_ctx_t ctx) #define CTX_IS_VF(ctx) ((ctx)->ifc_sctx->isc_flags & IFLIB_IS_VF) typedef struct iflib_sw_rx_desc_array { - bus_dmamap_t *ifsd_map; /* bus_dma maps for packet */ - struct mbuf **ifsd_m; /* pkthdr mbufs */ - caddr_t *ifsd_cl; /* direct cluster pointer for rx */ - bus_addr_t *ifsd_ba; /* bus addr of cluster for rx */ + bus_dmamap_t *ifsd_map; /* bus_dma maps for packet */ + struct mbuf **ifsd_m; /* pkthdr mbufs */ + caddr_t *ifsd_cl; /* direct cluster pointer for rx */ + bus_addr_t *ifsd_ba; /* bus addr of cluster for rx */ } iflib_rxsd_array_t; typedef struct iflib_sw_tx_desc_array { - bus_dmamap_t *ifsd_map; /* bus_dma maps for packet */ - bus_dmamap_t *ifsd_tso_map; /* bus_dma maps for TSO packet */ - struct mbuf **ifsd_m; /* pkthdr mbufs */ + bus_dmamap_t *ifsd_map; /* bus_dma maps for packet */ + bus_dmamap_t *ifsd_tso_map; /* bus_dma maps for TSO packet */ + struct mbuf **ifsd_m; /* pkthdr mbufs */ } if_txsd_vec_t; /* magic number that should be high enough for any hardware */ @@ -363,7 +363,7 @@ struct iflib_txq { /* constant values */ if_ctx_t ift_ctx; - struct ifmp_ring *ift_br; + struct ifmp_ring *ift_br; struct grouptask ift_task; qidx_t ift_size; uint16_t ift_id; @@ -381,7 +381,7 @@ struct iflib_txq { bus_dma_tag_t ift_tso_buf_tag; iflib_dma_info_t ift_ifdi; #define MTX_NAME_LEN 32 - char ift_mtx_name[MTX_NAME_LEN]; + char ift_mtx_name[MTX_NAME_LEN]; bus_dma_segment_t ift_segs[IFLIB_MAX_TX_SEGS] __aligned(CACHE_LINE_SIZE); #ifdef IFLIB_DIAGNOSTICS uint64_t ift_cpu_exec_count[256]; @@ -401,7 +401,7 @@ struct iflib_fl { uint64_t ifl_cl_dequeued; #endif /* implicit pad */ - bitstr_t *ifl_rx_bitmap; + bitstr_t *ifl_rx_bitmap; qidx_t ifl_fragidx; /* constant */ qidx_t ifl_size; @@ -457,7 +457,7 @@ struct iflib_rxq { uint8_t ifr_txqid[IFLIB_MAX_TX_SHARED_INTR]; uint8_t ifr_fl_offset; struct lro_ctrl ifr_lc; - struct grouptask ifr_task; + struct grouptask ifr_task; struct callout ifr_watchdog; struct iflib_filter_info ifr_filter_info; iflib_dma_info_t ifr_ifdi; @@ -548,7 +548,7 @@ rxd_info_zero(if_rxd_info_t ri) #define STATE_LOCK_DESTROY(ctx) mtx_destroy(&(ctx)->ifc_state_mtx) #define CALLOUT_LOCK(txq) mtx_lock(&txq->ift_mtx) -#define CALLOUT_UNLOCK(txq) mtx_unlock(&txq->ift_mtx) +#define CALLOUT_UNLOCK(txq) mtx_unlock(&txq->ift_mtx) /* Our boot-time initialization hook */ static int iflib_module_event_handler(module_t, int, void *); @@ -926,7 +926,7 @@ netmap_fl_refill(iflib_rxq_t rxq, struct netmap_kring *kring, bool init) MPASS(i < IFLIB_MAX_RX_REFRESH); if (addr == NETMAP_BUF_BASE(na)) /* bad buf */ - return (netmap_ring_reinit(kring)); + return (netmap_ring_reinit(kring)); fl->ifl_bus_addrs[i] = paddr + nm_get_offset(kring, slot); @@ -1457,17 +1457,17 @@ iflib_dma_alloc_align(if_ctx_t ctx, int size, int align, iflib_dma_info_t dma, i lowaddr = DMA_WIDTH_TO_BUS_LOWADDR(ctx->ifc_softc_ctx.isc_dma_width); err = bus_dma_tag_create(bus_get_dma_tag(dev), /* parent */ - align, 0, /* alignment, bounds */ - lowaddr, /* lowaddr */ - BUS_SPACE_MAXADDR, /* highaddr */ - NULL, NULL, /* filter, filterarg */ - size, /* maxsize */ - 1, /* nsegments */ - size, /* maxsegsize */ - BUS_DMA_ALLOCNOW, /* flags */ - NULL, /* lockfunc */ - NULL, /* lockarg */ - &dma->idi_tag); + align, 0, /* alignment, bounds */ + lowaddr, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + size, /* maxsize */ + 1, /* nsegments */ + size, /* maxsegsize */ + BUS_DMA_ALLOCNOW, /* flags */ + NULL, /* lockfunc */ + NULL, /* lockarg */ + &dma->idi_tag); if (err) { device_printf(dev, "%s: bus_dma_tag_create failed: %d (size=%d, align=%d)\n", @@ -1679,11 +1679,11 @@ _iflib_irq_alloc(if_ctx_t ctx, if_irq_t irq, int rid, irq->ii_res = res; KASSERT(filter == NULL || handler == NULL, ("filter and handler can't both be non-NULL")); rc = bus_setup_intr(dev, res, INTR_MPSAFE | INTR_TYPE_NET, - filter, handler, arg, &tag); + filter, handler, arg, &tag); if (rc != 0) { device_printf(dev, "failed to setup interrupt for rid %d, name %s: %d\n", - rid, name ? name : "unknown", rc); + rid, name ? name : "unknown", rc); return (rc); } else if (name) bus_describe_intr(dev, res, tag, "%s", name); @@ -1732,17 +1732,17 @@ iflib_txsd_alloc(iflib_txq_t txq) * Set up DMA tags for TX buffers. */ if ((err = bus_dma_tag_create(bus_get_dma_tag(dev), - 1, 0, /* alignment, bounds */ - lowaddr, /* lowaddr */ - BUS_SPACE_MAXADDR, /* highaddr */ - NULL, NULL, /* filter, filterarg */ - sctx->isc_tx_maxsize, /* maxsize */ - nsegments, /* nsegments */ - sctx->isc_tx_maxsegsize, /* maxsegsize */ - 0, /* flags */ - NULL, /* lockfunc */ - NULL, /* lockfuncarg */ - &txq->ift_buf_tag))) { + 1, 0, /* alignment, bounds */ + lowaddr, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + sctx->isc_tx_maxsize, /* maxsize */ + nsegments, /* nsegments */ + sctx->isc_tx_maxsegsize, /* maxsegsize */ + 0, /* flags */ + NULL, /* lockfunc */ + NULL, /* lockfuncarg */ + &txq->ift_buf_tag))) { device_printf(dev, "Unable to allocate TX DMA tag: %d\n", err); device_printf(dev, "maxsize: %ju nsegments: %d maxsegsize: %ju\n", (uintmax_t)sctx->isc_tx_maxsize, nsegments, (uintmax_t)sctx->isc_tx_maxsegsize); @@ -1750,17 +1750,17 @@ iflib_txsd_alloc(iflib_txq_t txq) } tso = (if_getcapabilities(ctx->ifc_ifp) & IFCAP_TSO) != 0; if (tso && (err = bus_dma_tag_create(bus_get_dma_tag(dev), - 1, 0, /* alignment, bounds */ - lowaddr, /* lowaddr */ - BUS_SPACE_MAXADDR, /* highaddr */ - NULL, NULL, /* filter, filterarg */ - tsomaxsize, /* maxsize */ - ntsosegments, /* nsegments */ - sctx->isc_tso_maxsegsize,/* maxsegsize */ - 0, /* flags */ - NULL, /* lockfunc */ - NULL, /* lockfuncarg */ - &txq->ift_tso_buf_tag))) { + 1, 0, /* alignment, bounds */ + lowaddr, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + tsomaxsize, /* maxsize */ + ntsosegments, /* nsegments */ + sctx->isc_tso_maxsegsize, /* maxsegsize */ + 0, /* flags */ + NULL, /* lockfunc */ + NULL, /* lockfuncarg */ + &txq->ift_tso_buf_tag))) { device_printf(dev, "Unable to allocate TSO TX DMA tag: %d\n", err); goto fail; @@ -1966,17 +1966,17 @@ iflib_rxsd_alloc(iflib_rxq_t rxq) fl->ifl_size = scctx->isc_nrxd[rxq->ifr_fl_offset]; /* this isn't necessarily the same */ /* Set up DMA tag for RX buffers. */ err = bus_dma_tag_create(bus_get_dma_tag(dev), /* parent */ - 1, 0, /* alignment, bounds */ - lowaddr, /* lowaddr */ - BUS_SPACE_MAXADDR, /* highaddr */ - NULL, NULL, /* filter, filterarg */ - sctx->isc_rx_maxsize, /* maxsize */ - sctx->isc_rx_nsegments, /* nsegments */ - sctx->isc_rx_maxsegsize, /* maxsegsize */ - 0, /* flags */ - NULL, /* lockfunc */ - NULL, /* lockarg */ - &fl->ifl_buf_tag); + 1, 0, /* alignment, bounds */ + lowaddr, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + sctx->isc_rx_maxsize, /* maxsize */ + sctx->isc_rx_nsegments, /* nsegments */ + sctx->isc_rx_maxsegsize, /* maxsegsize */ + 0, /* flags */ + NULL, /* lockfunc */ + NULL, /* lockarg */ + &fl->ifl_buf_tag); if (err) { device_printf(dev, "Unable to allocate RX DMA tag: %d\n", err); @@ -1985,8 +1985,8 @@ iflib_rxsd_alloc(iflib_rxq_t rxq) /* Allocate memory for the RX mbuf map. */ if (!(fl->ifl_sds.ifsd_m = - (struct mbuf **) malloc(sizeof(struct mbuf *) * - scctx->isc_nrxd[rxq->ifr_fl_offset], M_IFLIB, M_NOWAIT | M_ZERO))) { + (struct mbuf **) malloc(sizeof(struct mbuf *) * + scctx->isc_nrxd[rxq->ifr_fl_offset], M_IFLIB, M_NOWAIT | M_ZERO))) { device_printf(dev, "Unable to allocate RX mbuf map memory\n"); err = ENOMEM; @@ -1995,8 +1995,8 @@ iflib_rxsd_alloc(iflib_rxq_t rxq) /* Allocate memory for the direct RX cluster pointer map. */ if (!(fl->ifl_sds.ifsd_cl = - (caddr_t *) malloc(sizeof(caddr_t) * - scctx->isc_nrxd[rxq->ifr_fl_offset], M_IFLIB, M_NOWAIT | M_ZERO))) { + (caddr_t *) malloc(sizeof(caddr_t) * + scctx->isc_nrxd[rxq->ifr_fl_offset], M_IFLIB, M_NOWAIT | M_ZERO))) { device_printf(dev, "Unable to allocate RX cluster map memory\n"); err = ENOMEM; @@ -2005,8 +2005,8 @@ iflib_rxsd_alloc(iflib_rxq_t rxq) /* Allocate memory for the RX cluster bus address map. */ if (!(fl->ifl_sds.ifsd_ba = - (bus_addr_t *) malloc(sizeof(bus_addr_t) * - scctx->isc_nrxd[rxq->ifr_fl_offset], M_IFLIB, M_NOWAIT | M_ZERO))) { + (bus_addr_t *) malloc(sizeof(bus_addr_t) * + scctx->isc_nrxd[rxq->ifr_fl_offset], M_IFLIB, M_NOWAIT | M_ZERO))) { device_printf(dev, "Unable to allocate RX bus address map memory\n"); err = ENOMEM; @@ -2017,7 +2017,7 @@ iflib_rxsd_alloc(iflib_rxq_t rxq) * Create the DMA maps for RX buffers. */ if (!(fl->ifl_sds.ifsd_map = - (bus_dmamap_t *) malloc(sizeof(bus_dmamap_t) * scctx->isc_nrxd[rxq->ifr_fl_offset], M_IFLIB, M_NOWAIT | M_ZERO))) { + (bus_dmamap_t *) malloc(sizeof(bus_dmamap_t) * scctx->isc_nrxd[rxq->ifr_fl_offset], M_IFLIB, M_NOWAIT | M_ZERO))) { device_printf(dev, "Unable to allocate RX buffer DMA map memory\n"); err = ENOMEM; @@ -2557,7 +2557,7 @@ done: callout_reset_on(&txq->ift_timer, iflib_timer_default, iflib_timer, txq, txq->ift_timer.c_cpu); - /* Re-enable txsync/rxsync. */ + /* Re-enable txsync/rxsync. */ netmap_enable_all_rings(ifp); } @@ -3188,11 +3188,11 @@ static void print_pkt(if_pkt_info_t pi) { printf("pi len: %d qsidx: %d nsegs: %d ndescs: %d flags: %x pidx: %d\n", - pi->ipi_len, pi->ipi_qsidx, pi->ipi_nsegs, pi->ipi_ndescs, pi->ipi_flags, pi->ipi_pidx); + pi->ipi_len, pi->ipi_qsidx, pi->ipi_nsegs, pi->ipi_ndescs, pi->ipi_flags, pi->ipi_pidx); printf("pi new_pidx: %d csum_flags: %lx tso_segsz: %d mflags: %x vtag: %d\n", - pi->ipi_new_pidx, pi->ipi_csum_flags, pi->ipi_tso_segsz, pi->ipi_mflags, pi->ipi_vtag); + pi->ipi_new_pidx, pi->ipi_csum_flags, pi->ipi_tso_segsz, pi->ipi_mflags, pi->ipi_vtag); printf("pi etype: %d ehdrlen: %d ip_hlen: %d ipproto: %d\n", - pi->ipi_etype, pi->ipi_ehdrlen, pi->ipi_ip_hlen, pi->ipi_ipproto); + pi->ipi_etype, pi->ipi_ehdrlen, pi->ipi_ip_hlen, pi->ipi_ipproto); } #endif @@ -3742,7 +3742,7 @@ defrag: */ txq->ift_rs_pending += nsegs + 1; if (txq->ift_rs_pending > TXQ_MAX_RS_DEFERRED(txq) || - iflib_no_tx_batch || (TXQ_AVAIL(txq) - nsegs) <= MAX_TX_DESC(ctx) + 2) { + iflib_no_tx_batch || (TXQ_AVAIL(txq) - nsegs) <= MAX_TX_DESC(ctx) + 2) { pi.ipi_flags |= IPI_TX_INTR; txq->ift_rs_pending = 0; } @@ -3878,8 +3878,8 @@ iflib_completed_tx_reclaim(iflib_txq_t txq, int thresh) #ifdef INVARIANTS if (iflib_verbose_debug) { printf("%s processed=%ju cleaned=%ju tx_nsegments=%d reclaim=%d thresh=%d\n", __func__, - txq->ift_processed, txq->ift_cleaned, txq->ift_ctx->ifc_softc_ctx.isc_tx_nsegments, - reclaim, thresh); + txq->ift_processed, txq->ift_cleaned, txq->ift_ctx->ifc_softc_ctx.isc_tx_nsegments, + reclaim, thresh); } #endif return (0); @@ -3984,7 +3984,7 @@ iflib_txq_drain(struct ifmp_ring *r, uint32_t cidx, uint32_t pidx) #ifdef INVARIANTS if (iflib_verbose_debug) printf("%s avail=%d ifc_flags=%x txq_avail=%d ", __func__, - avail, ctx->ifc_flags, TXQ_AVAIL(txq)); + avail, ctx->ifc_flags, TXQ_AVAIL(txq)); #endif do_prefetch = (ctx->ifc_flags & IFC_PREFETCH); err = 0; @@ -4366,7 +4366,7 @@ iflib_if_transmit(if_t ifp, struct mbuf *m) if (abdicate) GROUPTASK_ENQUEUE(&txq->ift_task); - if (err) { + if (err) { if (!abdicate) GROUPTASK_ENQUEUE(&txq->ift_task); /* support forthcoming later */ @@ -4459,9 +4459,9 @@ iflib_if_qflush(if_t ifp) } #define IFCAP_FLAGS (IFCAP_HWCSUM_IPV6 | IFCAP_HWCSUM | IFCAP_LRO | \ - IFCAP_TSO | IFCAP_VLAN_HWTAGGING | IFCAP_HWSTATS | \ - IFCAP_VLAN_MTU | IFCAP_VLAN_HWFILTER | \ - IFCAP_VLAN_HWTSO | IFCAP_VLAN_HWCSUM | IFCAP_MEXTPG) + IFCAP_TSO | IFCAP_VLAN_HWTAGGING | IFCAP_HWSTATS | \ + IFCAP_VLAN_MTU | IFCAP_VLAN_HWFILTER | \ + IFCAP_VLAN_HWTSO | IFCAP_VLAN_HWCSUM | IFCAP_MEXTPG) static int iflib_if_ioctl(if_t ifp, u_long command, caddr_t data) @@ -4807,17 +4807,17 @@ iflib_reset_qvalues(if_ctx_t ctx) for (i = 0; i < sctx->isc_nrxqs; i++) { if (scctx->isc_nrxd[i] < sctx->isc_nrxd_min[i]) { device_printf(dev, "nrxd%d: %d less than nrxd_min %d - resetting to min\n", - i, scctx->isc_nrxd[i], sctx->isc_nrxd_min[i]); + i, scctx->isc_nrxd[i], sctx->isc_nrxd_min[i]); scctx->isc_nrxd[i] = sctx->isc_nrxd_min[i]; } if (scctx->isc_nrxd[i] > sctx->isc_nrxd_max[i]) { device_printf(dev, "nrxd%d: %d greater than nrxd_max %d - resetting to max\n", - i, scctx->isc_nrxd[i], sctx->isc_nrxd_max[i]); + i, scctx->isc_nrxd[i], sctx->isc_nrxd_max[i]); scctx->isc_nrxd[i] = sctx->isc_nrxd_max[i]; } if (!powerof2(scctx->isc_nrxd[i])) { device_printf(dev, "nrxd%d: %d is not a power of 2 - using default value of %d\n", - i, scctx->isc_nrxd[i], sctx->isc_nrxd_default[i]); + i, scctx->isc_nrxd[i], sctx->isc_nrxd_default[i]); scctx->isc_nrxd[i] = sctx->isc_nrxd_default[i]; } } @@ -4825,17 +4825,17 @@ iflib_reset_qvalues(if_ctx_t ctx) for (i = 0; i < sctx->isc_ntxqs; i++) { if (scctx->isc_ntxd[i] < sctx->isc_ntxd_min[i]) { device_printf(dev, "ntxd%d: %d less than ntxd_min %d - resetting to min\n", - i, scctx->isc_ntxd[i], sctx->isc_ntxd_min[i]); + i, scctx->isc_ntxd[i], sctx->isc_ntxd_min[i]); scctx->isc_ntxd[i] = sctx->isc_ntxd_min[i]; } if (scctx->isc_ntxd[i] > sctx->isc_ntxd_max[i]) { device_printf(dev, "ntxd%d: %d greater than ntxd_max %d - resetting to max\n", - i, scctx->isc_ntxd[i], sctx->isc_ntxd_max[i]); + i, scctx->isc_ntxd[i], sctx->isc_ntxd_max[i]); scctx->isc_ntxd[i] = sctx->isc_ntxd_max[i]; } if (!powerof2(scctx->isc_ntxd[i])) { device_printf(dev, "ntxd%d: %d is not a power of 2 - using default value of %d\n", - i, scctx->isc_ntxd[i], sctx->isc_ntxd_default[i]); + i, scctx->isc_ntxd[i], sctx->isc_ntxd_default[i]); scctx->isc_ntxd[i] = sctx->isc_ntxd_default[i]; } } @@ -4908,7 +4908,7 @@ cpuid_advance(if_ctx_t ctx, unsigned int cpuid, unsigned int n) } #if defined(SMP) && defined(SCHED_ULE) -extern struct cpu_group *cpu_top; /* CPU topology */ +extern struct cpu_group *cpu_top; /* CPU topology */ static int find_child_with_core(int cpu, struct cpu_group *grp) @@ -5460,9 +5460,9 @@ fail_unlock: iflib_deregister(ctx); fail_ctx_free: device_set_softc(ctx->ifc_dev, NULL); - if (ctx->ifc_flags & IFC_SC_ALLOCATED) - free(ctx->ifc_softc, M_IFLIB); - free(ctx, M_IFLIB); + if (ctx->ifc_flags & IFC_SC_ALLOCATED) + free(ctx->ifc_softc, M_IFLIB); + free(ctx, M_IFLIB); return (err); } @@ -5791,11 +5791,11 @@ iflib_register(if_ctx_t ctx) if_setqflushfn(ifp, iflib_if_qflush); if_setflags(ifp, IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST); ctx->ifc_vlan_attach_event = - EVENTHANDLER_REGISTER(vlan_config, iflib_vlan_register, ctx, - EVENTHANDLER_PRI_FIRST); + EVENTHANDLER_REGISTER(vlan_config, iflib_vlan_register, ctx, + EVENTHANDLER_PRI_FIRST); ctx->ifc_vlan_detach_event = - EVENTHANDLER_REGISTER(vlan_unconfig, iflib_vlan_unregister, ctx, - EVENTHANDLER_PRI_FIRST); + EVENTHANDLER_REGISTER(vlan_unconfig, iflib_vlan_unregister, ctx, + EVENTHANDLER_PRI_FIRST); if ((sctx->isc_flags & IFLIB_DRIVER_MEDIA) == 0) { ctx->ifc_mediap = &ctx->ifc_media; @@ -5868,12 +5868,12 @@ iflib_queues_alloc(if_ctx_t ctx) KASSERT(ntxqs > 0, ("number of queues per qset must be at least 1")); KASSERT(nrxqs > 0, ("number of queues per qset must be at least 1")); KASSERT(nrxqs >= fl_offset + nfree_lists, - ("there must be at least a rxq for each free list")); + ("there must be at least a rxq for each free list")); /* Allocate the TX ring struct memory */ if (!(ctx->ifc_txqs = (iflib_txq_t) malloc(sizeof(struct iflib_txq) * - ntxqsets, M_IFLIB, M_NOWAIT | M_ZERO))) { + ntxqsets, M_IFLIB, M_NOWAIT | M_ZERO))) { device_printf(dev, "Unable to allocate TX ring memory\n"); err = ENOMEM; goto fail; @@ -5882,7 +5882,7 @@ iflib_queues_alloc(if_ctx_t ctx) /* Now allocate the RX */ if (!(ctx->ifc_rxqs = (iflib_rxq_t) malloc(sizeof(struct iflib_rxq) * - nrxqsets, M_IFLIB, M_NOWAIT | M_ZERO))) { + nrxqsets, M_IFLIB, M_NOWAIT | M_ZERO))) { device_printf(dev, "Unable to allocate RX ring memory\n"); err = ENOMEM; goto rx_fail; @@ -5941,7 +5941,7 @@ iflib_queues_alloc(if_ctx_t ctx) #endif /* DEV_NETMAP */ err = ifmp_ring_alloc(&txq->ift_br, 2048, txq, iflib_txq_drain, - iflib_txq_can_drain, M_IFLIB, M_WAITOK); + iflib_txq_can_drain, M_IFLIB, M_WAITOK); if (err) { /* XXX free any allocated rings */ device_printf(dev, "Unable to allocate buf_ring\n"); @@ -5954,7 +5954,7 @@ iflib_queues_alloc(if_ctx_t ctx) callout_init(&rxq->ifr_watchdog, 1); if ((ifdip = malloc(sizeof(struct iflib_dma_info) * nrxqs, - M_IFLIB, M_NOWAIT | M_ZERO)) == NULL) { + M_IFLIB, M_NOWAIT | M_ZERO)) == NULL) { device_printf(dev, "Unable to allocate RX DMA info memory\n"); err = ENOMEM; @@ -5979,7 +5979,7 @@ iflib_queues_alloc(if_ctx_t ctx) rxq->ifr_fl_offset = fl_offset; rxq->ifr_nfl = nfree_lists; if (!(fl = - (iflib_fl_t) malloc(sizeof(struct iflib_fl) * nfree_lists, M_IFLIB, M_NOWAIT | M_ZERO))) { + (iflib_fl_t) malloc(sizeof(struct iflib_fl) * nfree_lists, M_IFLIB, M_NOWAIT | M_ZERO))) { device_printf(dev, "Unable to allocate free list memory\n"); err = ENOMEM; goto err_tx_desc; @@ -6636,7 +6636,7 @@ iflib_msix_init(if_ctx_t ctx) */ if (bar != -1) { ctx->ifc_msix_mem = bus_alloc_resource_any(dev, - SYS_RES_MEMORY, &bar, RF_ACTIVE); + SYS_RES_MEMORY, &bar, RF_ACTIVE); if (ctx->ifc_msix_mem == NULL) { device_printf(dev, "Unable to map MSI-X table\n"); goto msi; @@ -6781,7 +6781,7 @@ mp_ring_state_handler(SYSCTL_HANDLER_ARGS) state[0], state[1], state[2], ring_state); rc = sbuf_finish(sb); sbuf_delete(sb); - return (rc); + return (rc); } enum iflib_ndesc_handler { @@ -6842,7 +6842,7 @@ mp_ndesc_handler(SYSCTL_HANDLER_ARGS) static void iflib_add_device_sysctl_pre(if_ctx_t ctx) { - device_t dev = iflib_get_dev(ctx); + device_t dev = iflib_get_dev(ctx); struct sysctl_oid_list *child, *oid_list; struct sysctl_ctx_list *ctx_list; struct sysctl_oid *node; @@ -6888,7 +6888,7 @@ iflib_add_device_sysctl_pre(if_ctx_t ctx) CTLFLAG_RDTUN, &ctx->ifc_sysctl_extra_msix_vectors, 0, "attempt to reserve the given number of extra MSI-X vectors during driver load for the creation of additional interfaces later"); SYSCTL_ADD_INT(ctx_list, oid_list, OID_AUTO, "allocated_msix_vectors", - CTLFLAG_RDTUN, &ctx->ifc_softc_ctx.isc_vectors, 0, + CTLFLAG_RDTUN, &ctx->ifc_softc_ctx.isc_vectors, 0, "total # of MSI-X vectors allocated by driver"); /* XXX change for per-queue sizes */ @@ -6907,7 +6907,7 @@ iflib_add_device_sysctl_post(if_ctx_t ctx) { if_shared_ctx_t sctx = ctx->ifc_sctx; if_softc_ctx_t scctx = &ctx->ifc_softc_ctx; - device_t dev = iflib_get_dev(ctx); + device_t dev = iflib_get_dev(ctx); struct sysctl_oid_list *child; struct sysctl_ctx_list *ctx_list; iflib_fl_t fl; From nobody Mon Jul 7 10:06:55 2025 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 4bbKf83nxLz61Jpj; Mon, 07 Jul 2025 10:06:56 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbKf80Cq7z3dq3; Mon, 07 Jul 2025 10:06:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751882816; 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=/Oye/kgdL1wpxp/wA69pqWtdhKADtXiXNCn6ZLArHUM=; b=Mk5FbaSSaGsAqjCMvA8VSA/JtzustKH2wK6yduYv0c1h8p6y23LECPfeVa34s/Y/HJsyI4 9ZcUPutIWFPTQWdnQo3Yl5+y4J0gWgkbJjKt2fbJh4ZFRNSsI5+Iwr9sTKqq8ASKNu2mez x7jGGSCkoNyUIe5eTRd5dUA++iesl5/zHrEzig22WiV7AR3nowpK4n7XnMM6iJhx6lgF93 LRVPhYU5lStlGMte9f6tzBO1IuqKugzjJHpH//s2yrUOZR7wHZro+4sY3vlCz3bwMZDNBx a2Eauta7lYGZZHj0npYEBmyi5YRhzCDial2Go+brD5weFJw1wA+yj3C3v5MlOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751882816; 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=/Oye/kgdL1wpxp/wA69pqWtdhKADtXiXNCn6ZLArHUM=; b=rkeYJ7apAmYswjMEvRjL04vOG4bQvoN9ORzZfr1mjOq2N4v9asVMioQMmP4V0UTUDvSlrA QnD3S/Om7YbhupikuTorHfL7sfzimepxuefJDQ9HI+iKsxHpyb+HJtHjVIrf+eJz7MMVcU 9bYDY9fHjccGYs7j6/68PCwiaMsympVXtBnNN7aOGbeYQk1K75S633i//jkXb1jkErDLNp Uhd2e0DdRHv7lVhSamHxxsX+oArDd+zEPvALV0ivV2Jy6UfzC1XuDYmQhZmKRpV6nyeQNF 6cURZcnmtPBOT8FAMUr50t9nUAm6qGW0KlVSwan/0qbY9lReg5KxGmkCzUkKlw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751882816; a=rsa-sha256; cv=none; b=ljM7Jm3zcYM3bQKu/pgnfOKXZcon6Cf3adwUS9eqUSkjPF0dMC+kPXBn5VpzI4iSRzOfcG ieekZqiJ9qoC/Du7IcdxQnozMgpVfLlwqVj7+MJL+0W80prEfD4lF5eCTAcOHLN/huP90E uhVyMCNBbTyeQsn8E+OfcDxlG7bgUdv3xRvmibsVE4k4tB02CdQGPH6O1CGiUc/WbKJC1f SUkSvb5YigVHkMFAZCG3/ZtHOHgHUxorU1Uw2EowmnUJOp0vFWR/PFhXW/F98c54DgAq0Q HfMOrTt9R1WgTzpR8X13PLF9aVl/JsRbmzEn7aeqpfH7Dq1dOOcdhLq29o7ZPw== 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 4bbKf76j6HzmsG; Mon, 07 Jul 2025 10:06:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567A6tW5053346; Mon, 7 Jul 2025 10:06:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567A6tZr053343; Mon, 7 Jul 2025 10:06:55 GMT (envelope-from git) Date: Mon, 7 Jul 2025 10:06:55 GMT Message-Id: <202507071006.567A6tZr053343@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 3bc1aea4cc8a - stable/14 - if_firewire: Make firewire_broadcastaddr static const 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 3bc1aea4cc8a448ffd2e1477950da5e494cf1375 Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=3bc1aea4cc8a448ffd2e1477950da5e494cf1375 commit 3bc1aea4cc8a448ffd2e1477950da5e494cf1375 Author: Zhenlei Huang AuthorDate: 2025-06-01 14:47:24 +0000 Commit: Zhenlei Huang CommitDate: 2025-07-07 10:03:58 +0000 if_firewire: Make firewire_broadcastaddr static const This global variable is used only in this file. While here, constify it since it is only used to read. No functional change intended. MFC after: 1 week (cherry picked from commit 517eb20e54e59173b9dbede0bb3356f6197b5aa9) --- sys/net/if_fwsubr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/net/if_fwsubr.c b/sys/net/if_fwsubr.c index bf3362fc975c..ceac93d31d56 100644 --- a/sys/net/if_fwsubr.c +++ b/sys/net/if_fwsubr.c @@ -67,7 +67,7 @@ static MALLOC_DEFINE(M_FWCOM, "fw_com", "firewire interface internals"); -struct fw_hwaddr firewire_broadcastaddr = { +static const struct fw_hwaddr firewire_broadcastaddr = { 0xffffffff, 0xffffffff, 0xff, @@ -777,7 +777,7 @@ firewire_ifattach(struct ifnet *ifp, struct fw_hwaddr *llc) ifp->if_mtu = 1500; /* XXX */ ifp->if_output = firewire_output; ifp->if_resolvemulti = firewire_resolvemulti; - ifp->if_broadcastaddr = (u_char *) &firewire_broadcastaddr; + ifp->if_broadcastaddr = (const u_char *) &firewire_broadcastaddr; ifa = ifp->if_addr; KASSERT(ifa != NULL, ("%s: no lladdr!\n", __func__)); From nobody Mon Jul 7 10:06:59 2025 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 4bbKfC5q11z61Jh4; Mon, 07 Jul 2025 10:06:59 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbKfC2Wbsz3f5R; Mon, 07 Jul 2025 10:06:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751882819; 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=KC7B7ypSaMxVbvoM1dH8sPtdyGXbQ8CiSdknGARlIYA=; b=XuqKJQlcsrgVJnM3ozj1KAptf4a1/FZTgF1JQr0K6Td1oPoazFu+EntbVAueIVfddQ+zZV zGDB/Nkx6JuSa80RM6GAlKVrypWXiA/mP9qE+AxBTvs37o4EwODIvyo7Iaxk9f0yOErQTB b29gLOF6/XFeLItLpFYQAG1Gk944fl9FY4NAKhJ692WSfE/B1bKDA2b+fyR+OX8RQgqP3n R/SmgQLHvF8/K5WZ+JcQkwpt1QtwKj4SB8KScA5LPU47w89b/Z1/vOgprqFkqWcGW7IAwZ G+bZuXxqfoJEkNiHhQ7EceJdgaLPypoxbIslxWpJRNLHFVlZkSnvq+0drFg2ZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751882819; 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=KC7B7ypSaMxVbvoM1dH8sPtdyGXbQ8CiSdknGARlIYA=; b=vayeOOj2l0g0PU+gfdKU2Gw888SxwsxPxDRk0fKT1bXrM1yTHzCVx1AMJy7usyP6JPhSmI VgB9vMAAWVcCxGbJUfGnVB4RrsWuhA9HWrXXxHuhZiuWlfXdVO9kDRBVCK+hcVFbkF5QP1 SyC8brvfQdYyah1nmj5o7trpmM5G2WHPvAl3pKfUvow3hCBTpLlAyEAdbdnI8Am01M8aXF SC1SwrkhJifoY90WpGnEcA2xyXBgzlb8eaJTgKhU3aqUQB3qRFDoPYL94ZR9qM2BK7HqfN hjkyWGo6LlDx7No7mvZDP4OHMbD8sPjRJ0v6eOQrnE2pWE+5H0L0exd0gk2OVw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751882819; a=rsa-sha256; cv=none; b=ADX0LCjItLjEO5NGUic5E+ISYYjiwvKaLnkrJPAWZJ5yBLqDrqhSNfYKRAKVbM0HOfMQ5I wZE8hvIT+zRRaR3mYnnK7IACZRMzizKp9pudxnV2Zo/7bZy42OqazWFcQQv28S86EHKVbO WMh9eLrJIL+kJJPmAUuuA53yBh6+Qizcl3pLOazl+cth9LEk0xZXdxswbOYnrw+iD+nSoK jq4aHyYNhyBSRt7tSjxwXQQz7nSEN3PJhNtxEwyCw6wP4KvWQ61fEkmPZUYZ9osun4w5so Kqf3ZHVOGxbBF/hKvCLiqqejkZzxbFp833uNQPXHb7OnXQa1WC6dREf7S0rO9A== 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 4bbKfC1wj7zmcw; Mon, 07 Jul 2025 10:06:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567A6xt9053450; Mon, 7 Jul 2025 10:06:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567A6xsn053447; Mon, 7 Jul 2025 10:06:59 GMT (envelope-from git) Date: Mon, 7 Jul 2025 10:06:59 GMT Message-Id: <202507071006.567A6xsn053447@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 3da0853d7119 - stable/14 - ng_iface(4): Remove a redundant assignment of if_type 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 3da0853d71197610375262b8bb06cadda6c8f4dc Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=3da0853d71197610375262b8bb06cadda6c8f4dc commit 3da0853d71197610375262b8bb06cadda6c8f4dc Author: Zhenlei Huang AuthorDate: 2025-06-13 10:07:18 +0000 Commit: Zhenlei Huang CommitDate: 2025-07-07 10:05:09 +0000 ng_iface(4): Remove a redundant assignment of if_type That is unnecessary since change [1], as if_alloc(IFT_PROPVIRTUAL) has set if_type already. [1] fc74a9f93a5f Stop embedding struct ifnet at the top of driver softcs No functional change intended. MFC after: 1 week (cherry picked from commit c43d6dadf7e34a94f4d119ff6d7113ad9a9b4d38) --- sys/netgraph/ng_iface.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/netgraph/ng_iface.c b/sys/netgraph/ng_iface.c index d42e74d5fd22..fbe89e13474b 100644 --- a/sys/netgraph/ng_iface.c +++ b/sys/netgraph/ng_iface.c @@ -545,7 +545,6 @@ ng_iface_constructor(node_p node) ifp->if_ioctl = ng_iface_ioctl; ifp->if_mtu = NG_IFACE_MTU_DEFAULT; ifp->if_flags = (IFF_SIMPLEX|IFF_POINTOPOINT|IFF_NOARP|IFF_MULTICAST); - ifp->if_type = IFT_PROPVIRTUAL; /* XXX */ ifp->if_addrlen = 0; /* XXX */ ifp->if_hdrlen = 0; /* XXX */ ifp->if_baudrate = 64000; /* XXX */ From nobody Mon Jul 7 10:06:58 2025 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 4bbKfB5HYvz61Jpm; Mon, 07 Jul 2025 10:06:58 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbKfB1xxdz3dts; Mon, 07 Jul 2025 10:06:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751882818; 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=kYukBEEoFA2vIq4BzlMKHMdlzKPcK0m4/riKYGr1qE8=; b=ovm4vb/p6a5wbYi1r7e7JJiX0MSar3+y4RiBwrCE9Ivx1f/aJJqNtID3vctjxDp8bht5s/ b57CyVnapWxvKiYm/WUkwQLJ5jIeFX2pTvdUgOXxCMQvmM3iVDb1KEQg6Foj2rZLsUk1dU FgAF5jwn7jBh6y5fsvRKJ4vJPjl4mhpWKNGK/1kbf5tYkJ3qUkVlvcBCkkIR1s1rJwx/Tz Qz3TwJqEaLhhPL7N/jHQUXlgqrZNFa9eoGLpVcru/2pe4gB1wk3a0mAPVMu3DsiM1k0Vbz RWHIP1lyRvaqT69msBGbiA4JlXVsqGv9mhTsl4YPJd40csI20/2ig5ygm8gPNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751882818; 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=kYukBEEoFA2vIq4BzlMKHMdlzKPcK0m4/riKYGr1qE8=; b=VhwetLEafryk6Ngl7hgn/C3g7tBjTjHd8iJVyl2TmK8InN4AG3ResxOwLDvJjoguPMriMj u4eoVcDqrbtcX/QEO61HI25bhTQknWt6lu+J8q+tbqFIZvwAZUQE+wA8Q3eZ0U8Nr1orbn 5cU2n+VM+lT1GMaJKvRvcpY2wWZKTWD8YJtiosqiWgCD2RUibgRPNgEfE024buArCgATZj ytQR0Dn97Au0eLhtsxMVyzMJgNI7L4Ol9AeytBD3to9JRaxzwTTrAuZsyN80GKhtJerKhd D9XJ6S06q3Xd6AqtECBYtsgk4KxPvLUTB471499WX3Aq27slXynQo07ypZiLSg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751882818; a=rsa-sha256; cv=none; b=kchPYkkSkOlOEgVqPyPGFrFnG/eLFpBR6J2/xKXfUZbTiqk8uXuR+qwJjyWKqDNzCxKRVG D4EJMxIM0mkBgu/Q9cXF5qr5Z+Et8lIfmxC1lpbij+ru0864rSpArRDqXOitaRjGhwb0bN tEEcXFPgs98w2GnfbhBlTYto6gk2c+Ales+jsOpoj0k3M22nk+TDkLDLVKjYFnI+8FKuqS dS4EmVSCc/ePvmWBMrFghbJZcuVYRgf3LjhIlQ+w8wh+0ZDVWOk/Jg0R+3MVJu5ZnnD68s PR5QtjHU3Tu0yWQ4ORxETxOBqFcMUct1sexvoPOKAn4Aw53jcUhKTz1pBZYPwQ== 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 4bbKfB1D2fzmcv; Mon, 07 Jul 2025 10:06:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567A6wAF053415; Mon, 7 Jul 2025 10:06:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567A6wDW053412; Mon, 7 Jul 2025 10:06:58 GMT (envelope-from git) Date: Mon, 7 Jul 2025 10:06:58 GMT Message-Id: <202507071006.567A6wDW053412@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 1ddf7942c331 - stable/14 - git-blame-ignore-revs: iflib style(9) tweaks 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1ddf7942c331d61657aefbbf9998d00c27c25bef Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=1ddf7942c331d61657aefbbf9998d00c27c25bef commit 1ddf7942c331d61657aefbbf9998d00c27c25bef Author: Zhenlei Huang AuthorDate: 2025-06-06 10:07:06 +0000 Commit: Zhenlei Huang CommitDate: 2025-07-07 10:05:05 +0000 git-blame-ignore-revs: iflib style(9) tweaks Hash is updated to match MFC commit. (cherry picked from commit 898a886b4504cd9c7fe7dddd918cd64c068b1cfe) --- .git-blame-ignore-revs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 9f873aadd745..22cddb7b766d 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -8,6 +8,8 @@ # # This file is sorted in git log order (newest commits first). +# iflib style tweaks +a2989d11eabeb869b8c845a097d4214755d9a99f # queue(3) single space after all #define 49066283a4c1fc5c9d6c4cbee00cc941f4b09792 # bin/ps whitespace cleanup From nobody Mon Jul 7 10:07:01 2025 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 4bbKfG0NT6z61JSG; Mon, 07 Jul 2025 10:07:02 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbKfF5QCFz3f67; Mon, 07 Jul 2025 10:07:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751882821; 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=PVZcLcGAuFoW09O8ww9PYyfMHbvJ0ERHZzJ0VEh8Tdk=; b=bLMiBMiYMu9Ksw4zTkwfyKTeYw/9dCb1BqzedDmCNZexkxrk6lHpgdh3WBbpAEA6M9UNCY UVoenjMUrXPmjYIY008tQpTxveF9Rvj+lYq/TN2PtYjwwdI0SPpGR41EFrm2utIWJBzO+y 7ryqE7eJnfji+1pPnyBEglHyHVz7baCbc3jWg7ia7nqW3GvUw57uBU4EMGGH5a3n6yDKAr qfs87FeBFziBsYsOG2CaPVkdU9i6J8wWrGrJ6g4IAP0lJmwKpgpzRZZ2Aw2FU7MzAn3hfV orJO3cKinlK0mvHCnyugRJXw5zTE1mG29qAdZGUDLqWdNifaSXKdRuDTXg6J0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751882821; 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=PVZcLcGAuFoW09O8ww9PYyfMHbvJ0ERHZzJ0VEh8Tdk=; b=dzjvieIgAhD/rkRoAfpUmTvt2C9oC0xsBVtIQYh4az1p0ah2THScgil+HOLo9E5mge8K6C Q37EAeMFbYAr7mvxiy5TruDMqc563uSaJv2RsD++nv7pe//Qm8i/NFgTnYfMB3FiYXDvNx Vn7B7FKEMRrklwVhNyXzUuccA/Nw58ogqvgDPtznLJKSC56H7o4A/OMWKW/lQoJqtd0ijn Dl28hGLfVbznam/QenCbANU5FG2MqLRpKBulv7jaxE1Lf9iZFx0u10qqPIUJEiNJRWp0Po ZECT6tnaJsmrl4Ri5GZUbnCeZcUYBU679L5eZupyBW58cegIKnmMcdQjXvRfiw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751882821; a=rsa-sha256; cv=none; b=odwwrUdw24zrNOcJVG/Axiiys0ln517APy0UScnVfHIuRUZa3T6EsnvbQkgsS3xeh6zM6i 9yXeLMcnFAM/x5u83U1mEx5ICHStW88KvRJ4zWjomWvSkBp9RKZkyTtnwYBQ59Rs4qkSlh Nw3iDGhwrR3bWSqIVE8PUJ6Vlk4iSrCzFHMVET4ccds1qPb8MdbTcLC3K30UoDCA8zwsT3 4G8tNW+Wi7iDY822jdpGhyeH5rCcZOhXEkq4OBgAqgmw2TTueC/QhYvqNDVSMk4GBY4Wlu 7Tj12evVy6mlDUXCy/60WKlI8tnyrFoxNsp5ykWIsQVgGjGw+zsW4VzXwKg65w== 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 4bbKfF4336zmWZ; Mon, 07 Jul 2025 10:07:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567A71Wv053530; Mon, 7 Jul 2025 10:07:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567A718l053527; Mon, 7 Jul 2025 10:07:01 GMT (envelope-from git) Date: Mon, 7 Jul 2025 10:07:01 GMT Message-Id: <202507071007.567A718l053527@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 193f0bde3b04 - stable/14 - bridge: Remove a redundant assignment of if_type 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 193f0bde3b048559d36c3e6db5d6b2be7daeaf6f Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=193f0bde3b048559d36c3e6db5d6b2be7daeaf6f commit 193f0bde3b048559d36c3e6db5d6b2be7daeaf6f Author: Zhenlei Huang AuthorDate: 2025-06-16 14:35:40 +0000 Commit: Zhenlei Huang CommitDate: 2025-07-07 10:05:10 +0000 bridge: Remove a redundant assignment of if_type ether_ifattach() no longer sets if_type to IFT_ETHER and keeps it as is since the change [1]. [1] fc74a9f93a5f Stop embedding struct ifnet at the top of driver softcs No functional change intended. MFC after: 1 week (cherry picked from commit a07604e6264b88222941fa61c6f989bad5490765) --- sys/net/if_bridge.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c index 4d4f52263748..035ba0f0806c 100644 --- a/sys/net/if_bridge.c +++ b/sys/net/if_bridge.c @@ -806,7 +806,6 @@ bridge_clone_create(struct if_clone *ifc, char *name, size_t len, ether_ifattach(ifp, sc->sc_defaddr.octet); /* Now undo some of the damage... */ ifp->if_baudrate = 0; - ifp->if_type = IFT_BRIDGE; #ifdef VIMAGE ifp->if_reassign = bridge_reassign; #endif From nobody Mon Jul 7 10:07:00 2025 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 4bbKfD72mHz61Jpq; Mon, 07 Jul 2025 10:07:00 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbKfD3b9yz3dxN; Mon, 07 Jul 2025 10:07:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751882820; 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=uBYxNPjZN2LtEeeLNRF5JgQ0W+f/pgM1tact1uK0CGA=; b=A1zYsTpT0piJPSf3pp3qICbQpBh09zs6Y9kkSxmSsoNbt4f6YTUi12MAq58kimUVBMC0Ft 7Bv3zvR47dYdH8kPxmmOcZ63h0rAafeHwbwPy+G2xkbA2c4XWf/FlmIqqNGqGnQS4Y6gEg dvl0cxTng7dTSxeGDKAbpv2xQWGQVALmVCa00PKaGmzm8GEZJ5m5T0KcEks0QNPXsp0CdL M5NjZrdJrBO4nqMbUyVIrnnajbwCjfHOUi1EOfvPz/VJheXj8Otp+SpUSx4l+cyz2Uflpt tjhGvtkfaJGIF0mKa14FUFz3ZrVGJt/NR7ozBdMBU2hlk/ViCXfyz16HC4EOSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751882820; 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=uBYxNPjZN2LtEeeLNRF5JgQ0W+f/pgM1tact1uK0CGA=; b=jxotIITEHwqZ+uI+gLdfngl6drFpcSuBuZ1ZDEx2jKijZxeqQkBpBL1JbQ30ROEsYOs/1U hTFyhoKT9vpsNAtzglvqNAxwzN2ah1onPxIU5Z+dm/qUSK3owV4HrQl9KGzmvmEfLnYiBe lrzN8hebbxQH/ajCod1JUPS3s6tJvWJPDm5iIdvyjnWsqQIsAQeivXT9R/P5B4CeCJvMOC 8Nr2o5UKBYqTiAWOeXiNNusq4Kp+T8d+MriER/v8N6TrTU1o/yQhfV7KfF4xOR7uIGRaGC lIvaP2GRbKC/zSO+olI2MOe5pK+45SnlXdZUatxg6WtTJ6gIyEQ0gkhKI4jxFg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751882820; a=rsa-sha256; cv=none; b=c16GXV0xVIQxu6pZFhZtU6lVjQ4yxqa55GxzmO5ZYcooMTYvyjS8VKIUOcvupTiEVjG8nO ynLEv0p7ZmGPaiTK7aNT+Yzy+fLMy75cSHtz9N7wg5gmVMF3afwOFf2SGIsTw0b907rGTI EYCdIIP/qGGBhJSG/qv7hxML6gntGBKTaqrK+EDSwjiWUw9VyKI7j0WSppSaTOzFuvuzYU uMKouW+JQGPsSieqrkJtAQJwoojnb/1Ks6ejP2CRXvR6qaKR8lVatawSTkBiNMS+57m203 xVlM2eRT0eQdl9NiVVUUMqMHhCdfbo1s+O9omkD3UHolxL+OgB7jt96HcV3dbA== 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 4bbKfD3820zmWY; Mon, 07 Jul 2025 10:07:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567A70mS053496; Mon, 7 Jul 2025 10:07:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567A708e053493; Mon, 7 Jul 2025 10:07:00 GMT (envelope-from git) Date: Mon, 7 Jul 2025 10:07:00 GMT Message-Id: <202507071007.567A708e053493@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 082a6da890f3 - stable/14 - pfsync: Remove a redundant assignment of if_type 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 082a6da890f3487f1465c0757784798ebe38ef84 Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=082a6da890f3487f1465c0757784798ebe38ef84 commit 082a6da890f3487f1465c0757784798ebe38ef84 Author: Zhenlei Huang AuthorDate: 2025-06-16 14:12:03 +0000 Commit: Zhenlei Huang CommitDate: 2025-07-07 10:05:10 +0000 pfsync: Remove a redundant assignment of if_type On initializing the interface, if_alloc(IFT_PFSYNC) has set if_type already. No functional change intended. MFC after: 1 week (cherry picked from commit 48af70e7c82150942fd095a38131e454e47ad162) --- sys/netpfil/pf/if_pfsync.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/netpfil/pf/if_pfsync.c b/sys/netpfil/pf/if_pfsync.c index 503bdab0c6ac..5db72edc2dab 100644 --- a/sys/netpfil/pf/if_pfsync.c +++ b/sys/netpfil/pf/if_pfsync.c @@ -401,7 +401,6 @@ pfsync_clone_create(struct if_clone *ifc, int unit, caddr_t param) ifp->if_softc = sc; ifp->if_ioctl = pfsyncioctl; ifp->if_output = pfsyncoutput; - ifp->if_type = IFT_PFSYNC; ifp->if_hdrlen = sizeof(struct pfsync_header); ifp->if_mtu = ETHERMTU; mtx_init(&sc->sc_mtx, pfsyncname, NULL, MTX_DEF); From nobody Mon Jul 7 10:07:03 2025 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 4bbKfJ0cmcz61JhB; Mon, 07 Jul 2025 10:07:04 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbKfH605Gz3dvj; Mon, 07 Jul 2025 10:07:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751882823; 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=Pr3Q9wd7BuNUQYHIWfXEQIZad5E2tuCKR7Gz9qmUXbM=; b=SyeK42PXVVCLK+jmn/GIPGu8P1plLSg2bel219peklN3xzzedLbXuI+uFSnSipykguWSle XQIgWL79JnSb80/oJ0rwqpy5apS95VqNFBfNys8L5RDCGq7b7U6jJJ7hjgNMW/TW1Fpb0K NMv2HQHulP0BeVlhxhtkOu0reOF8dPD8pEEMOKfMFmUmbGUQmloq67cZYz60iLbUBsX0l5 VDG9whqpROG5lW8NQo0t3dFv/J+Z8t7/FvNyr75xmMgeBlIPadMoA7Rhd2y/Xqj6tmxopn IqOLv7tIMjogWBtgHJCOJFfgzcarxWsOx3cfbdL6G/rFArtfkVwn1h+otrcnrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751882823; 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=Pr3Q9wd7BuNUQYHIWfXEQIZad5E2tuCKR7Gz9qmUXbM=; b=f9VNdrdKf9ItsY+Kg88VUVlhJwX94W9INcXOLr/4XytZKaw/45KCUnMlx7lQLVschZf2L0 CooelV7Sh0Nf3iMT9mbQGheULcbe3wUtBCiEJWiVgxaI2t4+BvmLnXEg6FY6o0V2xUYEKY RbDUtmc15Jbq1hvg0GzYN705m2/8KpPx2erkh1GJrsf6wgVUQmJTT7C9aM7nzrPChIJXHt ECGHvM/sy5HyfrSYeDNSH0Ma111yVLZrtAt632HzHLCN3zSvICkuPb6pKYbw2o2gNoMlfN Dpz15YyWfzmcYjTTu/r9gAks2bAiQq56tE/NhnqVWdGAyzVij0ik0wPsmLjPxA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751882823; a=rsa-sha256; cv=none; b=YNemwG+WJhfbMXMnLpt1xMKSEgabONOKtNH5b238eK6C1xZ7Ovpazf5v/7G1yFndo8TilS PStpBanld8oWSIvk75x+xH62ZzDXrWPdgXHepsuCh6iS05A1/voStV++wsuZPO35+/Awa1 tsJCMu0QrLKfCfbfNJKBjZ7Pnnu28RR6aI7lmvTGnJhVct+I8w6UkRKkx6Zvoe+d/cIGe/ LaWlII1KYPc7l4MmjhI4VEiimJ5uSe6uKEaNGFr4UM038p6as72Q3K9QEqr1X4xAm8KExT cyCwYO1mc6Gy8E/oDXmambxt1Z+Dh6EuqNkVaeEUjSHEHtDaGXU4KRdRTY0eiQ== 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 4bbKfH5Vw7zmsH; Mon, 07 Jul 2025 10:07:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567A73fa053598; Mon, 7 Jul 2025 10:07:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567A738e053595; Mon, 7 Jul 2025 10:07:03 GMT (envelope-from git) Date: Mon, 7 Jul 2025 10:07:03 GMT Message-Id: <202507071007.567A738e053595@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 99d4e2870c03 - stable/14 - ifnet: Eliminate unnecessary synchronization of the interface index in the link layer address 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 99d4e2870c03ce86855fa2edab2fe9af0d3ff410 Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=99d4e2870c03ce86855fa2edab2fe9af0d3ff410 commit 99d4e2870c03ce86855fa2edab2fe9af0d3ff410 Author: Zhenlei Huang AuthorDate: 2025-06-24 10:01:18 +0000 Commit: Zhenlei Huang CommitDate: 2025-07-07 10:05:10 +0000 ifnet: Eliminate unnecessary synchronization of the interface index in the link layer address Change 80e60e236d85 made the if_index global, and for the whole lifecycle of an interface its index never changes, then there is no need to synchronize the interface index in the link layer address when moving interfaces from one vnet to another. No functional change intended. Reviewed by: glebius Fixes: 80e60e236d85 ifnet: make if_index global MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D50975 (cherry picked from commit 0b4c4833ee3eab0ce46b3bdbf054bca4b6bb7429) --- sys/net/if.c | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/sys/net/if.c b/sys/net/if.c index a0570aed32e9..39854489f5f7 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -932,21 +932,6 @@ if_attach_internal(struct ifnet *ifp, bool vmove) } #endif } -#ifdef VIMAGE - else { - /* - * Update the interface index in the link layer address - * of the interface. - */ - for (ifa = ifp->if_addr; ifa != NULL; - ifa = CK_STAILQ_NEXT(ifa, ifa_link)) { - if (ifa->ifa_addr->sa_family == AF_LINK) { - sdl = (struct sockaddr_dl *)ifa->ifa_addr; - sdl->sdl_index = ifp->if_index; - } - } - } -#endif if (domain_init_status >= 2) if_attachdomain1(ifp); From nobody Mon Jul 7 10:07:04 2025 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 4bbKfK1ntjz61Jjl; Mon, 07 Jul 2025 10:07:05 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbKfJ6wL2z3dy5; Mon, 07 Jul 2025 10:07:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751882825; 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=IWjVC8uUPZHqg0dUYB1zXwncw4DXM9vvtVVTX38SO7U=; b=wUJAzXXdX7opqHJbyGlgPL5BFSRCEOoFPDjCQaHlYKTrZJ9K0jEm39e105ph6hZ36b4S33 3bSdXY5yLarRsiwNbkpZHfR54n0Wz5xZbtS+0h72S6pcySPk8kJexaZGPxj0hJXqC20JLp Rzb2doC7X+BjcoCzpG8FVpSG/7pHOl9svtLEAkUWVOiHYT2j4JuRcdsbUVQyp4twP42OzV d+7z6kS0LTZ6sK6nyeLkJIlW+t1GV9Q8I/anVDSfUq1MkxsTHTDt1HgofcLLq+JRVYu2uy RINYKeVWoZhM+rL4RiSdysP6B9SwxaEy4nNYyn5NvgwsJXQVtSVveAErBLHS5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751882825; 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=IWjVC8uUPZHqg0dUYB1zXwncw4DXM9vvtVVTX38SO7U=; b=NI7ByPpg8TFz4yOFf5N+Z0KlVQsIGyWC5/rmf6mrhIDGbXA/rocJ8mm14obpzrP8xhg+5W vpXX7zy2VCjPbk5qfAuWACtqbK/nGKjUWch77WBgzzmIZ98De5w/DB2/XovyMt/5Ibp3Iq cffD+qybTXCr5Aw7LqW8g7WeCqG9/yPQCB4kunghvRN+4Fm7y3b1aMBgzI3K1RMVpZE3M2 BKNty6v+g8JBDhUq4Ln7oLMg7YVtkCXtKykDvjoKRgl9ar8l8yZqgkl0tmfNVdJLSbXm1S 28DGbLtoRVD9+qfrME6DdUBY8oZSfRe23Ehy8nsmrwWhPnv1k1MUo8fgw9Z6JQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751882825; a=rsa-sha256; cv=none; b=ihVLgiBZlFI5dVgpsXwBsmjKI27/yhv/WEANRPASNYtzN+S/MB69DEd8Ff472wrD1wO2Jw Qf+tKyfqTBDzoBrtnMsNaI3Y14mspTOoZbOSxJKTPnxqmnYyel5mKrfYY9rcxa7cMxbyHO JE1/S6id2wOQmYRwFKM+EfESWHe53nlRoqj9Gl95lbNe8EIH/bngtfRqSpRJHIqghtUNky /u6EM3DvS7HSJWG7/oRyA25ePDDCSJyw7yF/Rh7YD71mLhSZsifWpFSECNWVX2l6fAm5gm D0ogbgFIDPudr5CWUvJqp3IBhoFKaa+5YjJ1708sKDwd305VLaw7VOiXeJcjzQ== 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 4bbKfJ6XDyzmvD; Mon, 07 Jul 2025 10:07:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567A745j053633; Mon, 7 Jul 2025 10:07:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567A74Sg053630; Mon, 7 Jul 2025 10:07:04 GMT (envelope-from git) Date: Mon, 7 Jul 2025 10:07:04 GMT Message-Id: <202507071007.567A74Sg053630@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: ff54b680383b - stable/14 - if_vlan: Fix up if_type before attaching the interface 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ff54b680383bb0f212e813b74e7a3f76423d2238 Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=ff54b680383bb0f212e813b74e7a3f76423d2238 commit ff54b680383bb0f212e813b74e7a3f76423d2238 Author: Zhenlei Huang AuthorDate: 2025-06-26 16:37:13 +0000 Commit: Zhenlei Huang CommitDate: 2025-07-07 10:05:10 +0000 if_vlan: Fix up if_type before attaching the interface ether_ifattach() does not touch if_type, so it is not mandatory to fix the if_type after ether_ifattach(). Without this change, the event listeners, e.g. netlink, will see wrong interface type IFT_ETHER rather than the correct one IFT_L2VLAN. There is also a potential race that other threads see inconsistent interface type, i.e. initially IFT_ETHER and eventually IFT_L2VLAN. As a nice effect, this change eliminates the memory allocation for if_hw_addr, as vlan(4) interfaces do not support setting or retrieving the hardware MAC address yet [1]. [1] ddae57504b79 Persistently store NIC's hardware MAC address, and add a way to retrive it MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D50914 (cherry picked from commit a19b353d354d4ef808965c53253103cb6e7e6708) --- sys/net/if_vlan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c index dce1cff5bc69..6a0d9331324e 100644 --- a/sys/net/if_vlan.c +++ b/sys/net/if_vlan.c @@ -1185,10 +1185,10 @@ vlan_clone_create(struct if_clone *ifc, char *name, size_t len, ifp->if_ratelimit_query = vlan_ratelimit_query; #endif ifp->if_flags = VLAN_IFFLAGS; + ifp->if_type = IFT_L2VLAN; ether_ifattach(ifp, eaddr); /* Now undo some of the damage... */ ifp->if_baudrate = 0; - ifp->if_type = IFT_L2VLAN; ifp->if_hdrlen = ETHER_VLAN_ENCAP_LEN; ifa = ifp->if_addr; sdl = (struct sockaddr_dl *)ifa->ifa_addr; From nobody Mon Jul 7 10:07:02 2025 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 4bbKfH0RtXz61JSJ; Mon, 07 Jul 2025 10:07:03 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbKfG5SrCz3fF3; Mon, 07 Jul 2025 10:07:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751882822; 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=CSA5tbSFeAE1vUtDo+fYejpKnM5UHweaz94am3+GTG8=; b=KEttb2AA75aXJwI5V/10PHSNz44THgXQwuWXoXQX/WXmHvWZ93/iZmuYHDVdWTcCDXimy0 XW0F4lky8kcUMiK1Y2wJkxuu0VkxYu3GmNu5aF04c47qUOJxqqicjLfurXw14OXTCcBoMH 41vj5HKXbjNNSY/3GlKylYJrORxSMNnSmcQYr6P7Stwx/923i5oO/zasWrW362B/2gLYyU rF++sBGbwU10wv/HG5JqDAQBfCdjSVgCiTHrZli6Xzr1u4YqtynUfvGMI1inFoRRlmRgrm 8pD64Xef4uQVXzDZ/XcIUS3wq/EIFsK28fHVS7uhWfFHn/fwHWwHbG1QrOu7gQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751882822; 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=CSA5tbSFeAE1vUtDo+fYejpKnM5UHweaz94am3+GTG8=; b=onkedMdsnVDHMLr7oVtM6g72ZmXZfwyJxCGA5N7eTCe2ZKXnwBZ6u752gV1ypKtTnIsm5x qunKHxEUr1NppA09kBwtGYcqc/sn6R2axVmcEDoIzO99pWicEQLJHbUETcDbUI5s+6pO9C fbMzUMckO/GvltaIV3ATtHvPdLPSJMpvEi9e3FsZ1uPGJ0u/XGNlVI4AutXEuYKJNuQdB8 B9RoX8SOZMjawyBw82COWkouifcbPyMx5P0Uk+REf0M6NqUDSaO1Yx4ovr9+gvbMC6Ld7S iyKhPV4IFNWaAEHSVUXBTDD4uZQVL3xo+QcGjRgwSCXjAFBniPZnevFxPJqdRg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751882822; a=rsa-sha256; cv=none; b=rVQfzyRIpW5ZNASJcMDpLEda5TfYUBlJfIeSwqO5O0YTO4iinlLJXZtCWUVBg/HHUmSVy8 l/AdAGByfXGXl2eGn2AXnuYQYYjvz759KKonvmjiTHHaPv/FwV2+YeIAcvjcTOz1KVK1FR 4/vVRwUj7jZrJwsCYjrSytAWJVux54XKe0xEdRf2pBR3O/fF8ud4iBofVeNTxnvMn2TLPt CZjeMyUYDfQ0NT3LHd6ZojJ5XtkNcjjZeZO8Bj76DvA1nrQCjdLU6RoD8MoTqIgae9oXOk DqIL1uzo9gGqDe6TZw5O4DzP1LCKuQ3Nu42dD3M6GZao3C9Zwu+F91Q8U5o8WA== 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 4bbKfG4zqJzmvC; Mon, 07 Jul 2025 10:07:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567A72rk053564; Mon, 7 Jul 2025 10:07:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567A72Hn053561; Mon, 7 Jul 2025 10:07:02 GMT (envelope-from git) Date: Mon, 7 Jul 2025 10:07:02 GMT Message-Id: <202507071007.567A72Hn053561@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 3bb09e6b1930 - stable/14 - ethernet: Set maximum Ethernet header length based on the capability IFCAP_VLAN_MTU 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 3bb09e6b1930b58d9d92aa3f28515114631a1d6b Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=3bb09e6b1930b58d9d92aa3f28515114631a1d6b commit 3bb09e6b1930b58d9d92aa3f28515114631a1d6b Author: Zhenlei Huang AuthorDate: 2025-06-21 15:12:29 +0000 Commit: Zhenlei Huang CommitDate: 2025-07-07 10:05:10 +0000 ethernet: Set maximum Ethernet header length based on the capability IFCAP_VLAN_MTU Lots of Ethernet drivers fix the header length after ether_ifattach(). Well since the net stack can conclude it based on the capability IFCAP_VLAN_MTU, let the net stack do it rather than individual drivers. Reviewed by: markj, glebius MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D50846 (cherry picked from commit 6ce8fd1978a9526ff0dc02ed98ef797f9154ec1f) --- sys/net/if_ethersubr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c index 9210f1378666..baf3a27c2e7e 100644 --- a/sys/net/if_ethersubr.c +++ b/sys/net/if_ethersubr.c @@ -997,7 +997,8 @@ ether_ifattach(struct ifnet *ifp, const u_int8_t *lla) struct sockaddr_dl *sdl; ifp->if_addrlen = ETHER_ADDR_LEN; - ifp->if_hdrlen = ETHER_HDR_LEN; + ifp->if_hdrlen = (ifp->if_capabilities & IFCAP_VLAN_MTU) != 0 ? + ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN : ETHER_HDR_LEN; ifp->if_mtu = ETHERMTU; if_attach(ifp); ifp->if_output = ether_output; From nobody Mon Jul 7 10:07:05 2025 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 4bbKfL42Wxz61Jrr; Mon, 07 Jul 2025 10:07:06 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbKfL0SYYz3f1x; Mon, 07 Jul 2025 10:07:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751882826; 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=vcRmqS6jAgnWwBCczFn3fIigvxm8fIJXO0VOtAngi6c=; b=ksyvS2OkiDHrr0z1aRcEjt45I1yYnXLLmNfowEbxJQ5GH14mqwyhjaE6hZdMV5Amr894xA DiGX0MBoq4YCNuo4a5F6t63NVCZy5mPm4nidmWomw1IchTzVnK48e+KwBUsPWJ/II7UxXx f3ZYZPz8O5/eKXB8Glqy9D3D1QXgJuMT+5Kc5reACA7s5d9/a1UwtRnz63nfQbS53JjFM2 1Z2F9xzB9Brxs/ZJfTgNdJOhn1uOtc5t+mR0aApYvWY0OwvzKQ1WalTYKYOIc8/YBTkOcH aHu5qHwvev3ddSnXVWqqMMHSIUYH/3M0BYVWkTrkZYyVnWcIcvG7w+Zm7YwuVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751882826; 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=vcRmqS6jAgnWwBCczFn3fIigvxm8fIJXO0VOtAngi6c=; b=JjEXcNccmDnYhxgdddrqZRCavO0ofdXoGpFh1SJkKPKchxSaRmn634l8Cq8cA/rVuw8aBN vl4mATcA6XeFU7eMg68b7qgwnvQXFOb+wTAwdePYklKpf6xCAzp/d238Bfumt4Mbj02EqM DH0hGRqcoWyk634hGCANgwy6W0jOz14TyAqqr5dbsyeH1K2LEF+ciSpGGmKtFM8psqkE/c YAuRlzxX366x6TsMeIZOUIEylIm7UO5V+H2gFiCxZz237VlmdaFwAykAfEnKQXZmikXkQS 4KWUhV5EGVgu1zoCqqQ0qAasCGLLd/4pv5Aouwv6LEgiEkam7cKmfVDBMKl4CQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751882826; a=rsa-sha256; cv=none; b=VjC8UMVaBgWl2w4jvZwOKdnCo+lGf04dmuUJJF2QFDNS7ljEQbY61B/T4rP4BJyPw6PSkH JI0s1wvwwdcuEW7N9a8Ch932QmI5mX3qPzZTm0PSra6d7f19xPJzfvkXyPDd3gpp+VOvGc DLLMqmkxuE1rYSSMSiXOYdWA9BP28l35x8SYWFXTtnp/IDmH6IJtDiuHfK8m1jHyVg5dxS hSi0sHsKJIELi/v6xUxmoSq0LwTFghqaLWuqm5jQ3+t8zjLf5RtgyWuNCZi7PcprultleL d6xJW7gjcmAeiNxGR7pUccUlyX2mNwadsoLtI5gboVVUxUlxuF1v1euifb/S+g== 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 4bbKfL04Y2zmvF; Mon, 07 Jul 2025 10:07:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567A75ub053675; Mon, 7 Jul 2025 10:07:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567A75TX053672; Mon, 7 Jul 2025 10:07:05 GMT (envelope-from git) Date: Mon, 7 Jul 2025 10:07:05 GMT Message-Id: <202507071007.567A75TX053672@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: efbaf14c5b68 - stable/14 - pfsync: Destroy buckets mutexes on clone destroying interface 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: efbaf14c5b681c8f1a04a47c7bf8740134fff098 Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=efbaf14c5b681c8f1a04a47c7bf8740134fff098 commit efbaf14c5b681c8f1a04a47c7bf8740134fff098 Author: Zhenlei Huang AuthorDate: 2025-06-28 15:46:51 +0000 Commit: Zhenlei Huang CommitDate: 2025-07-07 10:05:10 +0000 pfsync: Destroy buckets mutexes on clone destroying interface So that the associated data with them will be freed. Reviewed by: kp Fixes: 4fc65bcbe3fb pfsync: Performance improvement MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D51063 (cherry picked from commit 8213c07c20586a67bc7f7152bd7ff76c02cbc007) --- sys/netpfil/pf/if_pfsync.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/netpfil/pf/if_pfsync.c b/sys/netpfil/pf/if_pfsync.c index 5db72edc2dab..b75cc4e08029 100644 --- a/sys/netpfil/pf/if_pfsync.c +++ b/sys/netpfil/pf/if_pfsync.c @@ -492,6 +492,10 @@ pfsync_clone_destroy(struct ifnet *ifp) mtx_destroy(&sc->sc_mtx); mtx_destroy(&sc->sc_bulk_mtx); + for (c = 0; c < pfsync_buckets; c++) { + b = &sc->sc_buckets[c]; + mtx_destroy(&b->b_mtx); + } free(sc->sc_buckets, M_PFSYNC); free(sc, M_PFSYNC); From nobody Mon Jul 7 10:07:07 2025 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 4bbKfM6dDGz61Jbt; Mon, 07 Jul 2025 10:07:07 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbKfM1Zkdz3dyW; Mon, 07 Jul 2025 10:07:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751882827; 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=ABLqcM3FxkvnXyKFtfa6vDndtp19Lj9eEH9+T3mjWig=; b=p45zFVoUgSMdcdziEQPysDR7BCV+GzXiBumCoNT7Z4li8SKvsMo3wqSUJzCGWGtRYuSAie 2gYgX3uroiWIKL6kC+aNa0Wp0Q8DwzwRVIKlalIw9/4UM+nwOey69sf8gQyPMjFwdsz93f e8iU1H7fKKXZMtEj3R6+84kkqi5C8OStrWP/2BRbsh21SRMrA8avFb7JxFZc6SI1V0Z8TN ZXFeAeMJrH366Ta87H3/ZSjDIMQ9yPQjVT9u4QMxQSYK3y2U192Bq3FzrNdd3a5CUaYTZx HIs1BxPwb+ykloQvNzn2xwA5D+pAY2pXKawIuQv1DMzCPVsJ2idqhDrLVFCPeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751882827; 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=ABLqcM3FxkvnXyKFtfa6vDndtp19Lj9eEH9+T3mjWig=; b=jmi3ro9mWdRpmwWEsLzNY3nmH4FHHoAIMDN3sX4KoyOQe5F52YIwU6DB5uhr32M25iqTWs WdsQjDDRQQDegKS2Eblqm3rvLbLD3K2v25QCwnAnl2/6MF+yA9++lMzjM8v77JUIyF2wGH J+zwjRUUDRGoylCTwhqPP4RfHr8HhGFUbKFP/a5UmIYDP73YNXk4iALgF7aJkPaLzAF+5X GvMKJB4RoG80ZpeVVXAEkD2ARdqKdm2WWrCgnSqXSpL+TatDcFsJoc5pjGg7qyFxwdFmla soQ1dbdgRQ30QO0As8jGPKH0XZmzwlODzke0wa9aRYTaeKJjDzwVh1gt5E14OA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751882827; a=rsa-sha256; cv=none; b=Mb4Q6JONWTAyEwGB2g2YLQJytAwjUQVbJONHyslRnx8ydZ4d/I3czpbQr6oDThoJIW8pG8 LtpqqFcNWfRAE01dtbuVkyoDDj/3WsSCnwgYrAhQTkuqgtcujZTAjGTBP1i6llTgtSmuTC p8PjrcsarDV9r2cePvObTJG149zJ830XJXIiMD06pRxh+ZPRtGOYopWJ71Tp71VrmxcyoD X/iH/5GRTOtlZGCM0m5n1/QnYoh8sTZZ428KeFmhai8knDRtVei/rm7hOroGpTUGw61U20 FIeA8tqC1bxSmM+nNq2mtyEmrjPgrlo8uPn4EKkqWuktR8qJWyRnmRoq/87VCA== 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 4bbKfM0yTbzmcx; Mon, 07 Jul 2025 10:07:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567A7776053711; Mon, 7 Jul 2025 10:07:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567A77fW053706; Mon, 7 Jul 2025 10:07:07 GMT (envelope-from git) Date: Mon, 7 Jul 2025 10:07:07 GMT Message-Id: <202507071007.567A77fW053706@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 8cc376735c65 - stable/14 - pfsync: Allocate and initialize buckets before attaching the interface 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8cc376735c65a18c53a70c30957a5f56dd066b79 Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=8cc376735c65a18c53a70c30957a5f56dd066b79 commit 8cc376735c65a18c53a70c30957a5f56dd066b79 Author: Zhenlei Huang AuthorDate: 2025-06-28 15:46:51 +0000 Commit: Zhenlei Huang CommitDate: 2025-07-07 10:05:10 +0000 pfsync: Allocate and initialize buckets before attaching the interface This prevents a potential race that the ioctl threads see NULL or uninitialized buckets. Reviewed by: kp Fixes: 4fc65bcbe3fb pfsync: Performance improvement MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D51064 (cherry picked from commit edc307eca9a9a9b0ce7445cff513b48f6489e5c6) --- sys/netpfil/pf/if_pfsync.c | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/sys/netpfil/pf/if_pfsync.c b/sys/netpfil/pf/if_pfsync.c index b75cc4e08029..64c938ee52ee 100644 --- a/sys/netpfil/pf/if_pfsync.c +++ b/sys/netpfil/pf/if_pfsync.c @@ -395,23 +395,6 @@ pfsync_clone_create(struct if_clone *ifc, int unit, caddr_t param) sc->sc_flags |= PFSYNCF_OK; sc->sc_maxupdates = 128; sc->sc_version = PFSYNC_MSG_VERSION_DEFAULT; - - ifp = sc->sc_ifp = if_alloc(IFT_PFSYNC); - if_initname(ifp, pfsyncname, unit); - ifp->if_softc = sc; - ifp->if_ioctl = pfsyncioctl; - ifp->if_output = pfsyncoutput; - ifp->if_hdrlen = sizeof(struct pfsync_header); - ifp->if_mtu = ETHERMTU; - mtx_init(&sc->sc_mtx, pfsyncname, NULL, MTX_DEF); - mtx_init(&sc->sc_bulk_mtx, "pfsync bulk", NULL, MTX_DEF); - callout_init_mtx(&sc->sc_bulk_tmo, &sc->sc_bulk_mtx, 0); - callout_init_mtx(&sc->sc_bulkfail_tmo, &sc->sc_bulk_mtx, 0); - - if_attach(ifp); - - bpfattach(ifp, DLT_PFSYNC, PFSYNC_HDRLEN); - sc->sc_buckets = mallocarray(pfsync_buckets, sizeof(*sc->sc_buckets), M_PFSYNC, M_ZERO | M_WAITOK); for (c = 0; c < pfsync_buckets; c++) { @@ -433,6 +416,22 @@ pfsync_clone_create(struct if_clone *ifc, int unit, caddr_t param) b->b_snd.ifq_maxlen = ifqmaxlen; } + ifp = sc->sc_ifp = if_alloc(IFT_PFSYNC); + if_initname(ifp, pfsyncname, unit); + ifp->if_softc = sc; + ifp->if_ioctl = pfsyncioctl; + ifp->if_output = pfsyncoutput; + ifp->if_hdrlen = sizeof(struct pfsync_header); + ifp->if_mtu = ETHERMTU; + mtx_init(&sc->sc_mtx, pfsyncname, NULL, MTX_DEF); + mtx_init(&sc->sc_bulk_mtx, "pfsync bulk", NULL, MTX_DEF); + callout_init_mtx(&sc->sc_bulk_tmo, &sc->sc_bulk_mtx, 0); + callout_init_mtx(&sc->sc_bulkfail_tmo, &sc->sc_bulk_mtx, 0); + + if_attach(ifp); + + bpfattach(ifp, DLT_PFSYNC, PFSYNC_HDRLEN); + V_pfsyncif = sc; return (0); From nobody Mon Jul 7 13:45:12 2025 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 4bbQV04vfcz61mNJ; Mon, 07 Jul 2025 13:45:12 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbQV02xt4z3KFS; Mon, 07 Jul 2025 13:45:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751895912; 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=HfaMnr/jCFriFMHsjKoz/vjj0169SPa3Wqlk3+/rSRY=; b=atu9pD46U/vjV4rjFzSC3Dqq4G853b6DMOB0ZkHaqRm2OX2opBi6wzNR+S49xzlcelUlHQ IUi3zCYyoUGfaptgWWmROU/GZuMXjvtB6UnSv8KjjPVdlbcU9l8sXTT0ZcwyOg1oGKprhp jafGn8MaosMvjHUeLxVmKuFZ3ts77eoooIC7cWKSNam1JZ/hc12u6QN0glj2i74E6B7G4F pSXZCI9wAzq00uk0gvxyT3C64bEQJdYKyAFXOIIIdmv74Cjaao7V+gwVg06V3CByDU+3vj PnIpRpn1dvfOw/eXLGtHZK4L5rUKb4YyYkXKX41zvqve79Yr/ZI2vX9qWCEriQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751895912; 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=HfaMnr/jCFriFMHsjKoz/vjj0169SPa3Wqlk3+/rSRY=; b=eouE2Ukjo2rmrl/a6Qeojdy6FuVX96Yz8XOWBuCBqucUKvOl8pFaSF0dX48td0p4L+/FRN i33yVu06TBOD6HYH3hSOVXz2086xEwJNGfPu8BGPEVfAI+ahmYygYP4WuiGIhRPPN/EMQl IS7Ogv7SZbl9TuMG9fnKXQQFBUxXF5I44iThQ0P/DdeoBQ2wXYTofEiKWAB8/GB4jEEQBO b5xv8dAmeGOgnEenbmdg565qHbsd1yTMluI2CDNVcPgjmxMrmcFW47Pe52VNXZvmbKhEtq minBCN64ZaoAB9Fbsv9WBkTs/CjSkyJWaSp71nYagOuXgZG1Uu75imJRKgU54A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751895912; a=rsa-sha256; cv=none; b=KQ+C/hjl0LYKsoDaYaaFZfqjHZaTk3tpQmeWQwYWHSF9ly9Sti23XyP5C+25BlQY5k1jZG FdD2pQCFGi8z3xfBluTCyTSL9xi4N1WxjBV+KJ+l+w/KdvoULbbReAYc4ufXhTD5igZrZ+ vRYUtYJkWBCzML7jf4+WLe86u7tGLjzRQr+gAD7MBfNRGGUBCUmdmxBXFV7/oD9MvIW6IY hOv1c6EpugfoWPdUpcCJ03YNiESqvfg1KXPFWb8kjQhIJ2km3XlPYqXb+g/ewsiUybO8gY 2UdVcPSiOT0vB59+vNzw0BRBz5Bn1eEMmezib0v9kO7JHsxw/nPFfBnQZHfgEg== 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 4bbQV02Ff1zt4J; Mon, 07 Jul 2025 13:45:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567DjClj064716; Mon, 7 Jul 2025 13:45:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567DjCWl064713; Mon, 7 Jul 2025 13:45:12 GMT (envelope-from git) Date: Mon, 7 Jul 2025 13:45:12 GMT Message-Id: <202507071345.567DjCWl064713@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 13a21c0c0e3d - main - VOP_WRITE_POST(): correct condition for knote activation 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 13a21c0c0e3db6e2c1a317031c7d1bf4651bec3d Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=13a21c0c0e3db6e2c1a317031c7d1bf4651bec3d commit 13a21c0c0e3db6e2c1a317031c7d1bf4651bec3d Author: Konstantin Belousov AuthorDate: 2025-07-07 12:51:24 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-07 13:44:21 +0000 VOP_WRITE_POST(): correct condition for knote activation Fixes: bc4430dc203ed7b6765fb5df041bf545c50f859b Reported by: dhw, Oleg Nauman Sponsored by: The FreeBSD Foundation --- sys/sys/vnode.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h index 3ed469bdce6d..2c6947103c94 100644 --- a/sys/sys/vnode.h +++ b/sys/sys/vnode.h @@ -1032,7 +1032,7 @@ void vop_rename_fail(struct vop_rename_args *ap); #define VOP_WRITE_POST(ap, ret) \ noffset = (ap)->a_uio->uio_offset; \ if (noffset > ooffset) { \ - if (VN_KNLIST_EMPTY((ap)->a_vp)) { \ + if (!VN_KNLIST_EMPTY((ap)->a_vp)) { \ VFS_KNOTE_LOCKED((ap)->a_vp, NOTE_WRITE | \ (noffset > osize ? NOTE_EXTEND : 0)); \ } \ From nobody Mon Jul 7 13:58:07 2025 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 4bbQmw0Nclz61n1g; Mon, 07 Jul 2025 13:58:08 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbQmv6Z0xz3Pj8; Mon, 07 Jul 2025 13:58:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751896688; 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=D5W94nbG9yOka+sbAuk93aaLOz0DxYq+3ysjnRzcp8o=; b=unxdhkICYa51Iw30TDdPZowAoNto9qHbLCqjJOSg06wYFWqanUvvHg7sKSziTjZa8gp5vo Zx9fNK+Q31V1LYRAhyLFA+n6CmDdXaXRJkbLI2Jk6IWmqb/BnvnmPFnnmq2AohwJIGHDZj hra9vKC9T333gMHeYPiD7EKQxc2c3S3GhLDdBQyJKwSvmMUoKmZNj6STj+o+vuAFTkapqC jXmT1xIAyvkQ+CVndVjpLTTX1haFniq8SLlpZnz9bf1YgvdIWjo+MPeVj4uJahDBggWFXy w9wRO9XGZcuJozGa8AN4UU7GCDtbEfuE2Xtj74AH2hqE4ye+8Uq8fKLu8z98aA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751896688; 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=D5W94nbG9yOka+sbAuk93aaLOz0DxYq+3ysjnRzcp8o=; b=xRKhDMnMxzceZAnYD9+BuFrtCd9Oit97xp7nYC+qezwawCp1YSz7cJ5vt+CJvTgKO0r/an hMX5V/hWGAMHz0ZExwCxR5E9bbMt8nn3LP58YHoS41ta4Gy5zGKRRZDizY506GlNqvpuOx F5BK3I9+gTgIdAiSZUMVDx9u9zRCYoErh4h5DwTK/NSV2s+xWmx0K1Zxk3KbRz3ue4nteL NFqKqjh1XBdOngHDNJDvLEAcPzizsQ9b0LhQ7+LqPecJXcU0VH6paMCriaPwIpO4kZSRAd IptKGEV48Y5qpqywFjq7JHJeirjdKqRZGPw9LGwRprGmpllQCBSSSeldpYCiSg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751896688; a=rsa-sha256; cv=none; b=mvTvsVQPuhkVRn6cujGQQ4QjxW42r9m1KTp4NVGUomCtMeFRjzrZx6cRT71ZBYgB9KGywq CRHa/HqIyvf2vG9ASLaMKJz+ApCzjSlc0qDTa20QPmkvlBlQxm5DYAp0TJRDd66pIsKZIF NUzCOkvEiIddsOFidnVLCtKUMhYt8V3X7MJkEecZRxkG5U5UOz/gAAXr/k3P1C9w1w9qqB ttryvT8Zus5PibIh37EhZ2+wKqCMry8MIYljI/exQxowvo4ITOmj1T50+jFTeZvpMoe69I GgPC4PEY73agpyQJ0u71FVZ1EfRh7lHlLh6MzOwWDugdHdwFKY/Jns4NAMgs7w== 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 4bbQmv5X1LztVc; Mon, 07 Jul 2025 13:58:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567Dw7f4083791; Mon, 7 Jul 2025 13:58:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567Dw7bm083788; Mon, 7 Jul 2025 13:58:07 GMT (envelope-from git) Date: Mon, 7 Jul 2025 13:58:07 GMT Message-Id: <202507071358.567Dw7bm083788@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 1a55bc50656b - stable/14 - acpi_wmi.4: fall cleaning 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1a55bc50656bd46639dd1fbde2cc0ab8a85d1e7c Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=1a55bc50656bd46639dd1fbde2cc0ab8a85d1e7c commit 1a55bc50656bd46639dd1fbde2cc0ab8a85d1e7c Author: Alexander Ziaee AuthorDate: 2024-10-17 05:24:50 +0000 Commit: Warner Losh CommitDate: 2025-07-07 13:57:01 +0000 acpi_wmi.4: fall cleaning + add descriptions to existing examples + github repo url in sysctls => port named in example using it + reword MOF description for consistency with external docs + restore standard link, move to STANDARDS + grammar and markup nits + tag SPDX MFC after: 3 days Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1477 Closes: https://github.com/freebsd/freebsd-src/pull/1477 (cherry picked from commit 954ac4049852cc1cf6d6074d9247b67f02b84b12) --- share/man/man4/acpi_wmi.4 | 61 ++++++++++++++++++++++++++++------------------- 1 file changed, 37 insertions(+), 24 deletions(-) diff --git a/share/man/man4/acpi_wmi.4 b/share/man/man4/acpi_wmi.4 index 9ad14ed7892a..e5c5517ba4ac 100644 --- a/share/man/man4/acpi_wmi.4 +++ b/share/man/man4/acpi_wmi.4 @@ -1,3 +1,6 @@ +.\"- +.\" SPDX-License-Identifier: BSD-2-Clause +.\" .\" Copyright (c) 2009 Michael Gmelin .\" All rights reserved. .\" @@ -22,47 +25,45 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd September 5, 2019 +.Dd June 12, 2025 .Dt ACPI_WMI 4 .Os .Sh NAME .Nm acpi_wmi -.Nd "ACPI to WMI mapping driver" +.Nd ACPI to WMI mapping driver .Sh SYNOPSIS To compile this driver into the kernel, place the following line in your kernel configuration file: -.Bd -ragged -offset indent -.Cd "device acpi_wmi" -.Ed +.Pp +.Dl Cd "device acpi_wmi" .Pp Alternatively, to load the driver as a module at boot time, place the following line in .Xr loader.conf 5 : -.Bd -literal -offset indent -acpi_wmi_load="YES" -.Ed +.Pp +.Dl acpi_wmi_load="YES" .Sh DESCRIPTION The .Nm driver provides an interface for vendor specific WMI implementations -(e.g. HP and Acer laptops). -It creates /dev/wmistat%d, which can be read to get -information about GUIDs found in the system. +.Pq e.g. HP and Acer laptops . +It creates +.Pa /dev/wmistat%d , +which can be read to get information about GUIDs found in the system. .Sh FILES .Bl -tag -width /dev/wmistat%d -compact .It Pa /dev/wmistat%d -WMI status device. +WMI status devices. .El .Sh SYSCTLS The following sysctl node is currently implemented: -.Bl -tag +.Bl -tag -width "dev.acpi_wmi.%d.bmof" .It Va dev.acpi_wmi.%d.bmof -Managed Object Format (MOF) blob. -You can obtain human readable output by bmf2mof in bmfdec tool. -(https://github.com/pali/bmfdec) +binary Managed Object Format (MOF) buffer .El .Sh EXAMPLES +Read GUIDs from the first WMI interface found in the system: .Bd -literal # cat /dev/wmistat0 GUID INST EXPE METH STR EVENT OID @@ -78,7 +79,14 @@ GUID INST EXPE METH STR EVENT OID {8232DE3D-663D-4327-A8F4-E293ADB9BF05} 0 NO NO NO NO BG {8F1F6436-9F42-42C8-BADC-0E9424F20C9A} 0 NO NO NO NO BH {8F1F6435-9F42-42C8-BADC-0E9424F20C9A} 0 NO NO NO NO BI -# sysctl -b dev.acpi_wmi.0.bmof |bmf2mof +.Ed +.Pp +Read first WMI interface description with +.Sy bmf2mof +from +.Pa ports/converters/bmfdec : +.Bd -literal +# sysctl -b dev.acpi_wmi.0.bmof | bmf2mof [abstract] class Lenovo_BIOSElement { }; @@ -91,10 +99,15 @@ class Lenovo_BiosSetting : Lenovo_BiosElement { [WmiDataId(1), Description("BIOS setting")] String CurrentSetting; }; ... - .Ed .Sh SEE ALSO .Xr acpi 4 +.Sh STANDARDS +.Rs +.%T Windows Instrumentation: WMI and ACPI +.%I Microsoft Corporation +.%U https://github.com/microsoft/Windows-driver-samples/tree/main/wmi/wmiacpi +.Re .Sh HISTORY The .Nm @@ -107,13 +120,13 @@ The driver was written by .An Michael Gmelin Aq Mt freebsd@grem.de . .Pp -Work has been inspired by the Linux acpi-wmi driver written by Carlos Corbacho. -.Pp -See http://www.microsoft.com/whdc/system/pnppwr/wmi/wmi-acpi.mspx for -the specification of ACPI-WMI. +Work inspired by the Linux +.Sy acpi-wmi +driver written by Carlos Corbacho. .Pp -MOF part has been inspired by the Linux wmi-bmof driver -written by Andy Lutomirski. +MOF handling inspired by the Linux +.Sy wmi-bmof +driver written by Andy Lutomirski. .Pp This manual page was written by .An Michael Gmelin Aq Mt freebsd@grem.de . From nobody Mon Jul 7 13:58:08 2025 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 4bbQmx042Vz61n1h; Mon, 07 Jul 2025 13:58:09 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbQmw60YSz3PWp; Mon, 07 Jul 2025 13:58:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751896688; 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=IW85R7R4IQ7NLt+jpHQ+W2lAh3beBaczb7U6MAfU1Fw=; b=tbdYy4i/X4SWw3srIvB4scjoQyi/Xjt2vQVjV2AnGMRJrF/t7EKkwhXOAXJg+5NAOkSeDu buvRztjR3sUiULhccG+yHUTd7n6xkA4LSjwpFPa7fpZzpgbcxjARvB4hX3phl8qj7cY4p3 QfuNFDr0Jiamjzjw8PcV9Gu+lyW3be+ZqfqP6H/T/P5UlEWH/vRKeVvL3RHRRRkueFYRqM 9d3JIs5gKfgQ8KkSjXBuFSiOuJxxZTJMeb2d7GaUNCMoHwun2lzDNMCGg14FobC9Tq+oA4 pFrdt6GfB7kt/LUiWkhTeRsPd00iwvUwLdUUB4z+e5ROnwXN63fYTH9Kgv3QTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751896688; 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=IW85R7R4IQ7NLt+jpHQ+W2lAh3beBaczb7U6MAfU1Fw=; b=tkjqislcjVdnADe04dqCgzspa6fhmGjVoX+5KaBl3Ldn/d2euKLRp514tERKgRPbdluNnl dK/9F62s72Lg3CfB2aLj8oqERhdJIuAyyGP/rTipD8xmKxZdfd6D1IjGp9d2T+ngCH5sza 95W9tNGi6KPmQrH/IqFaPVTY1fU+WQHtvfFayK5Ufx7B3ydxFO+oJQ2LXvJePzAjUCmTOE vAymS/AFsSeiTAGz9LoWDJ6TFHS3kRo4+cqQNbhSV3teGMb5VwAZBVnCpb1zx+RpFIvqZo K96Vg4qDFq1fYxcYCcz6jZ51Aa+rYgq9r2HOdflQizfPTVhYTyr4K/C3uD72SA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751896688; a=rsa-sha256; cv=none; b=WlZZSgenZQ301AGdzerFIcy3mjC01Nx4hOv9Eoo/fYts/Z6En+f7aJQmwJu+12v6stBxkS 20qTlVewv54OIGe5ItJoAUo7ACyaLWJnwqtqvTouVlQ7OveyfwXlQD2VZHoFA+vyAZBPh9 jEiYTznf7vIouNbXQShusW84iaY1Dr3DsvDBj2yqSpCmx9WLIK3TJIKEFxMx3RfQmUAHyC hy0BkXvm+FbNMYX19alx+SqKqT/z+8pTgfzJxvIeiwQuZ9Nh1KcK9Vc80vAju/z+Ji+1gy BWVbAms3O0KdRQS84aqS6lwQEoILLGUZVZBFIMPnHpJRXAc2gJ/PJVEqRU5H4Q== 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 4bbQmw5YGGztVd; Mon, 07 Jul 2025 13:58:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567Dw8E3083826; Mon, 7 Jul 2025 13:58:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567Dw8DY083824; Mon, 7 Jul 2025 13:58:08 GMT (envelope-from git) Date: Mon, 7 Jul 2025 13:58:08 GMT Message-Id: <202507071358.567Dw8DY083824@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 0077daf9cdc4 - stable/14 - pf.conf.5: additional quoting for ranges in lists 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0077daf9cdc45cf36e7cc2ca3b65252194221400 Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=0077daf9cdc45cf36e7cc2ca3b65252194221400 commit 0077daf9cdc45cf36e7cc2ca3b65252194221400 Author: Quentin Thébault AuthorDate: 2024-11-07 06:13:05 +0000 Commit: Warner Losh CommitDate: 2025-07-07 13:57:01 +0000 pf.conf.5: additional quoting for ranges in lists When defining network address ranges in macros that will later be used as items in list macro, these ranges must be quoted with additiona simple quotes. For instance, the following does not work and is rejected as a syntax error: usr = "192.168.1.0/24" srv = "192.168.2.10 - 192.168.29" nat_ranges = "{" $usr $srv "}" Defining ranges as the following instead will work: usr = "'192.168.1.0/24'" srv = "'192.168.2.10 - 192.168.29'" MFC after: 3 days Reviewed by: imp, ziaee Pull Request: https://github.com/freebsd/freebsd-src/pull/1516 (cherry picked from commit 54f278caf37f9ab578ee58fc70c7b66446ea7e84) --- share/man/man5/pf.conf.5 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/share/man/man5/pf.conf.5 b/share/man/man5/pf.conf.5 index 0b73ba6b5e02..697711a8306c 100644 --- a/share/man/man5/pf.conf.5 +++ b/share/man/man5/pf.conf.5 @@ -100,6 +100,8 @@ Macro names may not be reserved words (for example .Ar in , .Ar out ) . Macros are not expanded inside quotes. +Ranges of network addresses used in macros that will be expanded in lists +later on must be quoted with additional simple quotes. .Pp For example, .Bd -literal -offset indent @@ -107,6 +109,11 @@ ext_if = \&"kue0\&" all_ifs = \&"{\&" $ext_if lo0 \&"}\&" pass out on $ext_if from any to any pass in on $ext_if proto tcp from any to any port 25 + +usr_lan_range = "'192.0.2.0/24'" +srv_lan_range = "'198.51.100.0 - 198.51.100.255'" +nat_ranges = \&"{\&" $usr_lan_range $srv_lan_range \&"}\&" +nat on $ext_if from $nat_ranges to any -> ($ext_if) .Ed .Sh TABLES Tables are named structures which can hold a collection of addresses and From nobody Mon Jul 7 13:58:09 2025 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 4bbQmy39bBz61n1j; Mon, 07 Jul 2025 13:58:10 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbQmy0vnzz3PjB; Mon, 07 Jul 2025 13:58:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751896690; 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=Sgrk0sQ1ah1lphgTiPsYYpl+6cFL5eD3yNnnCMg3Kb4=; b=kcmFlS/CzYRg2kCIlFoEte2r7vJfaYdYpM3F2gXp+5NYz+hU7WM62yNbE/NCr1NtMHlkIg MNJSi31Fy99SEs6M5RnikZ0+LjZadTUvp0/6fTHfRitRFPh4nl+sWhLovcXjLbdtYfVPWi uoUuhyntChQ5sfaGFMVq4iN2KAjEweDjc5vLDYxSSHj7B8KXx4+jQLqpQzZpl06HCQIGmn a6op3PHzdWcEwi8k6YI4SWmYtctn9p8j2ykOWWIYNRldsbmKvHT4UQI28WtsABhMR3oAv5 k1CE7NCfkWXHiQTkXKpTDHKe/JYKnq/q79qYNf6m2OTkuE9/LJwWJ6yyeZC/CQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751896690; 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=Sgrk0sQ1ah1lphgTiPsYYpl+6cFL5eD3yNnnCMg3Kb4=; b=qigDz2XczODiwrzd5Jao091ludT7Pc44ELiq5k162+6zJ22YpbBt2DXXoZ5y4pSYdrgn6q GDIbPTKZRxdkmrhXVO0nAhTfN27kIdg53u5wTmhcn2c+MJcZ36C22hJGHCLvhk1fBa0oua ja4S0xDZSAkjBF4GSjsFmf/C0Ez7Rkf1iVFrLhj7sonSMi0MZ6Xwkl5c7w2rzb06itW6aG ZvNuRAjO3iOXzZofo1i9Inxnpam0Hi2XfjbLuMIx/pDT5CUwYOSgSAqrkFVgxxdW8+u50Q mO1peiFdGivBEejbPjyCPMxdR08+ypr2R51W1/WlFnW46uZh7LNJQLqM7roqNQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751896690; a=rsa-sha256; cv=none; b=rvuqUHNu2dpSRUF91Xx/5TUC3NhOPXqM7PjpH4KIMDNR+l5o5V9xcyh8CZjbgYVAtxPHz6 p5NsOLp2WYgs8+xAkADbodujQgsj6A6F78Xsp6bliyHrtcGxaamEomzsLUs/dG4e2r0V9u 3lV/9kSnlmdpcuCMgzF9WKcKc7FyAiV0yVWbLtkPdNW6AyKva1msKMD4XnCstXHk9bBgi4 CujvsiTDOvE2WKLgLNTUJSfCUk/UOMH76jWErdr0/PsEwkyfEwRU1NZOzeL7iwQlK6HLUv R7IafQ9Nk5GKLXS7PSAQGnnTfE2zdVawvK4+C5RzM4LdZB+yt6hBAPDL17WuFQ== 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 4bbQmx6b3LztZ3; Mon, 07 Jul 2025 13:58:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567Dw93v083861; Mon, 7 Jul 2025 13:58:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567Dw95v083857; Mon, 7 Jul 2025 13:58:09 GMT (envelope-from git) Date: Mon, 7 Jul 2025 13:58:09 GMT Message-Id: <202507071358.567Dw95v083857@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: f28690ec6a6a - stable/14 - pf.conf.5: use subsections and reword titles 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f28690ec6a6a0e5cc8465c0cfb78c866df3b3272 Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=f28690ec6a6a0e5cc8465c0cfb78c866df3b3272 commit f28690ec6a6a0e5cc8465c0cfb78c866df3b3272 Author: Quentin Thébault AuthorDate: 2024-11-13 06:54:46 +0000 Commit: Warner Losh CommitDate: 2025-07-07 13:57:01 +0000 pf.conf.5: use subsections and reword titles The current manpage has two PARAMETERS top-level sections, which can be confusing when searching or browsing documentation quickly. Since the parameters described in these two sections are actually applicable within the scope of the sections they follow (ETHERNET FILTERING and PACKET FILTERING respectively), I propose we move them to subsections. I also propose we reword the title of one of those subsections to facilitate quick searching or browsing. MFC after: 3 days Reviewed by: imp, ziaee Pull Request: https://github.com/freebsd/freebsd-src/pull/1516 Closes: https://github.com/freebsd/freebsd-src/pull/1516 (cherry picked from commit 12859ee366d084b5506d58b030079f839c4915e3) --- share/man/man5/pf.conf.5 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/share/man/man5/pf.conf.5 b/share/man/man5/pf.conf.5 index 697711a8306c..b43ebac6bd0e 100644 --- a/share/man/man5/pf.conf.5 +++ b/share/man/man5/pf.conf.5 @@ -27,7 +27,7 @@ .\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd January 10, 2025 +.Dd June 12, 2025 .Dt PF.CONF 5 .Os .Sh NAME @@ -727,7 +727,7 @@ Unlike for layer 3 traffic the packet is always silently dropped. The packet is passed; no state is created for layer 2 traffic. .El -.Sh PARAMETERS +.Ss Parameters applicable to layer 2 rules The rule parameters specify the packets to which a rule applies. A packet always comes in on, or goes out through, one interface. Most parameters are optional. @@ -1651,7 +1651,7 @@ handles state tracking. See .Sx STATEFUL TRACKING OPTIONS below for further details. -.Sh PARAMETERS +.Ss Parameters The rule parameters specify the packets to which a rule applies. A packet always comes in on, or goes out through, one interface. Most parameters are optional. From nobody Mon Jul 7 13:58:10 2025 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 4bbQmz6Zx5z61nF8; Mon, 07 Jul 2025 13:58:11 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbQmz0f0jz3PlF; Mon, 07 Jul 2025 13:58:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751896691; 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=IG9ol7zqfpCAYAbXl5VjzyKw4O9k4y7ODlt1FRXfuvM=; b=pq2f41JPMLOXgsdr+V8RY9ySGwL6xtCMOkTmR/cZkmqw4mYz5gXLW3ctLmXFbuegWtZ/KM zUyaf/Ehu1+iMD9zkMCIX2JxlZ6NsH09iBiIGmCzqq4amzb40HNoH6LreLrfqJBEfjVXo5 z80GrRista7Km8T2vuyxv8PQGJ3Ab6GHmmzHbWcnLMSCn5s22IXUQQtR9ZMFjXl1cI0z3D 4Zyr1Misr5PSqZFC2YP5c0+XGmqe+qsUhpupr3TO2OhREIAeGLJ/SfV4Uo+EGt2pY4t2T+ /ihDhS2XOi2S1ZZJbiKpHIl1sbuFqxsFrvUuzehU6obNt0U9e55+ORS0kliE2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751896691; 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=IG9ol7zqfpCAYAbXl5VjzyKw4O9k4y7ODlt1FRXfuvM=; b=k1UZ+0i3QcmBeXS3N99f5zXEuPOVMUgppCJyuQt7Gze5F1+eV2iY+4BenWZ4rI5rYZtE1G D5fCtLRPZ+n0cTl7PI27qBX0wtF5eSYmKi8WlC3VkOEY31+Rsl+obx+Qj+KOG50aB892Dt 2LzZpw2GslW/UN2E3Jp8MvdieLxM1gRgseed1K/ie0lIXcudDJlNwSr2clqKJ2rZIIbO6c RpMcBQkhGfgIQiGWnTdHLzcnwb9vU9Hr+ZjSoIltpzmgy1VY8K6ZOSuDNfJSMgALJEVHyy RgV6SdwRvPtcou79biO4qXh4bjaUjEOiNHxidrcd2T6aG+ajGeY3KWm9r93a4g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751896691; a=rsa-sha256; cv=none; b=LJ9ckjFLmCU6U2c2Gb6mT5JSk3fuCRqYbIeX5cRLQRrd8d3FrHkbmmhpWiLXfxue9ZPDyS SoimAXtZOyQ0kk+2F/icA8631kDZ8GLxxEhDScs++L/ry1gy9YWu2R/0vfd3lQLE9pawcb hEwTeA/ENlV4iGGBGz63UkvUxNdDtRCowZJM1nD0hHGLx2p7tnhVpm0f8M/sc0hN43/PrO PjGdfcFpR9Gucn3g053QeurR9g5Sd6wnXMpLHF7lwwzQViAVYsS9waCUJizbMfEgUzS0VL Ru0d8M8uKzLPgAYGfQy0qn8HoPU67FypwiNCUjjoisZdYUMVBirvUBZiOjpzvA== 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 4bbQmz091DztVf; Mon, 07 Jul 2025 13:58:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567DwAd3083897; Mon, 7 Jul 2025 13:58:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567DwAZl083894; Mon, 7 Jul 2025 13:58:10 GMT (envelope-from git) Date: Mon, 7 Jul 2025 13:58:10 GMT Message-Id: <202507071358.567DwAZl083894@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 669b52503298 - stable/14 - Add USB quirk for Creative Stage SE mini 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 669b52503298fc3f2ea822e7e1b99d98a9b0d9a6 Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=669b52503298fc3f2ea822e7e1b99d98a9b0d9a6 commit 669b52503298fc3f2ea822e7e1b99d98a9b0d9a6 Author: Jan Biedermann AuthorDate: 2025-06-05 23:25:22 +0000 Commit: Warner Losh CommitDate: 2025-07-07 13:57:01 +0000 Add USB quirk for Creative Stage SE mini Note: The commit in main was modified for the new macros in main. stable merge will need to use the version originally in #1715 MFC After: 2 weeks Pull Request: https://github.com/freebsd/freebsd-src/pull/1715 Closes: https://github.com/freebsd/freebsd-src/pull/1715 --- sys/dev/usb/quirk/usb_quirk.c | 1 + sys/dev/usb/usbdevs | 1 + 2 files changed, 2 insertions(+) diff --git a/sys/dev/usb/quirk/usb_quirk.c b/sys/dev/usb/quirk/usb_quirk.c index 21fbd3d9d70a..5920ffa934a0 100644 --- a/sys/dev/usb/quirk/usb_quirk.c +++ b/sys/dev/usb/quirk/usb_quirk.c @@ -224,6 +224,7 @@ static struct usb_quirk_entry usb_quirks[USB_DEV_QUIRKS_MAX] = { UQ_MSC_NO_START_STOP, UQ_MSC_IGNORE_RESIDUE), USB_QUIRK(CREATIVE, NOMAD, 0x0001, 0xffff, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_READ_CAP_OFFBY1), + USB_QUIRK(CREATIVE, STAGE_SE_MINI, 0x0000, 0xffff, UQ_MSC_NO_INQUIRY), USB_QUIRK(CYPRESS, XX6830XX, 0x0000, 0xffff, UQ_MSC_NO_GETMAXLUN, UQ_MSC_NO_SYNC_CACHE), USB_QUIRK(EMTEC, DANEELEC4GB, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE), diff --git a/sys/dev/usb/usbdevs b/sys/dev/usb/usbdevs index a7519c1e7fe5..251d2f483a61 100644 --- a/sys/dev/usb/usbdevs +++ b/sys/dev/usb/usbdevs @@ -1662,6 +1662,7 @@ product CORSAIR STRAFE2 0x1b44 Corsair STRAFE Gaming keyboard product CREATIVE NOMAD_II 0x1002 Nomad II MP3 player product CREATIVE NOMAD_IIMG 0x4004 Nomad II MG product CREATIVE NOMAD 0x4106 Nomad +product CREATIVE STAGE_SE_MINI 0x3295 Stage SE mini product CREATIVE2 VOIP_BLASTER 0x0258 Voip Blaster product CREATIVE3 OPTICAL_MOUSE 0x0001 Notebook Optical Mouse From nobody Mon Jul 7 14:00:22 2025 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 4bbQqV5dsMz61ncw; Mon, 07 Jul 2025 14:00:22 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbQqV3zJVz3RHb; Mon, 07 Jul 2025 14:00:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751896822; 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=8VNXGUnyLmGVteuWMI/wzatIovbQ/qi1y2GSy+Uc+ls=; b=mPFm6zYhNf8pJyQ1aaZEbBHcn5HxDf9J5S3Z/AUN5dqeSrWoEdyVUBOkAJct+bnpX3uynW x/jqhp+YCBHYY5iO5A2qQ6Pyhu09e+XG8Lsrpr8Yxdbwfib6Uw+Td+KaijHUVFHGVcHWFZ IiCkZMqgbY6WWpCjt8ZAPbh3fGYDuVeG5/UzqmDhA8UGcN325X9z2DNXSmwSseu3LPywmy +W2/l6KJ+3Nll1086qSdjRU8jvQWF1eRJOWUTHDa1GBoPpIgO7ujJ2ajipQI+k3uHMsR71 Dvl7P8e23+t7zief3SkoslrEnuQYsTqZNrD7l21xNK/tAynurho30vyWeeyysw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751896822; 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=8VNXGUnyLmGVteuWMI/wzatIovbQ/qi1y2GSy+Uc+ls=; b=WcFmE+XvES3q8pQ9WlXTQ6Dhs8Wr9qVGj79oy3gXeNus/iMu7NTJ/GkePVlVk6+5zJhJyl q7fhTxvabJTAubx/LXvwGrD+P5481TrRgb8uwTxSrOsZoJj/cHAP8NSHAb8hbn+O3/KAnZ qTmtxIA1gKkt3yb/Cbg6oEHv4vc5qmA6edBAPUiiOy1hQ01QOsrbJhJcdypn5b0f410dRN Dbny4Q8NkKy743nZNGGLXLGCSXK4T6TFVYOEiq6BgjBaPP8a8P08XHfB5JmASFwY+sz5v0 m3t1cfcLETWZ8tQimoMGFzlcHXeIDhno/O9e4z8T0mtRA2tNlA0WmZoHQJjDBQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751896822; a=rsa-sha256; cv=none; b=v9a7qT2JxLzR1iYxvKKORcWEXBMOoUjcgzZa+Ig6W2fI79pJrjq74m9Xr1/S5MhiO7g2PO sbb2/NfPMxT2Bi2H5vNwQJAMQdqLlk2L8pInmn+MSZ/Kyk8INnZg101MaktHAApMKoancy bm6ebIVvl4bTq064i5MPd2McESbEe5d2uq/iM5mG1UizH8q/JcMX7TooA7C6VzpM84W9kq xJqQastbs1fs6oeONBu2ET/ff1FwX7HfZGG5lkI1qx8Oeu36OWjWV8gxNL9+TV2uvvUvp9 B4Y/MNumhF+IZ5QPnSiICxEtfw8PwPfSOfTprPyUw1jgNSqaQdTnMoRo9dICuA== 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 4bbQqV3ZhhztVg; Mon, 07 Jul 2025 14:00:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567E0Mwm094403; Mon, 7 Jul 2025 14:00:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567E0MFO094401; Mon, 7 Jul 2025 14:00:22 GMT (envelope-from git) Date: Mon, 7 Jul 2025 14:00:22 GMT Message-Id: <202507071400.567E0MFO094401@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: 97452b097a4a - main - examples/inotify: Handle a zero-length name 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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/main X-Git-Reftype: branch X-Git-Commit: 97452b097a4a35df8ce8cbd44786fb7d95db2a92 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=97452b097a4a35df8ce8cbd44786fb7d95db2a92 commit 97452b097a4a35df8ce8cbd44786fb7d95db2a92 Author: Mark Johnston AuthorDate: 2025-07-07 13:51:41 +0000 Commit: Mark Johnston CommitDate: 2025-07-07 13:51:41 +0000 examples/inotify: Handle a zero-length name Reported by: jlduran Fixes: 1d8664d69041 ("examples: Add a demo program for inotify") --- share/examples/inotify/inotify.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/examples/inotify/inotify.c b/share/examples/inotify/inotify.c index b8e300bc992c..ea63ccd1f337 100644 --- a/share/examples/inotify/inotify.c +++ b/share/examples/inotify/inotify.c @@ -154,7 +154,7 @@ main(int argc, char **argv) ev = ev2str(iev1->mask); xo_open_instance("event"); xo_emit("{:wd/%3d} {:event/%16s} {:name/%s}\n", - iev1->wd, ev, iev1->name); + iev1->wd, ev, iev1->len > 0 ? iev1->name : ""); xo_close_instance("event"); n -= sizeof(*iev1) + iev1->len; From nobody Mon Jul 7 14:23:16 2025 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 4bbRKy1Zsbz61qhx; Mon, 07 Jul 2025 14:23:18 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbRKx5tvmz3ZvT; Mon, 07 Jul 2025 14:23:17 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751898197; 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: in-reply-to:in-reply-to:references:references; bh=qsYpLSw7t87s/aWVyHMN8/T25h9xk0UjQqpfG6AMwLQ=; b=TqxhSYJI9i9dDDX7GdrYNxSqQOG1qcV7kiCBtm7i7DUmApqyjLDZ45/Io/60FB/NrUFvfW bH5/Mu78Jh0uz/2XvMBaUl1ltdLKKIfAIZ17yMz7YOEqUyC5x7/8KXCr4FqmCruW+VJHYC r3vh98JrUEm73MieSCgWSnLJhq9SzV9sDw5lmcdNrvnfQ+ahSK6qNaPJMwxmittP2XUMea 7JPuNV1VJyZjCcxnj2lLLG3zfgbXmsxszbKPZpGlLNl4Pe6w0pG/kZEGHoLM5jv4VvboIE d+MaQQatemz5dqGEXGIVTTwLQxgkND84FVNEFXhe8ZaGd8bN+Qcyz7adhAWZBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751898197; 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: in-reply-to:in-reply-to:references:references; bh=qsYpLSw7t87s/aWVyHMN8/T25h9xk0UjQqpfG6AMwLQ=; b=xfnM3m9X5ZixTm8IGMxcs1xhRSwC9YGH9VCJF7vgNPclVfq1ow1xv8vbB/Lgbi+J47/Tak RMa16VkjxiJiPwzGkL3bduoa8/C+A5H60myMmtmPNAmdJ6IWvQ49pi6Qm7qt0naOC6ln4t xMzrbEo/HRQ8fPGau+Rlid63iyIWkRXZ+/8ZdvI/e6mDmVKXHDPtUHAk4pV9LUmuqAXVWN RFzKwJvOuwq6ffcrOxKGZtK+g8zl1rgd0bMGc7BK5poXG034Wyrx8xh7sXJgsQZE6Ak2L0 3gsOIC98PCXx4p8SpvND53iqdKtfdmO7cbA3sfn6fp9pu/05XRZaPZCB4HFcqQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751898197; a=rsa-sha256; cv=none; b=lRI/lOYUmx0IwaZGOY1Fx24rfqnXyZdZa9AU4vF9612yEsT4CWfGFNnv8Xe6LcFqpSNbrP HTM7PABNzjOBv9Z0vn/FBOhMOCXeqFiX5+ZS+b2LxKn+L05CN6e1yj3C9JBvs8KdiSpbiP la4QCA/WAMFZ+G+7hrtRDuAQqo1A1Y3hl4NDMx8iV4ySaSoH+x+VQOtbF274V/l9mxpEG5 Wl8y9zonmIGNDgOhcgG8AFRmQ+KTUDfvQyygx4A88jjJqDqMVUIYV1ThCdSc2qnh5b1KTb rSk2dOnH2SEKlxpqnyCwqk/4VEAg+7dEb7H2CFaU+Uo4XwBmGDEVAP4iw5E45g== Received: from [IPV6:2601:5c0:4200:b830:459f:451:1697:9d58] (unknown [IPv6:2601:5c0:4200:b830:459f:451:1697:9d58]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bbRKx3nzWz1QSm; Mon, 07 Jul 2025 14:23:17 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: Date: Mon, 7 Jul 2025 10:23:16 -0400 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: 4685fa8e4bef - main - aio: handle errors from fork Content-Language: en-US To: Konstantin Belousov , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202507052119.565LJIrH099925@gitrepo.freebsd.org> From: John Baldwin In-Reply-To: <202507052119.565LJIrH099925@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 7/5/25 17:19, Konstantin Belousov wrote: > The branch main has been updated by kib: > > URL: https://cgit.FreeBSD.org/src/commit/?id=4685fa8e4bef169e6a1ceaf07f149232326de805 > > commit 4685fa8e4bef169e6a1ceaf07f149232326de805 > Author: Konstantin Belousov > AuthorDate: 2025-07-04 18:30:31 +0000 > Commit: Konstantin Belousov > CommitDate: 2025-07-05 21:18:43 +0000 > > aio: handle errors from fork > > Do not try to fork forever if fork() failed. Propagate the error up. > > Reported and tested by: pho > Sponsored by: The FreeBSD Foundation > MFC after: 1 week I'm not sure this is always correct? Certainly we should not loop forever, but as long as one AIO worker exists, it is safe to continue and not report an error. Having multiple AIO workers is a performance optimization, not a functionality requirement. That is, I think aio_init_aioinfo() should only report an error if num_aio_procs is zero after the loop. -- John Baldwin From nobody Mon Jul 7 15:07:47 2025 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 4bbSKJ4SLlz61w7V; Mon, 07 Jul 2025 15:07:48 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbSKJ16nJz3wPm; Mon, 07 Jul 2025 15:07:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900868; 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=Za52I7S9gJ36yteNGyb+i/aQNeoO4hQ44QKPYQpMGTQ=; b=YwCi3WxLGJmcn1Kgv7fL8qlZL28KmTCkC6oxUHiHrtjJD1E9EWdQcQX3povFaNfquPq5d2 9xCktHGCDg5q0PmjZvdlckRIQQkV0baiUbVs7sZ5JfumsGlV/LMiw9lC1FDIFo/OL07ekp Qnns19c1lAwDUVrg6gqdly2moIAYO+dOfsSetPYS3UFX3VsDONK4wbwLb8eFrIJttIstKV s8SjYT8d7l70DJxwxlsZpRul8k+vQuPkXXyOXtrv88ecOp+UfmmtqdVOa1d4XV/l1lqCPq b+X3e7JIzVKWyDYe2/zBNuYkRaKOP6Z7JtRyNIpwGhyXUcZMZwyNe3FS2d5ufA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900868; 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=Za52I7S9gJ36yteNGyb+i/aQNeoO4hQ44QKPYQpMGTQ=; b=gCWMQAnSkCG7dhuYw4zZGG9xOrtLrr9LAMVTEQXV8p+YmZiGpGvW8layFxhENyrUf00Tlj nZ3tGyB+ZmtH8iRC/PLMutn0c+2S+VVcuR3y3pviLGt1NzDeXCfdkJ3RmhLHVzigCEZDcS JzBKFcz9kPCSOcwXF+gwaEKP763p2wypNaKx/T93qF6degF0C2JOQoHTWGwNHtjov6braS lCZ827jhhJ+SiJ+HGgwmIBw8CHnBMqJFBlLiZXUR+hbE5qGKkkZ6F7h8OiT6WdgdDcE7aX Q4WQL7PlDkkFkEgHqSkAJkJhuXPHtgFHyb1+cFMftbm2RCHCh8SxfDSTeTserg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751900868; a=rsa-sha256; cv=none; b=LU6l9E4lrclPQK+ZbJhCY5kWR/QQfPy1TN4kpaLU7iFIqvRSGJlNHxZo/MfKmc9chFPLkq lsWC+HszZn/rcP94KVbpqSMEDzJcwDt4bJEOXWnmvlYRYN34uvb74NclDrkPViVj/4Ca8n 6Xggu1x8OjUVkiMp5kK8/P0gtTmoPJherO1kwT/aAErBjHhkMTUhtnGfJxqItGJJZ5rAC9 uOSH2O8UaUcoO+2mMUucPJ4O7oemzgUAbnY/xTCd2pdIEVL/W4/p0HXTzdhrORB8bunT7G P4PozH2O0TJ5FsfJzmExsmNHd2ffDhUtOfaN/+OlLyELlw7Ap5oes6MkKx1NhQ== 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 4bbSKJ0k64zwF1; Mon, 07 Jul 2025 15:07:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567F7mY7016369; Mon, 7 Jul 2025 15:07:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567F7lqs016366; Mon, 7 Jul 2025 15:07:47 GMT (envelope-from git) Date: Mon, 7 Jul 2025 15:07:47 GMT Message-Id: <202507071507.567F7lqs016366@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 82e1b49d7571 - main - pfctl: Zap unnused iface function parameter from pfctl_kill_src_nodes() 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 82e1b49d75714b91052dfeaf9a8f5f94d03f77ec Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=82e1b49d75714b91052dfeaf9a8f5f94d03f77ec commit 82e1b49d75714b91052dfeaf9a8f5f94d03f77ec Author: Kristof Provost AuthorDate: 2025-07-01 09:50:17 +0000 Commit: Kristof Provost CommitDate: 2025-07-07 15:06:48 +0000 pfctl: Zap unnused iface function parameter from pfctl_kill_src_nodes() Killing source tracking entries per interface does not make sense and `-i interface' along with `-K key' is completely ignored anyway. There since import in 2006, probably just copy/pasta. OK sashan Obtained from: OpenBSD, kn , 28535c0a36 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/pfctl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c index 38d74aceba80..88123b17f1b3 100644 --- a/sbin/pfctl/pfctl.c +++ b/sbin/pfctl/pfctl.c @@ -78,7 +78,7 @@ int pfctl_clear_altq(int, int); void pfctl_clear_src_nodes(int, int); void pfctl_clear_iface_states(int, const char *, int); void pfctl_addrprefix(char *, struct pf_addr *); -void pfctl_kill_src_nodes(int, const char *, int); +void pfctl_kill_src_nodes(int, int); void pfctl_net_kill_states(int, const char *, int); void pfctl_gateway_kill_states(int, const char *, int); void pfctl_label_kill_states(int, const char *, int); @@ -590,7 +590,7 @@ pfctl_addrprefix(char *addr, struct pf_addr *mask) } void -pfctl_kill_src_nodes(int dev, const char *iface, int opts) +pfctl_kill_src_nodes(int dev, int opts) { struct pfioc_src_node_kill psnk; struct addrinfo *res[2], *resp[2]; @@ -3400,7 +3400,7 @@ main(int argc, char *argv[]) } if (src_node_killers) - pfctl_kill_src_nodes(dev, ifaceopt, opts); + pfctl_kill_src_nodes(dev, opts); if (tblcmdopt != NULL) { error = pfctl_table(argc, argv, tableopt, From nobody Mon Jul 7 15:07:49 2025 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 4bbSKK5csjz61wGL; Mon, 07 Jul 2025 15:07:49 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbSKK2Vdvz3wPt; Mon, 07 Jul 2025 15:07:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900869; 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=Lmeo06521rLcCvGoD21XFljP0uQ7xuWv07bVrnxtZUU=; b=jO7gyNmTUKcFCCGfIPnG75u7p38TCvtDUDoOv7wR1zVw3ZpQHO+zqEbAzXHfYayqqyg514 JmESoLl2qJwIkuP7nMUaZVGqlv+++dR6H6EO6efQFxFNUYT5+DIsb/aODtGkXK1kC+/lWK 3LzXvLMXlAsXcg2tBNNJYkm/Z2dMr4+c1ABiXzYuWMfRSj+IHkl9XIkhfpTCGdRkpnn6Ge iNxuBjCv0VHG4UIDm3Sup/jzhOWrzNj3HUlbcH8rvV9mZ+EeTGTfQUxYar89foy76S0zL6 S4gJPlJbmTrIzzStCCofVom18rVUWE4Vcjvb4kOH33aOjbMUzEeQOIaMSFWc2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900869; 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=Lmeo06521rLcCvGoD21XFljP0uQ7xuWv07bVrnxtZUU=; b=MJRRM6CUT5E1lnXW9EB4xkF3GIvisxa3wcxP+lAFm7LvUibqtLBPMwKMlialLzDFpEGJ17 lcEGOzrYYdZ6T0BvO/dFIq2oS/cJJlQqT2ew6negJmT+L0FzjToUkikwnggD8u19SSnRcV h8zhnNXkOsYoT/8OQ8WEP1zps92JaNDoIjqwpEpzWtajRGmYMvhr36+tnRflPxfzUfBQ/x m1dqc7HqeesmcaPQeaYTg2ezxb09wovdGD/NE0KvJDapbSlYisSTyx3FjlXrsQryGxBb6F Ogvc525PDok8ApfHdFwEnMT0lMma6HV5ElU/08lUqWkiX4al3kcbn1ISf3ZcFg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751900869; a=rsa-sha256; cv=none; b=Pa5JBa2IlIkgeZ19/7FWQ97NFh7iMql4vDvgXzzJyJMVhLva8D16hKtvTRogw30ZjHPv6b 0iH1ycGLW9/QzSYJJ+8x2d/QRZkhVE2QMpXrfV4WvMqu26SSj5WLhVJOEP05+u3pYD08fo jO6CoycMpDrkzPDBeTl4xMFIcs/LjTw//Q2NHtFspx73dcLgRypdhqU5ZiiTk5zNM1DgHE vH+0EX9SRPSLzvp5hsWGbVU86xoxvU0cxvZVN79Cs86dezAv2qQgSon72NCcN/DLaKpqBT HR8prODmcZLCiyjPimsFJmgAa20XzsW9XigQcNHGKJXTmdWrezO5RJU4TvNxEQ== 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 4bbSKK1fGHzwF2; Mon, 07 Jul 2025 15:07:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567F7nG1016406; Mon, 7 Jul 2025 15:07:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567F7n8Q016403; Mon, 7 Jul 2025 15:07:49 GMT (envelope-from git) Date: Mon, 7 Jul 2025 15:07:49 GMT Message-Id: <202507071507.567F7n8Q016403@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: f8a8bb7bade9 - main - pfctl: Improve duplicate table name warning 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f8a8bb7bade9575c549cbc94500ba706b712c650 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=f8a8bb7bade9575c549cbc94500ba706b712c650 commit f8a8bb7bade9575c549cbc94500ba706b712c650 Author: Kristof Provost AuthorDate: 2025-07-01 10:02:03 +0000 Commit: Kristof Provost CommitDate: 2025-07-07 15:06:48 +0000 pfctl: Improve duplicate table name warning When creating tables inside anchors, pfctl warned about namespace collisions with global tables, but only in certain cases and with limited information sometimes leaving users clueless. Deferring the check to process_tabledefs() where tables are eventually created, both anchor and table name are known which allows for checking all existing anchors. With this, warn on all duplicates even in dry-runs (`-n') and print quoted names so they can be copied to fix configurations right away. No functional change in parsing or ruleset production. Discussed with and OK sashan Obtained from: OpenBSD, kn , 0de3a0c9ad Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/parse.y | 1 + sbin/pfctl/pfctl.c | 3 --- sbin/pfctl/pfctl.h | 2 +- sbin/pfctl/pfctl_table.c | 26 ++++++++------------------ 4 files changed, 10 insertions(+), 22 deletions(-) diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index c59204d3d5a4..0b98bd357a37 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -5424,6 +5424,7 @@ process_tabledef(char *name, struct table_opts *opts, int popts) if (pf->opts & PF_OPT_VERBOSE) print_tabledef(name, opts->flags, opts->init_addr, &opts->init_nodes); + warn_duplicate_tables(name, pf->anchor->path); if (!(pf->opts & PF_OPT_NOACTION) && pfctl_define_table(name, opts->flags, opts->init_addr, pf->anchor->path, &ab, pf->anchor->ruleset.tticket)) { diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c index 88123b17f1b3..b4732d178cbb 100644 --- a/sbin/pfctl/pfctl.c +++ b/sbin/pfctl/pfctl.c @@ -3435,9 +3435,6 @@ main(int argc, char *argv[]) if (pfctl_rules(dev, rulesopt, opts, optimize, anchorname, NULL)) error = 1; - else if (!(opts & PF_OPT_NOACTION) && - (loadopt & PFCTL_FLAG_TABLE)) - warn_namespace_collision(NULL); } if (opts & PF_OPT_ENABLE) diff --git a/sbin/pfctl/pfctl.h b/sbin/pfctl/pfctl.h index 08d48695709e..d8196c129187 100644 --- a/sbin/pfctl/pfctl.h +++ b/sbin/pfctl/pfctl.h @@ -86,7 +86,7 @@ void pfctl_show_tables(const char *, int); int pfctl_table(int, char *[], char *, const char *, char *, const char *, int); int pfctl_show_altq(int, const char *, int, int); -void warn_namespace_collision(const char *); +void warn_duplicate_tables(const char *, const char *); void pfctl_show_ifaces(const char *, int); void pfctl_show_creators(int); FILE *pfctl_fopen(const char *, const char *); diff --git a/sbin/pfctl/pfctl_table.c b/sbin/pfctl/pfctl_table.c index 53abea3e1ae1..d1f20761a4f4 100644 --- a/sbin/pfctl/pfctl_table.c +++ b/sbin/pfctl/pfctl_table.c @@ -94,7 +94,8 @@ static const char *istats_text[2][2][2] = { goto _error; \ } \ if (nadd) { \ - warn_namespace_collision(table.pfrt_name); \ + warn_duplicate_tables(table.pfrt_name, \ + table.pfrt_anchor); \ xprintf(opts, "%d table created", nadd); \ if (opts & PF_OPT_NOACTION) \ return (0); \ @@ -576,12 +577,10 @@ pfctl_define_table(char *name, int flags, int addrs, const char *anchor, } void -warn_namespace_collision(const char *filter) +warn_duplicate_tables(const char *tablename, const char *anchorname) { struct pfr_buffer b; struct pfr_table *t; - const char *name = NULL, *lastcoll; - int coll = 0; bzero(&b, sizeof(b)); b.pfrb_type = PFRB_TABLES; @@ -597,22 +596,13 @@ warn_namespace_collision(const char *filter) PFRB_FOREACH(t, &b) { if (!(t->pfrt_flags & PFR_TFLAG_ACTIVE)) continue; - if (filter != NULL && strcmp(filter, t->pfrt_name)) + if (!strcmp(anchorname, t->pfrt_anchor)) continue; - if (!t->pfrt_anchor[0]) - name = t->pfrt_name; - else if (name != NULL && !strcmp(name, t->pfrt_name)) { - coll++; - lastcoll = name; - name = NULL; - } + if (!strcmp(tablename, t->pfrt_name)) + warnx("warning: table <%s> already defined" + " in anchor \"%s\"", tablename, + t->pfrt_anchor[0] ? t->pfrt_anchor : "/"); } - if (coll == 1) - warnx("warning: namespace collision with <%s> global table.", - lastcoll); - else if (coll > 1) - warnx("warning: namespace collisions with %d global tables.", - coll); pfr_buf_clear(&b); } From nobody Mon Jul 7 15:07:50 2025 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 4bbSKL719xz61wCy; Mon, 07 Jul 2025 15:07:50 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbSKL3bcdz3wQC; Mon, 07 Jul 2025 15:07:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900870; 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=IDR3N6Zvgn3U+Zz+rMk3L9cHXRDO+dZVeHgWfXDsQEk=; b=D4H8TtitD2Gv8j4IUBQTh/CDo1Z7mMMDST+ukRaGwwhaxKg0+CysyBx37tml72yMpmYapZ Me9m8nIGOAv25hxm8EngJXabq0YB8uq7otmN8Bi/c9HOu3Y3n7uqWmNc0qF5wsszOJCmcE 054T3F8G16mT5a9q8chAGHGamQi2rj8GDS08RQJKVu+LeqTFD+1AQoD5JxvL9tQzIDiMMW DZMG+X6zKrijrDr2gsx9Apna5p5m9TxbZdI/SHzBnvioMyTWWD1cvTJ2iTJibx+i3izihi xDcr04IJU6I+b5vpjRyr3eO3s/toYuA+QlMQfGonH4QDHDUMxUFpPSU6bHKiRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900870; 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=IDR3N6Zvgn3U+Zz+rMk3L9cHXRDO+dZVeHgWfXDsQEk=; b=BhQF14WVIH4ODx1nMtcOG7fSJZwc1GDKZ2Z8iaVaZs4mxiC4XpO5XweuLhlLxVpUSUvT1Z OQ9YmXNQuPK4GkJPw5tXd9teFb1JOCIq7rzlmeafgQ9tGtV1Ecoy6XbAz/ZqvmavsO0V/d 6T0l5bY/tfwOOwBEsH9B1a4F9uba2F98eOOpiCPFt1QVrFrWi9OWfMzAGnuS1GeiH1J+wM L/sFXlRhgHTq7s4AOuvZ1T5HMO6Ueo/tuntUdEaPBBY3fm3TB1AcnX6yanIQrCjxbMtPUp iq8fID01t5Gufs7i4gxhCuH0Zu8Kn2VIix8Uf3JMfRqE8DIAEoRJw/kksSk9ww== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751900870; a=rsa-sha256; cv=none; b=DesjC2JrkTAqgI68Du3shcp1t2v8FCYCttoTT2FpKjSUzNOqY8vZ1VQdmhBMPf3aMs/UiQ sTKmCf0zBvKA2TWinL9m0PfivQ5IwwQaQdvoiBFOyAZdGMOG1g5pA6biGyNbSx1iVtZixK AXSTZC7u+fjQOdmhpdekVwbkOqHR+tQ3NGR6yTI6T6VP3ruf3Im7LdBTPhomA0bkMqWCPD 2xhS1AM/58lhzcQsK5KZesYYvQlovXEUntVjsKxE/8a+2TVmk+jRT/LdI3c5+6moC1zIsd uvi0s6mUgbdwYTeusWUNCgQR0CxaqSgymDz2xsWiJ25zi0Yljc1WHRwPwhLzkw== 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 4bbSKL2b2YzwF3; Mon, 07 Jul 2025 15:07:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567F7oWZ016441; Mon, 7 Jul 2025 15:07:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567F7oWq016438; Mon, 7 Jul 2025 15:07:50 GMT (envelope-from git) Date: Mon, 7 Jul 2025 15:07:50 GMT Message-Id: <202507071507.567F7oWq016438@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 714be446a925 - main - pfctl: Defuse `-F all -i interface' 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 714be446a92555911b8cbd0f0f480f0dea617fa6 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=714be446a92555911b8cbd0f0f480f0dea617fa6 commit 714be446a92555911b8cbd0f0f480f0dea617fa6 Author: Kristof Provost AuthorDate: 2025-07-01 10:10:00 +0000 Commit: Kristof Provost CommitDate: 2025-07-07 15:06:48 +0000 pfctl: Defuse `-F all -i interface' Flushing all filter parameters does not make sense on one specific interface only as already noted. However, the main ruleset as well as all tables were still cleared on such invalid usage. Furthermore, an empty interface name was treated like no interface at all, hence source tracking entries, statistics and interface flags were cleared also. Immediately error out if `-i' is given regardless of its argument before flushing anything. OK sashan Obtained from: OpenBSD, kn , 7863d3574f Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/pfctl.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c index b4732d178cbb..169b75f202d1 100644 --- a/sbin/pfctl/pfctl.c +++ b/sbin/pfctl/pfctl.c @@ -3365,6 +3365,11 @@ main(int argc, char *argv[]) pfctl_clear_stats(pfh, opts); break; case 'a': + if (ifaceopt) { + warnx("don't specify an interface with -Fall"); + usage(); + /* NOTREACHED */ + } pfctl_flush_eth_rules(dev, opts, anchorname); pfctl_flush_rules(dev, opts, anchorname); pfctl_flush_nat(dev, opts, anchorname); From nobody Mon Jul 7 15:07:51 2025 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 4bbSKM6xvvz61w2p; Mon, 07 Jul 2025 15:07:51 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbSKM4ZZVz3wHV; Mon, 07 Jul 2025 15:07:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900871; 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=mMzdRdJZk64YxwkBXCn8MFATazsQBb5sDUoW5sy+O08=; b=hSbeGGQN9m3PL+HDTz/BYVDn40MKKeu5Q7bobebLMZ1LFyLRXocFDzPr+cdsqjlUph4uL2 hwZyy2hJD2N7fpTYXakIcHMcAjJyeNkuMOp2y/PcKBtuy60C8pXsXHrXb0Rj/rQsS5Ra2Y RgrEptFiHXDoxpmQjinm6MfzVBgM4IudLlKIZEzFYLuer+Rrjpc9WsQ3lpqW2o7QcM2ns2 e/ifAop6catEip/HcsAKXn5pmaacHAzkAiLU0Od3sR0lNz+Z4qkQ4xcswKddNuBQDRZmab HD+dEkKeJMLnt4NZFFJW5eX0sg3F5zsWulUn48QwAjPftYS8ATOto4B0zF5j1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900871; 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=mMzdRdJZk64YxwkBXCn8MFATazsQBb5sDUoW5sy+O08=; b=mfkWD6b0Ia/Ep+eDhf5PYDvY+aA7QKs+/BFXV4BiO5uUM/mg7u5l8jsUbbFECPJjyw1hY6 +THn7Kgh0FqA+FUJcbLuvFAbCmEsFmQYdWZEaxUtPKIyHjihQBt8N+GfrQF3/9mv7qWhZX kPPSUA1hlvPNCBJhB5JZp2GLFh03NmRsomnawTMPods2Xp9Cgvq+nNz74Zz8Ey5D4RiaKf QTOQ8upvPNhyh8tU4YHTzCtMARRuXHQC1iisFxGfS3cp7Oh/GIBJwyc8/Y0DHd9qcK60TK QieLIOYneWZXwMGbF8GZJB6nThLDXpou93MAzH674fUCl8m1bcTJ2kiTTH7yvA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751900871; a=rsa-sha256; cv=none; b=fsihws7rdqUxYhMxKlN+poFbqrSvX9AKpaVzNeyVwsVWpnyDYX12xNz8TVVUIHnFP+I+Le QkXd7B8aK6GFkgQv2xzsK1xXBCgTcV3JaE08nzDWLSSXWR0l998IYtBXBHRMRhXTbcsDlJ 54ajtMY2XdZvlzV/fCNSaEngpG9P/kqjxra1VUuceSKVPrttofkpHcu/0KrmoKKz6wC3ds KbSUVgx5AsTKF6TJFTQAuZxzKziiVD+bzZKe7WOmqzOSaO0meyB1Gxkj50s95CgvoxZKXZ AxZeUS6fMzFYQQV/B1VE9wZl/8BF/yii/BaaFLbzaiD5BsHV8AJhlDNEOcX8vg== 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 4bbSKM3DZxzwKH; Mon, 07 Jul 2025 15:07:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567F7pRY016476; Mon, 7 Jul 2025 15:07:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567F7pQv016473; Mon, 7 Jul 2025 15:07:51 GMT (envelope-from git) Date: Mon, 7 Jul 2025 15:07:51 GMT Message-Id: <202507071507.567F7pQv016473@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: b38e96f0232e - main - pfctl: Use mnemonic PFCTL_SHOW_* macros 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b38e96f0232e1bb353ca556ace6c1885db879289 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=b38e96f0232e1bb353ca556ace6c1885db879289 commit b38e96f0232e1bb353ca556ace6c1885db879289 Author: Kristof Provost AuthorDate: 2025-07-01 10:12:34 +0000 Commit: Kristof Provost CommitDate: 2025-07-07 15:06:49 +0000 pfctl: Use mnemonic PFCTL_SHOW_* macros Terminate string with null character. Tweak spacing while here, no object change. Feedback and OK procter, OK sceloha Obtained from: OpenBSD, kn , 2706705609 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/pfctl.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c index 169b75f202d1..f133a106c69c 100644 --- a/sbin/pfctl/pfctl.c +++ b/sbin/pfctl/pfctl.c @@ -2115,7 +2115,6 @@ pfctl_load_ruleset(struct pfctl *pf, char *path, struct pfctl_ruleset *rs, } } else if (pf->opts & PF_OPT_VERBOSE) printf("\n"); - } if (pf->optimize && rs_num == PF_RULESET_FILTER) @@ -2958,7 +2957,7 @@ pfctl_show_anchors(int dev, int opts, char *anchorname) errc(1, ret, "DIOCGETRULESET"); if (!strcmp(pr.name, PF_RESERVED_ANCHOR)) continue; - sub[0] = 0; + sub[0] = '\0'; if (pr.path[0]) { strlcat(sub, pr.path, sizeof(sub)); strlcat(sub, "/", sizeof(sub)); @@ -3307,12 +3306,14 @@ main(int argc, char *argv[]) 0); pfctl_show_nat(dev, path, opts, anchorname, 0, 0); - pfctl_show_rules(dev, path, opts, 0, anchorname, 0, 0); + pfctl_show_rules(dev, path, opts, PFCTL_SHOW_RULES, + anchorname, 0, 0); pfctl_show_altq(dev, ifaceopt, opts, 0); pfctl_show_states(dev, ifaceopt, opts); pfctl_show_src_nodes(dev, opts); pfctl_show_status(dev, opts); - pfctl_show_rules(dev, path, opts, 1, anchorname, 0, 0); + pfctl_show_rules(dev, path, opts, PFCTL_SHOW_LABELS, + anchorname, 0, 0); pfctl_show_timeouts(dev, opts); pfctl_show_limits(dev, opts); pfctl_show_tables(anchorname, opts); From nobody Mon Jul 7 15:07:52 2025 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 4bbSKP3hwzz61w9t; Mon, 07 Jul 2025 15:07:53 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbSKN5dmkz3wHh; Mon, 07 Jul 2025 15:07:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900872; 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=s4MnF8N1J0jXmUPWkN/JYtx5/C3hmn8l0Bwl5ae6A94=; b=xzM2VrRqC34J1rWPeSOHcTSUna243HIo9yveK/7CEi+kzHjnn+AihvBvz5gp4r5NB+AFbK Pn9PCQxX9PKAWTF3SCL8uBlY4Z+gLVCPglK56kwyRpNbOWTSkpLc0QLM6GY7Zr5YIPld7Y G3Q+Me3N7E1hkNUwIrVZDIfDKpOA7msOyf85aKgR+kCMJGKEi6e419pKXoPjJ33fN+XyHD WizwsKypFG1n29OfVW/gAWjjiaH8gENnjm9PZuhmD1y1wCVk2mifqm0T6RvlLHLrmyN84+ YAo/zW7dpYgplGfzBvPHKlCu9koWxeb19ATma6SFYytTdwaYqI50efyTe6RSMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900872; 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=s4MnF8N1J0jXmUPWkN/JYtx5/C3hmn8l0Bwl5ae6A94=; b=u5V7IkgwVW3AMKivnGEu5yDzMcuSB0I28hJuKF7zKQi/lTubF31vWQPAFEOWByYJJ4k/UR z9D/9VyX7banaPYUHOodkTetv7vR/udC0Z/yMWttgIFTpDFt1kTsUXA6cNSFBdOtZGG/w4 uvRm30+cySb555d4ggVjw4nvv1MUiFZnKK2SM/AvnkYlwfLf5TzXcKaScY55C64D7ek0b1 9wLHZjfQ57gHl5YBHY8fA+DJZgNcZkAtLy3EM7vZpaUcHr9KeCEan/9FlHwGSL91f9d1Zt +Snpop+W2ey1qUSxZqlmjDREcAweYIzvWCQztxSQ9KMkBHZE8oMoUs3VHZiAAQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751900872; a=rsa-sha256; cv=none; b=IaZOtYXBFhyVJxsaPfNpl1mJnV8ItOE46g4xCWJfRp+brHKRXG6i1dIEo87WljrTVMIIPd ik/aUjL8y/WYwsgU2zP5ZKd4+fCELBeN5Juaz/ynIrU6j+02BB6mDSU+Wjy6Wz8gTDQdzP zZ5xVJuaPWrTzCprRPm7O9Vbsqn9AUkOPbuOaI3oTnt38OuMUg1xOokkDi3PeIZtity7xq gGGV7sb4Dh6sfLkb+OkvyTBoDseew1fh/e68ql80xh2eh2xVnfLpRATVgMA5yPUs8ns6h8 hv9pxbwK3vv3Edv1noLxruEzz0CZY0OarkKCxOoNU9Jr8tBNw6vY8fBFGNkJhA== 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 4bbSKN4TKpzwGx; Mon, 07 Jul 2025 15:07:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567F7qUk016512; Mon, 7 Jul 2025 15:07:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567F7qKU016509; Mon, 7 Jul 2025 15:07:52 GMT (envelope-from git) Date: Mon, 7 Jul 2025 15:07:52 GMT Message-Id: <202507071507.567F7qKU016509@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 9bf3979d1b17 - main - pfctl.8: Mention that -r does reverse DNS lookups for tables as well 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9bf3979d1b17a2b019ed35ab661e44cc8a0f88ce Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=9bf3979d1b17a2b019ed35ab661e44cc8a0f88ce commit 9bf3979d1b17a2b019ed35ab661e44cc8a0f88ce Author: Kristof Provost AuthorDate: 2025-07-01 10:15:36 +0000 Commit: Kristof Provost CommitDate: 2025-07-07 15:06:49 +0000 pfctl.8: Mention that -r does reverse DNS lookups for tables as well OK benno Obtained from: OpenBSD, kn , 3ba17eef64 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/pfctl.8 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sbin/pfctl/pfctl.8 b/sbin/pfctl/pfctl.8 index c7fad58262dc..85294dda949f 100644 --- a/sbin/pfctl/pfctl.8 +++ b/sbin/pfctl/pfctl.8 @@ -24,7 +24,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd June 30, 2025 +.Dd July 1, 2025 .Dt PFCTL 8 .Os .Sh NAME @@ -401,7 +401,7 @@ Only print errors and warnings. Load only the filter rules present in the rule file. Other rules and options are ignored. .It Fl r -Perform reverse DNS lookups on states when displaying them. +Perform reverse DNS lookups on states and tables when displaying them. .It Fl s Ar modifier Show the filter parameters specified by .Ar modifier From nobody Mon Jul 7 15:07:55 2025 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 4bbSKS2KvCz61w5x; Mon, 07 Jul 2025 15:07:56 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbSKS0fRWz3wR0; Mon, 07 Jul 2025 15:07:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900876; 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=DCeH2rB1lxSL0Tvk+IyRNfoIcNM4/zWe9wpetafpS2g=; b=LGaoeOycFIJhpfLTmSNnBGba/TFdJKjpX0clirzhNG7VCAnSybY7M8kPlJdQ1YeBOGvQfn HVyku0JJmfgc/+L6G2qKvTBeBSyig7iC9whAhuOQYF/7VhpH1YYkooBcVChKsJ3iYs829z EKNsupG89AxRsWqJJym7Yixcxnlvf8CDzx9wADCrV1yQtkQg6mLA/eKpB0Kfalcuck7+ok ujGTKTuyoPhtbkiH0+2A+j0FYwGvYvRtTEYsVWrfzNy1h0IqP3V3KQOazxs2Ivefcy5a6G cC7BOdfN477VBrKP2lbyXCr5UpzaKdnNRzdP0qrXSc0gMEwZR3Qyb0OA1IvNVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900876; 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=DCeH2rB1lxSL0Tvk+IyRNfoIcNM4/zWe9wpetafpS2g=; b=AllRrQU4sga/KTlHSnOWdu0I1W0r16+LnXCL3WzLyl1j4AGFmC20YQeexUo7STcgdUZCQP zD1MtrA8givHVCWQIxcicqyc602AEhouwFijdT+LStg8k/Xc9+rKlF/UQmsS41IOHDS0dg hs9BRrGFMFUa73sRwULa9qB57G6z47ZLtXXOvnoQDWPtziTnEfKdQmwa6oew8AozDyPRoU MnsHKsU/3stz72pAEQK/O0oXtDMiI5HrfacvHU3cUdujmO4MWZ9MjHLdCBb5jdWK1CRVNu r6Lfm9tpA0WFmB5U63xLTLUfFwLwaUxM7Ef8KHOiAG1wqt5z/SNuhQc6USkkJA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751900876; a=rsa-sha256; cv=none; b=kkbrgHhJtGiX4C/N5BXYh/TVS3jbQcNZdNBNg6Q7rz9cC2FanfaCqQjAgfg+eX2K/kIZKi 9ADmR211pYD4hVqeqO0MJV/mnnsbZIQp2m/d2qog/fNdS1IEgh79Sv5VINReyQCIgRM2ke XxRkA83Fd8dDdGK2doeS311YtxpKdJ8+Skq7iHRDjZ8juFnyC6UsIVEVYYI+RNvzVWTXtY RR/tl+h57ngx8xL0THWlRkYBOSxrfZCrX9ATYrP7T/it4HVWQAKlqGLKNl+Q2T0zDbYRnt bJfT6CEqfmH0Y8ZdDbBggrj8umYFAxF0BzTWhcHQLdShrNHreCpOIvVfUYS7sg== 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 4bbSKR6T66zwC2; Mon, 07 Jul 2025 15:07:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567F7tia016627; Mon, 7 Jul 2025 15:07:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567F7thv016624; Mon, 7 Jul 2025 15:07:55 GMT (envelope-from git) Date: Mon, 7 Jul 2025 15:07:55 GMT Message-Id: <202507071507.567F7thv016624@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: ada0846f9303 - main - pfctl: Reuse copy_satopfaddr() when killing entries 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ada0846f9303a69f6844f54467189c9d2e8d80d5 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=ada0846f9303a69f6844f54467189c9d2e8d80d5 commit ada0846f9303a69f6844f54467189c9d2e8d80d5 Author: Kristof Provost AuthorDate: 2025-07-02 09:52:10 +0000 Commit: Kristof Provost CommitDate: 2025-07-07 15:06:49 +0000 pfctl: Reuse copy_satopfaddr() when killing entries Recently introduced in pfctl_parser.c r1.333, this helper nicely simplifies code when copying IPs based on their address family, so use it in five other places when killing state or source node entries. All addresses copied in these code paths result from either pfctl_parse_host() or pfctl_addrprefix() which guarantee the address family set to AF_INET or AF_INET6. Therefore, effectively relaxing the case of unhandled families from errx(3) in callers to warnx(3) in copy_satopfaddr() is safe since it's never reached. OK sashan Obtained from: OpenBSD, kn , 0ff82421d8 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/pfctl.c | 78 ++++++++--------------------------------------- sbin/pfctl/pfctl_parser.c | 1 - sbin/pfctl/pfctl_parser.h | 2 ++ 3 files changed, 14 insertions(+), 67 deletions(-) diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c index d3614f5f7c59..e490e933db5f 100644 --- a/sbin/pfctl/pfctl.c +++ b/sbin/pfctl/pfctl.c @@ -622,15 +622,7 @@ pfctl_kill_src_nodes(int dev, int opts) psnk.psnk_af = resp[0]->ai_family; sources++; - if (psnk.psnk_af == AF_INET) - psnk.psnk_src.addr.v.a.addr.v4 = - ((struct sockaddr_in *)resp[0]->ai_addr)->sin_addr; - else if (psnk.psnk_af == AF_INET6) - psnk.psnk_src.addr.v.a.addr.v6 = - ((struct sockaddr_in6 *)resp[0]->ai_addr)-> - sin6_addr; - else - errx(1, "Unknown address family %d", psnk.psnk_af); + copy_satopfaddr(&psnk.psnk_src.addr.v.a.addr, resp[0]->ai_addr); if (src_node_killers > 1) { dests = 0; @@ -654,18 +646,8 @@ pfctl_kill_src_nodes(int dev, int opts) dests++; - if (psnk.psnk_af == AF_INET) - psnk.psnk_dst.addr.v.a.addr.v4 = - ((struct sockaddr_in *)resp[1]-> - ai_addr)->sin_addr; - else if (psnk.psnk_af == AF_INET6) - psnk.psnk_dst.addr.v.a.addr.v6 = - ((struct sockaddr_in6 *)resp[1]-> - ai_addr)->sin6_addr; - else - errx(1, "Unknown address family %d", - psnk.psnk_af); - + copy_satopfaddr(&psnk.psnk_src.addr.v.a.addr, + resp[1]->ai_addr); if (ioctl(dev, DIOCKILLSRCNODES, &psnk)) err(1, "DIOCKILLSRCNODES"); killed += psnk.psnk_killed; @@ -729,15 +711,7 @@ pfctl_net_kill_states(int dev, const char *iface, int opts) kill.af = resp[0]->ai_family; sources++; - if (kill.af == AF_INET) - kill.src.addr.v.a.addr.v4 = - ((struct sockaddr_in *)resp[0]->ai_addr)->sin_addr; - else if (kill.af == AF_INET6) - kill.src.addr.v.a.addr.v6 = - ((struct sockaddr_in6 *)resp[0]->ai_addr)-> - sin6_addr; - else - errx(1, "Unknown address family %d", kill.af); + copy_satopfaddr(&kill.src.addr.v.a.addr, resp[0]->ai_addr); if (state_killers > 1) { dests = 0; @@ -761,17 +735,8 @@ pfctl_net_kill_states(int dev, const char *iface, int opts) dests++; - if (kill.af == AF_INET) - kill.dst.addr.v.a.addr.v4 = - ((struct sockaddr_in *)resp[1]-> - ai_addr)->sin_addr; - else if (kill.af == AF_INET6) - kill.dst.addr.v.a.addr.v6 = - ((struct sockaddr_in6 *)resp[1]-> - ai_addr)->sin6_addr; - else - errx(1, "Unknown address family %d", - kill.af); + copy_satopfaddr(&kill.src.addr.v.a.addr, + resp[1]->ai_addr); if ((ret = pfctl_kill_states_h(pfh, &kill, &newkilled)) != 0) errc(1, ret, "DIOCKILLSTATES"); @@ -830,16 +795,8 @@ pfctl_gateway_kill_states(int dev, const char *iface, int opts) kill.af = resp->ai_family; - if (kill.af == AF_INET) - kill.rt_addr.addr.v.a.addr.v4 = - ((struct sockaddr_in *)resp->ai_addr)->sin_addr; - else if (kill.af == AF_INET6) - kill.rt_addr.addr.v.a.addr.v6 = - ((struct sockaddr_in6 *)resp->ai_addr)-> - sin6_addr; - else - errx(1, "Unknown address family %d", kill.af); - + copy_satopfaddr(&kill.rt_addr.addr.v.a.addr, + resp->ai_addr); if (pfctl_kill_states_h(pfh, &kill, &newkilled)) err(1, "DIOCKILLSTATES"); killed += newkilled; @@ -984,8 +941,6 @@ pfctl_parse_host(char *str, struct pf_rule_addr *addr) { char *s = NULL, *sbs, *sbe; struct addrinfo hints, *ai; - struct sockaddr_in *sin4; - struct sockaddr_in6 *sin6; s = strdup(str); if (!s) @@ -1008,19 +963,10 @@ pfctl_parse_host(char *str, struct pf_rule_addr *addr) if (getaddrinfo(s, sbs, &hints, &ai) != 0) goto error; - switch (ai->ai_family) { - case AF_INET: - sin4 = (struct sockaddr_in *)ai->ai_addr; - addr->addr.v.a.addr.v4 = sin4->sin_addr; - addr->port[0] = sin4->sin_port; - break; - - case AF_INET6: - sin6 = (struct sockaddr_in6 *)ai->ai_addr; - addr->addr.v.a.addr.v6 = sin6->sin6_addr; - addr->port[0] = sin6->sin6_port; - break; - } + copy_satopfaddr(&addr->addr.v.a.addr, ai->ai_addr); + addr->port[0] = ai->ai_family == AF_INET6 ? + ((struct sockaddr_in6 *)ai->ai_addr)->sin6_port : + ((struct sockaddr_in *)ai->ai_addr)->sin_port; freeaddrinfo(ai); free(s); diff --git a/sbin/pfctl/pfctl_parser.c b/sbin/pfctl/pfctl_parser.c index 1db98c6103d4..a213487fb648 100644 --- a/sbin/pfctl/pfctl_parser.c +++ b/sbin/pfctl/pfctl_parser.c @@ -66,7 +66,6 @@ #include "pfctl_parser.h" #include "pfctl.h" -void copy_satopfaddr(struct pf_addr *, struct sockaddr *); void print_op (u_int8_t, const char *, const char *); void print_port (u_int8_t, u_int16_t, u_int16_t, const char *, int); void print_ugid (u_int8_t, unsigned, unsigned, const char *, unsigned); diff --git a/sbin/pfctl/pfctl_parser.h b/sbin/pfctl/pfctl_parser.h index 91c0f655e008..b91d37c791ae 100644 --- a/sbin/pfctl/pfctl_parser.h +++ b/sbin/pfctl/pfctl_parser.h @@ -276,6 +276,8 @@ struct pf_opt_rule { TAILQ_HEAD(pf_opt_queue, pf_opt_rule); +void copy_satopfaddr(struct pf_addr *, struct sockaddr *); + int pfctl_rules(int, char *, int, int, char *, struct pfr_buffer *); int pfctl_optimize_ruleset(struct pfctl *, struct pfctl_ruleset *); From nobody Mon Jul 7 15:07:53 2025 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 4bbSKQ1sDcz61w9v; Mon, 07 Jul 2025 15:07:54 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbSKP5CkZz3w8L; Mon, 07 Jul 2025 15:07:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900873; 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=qSWrJ2pDzGoefLNHjJBQ8D8i7YHjVK+R6TQ19OD8fbU=; b=cL6+M+zteeOIp4a59KE6/yZzb8lgGv/CMyk3pCL7R/13oAHi8Rh6XNZkh6VUd5hMkGACtW 0DxX9k/B1XElRtQaVHMnQZmpcKfBuGdI95nziuW3ztGulFlejDYhy3AVGy6nakAWs/QbEq NkQts3kCyqoQLd4lzqPSAyW6qf2hqC/0tBSLGqpL3t9pQWFbN3BfPomUGqiagcC9AZo/35 Vh8aqvdbWy4iKrBcwFs8isxIK/FxUnuDSOLyFpL+BfdDRpT2P8/o8qb7TT6pxWduNKiHbp AMg/dXw/ladzBZjiCVaRhynS5ko4ETjNT5CM2pMIQn1F/9dzFtYaKVFNw57rBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900873; 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=qSWrJ2pDzGoefLNHjJBQ8D8i7YHjVK+R6TQ19OD8fbU=; b=NuEACjibVjI7IBXOC0vaIqkzS70owar/ldkdcQso8LGkfjiohtwcZcHe+u0sAbTMWuR6Ie wtlouEoVfH2Gn9pPlHjr5PA0FGol8e0eqeNjzqliE4kI5D7CBg/EUUO8vgAOdz0+3/UHrI 1b5rbpOT8vFOkWvDgd+7zINzGkGqlthEh4m8t8Qk1aoyn+1e9iT+0kbsres5dfInftEWuN dz52LwObqnC01psJoH4+TEfKexEOZPTpT8aHQNhIaqp/QA3F34FE5hmO/10kigC6HbH7+v U2AL3ncXaBZd2hzsSxu8af/8LXsQDdrIRsL3NF9TtbF1rUlbDdyNGtFhfxO6Kg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751900873; a=rsa-sha256; cv=none; b=Ct1Q+IrjuKV7twGXtMPOXSylpcmpDlv6hqWKNeBLvjHAigWK6yKeOK+6DWL2SQ//AGqX9P yvUddiAiacPuIQp58FIDnC06JhWmdjNLFythgRCu7uSZXEZzg/OGBsFJOO97seoAFt+Fvg FH77aue1dlmu0qoPxpfsbyLrLsjfFPqWM+6teSGxQFuDy6SKOzzaOqzxq+iw68AcQgIhXE /4ch1ZYbCGFqFsoSchWUAKe3+zS/I+Gv/yRjg4532JZONjoX4PC5zQM8IG/CnC+kLfamOg MYuEP1qv3M4I75kFS+qjoyNG41B1x6YYb+hFCk5Mz9Kx5SazRgIvre4pD9LDdw== 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 4bbSKP4llZzwGy; Mon, 07 Jul 2025 15:07:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567F7rgD016552; Mon, 7 Jul 2025 15:07:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567F7rPh016547; Mon, 7 Jul 2025 15:07:53 GMT (envelope-from git) Date: Mon, 7 Jul 2025 15:07:53 GMT Message-Id: <202507071507.567F7rPh016547@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 058422752727 - main - pfctl: Simplify lookups when killing entries 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0584227527271b18fb3164522c0362a5df2f3732 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=0584227527271b18fb3164522c0362a5df2f3732 commit 0584227527271b18fb3164522c0362a5df2f3732 Author: Kristof Provost AuthorDate: 2025-07-02 09:41:58 +0000 Commit: Kristof Provost CommitDate: 2025-07-07 15:06:49 +0000 pfctl: Simplify lookups when killing entries Killing source tracking or state entries by hostname or CIDR would pass given keys twice to getaddrinfo(3): once to resolve/parse and again to parse the numerical address in case a prefix was specified. Avoid this overhead by making pfctl_addrprefix() resolve, pass and mask in one go and return the list of IPs to the callers. This notably simplifies both logic and sanity checks around prefix length and address family. While here, also pass -N along such that -k and -K can be restricted to not use DNS. Discussed with procter sashan, OK sashan Obtained from: OpenBSD, kn , 4a32e6d5fb Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/pfctl.c | 86 +++++++++++++++++++++--------------------------------- 1 file changed, 34 insertions(+), 52 deletions(-) diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c index f133a106c69c..10183084ceec 100644 --- a/sbin/pfctl/pfctl.c +++ b/sbin/pfctl/pfctl.c @@ -77,7 +77,8 @@ void pfctl_flush_nat(int, int, char *); int pfctl_clear_altq(int, int); void pfctl_clear_src_nodes(int, int); void pfctl_clear_iface_states(int, const char *, int); -void pfctl_addrprefix(char *, struct pf_addr *); +struct addrinfo * + pfctl_addrprefix(char *, struct pf_addr *, int); void pfctl_kill_src_nodes(int, int); void pfctl_net_kill_states(int, const char *, int); void pfctl_gateway_kill_states(int, const char *, int); @@ -539,35 +540,36 @@ pfctl_clear_iface_states(int dev, const char *iface, int opts) fprintf(stderr, "%d states cleared\n", killed); } -void -pfctl_addrprefix(char *addr, struct pf_addr *mask) +struct addrinfo * +pfctl_addrprefix(char *addr, struct pf_addr *mask, int numeric) { char *p; const char *errstr; int prefix, ret_ga, q, r; struct addrinfo hints, *res; - if ((p = strchr(addr, '/')) == NULL) - return; - - *p++ = '\0'; - prefix = strtonum(p, 0, 128, &errstr); - if (errstr) - errx(1, "prefix is %s: %s", errstr, p); - bzero(&hints, sizeof(hints)); - /* prefix only with numeric addresses */ - hints.ai_flags |= AI_NUMERICHOST; + hints.ai_socktype = SOCK_DGRAM; /* dummy */ + if (numeric) + hints.ai_flags = AI_NUMERICHOST; + + if ((p = strchr(addr, '/')) != NULL) { + *p++ = '\0'; + /* prefix only with numeric addresses */ + hints.ai_flags |= AI_NUMERICHOST; + } if ((ret_ga = getaddrinfo(addr, NULL, &hints, &res))) { errx(1, "getaddrinfo: %s", gai_strerror(ret_ga)); /* NOTREACHED */ } - if (res->ai_family == AF_INET && prefix > 32) - errx(1, "prefix too long for AF_INET"); - else if (res->ai_family == AF_INET6 && prefix > 128) - errx(1, "prefix too long for AF_INET6"); + if (p == NULL) + return (res); + + prefix = strtonum(p, 0, res->ai_family == AF_INET6 ? 128 : 32, &errstr); + if (errstr) + errx(1, "prefix is %s: %s", errstr, p); q = prefix >> 3; r = prefix & 7; @@ -586,7 +588,8 @@ pfctl_addrprefix(char *addr, struct pf_addr *mask) (0xff00 >> r) & 0xff; break; } - freeaddrinfo(res); + + return (res); } void @@ -596,7 +599,6 @@ pfctl_kill_src_nodes(int dev, int opts) struct addrinfo *res[2], *resp[2]; struct sockaddr last_src, last_dst; int killed, sources, dests; - int ret_ga; killed = sources = dests = 0; @@ -606,12 +608,9 @@ pfctl_kill_src_nodes(int dev, int opts) memset(&last_src, 0xff, sizeof(last_src)); memset(&last_dst, 0xff, sizeof(last_dst)); - pfctl_addrprefix(src_node_kill[0], &psnk.psnk_src.addr.v.a.mask); + res[0] = pfctl_addrprefix(src_node_kill[0], + &psnk.psnk_src.addr.v.a.mask, (opts & PF_OPT_NODNS)); - if ((ret_ga = getaddrinfo(src_node_kill[0], NULL, NULL, &res[0]))) { - errx(1, "getaddrinfo: %s", gai_strerror(ret_ga)); - /* NOTREACHED */ - } for (resp[0] = res[0]; resp[0]; resp[0] = resp[0]->ai_next) { if (resp[0]->ai_addr == NULL) continue; @@ -638,14 +637,9 @@ pfctl_kill_src_nodes(int dev, int opts) memset(&psnk.psnk_dst.addr.v.a.mask, 0xff, sizeof(psnk.psnk_dst.addr.v.a.mask)); memset(&last_dst, 0xff, sizeof(last_dst)); - pfctl_addrprefix(src_node_kill[1], - &psnk.psnk_dst.addr.v.a.mask); - if ((ret_ga = getaddrinfo(src_node_kill[1], NULL, NULL, - &res[1]))) { - errx(1, "getaddrinfo: %s", - gai_strerror(ret_ga)); - /* NOTREACHED */ - } + res[1] = pfctl_addrprefix(src_node_kill[1], + &psnk.psnk_dst.addr.v.a.mask, + (opts & PF_OPT_NODNS)); for (resp[1] = res[1]; resp[1]; resp[1] = resp[1]->ai_next) { if (resp[1]->ai_addr == NULL) @@ -699,7 +693,7 @@ pfctl_net_kill_states(int dev, const char *iface, int opts) struct sockaddr last_src, last_dst; unsigned int newkilled; int killed, sources, dests; - int ret_ga, ret; + int ret; killed = sources = dests = 0; @@ -718,15 +712,12 @@ pfctl_net_kill_states(int dev, const char *iface, int opts) state_killers = 1; } - pfctl_addrprefix(state_kill[0], &kill.src.addr.v.a.mask); + res[0] = pfctl_addrprefix(state_kill[0], + &kill.src.addr.v.a.mask, (opts & PF_OPT_NODNS)); if (opts & PF_OPT_KILLMATCH) kill.kill_match = true; - if ((ret_ga = getaddrinfo(state_kill[0], NULL, NULL, &res[0]))) { - errx(1, "getaddrinfo: %s", gai_strerror(ret_ga)); - /* NOTREACHED */ - } for (resp[0] = res[0]; resp[0]; resp[0] = resp[0]->ai_next) { if (resp[0]->ai_addr == NULL) continue; @@ -753,14 +744,9 @@ pfctl_net_kill_states(int dev, const char *iface, int opts) memset(&kill.dst.addr.v.a.mask, 0xff, sizeof(kill.dst.addr.v.a.mask)); memset(&last_dst, 0xff, sizeof(last_dst)); - pfctl_addrprefix(state_kill[1], - &kill.dst.addr.v.a.mask); - if ((ret_ga = getaddrinfo(state_kill[1], NULL, NULL, - &res[1]))) { - errx(1, "getaddrinfo: %s", - gai_strerror(ret_ga)); - /* NOTREACHED */ - } + res[1] = pfctl_addrprefix(state_kill[1], + &kill.dst.addr.v.a.mask, + (opts & PF_OPT_NODNS)); for (resp[1] = res[1]; resp[1]; resp[1] = resp[1]->ai_next) { if (resp[1]->ai_addr == NULL) @@ -814,7 +800,6 @@ pfctl_gateway_kill_states(int dev, const char *iface, int opts) struct sockaddr last_src; unsigned int newkilled; int killed = 0; - int ret_ga; if (state_killers != 2 || (strlen(state_kill[1]) == 0)) { warnx("no gateway specified"); @@ -832,12 +817,9 @@ pfctl_gateway_kill_states(int dev, const char *iface, int opts) if (opts & PF_OPT_KILLMATCH) kill.kill_match = true; - pfctl_addrprefix(state_kill[1], &kill.rt_addr.addr.v.a.mask); + res = pfctl_addrprefix(state_kill[1], &kill.rt_addr.addr.v.a.mask, + (opts & PF_OPT_NODNS)); - if ((ret_ga = getaddrinfo(state_kill[1], NULL, NULL, &res))) { - errx(1, "getaddrinfo: %s", gai_strerror(ret_ga)); - /* NOTREACHED */ - } for (resp = res; resp; resp = resp->ai_next) { if (resp->ai_addr == NULL) continue; From nobody Mon Jul 7 15:07:54 2025 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 4bbSKR1pZwz61w7Z; Mon, 07 Jul 2025 15:07:55 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbSKQ6Cfxz3wC0; Mon, 07 Jul 2025 15:07:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900874; 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=gzXcuzRfhbhH9BvcIguQeGCVK+LnOPgNZbKSA/rCJ5A=; b=B3Qk0c7FhVuYZRVtrTA1WycrrmGCt1FBR3Exz+fbCm6dCM6CKGZONQVNKBhy1wfwDJLq8B rKITrqsU784l04d2lCu31qnRgaJIa5U6M8SBMXMW2MUjKXbSq/YGO+aeHFaZTOgTT+XfSF ehPbwORMMRUKrVIcwWv409TrJ6nxKY7VidiuqcqjV/5jqWloS2bscHj/CRraRS4vQg8Jo4 IxmpTDdCv3C0+fHHwT9vau4bWeM/O4KVqNbpOWsUPxVCbkuT92StNx7c137TKhGuTK777Y /RVQh/OkZwvHU3VqKzy9seuH5n3UeY77/ESeEsct/aCfzhvVGdix8/p2Vg5tiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900874; 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=gzXcuzRfhbhH9BvcIguQeGCVK+LnOPgNZbKSA/rCJ5A=; b=b+fopA34VGv1Rr6e6Bo92cG8RuB7NlNmvDROjuYqUPWYxGt8zGryry+Y/hczylFBVk4b0X FFBf3Fqr20wpM6P6GL26vHh2VJRJBha+xvfQIDLmOO4H9Yxd4oelfDgHy9muaCIcUorWo3 FRD5c+AQ+BfkQKfgEE5gYNZU+NdMRn5ydh/2RKCKhxxsKa06cAWarbmfGs/r2Q+R59wLWe 96Iraq/09NIPQeWyvqz5whH6sK21cMixIqO7QeC5hDYbeJ6KNzvkj2t41oWc6EpLtA5JNy 3ve4UIMpHoSKZAvfdiPNKEiumIEQbezNz2O0YhcCyP59PlWwthz3eeBf/EVekQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751900874; a=rsa-sha256; cv=none; b=emKVlQRJlkKCLQ5TbE4reME0lcpXj2KKGtwkzfFkBAHqFtx0ZUmJXa3nh3X1dYn/01H38k c0tBkB9NJtoLFdd9bDNPzZQbtWLL3PvY4UhHGQv9L0HvcZVFmG/SBDk4QT9dACBeO0Kq92 //FJCfV819SJZcwQNMqfAN9/gd/anmVcR5mIjEK45StNS+wjupZeLM4VE9WFzmml83F3Ha y3onM3ROKWlvpZzE2XWFyZi0pkbd3ZyhRuO0Bz8upzE9y9jaBNtTiCRAd6Aom2xHy6V8me Qq9wKaFBulWV1VFlZpP8h97RN5cmVueXy4hwrJ30kd7LN1Flh4YUjH2dAxbs0w== 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 4bbSKQ5q2YzvGV; Mon, 07 Jul 2025 15:07:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567F7s5R016586; Mon, 7 Jul 2025 15:07:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567F7s2f016583; Mon, 7 Jul 2025 15:07:54 GMT (envelope-from git) Date: Mon, 7 Jul 2025 15:07:54 GMT Message-Id: <202507071507.567F7s2f016583@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 9d74a1b5d6cf - main - pfctl: Make -N and -r mutually exclusive 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9d74a1b5d6cfde02d27786c59ccafafdf6d6fe63 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=9d74a1b5d6cfde02d27786c59ccafafdf6d6fe63 commit 9d74a1b5d6cfde02d27786c59ccafafdf6d6fe63 Author: Kristof Provost AuthorDate: 2025-07-02 09:43:43 +0000 Commit: Kristof Provost CommitDate: 2025-07-07 15:06:49 +0000 pfctl: Make -N and -r mutually exclusive Either disable DNS or enable additional reverse lookups, but not both. OK benno Obtained from: OpenBSD, kn , b294e41e93 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/pfctl.8 | 6 +++++- sbin/pfctl/pfctl.c | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/sbin/pfctl/pfctl.8 b/sbin/pfctl/pfctl.8 index 85294dda949f..0c4a7b519bf6 100644 --- a/sbin/pfctl/pfctl.8 +++ b/sbin/pfctl/pfctl.8 @@ -24,7 +24,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd July 1, 2025 +.Dd July 2, 2025 .Dt PFCTL 8 .Os .Sh NAME @@ -402,6 +402,10 @@ Load only the filter rules present in the rule file. Other rules and options are ignored. .It Fl r Perform reverse DNS lookups on states and tables when displaying them. +.Fl N +and +.Fl r +are mutually exclusive. .It Fl s Ar modifier Show the filter parameters specified by .Ar modifier diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c index 10183084ceec..d3614f5f7c59 100644 --- a/sbin/pfctl/pfctl.c +++ b/sbin/pfctl/pfctl.c @@ -3156,6 +3156,9 @@ main(int argc, char *argv[]) } } + if ((opts & PF_OPT_NODNS) && (opts & PF_OPT_USEDNS)) + errx(1, "-N and -r are mutually exclusive"); + if (tblcmdopt == NULL ^ tableopt == NULL) usage(); From nobody Mon Jul 7 15:07:58 2025 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 4bbSKV5FkWz61w7p; Mon, 07 Jul 2025 15:07:58 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbSKV2JZPz3wSZ; Mon, 07 Jul 2025 15:07:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900878; 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=El/r1HmkFS79yioilUWO/nZfmF1H7hrfSwegbcPDQWY=; b=Xkk7YCNyPENfifTqBGhgFTPDXxaM/4uxVzBVZPR8jN7PcifPDSHJon1vcYtvPoroNe1aO4 rY+XTTZt9db9HwDj2MtQVhYjW1VVLCf4hWyrhROoRBRgdLIs0y7iI/4zpuIOjc6X/HH7qr vOB/q59knkcGwTTvd7gtOvE5HP4xEfRGvYTGYoBic1o0yDJ+qPG2f9uhCWo8OYpJ9GzGH6 36bxFv5KNua3UPRR+YByZxe2fJqY63qDWEzP1PqYuMRazJ7RN5z+vxSm0qusc9cOf7PiBX LT5i5PI45+hADUfG7jx71MLfkOJjCGZ0ab1FVCj3ceMO14vGTNvWem/tx2mqWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900878; 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=El/r1HmkFS79yioilUWO/nZfmF1H7hrfSwegbcPDQWY=; b=mHEIAbK+H7L79w7i0KWps37dGYOJq1IOkvE4WJ2Ba+K7KIn7Y7lGVU5IkPZ9nLq4aCfBc3 DJawTPIFtFed+Wgjv+j+TOuILdOSm39YNPQ4tdev7K7+PHNqyMzRrvshDl0Kl11CJ0erRt frxC1JYQLzxzG7Tq90wKDgZ4mr9f6pG/M6eimOaZbDNTDbBz0wZyU2/DxwfbK/n5WKXE+Z wb7xFBbnk3YG46qzPWIRfsY8mTi84tws6qqkVFq5feF+5lK2qjiMvwwOGZmYRUiyZMD3MB InsRNKIS/qkll92npZskw8dxHWdkO5dGVbViD0EyrLK1RwG9MmUc2OolhW1zXg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751900878; a=rsa-sha256; cv=none; b=gvefMn831HNp/4Xe+30jbb5wf+RYG1u0x6j/TI50NImq7B1BaKzzGFmO4TeeCy5HX8ivUP YK6xHWNVGrdzA12959dN/mY/in4DoOdm2gjmt8+nbNI07spBLOm4Gv0M157HlBld2cdlcv hycYqS3FbipyqVgASsQqRPFxlTXlMWRdjh8vo6HXPbCyHHx6BgUwIlIDT13T76iZeLs13a gbakIcyhv7QnLmaHIxn8OobLzVuv3LruECpavwKuEEP+ofcXA0JigY0AQEmbzfJ6uId+ZU /2EQD/Dp26PNv6Bz4IqccI6pI1dVu91G/sYEoKFQP6YT98FGbUVDY+lAe7aCRw== 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 4bbSKV1WWszwF5; Mon, 07 Jul 2025 15:07:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567F7wPZ016696; Mon, 7 Jul 2025 15:07:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567F7wJm016693; Mon, 7 Jul 2025 15:07:58 GMT (envelope-from git) Date: Mon, 7 Jul 2025 15:07:58 GMT Message-Id: <202507071507.567F7wJm016693@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: f33973f53607 - main - pfctl: Anchor names must not be empty 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f33973f5360792835c82b3a164e0d043e8656a4a Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=f33973f5360792835c82b3a164e0d043e8656a4a commit f33973f5360792835c82b3a164e0d043e8656a4a Author: Kristof Provost AuthorDate: 2025-07-02 13:00:49 +0000 Commit: Kristof Provost CommitDate: 2025-07-07 15:06:50 +0000 pfctl: Anchor names must not be empty The parser would allow bogus input and sometimes even produce invalid rules on empty anchor names, so error out immediately. OK sashan Obtained from: OpenBSD, kn , 85af6f4b29 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/parse.y | 5 +++++ sbin/pfctl/pfctl.c | 2 ++ 2 files changed, 7 insertions(+) diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index 2ebd528443fe..5c6102db3b55 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -922,6 +922,11 @@ varset : STRING '=' varstring { ; anchorname : STRING { + if ($1[0] == '\0') { + free($1); + yyerror("anchor name must not be empty"); + YYERROR; + } if (strlen(pf->anchor->path) + 1 + strlen($1) >= PATH_MAX) { free($1); diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c index e490e933db5f..0fb0602eb04f 100644 --- a/sbin/pfctl/pfctl.c +++ b/sbin/pfctl/pfctl.c @@ -3129,6 +3129,8 @@ main(int argc, char *argv[]) if (anchoropt != NULL) { int len = strlen(anchoropt); + if (anchoropt[0] == '\0') + errx(1, "anchor name must not be empty"); if (mode == O_RDONLY && showopt == NULL && tblcmdopt == NULL) { warnx("anchors apply to -f, -F, -s, and -T only"); usage(); From nobody Mon Jul 7 15:07:56 2025 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 4bbSKT2t4Bz61w2w; Mon, 07 Jul 2025 15:07: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbSKT10rpz3wRD; Mon, 07 Jul 2025 15:07:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900877; 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=Z5bWVioByw1YT4oHJkU0BxiqCnbFKg3G5hanlGCh0uI=; b=sC0RGJboGrR71ZeeF5MglwTws8c52bUqU8JtIv0uyPtSrv0AlFx9F9yIFlWwHK1gkjehF7 dT0KUF6JcUyKWaBrQxR+yafosp4Rrz/GYZXB5FAcH36YA/PwBPNz0nt964iO4BUnS+NM7A v3s8gR9aL2jUj9D+XfOk27TeGXoHL2e+9yUUNf/mhqcQqem1Pv2jIVYbc9foEH+OSFheDR R3xfAHwMSTED2uX5W2io3/MbutN0RK7oUvJqGLiJ+6jPmEbCT0edUJKNycEs2+HT5mRIFt EdU9GutRnCEu0ChpVieIeiM99+VSZrXg72KRFCTDTIY8U0S6xqIm6sRXKnB75A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900877; 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=Z5bWVioByw1YT4oHJkU0BxiqCnbFKg3G5hanlGCh0uI=; b=btt5pgMREkYAZ+qyZHToug9umKPy8/AFKRLL/kcC+23PGf0XPQ1Sh2jsP9udCPEJm8zx9Y EkZ/ShWmr/WqzSZPpD+GFhIf/aTnW6CovXmeV8Miy/QFN9prxHN36VTO/ABy9bkN538Lqv /pfRoBRTwkNQcRiyj8XpnapqZsUuIQxDtqiRG5JnqHwPUOD8FWtvxMS7PNcFLtbqfUivEK X/XMrHk+caDEpitjWEUgp+f+MlZ7Af6BJJnaCufdyhyes7YiLrZpyu7meSqpqt0Qup0o3d zF0XgRVgZo9r9dWYlAycYnPyAKVEt7gy3lmJ+XARZjxOEuTaX/1GR0FFEPD1bA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751900877; a=rsa-sha256; cv=none; b=VQ0q8C8dj4tx8ognvcZYl9Rclie9CFUq0qiS8sz8UCMl7hRfeHBEx06GTQWc1htmpCShGb 8MEZIttLFfS0EydbPKEoz9yvJwbSNi1lnPuXTgR8J/L1OTjuWCZdST+ZZwBAKvUn7/KE1j bClcZjaJuMT794gYGDL7JNEwlIwE5hRhi8sl5VFH/Uf5qjKuRZzPqRX3S3w6ixvje2/TRN tk4SBN7anpcS7TCLBloGjDy6gw5qHgrwsOcs1ENa8HdDDz1SE0T20CcsWZ4aq/c0QWl3GB aYWwNOd7Z3JydEu29eqGhKLpKUAHspwsY+UAiDRu/lxBEfbynwjssUrS3LyDCQ== 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 4bbSKT0ZxqzwF4; Mon, 07 Jul 2025 15:07:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567F7usL016662; Mon, 7 Jul 2025 15:07:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567F7uri016659; Mon, 7 Jul 2025 15:07:56 GMT (envelope-from git) Date: Mon, 7 Jul 2025 15:07:56 GMT Message-Id: <202507071507.567F7uri016659@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 7ea14ad4db6b - main - pfctl: Unify anchor name sanity checks 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7ea14ad4db6bd840c05eaa8b4ebb941c983a9424 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=7ea14ad4db6bd840c05eaa8b4ebb941c983a9424 commit 7ea14ad4db6bd840c05eaa8b4ebb941c983a9424 Author: Kristof Provost AuthorDate: 2025-07-02 12:46:51 +0000 Commit: Kristof Provost CommitDate: 2025-07-07 15:06:50 +0000 pfctl: Unify anchor name sanity checks For anchor names, make `load anchor' use the same grammar as `anchor' and merge unique checks from both places so that anchor names are validated regardless of the specific rule at hand. OK sashan Obtained from: OpenBSD, kn , 0f06db3497 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/parse.y | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index 0b98bd357a37..2ebd528443fe 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -921,7 +921,22 @@ varset : STRING '=' varstring { } ; -anchorname : STRING { $$ = $1; } +anchorname : STRING { + if (strlen(pf->anchor->path) + 1 + + strlen($1) >= PATH_MAX) { + free($1); + yyerror("anchor name is longer than %u", + PATH_MAX - 1); + YYERROR; + } + if ($1[0] == '_' || strstr($1, "/_") != NULL) { + free($1); + yyerror("anchor names beginning with '_' " + "are reserved for internal use"); + YYERROR; + } + $$ = $1; + } | /* empty */ { $$ = NULL; } ; @@ -974,13 +989,6 @@ anchorrule : ANCHOR anchorname dir quick interface af proto fromto YYERROR; } - if ($2 && ($2[0] == '_' || strstr($2, "/_") != NULL)) { - free($2); - yyerror("anchor names beginning with '_' " - "are reserved for internal use"); - YYERROR; - } - pfctl_init_rule(&r); if (pf->astack[pf->asd + 1]) { @@ -1162,14 +1170,11 @@ anchorrule : ANCHOR anchorname dir quick interface af proto fromto } ; -loadrule : LOAD ANCHOR string FROM string { +loadrule : LOAD ANCHOR anchorname FROM string { struct loadanchors *loadanchor; - if (strlen(pf->anchor->path) + 1 + - strlen($3) >= MAXPATHLEN) { - yyerror("anchorname %s too long, max %u\n", - $3, MAXPATHLEN - 1); - free($3); + if ($3 == NULL) { + yyerror("anchor name is missing"); YYERROR; } loadanchor = calloc(1, sizeof(struct loadanchors)); From nobody Mon Jul 7 15:08:00 2025 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 4bbSKY2HqRz61w7r; Mon, 07 Jul 2025 15:08:01 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbSKX4C09z3wRk; Mon, 07 Jul 2025 15:08:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900880; 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=0EnFP5OEFUt7YkhZO1P/b7Qa3J0jpxaxVrFYQLuux/Q=; b=wR9/u04XL7YhnSf/naNmcAaeDVuWTRqcu7Ay0KNAS5AuZjSGWbfAZNRVqQVqzJFEy9Xzqi bjjCRumTrKid11zq51QE8rGlgOpbdkk4GuEfQPUhOaAep8tUUcbRXqeQeTE6meVvjrG2wu 7axvzIQ/6YFcuu1WXU/PhkX9sLexYO/spdkMP73GPJ0FutioSDb57pXeoGHTo8emK+BKBs nfR5pic9/no3A1TRjsS+AdDe42Yw6gFGQGTP8favYFgR7hLWYtpRz7tdx18HH+4g6s22nW jEfqOrctDIicRwXEYS3Q87kVyehKOe5faZSS0Q9MGtRqHoNlD4bTdY0uoNOTvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900880; 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=0EnFP5OEFUt7YkhZO1P/b7Qa3J0jpxaxVrFYQLuux/Q=; b=dB9UV7A2fZLOTpCNDh4y35sefWiDB30dgU4mq+dCzFDyWGtbu06p4l8R5jx+GeMOQdtpfl jTNV4eJU03DHQy4c1boztxZPx6QLQh3CTeLx8xXTguh84JZol5TmsjkVpI6w8MmSmtWSNb x0vmKyCkKqsXQ2BKwRQJ0g3yn4IvkL8/5GXu2IeqjxzMf17ojTM7Dw2NhZRKlSjgOh2+WJ 9YjkR6aZgAiE2bNaanf1NqRVFsXRdHCK3JUabiVQnPVOCDkwXGOGoj7vcxXbuhc73Brlf5 nEp1q6L6Kp9YVU8MYB5cZhT8y3zKI3k3pY/VPrBVeNiX/QxtZzoJQUuTocssBA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751900880; a=rsa-sha256; cv=none; b=l6Wki9LzQt9DGIfJY5jTQYlQ89WrH388d+Zm1mUTuH4oTyaJQx9SlLfSyBH4fUZGqpZHlV TGO5tdG4uxBv9Z5I9rDHQEfgnKlNk4gIWzHMh/FNdT09d8DQ1+2wsGLFAvv/Vfn7btCuZN my8GYEG8mMLrgX4oXxpcYorRsJerPdbkz4GvrvEp9nH8BK1IFGvbgAU6y2tro7tjeJx17q 1EdJsnqOZIFqlDGqNWoNe8tuN7IEWqkUqq1IPXyJ4OB2AgH8D/mZqKxKFr93TUeOC0AzK/ 0ehLKhg/a1EPh+AQCkA05fPlAyI5DUynM7Tr8/zfVoIkIqjUzpgXilsWyAjwRg== 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 4bbSKX37PjzwNy; Mon, 07 Jul 2025 15:08:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567F80KP016771; Mon, 7 Jul 2025 15:08:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567F80uM016768; Mon, 7 Jul 2025 15:08:00 GMT (envelope-from git) Date: Mon, 7 Jul 2025 15:08:00 GMT Message-Id: <202507071508.567F80uM016768@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: beb3c25d42a8 - main - pfctl: Fail on invalid netmasks when filling tables 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: beb3c25d42a885f58f77dd36e1a31199c79fbd82 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=beb3c25d42a885f58f77dd36e1a31199c79fbd82 commit beb3c25d42a885f58f77dd36e1a31199c79fbd82 Author: Kristof Provost AuthorDate: 2025-07-02 13:18:20 +0000 Commit: Kristof Provost CommitDate: 2025-07-07 15:06:50 +0000 pfctl: Fail on invalid netmasks when filling tables Fix a regression of revision 1.326 "Zap v4mask and v6mask in host()" which allowed CIDR networks with more than one "/" to be loaded into tables. I took care of this code path with regard to rules coming the ruleset parser, which aborts earlier on such invalid specifications, but missed `-T add 1/2/3' and the like. Analyzed and fixed by Petr Hoffmann , thanks! OK deraadt Obtained from: OpenBSD, kn , dfaca1426d Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/pfctl_parser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/pfctl/pfctl_parser.c b/sbin/pfctl/pfctl_parser.c index a213487fb648..26a213c3ffd9 100644 --- a/sbin/pfctl/pfctl_parser.c +++ b/sbin/pfctl/pfctl_parser.c @@ -1794,7 +1794,7 @@ host(const char *s, int opts) char *p, *ps; const char *errstr; - if ((p = strrchr(s, '/')) != NULL) { + if ((p = strchr(s, '/')) != NULL) { mask = strtonum(p+1, 0, 128, &errstr); if (errstr) { fprintf(stderr, "netmask is %s: %s\n", errstr, p); From nobody Mon Jul 7 15:07:59 2025 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 4bbSKW5cQ7z61wB2; Mon, 07 Jul 2025 15:07:59 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbSKW37mfz3wYS; Mon, 07 Jul 2025 15:07:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900879; 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=LuZDUmFocXmvScTnCq26kzQESGMJQDJT1zrHOxhC/E8=; b=xwlhgyM0ouMDbUVa2FvrQGQmh4muQ/aEYBQqXq90lkr7/7sinARgRuPd1CEkNajLRUKMRy +nOK/wzQY6bZ+3JBQkcV04Jd8WvrnzzheMflc+GKv+B94aERqITPTOR9eR0jIFKkYfBscf HsFQv7QhSdI1UN6D6b5Y3Q0299ftuIciDkEF9ebgNEhfR3l4f3jR27gc2otJ9RSlONzccZ 3atZZ2MRR+ieIuORHBd1XTCkInC2fgNMGrS+lLzX8aj+K+X6rVGs591nWvZbq3m4DGHve8 unS+T4V1fKgf7ov81FaNF9OaEC0HF9LLE6EByZq/bFGw8XNH96T3amv3uT+TiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900879; 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=LuZDUmFocXmvScTnCq26kzQESGMJQDJT1zrHOxhC/E8=; b=NYk5Ses3CF7plrLZlGABe0PfqH6oPcF8oKyVYLsxNdvnJqCa7nrL37Mt41A2Q0PEYoG/g0 dxxeKEdx77+IMRBKhpDJEt+6nG06HIVm5dtWy8riIFnqs+fO9lwp9OF1ZbuH+gImR3tnA4 YX40XB+TGYPQI9BSmgtoaCRPckuIi8L8IOjA6sKg0z4Hd6+BJX1u4ZB9FlJ0Elq65HiGx1 bDZa6J5YSW8PBa0Ipk0EKe33NWzJH9iVn9i6y6r2P7IAAONU+l9pM7jnJWvYyjKY5UqhyQ fmOqQhBkf3Qz4gGpOIvi9aljXmSg+bGIrfWRrG0ghDKApWPKwRkHonTp2zJ1rg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751900879; a=rsa-sha256; cv=none; b=W42Q3S4BPJKIqGbMXlA51/XyCCmdp+YWv9X5XMnLPfxpBMSQiWNjWx0Pf6AKbmpkLRtszq 3EIaUf128SUTzQG062HY5QqxNWiz931A8QLpvedwNXyrPVxL3G/w3G+eM9oHnzlRJhTffb xxPcvrl5t+4skAvRXrrHtr+cW9JD5o/cfmMtGHDHUaKyj2EXCcNdv5+vSoVemKgQ4iGDpd Ceufb9YWXmvP6CROURxTL6LTLaJmDW+OBF3Dosq7JC8pVORJvA5PtTv2v0mxeoTAqntVH5 0e/RoNu7il8+l7hqXM214uvwR1JDTC7EN69v7uG+rXfk6H/+esjKSAW3APsbFQ== 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 4bbSKW2C0czwNx; Mon, 07 Jul 2025 15:07:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567F7xrc016731; Mon, 7 Jul 2025 15:07:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567F7xP6016728; Mon, 7 Jul 2025 15:07:59 GMT (envelope-from git) Date: Mon, 7 Jul 2025 15:07:59 GMT Message-Id: <202507071507.567F7xP6016728@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 6bbee85e48f6 - main - pfctl: Don't use unsigned for ptrdiff_t 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6bbee85e48f6829e23cbb85b3de385244c6f0df0 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=6bbee85e48f6829e23cbb85b3de385244c6f0df0 commit 6bbee85e48f6829e23cbb85b3de385244c6f0df0 Author: Kristof Provost AuthorDate: 2025-07-02 13:02:33 +0000 Commit: Kristof Provost CommitDate: 2025-07-07 15:06:50 +0000 pfctl: Don't use unsigned for ptrdiff_t (unsigned) means (unsigned int) which on ptrdiff_t or size_t or other larger types really is a range reduction... Almost any cast to (unsigned) is a bug. ok millert tb benno Obtained from: OpenBSD, deraadt , 915c3f33d3 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/parse.y | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index 5c6102db3b55..ca3ca28475d7 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -6929,7 +6929,7 @@ top: if (c == '-' || isdigit(c)) { do { *p++ = c; - if ((unsigned)(p-buf) >= sizeof(buf)) { + if ((size_t)(p-buf) >= sizeof(buf)) { yyerror("string too long"); return (findeol()); } @@ -6968,7 +6968,7 @@ nodigits: if (isalnum(c) || c == ':' || c == '_') { do { *p++ = c; - if ((unsigned)(p-buf) >= sizeof(buf)) { + if ((size_t)(p-buf) >= sizeof(buf)) { yyerror("string too long"); return (findeol()); } From nobody Mon Jul 7 15:08:01 2025 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 4bbSKZ0jL0z61w7w; Mon, 07 Jul 2025 15:08:02 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbSKY4p5Qz3wS1; Mon, 07 Jul 2025 15:08:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900881; 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=i/7GYpb18p1tzEcfSX4ujATb1DFRV/IBmGtCBfiFg28=; b=dgmPcoiSobJ5ulajWQAxrBXSGpp4Qof4u7D98gNayMLCesw8bKlyCLjeTwCS0iElbTqWGA yCMDr8IIF89EFQT8iuhcxe3DlwYm5ZR8VK5IAbmeFrUif4pfJ7bDgJHqj1GExU3nHMVpzC xty57V/D3I6DLkhSijgi61JrjB6QD8Tpdi6sTudbD8FVmKtpm3pJ2d7BWriDhQe9RsKiGf N0UJh5ePl/frqhGe2ZNYByVWubo0bzF3/ELKSmS7To0ythEyhLXY9SK9sPuyMhu3TbWG7m ZGYuOj4H+VuOzTV96bi5OnfKVcicll1ExvRXtelGT8cmFghs9oa/no+Cs3Q86Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900881; 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=i/7GYpb18p1tzEcfSX4ujATb1DFRV/IBmGtCBfiFg28=; b=SapDwsuRrYA22fUdsquJOg0mETo5pXb9ICToPJgZ0UrvPReS6AidecuIkcomP2x5PlegIl McIBIQY3n1OL2B5sn6JvLiM5gsiF9P1Mc5fRPVI2b/OWQPJdS6vzEz59K9wLRllMfj4CWv MFmBz11zvQxnDxq+WvpD1wL7S6UKflJSvnhBKLZG5F+LQ4p5xvcvMLeOB1pz1usyFSHmDX th13QzNFuEr7V3EeNtamb5xzjSk1wwwSuuZ9b26FBm6TlpviCqbFcp+DTdsZWRwFMTdl/y zr5w48v2k15bPzSDeKovWzun+76R2qWl1QHSRy0DJPJfsRZJ8ON7dceDwdnS3g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751900881; a=rsa-sha256; cv=none; b=o5d31ucFfU5FXejhHNf+a3bHklBceQ77vln7ix3kYhJWv9oV0Mal1ksLGJsx2hbsS0tazV 23YudwMg/nBlf7b7lCv+E5UEeg6zUBpMppKBSDNLum6wOZhkj9DfMNYBbO+UuzqYhGNQOK 7FxhhdhbaQ7JdeHD15Sv+C4nhcAbqfS4mna9yypd+06oEK3XqeGjqXoyYu0BDliQm55IHM SJA0mNRJRQ6exv7rTs5l8QZzddhXdzgHSTik90+1MLwQbOb46neqQ8TK3kpddnCwPkhyi8 HtwisBSGrOrlHdIWfcsipNqUtYrTNLkYVOUWcjHmP/HkQgmI80aYz3ihCYFw1A== 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 4bbSKY4PdkzwH0; Mon, 07 Jul 2025 15:08:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567F81DK016813; Mon, 7 Jul 2025 15:08:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567F81NN016810; Mon, 7 Jul 2025 15:08:01 GMT (envelope-from git) Date: Mon, 7 Jul 2025 15:08:01 GMT Message-Id: <202507071508.567F81NN016810@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 613a144a4b78 - main - pfctl: introduce 'pfctl -FR' to reset settings to defaults 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 613a144a4b7819f2ac9619d3ae85dd4db08aac59 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=613a144a4b7819f2ac9619d3ae85dd4db08aac59 commit 613a144a4b7819f2ac9619d3ae85dd4db08aac59 Author: Kristof Provost AuthorDate: 2025-07-02 14:47:43 +0000 Commit: Kristof Provost CommitDate: 2025-07-07 15:06:51 +0000 pfctl: introduce 'pfctl -FR' to reset settings to defaults (discussed with many at tech@) OK deraadt@, kn@, sthen@, tedu@ Obtained from: OpenBSD, sashan , 22f3d0383c Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/pfctl.8 | 2 ++ sbin/pfctl/pfctl.c | 47 +++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 47 insertions(+), 2 deletions(-) diff --git a/sbin/pfctl/pfctl.8 b/sbin/pfctl/pfctl.8 index 0c4a7b519bf6..2391c1d1cd12 100644 --- a/sbin/pfctl/pfctl.8 +++ b/sbin/pfctl/pfctl.8 @@ -223,6 +223,8 @@ Flush the filter information (statistics that are not bound to rules). Flush the tables. .It Fl F Cm osfp Flush the passive operating system fingerprints. +.It Fl F Cm Reset +Reset limits, timeouts and options back to default settings. .It Fl F Cm all Flush all of the above. .El diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c index 0fb0602eb04f..8c20c8250ed1 100644 --- a/sbin/pfctl/pfctl.c +++ b/sbin/pfctl/pfctl.c @@ -123,6 +123,7 @@ int pfctl_load_ruleset(struct pfctl *, char *, struct pfctl_ruleset *, int, int); int pfctl_load_rule(struct pfctl *, char *, struct pfctl_rule *, int); const char *pfctl_lookup_option(char *, const char * const *); +void pfctl_reset(int, int); static struct pfctl_anchor_global pf_anchors; struct pfctl_anchor pf_main_anchor; @@ -231,7 +232,7 @@ static const struct { static const char * const clearopt_list[] = { "nat", "queue", "rules", "Sources", "states", "info", "Tables", "osfp", "all", - "ethernet", NULL + "ethernet", "Reset", NULL }; static const char * const showopt_list[] = { @@ -2947,6 +2948,45 @@ pfctl_lookup_option(char *cmd, const char * const *list) return (NULL); } +void +pfctl_reset(int dev, int opts) +{ + struct pfctl pf; + struct pfr_buffer t; + int i; + + pf.dev = dev; + pf.h = pfh; + pfctl_init_options(&pf); + + /* Force reset upon pfctl_load_options() */ + pf.debug_set = 1; + pf.reass_set = 1; + pf.syncookieswat_set = 1; + pf.ifname = strdup("none"); + if (pf.ifname == NULL) + err(1, "%s: strdup", __func__); + pf.ifname_set = 1; + + memset(&t, 0, sizeof(t)); + t.pfrb_type = PFRB_TRANS; + if (pfctl_trans(dev, &t, DIOCXBEGIN, 0)) + err(1, "%s: DIOCXBEGIN", __func__); + + for (i = 0; pf_limits[i].name; i++) + pf.limit_set[pf_limits[i].index] = 1; + + for (i = 0; pf_timeouts[i].name; i++) + pf.timeout_set[pf_timeouts[i].timeout] = 1; + + pfctl_load_options(&pf); + + if (pfctl_trans(dev, &t, DIOCXCOMMIT, 0)) + err(1, "%s: DIOCXCOMMIT", __func__); + + pfctl_clear_interface_flags(dev, opts); +} + int main(int argc, char *argv[]) { @@ -3314,7 +3354,7 @@ main(int argc, char *argv[]) pfctl_clear_src_nodes(dev, opts); pfctl_clear_stats(pfh, opts); pfctl_clear_fingerprints(dev, opts); - pfctl_clear_interface_flags(dev, opts); + pfctl_reset(dev, opts); } break; case 'o': @@ -3323,6 +3363,9 @@ main(int argc, char *argv[]) case 'T': pfctl_do_clear_tables(anchorname, opts); break; + case 'R': + pfctl_reset(dev, opts); + break; } } if (state_killers) { From nobody Mon Jul 7 15:08:02 2025 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 4bbSKb5cWNz61wLn; Mon, 07 Jul 2025 15:08:03 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbSKZ5cBRz3wfj; Mon, 07 Jul 2025 15:08:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900882; 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=EvjGQMKSjvVaqUf3MDIifr2EfwFi+wuQWKuEflmFx3k=; b=huVuN/I5LRFI6FILceTE1BXbrZfmofYC5u+z4ZDZkr70vjNd7sP4Q/qzEvS/fR8NlfKW6t AcM+sqVwa/BW4dsMyri6h9wjJ5HwkeYzx5vUxNlVq26MBNTpfGQ9F5vd4jgnYBMe3NWBdn Yt8zsa0P1f6ws9NG4JomMjETAcDse1WmJMVLqq7BrTJNE/fZvi0eQZFAt5Vy4DovBvXU7w yhz7SDNkXmr0rIposGm8Ym55xo9AeE7SdnYynDfdDT1RRYWxcY4/KdQjRaH+pCmLKe90Tu vWBd39rmB7hif8c/l/6rltcKP2LBTm4RbargDYvz2mGIpeetu7Vwdc7U3wY42g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900882; 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=EvjGQMKSjvVaqUf3MDIifr2EfwFi+wuQWKuEflmFx3k=; b=ppwBI8oWFSzN2TTTA5ExLvehH8/BSRCWslixP5rVnw8hKnXd3tL7q4z3c7+7fS40s6+yxx GAJ2CKa1xD/clj3NryDUJleEOonTzv0HgO833FFlPsyGE436a8boLsTVPDVLRz0ppNGPjq swX+avNCbNTrV4yyDzG13uma9Ow8V24uYnPrYleIB63gRUGLKY1NUw+5tRl2PzsH/Y0Ktl v5ECYkLQXVjl7nUqcPDMaaf8fyaNsmz58qoeXEBDXeVUVC4kCHYgSjPbvT5UWnn793CdYu epLBxp6fGE8/pQ+7umJMWVJ8dvrp98qp3Lr8MCoZ6pwFyAMPPwmoSTcuXbXhqQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751900882; a=rsa-sha256; cv=none; b=m/ZzIDTMKls58SjCeNodpzdvFMPjnW37QiciuIVnKfZKj75l7N7BRghaTYc0C6u3db1aws QTLNTnxkjal1Ox2XvGk77uaW35AoCPn3qLncImwuvlJzdeMBTPEhGOy8E3xbYo9AKbd2Hl 644J7fmqHEKMQBRDBa/lHYX8h1y8hds8vPczHgaL1Ktt9vlOo6nW+Kd8cgQREQXgKD/RC4 h7UBUDSpS21qQxw1yVyBJOuMFTKLthw1YOLX64InbaLUEahs20YvirjxDT/b1TTncLO+cD 318eKc4JNW8/u+7nVoBku1DH4zbocmIO7USe0CD2Vy7Y+YPNwf4rDhgW+xU7jg== 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 4bbSKZ58VRzvGW; Mon, 07 Jul 2025 15:08:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567F82Mq016848; Mon, 7 Jul 2025 15:08:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567F82SD016845; Mon, 7 Jul 2025 15:08:02 GMT (envelope-from git) Date: Mon, 7 Jul 2025 15:08:02 GMT Message-Id: <202507071508.567F82SD016845@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 95d1b98db164 - main - pf tests: verify the new reset functionality 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 95d1b98db164f1e99622b2425cf39d96ddab44bc Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=95d1b98db164f1e99622b2425cf39d96ddab44bc commit 95d1b98db164f1e99622b2425cf39d96ddab44bc Author: Kristof Provost AuthorDate: 2025-07-02 15:00:16 +0000 Commit: Kristof Provost CommitDate: 2025-07-07 15:06:51 +0000 pf tests: verify the new reset functionality We can now reset state limit, debug level and others. Verify reset for at least some of these. Sponsored by: Rubicon Communications, LLC ("Netgate") --- tests/sys/netpfil/pf/debug.sh | 50 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/tests/sys/netpfil/pf/debug.sh b/tests/sys/netpfil/pf/debug.sh index 18a7febfbb5b..404d37ab8932 100644 --- a/tests/sys/netpfil/pf/debug.sh +++ b/tests/sys/netpfil/pf/debug.sh @@ -50,7 +50,57 @@ basic_cleanup() pft_cleanup } +atf_test_case "reset" "cleanup" +reset_head() +{ + atf_set descr 'Test resetting debug level' + atf_set require.user root +} + +reset_body() +{ + pft_init + + vnet_mkjail debug + + # Default is Urgent + atf_check -s exit:0 -o match:'Debug: Urgent' \ + jexec debug pfctl -sa + state_limit=$(jexec debug pfctl -sa | grep 'states.*hard limit' | awk '{ print $4; }') + + # Change defaults + pft_set_rules debug \ + "set limit states 42" + atf_check -s exit:0 -e ignore \ + jexec debug pfctl -x loud + + atf_check -s exit:0 -o match:'Debug: Loud' \ + jexec debug pfctl -sa + new_state_limit=$(jexec debug pfctl -sa | grep 'states.*hard limit' | awk '{ print $4; }') + if [ $state_limit -eq $new_state_limit ]; then + jexec debug pfctl -sa + atf_fail "Failed to change state limit" + fi + + # Reset + atf_check -s exit:0 -o ignore -e ignore \ + jexec debug pfctl -FR + atf_check -s exit:0 -o match:'Debug: Urgent' \ + jexec debug pfctl -sa + new_state_limit=$(jexec debug pfctl -sa | grep 'states.*hard limit' | awk '{ print $4; }') + if [ $state_limit -ne $new_state_limit ]; then + jexec debug pfctl -sa + atf_fail "Failed to reset state limit" + fi +} + +reset_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "basic" + atf_add_test_case "reset" } From nobody Mon Jul 7 15:08:03 2025 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 4bbSKc47dVz61w6C; Mon, 07 Jul 2025 15:08:04 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbSKb6JZqz3wcS; Mon, 07 Jul 2025 15:08:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900883; 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=EtI4rkoJDkFzQx2ztLlxN7tpSprf69SjBCWEa/g7yzU=; b=haI2wqmMi2cyMKOTnVj+p/vWqqieZh0wOpDGKKaKh9uo25t1m6Iri678gR8IrCYWKXO/Fy 2KtsgYQr2sUmNMUJW8Uu1ihSsVKf/IOB/BEOb8ZewChJR72YhZblf78NEyVbi1coLTuDaS SMOfkyI5KLxqgcrY9qUkbvHhx5WUhsXphXA9rvprjbK2xAjQqpPcNv+ro227I2051WjBrN OhigSvPoyB3pd8sTI/zmi/a3479vE2NI4GukO+iZJn5la0I2voZS9DWdAXofOpjHo84dWk ae8HRxNbNIGvWL3a88xGQvxa71u+XAqw2/qcD6NZ6OFGakhwEE5brwL8uYAGdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900883; 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=EtI4rkoJDkFzQx2ztLlxN7tpSprf69SjBCWEa/g7yzU=; b=nmxI0xe6YcsKd6aWXvBxX3pQ29MOoLp/gYjyTN0FuhZDsMHykgKIRClwA9wmQwZ52MQ4bk MgahlsXw2krihhcmyVEdsEgeO7zWG9Ffkafy7AjQGPD9Mgk9yBxpBW1ifBmA/bbf3DHYm3 K5ZF1H+15ct80IyuzipYL3YvAnjJPgJ5CLi7Nxr/TrD+z7lH3rbx55DeDaUdcWA15NYITC 9EQRINwEYJBUUXOURvZlzi/NyKiWJYFMfaCymewAigNPRMdENh8qCAca9H8brRIB3U1j5B O0nHaHHmvlevVPz/h594hzYbOfc9U1l/9seogXhnYkGTthgYyhGOyh0ycSbGWg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751900883; a=rsa-sha256; cv=none; b=Ho8GBJbW4r2fT58I84lVcM8Jop9u+gtHRVniv5cLRgqLclAQqdX/nhFvuFUuWQlgYSFVdn Kq5qd1ssP6WJXTsZsnnG6NHb0srERiATZ5uSVTzsp+oDPp7LA5JahHDOxYFkO1Sy+UhCg1 mGSAO1wDhjxjsPio7CJUIOZOh7H55aAA1Um1+b65QaooQEiqOBfrkWORTSOT6yUH6A/0Cq 7S7XOEFlU0PeQo8X+DK5hYDgYCY16p5HCG27OAssdiN/6SoMKSYfmEWtEq64xIq01crvw1 TuUT3934DUYJs9nFbfggo6QFSW2J6QO+rpkmPRdjnEmDoMYrC1Zut0UlxBJnpA== 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 4bbSKb5p1QzwKJ; Mon, 07 Jul 2025 15:08:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567F83lM016893; Mon, 7 Jul 2025 15:08:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567F83nE016890; Mon, 7 Jul 2025 15:08:03 GMT (envelope-from git) Date: Mon, 7 Jul 2025 15:08:03 GMT Message-Id: <202507071508.567F83nE016890@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: ea0ca279edc2 - main - pfctl: Fix table definition parsing as unprivileged user 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ea0ca279edc2683e79a203df22b7ac02cfd48e39 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=ea0ca279edc2683e79a203df22b7ac02cfd48e39 commit ea0ca279edc2683e79a203df22b7ac02cfd48e39 Author: Kristof Provost AuthorDate: 2025-07-02 15:07:23 +0000 Commit: Kristof Provost CommitDate: 2025-07-07 15:06:51 +0000 pfctl: Fix table definition parsing as unprivileged user revision 1.689 introduced warn_duplicate_tables() unconditionally, breaking the parser on tables withs insufficient permissions to open pf(4): $ echo 'table ' | pfctl -nf- pfctl: pfr_get_tables: Bad file descriptor So simply check whether pfctl is able to get the table list first. If not, instead of silently avoiding namespace collision checks, print a brief notice iff `-v' is given to help finding duplicate definitions by hand: $ echo 'table ' | ./obj/pfctl -vnf- table stdin:1: skipping duplicate table checks for Reported by Rivo Nurges, thanks! OK benno sashan Obtained from: OpenBSD, kn , 4650ad2af4 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/parse.y | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index ca3ca28475d7..d465599e1738 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -5434,7 +5434,12 @@ process_tabledef(char *name, struct table_opts *opts, int popts) if (pf->opts & PF_OPT_VERBOSE) print_tabledef(name, opts->flags, opts->init_addr, &opts->init_nodes); - warn_duplicate_tables(name, pf->anchor->path); + if (!(pf->opts & PF_OPT_NOACTION) || + (pf->opts & PF_OPT_DUMMYACTION)) + warn_duplicate_tables(name, pf->anchor->path); + else if (pf->opts & PF_OPT_VERBOSE) + fprintf(stderr, "%s:%d: skipping duplicate table checks" + " for <%s>\n", file->name, yylval.lineno, name); if (!(pf->opts & PF_OPT_NOACTION) && pfctl_define_table(name, opts->flags, opts->init_addr, pf->anchor->path, &ab, pf->anchor->ruleset.tticket)) { From nobody Mon Jul 7 15:08:04 2025 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 4bbSKd53Gmz61wDN; Mon, 07 Jul 2025 15:08:05 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbSKc6tP0z3wZH; Mon, 07 Jul 2025 15:08:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900885; 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=+I1aIeqzcm/FXrUPLA94Hows0SVCTPWLETpIfmNZS68=; b=YJBrffHmIN0CFRQOVAwBW38mhcRj/shEsFC6pOfmM0/CovKsC0ZnbQJJyOpHflu8pFyhpt KNybg+6Ue65hYB+44WhGzOMBJ6ZYBZrxzctVFzzac28OXpnt4G7bkwlJV9fPuNqkYMfptG FC67pFvpu34B/ZXOqZzZ18Ob9EUFsjDS4NBihpun7VLlNZc0W5kxI0FOhLCy4e4iOcPf3e pI0bJda/t/5byGENWP/idzAMji48u2iZubR/D9FzLbLRkTCl8rp6igjWtnm9foNlSGbgwn HuBq5aB+5KXkou5WDSwmgSaIamCrqnu+Obmlf89nJvUo/g+9/XLa3lCAPC7yPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900885; 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=+I1aIeqzcm/FXrUPLA94Hows0SVCTPWLETpIfmNZS68=; b=ph6mY6utSCma8wU0Q7Sc53KUYYKgzIXCMHIBHfHXxWJ6RU6m2AiYau7xo2MzpifIClftEL M45U+5sGh7kmIkPC8pB3yXSG4GFBDl4YuL1oE0ZEe7LCF6wKVuZ+YgnuBBuQqBK0zbFYfo HZmkiFOQcaMe2FJclGwWjG+nX+7UaxmiyH5HpCiN04Pj5Bl0UNwqjYf9mTYOkl8nkOWoUF AtGr+RJHb1h2ZHRFxzkyTxEpn0bVUeC3xV9n/GddGereqqvqyFdj0SeehxitkFEZ0P7anO MamhNs+EAQ/6OtTf9KvsYVRnbREzqCErUaImsQ1Rg1L0Cvyhza/utwd6x1o+IA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751900885; a=rsa-sha256; cv=none; b=y3IlyqhYGRdnmDZrKo3jF2EY/nb96Eoof4qcZxvzvH5PpFTZsbhve/WPGe4iqrUd5OPHaA eke35/rmmNK+YeegPqKWs3N2bMHqj1NoSedFBDJ/6Q9RJ59hsXqJTRbwqK3e2RfQXjmCGr pMLaV2+dLjG0BYuz2SpfgTmijY3ao/NjAFacWOHLH2xxUYqIZiBl8tLXWR1ArUVkJBIBoF FC1/MjneRbWV8Tff4mNALAQ4OU9RzjeBbs+oEwW2Lu1jVa3LrPlRQ0a3iIxeDRTfwHoKYd 4vX7YdBQVzWfFgsWYK+NR/8XEWmXllL+SiyZmDsgsCL6Ih80IX/Wk6Wettwshw== 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 4bbSKc6Tx1zwH1; Mon, 07 Jul 2025 15:08:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567F84DF016930; Mon, 7 Jul 2025 15:08:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567F84OP016926; Mon, 7 Jul 2025 15:08:04 GMT (envelope-from git) Date: Mon, 7 Jul 2025 15:08:04 GMT Message-Id: <202507071508.567F84OP016926@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 0ccf78da3bd4 - main - pfctl: Always check for namespace collisions on table commands 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0ccf78da3bd4f273f203deb4c237d1a3c046fac0 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=0ccf78da3bd4f273f203deb4c237d1a3c046fac0 commit 0ccf78da3bd4f273f203deb4c237d1a3c046fac0 Author: Kristof Provost AuthorDate: 2025-07-02 15:08:33 +0000 Commit: Kristof Provost CommitDate: 2025-07-07 15:06:51 +0000 pfctl: Always check for namespace collisions on table commands `-t table -T add|replace ...' would only check for duplicate tables in case addresses where actually to the table. Instead of using a positive number of added addresses as prove for successful table operations, rely on the fact that CREATE_TABLE() is guaranteed to be called only if pf(4) can be accessed, that is warn_duplicate_tables() will return. This improves duplicate detection rate as warnings are now also emitted even when table commands eventually leave tables unchanged. OK benno sashan Obtained from: OpenBSD, kn , 898866c293 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/pfctl_table.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sbin/pfctl/pfctl_table.c b/sbin/pfctl/pfctl_table.c index d1f20761a4f4..0842b042df41 100644 --- a/sbin/pfctl/pfctl_table.c +++ b/sbin/pfctl/pfctl_table.c @@ -85,6 +85,8 @@ static const char *istats_text[2][2][2] = { } while (0) #define CREATE_TABLE do { \ + warn_duplicate_tables(table.pfrt_name, \ + table.pfrt_anchor); \ table.pfrt_flags |= PFR_TFLAG_PERSIST; \ if ((!(opts & PF_OPT_NOACTION) || \ (opts & PF_OPT_DUMMYACTION)) && \ @@ -94,8 +96,6 @@ static const char *istats_text[2][2][2] = { goto _error; \ } \ if (nadd) { \ - warn_duplicate_tables(table.pfrt_name, \ - table.pfrt_anchor); \ xprintf(opts, "%d table created", nadd); \ if (opts & PF_OPT_NOACTION) \ return (0); \ From nobody Mon Jul 7 15:08:05 2025 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 4bbSKf4Xl2z61wPP; Mon, 07 Jul 2025 15:08:06 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbSKf1B8Wz3wgW; Mon, 07 Jul 2025 15:08:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900886; 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=XMflI7HlVTzUVDJTvh/K5EXOiPK+t5h3EHMLqNgjBBQ=; b=g5mZduvxXpeh18A2thmqDW5zn0bnmIm5zhnAAzCsMUnXjzg1L6lEXOIFZp/Zulizyywbwj MbGULytRzWpBBWFqJaCmetsgnpC7ANriRM2kh0HbanTXtzCxidN4kmN/DPfUQOSP5RA2br wT5jfK9Pa5I0jUa5JZQ3LVwnIP+3BsMgR69A3iAv3RCr8A/Tj0odsgglZu4dIBxTKCjE4S ikAaMvBHmSJzMR5L2e4ht3tqVyKep3xVRTJ7AgVpwhrgVkuA6l5Od0J1RWhHmQY3KX3yv4 gqd4g+MMhHQMZz+SQN6CVYlIjydTnhluXa5TRIiudwYkIFF2SRrURGv5KaoLrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900886; 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=XMflI7HlVTzUVDJTvh/K5EXOiPK+t5h3EHMLqNgjBBQ=; b=EE4m24NrpvKfciGF5mIYsk3LLru1xIa1W4xI87UCDspIoiqsJrGfp1rnO11h2omv2OJFEB tlIg6ek7vDDSp42u2PzxE1Xa0pGQpWVqZX6BlMEMNuCQocY5tklcDmBBFVH57uN1nA69uM uijQW7IhJoWqi1VC4qTfvjUPyEX4nvz0IYBG+CRfFHwmNiHpnghHjn7ajHoaWFacwNXhJh 5LGMYjiQUsXEW3xBx4/8xr/3MYBZ4a70bXMZxiZFO0M8/IR+s21pcs/TI5mHUTWqxSAGA5 RYzna6FMuOSTDlztoCbeGRr9soEDaDTRpROqzr0C4t7BiS04KdcWBbjOv0vfxA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751900886; a=rsa-sha256; cv=none; b=P2pXt5k5O25E8crjYoUWaTgtQHjDr4AxAU3eVGeIKYqA5rxSDFgSBjiT+/dxVobndPtFoG 6GR9X1AL4XbZGAriEe8A5pDbg4VpNZ+4Dly0bOkrjHBeUFJVVAaQwNwYCF/9obq62RmTdm 5RlVVkXs+XcB7T3dFjsS+2M1CFa8mgSqx3zfEbOQc8BcQq0itoH93FDWfOJQLa1789v5QX keaP5F2YC4ErLQHa5DU7pitFHR76h7O/K765UQbFvhW8dizErQE2kUMSokSujhBT0hum7y uc5tEOSRB1G4Z+L4BQepE6WRqz/+pQ8OyUzAZW3ibTB6dSVqQ/Mr1TpyU0TLkg== 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 4bbSKf0gYWzwP0; Mon, 07 Jul 2025 15:08:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567F85Cf016966; Mon, 7 Jul 2025 15:08:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567F85Ft016963; Mon, 7 Jul 2025 15:08:05 GMT (envelope-from git) Date: Mon, 7 Jul 2025 15:08:05 GMT Message-Id: <202507071508.567F85Ft016963@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 5606ac2fcadf - main - pf.conf.5, pfctl.8: update to PF pfctl(8) and pf.conf(5) manpages 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5606ac2fcadf801fc5485c3326fc678e77eab377 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=5606ac2fcadf801fc5485c3326fc678e77eab377 commit 5606ac2fcadf801fc5485c3326fc678e77eab377 Author: Kristof Provost AuthorDate: 2025-07-02 16:25:56 +0000 Commit: Kristof Provost CommitDate: 2025-07-07 15:06:51 +0000 pf.conf.5, pfctl.8: update to PF pfctl(8) and pf.conf(5) manpages great input by Ingo, Jason and Klemens OK schwarze@, OK kn@, OK jmc@ Obtained from: OpenBSD, sashan , acd7255d6a Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/pfctl.8 | 5 ++++- share/man/man5/pf.conf.5 | 7 ++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/sbin/pfctl/pfctl.8 b/sbin/pfctl/pfctl.8 index 2391c1d1cd12..28efff896956 100644 --- a/sbin/pfctl/pfctl.8 +++ b/sbin/pfctl/pfctl.8 @@ -224,7 +224,10 @@ Flush the tables. .It Fl F Cm osfp Flush the passive operating system fingerprints. .It Fl F Cm Reset -Reset limits, timeouts and options back to default settings. +Reset limits, timeouts and other options back to default settings. +See the OPTIONS section in +.Xr pf.conf 5 +for details. .It Fl F Cm all Flush all of the above. .El diff --git a/share/man/man5/pf.conf.5 b/share/man/man5/pf.conf.5 index 3c9706063a65..fe848b030484 100644 --- a/share/man/man5/pf.conf.5 +++ b/share/man/man5/pf.conf.5 @@ -27,7 +27,7 @@ .\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd June 26, 2025 +.Dd July 2, 2025 .Dt PF.CONF 5 .Os .Sh NAME @@ -542,6 +542,9 @@ an ICMP UNREACHABLE is returned for blocked UDP packets, and all other packets are silently dropped. .El .Pp +The default value is +.Cm drop . +.Pp For example: .Bd -literal -offset indent set block-policy return @@ -666,6 +669,8 @@ but can be overridden via this option. Setting this option may leave a small period of time where the fingerprints referenced by the currently active ruleset are inconsistent until the new ruleset finishes loading. +The default location for fingerprints is +.Pa /etc/pf.os . .Pp For example: .Pp From nobody Mon Jul 7 15:08:07 2025 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 4bbSKh1kVSz61w88; Mon, 07 Jul 2025 15:08:08 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbSKg1w5Gz3wpW; Mon, 07 Jul 2025 15:08:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900887; 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=Xm3RlnHxOxQm20uNMmWEx2vgg2+8VbLGXVqNtU/Ck68=; b=FSpvQeDhipa+SPVhz2lTfaJcaGAUL5DU8yySMD1kbYq2fLFR3xcnmplQToxAu5YWaXatJY gfq1hSf8+EN3YnYjBYme4l+nvO93lUexyiV2kFR0uWcZLBO7MdnG6Y6ViBgb8Likln86TE Dap4GOs2kRQKQefKQDaNMMw4FWqIXJSKHTP9nlaWUkG2NO9SVYba0Klmi2Nlrc1tBO2lqG joQsUznVZSzYgNP4uCoHuBwJQmbyzG4yq7DY0ABY/WuxexsC4ksesmvy4VY0m+zhvcQFBS JGiqSQYV62D/hF/zWBlpLOOSoP0Q7rJHGeNnK9EelT3Zc3Gdxn/pl7scMeln5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900887; 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=Xm3RlnHxOxQm20uNMmWEx2vgg2+8VbLGXVqNtU/Ck68=; b=Moq10tVt3dh+aLTTH7d2OTFjeKuWo5T7v0rBjf9Yl77QKM5iv14LNbE0sSjmNWGkX7f+1i 96HQp2BV7wDeo17XqtahHbJGnkIdihsxzPnGcJhsUXgzVJXcLPor4cGIsd44GCMlj8i4PZ 0r0KoJipJQG4gzed+vLkDVYJzcWuJu6ysI8cV67HXXaeEveJlBVlpGfamiIotKGU49dtJb yL+GAZxEpjsQyTFzRaNMToAcdd2eHb54lJgJP9njtIlsc1T97oVuQLE3EaCAIXyRqVXlD7 9G3by+nsW2kxuKXsF80loZ7raN3T1dczpcLMX9TefFQ67CjJ+TnMvys82L4xhQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751900887; a=rsa-sha256; cv=none; b=KxPVRt9eI0HLr0jZzbDohNeZXwa5N9SFaqpVgW2qE6Qvkctp6i66ypH4yGP8hZFjWWboW2 BBhJR2KN2SqdRmpzxtftGviLSq02NwJs4kOnxm6l/Wgm6XlqsA0CnJVBFYs5eiJ0RX9L9g umTwka1LSAVq5ZOOCGDH+EERvAOJlWmUkbvpmU6qpeNvDQ6BmofPYb2UBHqbb9JOxGX81L G20XMeggcUbLH3gbyMSfWx98mHCsNIUqQjGHPYIizEkCG9FJmHUu+9GjN8RAAWyTiAmWll 2OpjmH76uODrT7a8S1e4cXlwr1euMCOPtyT2Y3Aw/Kvi1Q2bxX/NHCYmbPv6rg== 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 4bbSKg1Q9tzwKK; Mon, 07 Jul 2025 15:08:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567F87QP017008; Mon, 7 Jul 2025 15:08:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567F87qb017005; Mon, 7 Jul 2025 15:08:07 GMT (envelope-from git) Date: Mon, 7 Jul 2025 15:08:07 GMT Message-Id: <202507071508.567F87qb017005@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 8b8fae451c8e - main - pfctl: pfctl should check pfctl.astack is not overrun 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8b8fae451c8ead8af978a4528631ca6b29eff30d Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=8b8fae451c8ead8af978a4528631ca6b29eff30d commit 8b8fae451c8ead8af978a4528631ca6b29eff30d Author: Kristof Provost AuthorDate: 2025-07-02 16:27:30 +0000 Commit: Kristof Provost CommitDate: 2025-07-07 15:06:52 +0000 pfctl: pfctl should check pfctl.astack is not overrun (bug found and fixed by Petr Hoffmann _at_ oracle.com) OK kn@ Obtained from: OpenBSD, sashan , 12ebb2cc68 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/parse.y | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index d465599e1738..af1fb95398f8 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -958,6 +958,8 @@ pfa_anchor : '{' struct pfctl_ruleset *rs; /* stepping into a brace anchor */ + if (pf->asd >= PFCTL_ANCHOR_STACK_DEPTH) + errx(1, "pfa_anchor: anchors too deep"); pf->asd++; pf->bn++; @@ -1261,6 +1263,8 @@ etherpfa_anchor : '{' struct pfctl_eth_ruleset *rs; /* steping into a brace anchor */ + if (pf->asd >= PFCTL_ANCHOR_STACK_DEPTH) + errx(1, "pfa_anchor: anchors too deep"); pf->asd++; pf->bn++; From nobody Mon Jul 7 15:08:08 2025 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 4bbSKh6bfcz61w3K; Mon, 07 Jul 2025 15:08:08 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbSKh2j9Pz3wXB; Mon, 07 Jul 2025 15:08:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900888; 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=QUXy/pKRFYw9Ib7SwcJ3Gj08zkN0jp6/x0aqc4bcwMw=; b=Dc/YrCBVyHakzZdffxeD0eLOKrZHBq8FDXIbDmH2YzsMVcPggOGR/GC5jdi3mJeI8MxGaI v8zQnJl0S/UGFN7cqPVj7i5D/aKXV8oiguhzlNFoIk6l9AHUCi+BnX9mYinweYuM6Z3QNw 25R8NCkc64c9uPS9Rajco92f05dD6UBoZVSAFn4q/WgVhg+V7M1EjdInTtvy5fwCBKB7xC eK6F+IAHmo4s5K54YDBR1sDh9hxLLqANMdOZ+Gjbi0JvUHr+gbSiLYORGdrfOlNRFnGQdE 9piUq4gnM7csNfj+VbJRE36FRM56hVfnDqnTt2Cybmd4srJN6RvAoTkDtlNtSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900888; 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=QUXy/pKRFYw9Ib7SwcJ3Gj08zkN0jp6/x0aqc4bcwMw=; b=GTmoTd186R5jpZqq9eZz/FWRpA/4jUsbGrAGehAoaI8aMVIN8jD9ZfEjsG4SrK7MDynfdg 0tGW+PobDcAHRZsEijHXbh7jO8mS3giLgk4VKfiuCgTM3JP1WZ6ut4voi5YPk+vsAwrIu2 Yz2Bzk39QjyyQHhqqK+L6ugDHhXZ5NVil9y1cIJgktVT5pXiB6kNaFEUgqFp8jb350brP6 SqGl/qM8mkuFXSWvN8Hv3DfjMDUuXG8VWpNZOoXUtWgNzuA5H4VLcYKTdMvZYVngzWO/mZ ukikaCWugS2Bzv3XKbBPJBlRUeg3t+LFC3t4+L4UGsOsZsLXz8rO5+WMheaoyw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751900888; a=rsa-sha256; cv=none; b=Puo3owIaDAXjeyNIwU4xIOVi/7upQPA0LxjcIfqJm/QiBIz+oXlPPiDW9JxUVfwkj+b9HF FR5+lmMMy6gjIe8OSoTYqeTfatcJteppTVCj907Dh5bDG8ArEAlNkztMo8njIsweGMeXmE mLLPWyVXN3iDRCaNq9JICqShcUhJ69RljHhuDM3Ap5MRwbIpYSi+BZSipc2MLLXD5EPjn2 1CwXMcCJb7ooIxNkas/nwj4sOJ6sU+Bvu/jzPwltB+sf/fwOveOfhhCZt73UnCLyO76R4j 9ChYQ0vsgy1k+hVY75f0KlOBShwR5ENTNjDyyxx2Hfwb+nBKSt6++5Qa6JINYg== 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 4bbSKh2HjQzw4r; Mon, 07 Jul 2025 15:08:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567F88C4017040; Mon, 7 Jul 2025 15:08:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567F88kZ017037; Mon, 7 Jul 2025 15:08:08 GMT (envelope-from git) Date: Mon, 7 Jul 2025 15:08:08 GMT Message-Id: <202507071508.567F88kZ017037@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 27626ff49ada - main - pfctl: Add parentheses for readability 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 27626ff49ada57f1978c893f21743e312dd40106 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=27626ff49ada57f1978c893f21743e312dd40106 commit 27626ff49ada57f1978c893f21743e312dd40106 Author: Kristof Provost AuthorDate: 2025-07-03 08:51:43 +0000 Commit: Kristof Provost CommitDate: 2025-07-07 15:06:52 +0000 pfctl: Add parentheses for readability Prompted by and OK deraadt Obtained from: OpenBSD, kn , ff93619fa5 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/pfctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c index 8c20c8250ed1..738c89069383 100644 --- a/sbin/pfctl/pfctl.c +++ b/sbin/pfctl/pfctl.c @@ -3145,7 +3145,7 @@ main(int argc, char *argv[]) if ((opts & PF_OPT_NODNS) && (opts & PF_OPT_USEDNS)) errx(1, "-N and -r are mutually exclusive"); - if (tblcmdopt == NULL ^ tableopt == NULL) + if ((tblcmdopt == NULL) ^ (tableopt == NULL)) usage(); if (tblcmdopt != NULL) { From nobody Mon Jul 7 15:08:09 2025 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 4bbSKk1ggvz61w8C; Mon, 07 Jul 2025 15:08:10 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbSKj3FgJz3wZy; Mon, 07 Jul 2025 15:08:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900889; 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=obWQFKavpNjaNAZJo0WNmLyTholbQi6YYp4JkhbcFKQ=; b=h5Yy3FINgQ5HDRSTmryGbq8lOr3wJoR/GIhqKDADElb76d0ZrMGDlTYvG0QHSgIb4FTDYi 2PbT4mbb3z11ZXafS7d9q8+fgvVxKET7gTSYriVNL5JsoGyTq5y+eyZGp4JLtIQ5KAoEBm S21hhdtVdeoP19mhXbw7FhbdgYGYX8INzekyOI8qaeD8PpEj13QaJFQLTLXnEQL3Yj2RDr mLhOj7xWtQCMQPJ/kHkb05rXzR3BV29p7LbOXriOnrfFadgWg39p2gjpiu64NRB0OoaIIv DtlhV6Hw4wvN/YX9K2tqVvexTtSrp0NDlEvjyyVVDtS01stiqZ9Xn2Eu7DEVUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751900889; 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=obWQFKavpNjaNAZJo0WNmLyTholbQi6YYp4JkhbcFKQ=; b=F6moKYHFmqHOEFK2vcq7DTq4OibcqoXicToD11Y6UHHmJ9IX639VheSR27HYbMb8wr7v1a pBQnc0b5ajpEGGA0LganfRit3JgJ+ex2DK0Ybxt6tHFsF/hFlu16fCuffUp2lTOY8MGuDs 2p43Oq+rsFp7HlpuyqTUDlJ8hyYbiACnm9hD+OjU1Xrlga+EkaASObBm2KppJ7U0T71vfc jfWvRxmw2Y2pzkV1yKRYbY/hXye+qsHM1DJXCDPjJiauJr8fqhu3CTHLqENKwEtFHusFGP MnbxQhay91x+csfr3kYhPZQY1ZyyLADOx3DwL/elSn4smiZv3f5a7K5BqKM5Jg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751900889; a=rsa-sha256; cv=none; b=oMet2IdBxBlnPV3UrLL1FCbWwnuNiyfcOJ6Ah6PR3+z07wAQO11V/TjHmu9YzrjTfjHAqm ACGJRqlwv2vBBuXPOCeheTvKooPOPdKLC69lTXr0VXQ8Tp4shrsesvODIIQgLDHwTi6rrS OD9FoQj3EfxZyrVWZcKFHWhdlXPycEd5B8K42hA45j1DnHWhFgrie3Egqyw2VUXtJmCsiV LaiETF1+k+JUECgz9AszPNMXc9bYO92zVk66W3aTVUI9Pd/m1VhjDyLwB02DuKliDAET2/ l1ruxetn5oeVlYk+KDq9fhXqu5d09Uqg3aTTXboDgdxw7ldAnmxL4bBewv/2Mg== 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 4bbSKj2qsfzwH2; Mon, 07 Jul 2025 15:08:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567F89Ci017072; Mon, 7 Jul 2025 15:08:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567F89N4017069; Mon, 7 Jul 2025 15:08:09 GMT (envelope-from git) Date: Mon, 7 Jul 2025 15:08:09 GMT Message-Id: <202507071508.567F89N4017069@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: b3902af408a9 - main - pfctl: use str*l*cpy() to copy strings 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b3902af408a98ff5520d50e6af69652d9b2984d5 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=b3902af408a98ff5520d50e6af69652d9b2984d5 commit b3902af408a98ff5520d50e6af69652d9b2984d5 Author: Kristof Provost AuthorDate: 2025-07-07 08:49:20 +0000 Commit: Kristof Provost CommitDate: 2025-07-07 15:06:52 +0000 pfctl: use str*l*cpy() to copy strings Ensure it's always '\0'-terminated. Reported by: ivy@ Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/pfctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c index 738c89069383..defba3b56c44 100644 --- a/sbin/pfctl/pfctl.c +++ b/sbin/pfctl/pfctl.c @@ -1632,7 +1632,7 @@ pfctl_show_states(int dev, const char *iface, int opts) struct pfctl_state_filter filter = {}; if (iface != NULL) - strncpy(filter.ifname, iface, IFNAMSIZ); + strlcpy(filter.ifname, iface, IFNAMSIZ); arg.opts = opts; arg.dotitle = opts & PF_OPT_SHOWALL; From nobody Mon Jul 7 15:13:29 2025 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 4bbSRx3c7wz61x3H for ; Mon, 07 Jul 2025 15:13:33 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-io1-xd2d.google.com (mail-io1-xd2d.google.com [IPv6:2607:f8b0:4864:20::d2d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbSRx0JChz44gh for ; Mon, 07 Jul 2025 15:13:33 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Authentication-Results: mx1.freebsd.org; none Received: by mail-io1-xd2d.google.com with SMTP id ca18e2360f4ac-8723a232750so348030439f.1 for ; Mon, 07 Jul 2025 08:13:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; t=1751901210; x=1752506010; darn=freebsd.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=DrjXVPAYiG4dEDtPQcMwkFAgllrlk/VnjjURv9/yLMA=; b=gj6NJZnb7mnqadvps3cHaKkW2DN2+lMG3n5DVrWJYy+tiavaEYzlLB3WpHygYCJ0pK 9QF1gEk/rm3COASATi70okwq3vuw61IJeYvf/tuesjAUimntcoiOY02NMYL1E/WrOqPJ UqzEsyANDsk5+sSMuvdURALB22IjCCw0auNgGs5s612MQY49TUAE08VnEl74slZQiG1X 8GMULwq7kdUEVZL9H7r5FtjiPY17RDNFHkMjgaiiwRyaMBDsnkxCfJnQ/Da8oNhOq2AM 7fTdPFnzjuTY+73gEwAKCwEYZriX/fMK1+PNWjXkKy153U7SJV30++dmOsdaBPliXQZK hoGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751901210; x=1752506010; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=DrjXVPAYiG4dEDtPQcMwkFAgllrlk/VnjjURv9/yLMA=; b=eVj+skw3CNrF6c7JEJutJ+jCnVeiqIsIGFPepCRlIujmSWq0TFEskiPnEbrCV0wRbx s3RSiCjgDC86fypXRSfYq+5VK08Vnbo1uOg786VHLaNFvJ+Rivf1k6YKIxYqUgJz3J3v X74j8/7PrRqqcR2I6Za5vX7qobinSePz/UblKBCV5SUojx8rntM8bL4eruXDyqGVrGqr Awg3cXG+3egJ4WEFM2DzwME920lAOpB8cHVx7yVWGJIWXKtZGXP4ozaICt0HAFyhRnuQ HXMypdZDLBZGjB0WyBG/BVMF1jRJaX4uz/KBy8TOBhbFXy0DJLxRuMPKUuVW0/lK4n6Y YnqQ== X-Forwarded-Encrypted: i=1; AJvYcCW/H6yX9yNgx/RGh3dFTrvA5P3Iim18yyk+3cW8NdoW9Z+ZQmZTOfSRQa5/r6LgjH3dhIOkTdTDqc7Ury93yUxc5VGT@freebsd.org X-Gm-Message-State: AOJu0YwXN7502HtVTw5XlMdnbBgreuSV+KfwWFoK1htZTtYaFxhS4Cx0 LpscQUENRZonEtxyECsh8GqpK5mNzTxpe2RjDwimpcdfc5/CPAxO6YxufezYaGwJPwg= X-Gm-Gg: ASbGncu+Lr28LxK7nhpwPxA59ptwHGCCQaIDbJ1fLs+/Ae6g37ZrNIrCOuElTEJC5n8 86IXK0i29X8svyJuWXQFDQZ7YfypeW05YttA9TZiThB5HVYTBR5iERM1pOZxNWTziNmhpXbUkMe 2aZ5LQp4wWyXgYh7e9vysECko8JTXQCizSXPYy7itLchxpTW5+Ts1o2kHYsEytzsf/7GcoVVOsx yZaFz2Nl7zX7raOMkyZFr+EvJWespPCquSG86Ga6msLzt3hDLVhdNLeJf64KBugdvyH/C4GFXDn yG8C2TZHItc/RDrfvg1uNbRD8UPhp6Rn9bGi6n4MTSe0 X-Google-Smtp-Source: AGHT+IFN3qWreoUrvtquSiDuV5Kofk8e7Dy1dJJvaMO3Ce78ZI78JDyTwS+jReVPi5n0xgW/FESVKg== X-Received: by 2002:a05:6602:1512:b0:864:a228:92b4 with SMTP id ca18e2360f4ac-876e15d75a0mr1191900139f.7.1751901210417; Mon, 07 Jul 2025 08:13:30 -0700 (PDT) Received: from mutt-hbsd ([2001:470:4001:1::95]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-503b5bdf9e2sm1751268173.67.2025.07.07.08.13.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Jul 2025 08:13:29 -0700 (PDT) Date: Mon, 7 Jul 2025 15:13:29 +0000 From: Shawn Webb To: Mark Johnston Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 71a0af25a535 - main - libopenbsd: Add recallocarray() Message-ID: X-Operating-System: FreeBSD mutt-hbsd 14.3-STABLE-HBSD FreeBSD 14.3-STABLE-HBSD HARDENEDBSD-14-STABLE amd64 X-PGP-Key: https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/blob/master/Shawn_Webb/03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc References: <202507062318.566NIhSM031303@gitrepo.freebsd.org> 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="vp7vzkwe5dfjx2hk" Content-Disposition: inline In-Reply-To: <202507062318.566NIhSM031303@gitrepo.freebsd.org> X-Rspamd-Queue-Id: 4bbSRx0JChz44gh X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] --vp7vzkwe5dfjx2hk Content-Type: text/plain; protected-headers=v1; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Subject: Re: git: 71a0af25a535 - main - libopenbsd: Add recallocarray() MIME-Version: 1.0 Hey Mark, I've noted a couple things. On Sun, Jul 06, 2025 at 11:18:43PM +0000, Mark Johnston wrote: > The branch main has been updated by markj: >=20 > URL: https://cgit.FreeBSD.org/src/commit/?id=3D71a0af25a5353f929521cb04c7= 3a7266ac5b7b61 >=20 > commit 71a0af25a5353f929521cb04c73a7266ac5b7b61 > Author: Ricardo Branco > AuthorDate: 2025-06-16 21:41:48 +0000 > Commit: Mark Johnston > CommitDate: 2025-07-06 23:09:00 +0000 >=20 > libopenbsd: Add recallocarray() > =20 > Reviewed by: kib > MFC after: 1 month > Pull Request: https://github.com/freebsd/freebsd-src/pull/1698 That appears to be the PR for POSIX O_CLOFORK. > --- > lib/libopenbsd/Makefile | 3 +- > lib/libopenbsd/recallocarray.c | 82 ++++++++++++++++++++++++++++++++++++= ++++++ > 2 files changed, 84 insertions(+), 1 deletion(-) FreeBSD commit 450dfafb1519ae7bb0615368ba45813bcabb9b35 back in 2015 imported a different version of OpenBSD's reallocarray into libc. Would it make sense to have only one reallocarray implementation? Or what's the justification for having two implementations of the same function? What might happen if someone links against both libc and libopenbsd? Thanks, --=20 Shawn Webb Cofounder / Security Engineer HardenedBSD Signal Username: shawn_webb.74 Tor-ified Signal: +1 303-901-1600 / shawn_webb_opsec.50 https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/raw/master/Shawn_Webb/03A= 4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc --vp7vzkwe5dfjx2hk Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEA6TL67gupaZ9nzhT/y5nonf44foFAmhr5AoACgkQ/y5nonf4 4fptkQ//VdK4aVAvdiUF7Wz8vU/z94+hRCkw14wtth+fK7C1z2k8I7ObS/NaMI5H 7EvtopnIxsY94V85rsSpfGPgUoNfpmkYqjv9q4AuZa3IyV5ZOU1/MM+xn8w9I1jT +oipmMEFBd199Pjpo5AD1zLRHDcAW2GYWjsxngTTBAGftQHmC1fyKDUCf7l7zV+Y ymM9CtSpWG/7dIB8XhxuRUKEgySv5VG5FDUnjB7cL7B+KmJkVD0PtyLWwiFWLamV kZiYyWA0XhR2c8VRzrPzBIDMWWQhw1ZKRnNfFCFmhgHr1JPhj5M/Ke6N5qPUT71X hmCASx1w6y6osUFki3kPNhPNuauw+gVxV2rOR3TfKxTlfZ3BhDlWAcd/XCLfVGJz hHDTMm3JIZJDocyuL7Uvx3kxsiMI7zOxJngacTMsWk0aQU804IiEs1BtDE7SIil1 SYvJh0kYcEnsvIVXQ6v7ZZfK1ltK3Q71pynx9Q/QyRnJAPyfZMzqsBekrP5J8W1N UkQdMW2ObXBiZGTU6k76DoGwPziZNEWsEeEoAylb/W+nb4u9OYhMqnbNhW3uLM8v 5u1Rqkmz0iiQoOY7Y1ry9ro0lLZRXu08u9GjahDOJCBvlc4i0xD8CDCp9lNCIxcs M1HhrK7CSzWFjJduEg8eraWPjELSfdk8js0abFFPA1t2jKAUaB4= =xbJK -----END PGP SIGNATURE----- --vp7vzkwe5dfjx2hk-- From nobody Mon Jul 7 15:20:27 2025 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 4bbSc12Hmyz61xGX; Mon, 07 Jul 2025 15:20:33 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qk1-x734.google.com (mail-qk1-x734.google.com [IPv6:2607:f8b0:4864:20::734]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbSc10DSRz462S; Mon, 07 Jul 2025 15:20:33 +0000 (UTC) (envelope-from markjdb@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-qk1-x734.google.com with SMTP id af79cd13be357-7d219896edeso394641285a.1; Mon, 07 Jul 2025 08:20:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1751901631; x=1752506431; darn=freebsd.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=9fhIJyo7yvxDdwkSTIFbZXyr6FGbnoq3MgkAw8KKwKs=; b=bNNW/WfhCpi0QfrqwBAKZxfubvAwsSnMy1kJtP6b+YyFN/3+OrvJM8927YbYEedYFX sxo+FSBUL7sqGxNP5yijvZWf3YJeh6NxajlmeVSa43yycmigdCoPIfPCNuCfEcuD9GFc ovj2zjfOq03ybfWIeptMj3OhDzpJ63z8nc9yufUdpYXHR6hKMl2p6J94b2ROuaPTMtlj 37+ncJ0YzKc9LctGA/bVp7JqceVhubjXNmTklkxROJe/eLklf/Xb7KzNi4HHuAlUILzy WTbfmBjvW87MdQvHQiaZKW1p4xxdAjJWagtOphZ8cvMANEG9/nU8JG6rEdY37jPu+cHK 0emQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751901631; x=1752506431; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9fhIJyo7yvxDdwkSTIFbZXyr6FGbnoq3MgkAw8KKwKs=; b=SWRuxs/xzl360w9AhQbkYuF2GJG/ID+R3eZeLRJTlz1QZKIZr4DzCdXr9WBujorubl QBhib6KnbN6q6+IszPtZ/Kv/93CpWTNWlRWhSblo2+wwaZ8cWiD0WWqfXkBKz9XfDcC1 U7sWpXFXCAn7Pspy93C6Q93nLCqcF3fxF6umrd1vVyp50WDO3uFzlMC3gwUnQsOS+76Y m+ew9j1EAXOmExihbi6LVeMaSXbYr8Cd1OvRqZL3j4PC64l29yX8rmFJ5kl8N2Rwqet/ T+vWs/appcuacype/sjsTlTCTKIRvoWsXUj0Gzfl24jN0qO3Nv4Vizlpo51h7KF9QnHB 5pQw== X-Forwarded-Encrypted: i=1; AJvYcCVbaHLO32QlZK0a1pStNYJ4RTwtLI9Nd92CqdTKdfqvi33bRmn/oz/4OV8zwKm6YxKhds5S/GxNe5C5DZTU+daEaW1+@freebsd.org, AJvYcCViso2m3BTyapem8FNKscM/oFw54HlPKFiPgADrHYdIOXEdcMZ8D5+/nyPBhuSUgUXxyQ4EAOs18mtFLIMwAlu15Rk3Mg4=@freebsd.org X-Gm-Message-State: AOJu0YwzELA6lLBWRzd1+Cf3WRZg1K8q1BvElzpUSD6FIEt8SSfYsyVc LLo1rzpX1KmT+INg9gzR8NqJf4AUABcURLquSeHfkplTU0QaCGooCKcYe9cHS5yP X-Gm-Gg: ASbGncs/hlmmvFAJBC8H/HC3YT85lEKNVgSbJlVMr9IzVewjQVbM0UiyMFCLZURlfcx lhBzLUE0DWKto1jI4sleM6lQpFPyFP/Om+z2vLXvZEg/1ZoOAwYi5GET62UvJAfNaVjtif+BYe1 xXe4q+u4FWX9dsxTX0ehuevdqDBJCqSj0o1fFKNC8NvABEBZHYU2fkYMl0RB2Z+PdU0s8EtWUKw NLwfEZrQih0ZMHOmCYNXX/w++nW68iXCb34N50AKgz12PLteKVYrh4fAblpBI4NJuKUuxnAxsE8 0Y0s0JAzd9H0ucPcI+eaGxT1mAVwTAGfCVkyJVbzqd9q5S1o81NJQC3ofViOQQrQTZxK7M03lj4 U X-Google-Smtp-Source: AGHT+IF/lCkB7cQJ6SHtt2roUZjLPflfYlrq/kE4djsNc1zZ3imfcz9atP3tk9Q8UgOr9n1Cg+zPsA== X-Received: by 2002:a05:6214:f65:b0:702:bf0a:b9d8 with SMTP id 6a1803df08f44-702d169572emr132313176d6.13.1751901631096; Mon, 07 Jul 2025 08:20:31 -0700 (PDT) Received: from nuc (192-0-220-237.cpe.teksavvy.com. [192.0.220.237]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-702d5e53246sm35623116d6.1.2025.07.07.08.20.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Jul 2025 08:20:30 -0700 (PDT) Date: Mon, 7 Jul 2025 11:20:27 -0400 From: Mark Johnston To: Shawn Webb Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 71a0af25a535 - main - libopenbsd: Add recallocarray() Message-ID: References: <202507062318.566NIhSM031303@gitrepo.freebsd.org> 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4bbSc10DSRz462S X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] On Mon, Jul 07, 2025 at 03:13:29PM +0000, Shawn Webb wrote: > Hey Mark, > > I've noted a couple things. > > On Sun, Jul 06, 2025 at 11:18:43PM +0000, Mark Johnston wrote: > > The branch main has been updated by markj: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=71a0af25a5353f929521cb04c73a7266ac5b7b61 > > > > commit 71a0af25a5353f929521cb04c73a7266ac5b7b61 > > Author: Ricardo Branco > > AuthorDate: 2025-06-16 21:41:48 +0000 > > Commit: Mark Johnston > > CommitDate: 2025-07-06 23:09:00 +0000 > > > > libopenbsd: Add recallocarray() > > > > Reviewed by: kib > > MFC after: 1 month > > Pull Request: https://github.com/freebsd/freebsd-src/pull/1698 > > That appears to be the PR for POSIX O_CLOFORK. Correct. > > --- > > lib/libopenbsd/Makefile | 3 +- > > lib/libopenbsd/recallocarray.c | 82 ++++++++++++++++++++++++++++++++++++++++++ > > 2 files changed, 84 insertions(+), 1 deletion(-) > > FreeBSD commit 450dfafb1519ae7bb0615368ba45813bcabb9b35 back in 2015 > imported a different version of OpenBSD's reallocarray into libc. > Would it make sense to have only one reallocarray implementation? Or > what's the justification for having two implementations of the same > function? What might happen if someone links against both libc and > libopenbsd? Note, this is recallocarray(), not reallocarray(). libc has the latter, this commit added an implementation of the former to libopenbsd. From nobody Mon Jul 7 15:24:23 2025 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 4bbShV27Jcz61xrR for ; Mon, 07 Jul 2025 15:24:26 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-io1-xd2b.google.com (mail-io1-xd2b.google.com [IPv6:2607:f8b0:4864:20::d2b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbShT6Ztqz472P for ; Mon, 07 Jul 2025 15:24:25 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Authentication-Results: mx1.freebsd.org; none Received: by mail-io1-xd2b.google.com with SMTP id ca18e2360f4ac-875ce3c8e24so117426039f.1 for ; Mon, 07 Jul 2025 08:24:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; t=1751901865; x=1752506665; darn=freebsd.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=7Oj4zufyOU55CCDmncF6ZMzitjRYF3wUKgc1KUZ/rzw=; b=YYZv5Rqym1SndPjfD1w6TDGrMkROoNgXM27xwpgQ2SrLFnu3ejuiYPBpnXLJsqfEn2 uoRWTyoIR5tbUBcBVmVTviniYArchZX+muubSlLDUoU0m4qG/vc2zKvr93i8EXl+T0RU jp0arB6CcRWGfR41EzQ6jIKsuUq/qPRNR93nBrIDyVdYOIkvEPD0avbwTP8HePhZVSyK ++FTiVNMDXNWZMSc/6rIq/+brmTeRZvqqqAbZhYZFcZpS58n86gOnrbsz3k7eBYvbWpp QRVPNFdwriqyTwHLGn4ulSLW0J3Ir1zHvJsXpLE5HXRrUzP1kcw/M9TtWNLO9aJUGMAc dlcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751901865; x=1752506665; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=7Oj4zufyOU55CCDmncF6ZMzitjRYF3wUKgc1KUZ/rzw=; b=BQM/DYMu/D7sdrDyT93ZDLMjoJXutjQjoNfWXRtjI40pX5lIXuwbmi9xf3OMbuIVOV DR4zGCzNcN5QpFLAGHpuWsdYomq7S4sQ/463csEYkshiHt+RDzU7voDvCICNolI58TMy JDzwhWmAIzrWG5UpsJAQGcKD0SxR/ndRncRzfD2Bt6N7WZ8gMrCcFCtoi+SkIcjdE1qt ZplSHPaHsDkUU46yBGjSne/DOihJkay0dFSg+8jM+2FDjAyioHRvJXIQbFXqazcCAcL1 Zirrq2GMGOF3cAOAcqpbv4LPtYk1so0jSh+Ck74sEprGlUgrJHoJ9UvURAsXLZLYeXMe jT3w== X-Forwarded-Encrypted: i=1; AJvYcCWQYMssBLSMIV5GHRlvJXL4rhKqsn8k7EKr+Zcz6/otqSOhghB3Xxn5KMywOysDvDjUe0fuek5T5NdiX6I1YBbtJYnc@freebsd.org X-Gm-Message-State: AOJu0YyZcDxKyTBm0L7fOggnawa7iLBZyyQqX+z4rfbgfvhgOngtce/M hEChdv2oL+IvdFQ/rv57tq6gBi1Z6wydo/35m9hi5WhQzjGxYiZeUzAPj1hpIVCLPTQ= X-Gm-Gg: ASbGncsZjS6h+i2p5F2RlhhY7FiFQVFojY2AUOCtRv3C7LUScRyKkRccTpS821QPiVs 5KaqJbQ7+XkHOLE/ll2S5AFNocGpb4tW/foY3xrI0qP54yfnZ/11WfktvTRu6tjDpnuqeh7+1Ry 9qP5DuiIobqComQl4CdVZRbCKziOZxQXS1wRHwKAUDRZGTsa+X7OfvRRW6+h92fIUsYCwbu0Bv+ h/gMkP/YFXPomweyYAUZhvrmu7Sndu5BGBcEFOqRcLToOFQJl1+NQkulsKttUxLWcSewhfhIZZ9 H7d4In0q1dymmcGiQieHmiIjYRvvvja1mA0jfAaSqvV86pTiJDwu948= X-Google-Smtp-Source: AGHT+IG9fOArTxOHDazxQj7+1r9f03uMaABuN/4AkS/Ryd4Y/uQqTG+hW9Ts7VzaiNqRUdbpYifAiw== X-Received: by 2002:a05:6602:2b93:b0:876:a951:b272 with SMTP id ca18e2360f4ac-8794a3b2afbmr3406239f.3.1751901864652; Mon, 07 Jul 2025 08:24:24 -0700 (PDT) Received: from mutt-hbsd ([2001:470:4001:1::95]) by smtp.gmail.com with ESMTPSA id ca18e2360f4ac-876e0858ac8sm219549839f.32.2025.07.07.08.24.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Jul 2025 08:24:24 -0700 (PDT) Date: Mon, 7 Jul 2025 15:24:23 +0000 From: Shawn Webb To: Mark Johnston Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 71a0af25a535 - main - libopenbsd: Add recallocarray() Message-ID: X-Operating-System: FreeBSD mutt-hbsd 14.3-STABLE-HBSD FreeBSD 14.3-STABLE-HBSD HARDENEDBSD-14-STABLE amd64 X-PGP-Key: https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/blob/master/Shawn_Webb/03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc References: <202507062318.566NIhSM031303@gitrepo.freebsd.org> 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="wpjsuxfexknztctl" Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4bbShT6Ztqz472P X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] --wpjsuxfexknztctl Content-Type: text/plain; protected-headers=v1; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Subject: Re: git: 71a0af25a535 - main - libopenbsd: Add recallocarray() MIME-Version: 1.0 On Mon, Jul 07, 2025 at 11:20:27AM -0400, Mark Johnston wrote: > On Mon, Jul 07, 2025 at 03:13:29PM +0000, Shawn Webb wrote: > > Hey Mark, > >=20 > > I've noted a couple things. > >=20 > > On Sun, Jul 06, 2025 at 11:18:43PM +0000, Mark Johnston wrote: > > > The branch main has been updated by markj: > > >=20 > > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D71a0af25a5353f929521cb= 04c73a7266ac5b7b61 > > >=20 > > > commit 71a0af25a5353f929521cb04c73a7266ac5b7b61 > > > Author: Ricardo Branco > > > AuthorDate: 2025-06-16 21:41:48 +0000 > > > Commit: Mark Johnston > > > CommitDate: 2025-07-06 23:09:00 +0000 > > >=20 > > > libopenbsd: Add recallocarray() > > > =20 > > > Reviewed by: kib > > > MFC after: 1 month > > > Pull Request: https://github.com/freebsd/freebsd-src/pull/1698 > >=20 > > That appears to be the PR for POSIX O_CLOFORK. >=20 > Correct. >=20 > > > --- > > > lib/libopenbsd/Makefile | 3 +- > > > lib/libopenbsd/recallocarray.c | 82 ++++++++++++++++++++++++++++++++= ++++++++++ > > > 2 files changed, 84 insertions(+), 1 deletion(-) > >=20 > > FreeBSD commit 450dfafb1519ae7bb0615368ba45813bcabb9b35 back in 2015 > > imported a different version of OpenBSD's reallocarray into libc. > > Would it make sense to have only one reallocarray implementation? Or > > what's the justification for having two implementations of the same > > function? What might happen if someone links against both libc and > > libopenbsd? >=20 > Note, this is recallocarray(), not reallocarray(). libc has the latter, > this commit added an implementation of the former to libopenbsd. What a difference one letter can make, haha. I certainly missed the extra "c". Sorry for the noise and thanks for the clarification. --=20 Shawn Webb Cofounder / Security Engineer HardenedBSD Signal Username: shawn_webb.74 Tor-ified Signal: +1 303-901-1600 / shawn_webb_opsec.50 https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/raw/master/Shawn_Webb/03A= 4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc --wpjsuxfexknztctl Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEA6TL67gupaZ9nzhT/y5nonf44foFAmhr5pcACgkQ/y5nonf4 4fqJfA/8C0ihGJmFHiLheWZdWZPWlOMcCeMTL7qIs44GYpyN0i3w9Ie6d/sGSnbS N7FNFtx9LzKAo+Q6pyfgU852LvwCLHdTqYgY/McIfkPT7v2OJdPl7v0SS0fG6u5j TUVsH3Sjiaao/ESdTkoehNPRZbOYz0t81SIpb5RBDKhr2fLnTpWdZsGJQp3tXzY4 7fZXzR6e3hPQTgnQYidPkmEu2Q8JrwlZsKQPOO/z2c9tZwLFhwa3yelduffj3bm4 AldyT0tNFr0HE1PlhdYawkDYrZQ8z0XS4pxM/Z3U1HjaCk5Ok0ti0GhFWBau+Kue GHpRJTkQObVJ7Mrq+S52TU9p0qmKSEnBZw4vLhYBGGaNsBW7SelT5PqdvL3bg0Di NBb+lsUkCGmLSxGJmpFow4bAhQ9pzBxhiIQ2s2vZEmW0tsRvOgn52Rtn6P287Qo+ LzSo49+jWE40EUt4bzPUo+n8+NCHXaCeIJTcEkeorrcb5ypU9YkpFtcnJWL2iu74 YJTTDnmqKK2jU78JVmkP1ZRP0aA+/yHpcJXpRzjIbblCMASdzhbCF8Oq1Jf0mMVY HgJ298WOBf2lJdXtS5snQk3TIUhaVGioDJH75w0p8lQ0lPb8HeK+e/1AXROTLwK8 UK15Iiirhm1tReHCN9KWFL4Nixj4Cvsr3blaigJXtD7G+tnQs1o= =8Mz7 -----END PGP SIGNATURE----- --wpjsuxfexknztctl-- From nobody Mon Jul 7 15:42:51 2025 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 4bbT5m0jhCz62115; Mon, 07 Jul 2025 15:42:52 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbT5l6mgrz4FcC; Mon, 07 Jul 2025 15:42:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751902972; 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=ZF0AExwoeRVqPVaeAFKOCiPV8g4m82BUTAMENtqvyVk=; b=Lu75YU76IE4cF6UHjkFmLZWVeExzaRxQy5oPuanWKFrG4zWSn9/8+GGCAlW1xNVxru37vQ ph8yE5i8IvphaRLomTA8nF/6v/motkKMXXmWNtKR+cvnYOU+Yy06S0W2JtNgIlCLENWmss VvfI3yff7w4S+14tz8vVBBNcbJq5Xiz8iXBdV+2lnOH0uBa5m58VoyMayi+B1HCMtBRNFp EqdTdBH5h53zF81Vqcr/kI/9cePD7vQZcSO68r0Ulyc2EZLiPkDAYB5UkaxIE4d/9gmwNc vEoX693MxY8U1B+zTMUApsupbsEsoSXU8ebUS2IQKlE/AwweFSUB1nOHKoNaeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751902972; 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=ZF0AExwoeRVqPVaeAFKOCiPV8g4m82BUTAMENtqvyVk=; b=vqeX0Q6Btp8czjlPFln8eUb/AQfIX+m+TkS1bh2qZOFKZXDbstvhi/hSP2Gk/7I8TCBMnC O2uZzo5flMFH00vII4io2BgH6Qyr+rCFSPXWXV1BDtpXGo+6+d2zO4OCZkxYSVcq8n1jzD AHxDogmz2brc5RHV6F4avGBNVBAYoApY9gCItgWETwl0JlAP7PA/BrBDIiJc9WaYptxSu2 DqhBWfy1X5irnAKFNPhQKklSB+K0dmhowJ3wtWmetdzZ28LrubAnozO5ZWb91Qv54KAYLa RlHW+aXmzaEdzreY4T34hYlN8nQa84R8vzkA79MAtzuX9UcFGezvGY1Q5a7z9A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751902972; a=rsa-sha256; cv=none; b=AMdZrUGDeKohx9W75fPoY+RRmc0DuD/1s1Z8y9l94rXkFxBiuQoQD16V9vbjmA9Xwebiee FLm1/UsJcg5e3ZbqnpkOmZq3sXpMxEg2WoP2P4Iahwx+s5t76cTWtLssYDziw4D3wr8/XQ 8pKv3CDILbsFAoYbgputANBNys1+23E8TCCqq1YOiDA94ToYWZ7BWoJ2Y5x+ovR3wFEC7d Rnb1sewZ9qH+50ZNbMNkimzRvRMMFQwhaLVDVHwMTDajPw4IIZ9bmA/J8SdeSuEH51t+Nz N4ZD2fSdkEuvVrqq+K1ylUn9pvzBbYXvubHwVeC/ncdBOoR18zWh8dpGgOAPLg== 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 4bbT5l644Fzx4k; Mon, 07 Jul 2025 15:42:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567Fgpaf091925; Mon, 7 Jul 2025 15:42:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567Fgpee091922; Mon, 7 Jul 2025 15:42:51 GMT (envelope-from git) Date: Mon, 7 Jul 2025 15:42:51 GMT Message-Id: <202507071542.567Fgpee091922@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: 9940c974029b - main - random: Change the entropy harvest event queuing scheme 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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/main X-Git-Reftype: branch X-Git-Commit: 9940c974029ba53fc00696b3fa1784725c48a9e9 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=9940c974029ba53fc00696b3fa1784725c48a9e9 commit 9940c974029ba53fc00696b3fa1784725c48a9e9 Author: Mark Johnston AuthorDate: 2025-07-07 15:02:36 +0000 Commit: Mark Johnston CommitDate: 2025-07-07 15:41:57 +0000 random: Change the entropy harvest event queuing scheme The entropy queue stores entropy gathered from environmental sources. Periodically (every 100ms currently), the random kthread will drain this queue and mix it into the CSPRNG's entropy pool(s). The old scheme uses a ring buffer with a mutex to serialize producers, while the sole consumer, the random kthread, avoids using a mutex on the basis that no serialization is needed since nothing else is updating the consumer index. On platforms without total store ordering, however, this isn't sufficient: when a producer inserts a queue entry and updates `ring.in`, there is no guarantee that the consumer will see the updated queue entry upon observing the updated producer index. That is, the update to `ring.in` may be visible before the updated queue entry is visible. As a result, we could end up mixing in zero'ed queue entries, though this race is fairly unlikely in practice given how infrequently the kthread runs. The easiest way to fix this is to make the kthread acquire the mutex as well, and hold it while processing queue entries. However, this might result in a long hold time if there are many queue entries, and we really want the hold times to be short, e.g., to avoid delaying interrupt processing. We could introduce a proper MPSC queue, but this is probably overcomplicated for a consumer which runs at 10Hz. Instead, define two buffers, always with one designated as the "active" buffer. Producers queue entries in the active buffer, and the kthread uses the mutex to atomically flip the two buffers, so it can process entries from the inactive buffer without holding the mutex. This requires more memory, but keeps mutex hold times short and lets us keep the queue implementation very simple. Reviewed by: cem MFC after: 1 month Sponsored by: Stormshield Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D51112 --- sys/dev/random/random_harvestq.c | 103 +++++++++++++++++---------------------- 1 file changed, 46 insertions(+), 57 deletions(-) diff --git a/sys/dev/random/random_harvestq.c b/sys/dev/random/random_harvestq.c index ee37bda36496..395310b115fb 100644 --- a/sys/dev/random/random_harvestq.c +++ b/sys/dev/random/random_harvestq.c @@ -131,30 +131,14 @@ static struct harvest_context { /* The context of the kernel thread processing harvested entropy */ struct proc *hc_kthread_proc; /* - * Lockless ring buffer holding entropy events - * If ring.in == ring.out, - * the buffer is empty. - * If ring.in != ring.out, - * the buffer contains harvested entropy. - * If (ring.in + 1) == ring.out (mod RANDOM_RING_MAX), - * the buffer is full. - * - * NOTE: ring.in points to the last added element, - * and ring.out points to the last consumed element. - * - * The ring.in variable needs locking as there are multiple - * sources to the ring. Only the sources may change ring.in, - * but the consumer may examine it. - * - * The ring.out variable does not need locking as there is - * only one consumer. Only the consumer may change ring.out, - * but the sources may examine it. + * A pair of buffers for queued events. New events are added to the + * active queue while the kthread processes the other one in parallel. */ - struct entropy_ring { + struct entropy_buffer { struct harvest_event ring[RANDOM_RING_MAX]; - volatile u_int in; - volatile u_int out; - } hc_entropy_ring; + u_int pos; + } hc_entropy_buf[2]; + u_int hc_active_buf; struct fast_entropy_accumulator { volatile u_int pos; uint32_t buf[RANDOM_ACCUM_MAX]; @@ -183,37 +167,41 @@ random_harvestq_fast_process_event(struct harvest_event *event) static void random_kthread(void) { - u_int maxloop, ring_out, i; + struct harvest_context *hc; - /* - * Locking is not needed as this is the only place we modify ring.out, and - * we only examine ring.in without changing it. Both of these are volatile, - * and this is a unique thread. - */ + hc = &harvest_context; for (random_kthread_control = 1; random_kthread_control;) { - /* Deal with events, if any. Restrict the number we do in one go. */ - maxloop = RANDOM_RING_MAX; - while (harvest_context.hc_entropy_ring.out != harvest_context.hc_entropy_ring.in) { - ring_out = (harvest_context.hc_entropy_ring.out + 1)%RANDOM_RING_MAX; - random_harvestq_fast_process_event(harvest_context.hc_entropy_ring.ring + ring_out); - harvest_context.hc_entropy_ring.out = ring_out; - if (!--maxloop) - break; - } + struct entropy_buffer *buf; + u_int entries; + + /* Deal with queued events. */ + RANDOM_HARVEST_LOCK(); + buf = &hc->hc_entropy_buf[hc->hc_active_buf]; + entries = buf->pos; + buf->pos = 0; + hc->hc_active_buf = (hc->hc_active_buf + 1) % + nitems(hc->hc_entropy_buf); + RANDOM_HARVEST_UNLOCK(); + for (u_int i = 0; i < entries; i++) + random_harvestq_fast_process_event(&buf->ring[i]); + + /* Poll sources of noise. */ random_sources_feed(); + /* XXX: FIX!! Increase the high-performance data rate? Need some measurements first. */ - for (i = 0; i < RANDOM_ACCUM_MAX; i++) { - if (harvest_context.hc_entropy_fast_accumulator.buf[i]) { - random_harvest_direct(harvest_context.hc_entropy_fast_accumulator.buf + i, sizeof(harvest_context.hc_entropy_fast_accumulator.buf[0]), RANDOM_UMA); - harvest_context.hc_entropy_fast_accumulator.buf[i] = 0; + for (u_int i = 0; i < RANDOM_ACCUM_MAX; i++) { + if (hc->hc_entropy_fast_accumulator.buf[i]) { + random_harvest_direct(&hc->hc_entropy_fast_accumulator.buf[i], + sizeof(hc->hc_entropy_fast_accumulator.buf[0]), RANDOM_UMA); + hc->hc_entropy_fast_accumulator.buf[i] = 0; } } /* XXX: FIX!! This is a *great* place to pass hardware/live entropy to random(9) */ - tsleep_sbt(&harvest_context.hc_kthread_proc, 0, "-", + tsleep_sbt(&hc->hc_kthread_proc, 0, "-", SBT_1S/RANDOM_KTHREAD_HZ, 0, C_PREL(1)); } random_kthread_control = -1; - wakeup(&harvest_context.hc_kthread_proc); + wakeup(&hc->hc_kthread_proc); kproc_exit(0); /* NOTREACHED */ } @@ -435,7 +423,7 @@ random_harvestq_init(void *unused __unused) hc_source_mask = almost_everything_mask; RANDOM_HARVEST_INIT_LOCK(); - harvest_context.hc_entropy_ring.in = harvest_context.hc_entropy_ring.out = 0; + harvest_context.hc_active_buf = 0; } SYSINIT(random_device_h_init, SI_SUB_RANDOM, SI_ORDER_THIRD, random_harvestq_init, NULL); @@ -540,9 +528,9 @@ SYSUNINIT(random_device_h_init, SI_SUB_RANDOM, SI_ORDER_THIRD, random_harvestq_d * This is supposed to be fast; do not do anything slow in here! * It is also illegal (and morally reprehensible) to insert any * high-rate data here. "High-rate" is defined as a data source - * that will usually cause lots of failures of the "Lockless read" - * check a few lines below. This includes the "always-on" sources - * like the Intel "rdrand" or the VIA Nehamiah "xstore" sources. + * that is likely to fill up the buffer in much less than 100ms. + * This includes the "always-on" sources like the Intel "rdrand" + * or the VIA Nehamiah "xstore" sources. */ /* XXXRW: get_cyclecount() is cheap on most modern hardware, where cycle * counters are built in, but on older hardware it will do a real time clock @@ -551,28 +539,29 @@ SYSUNINIT(random_device_h_init, SI_SUB_RANDOM, SI_ORDER_THIRD, random_harvestq_d void random_harvest_queue_(const void *entropy, u_int size, enum random_entropy_source origin) { + struct harvest_context *hc; + struct entropy_buffer *buf; struct harvest_event *event; - u_int ring_in; - KASSERT(origin >= RANDOM_START && origin < ENTROPYSOURCE, ("%s: origin %d invalid\n", __func__, origin)); + KASSERT(origin >= RANDOM_START && origin < ENTROPYSOURCE, + ("%s: origin %d invalid", __func__, origin)); + + hc = &harvest_context; RANDOM_HARVEST_LOCK(); - ring_in = (harvest_context.hc_entropy_ring.in + 1)%RANDOM_RING_MAX; - if (ring_in != harvest_context.hc_entropy_ring.out) { - /* The ring is not full */ - event = harvest_context.hc_entropy_ring.ring + ring_in; + buf = &hc->hc_entropy_buf[hc->hc_active_buf]; + if (buf->pos < RANDOM_RING_MAX) { + event = &buf->ring[buf->pos++]; event->he_somecounter = random_get_cyclecount(); event->he_source = origin; - event->he_destination = harvest_context.hc_destination[origin]++; + event->he_destination = hc->hc_destination[origin]++; if (size <= sizeof(event->he_entropy)) { event->he_size = size; memcpy(event->he_entropy, entropy, size); - } - else { + } else { /* Big event, so squash it */ event->he_size = sizeof(event->he_entropy[0]); event->he_entropy[0] = jenkins_hash(entropy, size, (uint32_t)(uintptr_t)event); } - harvest_context.hc_entropy_ring.in = ring_in; } RANDOM_HARVEST_UNLOCK(); } From nobody Mon Jul 7 15:44:00 2025 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 4bbT745b46z6211k; Mon, 07 Jul 2025 15:44:00 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbT744s5Zz4G6h; Mon, 07 Jul 2025 15:44:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751903040; 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=hl09G+V9B5axLtWjIG/NV0Rhcwh2iIgYqGorQUORNi0=; b=V8dh714hQIvN4xMy+ONbQuzlrC8cKqjwFDyLWrR3UQ0sZWoYOBUKJlE6E7m8Tjqh4YCC20 OILQFPCHjj4PhmgqmGjZDBki3siAbkoJfkGqn1PaaA23PUHaGWtC5mBq28oQrW2uLYSjDx 8rR6er7UbYm43E1noHbIJk4FeoawVw+AAMv24a0WZV0zFJNsqHN5OPUfnELgI7xafk4+q0 GZridzOcz1jY/ZFO14JbzH1uu9w1+dLpp29NM8GSnaUXAjjUzdnOTjybtUYKO/ftjWO/Ko jRm3gEBeY06ANnYGVnOSIztKuOQMIUyiGENF/yYu6KfTOVFTQlfYMol1yyJ6Kw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751903040; 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=hl09G+V9B5axLtWjIG/NV0Rhcwh2iIgYqGorQUORNi0=; b=YOWPo0MH6wAOTOCPCMGgTr5IRwn9cKJKP/xcbxr9NfG4nFofHROlM76KxDG0Hh6apDtku7 ydbx6G7cvyGaOkLpYtf3wDMH/iSlY8tNnP/hzbM2CBYenlPAnuvsurxV0Sf0W0IyAU92KF pE+LyZDXhNBGVW/TfEHNOR5aIhWnpJsYsok2vM8wCsJYx6TowTmd7Re7GXZqcHXyMujsmq ViyEvfcqkFGeG4jt9arWXlVes+PCZIiT8iguesWSs4pS5MR8qrxnrbfLAPWChlT/Y0+200 D8Jjtkbxf0ysFvnj7MNKxlpmbwuEGHuhpAjVLHV6uRvq8/9pJPF1B7CDM9hS9g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751903040; a=rsa-sha256; cv=none; b=S5mlqqTayWVe2ZX6+nfElH5RMK0VGLVWlOuXWU5FhMNmXYsKqiaRPlmXeXygIzEwB7Auqh aRvL9atCV9SfQ3efXEqu21AhE6T3aO7YoppCs8e3fNVnp95esaxY6xpN275VGHFioPyzEH 7arWUddsXMEszJtJ7XiijlMXVDeNcPNym8GlwK9JykKnJPjGY/kZdYB7JtixdNH4xfhAg/ e7YVhqXcvkP4Tj2u53kekVmCzkd2QjPDS/XXTb3fsbijvkuPjQ1yRXhzDjg7E/8kQND+Ps HpRNmW1O9t78oZdJIyiaDyXvfM5TQXMsvzdZa/yk+XcFThuChoh1NL9if76lQA== 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 4bbT744RGYzxCl; Mon, 07 Jul 2025 15:44:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567Fi0EY092404; Mon, 7 Jul 2025 15:44:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567Fi0ZJ092401; Mon, 7 Jul 2025 15:44:00 GMT (envelope-from git) Date: Mon, 7 Jul 2025 15:44:00 GMT Message-Id: <202507071544.567Fi0ZJ092401@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: eda96744b434 - main - lposix: Clean up the posix namespace definitions 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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/main X-Git-Reftype: branch X-Git-Commit: eda96744b434325c475dce449744f2268f1033e8 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=eda96744b434325c475dce449744f2268f1033e8 commit eda96744b434325c475dce449744f2268f1033e8 Author: Mark Johnston AuthorDate: 2025-07-07 15:43:27 +0000 Commit: Mark Johnston CommitDate: 2025-07-07 15:43:27 +0000 lposix: Clean up the posix namespace definitions The posix module is subdivided according to C headers; for instance, posix.unistd contains routines available from unistd.h, such as chown(2). A quirk of our implementation is that each of the modules is a direct entry in the global table. That is, there is no "posix" table. Instead, "posix.foo" and "posix.bar.baz" are both top-level tables. This is surprising and goes against Lua's shorthand of using "." to access keys in a table. lua-posix also doesn't work this way. Rework things so that "posix" and "posix.sys" are proper tables. Existing flua code which uses require() to bind posix submodules to a name will be unaffected. Code which accesses them directly using something like _G["posix.sys.utsname"].uname() will be broken, but I don't think anything like that exists. In particular, it is now possible to call posix.sys.utsname.uname() without any require statements. Reviewed by: imp, bapt MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D51158 --- libexec/flua/linit_flua.c | 10 +-------- libexec/flua/modules/lposix.c | 51 +++++++++++++++++++++++++++++++++---------- libexec/flua/modules/lposix.h | 8 +------ 3 files changed, 42 insertions(+), 27 deletions(-) diff --git a/libexec/flua/linit_flua.c b/libexec/flua/linit_flua.c index 8eaa4af1ffca..b466b7872158 100644 --- a/libexec/flua/linit_flua.c +++ b/libexec/flua/linit_flua.c @@ -57,18 +57,11 @@ static const luaL_Reg loadedlibs[] = { #endif /* FreeBSD Extensions */ {"lfs", luaopen_lfs}, - {"posix.fnmatch", luaopen_posix_fnmatch}, - {"posix.libgen", luaopen_posix_libgen}, - {"posix.stdlib", luaopen_posix_stdlib}, - {"posix.sys.stat", luaopen_posix_sys_stat}, - {"posix.sys.utsname", luaopen_posix_sys_utsname}, - {"posix.sys.wait", luaopen_posix_sys_wait}, - {"posix.unistd", luaopen_posix_unistd}, + {"posix", luaopen_posix}, {"fbsd", luaopen_fbsd}, {NULL, NULL} }; - LUALIB_API void luaL_openlibs (lua_State *L) { const luaL_Reg *lib; /* "require" functions from 'loadedlibs' and set results to global table */ @@ -77,4 +70,3 @@ LUALIB_API void luaL_openlibs (lua_State *L) { lua_pop(L, 1); /* remove lib */ } } - diff --git a/libexec/flua/modules/lposix.c b/libexec/flua/modules/lposix.c index 9edc7e687786..75cdd345aeaa 100644 --- a/libexec/flua/modules/lposix.c +++ b/libexec/flua/modules/lposix.c @@ -590,21 +590,21 @@ static const struct luaL_Reg unistdlib[] = { #undef REG_SIMPLE #undef REG_DEF -int +static int luaopen_posix_libgen(lua_State *L) { luaL_newlib(L, libgenlib); return (1); } -int +static int luaopen_posix_stdlib(lua_State *L) { luaL_newlib(L, stdliblib); return (1); } -int +static int luaopen_posix_fnmatch(lua_State *L) { luaL_newlib(L, fnmatchlib); @@ -622,14 +622,21 @@ luaopen_posix_fnmatch(lua_State *L) return 1; } -int +static int luaopen_posix_sys_stat(lua_State *L) { luaL_newlib(L, sys_statlib); return (1); } -int +static int +luaopen_posix_sys_utsname(lua_State *L) +{ + luaL_newlib(L, sys_utsnamelib); + return 1; +} + +static int luaopen_posix_sys_wait(lua_State *L) { luaL_newlib(L, sys_waitlib); @@ -655,16 +662,38 @@ luaopen_posix_sys_wait(lua_State *L) return (1); } -int -luaopen_posix_sys_utsname(lua_State *L) +static int +luaopen_posix_unistd(lua_State *L) { - luaL_newlib(L, sys_utsnamelib); - return 1; + luaL_newlib(L, unistdlib); + return (1); } int -luaopen_posix_unistd(lua_State *L) +luaopen_posix(lua_State *L) { - luaL_newlib(L, unistdlib); + lua_newtable(L); /* posix */ + + luaL_requiref(L, "posix.fnmatch", luaopen_posix_fnmatch, 0); + lua_setfield(L, -2, "fnmatch"); + + luaL_requiref(L, "posix.libgen", luaopen_posix_libgen, 0); + lua_setfield(L, -2, "libgen"); + + luaL_requiref(L, "posix.stdlib", luaopen_posix_stdlib, 0); + lua_setfield(L, -2, "stdlib"); + + lua_newtable(L); /* posix.sys */ + luaL_requiref(L, "posix.sys.stat", luaopen_posix_sys_stat, 0); + lua_setfield(L, -2, "stat"); + luaL_requiref(L, "posix.sys.utsname", luaopen_posix_sys_utsname, 0); + lua_setfield(L, -2, "utsname"); + luaL_requiref(L, "posix.sys.wait", luaopen_posix_sys_wait, 0); + lua_setfield(L, -2, "wait"); + lua_setfield(L, -2, "sys"); + + luaL_requiref(L, "posix.unistd", luaopen_posix_unistd, 0); + lua_setfield(L, -2, "unistd"); + return (1); } diff --git a/libexec/flua/modules/lposix.h b/libexec/flua/modules/lposix.h index da7079056826..1aa33f042571 100644 --- a/libexec/flua/modules/lposix.h +++ b/libexec/flua/modules/lposix.h @@ -7,10 +7,4 @@ #include -int luaopen_posix_fnmatch(lua_State *L); -int luaopen_posix_libgen(lua_State *L); -int luaopen_posix_stdlib(lua_State *L); -int luaopen_posix_sys_stat(lua_State *L); -int luaopen_posix_sys_utsname(lua_State *L); -int luaopen_posix_sys_wait(lua_State *L); -int luaopen_posix_unistd(lua_State *L); +int luaopen_posix(lua_State *L); From nobody Mon Jul 7 16:34:37 2025 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 4bbVFV354hz60d9m; Mon, 07 Jul 2025 16:34:38 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbVFT5J5vz3JCd; Mon, 07 Jul 2025 16:34:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751906077; 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=KDdGNI9K9+BXr1BMx4g3R+kzp7CgtCr1yPKW0cpmgRY=; b=f5YcfyVONmLTnnXvH1MqtehM89Qo4tWsK2aJMR+a+e50CcWUVdHX3LM05kM45+a0cppMpt bO+KLQrqBHJAqmkFT3o2YZ32WrMNRO8YQDXUgB0aCtI5CHguPp+of2PYQiNr1Kpk+W0dCP UF2/lPeMvTS+s+Y+iNz71tddXB4txsFndaFbmPqvzou/vC65lc6gKzl6ySjaMJj04mhJai o63FotZ7OwfFcHZVmGxuwwDp2oQwmqhivuh5TY1IR1FpO1Og7fUN6naOmpray/ash6dz/9 5pmTA9sN68M5PdJgdpacMVpa8IlHzgec1M3woi95eKvfIyNwsfJmD5jTBK0dtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751906077; 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=KDdGNI9K9+BXr1BMx4g3R+kzp7CgtCr1yPKW0cpmgRY=; b=x3F5JuihtwaAQI0HlJBeXv43S8r1EpaaWVPYxVWkI9dqslhaINuUfZ+CuyYdDN/Y0YAzih nP2NnBdXBwsHkeZCXUKWx6nb1Cw/fUZIqPQ7T0PNqkjFO/B1QGqIhxk/E06IrxYEAtFBQX OL6LiQo54DQ5Yo2EtgF/t8a7LzqLMmHNtiH2zDhu9NLuTEZQA8av1W7Ks4ZMhlwOLiQOUp BkC2diGt05OOP5DMIaHCMjyIKgPsx06sfLsg775hXnRw89U7deYfy5JnkkE6STvzHPuiVW rU+B53TiwRypi4o/V5mejJXtBbJeKPffY4Ba4zb+SO1cxdUBIt+lcPZ+6c8YPg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751906077; a=rsa-sha256; cv=none; b=sJmghjF5PyMmsja7u3iqvYXiQuVKGJA5SoPaULY1HSRWAo2w5d7N9O2Jc29XBkBfm9lBW/ Bb2sjkrBYCdc40fd4TZcghAw82nom73QkQsfOxdbKCmA9k/gEZHJLkpsUq6Wq8ncNDTofU h7bqFsOCgGq7djQHb35ctfmLamd9y/Un7gTR/SVKCIu7DL8VPet/FHSIzyYumj43ObGXME ncFeZwfcYkrHnJMqikxcC7TGbmdIBgu/a2CUHvNyfjEeRGF3fRNEumOnYYWJ6jHB2+wFsW 4x3pK/vPlvrXayc0FPSOPnpvSoTfWrenAH5lMs7hxdPRAHh+TdYb04+0WKFZFA== 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 4bbVFT30bMzym7; Mon, 07 Jul 2025 16:34:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567GYb5h086857; Mon, 7 Jul 2025 16:34:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567GYbQt086854; Mon, 7 Jul 2025 16:34:37 GMT (envelope-from git) Date: Mon, 7 Jul 2025 16:34:37 GMT Message-Id: <202507071634.567GYbQt086854@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 96f544bcc1cb - main - tcp: don't allow to connect a TCP/IPv6 endpoint in TIME WAIT state 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 96f544bcc1cb641ab096812c168ebe9136e78c15 Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=96f544bcc1cb641ab096812c168ebe9136e78c15 commit 96f544bcc1cb641ab096812c168ebe9136e78c15 Author: Michael Tuexen AuthorDate: 2025-07-07 16:29:35 +0000 Commit: Michael Tuexen CommitDate: 2025-07-07 16:29:35 +0000 tcp: don't allow to connect a TCP/IPv6 endpoint in TIME WAIT state This ensures the TCP/IPv4 and TCP/IPv6 behave the same. Reported by: syzbot+4de353ba85dac4dcb1ab@syzkaller.appspotmail.com Reviewed by: Peter Lei MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D51125 --- sys/netinet/tcp_usrreq.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index 3ea561e63503..687b0d538666 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -1520,7 +1520,8 @@ tcp6_connect(struct tcpcb *tp, struct sockaddr_in6 *sin6, struct thread *td) INP_WLOCK_ASSERT(inp); if (__predict_false((so->so_state & - (SS_ISCONNECTING | SS_ISCONNECTED)) != 0)) + (SS_ISCONNECTING | SS_ISCONNECTED | SS_ISDISCONNECTING | + SS_ISDISCONNECTED)) != 0)) return (EISCONN); if (__predict_false((so->so_options & SO_REUSEPORT_LB) != 0)) return (EOPNOTSUPP); From nobody Mon Jul 7 17:23:00 2025 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 4bbWKK22SWz60kZn; Mon, 07 Jul 2025 17:23:01 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbWKK1Wytz3dQj; Mon, 07 Jul 2025 17:23:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751908981; 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=r236bkBBXQUJ2801xKVFWANPKGfcRHX7GzwE68BQE3M=; b=M3BmzKKReVlOXQto2X61BudBGgmAJ9s4LV8QJVAKs6ELYK1YVFngvZ8r8WG3CyCG/L7oaE TmizblPoztE3iOqAYHypNWTv9Pt0Mxw8TvLKLZvR4cNJD/O9YXmfZ6Z9nhLsMegzvQ+gRf cgHMP3itmC3BZc5R8ADYm0jFm60LbUlTtkXIR+J+isaIUjRCBQN5FOYa69PeU4uUa9jwi8 ioB9jeSpEEBZuCfTB1MdYCL9Bj1bJs55Rkj9xX1pvauTSeAWuDAFP5DbGAy2ZfFpL9FP9+ +n6cOI1uzUA98X4ufrHsymnxAW4Tpf8i33uF+wdMS99eQdORZMKxMKjD/nyeSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751908981; 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=r236bkBBXQUJ2801xKVFWANPKGfcRHX7GzwE68BQE3M=; b=hXWqpF0ftCkgcPHXtHgnpvGHHyFMIH6Cq1llrvfcys9Q+8pupnmDBPE1WMNn2dI1lH4LMj WFfRqB5+NDN68MClFXrmP0sGR8OEWc2WRQ6QLZL4QWKGwgGto8nPx4yFoVJV7VymOwJN+F fdYsKGme3sydnrfOV6jJ9RTpo0djRhHq/lmCPVpnpmM9tPUMaAqfd3ZTV4mfpkWyFRCj0w eUzH2mFpaWjpr2TnJJPjc22ReDlHS6adt8VjsZaG6Jo6aUJu3PseoqL7sGpl/mCCToYJGT 3biZauJSOYZ6ysx5p9p56764ToaPHTSPCcx/pVR777IzvXvmYnEU8nM9PePmUQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751908981; a=rsa-sha256; cv=none; b=CD4dq28vAd886M69TUmBLfMVLImK+wqDQw5U2PzOKghytZrB6uo3gW7WnVqkW6Ua55Rsxc c+B7r2M7SyoL9fc+KzSm4zTdWQmmlxomkBlZ0SHWF+NXykUt5Cg9g0OcXFNQAR1wKTb7il Du+W1XKKLF1P9ZEeCMYEMiyNj2UDrQjXmSJ8sccXYmLb/Gu8plVSWEanB1PmK+87l9qxUq 0wIfRQf6mjK+J7ktuKRBn2tdn9cYwu1wrn48vltSBwKXnMfIgmQdoVTZQy5cz6iPoJ/N5q rKLd3MGx7jitXeplaEcgFowxO70KEZVFUdZM2yrQjXyVZDWt0Crm/FbUxkEqeA== 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 4bbWKK1717z10Zy; Mon, 07 Jul 2025 17:23:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567HN0Dw080597; Mon, 7 Jul 2025 17:23:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567HN09V080594; Mon, 7 Jul 2025 17:23:00 GMT (envelope-from git) Date: Mon, 7 Jul 2025 17:23:00 GMT Message-Id: <202507071723.567HN09V080594@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: fe1cd734a176 - main - mfiutil: Change mfi_autolearn_(period|mode) to write to a FILE 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: fe1cd734a17603f9b237c5bb08a9e29f2b4898ee Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=fe1cd734a17603f9b237c5bb08a9e29f2b4898ee commit fe1cd734a17603f9b237c5bb08a9e29f2b4898ee Author: John Baldwin AuthorDate: 2025-07-07 16:36:47 +0000 Commit: John Baldwin CommitDate: 2025-07-07 16:36:47 +0000 mfiutil: Change mfi_autolearn_(period|mode) to write to a FILE This avoids using fragile logic with snprintf() to build strings. For the calling code in mfi_show.c, I chose to pass stdout directly instead of using fmemopen() to write to the temporary buffer since that is simpler and avoids having to deal with output truncation. Differential Revision: https://reviews.freebsd.org/D50881 --- usr.sbin/mfiutil/mfi_bbu.c | 40 +++++++++++----------------------------- usr.sbin/mfiutil/mfi_show.c | 10 ++++++---- usr.sbin/mfiutil/mfiutil.h | 4 ++-- 3 files changed, 19 insertions(+), 35 deletions(-) diff --git a/usr.sbin/mfiutil/mfi_bbu.c b/usr.sbin/mfiutil/mfi_bbu.c index e97227d47c70..aa685e438453 100644 --- a/usr.sbin/mfiutil/mfi_bbu.c +++ b/usr.sbin/mfiutil/mfi_bbu.c @@ -40,41 +40,23 @@ /* The autolearn period is given in seconds. */ void -mfi_autolearn_period(uint32_t period, char *buf, size_t sz) +mfi_autolearn_period(FILE *fp, uint32_t period) { unsigned int d, h; - char *tmp; d = period / (24 * 3600); h = (period % (24 * 3600)) / 3600; - tmp = buf; if (d != 0) { - int fmt_len; - fmt_len = snprintf(buf, sz, "%u day%s", d, d == 1 ? "" : "s"); - if (fmt_len < 0) { - *buf = 0; - return; - } - if ((size_t)fmt_len >= sz) { - return; - } - tmp += fmt_len; - sz -= tmp - buf; - if (h != 0) { - fmt_len = snprintf(tmp, sz, ", "); - if (fmt_len < 0 || (size_t)fmt_len >= sz) { - return; - } - tmp += fmt_len; - sz -= 2; - } + fprintf(fp, "%u day%s", d, d == 1 ? "" : "s"); + if (h != 0) + fprintf(fp, ", "); } if (h != 0) - snprintf(tmp, sz, "%u hour%s", h, h == 1 ? "" : "s"); + fprintf(fp, "%u hour%s", h, h == 1 ? "" : "s"); if (d == 0 && h == 0) - snprintf(tmp, sz, "less than 1 hour"); + fprintf(fp, "less than 1 hour"); } /* The time to the next relearn is given in seconds since 1/1/2000. */ @@ -96,21 +78,21 @@ mfi_next_learn_time(uint32_t next_learn_time, char *buf, size_t sz) } void -mfi_autolearn_mode(uint8_t mode, char *buf, size_t sz) +mfi_autolearn_mode(FILE *fp, uint8_t mode) { switch (mode) { case 0: - snprintf(buf, sz, "enabled"); + fprintf(fp, "enabled"); break; case 1: - snprintf(buf, sz, "disabled"); + fprintf(fp, "disabled"); break; case 2: - snprintf(buf, sz, "warn via event"); + fprintf(fp, "warn via event"); break; default: - snprintf(buf, sz, "mode 0x%02x", mode); + fprintf(fp, "mode 0x%02x", mode); break; } } diff --git a/usr.sbin/mfiutil/mfi_show.c b/usr.sbin/mfiutil/mfi_show.c index bf85c8b82d69..2d413f2a46b4 100644 --- a/usr.sbin/mfiutil/mfi_show.c +++ b/usr.sbin/mfiutil/mfi_show.c @@ -218,8 +218,9 @@ show_battery(int ac, char **av __unused) printf(" Current Voltage: %d mV\n", stat.voltage); printf(" Temperature: %d C\n", stat.temperature); if (show_props) { - mfi_autolearn_period(props.auto_learn_period, buf, sizeof(buf)); - printf(" Autolearn period: %s\n", buf); + printf(" Autolearn period: "); + mfi_autolearn_period(stdout, props.auto_learn_period); + printf("\n"); if (props.auto_learn_mode != 0) snprintf(buf, sizeof(buf), "never"); else @@ -229,8 +230,9 @@ show_battery(int ac, char **av __unused) printf(" Learn delay interval: %u hour%s\n", props.learn_delay_interval, props.learn_delay_interval != 1 ? "s" : ""); - mfi_autolearn_mode(props.auto_learn_mode, buf, sizeof(buf)); - printf(" Autolearn mode: %s\n", buf); + printf(" Autolearn mode: "); + mfi_autolearn_mode(stdout, props.auto_learn_mode); + printf("\n"); if (props.bbu_mode != 0) printf(" BBU Mode: %d\n", props.bbu_mode); } diff --git a/usr.sbin/mfiutil/mfiutil.h b/usr.sbin/mfiutil/mfiutil.h index 34b423098862..86b03998163c 100644 --- a/usr.sbin/mfiutil/mfiutil.h +++ b/usr.sbin/mfiutil/mfiutil.h @@ -175,9 +175,9 @@ int mfi_bbu_get_props(int fd, struct mfi_bbu_properties *props, uint8_t *statusp); int mfi_bbu_set_props(int fd, struct mfi_bbu_properties *props, uint8_t *statusp); -void mfi_autolearn_period(uint32_t, char *, size_t); +void mfi_autolearn_period(FILE *, uint32_t); void mfi_next_learn_time(uint32_t, char *, size_t); -void mfi_autolearn_mode(uint8_t, char *, size_t); +void mfi_autolearn_mode(FILE *, uint8_t); int get_mfi_unit(const char *dev); char *get_mfi_type(const char *dev); From nobody Mon Jul 7 17:23:01 2025 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 4bbWKL2jPXz60kVM; Mon, 07 Jul 2025 17:23:02 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbWKK59Jqz3dQk; Mon, 07 Jul 2025 17:23:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751908981; 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=pRVeQkYsmiWTkLQ/D+RukGryFJ6jk2U2HlFI1GXVFKo=; b=YzO7IfJbleH3vnrMytYpEIO0ThidC76KiivA8Z8tA8BwrqeZdp8WdyrGLtvc7uJ7x/JWw9 SBWVSyDC3193uUaNhh+MOgMCJALD5v/9KzGgI7r73pzTvn4Ibl8DuPVfLkR6HsSSkXJfws BDwV/46glNMpX/OQw8o5OdgeFEIsddSs/T7zKsaw/jX0p5e6XVCLAXEi9dcx1BxbivWAUE jSR1Ei8mH8ytzKGzxdqn+CRy+/qro1jGm+Q3Dx50vPUwFFXcXCAsmiNGuVK1RMWl7R09V5 TGiDSl5BxVTWxna/QfCWVtFqLZbtI6cNOoCnevyhSAZ2kOsjdF2KJg2IjLW5YA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751908981; 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=pRVeQkYsmiWTkLQ/D+RukGryFJ6jk2U2HlFI1GXVFKo=; b=WW9We64EYFglr3P0vl2NkKbDsT/xfDJwkhkUwoucjkVgajH3LJvddy7kAZ00T8dBWLa+Hn 2/dZ9qo1AqOlr3tEHdyBhvOVYXz3Ntlu85zwg45GMZJuvkUNNsAbk04Kk2SSHykT8indi9 MmPJu0SHsoGRcfzfkRJJzBEDlyqH0cBqhGtU9UoSQbVtjvq/+Bq1D/vhQPNjNlrDfGq9dT N2QGpJJU2syXN12TolbnaRrkthUQSFuSKUn56VbwCvA56VUbMm+aNBbe+8eYhXq0dGEjw5 fh/wR2q/E3RvD3d855Fxwu3SHBvo/0ZEWAFlXiFEsKHruVO1Ul2WZ1BZSBMQWg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751908981; a=rsa-sha256; cv=none; b=cjsWfh59TGdrKk2aIoP620lrLqT5fI6Hh1RiLIyamMSmyzsf3Uy9SXTmXtTQeSjE3vZ3S9 AyAwe3JW6LJmaiCdsY3E9uRmtw35KjZ7Erd/+eJlqxh6EmxHQ1XtQotoO3JC3jXXDDuAft XmgffipI5aMrnxcFir+OPP3A9uLjIVEW3uxJBRzdBZQCMFAdJKHgCkBa2N+zZAefRzzxre fi7t4t6PHmu7Fn2G+E+LThivOLdfEEG81p9weAh8rG2qNtyUwoAAcNDG2bG4fPidQyf/1G PlesIM9eOigh3uEOXacrlzWny9dE3w/AjwgJsKj9LEadIzJrS0A9rjGBO4zlcw== 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 4bbWKK30bcz10b0; Mon, 07 Jul 2025 17:23:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567HN1QO080631; Mon, 7 Jul 2025 17:23:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567HN1uk080628; Mon, 7 Jul 2025 17:23:01 GMT (envelope-from git) Date: Mon, 7 Jul 2025 17:23:01 GMT Message-Id: <202507071723.567HN1uk080628@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: 10ed5b90e46f - main - mfiutil: Handle truncation in mfi_next_learn_time 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 10ed5b90e46f5df329f511c08bd55458f95f1b6c Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=10ed5b90e46f5df329f511c08bd55458f95f1b6c commit 10ed5b90e46f5df329f511c08bd55458f95f1b6c Author: John Baldwin AuthorDate: 2025-07-07 16:37:09 +0000 Commit: John Baldwin CommitDate: 2025-07-07 16:37:09 +0000 mfiutil: Handle truncation in mfi_next_learn_time Only trim the trailing newline if the output from ctime() was not truncated. To simplify the code, use strlcpy() instead of snprintf() since strlcpy() can't fail with a negative size (and the previous code probably didn't handle those errors properly given the int -> size_t conversion). Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D50882 --- usr.sbin/mfiutil/mfi_bbu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/mfiutil/mfi_bbu.c b/usr.sbin/mfiutil/mfi_bbu.c index aa685e438453..3e78e791dfc2 100644 --- a/usr.sbin/mfiutil/mfi_bbu.c +++ b/usr.sbin/mfiutil/mfi_bbu.c @@ -71,8 +71,8 @@ mfi_next_learn_time(uint32_t next_learn_time, char *buf, size_t sz) tm.tm_year = 100; basetime = timegm(&tm); basetime += (time_t)next_learn_time; - len = snprintf(buf, sz, "%s", ctime(&basetime)); - if (len > 0) + len = strlcpy(buf, ctime(&basetime), sz); + if (len < sz) /* Get rid of the newline added by ctime(3). */ buf[len - 1] = '\0'; } From nobody Mon Jul 7 17:23:02 2025 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 4bbWKL6RMMz60kqZ; Mon, 07 Jul 2025 17:23:02 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbWKL4DwDz3dJv; Mon, 07 Jul 2025 17:23:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751908982; 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=WUH7CrmpQGitXyfkhMpTF0xyjNwPmKZAFatBJobGNcA=; b=ZWXGenFPU35Ubcr7YAZ/hD2l9k/Bz+wYsstSo08zqY/Eij3um2kbzUG1ycn9p3qu6C4jJG Q2bfuTutpc7+9dN2cNyg/c3ZP0tFI7KzYTxpfMaKKI65WrrPWkPt7G1kyZjjNkWx0/eVRB YvlnDoLJofHHyl7YdnQVnA0kqsMWiLpzk0jWeEim2MO8ZbQWzRkydgUZDVRRljjESM2l/w i+c2bJm5WXyDrk1OUeC/pbwohz2indI2a/TUxboLuJ14bWnJBFPlSDFUIas2hhH77ok09e LyPmhafWnocGBJAmPJ6uihJJRcrLoxSX22SwwvCntqQVQuXuVYK8NptVJDY7Jg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751908982; 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=WUH7CrmpQGitXyfkhMpTF0xyjNwPmKZAFatBJobGNcA=; b=B1DCDqbwBnQOzoMbTTduGu31K+4Xok5lyfBhVaQ1YIPQG2qKnNAIYMXRVSWFGzwgibQeJH hZfD5oq74yCNE6Zguezp1YDkW2TxV/0vT7AP/rwmiDr1BrRLulBv83G/ukSCRt3Rz49RVm SqAW27/vF7DXysITMSTuDVwXvOBM+uA0sL9o6cjZ3S+ZF5TooQWbc+Lg0ghnJ1hoI0LPGu kdSHxTeb9g2QgEKvDy1rob/917RVUrL2LwBOG4bKfUS7mWtzBpjrGP/2UpnhcS916PZJNY rjPmBci7Pw8brGj5tA453wVkugp/RzOGPe+Hfa9GgK0O1Wf0heZ76q88ygFjOg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751908982; a=rsa-sha256; cv=none; b=xgSoWvj42tRFSlYFuxk1ywTVAYeuguPv8nbThlOU/DOcGOtHs+hOBGwJD0NjDHB+63I4ie hO7XtB8y5T6AbylQu9VgpVQPjI7VGevjB7RN1ezWClHkI9h8yqnShe1VCN9a6EvJOX2FLs Se9eRBoKOKukbkpneg9vNAdos7IIN8qXV2ni3QokaTb6ImMSfV6FBZX1gRtCZt+tcNpEPz R8qQjANgoaOFCjiKckURnNtbUvZ539wZYj5vJcBvwcMxRXGeJqYZFwUIIDrxLQ5UgJOk/3 FtRLxeNLkn9V0MMwlFVAGkGT6lK8jwbp+4pXH3EFbBGeFPj6H13MRUrFruTIGQ== 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 4bbWKL3hNKz10XC; Mon, 07 Jul 2025 17:23:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567HN2V9080665; Mon, 7 Jul 2025 17:23:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567HN2Qr080662; Mon, 7 Jul 2025 17:23:02 GMT (envelope-from git) Date: Mon, 7 Jul 2025 17:23:02 GMT Message-Id: <202507071723.567HN2Qr080662@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: 6b7b8575e979 - main - mfiutil: Use sbuf(3) to construct drive names in mfi_drive_name 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 6b7b8575e97980166416886935e8cf376e50d88d Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=6b7b8575e97980166416886935e8cf376e50d88d commit 6b7b8575e97980166416886935e8cf376e50d88d Author: John Baldwin AuthorDate: 2025-07-07 16:37:28 +0000 Commit: John Baldwin CommitDate: 2025-07-07 16:37:28 +0000 mfiutil: Use sbuf(3) to construct drive names in mfi_drive_name This replaces fragile uses of snprintf(). Note that I did not keep the truncation check for the space separator in the middle of the drive name since the same check was not applied to the second part, so the name was truncated anyway. Just truncate the entire result if it doesn't fit. Differential Revision: https://reviews.freebsd.org/D50883 --- usr.sbin/mfiutil/Makefile | 2 +- usr.sbin/mfiutil/mfi_drive.c | 34 ++++++++++++---------------------- 2 files changed, 13 insertions(+), 23 deletions(-) diff --git a/usr.sbin/mfiutil/Makefile b/usr.sbin/mfiutil/Makefile index da1c9249f8cd..85b66d4b6f49 100644 --- a/usr.sbin/mfiutil/Makefile +++ b/usr.sbin/mfiutil/Makefile @@ -9,7 +9,7 @@ MLINKS= mfiutil.8 mrsasutil.8 CFLAGS.gcc+= -fno-builtin-strftime -LIBADD= util +LIBADD= sbuf util # Here be dragons .ifdef DEBUG diff --git a/usr.sbin/mfiutil/mfi_drive.c b/usr.sbin/mfiutil/mfi_drive.c index e8e945c566c4..c7c5aeb02f14 100644 --- a/usr.sbin/mfiutil/mfi_drive.c +++ b/usr.sbin/mfiutil/mfi_drive.c @@ -31,6 +31,7 @@ #include #include +#include #include #include #include @@ -56,9 +57,9 @@ const char * mfi_drive_name(struct mfi_pd_info *pinfo, uint16_t device_id, uint32_t def) { struct mfi_pd_info info; + struct sbuf sb; static char buf[16]; - char *p; - int error, fd, len; + int fd; if ((def & MFI_DNAME_HONOR_OPTS) != 0 && (mfi_opts & (MFI_DNAME_ES|MFI_DNAME_DEVICE_ID)) != 0) @@ -89,40 +90,29 @@ mfi_drive_name(struct mfi_pd_info *pinfo, uint16_t device_id, uint32_t def) pinfo = &info; } - p = buf; - len = sizeof(buf); + sbuf_new(&sb, buf, sizeof(buf), SBUF_FIXEDLEN); if (def & MFI_DNAME_DEVICE_ID) { if (device_id == 0xffff) - error = snprintf(p, len, "MISSING"); + sbuf_printf(&sb, "MISSING"); else - error = snprintf(p, len, "%2u", device_id); - if (error >= 0) { - p += error; - len -= error; - } + sbuf_printf(&sb, "%2u", device_id); } if ((def & (MFI_DNAME_ES|MFI_DNAME_DEVICE_ID)) == - (MFI_DNAME_ES|MFI_DNAME_DEVICE_ID) && len >= 2) { - *p++ = ' '; - len--; - *p = '\0'; - len--; + (MFI_DNAME_ES|MFI_DNAME_DEVICE_ID)) { + sbuf_cat(&sb, " "); } if (def & MFI_DNAME_ES) { if (pinfo->encl_device_id == 0xffff) - error = snprintf(p, len, "S%u", + sbuf_printf(&sb, "S%u", pinfo->slot_number); else if (pinfo->encl_device_id == pinfo->ref.v.device_id) - error = snprintf(p, len, "E%u", + sbuf_printf(&sb, "E%u", pinfo->encl_index); else - error = snprintf(p, len, "E%u:S%u", + sbuf_printf(&sb, "E%u:S%u", pinfo->encl_index, pinfo->slot_number); - if (error >= 0) { - p += error; - len -= error; - } } + sbuf_finish(&sb); return (buf); } From nobody Mon Jul 7 17:26:22 2025 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 4bbWPV5FHKz60lBd; Mon, 07 Jul 2025 17:26:38 +0000 (UTC) (envelope-from rionda@gmail.com) Received: from mail-qk1-x72b.google.com (mail-qk1-x72b.google.com [IPv6:2607:f8b0:4864:20::72b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbWPV34VTz3gDq; Mon, 07 Jul 2025 17:26:38 +0000 (UTC) (envelope-from rionda@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-qk1-x72b.google.com with SMTP id af79cd13be357-7d7f2600c17so217451885a.0; Mon, 07 Jul 2025 10:26:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1751909197; x=1752513997; darn=freebsd.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:sender:from:to:cc:subject :date:message-id:reply-to; bh=Pb4yEwnT4g5FCnSOXIP8RjpIViJLGGLdBKeIpY9MVo8=; b=Ubqf4S46MK39SMecRhFI46Ghx9MiZPdfKvKd9MpfSVAcfCKFoonG9dUD2sdFhXp9nW 8ZfYQ17Zn07Ly7DTkqbVstolHDLDJXXe3fKgAFSZpJWv5Hg6zEstaodBk4Ojk0917syo eUJOhYluQhAYCCkMrlrvqPgjcKxAqhj1Q5wklpcBlU2kc2+PztPGS5eyxTCWYV8BpoBD xqN9ICkcVNkaKqLhckEmFZ6QutlRdKfs8yUqQdOPkj/HZdRvT0JjzH9M/qTHc/IHb4/r fm9rBf28ZfOMcmJ/Pj5Te0RNua0FnSp/q7+RxQFB+34omVHLdazFIjr3FUQ7Dy9UCJPg QcvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751909197; x=1752513997; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:sender:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=Pb4yEwnT4g5FCnSOXIP8RjpIViJLGGLdBKeIpY9MVo8=; b=Y1xMVNImZQ1mjv6/hmQ1llReMgeFVaoRwu8Mp08AgpsLDNLADTPDe+lsBNTf74DMjt qd+T6m3Y7LkMDNWUhOnACD1XuBjgi4uOW2m6qBhZH4AXfDBp21FWQGVGDPqe2Em2j7qP AKEhK+k8nHSlL+t6+FaM/7LBxNH5TkmwQ1rwlIcy/69iG26hbxSa1GHWdNb5sTOgueGp woFKk8OpuKOCYNz+vwUTE5edXDcb3H2/UwcCV2xAn7gEbAL6wZJ3H5W4WF/iZAwUdrid HAWive+BaCT5H3kNKr1zPIOOlHcXXCOqRxKFXWxEGUxcYBhvIhXYelr0cBqIQYBnoIOD ZAvw== X-Forwarded-Encrypted: i=1; AJvYcCUZ4NU2I9UfzOc/c4pTHV/JLuaMFVXNZfzrBCnRdN/EYk46ct85zpC/oANsvGyAgs8I5JTiMCIcFUnRsU92nUTVRaxjqLE=@freebsd.org, AJvYcCVrKl3PIZrauVP9nlNW+pzoXmb+CaN3kG+C1yizzY9aceQv/PlmIqSSI+O++sQIbt3KFiaERB6KIY3D8F5Cs69U76Uv@freebsd.org X-Gm-Message-State: AOJu0YwjO4VX8mQGKen6Je0AHPSwIvaE9KpKyNrXBYADhAFsdMplBj/D h4r3kFSZ4AS0PRWHn544o4xDb3/DdrkOn4k3kvom4VdANg3Sbfl70H/oEHHT7Q== X-Gm-Gg: ASbGncspBgmEPLcIaZ2y1QNr8eRQ71zTF3knVbS452uKgWYttvyhkS7Tq/PN2RenVcN t3c3nC6GXymcmEa7ZPn2npyksmWvWsJxbJxo81L8Iz5dkd0Zg8ctHI6rq0E/e44TEgpCT1nITZM 0IZssted/eysbzhkM/XL+PUuczSv6+QsBCORAhqsFKh1bDOlSmr6OklDpSlW6A/+Uas+r1FP35Y 5e7uSf0JCK2zHsXW3MntkRuC1wzpuBIVlLwoQZkdv5WFzlm9Dveu+oprTtjZZggONO9dHQn7IwE 5rAkbvtMf7KcrIQCwryIZfHVCKkhfy3ku863iJaC7YL5RaxbETCz5OAE8IQV6F+CLPmGHcg+9bs oUpacAjQ9PNWEhw1tfl+ysg== X-Google-Smtp-Source: AGHT+IEjde+iIoRzeS61V2219AArRqdEj+uQPpRAiIiyNAabuiiC2PD+J/WVNZy38QpVvgnYw2+lvw== X-Received: by 2002:a05:620a:444c:b0:7d4:219:50d4 with SMTP id af79cd13be357-7d9ebaa4c91mr28818185a.34.1751909196517; Mon, 07 Jul 2025 10:26:36 -0700 (PDT) Received: from smtpclient.apple ([2607:fb91:daf:87b6:c1f9:c0be:2d0d:a56f]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7d5dbe8f87fsm630718385a.80.2025.07.07.10.26.33 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Jul 2025 10:26:33 -0700 (PDT) Content-Type: text/plain; charset=us-ascii 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6.1.11\)) Subject: Re: git: f8a8bb7bade9 - main - pfctl: Improve duplicate table name warning From: Matteo Riondato In-Reply-To: <202507071507.567F7n8Q016403@gitrepo.freebsd.org> Date: Mon, 7 Jul 2025 13:26:22 -0400 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <81D328A4-8A6C-44DA-861B-D3C067986CBE@FreeBSD.org> References: <202507071507.567F7n8Q016403@gitrepo.freebsd.org> To: Kristof Provost X-Mailer: Apple Mail (2.3731.700.6.1.11) X-Rspamd-Queue-Id: 4bbWPV34VTz3gDq X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] > On Jul 7, 2025, at 11:07 AM, Kristof Provost wrote: >=20 > The branch main has been updated by kp: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3Df8a8bb7bade9575c549cbc94500ba706= b712c650 >=20 > commit f8a8bb7bade9575c549cbc94500ba706b712c650 > Author: Kristof Provost > AuthorDate: 2025-07-01 10:02:03 +0000 > Commit: Kristof Provost > CommitDate: 2025-07-07 15:06:48 +0000 >=20 > pfctl: Improve duplicate table name warning >=20 > When creating tables inside anchors, pfctl warned about namespace > collisions with global tables, but only in certain cases and with > limited information sometimes leaving users clueless. >=20 > Deferring the check to process_tabledefs() where tables are = eventually > created, both anchor and table name are known which allows for = checking > all existing anchors. >=20 > With this, warn on all duplicates even in dry-runs (`-n') and print > quoted names so they can be copied to fix configurations right = away. >=20 > No functional change in parsing or ruleset production. Based only on the commit message, this may fix PR #262295. Thanks, Matteo From nobody Mon Jul 7 17:52:56 2025 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 4bbWzr50Wcz60pP9; Mon, 07 Jul 2025 17:52:56 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbWzr3Ynrz3sl8; Mon, 07 Jul 2025 17:52:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751910776; 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=3IeCCFOoszEe7FhExO8Jemv6Qo0dw5BpHdfa5HidIu8=; b=cbn5f6YO198gkRHnBnjslNDdyZ0VvmIukx/T+2C3DmW+uO9d/gLwBl8PXAku57jkIa29ha 92jVJfukO3bOFzw7JzQKmhLcUEGBndqdPsEPd87b5e62nXaQ0qRqSOOuSGRiGfsnTJDVi4 Zf96Fg+dFr3CnovHDYssXOLRjMjteMQghwMfL036HK+sxWt1rEgHEGri4r9DJnh/hVuvTz PqkOjIBSGAjzypwW6Lfqt1+HgOEINzqmUna2AtBAWjRT9hw7DZtE4F+5yHJI79tPrsOY/e bdTiGfLB0w90ixRpZiY+1vj1MFDZpc2DH3afyYm7fFU3Fwmlbsj4kkkCqg68mg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751910776; 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=3IeCCFOoszEe7FhExO8Jemv6Qo0dw5BpHdfa5HidIu8=; b=cOlW2nIIbT9v5zQGUCPfZVjb/Sz29O30h/RBAqwfCg0jrlhGvzR2uJdMX91hl9bse74tJc JjkMiZvKAzLpubEb+PC7LMoeTGXg8x33bzyDc2cSC+vWU5MyBrGEBHJM3f5qyBw5M1OYZD /lswucHIyOC1m8wl3DJL24rDVjbAOCb2e4jSCkIU0wkmJoY4MdIGLU9MxDQBX8gbjk3uzk 0wVOsUmOJBe5z78G2t/D5pf3WOPXdXzVCkJMFlN+YWqrn/C30aWcwocoq3BqPntvjoiFBy oUztn1TTULUcS+P270RrjuvG5JsAyeVNbLMlVELZjIGFMOlWn3w4qy2Gep8uEA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751910776; a=rsa-sha256; cv=none; b=NlgZ/M9h6X0uGsaECOMFYm0rwYEjrrHpzlwGBRz6Tlmkvcm7bet8JW/jyXORc29ooudaSe U16GCqQOMT1UruqhHfZkwUqGMDMRQJYOEOb/UFXoe67Oxp9kGfYq1uMuvutrcyGshRnBUP tTsAD4c4fx9UA8wnZ+nxX5k3mhR8luVDn6hwrAsdMDqNFRBZf69WYPuhdQtjUmo+Wp2sjF +nHqa5QSaFrDZegIg4OJhnfuitms6h2i3qAk9lpDR0pdbpa3KibPKy5fwkNwwmOcL6zQwg KYOe8ywmgfHy7Ed08vc4lCbU8040BdJDA9jNm6V/JDz1vGtNw1AFFsGz0kogww== 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 4bbWzr35YFz11ks; Mon, 07 Jul 2025 17:52:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567HqufS036996; Mon, 7 Jul 2025 17:52:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567HquuM036993; Mon, 7 Jul 2025 17:52:56 GMT (envelope-from git) Date: Mon, 7 Jul 2025 17:52:56 GMT Message-Id: <202507071752.567HquuM036993@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 0c38e3dbbf6e - main - aio: if there is at least one aio thread, hide an error from aio_init_aioinfo() 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0c38e3dbbf6eaa2755d34189149c9140cacd4bb1 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=0c38e3dbbf6eaa2755d34189149c9140cacd4bb1 commit 0c38e3dbbf6eaa2755d34189149c9140cacd4bb1 Author: Konstantin Belousov AuthorDate: 2025-07-07 14:35:11 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-07 17:52:20 +0000 aio: if there is at least one aio thread, hide an error from aio_init_aioinfo() Noted and reviewed by: jhb Fixes: 4685fa8e4bef169e6a1ceaf07f149232326de805 Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D51191 --- sys/kern/vfs_aio.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sys/kern/vfs_aio.c b/sys/kern/vfs_aio.c index 66ea50eee77b..02973146068d 100644 --- a/sys/kern/vfs_aio.c +++ b/sys/kern/vfs_aio.c @@ -455,8 +455,15 @@ aio_init_aioinfo(struct proc *p) error = 0; while (num_aio_procs < MIN(target_aio_procs, max_aio_procs)) { error = aio_newproc(NULL); - if (error != 0) + if (error != 0) { + /* + * At least one worker is enough to have AIO + * functional. Clear error in that case. + */ + if (num_aio_procs > 0) + error = 0; break; + } } return (error); } From nobody Mon Jul 7 17:55:47 2025 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 4bbX375JY3z60pc0; Mon, 07 Jul 2025 17:55:47 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbX374lrKz3tjB; Mon, 07 Jul 2025 17:55:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751910947; 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=dW9oXXh+Y25A/PTf67DjPMnx6r5FgfkkCwbMvqbrURA=; b=bo1BpnSlQzS/kyXgYKndtPHkSPLM63abzUCRV2yWkqebh6sQ7q+Um0g22rN8O1ei8TCo6R 7LEnvSaWRGjgjfYPdAXbfzIxto2VoRX+UneOTraiDmvGY6S6y/qpNglSZH0VCri1O0BoHW ClcvwQbDlfNIG5XcIQezRLFxAGWE0/NDDfeiEyAwHIspdJ3+9ze+nILsSHPoVle6kh9f5K Mbl7/MW1hAVLk9XlZT9kMaB4r/JJtexuK67lctoUlNampboH+TyOt8JXSXDeD1p+YcLQze vYMbZDPBspztNdBHWOg73oERR2e8Mi/0r/j77xRiuTELmckQJ8STcVCpg/xpDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751910947; 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=dW9oXXh+Y25A/PTf67DjPMnx6r5FgfkkCwbMvqbrURA=; b=xDtxDNWaPmuGCnFS5jUTh+ZB6e9B1iOP8Zpvy0e1FiwRvxHdn90wHTK4I7eH+b9Xo9F0MW c1ROh/ggP8+3WVTV/vo+1thjUHPw7tO0KhSq3vGLGCNGWSQ+S2wLTLkFweESUJWhdb+IJd mhLs9OJWDO9sHABcIm/xeTbJhm1nFCPFq/IBnzUrH7BStDAjkhBiGVGrfPiO2yDzGdZCCJ F3hEEdydxjDmk6eHM786AK6iYu8jzbac8faeWm3bIjx7HtkDXB9mMDit3I0xBTtDrA7Jvu 0K/UbC0PbmXSTWqJ2Wec2wCH3GqN2YwjADnuVZFlttT7tp6Y4dbsKM1i9ftm2A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751910947; a=rsa-sha256; cv=none; b=cTP3PRSpGPKahNtrfrBiPS53Y/uObnEUKuIY+DAjzNdPUbHWMjtQTKm7yd1hCLGMiOMvop h2q0lApFGdy90OeplQN3jhuxSlLnIFQe22La8EbLEBGOnVUE1Rpvzu69kAjbwV0y5C+1aw dyBEPS7XBoU1mtgTdkqAK/eOIIvVhJQBJhhjgiA7QysLU1P6qarRveV1wN2+wgL30y2+yv +RgWlBKBR14h6KyISEavS/3wisqk+l7DcMr8eoVgmSOx1CzB9wb0Xsxe/9czBNwu5Y8TJQ Ik6jP8tfZlDTpdeL+58jqclUPp/dZ5sKn8Rj1GT4Gu/gNLhowyuAzLZsgY2JUA== 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 4bbX3743QDz11QW; Mon, 07 Jul 2025 17:55:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567HtlKu038030; Mon, 7 Jul 2025 17:55:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567HtltK038027; Mon, 7 Jul 2025 17:55:47 GMT (envelope-from git) Date: Mon, 7 Jul 2025 17:55:47 GMT Message-Id: <202507071755.567HtltK038027@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Antoine Brodin Subject: git: a38eb8d4282d - main - ObsoleteFiles.inc: fix a typo 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: antoine X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a38eb8d4282d2126896da35f0742fd5e84ffac49 Auto-Submitted: auto-generated The branch main has been updated by antoine: URL: https://cgit.FreeBSD.org/src/commit/?id=a38eb8d4282d2126896da35f0742fd5e84ffac49 commit a38eb8d4282d2126896da35f0742fd5e84ffac49 Author: Antoine Brodin AuthorDate: 2025-07-07 17:54:17 +0000 Commit: Antoine Brodin CommitDate: 2025-07-07 17:55:07 +0000 ObsoleteFiles.inc: fix a typo --- ObsoleteFiles.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index dcda9a035b44..61f948a2c970 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -2481,7 +2481,7 @@ OLD_FILES+=usr/share/man/man4/ng_uni.4.gz OLD_FILES+=usr/share/man/man4/ngatmbase.4.gz # 20230308: machine-id merged into hostid_save -OLD_FILES+=etc/rc.d/machine-id +OLD_FILES+=etc/rc.d/machine_id # 20230306: remove tzsetwall(3) OLD_FILES+=usr/share/man/man3/tzsetwall.3.gz From nobody Mon Jul 7 19:23:04 2025 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 4bbYzs1CN3z611XR; Mon, 07 Jul 2025 19:23:05 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbYzs07kqz3ld7; Mon, 07 Jul 2025 19:23:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751916185; 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=KBBqSLs59vSxAyL4aHnAVnaW3fHE2Hg5SZZDm3dqBsM=; b=OmMmdVNdWq8BUUH4Wc9fI8v2++z07F8AvhFCNUINFYtEAVh27e2tbZ4s6CmtiAUlrALTiG sOjnIKu0g82SHW59XpfVZa7DOw6KS1UvIOxDte8ikq+/7ZJPZwnMsjQrviMN7wQ7y0PUCM UpHLJyjBOdSvZnmkWCP5RgOTC1BtG2ZQhWOcE82acMXiqS5+j19KvVsQ6NZx8/pC656gVf rBgAlNjTSfCIF4vZaIElYD0Z4f7B4Um7L3CeSl0ddx+MsnBovg6RD3GTB9tcX8SaQu4MEY qHSX4z3KXi15OH9UHq7zEFtZe8bhUDbisOefG6BzkYcLCTJV2/ICt9y7qq+/AA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751916185; 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=KBBqSLs59vSxAyL4aHnAVnaW3fHE2Hg5SZZDm3dqBsM=; b=HXnW+Pb7MSaduaHdzApQzQ3qgTsZruxaiFTW6j/gvTIj1BlXl+3zrtGK9czuBVNRANfuja 36CIgQWQ+UKUHBHiYmRTWx2sy1Zg/0FLRymmyPCqaymiMeJbwrznKmLop3+AC6NttXDv8G G/rRuqidSQ7OxTwPsdrYxJOFdaEo67GUpxf99wOmGHzpsaNaO+6drZpl+w8FZFS0RteQG8 8LfoaeqW2x72HeWrITp7DGn5WQAKPVbPQRJDb5bWrCZQqZcGakqLN7Q0pywwVTVOPxttUM uWJeFg611PgYoUURU0dSDoz1CRodcn9Ze4Xo62qldTIyk5j7utk+YENJI+RPoA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751916185; a=rsa-sha256; cv=none; b=MmXf2v3vyo51H3oPpiK1Mny0GiTStUFpWMKNQ6/mlu4VTx64DXfmiQ7DAqCuEvRVbqBVGp jHZQYGhQMagGkorry+C9jBwEcu8nAWp+EaMYeIx0lM0Q1GkMVPShP79n52mSXuHO+avbTw Ffi2y17kbm5JDfl/GvuFDLKCnAAP3TlEe5y33d0WK8SQLm3rVsPZaxL1XTQAyiJEjEgB6Y wybLMRleeV7/FrVH35R2uwmSJMe/cR+LdvKfmZTCQTpd1FRvZnT5GdfVO36V3vyFsoq02s e97MbAsHBOHQI/EEmgOODpvtqYZPvawdS3V18schSRWtkbxi4j0sfhx1PASQvQ== 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 4bbYzr6sHRz143m; Mon, 07 Jul 2025 19:23:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567JN4a9010706; Mon, 7 Jul 2025 19:23:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567JN4S5010703; Mon, 7 Jul 2025 19:23:04 GMT (envelope-from git) Date: Mon, 7 Jul 2025 19:23:04 GMT Message-Id: <202507071923.567JN4S5010703@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ahmad Khalifa Subject: git: 32c90988d204 - stable/14 - gpio: remove redundant calls to bus_attach_children 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vexeduxr X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 32c90988d204ca2c7ede51de9474756db5be27d0 Auto-Submitted: auto-generated The branch stable/14 has been updated by vexeduxr: URL: https://cgit.FreeBSD.org/src/commit/?id=32c90988d204ca2c7ede51de9474756db5be27d0 commit 32c90988d204ca2c7ede51de9474756db5be27d0 Author: Ahmad Khalifa AuthorDate: 2025-07-04 13:51:11 +0000 Commit: Ahmad Khalifa CommitDate: 2025-07-07 18:47:12 +0000 gpio: remove redundant calls to bus_attach_children gpiobus_attach_bus already calls it. Reviewed by: mmel, imp, andrew Approved by: imp (mentor) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D51108 (cherry picked from commit c2d8cca77152ebf72f488490163585be7e34eb0f) --- sys/arm/mv/mvebu_gpio.c | 2 +- sys/arm/nvidia/tegra_gpio.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/arm/mv/mvebu_gpio.c b/sys/arm/mv/mvebu_gpio.c index 001369bb3a02..3ade09e82d1a 100644 --- a/sys/arm/mv/mvebu_gpio.c +++ b/sys/arm/mv/mvebu_gpio.c @@ -810,7 +810,7 @@ mvebu_gpio_attach(device_t dev) return (ENXIO); } - return (bus_generic_attach(dev)); + return (0); } static int diff --git a/sys/arm/nvidia/tegra_gpio.c b/sys/arm/nvidia/tegra_gpio.c index 29bc8624e27a..e37fd69a121e 100644 --- a/sys/arm/nvidia/tegra_gpio.c +++ b/sys/arm/nvidia/tegra_gpio.c @@ -824,7 +824,7 @@ tegra_gpio_attach(device_t dev) return (ENXIO); } - return (bus_generic_attach(dev)); + return (0); } static int From nobody Mon Jul 7 19:23:05 2025 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 4bbYzt585dz611XS; Mon, 07 Jul 2025 19:23:06 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbYzt172Nz3lpW; Mon, 07 Jul 2025 19:23:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751916186; 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=bHJ3d4Q8uyiPdyDq1ardrwgWjnOSZ8qYgr6ogeL6r1Q=; b=vDKXx+sjn7eqtDT+4yusUO3Zh4kUhz80wI3ZmktOIY7DHYyqJ3aBXLdjOYMx8pbjhVCpya zx2YpBsmj9e7qO3vcifoIdJbr4+FvW4JOG/edpllXUDliDiUOcWIwBUjKe98SqmWPKjtP6 6XIbzaJy2Ah6sFRsV2RkUnUpTDcj5ob1IJ7qkkSK1esqHL0EBOSOWcBlsfhU/k0q8HtfWe yxWFA33smOZUn5tCP1hprZd+lfh00bN5XuU1zldZAn2OsGAV9JsbSfBpuPGVS+Ep2+J0f0 sNdQQqeUIXCX5Mgt7vZ6xOxXyS7Jf6wjP+VBBWMNRRUxHHCtYLkAqll6m6KHNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751916186; 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=bHJ3d4Q8uyiPdyDq1ardrwgWjnOSZ8qYgr6ogeL6r1Q=; b=p8PZpdDy8ccM5s+pddtrlpDFiXGurEMvRtm+vO7wjoNvXNpvxtoZZoB9FwDlk39flmhz73 Wzb/tjM/3KImqA3cr9vWzZIaxa2+rn0Eg4gKoV3YnASTzlTSjbH2ROY6DarcxQ8UZ7UC4M kGmQjaIlmJOTpcDl1oDrwBOfTScyKCFRb4OPQaFI7FsS3ZNKx4NUPFbLtD+AZLnMNPXYSj B0oDsU5P/bHOadhDIeUWU9Flvwc7/8rZUG7y2/JC1nBNR1Xsr6PtEudd+6VTWGX9JBeMwC kkQlZnYp+1tEFPUs0lny3fjRdcRok0UWckiGLI2oZadZg9YvIvwP5Zv3d8ZS/g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751916186; a=rsa-sha256; cv=none; b=srga0ggea8ovZeyE+Hj5Rsfi8Ypkezou1deW5WNPPYmlM9M9zQTeWR15khXALPzlXLsBhR I3LXA84/k74frXp8exVfBM+g4P12SsKNGAMJU02/mW2ZgFO/71tsnt7jiH7ayAu3QWSkED T8QzI5/hC+VxwBHgdQA+OeRM1t0zy9C3bTG+39fLy1n8bjiTn4AutkWbZnzdQAOS7bZUGz s9QuU+oRsdlPM2uqXht4DtWDE6by3gpcm1P7c7fqUsHfC8B0q0ev1iO57wWZIuM0gTj/lX EEqJ2iNz7jzz63jzNlvDdvgcPcQHYpJGeWsMcteAb7JJQvYqX1sXS4sVwlpjdA== 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 4bbYzt0jkYz141T; Mon, 07 Jul 2025 19:23:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567JN65d010739; Mon, 7 Jul 2025 19:23:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567JN5YO010736; Mon, 7 Jul 2025 19:23:05 GMT (envelope-from git) Date: Mon, 7 Jul 2025 19:23:05 GMT Message-Id: <202507071923.567JN5YO010736@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ahmad Khalifa Subject: git: c6a6b94b6613 - stable/14 - gpiobus: add a gpiobus_add_bus function 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vexeduxr X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c6a6b94b661378961179d832be6f1eceef91f953 Auto-Submitted: auto-generated The branch stable/14 has been updated by vexeduxr: URL: https://cgit.FreeBSD.org/src/commit/?id=c6a6b94b661378961179d832be6f1eceef91f953 commit c6a6b94b661378961179d832be6f1eceef91f953 Author: Ahmad Khalifa AuthorDate: 2025-07-04 13:51:25 +0000 Commit: Ahmad Khalifa CommitDate: 2025-07-07 18:48:59 +0000 gpiobus: add a gpiobus_add_bus function Some drivers need to postpone the attachment of gpiobus until hardware init is done. Add a new gpiobus_add_bus function to accommodate this case. Suggested by: mmel, andrew Reviewed by: mmel, imp, andrew Approved by: imp (mentor) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D51133 (cherry picked from commit 2c356c8b8f79c08d42b23a72b7a320b59d955a3f) --- sys/dev/gpio/gpiobus.c | 20 ++++++++++++++++++-- sys/dev/gpio/gpiobusvar.h | 1 + 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/sys/dev/gpio/gpiobus.c b/sys/dev/gpio/gpiobus.c index a8dd8a753676..266fe1a29c3b 100644 --- a/sys/dev/gpio/gpiobus.c +++ b/sys/dev/gpio/gpiobus.c @@ -294,7 +294,7 @@ gpiobus_print_pins(struct gpiobus_ivar *devi, struct sbuf *sb) } device_t -gpiobus_attach_bus(device_t dev) +gpiobus_add_bus(device_t dev) { device_t busdev; @@ -308,8 +308,24 @@ gpiobus_attach_bus(device_t dev) #ifdef FDT ofw_gpiobus_register_provider(dev); #endif - bus_generic_attach(dev); + return (busdev); +} +/* + * Attach a gpiobus child. + * Note that the controller is expected + * to be fully initialized at this point. + */ +device_t +gpiobus_attach_bus(device_t dev) +{ + device_t busdev; + + busdev = gpiobus_add_bus(dev); + if (busdev == NULL) + return (NULL); + + bus_generic_attach(dev); return (busdev); } diff --git a/sys/dev/gpio/gpiobusvar.h b/sys/dev/gpio/gpiobusvar.h index 74783e112f89..3ae0767466c9 100644 --- a/sys/dev/gpio/gpiobusvar.h +++ b/sys/dev/gpio/gpiobusvar.h @@ -172,6 +172,7 @@ struct resource *gpio_alloc_intr_resource(device_t consumer_dev, int *rid, * these should not be called directly by other drivers. */ int gpio_check_flags(uint32_t, uint32_t); +device_t gpiobus_add_bus(device_t); device_t gpiobus_attach_bus(device_t); int gpiobus_detach_bus(device_t); int gpiobus_attach(device_t); From nobody Mon Jul 7 19:23:07 2025 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 4bbYzv5K3Cz611Tc; Mon, 07 Jul 2025 19:23:07 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbYzv1trWz3lXS; Mon, 07 Jul 2025 19:23:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751916187; 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=+I2Dw5ShgIPGOuBFw90oz7gEcE/Ypsj4nkeknRUz450=; b=ik6wUyWPbzc3A7jheduShH0iHsp237/tWhGp1IaL32z76MxquHFg9mL/rReAxCFqoVt5H9 0wMiFp8THLOWYjotEulII+iA72gkwU1wKXnUK6KWLQzQgTus8YByahDyq3jI3rLq0v+rfU To9wrXfTBvpwY9u1Fb/LX6klceIQsf8wJTOlIy5/TQEy4CKR9OTDM9roThmOu2ynyvkpgz BdjJy+XD+kA6IJ9W8PxUWknOPdaEaARBbVQ8yPoGRvEwNkWGZEHjMi/s0S8UjQAck9x/8M A6sbhb0Gu9LYU8qefQ9nTe3LNCKudwtJgYUJxHCwQeIXkG1JDXb2qVSgcrzJ2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751916187; 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=+I2Dw5ShgIPGOuBFw90oz7gEcE/Ypsj4nkeknRUz450=; b=q4qkCO2YN1ZBl4GaVq8HSXeSzNyNhbhtUG5yP1G1Fsy/oGD3PbkvXyKYYOJ7rI3PbeFavt bua8PdHoeFOlC+Ldpoj5WsW2cWWj4RyV2E/usnVzWmKI8ly6sPSu2pzt6Ob2o4LUnICw3c ENlMzO3QrOh+VZblOfKduVNw4zooZUYrhduCy6YP+jx61e0AF7HF3FPs3GXIIVu7zmke5j nX5SFgG5VbUioKNrXncwW5V3ECCE8KHbNiBEoMw/uqHa2g2PisPF+0uYpJ2Z3iaYi+VhA7 Dnk5LzcJzBOed7KkMk8Ngqcef0tuAtDEFTQlDC8FcrG4+1vHuGyGrsSLUcZuSA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751916187; a=rsa-sha256; cv=none; b=N3vxmOoMCTNPLDBRzs0PX+VqbVQ4vuDnKBQGgZI/1ZXruBQfku9VDuhdSDOsFXz716VWZe 0zQqosP/ThwRP5MoS1itT47oBTPm9vrpxIcI0IMz4bU4Q+8J3sVhkp6kW3tw1HQ5pS2YaH sTrjDVjla4l6Exn/CvfyUdYPIZimC46M+SVH3IDS+Hp5JZSVfE2IEE6SrcoXA4dZ7vZ9GU 0DgTwTmjb5Xvii+xd3/J5toYq+JQ0e+e5sLdzRBDjXJwk7/eqDEQQwjIwx4JMHSEd4qSjV ahwPogS4cJPdLLgtsbNGZ+UuXoGbaMFCQlwEMQ8ZIiGyovQJDTx2QQNznv8d5g== 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 4bbYzv1S7Rz140N; Mon, 07 Jul 2025 19:23:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567JN72g010772; Mon, 7 Jul 2025 19:23:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567JN7lb010769; Mon, 7 Jul 2025 19:23:07 GMT (envelope-from git) Date: Mon, 7 Jul 2025 19:23:07 GMT Message-Id: <202507071923.567JN7lb010769@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ahmad Khalifa Subject: git: cdba3a8f9fce - stable/14 - gpio: attach gpiobus when the controller is ready 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vexeduxr X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: cdba3a8f9fce453774833f2f1123536cd17003b8 Auto-Submitted: auto-generated The branch stable/14 has been updated by vexeduxr: URL: https://cgit.FreeBSD.org/src/commit/?id=cdba3a8f9fce453774833f2f1123536cd17003b8 commit cdba3a8f9fce453774833f2f1123536cd17003b8 Author: Ahmad Khalifa AuthorDate: 2025-07-04 13:52:00 +0000 Commit: Ahmad Khalifa CommitDate: 2025-07-07 18:51:47 +0000 gpio: attach gpiobus when the controller is ready Only attach gpiobus when the controller is fully initialized. Children of gpiobus expect this to be the case. Reviewed by: mmel, imp, andrew Approved by: imp (mentor) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D51088 (cherry picked from commit 4695e3aa7c685c092cb4b2662bee16c31be790f8) --- sys/arm/allwinner/aw_gpio.c | 8 ++++---- sys/arm/broadcom/bcm2835/bcm2835_gpio.c | 6 +++--- sys/arm/nvidia/as3722_gpio.c | 2 +- sys/arm64/nvidia/tegra210/max77620_gpio.c | 2 +- sys/arm64/rockchip/rk_gpio.c | 12 ++++++------ sys/dev/gpio/pl061.c | 12 ++++++++++-- sys/dev/gpio/pl061.h | 1 + sys/dev/gpio/pl061_acpi.c | 15 ++++----------- sys/dev/gpio/pl061_fdt.c | 15 ++++----------- sys/dev/gpio/qoriq_gpio.c | 11 ++++++----- sys/dev/iicbus/gpio/tca64xx.c | 3 +-- sys/powerpc/mpc85xx/mpc85xx_gpio.c | 4 ++-- 12 files changed, 43 insertions(+), 48 deletions(-) diff --git a/sys/arm/allwinner/aw_gpio.c b/sys/arm/allwinner/aw_gpio.c index 1229d5bb146d..b180ef226c15 100644 --- a/sys/arm/allwinner/aw_gpio.c +++ b/sys/arm/allwinner/aw_gpio.c @@ -1076,10 +1076,6 @@ aw_gpio_attach(device_t dev) aw_gpio_register_isrcs(sc); intr_pic_register(dev, OF_xref_from_node(ofw_bus_get_node(dev))); - sc->sc_busdev = gpiobus_attach_bus(dev); - if (sc->sc_busdev == NULL) - goto fail; - /* * Register as a pinctrl device */ @@ -1088,6 +1084,10 @@ aw_gpio_attach(device_t dev) fdt_pinctrl_register(dev, "allwinner,pins"); fdt_pinctrl_configure_tree(dev); + sc->sc_busdev = gpiobus_attach_bus(dev); + if (sc->sc_busdev == NULL) + goto fail; + config_intrhook_oneshot(aw_gpio_enable_bank_supply, sc); return (0); diff --git a/sys/arm/broadcom/bcm2835/bcm2835_gpio.c b/sys/arm/broadcom/bcm2835/bcm2835_gpio.c index e4fc57b79ba5..48d1d2af5abc 100644 --- a/sys/arm/broadcom/bcm2835/bcm2835_gpio.c +++ b/sys/arm/broadcom/bcm2835/bcm2835_gpio.c @@ -837,12 +837,12 @@ bcm_gpio_attach(device_t dev) } sc->sc_gpio_npins = i; bcm_gpio_sysctl_init(sc); - sc->sc_busdev = gpiobus_attach_bus(dev); - if (sc->sc_busdev == NULL) - goto fail; fdt_pinctrl_register(dev, "brcm,pins"); fdt_pinctrl_configure_tree(dev); + sc->sc_busdev = gpiobus_attach_bus(dev); + if (sc->sc_busdev == NULL) + goto fail; return (0); diff --git a/sys/arm/nvidia/as3722_gpio.c b/sys/arm/nvidia/as3722_gpio.c index f7ae3c99d0f4..0f823ce3e0c1 100644 --- a/sys/arm/nvidia/as3722_gpio.c +++ b/sys/arm/nvidia/as3722_gpio.c @@ -545,7 +545,7 @@ as3722_gpio_attach(struct as3722_softc *sc, phandle_t node) sc->gpio_pins = malloc(sizeof(struct as3722_gpio_pin *) * sc->gpio_npins, M_AS3722_GPIO, M_WAITOK | M_ZERO); - sc->gpio_busdev = gpiobus_attach_bus(sc->dev); + sc->gpio_busdev = gpiobus_add_bus(sc->dev); if (sc->gpio_busdev == NULL) return (ENXIO); for (i = 0; i < sc->gpio_npins; i++) { diff --git a/sys/arm64/nvidia/tegra210/max77620_gpio.c b/sys/arm64/nvidia/tegra210/max77620_gpio.c index 0021aab151de..b60d62a3e0c3 100644 --- a/sys/arm64/nvidia/tegra210/max77620_gpio.c +++ b/sys/arm64/nvidia/tegra210/max77620_gpio.c @@ -673,7 +673,7 @@ max77620_gpio_attach(struct max77620_softc *sc, phandle_t node) sx_init(&sc->gpio_lock, "MAX77620 GPIO lock"); - sc->gpio_busdev = gpiobus_attach_bus(sc->dev); + sc->gpio_busdev = gpiobus_add_bus(sc->dev); if (sc->gpio_busdev == NULL) return (ENXIO); diff --git a/sys/arm64/rockchip/rk_gpio.c b/sys/arm64/rockchip/rk_gpio.c index b1175963a5e4..5a96ea2d0cb4 100644 --- a/sys/arm64/rockchip/rk_gpio.c +++ b/sys/arm64/rockchip/rk_gpio.c @@ -363,12 +363,6 @@ rk_gpio_attach(device_t dev) return (ENXIO); } - sc->sc_busdev = gpiobus_attach_bus(dev); - if (sc->sc_busdev == NULL) { - rk_gpio_detach(dev); - return (ENXIO); - } - /* Set the cached value to unknown */ for (i = 0; i < RK_GPIO_MAX_PINS; i++) sc->pin_cached[i].is_gpio = 2; @@ -378,6 +372,12 @@ rk_gpio_attach(device_t dev) sc->swporta_ddr = rk_gpio_read_4(sc, RK_GPIO_SWPORTA_DDR); RK_GPIO_UNLOCK(sc); + sc->sc_busdev = gpiobus_attach_bus(dev); + if (sc->sc_busdev == NULL) { + rk_gpio_detach(dev); + return (ENXIO); + } + return (0); } diff --git a/sys/dev/gpio/pl061.c b/sys/dev/gpio/pl061.c index 1a12710ababa..1d7a1439ea76 100644 --- a/sys/dev/gpio/pl061.c +++ b/sys/dev/gpio/pl061.c @@ -485,14 +485,21 @@ pl061_attach(device_t dev) } } + mtx_init(&sc->sc_mtx, device_get_nameunit(dev), "pl061", MTX_SPIN); + + if (sc->sc_xref != 0 && !intr_pic_register(dev, sc->sc_xref)) { + device_printf(dev, "couldn't register PIC\n"); + PL061_LOCK_DESTROY(sc); + goto free_isrc; + } + sc->sc_busdev = gpiobus_attach_bus(dev); if (sc->sc_busdev == NULL) { device_printf(dev, "couldn't attach gpio bus\n"); + PL061_LOCK_DESTROY(sc); goto free_isrc; } - mtx_init(&sc->sc_mtx, device_get_nameunit(dev), "pl061", MTX_SPIN); - return (0); free_isrc: @@ -501,6 +508,7 @@ free_isrc: * for (irq = 0; irq < PL061_NUM_GPIO; irq++) * intr_isrc_deregister(PIC_INTR_ISRC(sc, irq)); */ + bus_teardown_intr(dev, sc->sc_irq_res, sc->sc_irq_hdlr); bus_release_resource(dev, SYS_RES_IRQ, sc->sc_irq_rid, sc->sc_irq_res); free_pic: diff --git a/sys/dev/gpio/pl061.h b/sys/dev/gpio/pl061.h index 809a1168493d..d9fe23e502b1 100644 --- a/sys/dev/gpio/pl061.h +++ b/sys/dev/gpio/pl061.h @@ -46,6 +46,7 @@ struct pl061_softc { struct resource *sc_mem_res; struct resource *sc_irq_res; void *sc_irq_hdlr; + intptr_t sc_xref; int sc_mem_rid; int sc_irq_rid; struct pl061_pin_irqsrc sc_isrcs[PL061_NUM_GPIO]; diff --git a/sys/dev/gpio/pl061_acpi.c b/sys/dev/gpio/pl061_acpi.c index d2531fa94faf..ba927af27f1c 100644 --- a/sys/dev/gpio/pl061_acpi.c +++ b/sys/dev/gpio/pl061_acpi.c @@ -68,19 +68,12 @@ pl061_acpi_probe(device_t dev) static int pl061_acpi_attach(device_t dev) { - int error; + struct pl061_softc *sc; - error = pl061_attach(dev); - if (error != 0) - return (error); + sc = device_get_softc(dev); + sc->sc_xref = ACPI_GPIO_XREF; - if (!intr_pic_register(dev, ACPI_GPIO_XREF)) { - device_printf(dev, "couldn't register PIC\n"); - pl061_detach(dev); - error = ENXIO; - } - - return (error); + return (pl061_attach(dev)); } static device_method_t pl061_acpi_methods[] = { diff --git a/sys/dev/gpio/pl061_fdt.c b/sys/dev/gpio/pl061_fdt.c index 352f21560d72..c001b8eb232e 100644 --- a/sys/dev/gpio/pl061_fdt.c +++ b/sys/dev/gpio/pl061_fdt.c @@ -62,19 +62,12 @@ pl061_fdt_probe(device_t dev) static int pl061_fdt_attach(device_t dev) { - int error; + struct pl061_softc *sc; - error = pl061_attach(dev); - if (error != 0) - return (error); + sc = device_get_softc(dev); + sc->sc_xref = OF_xref_from_node(ofw_bus_get_node(dev)); - if (!intr_pic_register(dev, OF_xref_from_node(ofw_bus_get_node(dev)))) { - device_printf(dev, "couldn't register PIC\n"); - pl061_detach(dev); - error = ENXIO; - } - - return (error); + return (pl061_attach(dev)); } static device_method_t pl061_fdt_methods[] = { diff --git a/sys/dev/gpio/qoriq_gpio.c b/sys/dev/gpio/qoriq_gpio.c index 5dabe03b775a..a82bd88757e5 100644 --- a/sys/dev/gpio/qoriq_gpio.c +++ b/sys/dev/gpio/qoriq_gpio.c @@ -370,11 +370,6 @@ qoriq_gpio_attach(device_t dev) for (i = 0; i <= MAXPIN; i++) sc->sc_pins[i].gp_caps = DEFAULT_CAPS; - sc->busdev = gpiobus_attach_bus(dev); - if (sc->busdev == NULL) { - qoriq_gpio_detach(dev); - return (ENOMEM); - } /* * Enable the GPIO Input Buffer for all GPIOs. * This is safe on devices without a GPIBE register, because those @@ -385,6 +380,12 @@ qoriq_gpio_attach(device_t dev) OF_device_register_xref(OF_xref_from_node(ofw_bus_get_node(dev)), dev); + sc->busdev = gpiobus_attach_bus(dev); + if (sc->busdev == NULL) { + qoriq_gpio_detach(dev); + return (ENOMEM); + } + return (0); } diff --git a/sys/dev/iicbus/gpio/tca64xx.c b/sys/dev/iicbus/gpio/tca64xx.c index a129c8727c8a..90c38438cdf3 100644 --- a/sys/dev/iicbus/gpio/tca64xx.c +++ b/sys/dev/iicbus/gpio/tca64xx.c @@ -262,14 +262,13 @@ tca64xx_attach(device_t dev) sc->addr = iicbus_get_addr(dev); mtx_init(&sc->mtx, "tca64xx gpio", "gpio", MTX_DEF); + OF_device_register_xref(OF_xref_from_node(ofw_bus_get_node(dev)), dev); sc->busdev = gpiobus_attach_bus(dev); if (sc->busdev == NULL) { device_printf(dev, "Could not create busdev child\n"); return (ENXIO); } - OF_device_register_xref(OF_xref_from_node(ofw_bus_get_node(dev)), dev); - #ifdef DEBUG switch (sc->chip) { case TCA6416_TYPE: diff --git a/sys/powerpc/mpc85xx/mpc85xx_gpio.c b/sys/powerpc/mpc85xx/mpc85xx_gpio.c index f8c46a9975ae..43ac63ab7031 100644 --- a/sys/powerpc/mpc85xx/mpc85xx_gpio.c +++ b/sys/powerpc/mpc85xx/mpc85xx_gpio.c @@ -227,14 +227,14 @@ mpc85xx_gpio_attach(device_t dev) return (ENOMEM); } + OF_device_register_xref(OF_xref_from_node(ofw_bus_get_node(dev)), dev); + sc->busdev = gpiobus_attach_bus(dev); if (sc->busdev == NULL) { mpc85xx_gpio_detach(dev); return (ENOMEM); } - OF_device_register_xref(OF_xref_from_node(ofw_bus_get_node(dev)), dev); - return (0); } From nobody Mon Jul 7 19:28:45 2025 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 4bbZ6Q1LY9z611gl; Mon, 07 Jul 2025 19:28:46 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbZ6Q0Gd0z3pt2; Mon, 07 Jul 2025 19:28:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751916526; 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=0u5QIhM56uSZPcOYEf+QsbdsDIWvjDZszOMxydVT72Q=; b=wsI7ixkoE+3R5WsB2cnl4J03oy8PpVjHfUNI/TsVOvZyKC6LfblAIl3lJbSSIOy+Ae55u7 xgRgwkWK4mIqPX5X5oVM0FMaAP/MbgMOO7l4l/GScU7Rvm1SflHzdrHiBMGrXMoc2BBiuQ 3A1rXV6mTz2oT6LjsSJecJ/Nh4+nOusvGzv1SgfjoWwfxJQ6PNoGXdaBNvTyr2VzqX8cVE FwCKMCbrfhnsrf2cbIjZw5UdlKplgKoKf/7xg3DFoxDM2S1Ihe1+sXU1+6xw9uaVBKJbvO zcEqXYRlMeNNN6lQ/Uhxb9xeOmc//CSIQn66y8twmKS5r1k1AwjDj7Gzp1RKuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751916526; 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=0u5QIhM56uSZPcOYEf+QsbdsDIWvjDZszOMxydVT72Q=; b=hpS6MlorDg2GPvnNsw419XO1lAPBifjIIz8+TX3G2Wl5F8NSeYutX1Aq0CFvxcYsUTu3pv EQY2h1h+wl+GsK6+NyKN7kzgfUlbos8t1+Iw0Kx//hBUVfqSZ11oEoFnmM5flyrMESb7oH T/DF5kJVs665KZQ/w9nf8MwetBHvANlS+wVSKYSL5PCTZMkqZfdiEWrmcIk8JgoQJ986sh uB7ykDRQo/EUnYfTW0x/eRhq5L67mvpBxb5jJU4AlbFI3B1ZYVcZ+TcGJ24f232cmPBvka ctwTg731WsW00OufxyIYwy8jHXCAgT1dI+KTRSIBRxN6UIryeOyg3sD/dyeLFw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751916526; a=rsa-sha256; cv=none; b=H8rkyEB2sXfJPyIR37gU92dBVgJhF4EEZyvuhPFu12gUI7Y2E7/WXg5N80yHxhnRxMTMyL j+Dt+KESjQGf08cf4RFggO0O/VFOKa8h1y9/G8j+g2jiX+eCS2yMgE8x9VnJiSQTsEqpK8 pgUIwLgqbv+XQMNLh9PVB550dInlzTshjJlRIVP0lM6ZqhtMQM041l00kN8T9pWZRqpqGA Bo6iackaScfCMT7qLYgsx/ORPhL6B6yIRZ+UvnT0ZI0osYyRJiW1kP35AXqbQgi2phc7du Pi7m3mL0Jd+Z6DYJsH8PN3DT0tH4IWUvVAz/AJvQlzeGtc/+grX3o7vKQVsDXg== 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 4bbZ6P6vBDz141V; Mon, 07 Jul 2025 19:28:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567JSjA8012601; Mon, 7 Jul 2025 19:28:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567JSj0r012598; Mon, 7 Jul 2025 19:28:45 GMT (envelope-from git) Date: Mon, 7 Jul 2025 19:28:45 GMT Message-Id: <202507071928.567JSj0r012598@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 283c1bd8ceb0 - main - uexterr_format(): simplify output when ext error string is available 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 283c1bd8ceb07cbbc5fa3f3034b2e2d9ee53d981 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=283c1bd8ceb07cbbc5fa3f3034b2e2d9ee53d981 commit 283c1bd8ceb07cbbc5fa3f3034b2e2d9ee53d981 Author: Konstantin Belousov AuthorDate: 2025-07-03 03:04:23 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-07 18:44:14 +0000 uexterr_format(): simplify output when ext error string is available If the extended error string is provided by kernel, return only the string, which is supposedly enough to identify exact cause of the error. If the string is not provided, print the technically looking gibberish which still allows to identify location with kernel sources. Reviewed by: asomers, brooks Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D51141 --- lib/libc/gen/uexterr_format.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/libc/gen/uexterr_format.c b/lib/libc/gen/uexterr_format.c index 32b57ffb6e1a..86ba40234ae4 100644 --- a/lib/libc/gen/uexterr_format.c +++ b/lib/libc/gen/uexterr_format.c @@ -23,9 +23,13 @@ __uexterr_format(const struct uexterror *ue, char *buf, size_t bufsz) strlcpy(buf, "No error", bufsz); return (0); } - snprintf(buf, bufsz, - "errno %d category %u (src line %u) p1 %#jx p2 %#jx %s", - ue->error, ue->cat, ue->src_line, - (uintmax_t)ue->p1, (uintmax_t)ue->p2, ue->msg); + if (ue->msg[0] == '\0') { + snprintf(buf, bufsz, + "errno %d category %u (src line %u) p1 %#jx p2 %#jx", + ue->error, ue->cat, ue->src_line, + (uintmax_t)ue->p1, (uintmax_t)ue->p2); + } else { + strlcpy(buf, ue->msg, bufsz); + } return (0); } From nobody Mon Jul 7 19:28:46 2025 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 4bbZ6R3RGHz611gm; Mon, 07 Jul 2025 19:28:47 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbZ6R15RZz3ph5; Mon, 07 Jul 2025 19:28:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751916527; 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=U95Z+LJjRtY78ixdlhb0ZMhT81M/0hFUrHQPVJ0RlsM=; b=bZUuZpxF0h88c2qDe91iVk+kPYbvL6+zeT+pehKFxVPOu7hSK8AL+3GIq/VO7xi5o+hfxP qB/7/eeFuD2mObqd3kE0Do4gpIC4pYa3oNlXxF6SAj3MgR+bozcBLViLlDApSaRukfvHIV i6qNK1ApIgXN+sn4MPCZfGi5e3kArtRhjxPgBD6speF6wb1WSLWA8r6kABQ9UEalquZyZM 0POTj2yXXao03rfayaz5xbUOmUNw9cX1Wi0RjmKLhOEcCA/DnD1Ww6zlqNy9Z9L0h1kE/E 48xk3yWT+MjFrjuTI+velpoPYhzYGUxwfQkuk0R3DYT2vyo6WW1WXHnHgvOiuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751916527; 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=U95Z+LJjRtY78ixdlhb0ZMhT81M/0hFUrHQPVJ0RlsM=; b=mbeJB2hu/4eHXZAOH4FUKpfn7OMC6oB038xoN7WgCxYI1P80Hg4cQbIBVlrfVo217xpsDQ 23cTmBiDg3p34KTXgJLWU3vl2VEYyu9DzEm48WB0rkS3ekk0JZz6ZOX9WFp60gWskn90qp eZIMqHOnWbfqCLHK8NOgtwh57mttPaZ0KJ62Dn/o92WuXkjdc2ZQ1y84JtFRqmKmMJEatv 8GWFuxlxZ8FMNnkKwasjFhGz9LKXyxzij13N4Z28/ni6RX7v1tbQayHCLNtIWewGIzPLca 0sM5iHv8gH6w7M41YLqCj5PZvmsf8WDhbQO793W1yZLHAackJq98tIgqXRErSw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751916527; a=rsa-sha256; cv=none; b=edtyWdaMh55zrpimhJR8U7+3q2X1V/tkcwaURYkvuS1blFaZBFYjrQ4RWwiBK4O8w35ana G5x96WmllaU8u60dvmUB7ZLTHqOmVuM3/asWQ/MFXHHKDwRkRntJ/bd/EhYj8CnitLjiey QM7AAA2jESonYFpH4/8qrwlL/KPz4CjASI9DNpQxunaeSqpfYOJCEoPFMzOpeC+Pqs+/st lt7NoMX8QWCjPhl9/V2+1ZlFAOK2ofkDgATHYplVofWFfQ55kt0/mlIjjMpSiBHGMfMNeS oLCyLxKy5n74mN3aFSFjY3nmdgaOpt10+1GBDbDQGek4GASA5wJFUH5ItKd3aA== 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 4bbZ6R0dtjz140T; Mon, 07 Jul 2025 19:28:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567JSkDQ012642; Mon, 7 Jul 2025 19:28:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567JSk8Y012639; Mon, 7 Jul 2025 19:28:46 GMT (envelope-from git) Date: Mon, 7 Jul 2025 19:28:46 GMT Message-Id: <202507071928.567JSk8Y012639@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 01a679715f68 - main - err(3): print extended error if available 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 01a679715f68d5e32efecafc1f158eecec3f781b Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=01a679715f68d5e32efecafc1f158eecec3f781b commit 01a679715f68d5e32efecafc1f158eecec3f781b Author: Konstantin Belousov AuthorDate: 2025-06-16 21:26:22 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-07 18:44:22 +0000 err(3): print extended error if available Reviewed by: asomers, brooks Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D51141 --- lib/libc/gen/err.c | 51 +++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 39 insertions(+), 12 deletions(-) diff --git a/lib/libc/gen/err.c b/lib/libc/gen/err.c index 24ea242560b8..cdce20af5a91 100644 --- a/lib/libc/gen/err.c +++ b/lib/libc/gen/err.c @@ -30,9 +30,12 @@ */ #include "namespace.h" +#include #include #include +#include #include +#include #include #include #include @@ -43,6 +46,11 @@ static FILE *err_file; /* file to use for error output */ static void (*err_exit)(int); +static void verrci(bool doexterr, int eval, int code, const char *fmt, + va_list ap) __printf0like(4, 0) __dead2; +static void vwarnci(bool doexterr, int code, const char *fmt, va_list ap) + __printf0like(3, 0); + /* * This is declared to take a `void *' so that the caller is not required * to include first. However, it is really a `FILE *', and the @@ -70,14 +78,14 @@ _err(int eval, const char *fmt, ...) { va_list ap; va_start(ap, fmt); - verrc(eval, errno, fmt, ap); + verrci(true, eval, errno, fmt, ap); va_end(ap); } void verr(int eval, const char *fmt, va_list ap) { - verrc(eval, errno, fmt, ap); + verrci(true, eval, errno, fmt, ap); } void @@ -85,13 +93,24 @@ errc(int eval, int code, const char *fmt, ...) { va_list ap; va_start(ap, fmt); - verrc(eval, code, fmt, ap); + verrci(false, eval, code, fmt, ap); va_end(ap); } void verrc(int eval, int code, const char *fmt, va_list ap) { + verrci(false, eval, code, fmt, ap); +} + +static void +vexterr(bool doexterr, int code, const char *fmt, va_list ap) +{ + char exterr[UEXTERROR_MAXLEN]; /* libc knows the buffer size */ + int extstatus; + + if (doexterr) + extstatus = uexterr_gettext(exterr, sizeof(exterr)); if (err_file == NULL) err_set_file(NULL); fprintf(err_file, "%s: ", _getprogname()); @@ -99,7 +118,16 @@ verrc(int eval, int code, const char *fmt, va_list ap) vfprintf(err_file, fmt, ap); fprintf(err_file, ": "); } - fprintf(err_file, "%s\n", strerror(code)); + fprintf(err_file, "%s", strerror(code)); + if (doexterr && extstatus == 0) + fprintf(err_file, " (extended error %s)", exterr); + fprintf(err_file, "\n"); +} + +static void +verrci(bool doexterr, int eval, int code, const char *fmt, va_list ap) +{ + vexterr(doexterr, code, fmt, ap); if (err_exit) err_exit(eval); exit(eval); @@ -156,18 +184,17 @@ warnc(int code, const char *fmt, ...) void vwarnc(int code, const char *fmt, va_list ap) +{ + vwarnci(false, code, fmt, ap); +} + +static void +vwarnci(bool doexterr, int code, const char *fmt, va_list ap) { int saved_errno; saved_errno = errno; - if (err_file == NULL) - err_set_file(NULL); - fprintf(err_file, "%s: ", _getprogname()); - if (fmt != NULL) { - vfprintf(err_file, fmt, ap); - fprintf(err_file, ": "); - } - fprintf(err_file, "%s\n", strerror(code)); + vexterr(doexterr, code, fmt, ap); errno = saved_errno; } From nobody Mon Jul 7 19:36:31 2025 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 4bbZHW5pdKz612tj; Mon, 07 Jul 2025 19:36:39 +0000 (UTC) (envelope-from fluffy@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbZHW10Ytz3tT4; Mon, 07 Jul 2025 19:36:39 +0000 (UTC) (envelope-from fluffy@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751916999; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=Rlg966qaydoyKHp/jG+F6aKfgykVvEQeWQChe686PAc=; b=SGhGo7q65WzGzsDpzzpdpHpL/i3CNLB3GPeHby85VBDfqAscsTn95bHs+PebbF7/oaw9GA 0S0NOJXSgzfxMaZV3RxJxsqkvxx3C7hs0fopfZtO3e6Td2n/gddWv1cD/Jdyym+PPuFEGv yBGMI+RoQFEbShZ9yxKLAq6URwPaFMlIpj7iWQOozT2jUvuOCZDxsfcxRVwD7z2oyrIRG7 ES1KKiJ/WkIrMtRtgESI84pj5O9dId0w4gUjdA3vBtUQV7wHQC56BenBGmCBJKV55IjBQC tHmJSVlDyah5/WXopRyI4Ilv9Y31GP7C9uSven1mcdxi2ygNyKRQ7HGdpeN94Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751916999; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=Rlg966qaydoyKHp/jG+F6aKfgykVvEQeWQChe686PAc=; b=p7WvheAzPumL0//fGngHkbQiAxfbdP/bRaSU5+5rL2hjQRXUWLyyC4Qdar+yrlkx9404O5 ncys8FMe/G0QpAm6VXkW/ftculGhCRbiVTgHFJH68LU2TJ6ZeCZ7Vge9Bet/vx4xPXKRHR 07NA19K+UnxKmmg/MMZzugwNN9N0yz3fnH+bzI244foRzmO0Tv7Ak2n+UBKeq8gHB97sAx u0R/jcQTpXztNyOsDY8K2ftcftAg+P+cbN7x/m3Qyzc+NFv4GV5oMVmxfgFpMlHhZ7zf1F DWYj+bpnq9VJNyrMeTc69zYrpjzsp03Ux3KofA34qYocOSHfJt7zxfpclu7h9w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751916999; a=rsa-sha256; cv=none; b=WWJEzqwmbJbj3FyzYtNAEbSuwbwyBKJBxMn7JrztATFkviNWQ4XbtTK1nuKtbxCD4qBQtH QMZue1a6d17WHTgz0riZIQLWrgcyj0uEM3Vk7OCKSWIRdV+LerMVGsfdDK+JRKKQYkLLlz wPc5lV7Nn5yBVF4Vu3X4aW2nSd8CbGFTFTVGRsg7pULwh20vNcOS2HJPyZIee/+kc0xakL y2PrhrvlKwFIOZtc3hOa9E+jVJxulpIqV29idHVSzhFkSAx5lwmVJHPIaCmcm6LiX3Fm09 GGUYfZEJPKr36F6uOImyBlaquP7osMxPghtCj9VApAXReXbO8VUeodAn4IGUPA== Received: from [10.80.0.22] (unknown [89.150.40.109]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: fluffy) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bbZHS6jdfz4CF; Mon, 07 Jul 2025 19:36:36 +0000 (UTC) (envelope-from fluffy@FreeBSD.org) Message-ID: Date: Mon, 7 Jul 2025 22:36:31 +0300 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: 7e35117eb07f - main - Makefile: Hook MIT KRB5 into the build To: Cy Schubert Cc: Cy Schubert , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202506160251.55G2pwx4063231@gitrepo.freebsd.org> <20250620073050.7f03f74e@slippy> Content-Language: ru, en-GB From: Dima Panov Autocrypt: addr=fluffy@FreeBSD.org; keydata= xsFNBEp+xiUBEAD01RkOYcyzU/Fnam2FI7PPwYqW00SwVmfUHihvVniiaMwzaYzchb+mzSha NsqRgjIN/i59OBpnS25OXMLEpQP7jDJnY2xKyJN2H4qn1HPHkF9cYuqvqkm+r5459g+2ZoGY 9Sr1PA0XSzXJMSQ1nRK3cFfqlN/L2//P36U5VuOWXGZUTwr/n2B/N0HAsYsqDOdjofLg7x9z 8p8elqwJbT/O4ltg8JBVAnof+FzqefYW4CzqkHRjq/9ORiGYh14ST9ECsCaVpfdDUTor0wgp JqzCN1HsQcHqgdMmOqigWIgN7Eg4MRQU3LDCISrNJ/45zvcKUXR0RHOjnSuflYba74q58XhZ 4eCTqHeMHjA8st4IWRzy9l0V4RunnZxjOTb806jyIhdxcb2m8o5tXwsqjf0TQ7vYowDHrQ6g XlhPg4Jvvwf+BwlB2p+w7Cs/Y9QA0YHnIOIVZAwU1wv66YSI9IDL2AbnY2gQGx+dkHiC3S5L G8HcPrMcjayyThKKIi5KQsWa3snFeK5ky+cRpVEOPQfUXFOas++91v90Xe9j+lsmRofsyvuy gzoaZE2fud0kCsOgYEg+kiLPlQicNAx5IToOs8BrVFLcxmbPKuVBfbLdWsYLjXGzbXEmzV9f NDZ1r1uNmVema8YYCiNjUDZhxIfKt8nbp6cx8UgVLGRVDEfXeQARAQABzTdEaW1hIFBhbm92 IChGcmVlQlNELk9SRyBDb21taXR0ZXIpIDxmbHVmZnlARnJlZUJTRC5PUkc+wsF2BBMBAgAg BQJKfsYlAhsDBgsJCAcDAgQVAggDBBYCAwECHgECF4AACgkQ+4ugndU5jyk6dhAArHclTYjw VRjDnoRfO3Zfj9Ssab9Vrbo7DNFWeAqPE3OTCmiq9Q0fzRHzmhVyedYMm9qNA3i0J1De3KTn LanXOrBIqsmmZpSqmrp/xXdZngDLW5H6hpE0f2PeAPwxrb9uBQax8WMR7Z4STSHAP4GRjve3 0wNNS0MlawGllcs9VKRxG5PsDA8k3ACTSjdpQ76RWldORN4LA8M40yHRX377SGMzO+XsCeOw ad65GKyLrx+6Gnd3PMOjVCJCrqd04Jgqg9G0xKNImchwIZ5ulx9jAt+ixfNbY6hwslleqimr 2t5+MMqo6dRrvJ+BsR8NHt9vGi2Jy4+4smg05fR18fck0Sk4vCYyVvtvnOk3qZf0F8zJu06G cjWWC2ZbDPbmksWXFIMxoJbyVxK55xOqcFs0t12sR6gbVJb8Nb88WrQub3MgePyMF6R3Tkfa OqkjvQur1xC2AXESTxtJw1FkdGSb3UopNKgvSPHSLFW8B0LbyDxdYRTRWPGGEUhFP6tdXi5R vb1210ks2EQAqF4Cm3iRIhYgtZvQqQgMSiO9fVyeJ0U6dYGDtg2Boi+NtXKRdmtL7pRSnI3n fAbVJ05Hhd7PBnJeob6R08nHRo9DdAG7o8ToM+egUAuEsEvoRV+v4f6k3mShdxE7gG/anwVy eh3n6LGwg9KHDr1X2FODsLLxgUjOwU0ESn7GJQEQAMBTMHQgb0vcPMAiRvb357ihlh/YYA22 FXj4p3XTrDlBlRL0QCRq1I8XDeQmL3mG3s3NBtDXSefnNM06jZ3XCAfHIDBdxJJvQZZCXfvL p/JK7nnEuqoeqT6/oKs1MeZVdUnvh1nZhphs+Z6dl01GIE8YDpzT1JMD2f3G9PHChGi3Ddzq m3VdXt/87khYJkPbaf6EN5+vDthKgMjba8jwbQ+7IUPqkfnNFIZS6irZ2LYb79BLNI5JSl9l ReSfEX2d8ByQlLzuf0TS4voy3nWGeCyj6BIOMiRSxg+hZmJLYxhNkyK4GQVCt/rLT7dIfBQM syBbX0Qw2NOcfba9VgdPZBgdrawwB4/xF9SA3NB0J0lUjhjpH9iG8NxlpleEg8OSUApyFZEJ q2A/flns4kKzNH7AGYDOFORytDzA3qkgCJrZ7nzQSsdtZ2qbyAoze0tl+YrShJhOcmQBtFem omhWVeJ8T/Bw1KH8M1ihrENBTSzYzLvN18YjNP6P0Dh/7Zda5yYI8fNqd84K3Uq5xBiI0S6+ qxViw84z2tJj8TxiNqFAk7Tbeo2Ximtq7uQ9UnFRSK3jw96yi19KU9rQQZs0xUjN5gn/tF5l BZWKjwuZCkcOiI0EWHAR+ATAEsFNXcuoC9CAGK5HFW4nI4WtE3pv1KYvivlGtF1wzf0Qrhye RrmxABEBAAHCwV8EGAECAAkFAkp+xiUCGwwACgkQ+4ugndU5jymgKg//RvnI7zEDKv6nQUqK RyLawPTrCKCtQ2vSoWyTNgRB6byNS1w5wNSAMnqaESx2bdhauaxe167VEJYqgQy241yFslpC 6v/xlH25Ppos+Jg6AKaQG/JABHO6Co4tHtBbNmM+14HESxAodA4NJuEU19iIPjRhUKC8F8R9 xBmW1uLpPiljU9Km0P3EIKjAdtdZNeMLhwsbSHBwJROFrxFGiTzWNREWZoZpQxgSbHYhwYbx HEbJi1cybl9IQvSGHrysctZsxD04Jxh6ogaziiT8aV6ear6BNh008yRf61FvrinfG3USLR3i JO8aHap4QGCPjZ3cyT+DEq8/zVfDdeidTeNEhSgRKk856RcA+yAE79KYdKkvmDUiC8poAJ7F GEYHMB+g/1+LczCr2g9GYkiB/53boYfU9esYYlarxCgedCrwXv6T48FZ3xxoH3XJ2KV8K6M8 CUb04jj3kEeCwq+R6Bk2ZXrnMzyQmmn223X+Zp89B/gchH32JY8y3j7BICcoZmgMu62XNMgW I/hRgfi3JlVCne6XPj3/w00JYG7vo+eTJOflqYr3WRTPYh7DxzYtshZswHmmkZtwizUQUZzF 9dX2CM8nY7cKucEmtcnUpjGwXMOufa/DmCTlk8ggRZ0ukCUZOlIA4ILxp95sS2oqyucARv+p wMWvrqJ/LfbZexSsIjI= Organization: FreeBSD.org In-Reply-To: <20250620073050.7f03f74e@slippy> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------HFQRNXg78vu0UjJcJYr70J0P" This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------HFQRNXg78vu0UjJcJYr70J0P Content-Type: multipart/mixed; boundary="------------dGEJHv5hY0rfzj00d7E0LOSD"; protected-headers="v1" From: Dima Panov To: Cy Schubert Cc: Cy Schubert , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Message-ID: Subject: Re: git: 7e35117eb07f - main - Makefile: Hook MIT KRB5 into the build References: <202506160251.55G2pwx4063231@gitrepo.freebsd.org> <20250620073050.7f03f74e@slippy> In-Reply-To: <20250620073050.7f03f74e@slippy> --------------dGEJHv5hY0rfzj00d7E0LOSD Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: base64 SGVsbG8hDQoNCg0KQlRXLCBpdCBsb29rcyBsaWtlIHN5bWxpbmsgZm9yIGxpYmthZG01Y2xu dC5zbyBpcyBicm9rZW4gYW5kIHByb2R1Y2VkIGEgYmFkIGZpbGUNCiQgbHMgLWxhIGxpYmth ZG01Y2xudA0KbHJ3eHIteHIteCAgMSByb290IHdoZWVsIDEzICA3IEp1bCAyMDo0MCBsaWJr YWRtNWNsbnQgLT4ga2FkbTVjbG50X21pdA0KDQppbnN0ZWFkIG9mIGFzc3VtZWQgbGlia2Fk bTVjbG50LnNvIC0+IGthZG01Y2xudF9taXQuc28NCg0KDQpQbGVhc2UgcmV2aWV3Og0KDQpk aWZmIC0tZ2l0IGEva3JiNS9saWIva2FkbTVjbG50L01ha2VmaWxlIGIva3JiNS9saWIva2Fk bTVjbG50L01ha2VmaWxlDQppbmRleCBlMzc3Zjk1ZjViNmUuLmJlMDlkZDNlMjEwZSAxMDA2 NDQNCi0tLSBhL2tyYjUvbGliL2thZG01Y2xudC9NYWtlZmlsZQ0KKysrIGIva3JiNS9saWIv a2FkbTVjbG50L01ha2VmaWxlDQpAQCAtODgsNyArODgsNyBAQCAke0NIUEFTU19VVElMX1NU UklOR1NfRVJSX0N9OiAke0NIUEFTU19VVElMX1NUUklOR1NfRVJSfQ0KICAgICAgICAgcm0g LWYgZXQtYy0key5QUkVGSVh9LmV0IGV0LWMtJHsuUFJFRklYfS5jDQoNCiAgYWZ0ZXJpbnN0 YWxsOg0KLSAgICAgICAke0lOU1RBTExfTElCU1lNTElOS30gJHtTSExJQn0gJHtERVNURElS fSR7TElCRElSfS9saWJrYWRtNWNsbnQNCisgICAgICAgJHtJTlNUQUxMX0xJQlNZTUxJTkt9 ICR7U0hMSUJfTkFNRX0gJHtERVNURElSfSR7TElCRElSfS9saWJrYWRtNWNsbnQuc28NCg0K ICAuaW5jbHVkZSA8YnNkLmxpYi5taz4NCg0KDQpPbiAyMC4wNi4yMDI1IDE3OjMwLCBDeSBT Y2h1YmVydCB3cm90ZToNCj4gT24gRnJpLCAyMCBKdW4gMjAyNSAxMjoyNzowOSArMDMwMA0K PiBEaW1hIFBhbm92IDxmbHVmZnlARnJlZUJTRC5vcmc+IHdyb3RlOg0KPiANCj4+IEhlbGxv IQ0KPj4NCj4+DQo+PiBMb29rcyBsaWtlIHNvbWV0aGluZyBtaXNzaW5nIGFmdGVyIHRoZSBi dWlsZCB3aXRoIE1JVCBLZXJiZXJvcy4NCj4+DQo+PiBnb3QgdGhpcyB3aXRoIGRldmVsL2d2 ZnMgYnVpbGQ6DQo+Pg0KPj4gPT0NCj4+IEluIGZpbGUgaW5jbHVkZWQgZnJvbSAuLi9kYWVt b24vcHR5X29wZW4uYzo3MDoNCj4+IC91c3IvaW5jbHVkZS91dGlsLmg6MzY6MTA6IGZhdGFs IGVycm9yOiAnazUtaW50LmgnIGZpbGUgbm90IGZvdW5kDQo+PiAgICAgIDM2IHwgI2luY2x1 ZGUgIms1LWludC5oIg0KPj4gICAgICAgICB8ICAgICAgICAgIF5+fn5+fn5+fn4NCj4+IDEg ZXJyb3IgZ2VuZXJhdGVkLg0KPj4gPT0NCj4+DQo+PiBJbmRlZWQsIGs1LWludC5oIGlzIG1p c3NpbmcgaW4gL3Vzci9pbmNsdWRlIDooDQo+Pg0KPj4gT24gMTYuMDYuMjAyNSAwNTo1MSwg Q3kgU2NodWJlcnQgd3JvdGU6DQo+Pj4gVGhlIGJyYW5jaCBtYWluIGhhcyBiZWVuIHVwZGF0 ZWQgYnkgY3k6DQo+Pj4NCj4+PiBVUkw6IGh0dHBzOi8vY2dpdC5GcmVlQlNELm9yZy9zcmMv Y29tbWl0Lz9pZD03ZTM1MTE3ZWIwN2Y4NmMzODU2NTZlY2M2YTJhOTIwOTNiZTk4MTMxDQo+ Pj4NCj4+PiBjb21taXQgN2UzNTExN2ViMDdmODZjMzg1NjU2ZWNjNmEyYTkyMDkzYmU5ODEz MQ0KPj4+IEF1dGhvcjogICAgIEN5IFNjaHViZXJ0IDxjeUBGcmVlQlNELm9yZz4NCj4+PiBB dXRob3JEYXRlOiAyMDI1LTA2LTExIDAyOjU3OjU0ICswMDAwDQo+Pj4gQ29tbWl0OiAgICAg Q3kgU2NodWJlcnQgPGN5QEZyZWVCU0Qub3JnPg0KPj4+IENvbW1pdERhdGU6IDIwMjUtMDYt MTYgMDI6NDk6MzcgKzAwMDANCj4+Pg0KPj4+ICAgICAgIE1ha2VmaWxlOiBIb29rIE1JVCBL UkI1IGludG8gdGhlIGJ1aWxkDQo+Pj4gICAgICAgDQo+Pj4gICAgICAgQWRkIHRlc3RzIGZv ciBNS19NSVRLUkI1LiBJZiAieWVzIiBidWlsZCBNSVQgS1JCNS4gSWYgIm5vIiBidWlsZCBI ZWltZGFsLg0KPj4+ICAgICAgIFRoZSBkZWZhdWx0IGlzIE1LX01JVEtSQjUgPSBubywgYWRk ZWQgYnkgImtyYjU6IEFkZCBidWlsZCBwbHVtYmluZyIuDQo+Pj4gICAgICAgDQo+Pj4gICAg ICAgQXQgc29tZSBwb2ludCB3ZSB3aWxsIGNoYW5nZSB0aGUgZGVmYXVsdCB0byBNS19NSVRL UkI1ID0geWVzLiBBIHBvcnRzDQo+Pj4gICAgICAgZXhwLXJ1biB3aWxsIG5lZWQgdG8gYmUg c3VjY2Vzc2Z1bGx5IHJ1biBmaXJzdC4NCj4+PiAgICAgICANCj4+PiAgICAgICBTcG9uc29y ZWQgYnk6ICAgICAgICAgICBUaGUgRnJlZUJTRCBGb3VuZGF0aW9uDQo+Pj4gICAgICAgRGlm ZmVyZW50aWFsIHJldmlzaW9uOiAgaHR0cHM6Ly9yZXZpZXdzLmZyZWVic2Qub3JnL0Q1MDgx NQ0KPj4+IC0tLQ0KPj4+ICAgIE1ha2VmaWxlLmluYzEgICAgICAgIHwgODkgKysrKysrKysr KysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKw0KPj4+ICAgIE1h a2VmaWxlLmxpYmNvbXBhdCAgIHwgIDQgKysrDQo+Pj4gICAgdG9vbHMvYnVpbGQvTWFrZWZp bGUgfCA2NCArKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrDQo+Pj4gICAg MyBmaWxlcyBjaGFuZ2VkLCAxNTcgaW5zZXJ0aW9ucygrKQ0KPj4+DQo+IFsuLi5dDQo+IA0K PiBUaGUgYXR0YWNoZWQgcGF0Y2ggd2lsbCBmaXggdGhlIHByb2JsZW0uIEl0IGNvbnRhaW5z IHR3byBwYXJ0cy4NCj4gDQo+IDEuICBEb24ndCBpbnN0YWxsIHRoZSBvZmZlbmRpbmcgaGVh ZGVyIGZpbGVzLiBUaGV5IHdlcmUgaW4gbXkgZmlyc3QgY3V0DQo+ICAgICAgb2YgdGhlIHBs dWdpbnMgYnVpbGQgYW5kIHdlcmUgbm90IHJlbW92ZWQgYXMgSSBjbGVhbmVkIHVwIHdoaWxl DQo+ICAgICAgcmF0aW9uYWxpemluZyB0aGUgaW5zdGFsbGVkIGZpbGVzIHdpdGggdGhlIHBv cnQuDQo+IA0KPiAyLiAgT3B0aW9uYWxPYnNvbGV0ZUZpbGVzLmluYyByZW1vdmVzIHRoZSBm aWxlcyB0aGF0IHdlcmUgZXJyb25lb3VzbHkNCj4gICAgICBpbnN0YWxsZWQuDQo+IA0KPiBJ dCBpcyBlbm91Z2ggdG8gcnVuIG1ha2UgZGVsZXRlLW9sZCB0byBmaXggdGhlIHByb2JsZW0u IFRoZSBNYWVmaWxlDQo+IHBhdGNoIGVuc3VyZXMgdGhleSdyZSBub3QgaW5zdGFsbGVkIGFn YWluLg0KPiANCj4gTXkgYnVpbGR3b3JsZC9pbnN0YWxsd29ybGQgdGVzdCBpcyBzdGlsbCBy dW5uaW5nIHRvIHZlcmlmeSBub3RoaW5nIGVsc2UNCj4gaXMgYnJva2VuLg0KPiANCj4gU29y cnkgZm9yIHRoZSBicmVha2FnZS4NCj4gDQoNCi0tIA0KU2luY2VyZWx5LA0KRGltYSAoZmx1 ZmZ5QEZyZWVCU0Qub3JnLCBodHRwczovL3QubWUvRmx1ZmZ5QlNELCBAZmx1ZmZ5Om1hdHJp eC1kZXYuZnJlZWJzZC5vcmcpDQooZGVza3RvcCwga2RlLCB4MTEsIG9mZmljZSwgcG9ydHMt c2VjdGVhbSlARnJlZUJTRCB0ZWFtDQoNCg== --------------dGEJHv5hY0rfzj00d7E0LOSD-- --------------HFQRNXg78vu0UjJcJYr70J0P Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature.asc" -----BEGIN PGP SIGNATURE----- wsF5BAABCAAjFiEELTAsy5mEEwxvh7r8+4ugndU5jykFAmhsIb8FAwAAAAAACgkQ+4ugndU5jyli RhAAy4NzRCXSP0vnsWdfeOT863FAPBhiDErZGN+W0y7yb+LcdnawU3HZldE3rbZClJ4NQhyVHD6S X8joh1irLRxdaoMwg3hDUTi/O9quxT1P67itKT634LT48TCo0/SGHlHVx92dzKKv258dRkPv7uIv LWqfllLNnmuYOgT+Tx3b21aM1lcfHhYiGSLad9nsjOeO0g8mXUcdmK071BnNNURTMOHYDURxxw77 ox74Btuc5mRbT1o/nUPMogBRfDG3OwW9828mfoTwaaJVkW2ihPorTojwEhC1VaK1b6ebCDiED6oQ 1wJC8ISuzPB+zparBenTsTNWm6jbBKgjqbDUnBUoisUwARCugmm1C+C8pfQ5lH3f8rAYoSCbL3JR 1hvJE9RY31aJX85O13qIh8eeBSkKIRfPlf3pE06JFJ2V7nMkGhfVk7axviNfLU8mOGRxFGdnT03k ryOogwKkz3cQYne8bLPQJAhmdeBnVkWe2S0gEaHBgPsWRvqcKM99mBDSoDX6zmGZ0R/XfSuuFc1+ lnS1n3WzVzIgy7rC2nH+pJz8zcpTe8+foJMv8uqjz+N+TLxCRQHxtiuAphonqmTcXzHPbJm24BCj 1GohCuNyPvJmbL49M0bOp3NATnqpw8Wub9XYleoGUJ9ya8K7qlA31xx9bTEs5Gk582zFUnx4X9db eRc= =Kne2 -----END PGP SIGNATURE----- --------------HFQRNXg78vu0UjJcJYr70J0P-- From nobody Mon Jul 7 20:16:48 2025 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 4bbb9s2C59z616pC; Mon, 07 Jul 2025 20:16:49 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbb9s0L3kz3KZj; Mon, 07 Jul 2025 20:16:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751919409; 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=92QWW0SnrLMLNC1om3T1gSP8fjkcWFb7uRjvfgwWviQ=; b=eOnhT22jj5A+Gv/ibC0GTV5tpSpAecuegon8iTHbtGXHPTUh/XpJLVNQrIVw3n7yLurE1l G3mfTRuvQfwGhGdBKeM2sFlNj/1X3Z8EW4NBSun8xEEFnD7whsDup3u7SSH2Oj1Fbn4o7l uagxh7DlGFOpfSl07i/vnCqTXHXLY2zI0X7VzOM5YUgWc5jIBg5pQMAoR8pPUpgHBhcact HTV68F0KwjdDhDCWy3P4wbN6BpMB9ekBP3RrI1ArSMd+qw8nyhpa5fREBU8SEck+i2reZJ EvSZ7aBkQjB+SG3ZnJttwqfyEIi0gjfgBU7O012nbHe6ryZCKVANgumKZViyLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751919409; 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=92QWW0SnrLMLNC1om3T1gSP8fjkcWFb7uRjvfgwWviQ=; b=rUgAWr9M/M2mWVnWktQerX2B5ee1IU4wlRW/uZJGimvOH5Wq/hv2u9mKv3XO6TsAxgRssd P77G8HNLd+FylwB1EXHbS0tSm2y0vdkwxMHOw2Y7DR1WiQD0lS0jY5e212PkPggv0Z0wnh Hp6pjHHu0LqaDpmhYK6RBfD9HK7MfEQ/MYP+1exmdJAwhB9DioQTTThZAxhA0bIM3hk96Y K0yUo88KW+EowMr4AaWt1tDThHrG7QSXxbskFJXoPSBcsth5AbV6RajpsQnt5BdbJ+nVhy VbEe5eVfDJBQFKorzuRUF2cvfBR8iZlQlkZXAoUweE6AZLnRIKhhXANWmlRD7w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751919409; a=rsa-sha256; cv=none; b=bT06FCR9WlAK0bw8bEwi3NaakIwzXk7aF+U230b6x/KZNamrKWur+3Dd0KInz2uc+AmBCl KCT1y/C1/CXwoaIYfcyst4xMoxVCRJDz5IINOJW7ZmRnyWe+wwr4io61xmSOvSEA5ythUu snIos+Vfv1qDhk6VXo3+TYvtAdK0F8A8+6qMhpplSFwMvuVllbYaX+hO43a+6rsqg2x4ML oGyPot6ogEyGra9JSqTBmFxxPTBp2RJSELRptjPqcDlpHgaB6bJpV+W2Nse606+BEV1Ulz 1SW8n5tuCtPDKEdpGbyIKmS58n0wCkc4FjV0Aq8hb3IVLCx10dNdVymx0S+wuQ== 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 4bbb9r64SJz154F; Mon, 07 Jul 2025 20:16:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567KGmrN006480; Mon, 7 Jul 2025 20:16:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567KGmQr006477; Mon, 7 Jul 2025 20:16:48 GMT (envelope-from git) Date: Mon, 7 Jul 2025 20:16:48 GMT Message-Id: <202507072016.567KGmQr006477@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: 3a20f630a9fc - main - git-arc: Fix handling of author names when we have to make a guess 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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/main X-Git-Reftype: branch X-Git-Commit: 3a20f630a9fcf6a1267cd527464edf71d01c8771 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=3a20f630a9fcf6a1267cd527464edf71d01c8771 commit 3a20f630a9fcf6a1267cd527464edf71d01c8771 Author: Mark Johnston AuthorDate: 2025-07-07 16:50:10 +0000 Commit: Mark Johnston CommitDate: 2025-07-07 20:16:30 +0000 git-arc: Fix handling of author names when we have to make a guess The output printed by this function is used as the author name, so we don't want to print informational messages to stdout. --- tools/tools/git/git-arc.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/tools/git/git-arc.sh b/tools/tools/git/git-arc.sh index d953a30cb90d..22df0c61293a 100644 --- a/tools/tools/git/git-arc.sh +++ b/tools/tools/git/git-arc.sh @@ -545,7 +545,7 @@ find_author() # don't know if the prior _ are _ or + or any number of other characters. # Since there's issues here, prompt a=$(printf "%s <%s>\n" "${name}" $(echo "$addr" | sed -e 's/\(.*\)_/\1@/')) - echo "Making best guess: Turning ${addr} to ${a}" + echo "Making best guess: Turning ${addr} to ${a}" >&2 if ! prompt; then echo "ABORT" return From nobody Mon Jul 7 20:16:49 2025 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 4bbb9t1CVnz616lf; Mon, 07 Jul 2025 20:16:50 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbb9s6byCz3Knm; Mon, 07 Jul 2025 20:16:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751919409; 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=PiUFKIMUehkC0pmasbQCzElEnuE+kkWaSXDIP5wo+uY=; b=M0EnRAZ4VqlNZie673mgutJ2fr6v6kZxtAWiqOQInS4yOy8voT1w/A4eNi1zSkDXT/Wt2q nYaw04bDkalAJwNjB0LWUo7fCN9jDZn5/p5z1U7/VfN2c4hcOuQjaXrd/GQ85jNza4g7Bn 7j2zg53gKTPaIEuhiiv/uk/LF5pzX+gYFDVvPnDNEu3q0vGaRql9LnTiVv1Q7K4g1b3ZM6 NGoqcFDYwujrKAGiFbCTXUhCB+rrPhRcR16Xm48b/82a/syOGuJDlONszlwhQUbCX7wkIK s4LVlKxHZuMTnMYHffhtmCwY8obDX4CWMf9/pR4QPpVefhJY0kzZt0iaP4BxDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751919409; 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=PiUFKIMUehkC0pmasbQCzElEnuE+kkWaSXDIP5wo+uY=; b=c1QEyUA16jOKAsTVhN1C4qqEwbjVaEIQz+Ukbx2qUT4DoiSVBNaXtWPkflPl2qqvmPJnWa S8tJyHbLIMV7zOJy4r+Oh7a6nIdgzsbqlmFOv+3px4J/DTk+LtGkcIv6OZYLBmL/r8duKi iKosvaHS4uHjcbDj9zVHlxwm3VxA/wdRBPRWrCostzsF9dobhsf6sfuLO+JYp9zwGgUcAk sr2q89PIFbgtNIwrrXQqejVfp3PcEehSRsl3aHTJutJhgiIybVjsFluwcQ5+sVv5Z4luCr BMF+/4Zx3LnJcrKD8nAYE9qJtqFhZcH59nIDngbzXJ4IKp0kvx3GztFFZX6KtQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751919409; a=rsa-sha256; cv=none; b=kAa9gpteT2sNjTIKKSYiMcbgFrOqOxuY+pXUhyL//gILtPhu/qF6FMN4bRxoPk/SmSY/A/ SJlkSL5fff8ND8baLiqG2R7tHo3lVnoqyz6FR87E9H8NqqmL/tJHr6XSomutriP8xj9lGn tb+QYPvt1lQdJEbV57yLfy+dE9UCczExJGkavG9zUW7axTboOS/8z70xpWsAAH/E+avER9 qY6Mr5QE8jtAR+nZ+IjqGTKcN8lkpBs3cbAUYt8PmdkwW061qpzvrAXDHSD7Olg7U4b9Kr zOTUc+ZRkj8dS+zdEav00XlNKghQrlG7KWaHOcB9czLuSgUTQHF4P5EXoaPlQQ== 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 4bbb9s69DXz155x; Mon, 07 Jul 2025 20:16:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567KGnkE006513; Mon, 7 Jul 2025 20:16:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567KGnfd006510; Mon, 7 Jul 2025 20:16:49 GMT (envelope-from git) Date: Mon, 7 Jul 2025 20:16:49 GMT Message-Id: <202507072016.567KGnfd006510@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: 12bef37a824c - main - dtrace: fix symbol address resolution 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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/main X-Git-Reftype: branch X-Git-Commit: 12bef37a824c52582ee8f38699b8ae4fde17068d Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=12bef37a824c52582ee8f38699b8ae4fde17068d commit 12bef37a824c52582ee8f38699b8ae4fde17068d Author: Jiacong Fang AuthorDate: 2025-07-07 18:51:51 +0000 Commit: Mark Johnston CommitDate: 2025-07-07 20:16:31 +0000 dtrace: fix symbol address resolution Dtrace assumes only ELF sections of type SHT_PROGBITS or SHT_NOBITS occupy memory space. However, sections with SHF_ALLOC flag also consume memory space. Moreover, the symbol address initialization skips symbols at the very beginning of a section in ET_REL KLDs. Fix: Check section flag for calculating section offset, and disable the skipping at the beginning of a section. PR: 288000 Reviewed by: markj MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D51188 --- cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c index 2a0386c33124..f6a328bb9b39 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c @@ -109,8 +109,7 @@ dt_module_syminit32(dt_module_t *dmp) if (sym->st_name == 0 || sym->st_name >= ss_size) continue; /* skip null or invalid names */ - if (sym->st_value != 0 && - (ELF32_ST_BIND(sym->st_info) != STB_LOCAL || sym->st_size)) { + if (ELF32_ST_BIND(sym->st_info) != STB_LOCAL || sym->st_size) { asrsv++; /* reserve space in the address map */ #if defined(__FreeBSD__) @@ -159,8 +158,7 @@ dt_module_syminit64(dt_module_t *dmp) if (sym->st_name == 0 || sym->st_name >= ss_size) continue; /* skip null or invalid names */ - if (sym->st_value != 0 && - (ELF64_ST_BIND(sym->st_info) != STB_LOCAL || sym->st_size)) { + if (ELF64_ST_BIND(sym->st_info) != STB_LOCAL || sym->st_size) { asrsv++; /* reserve space in the address map */ #if defined(__FreeBSD__) sym->st_value += (Elf_Addr) dmp->dm_reloc_offset; @@ -245,8 +243,7 @@ dt_module_symsort32(dt_module_t *dmp) for (i = 1; i < n; i++, dsp++) { Elf32_Sym *sym = symtab + dsp->ds_symid; - if (sym->st_value != 0 && - (ELF32_ST_BIND(sym->st_info) != STB_LOCAL || sym->st_size)) + if (ELF32_ST_BIND(sym->st_info) != STB_LOCAL || sym->st_size) *sympp++ = sym; } @@ -269,8 +266,7 @@ dt_module_symsort64(dt_module_t *dmp) for (i = 1; i < n; i++, dsp++) { Elf64_Sym *sym = symtab + dsp->ds_symid; - if (sym->st_value != 0 && - (ELF64_ST_BIND(sym->st_info) != STB_LOCAL || sym->st_size)) + if (ELF64_ST_BIND(sym->st_info) != STB_LOCAL || sym->st_size) *sympp++ = sym; } @@ -1218,7 +1214,7 @@ dt_module_update(dtrace_hdl_t *dtp, struct kld_file_stat *k_stat) continue; /* skip any malformed sections */ if (sh.sh_size == 0) continue; - if (sh.sh_type == SHT_PROGBITS || sh.sh_type == SHT_NOBITS) { + if (sh.sh_flags & SHF_ALLOC) { alignmask = sh.sh_addralign - 1; mapbase += alignmask; mapbase &= ~alignmask; From nobody Mon Jul 7 20:16:50 2025 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 4bbb9v3dLNz616rD; Mon, 07 Jul 2025 20:16:51 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbb9v0Nx1z3KRb; Mon, 07 Jul 2025 20:16:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751919411; 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=2yRiu4H8n7UyhoB9XkgduSSVMy0hn65l1NcBJyDWp+0=; b=X/r29HTItomMvbNWmiyhQDlTQ/IIGh+BOv5g1zvwH0dmyBqBrfdLEleP8ByhcoiIwpSiFd 3g4jmPgtbnQ/8omAuJ+UVdUpm2SEZRLnuO5NCiD6lPcRaBV0NHTcUpYrDAv+nc6BAgJRkd 4SDnMdw8gxMVV9AyRYuSpdgi1QxuUNNG5QQ/v3rxGA67XAcX7IKu7R2WQgCayEbyR2qW4u Y++EtfMrL+fiFNJu+/a8eabV4m/c1PqVbRc1zhzZOswPCH6DzvJkqgxifXjjTtMzbYrp+6 U1orCpidQtzenwlCjiABCPsNONCZi20lbQurPGwq5LB8sOfwy5e23ZmiBvYAkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751919411; 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=2yRiu4H8n7UyhoB9XkgduSSVMy0hn65l1NcBJyDWp+0=; b=O5aXNcUeZyvfOMz92jCvroFt06radUcC8yqBRqmHjdkUxVlFOIBEDYMUh3ekBmwuAbiH5w xmHorocvsgy4XLqf5NS6z+Ln0iH1ITokOYHXxkWEB5dL3zI70xOgukCp1nl3MXR6bRr4td 1YB0mPlBeTMXYaqT7J5A3SOzUW4mQVbAQtFwselaMXsiZIvwnkFI1H6Q0ZZTnx7thVDVuw Jb0kQG7YayxjsHB/q7ALIpuHBGPtJdyuw8RSAsQNG0ohrVYjUjERRY4ZuFwOml5drsofLQ h1FxEPKjwWzhZE/ZtFtQSxVaF62e6vD+hUhAPt7mIRlEnAN9OboNZgZ2RN19+Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751919411; a=rsa-sha256; cv=none; b=oIfFLUM+dnVspcd2I5gaqtwBl+zdXtIW24UlsqxhZjKrNpN0YmDXTZjedsfHQV1HRcGcrH M0ReJ9QcSMiUmfyUPKmpSFItWnhrHwjWYmHDeluZq8945SK+KOLEv4LMFaTHeAT2C6QUKg Vz51MZmHqxjfkNSPe3fWZkuamsmUEiJ5Y6xgvspTR/Fm2qDW9PSN1IgEpkEWIrjTSQUEiY S0ig+CZFpv5I2NSqeC7/23V1kHgnH+8XCgbdRa9raNTiP0uD0Cl8kKq1l6b7R/ngjjxlX+ DSMfTtVd6qGWeYfeB5fyvxNyBFO0a6nPXvidZ7cQI8uHzAvDg2HeJZyyl9xfQA== 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 4bbb9t6qKNz154G; Mon, 07 Jul 2025 20:16:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567KGolv006554; Mon, 7 Jul 2025 20:16:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567KGoES006549; Mon, 7 Jul 2025 20:16:50 GMT (envelope-from git) Date: Mon, 7 Jul 2025 20:16:50 GMT Message-Id: <202507072016.567KGoES006549@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: 4ea7a920de22 - main - inotify tests: Use unsigned integers for event masks 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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/main X-Git-Reftype: branch X-Git-Commit: 4ea7a920de22d283dd801a38588f35f56cdddcb6 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=4ea7a920de22d283dd801a38588f35f56cdddcb6 commit 4ea7a920de22d283dd801a38588f35f56cdddcb6 Author: Mark Johnston AuthorDate: 2025-07-07 19:14:41 +0000 Commit: Mark Johnston CommitDate: 2025-07-07 20:16:31 +0000 inotify tests: Use unsigned integers for event masks Reported by: gcc Fixes: 739fc14938d5 ("tests: Add some regression tests for inotify") --- tests/sys/kern/inotify_test.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/sys/kern/inotify_test.c b/tests/sys/kern/inotify_test.c index ed7cef5d148c..713db55afc22 100644 --- a/tests/sys/kern/inotify_test.c +++ b/tests/sys/kern/inotify_test.c @@ -79,7 +79,8 @@ close_inotify(int fd) } static uint32_t -consume_event_cookie(int ifd, int wd, int event, int flags, const char *name) +consume_event_cookie(int ifd, int wd, unsigned int event, unsigned int flags, + const char *name) { struct inotify_event *ev; size_t evsz, namelen; @@ -118,7 +119,8 @@ consume_event_cookie(int ifd, int wd, int event, int flags, const char *name) * matches the expected values. */ static void -consume_event(int ifd, int wd, int event, int flags, const char *name) +consume_event(int ifd, int wd, unsigned int event, unsigned int flags, + const char *name) { (void)consume_event_cookie(ifd, wd, event, flags, name); } From nobody Mon Jul 7 20:16:51 2025 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 4bbb9w4rzKz616ys; Mon, 07 Jul 2025 20:16:52 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbb9w1K4rz3Khy; Mon, 07 Jul 2025 20:16:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751919412; 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=ClpeLU8M7C4k4OvF2fAFTNssyL+GAUl2SDMvhzqrwdw=; b=IAaZb0VGmbNfc7BMoLpmQaC9djZV/sm3BSrkFLfVKq4qImv68wCzAxJCDb/2YbnkMLOfcc Qsru/9i7WpbKNuds+EKGiPyhUwtZdG9GDeKI4Ha33yKcE2BHHvj119ed2KGO79mHFHZl6F SVdP2XXYoCsI4HkPpBpbcI+/NHI+uZv/0hqXCJtorVsNn1u7iboWXEgBFYbtnOhImCcU1z mtEX4p9refAGN9pFuJvqpWn2jJfX0DWbyCl5937dnO7imiAvF8HqY6UOtLIJVrPDT2/Nnd iJ3nY1WMgFgTBBjBYp0HZUOjcPoMPjXrlfyAFSfqbhSRm/pLRo+vBh+3o8mO7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751919412; 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=ClpeLU8M7C4k4OvF2fAFTNssyL+GAUl2SDMvhzqrwdw=; b=p0fxbTVe++HCBhGLahtI++VM26IKXALTAPn2qrW7tPQ4nsg2MMCc3ggDfo0ER6Is9LRvPc ZULy/d4LHQZx+07zIfEO3MH0UU/qyrfeg922lz5tLhFiUZKNRN2ypXNI2wQtLO0IMsPp3v evM63RJ2S3FGM231gdd1JErkiqzHl2qgJsDT/DgxlnZvO4MEUGNn3JcJOjIXrdvedlG2/n Rz/cU8eW67ttuEIS9ZibLMOQ/nOCqRDA+9xgNlId/cjTdLT6/RWTrm+p9kyViZPOcJaxMj 7viEM/7davgpJAhfH2DYJgdg/H4+GwcRilk4DP5PtDsNB8gUVmR9+yhXdbztbg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751919412; a=rsa-sha256; cv=none; b=UROKgp9X9M+JzqKb9Rgd2aIMn/HNXj5KOoIMBI0HWFiLETosNSJcE5EdkfyICVwW3WElJD QSvQprDW5xJ0gBadP9WvwtpgxEYub4HvEewln/Igc3K1kStikCaLTQlXdsrlvxFaz0YfDY 151Ap8mnPG8NWBuXVgepVclV0yQN52hS4qhsE1M/7erd/aPTqbqWAdAw0I+EhZcMeiN1Ox tDlPVN0P/CgBhQCwT+6bheJw+5zIcal1hvgmXUu7nzA9E4ceh+5w/HXtCcSqfhydv5L1oe I0UjehNaZqgX/7AVDdHf/1fDNXTedCjRGGDzqXrfLFUBqv6kGbDtqag0NFbv1g== 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 4bbb9w0gjSz14cg; Mon, 07 Jul 2025 20:16:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567KGpcf006596; Mon, 7 Jul 2025 20:16:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567KGpNl006593; Mon, 7 Jul 2025 20:16:51 GMT (envelope-from git) Date: Mon, 7 Jul 2025 20:16:51 GMT Message-Id: <202507072016.567KGpNl006593@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: bc6b526e2b71 - main - inotify: Use memcmp() to compare embedded file names 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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/main X-Git-Reftype: branch X-Git-Commit: bc6b526e2b71cf7e07806db5bc77926ed5c874f7 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=bc6b526e2b71cf7e07806db5bc77926ed5c874f7 commit bc6b526e2b71cf7e07806db5bc77926ed5c874f7 Author: Mark Johnston AuthorDate: 2025-07-07 19:30:35 +0000 Commit: Mark Johnston CommitDate: 2025-07-07 20:16:31 +0000 inotify: Use memcmp() to compare embedded file names Otherwise gcc warns that strcmp() will read a byte from a zero-length array, though in practice we exclude that case with an explicit length check. Fixes: f1f230439fa4 ("vfs: Initial revision of inotify") --- sys/kern/vfs_inotify.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/vfs_inotify.c b/sys/kern/vfs_inotify.c index 9562350c897f..41e73bb41a49 100644 --- a/sys/kern/vfs_inotify.c +++ b/sys/kern/vfs_inotify.c @@ -503,7 +503,7 @@ inotify_can_coalesce(struct inotify_softc *sc, struct inotify_event *evp) return (prev != NULL && prev->ev.mask == evp->mask && prev->ev.wd == evp->wd && prev->ev.cookie == evp->cookie && prev->ev.len == evp->len && - (evp->len == 0 || strcmp(prev->ev.name, evp->name) == 0)); + memcmp(prev->ev.name, evp->name, evp->len) == 0); } static void From nobody Mon Jul 7 20:26:10 2025 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 4bbbNf4grKz617tM; Mon, 07 Jul 2025 20:26:10 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbbNf3LYvz3S1k; Mon, 07 Jul 2025 20:26:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751919970; 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=3aOzc+UCeZoNwzvqEagWsii6WTefBkWVjS1y9q4m3I8=; b=Td2pB5hmwEMy0Aj/xeRkyKiPCZPKaRbrVScTkaAZZPkBifYeQ/yRRIUWGSKuf/UeIuA3wW d7cEG1kczfv0r1S2P/rxQAJzyEceB8k8t9m1m2YNabusOyeHAa/9eGrHRf0qJoGigNmzgw zoZvI7H5hH3hgyTohejhwV5NFuSLXpy2cu2vw50NcL6C2u8glFxb4J4v477p5Pofubuy/X A3GJYmfet2eboJG1wJT//dXjzDO2AZMqUp8Ax4WuV/Gg2G3/rWVJQfnjKTD3XopRJr1NXK WztT+v+7rVFVFWwdLx9XGkJMyOyY1UPLTDfxC/c8Mf1fFNpUS3ZcuGqsz/oMXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751919970; 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=3aOzc+UCeZoNwzvqEagWsii6WTefBkWVjS1y9q4m3I8=; b=pUv/H3Hx9Nnx2F6gkCgVcMWYL4nRacaEMcIx64Zll70/0xq+KhO1IykX0FbbVwnO+yf7qA KRYftt4qkhDMcNhUr2tu2hi9s6OHkCxW3QQ3m7oKo8ZgeXeUyOHZF9PAMpfFbIFTePapp8 6lWY33nYmzJnNMye4aOQGo3jtbedB0RGORJrPIhjtxH5Cy7g5fhco0do7Eo71klO/+2R47 K0P6IiKBT7bpPrl1Zkx36N5GGnyYCRE7vnwBxjoIlV76+3cmo97w3fkxb2saIKOG8QKXHt fExG7/VSj7ZuqUPikLdZcDBGp+oKS9MzNSagfs0fVg7ihFRFWqoKOv8jkmE05g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751919970; a=rsa-sha256; cv=none; b=tn3Itpfj9g09OG7TJXXwkdTxio2g9KsWpCWFtQgzCLYUQSfvOQRm12sECJ6OM7GvKCJ/Ur KoGOQ2gHkna1iHgLD1uBs3UDiN3Foj7RffXgyi4DwsFSZcs8HaJn9ChhpglhwirJT3pX07 ccEV/zhzxvjxuOkujL3M129yJH7/Fe0WQhTOqN0OplD3Yb0raEgv1uwn0HbVzYKPtV0W5h eA3uytzphB1Wg1XXcg/2Z4NM7OXJQk6gaNsbAuagmUt32e/KILYg9L9GCX6OBIT8eyKshJ sXVyCud0uYcIFpxOFMyMeQi6omZhbQifwYxTVGWMKCx+HbwN6k0UQN0sMGpOiQ== 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 4bbbNf2k0Hz14dQ; Mon, 07 Jul 2025 20:26:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567KQAwl024746; Mon, 7 Jul 2025 20:26:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567KQAFa024743; Mon, 7 Jul 2025 20:26:10 GMT (envelope-from git) Date: Mon, 7 Jul 2025 20:26:10 GMT Message-Id: <202507072026.567KQAFa024743@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Li-Wen Hsu Subject: git: ed4c64bc792f - main - tests/ci: Use suitable variable for qemu-user-static existence check 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: lwhsu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ed4c64bc792fd2509d8fd6805f8e174c2db62338 Auto-Submitted: auto-generated The branch main has been updated by lwhsu: URL: https://cgit.FreeBSD.org/src/commit/?id=ed4c64bc792fd2509d8fd6805f8e174c2db62338 commit ed4c64bc792fd2509d8fd6805f8e174c2db62338 Author: Siva Mahadevan AuthorDate: 2025-07-02 19:00:06 +0000 Commit: Li-Wen Hsu CommitDate: 2025-07-07 20:25:20 +0000 tests/ci: Use suitable variable for qemu-user-static existence check And simplify a qemu-system existence check. Signed-off-by: Siva Mahadevan Reviewed by: imp Sponsored by: The FreeBSD Foundation Pull Request: https://github.com/freebsd/freebsd-src/pull/1751 --- tests/ci/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/ci/Makefile b/tests/ci/Makefile index b57de345f852..271fc377619b 100644 --- a/tests/ci/Makefile +++ b/tests/ci/Makefile @@ -144,10 +144,10 @@ portinstall-pkg: .PHONY .endif portinstall-qemu: portinstall-pkg .PHONY -.if !exists(/usr/local/bin/qemu-${TARGET_ARCH}-static) +.if !exists(/usr/local/bin/qemu-${QEMU_ARCH}-static) env ASSUME_ALWAYS_YES=yes pkg install emulators/qemu-user-static .endif -.if !exists(/usr/local/bin/qemu-system-${QEMU_ARCH}) +.if !exists(${QEMUBIN}) env ASSUME_ALWAYS_YES=yes pkg install emulators/qemu@nox11 .endif From nobody Mon Jul 7 20:28:59 2025 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 4bbbRw4RNKz618KZ; Mon, 07 Jul 2025 20:29:00 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbbRw0rDHz3VCr; Mon, 07 Jul 2025 20:29:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751920140; 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=LqKVqnnV2L0xvqDWvS+uRZSSGbC1iLt6PEGqdD84dQ8=; b=ABmOmiQV/gO5OE/NEcaj6XQcV73+CrCgWrBT01rk+cOxJ1RJHezTRsvlgxVuiw90fLoL4G +JQf1cWANxz+/BtZYmgpZpDpdCj10VEujyGj6vjcvPH89kU4KWn4jZtDiSd/nFrBHOBYwn ZflLg1RuJk7sSPyelmhqS1rzbKL6fe/c71F1uWQu8Y6ZYIOAPB2V9zkm4uGIToEA6eljr6 r4gp605QD86OquKIQZtlN9xB9WJp35WX5mG6nK1d4nZmXMW/QvRdPgqosahO33I5/OzoIT VoRnmVU+dnJjiX8prrzgK9HWv5DlGt50ugIpKLPRLhsUG+rLKWNAGwDqtvmphQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751920140; 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=LqKVqnnV2L0xvqDWvS+uRZSSGbC1iLt6PEGqdD84dQ8=; b=QW/o2RgiEdKF3RqSNoN+k1jI2ZJThe3DAz3yazs2lHU6fR9bTeSQK/NRgTcs6IDG3mYSN3 ZIyHMN4OvnFmlgM6Fg/0eTUmTWVHb0JXAMT8zQN1uY3QGW9jNwdLC+JFNm8CocsF7ZaKEc j1+M2msSEXzCBkxK1RORpcwI0J59hLpgOre4tZTmNBTDqkAX9Kd1oSa7yEzggBIoiwdmAz kJWwLtOubHOFax+aot4NXZ3xugLijaKbLicKSk6tVEtr6QxaDtRVajFiToaxJkDgLOtd7x enBA66QW/floSjxtLUhW5D3d5FW/ikhxrS7cXV0W0qLlF+BTijeHJLKJ/GfZsw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751920140; a=rsa-sha256; cv=none; b=C4gVD++8e/7KEG5jMhGjZBblw6JTkNLuw6r4yoRKseN2qqeLx8el+p/Bi2KJXDsfkQVdjn SgYEeCgvgoO599RyIxZjTPv2Vlb6njEQr7QHzEF/yodC1yvUXVTHGkDJxorpIaj/F/jUN5 DZuHYzjeRtTNzVaztLzFnxf9HjTGqbVyVuqTE2fldh3KRjd5GpEgH00wCe85GX1LBpToVS lP2pirYqgSO1jR7XSyXAF0w/30DNrKPvfTCdH73ZPDdhAPLJ/d4dR/HFOWn8CI2c0OpW7h P7HEGpycsjfX7ColtnnnxLahI+9BurClb9nH59vl9aTr+UwwK/RAqULBJpwGcA== 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 4bbbRw0Btlz15d3; Mon, 07 Jul 2025 20:29:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567KSxVd025673; Mon, 7 Jul 2025 20:28:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567KSxfH025670; Mon, 7 Jul 2025 20:28:59 GMT (envelope-from git) Date: Mon, 7 Jul 2025 20:28:59 GMT Message-Id: <202507072028.567KSxfH025670@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: 393fefa3d9c7 - main - mkimg: Make output reproducible using a specific timestamp 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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/main X-Git-Reftype: branch X-Git-Commit: 393fefa3d9c78948d911e5de0182a9b858b23475 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=393fefa3d9c78948d911e5de0182a9b858b23475 commit 393fefa3d9c78948d911e5de0182a9b858b23475 Author: Mark Johnston AuthorDate: 2025-07-07 20:27:24 +0000 Commit: Mark Johnston CommitDate: 2025-07-07 20:27:24 +0000 mkimg: Make output reproducible using a specific timestamp In commit 95ac5b0e27e9 ("mkimg: Add a reproducible mode"), I added a -R flag to mkimg, indicating that output should be reproducible. There is one place in the VHD image backend that uses time(3) to populate an image metadata field; this field is visible to tools which know how to process VHD images. Rather than picking an arbitrary value for that timestamp, it seems better to behave like makefs(8) and let the invoker pick a suitable timestamp. So, remove -R and instead add a -t option which lets the timestamp be specified directly. Then, modify the VHD backend to use that timestamp. Fixes: 95ac5b0e27e9 ("mkimg: Add a reproducible mode") Reviewed by: bnovkov MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D51077 --- usr.bin/mkimg/mkimg.1 | 8 ++++---- usr.bin/mkimg/mkimg.c | 24 ++++++++++++++++-------- usr.bin/mkimg/mkimg.h | 4 ++-- usr.bin/mkimg/uuid.c | 7 ++++--- usr.bin/mkimg/vhd.c | 2 +- 5 files changed, 27 insertions(+), 18 deletions(-) diff --git a/usr.bin/mkimg/mkimg.1 b/usr.bin/mkimg/mkimg.1 index f6b151d2d5c7..ae48904eb16c 100644 --- a/usr.bin/mkimg/mkimg.1 +++ b/usr.bin/mkimg/mkimg.1 @@ -41,7 +41,7 @@ .Op Fl f Ar format .Op Fl o Ar outfile .Op Fl a Ar active -.Op Fl R +.Op Fl t Ar timestamp .Op Fl v .Op Fl y .Op Fl s Ar scheme Op Fl p Ar partition ... @@ -139,9 +139,9 @@ option is a shorthand to specify the minimum and maximum capacity at the same time. .Pp The -.Fl R -option enables reproducible mode: any timestamps or random identifiers will -be fixed so as to ensure consistent output. +.Fl t +option causes any timestamps embedded in the output file to be set to the +given time, specified in seconds since the epoch. .Pp The .Fl v diff --git a/usr.bin/mkimg/mkimg.c b/usr.bin/mkimg/mkimg.c index c8872ebb1bc6..a7409b686560 100644 --- a/usr.bin/mkimg/mkimg.c +++ b/usr.bin/mkimg/mkimg.c @@ -61,7 +61,8 @@ static struct option longopts[] = { static uint64_t min_capacity = 0; static uint64_t max_capacity = 0; -bool reproducible = false; +/* Fixed timestamp for reproducible builds. */ +time_t timestamp = (time_t)-1; struct partlisthead partlist = TAILQ_HEAD_INITIALIZER(partlist); u_int nparts = 0; @@ -563,7 +564,7 @@ main(int argc, char *argv[]) bcfd = -1; outfd = 1; /* Write to stdout by default */ - while ((c = getopt_long(argc, argv, "a:b:c:C:f:o:p:s:vyH:P:RS:T:", + while ((c = getopt_long(argc, argv, "a:b:c:C:f:o:p:s:t:vyH:P:S:T:", longopts, NULL)) != -1) { switch (c) { case 'a': /* ACTIVE PARTITION, if supported */ @@ -608,9 +609,6 @@ main(int argc, char *argv[]) if (error) errc(EX_DATAERR, error, "partition"); break; - case 'R': - reproducible = true; - break; case 's': /* SCHEME */ if (scheme_selected() != NULL) usage("multiple schemes given"); @@ -618,6 +616,19 @@ main(int argc, char *argv[]) if (error) errc(EX_DATAERR, error, "scheme"); break; + case 't': { + char *ep; + long long val; + + errno = 0; + val = strtoll(optarg, &ep, 0); + if (ep == optarg || *ep != '\0') + errno = EINVAL; + if (errno != 0) + errc(EX_DATAERR, errno, "timestamp"); + timestamp = (time_t)val; + break; + } case 'y': unit_testing++; break; @@ -680,9 +691,6 @@ main(int argc, char *argv[]) if (max_capacity != 0 && min_capacity > max_capacity) usage("minimum capacity cannot be larger than the maximum one"); - if (reproducible) - srandom(42); - if (secsz > blksz) { if (blksz != 0) errx(EX_DATAERR, "the physical block size cannot " diff --git a/usr.bin/mkimg/mkimg.h b/usr.bin/mkimg/mkimg.h index 608de458e83c..aa0ec2a8d944 100644 --- a/usr.bin/mkimg/mkimg.h +++ b/usr.bin/mkimg/mkimg.h @@ -29,9 +29,9 @@ #include #include -#include +#include -extern bool reproducible; /* Generate reproducible output. */ +extern time_t timestamp; struct part { TAILQ_ENTRY(part) link; diff --git a/usr.bin/mkimg/uuid.c b/usr.bin/mkimg/uuid.c index f3415a8c1111..885a6c36b522 100644 --- a/usr.bin/mkimg/uuid.c +++ b/usr.bin/mkimg/uuid.c @@ -57,9 +57,10 @@ osdep_uuidgen(mkimg_uuid_t *uuid) u_int i; uint16_t seq; - if (reproducible) - memset(&tv, 0, sizeof(tv)); - else if (gettimeofday(&tv, NULL) == -1) + if (timestamp != (time_t)-1) { + tv.tv_sec = timestamp; + tv.tv_usec = 0; + } else if (gettimeofday(&tv, NULL) == -1) abort(); time += (uint64_t)tv.tv_sec * 10000000LL; diff --git a/usr.bin/mkimg/vhd.c b/usr.bin/mkimg/vhd.c index 1e1f1e7f3c3e..c0fe45ab416e 100644 --- a/usr.bin/mkimg/vhd.c +++ b/usr.bin/mkimg/vhd.c @@ -188,7 +188,7 @@ vhd_timestamp(void) time_t t; if (!unit_testing) { - t = time(NULL); + t = timestamp != (time_t)-1 ? timestamp : time(NULL); return (t - 0x386d4380); } From nobody Mon Jul 7 20:36:35 2025 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 4bbbcr59MYz618sn; Mon, 07 Jul 2025 20:36:44 +0000 (UTC) (envelope-from herbert@gojira.at) Received: from mail.bsd4all.net (mail.bsd4all.net [IPv6:2a01:4f8:13b:240c::25]) (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 mx1.freebsd.org (Postfix) with ESMTPS id 4bbbcr1D0Bz3YPV; Mon, 07 Jul 2025 20:36:43 +0000 (UTC) (envelope-from herbert@gojira.at) Authentication-Results: mx1.freebsd.org; none Date: Mon, 7 Jul 2025 22:36:35 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=gojira.at; s=mail202005; t=1751920595; bh=jq9onjmCwF3rIg29EN3WTnnijEgtUrqW+Wx2JyeA0uA=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type; b=zdqZ0RZwzo8RMmeMtZlYRgyFvyRMoS8uu5frnnRQUtsStgoKKNQouTpRp98L5+Fag Dq0FM/Gm94XboO9a4V/OVJHF/PYqgEsmiPJKC0Zviangf4VrVNoEa6JyB/OIrwu7h0 a7Ln68DmoB2gUYKiibNKXf+3pS6jxt8gYXNHa1YY7e5RWHepdGyJSYY9ZhRFjGS4Yk S1WFsRZ0RiElqwbnemOc1oDPt+4ce7gumWIXQPl7dI7I+NwCiFToFptKanbYTcLXSr e1/ZNJMrfAiP2e15nEODi800pnHzFvzI9na8xx8Q+6kLis88FflNl8uvJW8IbScRPQ D9DCk3GkPzlNA== From: "Herbert J. Skuhra" To: Dima Panov Cc: Cy Schubert , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 7e35117eb07f - main - Makefile: Hook MIT KRB5 into the build Message-ID: References: <202506160251.55G2pwx4063231@gitrepo.freebsd.org> <20250620073050.7f03f74e@slippy> 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4bbbcr1D0Bz3YPV X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/32, country:DE] On Mon, Jul 07, 2025 at 10:36:31PM +0300, Dima Panov wrote: > Hello! > > > BTW, it looks like symlink for libkadm5clnt.so is broken and produced a bad file > $ ls -la libkadm5clnt > lrwxr-xr-x 1 root wheel 13 7 Jul 20:40 libkadm5clnt -> kadm5clnt_mit > > instead of assumed libkadm5clnt.so -> kadm5clnt_mit.so > > > Please review: > > diff --git a/krb5/lib/kadm5clnt/Makefile b/krb5/lib/kadm5clnt/Makefile > index e377f95f5b6e..be09dd3e210e 100644 > --- a/krb5/lib/kadm5clnt/Makefile > +++ b/krb5/lib/kadm5clnt/Makefile > @@ -88,7 +88,7 @@ ${CHPASS_UTIL_STRINGS_ERR_C}: ${CHPASS_UTIL_STRINGS_ERR} > rm -f et-c-${.PREFIX}.et et-c-${.PREFIX}.c > > afterinstall: > - ${INSTALL_LIBSYMLINK} ${SHLIB} ${DESTDIR}${LIBDIR}/libkadm5clnt > + ${INSTALL_LIBSYMLINK} ${SHLIB_NAME} ${DESTDIR}${LIBDIR}/libkadm5clnt.so > > .include This produces a valid symlink that 'make delete-old' wants to remove again: lrwxr-xr-x 1 root wheel 23 Jul 7 22:26 /usr/lib/libkadm5clnt.so -> libkadm5clnt_mit.so.121 # make delete-old >>> Removing old files (only deletes safe to delete libs) remove /usr/lib/libkadm5clnt.so? From nobody Mon Jul 7 23:04:16 2025 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 4bbfv532pkz61T1Z; Mon, 07 Jul 2025 23:04:17 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbfv50Z1nz3pdl; Mon, 07 Jul 2025 23:04:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751929457; 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=Tbawh58FbPyfZivPj7Nl1yvulM32omYdHJvGGypQ7yE=; b=VTLFv4WzWKy5o8hWK4Xx8l4gRBFoHwZEzq3HpkJpW13yQUmKCOgUmfYOVX2brGd6OJfUcn S5IorwsXDPBrosmrjUOOrAzPExhneg3ENUioRaxc5+8uRVrcsTyotKDY/ANCKyj1oufx2o vaOdoA1JFQ1sURBbIrabZFf8aVccGhrdcaRESqasxpLhjoBiUBJLNBHBXFDint+zAOXs6x xJG9Ycn+Baw53c5fM+zYpV9IPqmsMEZAhniuUChQ3AdZwCOopwk7IggHVqOjLVJUnByq7L 0W6NRtkCqUR7vwaSWeicxe4pXSIcAOXuBrfkuJ3UBco+RxHJ4txyUI+Hdz87hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751929457; 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=Tbawh58FbPyfZivPj7Nl1yvulM32omYdHJvGGypQ7yE=; b=VikvsG2T6d6R2/6jIhy06QPSmXy442A1CQokD1gec3V6ZdhARawS1sLOowDeFec6ZzfWC+ phm6hUsAi0BFKEY1TCJ9/oqaF0R4lKhZvEe3xaeY8ub3TH+yFZl2//SHikjuOC+Nmprjsr WLOhqGAwaCLzEx4egYrG1BbNxH2m2dCUe/KKMIOq8rLb+9dgmDsaKXRzUDmlcDjI/Etb2o j/ybIzsoNXsFU8Fi8xPZAE3BgBoAOuVZh3kAZheWDh93om8IoFIWD0989kYGoej1MYRBcB EY6AI2b2ZR7OQQDGK3N29bTXd4dI8YD9+OE1g8i5m8obw/rj/ajd47B7RxjfEw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751929457; a=rsa-sha256; cv=none; b=pgQdkUa34BcOPP5EGPzP5ZYnSOICaeSkZODszOkN8zsWsN4+FM8wAhvvApKYDGswFIlwbI Z9Cgb7Li46NDJCmSZOI+M/oHzo1mZz2rbaA/XnyCTlZKlLIpkpSg0VvwTxQwJDZ7G4/3WU EpeuW7CY5Ufe9+J1q1bKegNxrro3MKJoirEjKx+s5mdTKxtq9zZodsjOV8dDKjVKgdBP7h 2fxags6F6FWMPln8w7QclD9QWpVTrz2U4MveBh/2NbdGOtSjc+ANsxe4EGY1+BP1pcUoDK 0k9LWaUGGC+uXQyzWWVXUrOV8pGJLtB6XwO/IHXbWsu3CIs2TmUOXSPVatWL8g== 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 4bbfv505BSz19MN; Mon, 07 Jul 2025 23:04:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567N4GEA025935; Mon, 7 Jul 2025 23:04:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567N4G0L025932; Mon, 7 Jul 2025 23:04:16 GMT (envelope-from git) Date: Mon, 7 Jul 2025 23:04:16 GMT Message-Id: <202507072304.567N4G0L025932@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: cf9b68575453 - main - Revert "ipfilter: Avoid allocating a new ipf token when not needed" 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cf9b6857545371ab5becc6a785c62bc844cb2f94 Auto-Submitted: auto-generated The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=cf9b6857545371ab5becc6a785c62bc844cb2f94 commit cf9b6857545371ab5becc6a785c62bc844cb2f94 Author: Cy Schubert AuthorDate: 2025-07-07 16:50:27 +0000 Commit: Cy Schubert CommitDate: 2025-07-07 23:03:00 +0000 Revert "ipfilter: Avoid allocating a new ipf token when not needed" malloc() outside of a write lock will reduce potential contention. MFC after: 3 days This reverts commit 7f5e3b9fa3d159b7f061b4d01a767cbe5d0527f3. --- sys/netpfil/ipfilter/netinet/fil.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/sys/netpfil/ipfilter/netinet/fil.c b/sys/netpfil/ipfilter/netinet/fil.c index 2a75190a3ec7..2a4feb17dbd3 100644 --- a/sys/netpfil/ipfilter/netinet/fil.c +++ b/sys/netpfil/ipfilter/netinet/fil.c @@ -7455,6 +7455,10 @@ ipf_token_find(ipf_main_softc_t *softc, int type, int uid, void *ptr) { ipftoken_t *it, *new; + KMALLOC(new, ipftoken_t *); + if (new != NULL) + bzero((char *)new, sizeof(*new)); + WRITE_ENTER(&softc->ipf_tokens); for (it = softc->ipf_token_head; it != NULL; it = it->ipt_next) { if ((ptr == it->ipt_ctx) && (type == it->ipt_type) && @@ -7463,10 +7467,6 @@ ipf_token_find(ipf_main_softc_t *softc, int type, int uid, void *ptr) } if (it == NULL) { - KMALLOC(new, ipftoken_t *); - if (new != NULL) - bzero((char *)new, sizeof(*new)); - it = new; new = NULL; if (it == NULL) { @@ -7478,6 +7478,11 @@ ipf_token_find(ipf_main_softc_t *softc, int type, int uid, void *ptr) it->ipt_type = type; it->ipt_ref = 1; } else { + if (new != NULL) { + KFREE(new); + new = NULL; + } + if (it->ipt_complete > 0) it = NULL; else From nobody Mon Jul 7 23:04:18 2025 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 4bbfv63TRWz61T3w; Mon, 07 Jul 2025 23:04:18 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbfv61bJ0z3ptt; Mon, 07 Jul 2025 23:04:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751929458; 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=RbibdRpK/J98X7nmAOYWy4aGSw/yfhu7106SAcM/heo=; b=YbXHzeyLpNZ+STSWFPEQZWHvx6jEAm+E3oVL5WQ7rhtMYMFi832g8nbHMFjedPOUXPSB8Y k6kIQhYickJzn3Uco8tPYxotfZEm0Q+8SFIQOgPc8kYp4pO7sh53A/Uz6HNb19leKir6Yg yzUrrV3s3jl3RMfB2QZBT4pMuHxIGqe2GvnRBAj10Oq/2te6LwrAsFXn1TYiuYoVF4y+Jo TeK105OOTaYmnWiSmAA2a7/6dYpNknnma/wFaIdAXlq5BsdAi950eqUe7LBcEH9UJ77wWT aVtrD1NFN8yPFu651dmmsEpFvUbS+kDGJuh55sB9zZ9RGf3xEjm+lFtgkNdqHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751929458; 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=RbibdRpK/J98X7nmAOYWy4aGSw/yfhu7106SAcM/heo=; b=mNc6Z8H+7TSHxOLCWgCtWh49YNDNR5geRu/MdQIxO8xMa1QzQOZdMFC0yQR+t5t/AK+D/O CK8jdi1MtQDGu6qplFkehqHZkaqaU49gphIStgbB7UtA/gykRNv8tqQdzlFxzyd0KLaNKd cEwskhqNmaZw+gvzSgQoJyBp3Wh3G7hOQaGkr6S6BF7FX7R0ybsFFV3hLoyD90pGsLDSAq rp48lFWlzDmFqIYy9nQehTy/1gSr8r9qgs4B/k5wvCfrHoVPVwqgOx8GxibjxH8ON5ig1H XNYIV+3gdeAjUOYGkBnEvDW5gYHbywLSigVEQzrORkBSAiEpkdNuwMq+3PZM5g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751929458; a=rsa-sha256; cv=none; b=tmmLxDkL9b1jnBHpMHIT52ahcuLnVCl+3TknnEQm7aOwkEZA/gIpMUoe6WD7LyvUWgbEqL igSmqf8tTljCXNZX7FFMPL12lqLg4CHMG9adQGUUSfdrPvi1+VnuGgjkYG6QGVTAXgGgu9 ApaphF1RzvSa3OMIS7wid2DWSPHj0mG3qOr7c3ZC+26BC3Ewku0qm7DRSfLlphDcggl0Bc bS68gUY+9B13EtDFNeAf0JTW+J6IEzX82konF4x1PJ+0HshfrwcBnfvHFVJlCEFDewSXrC /LfZJfcRSACiFN1nIRq02oY6AKCjRlhAeyCR8BOVk4QpmAtEAHR5sk0bOAsyog== 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 4bbfv610y5z19Jq; Mon, 07 Jul 2025 23:04:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567N4IdM025973; Mon, 7 Jul 2025 23:04:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567N4I9E025970; Mon, 7 Jul 2025 23:04:18 GMT (envelope-from git) Date: Mon, 7 Jul 2025 23:04:18 GMT Message-Id: <202507072304.567N4I9E025970@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: ca4abebcf80e - main - ipfilter: Save unit in hash table entry 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ca4abebcf80e282b2e5d33556d47ad9a50d13ba0 Auto-Submitted: auto-generated The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=ca4abebcf80e282b2e5d33556d47ad9a50d13ba0 commit ca4abebcf80e282b2e5d33556d47ad9a50d13ba0 Author: Cy Schubert AuthorDate: 2025-07-07 17:38:11 +0000 Commit: Cy Schubert CommitDate: 2025-07-07 23:03:00 +0000 ipfilter: Save unit in hash table entry As with tree tables the unit must also be saved in hash tables. MFC after: 1 week --- sys/netpfil/ipfilter/netinet/ip_htable.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/netpfil/ipfilter/netinet/ip_htable.c b/sys/netpfil/ipfilter/netinet/ip_htable.c index 22d427b87a71..e54b739df361 100644 --- a/sys/netpfil/ipfilter/netinet/ip_htable.c +++ b/sys/netpfil/ipfilter/netinet/ip_htable.c @@ -343,6 +343,7 @@ ipf_htable_create(ipf_main_softc_t *softc, void *arg, iplookupop_t *op) iph->iph_ref = 1; iph->iph_list = NULL; iph->iph_tail = &iph->iph_list; + iph->iph_unit = unit; iph->iph_next = softh->ipf_htables[unit + 1]; iph->iph_pnext = &softh->ipf_htables[unit + 1]; if (softh->ipf_htables[unit + 1] != NULL) From nobody Mon Jul 7 23:04:19 2025 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 4bbfv75SMvz61TKF; Mon, 07 Jul 2025 23:04:19 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbfv72d8bz3ppX; Mon, 07 Jul 2025 23:04:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751929459; 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=pSrPovf5n3JLVb0Nwa+uOy+NdAHBJnDKrr0fdvUtnSw=; b=NW7n5l2+hcXPQJls1OdmhFzeiaUmOsvXCCrEFNxRvWnEeetLGr/BBmbAliGv/O8YSvAR9W SE7CS1R1a5XkEgyu2o0rt4xgl4DYFM645Jffv4cnzmb1lfTE65knHKbk9gwaoCGUqtQcaV KW5j8dIaaxclk5qxwwgKpZQ0dPw3v/Elig+rIdx65cMx/UNJaXi2YdIlNqZsceTEfnUBbm nmo0rsnSomf5uh0jkjbQJZMGcpgwPWUjdbuFsaYfx9EUH3MCvQ2ceOAM9jlyqP2oXo6ro1 CSWdHTUpqvg334RyVLK7O+YhzYM4TpFPtaZp446YIYFEeNLC20yTZtbIzYC0Eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751929459; 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=pSrPovf5n3JLVb0Nwa+uOy+NdAHBJnDKrr0fdvUtnSw=; b=wBwuVjC/5pUYEZ9HplcaKeyjAgPCdfC6k/zaKTv4mqRmSgTp52YSbK1hbpMe06AU8bkEpk XE+JYYiURXDLZvbRetPtjC+0VDiyHExWxBdcB9CsfJTMkW29RXWRAmxflixJXNY9UZ04pb JvxYeVU2ncFFWIJt2HVGkYA7rltuw+RTajbHkkfM1aGHEXBbT4XyADG0dMvuUqCZVgU5+L dbxPLqq+6cbB/j9vL87WMg8K/st13PYC59Hw4ownhC5DKOsa2EFMKC1GzrmzZfDAicUvFM TLfB8iQZL7oz8o3y/fD3r+c6ZH9Q7jcbpKNy8tEUVzcg3K29bqhc3pc/C4vbuA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751929459; a=rsa-sha256; cv=none; b=CpYhjMICYagyAT3JW4oQ+KGwOE+01EOAylwnv96ebrMrqtfphBx7iqDptoy/A+aOyZ7aZ7 vu0kp60T7vrFVPuwDEq4KWr0y/Px88INnVCHeEoMLzfVMTkaTOqyMwB3MYoPCFzWpdDtS6 tdWKDM9UPaEr8bSb3ZB95sQpr/K5BzozrZCmZ7/5S/Q0BP5rA6ihcpf9vkgeuopXeogfQg qafejvH/M/EpbVeVqzpsBn/wq3wLkb/brgOQwZV4BYZJVnm58HR0DsNBzqlfi88cDtyZno /wGL9OXAEkKG16f/FN1SA1d8D8/bur0e2isV2uObpJoiUbqzVddDkmcWRxHsVQ== 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 4bbfv720N1z19Xj; Mon, 07 Jul 2025 23:04:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567N4JRV026006; Mon, 7 Jul 2025 23:04:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567N4J7w026004; Mon, 7 Jul 2025 23:04:19 GMT (envelope-from git) Date: Mon, 7 Jul 2025 23:04:19 GMT Message-Id: <202507072304.567N4J7w026004@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: aad5020c709a - main - OptionalObsoleteFiles: libkadm5clnt.so is used by MIT and Heimdal 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: aad5020c709ac4231af88d4b74588a28f87c9497 Auto-Submitted: auto-generated The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=aad5020c709ac4231af88d4b74588a28f87c9497 commit aad5020c709ac4231af88d4b74588a28f87c9497 Author: Cy Schubert AuthorDate: 2025-07-07 23:02:03 +0000 Commit: Cy Schubert CommitDate: 2025-07-07 23:03:10 +0000 OptionalObsoleteFiles: libkadm5clnt.so is used by MIT and Heimdal Reported by: fluffy, "Herbert J. Skuhra" Fixes: af2593e3212c --- tools/build/mk/OptionalObsoleteFiles.inc | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc index eb2713bafac9..e0689b2d811f 100644 --- a/tools/build/mk/OptionalObsoleteFiles.inc +++ b/tools/build/mk/OptionalObsoleteFiles.inc @@ -4950,7 +4950,6 @@ OLD_FILES+=usr/lib/libhx509.so OLD_LIBS+=usr/lib/libhx509.so.11 OLD_FILES+=usr/lib/libhx509_p.a OLD_FILES+=usr/lib/libkadm5clnt.a -OLD_FILES+=usr/lib/libkadm5clnt.so OLD_LIBS+=usr/lib/libkadm5clnt.so.11 OLD_FILES+=usr/lib/libkadm5clnt_p.a OLD_FILES+=usr/lib/libkadm5srv.a From nobody Mon Jul 7 23:04:46 2025 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 4bbfvl0G30z61TBf; Mon, 07 Jul 2025 23:04:51 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta004.cacentral1.a.cloudfilter.net (omta002.cacentral1.a.cloudfilter.net [3.97.99.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbfvk37X2z3qcs; Mon, 07 Jul 2025 23:04:50 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; none Received: from shw-obgw-4004a.ext.cloudfilter.net ([10.228.9.227]) by cmsmtp with ESMTPS id YtJluh7YS5MqyYutFuUB73; Mon, 07 Jul 2025 23:04:49 +0000 Received: from spqr.komquats.com ([70.66.136.217]) by cmsmtp with ESMTPSA id YutDulGRiJhBPYutEuL8Ux; Mon, 07 Jul 2025 23:04:49 +0000 X-Auth-User: cschuber X-Authority-Analysis: v=2.4 cv=QY3Fvdbv c=1 sm=1 tr=0 ts=686c5291 a=h7br+8Ma+Xn9xscxy5znUg==:117 a=h7br+8Ma+Xn9xscxy5znUg==:17 a=kj9zAlcOel0A:10 a=Wb1JkmetP80A:10 a=6I5d2MoRAAAA:8 a=EkcXrb_YAAAA:8 a=S-1b6JwnAAAA:8 a=YxBL1-UpAAAA:8 a=fEelrhWR8ugnEJ3nHZQA:9 a=CjuIK1q_8ugA:10 a=LK5xJRSDVpKd5WXXoEvA:22 a=jHPkhvgQCurpnRnmkKlz:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id 0861F32B; Mon, 07 Jul 2025 16:04:47 -0700 (PDT) Received: by slippy.cwsent.com (Postfix, from userid 1000) id F279E3A1; Mon, 07 Jul 2025 16:04:46 -0700 (PDT) X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.8+dev Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: "Herbert J. Skuhra" cc: Dima Panov , Cy Schubert , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 7e35117eb07f - main - Makefile: Hook MIT KRB5 into the build In-reply-to: References: <202506160251.55G2pwx4063231@gitrepo.freebsd.org> <20250620073050.7f03f74e@slippy> Comments: In-reply-to "Herbert J. Skuhra" message dated "Mon, 07 Jul 2025 22:36:35 +0200." 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 07 Jul 2025 16:04:46 -0700 Message-Id: <20250707230446.F279E3A1@slippy.cwsent.com> X-CMAE-Envelope: MS4xfBooDeVQXMPilIRIdo8LdC0uYHMHFzyBufUaRgWxFL97VduHWn+yDGMfypafO5dG+xrD0lkLbv6lMsn4dDKEZxhktrkAQDgH1ZGWkXNmHsAqRqu7Cp8Y GG1KLr74na0TZFVDYCh1DqF4P74J6Z4Vy5g8dwJX9kw96X9Gg0kFV8lbHGxjtoHtk6eMkF8T+BMNNQpqqFd3A1DeTIqwm1t2HsCMIv5qP+aQwoMATGuN7UVM VSyt7x8aNYCB5Fay/udy4Q/VmIHgWDgYRfqb+56Xol/BqUZ22I2uGt7r/Pya5t9FfIXu4hgluzpNHAcwnth9oJkI06xYuAr35Arx2BuvV+PVVZIAv2ZuWInF o29auHzKa+A7WVNzcjv1PpYASdgVHw== X-Rspamd-Queue-Id: 4bbfvk37X2z3qcs X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:16509, ipnet:3.96.0.0/15, country:US] In message , "Herbert J. Skuhra" writes: > On Mon, Jul 07, 2025 at 10:36:31PM +0300, Dima Panov wrote: > > Hello! > > > > > > BTW, it looks like symlink for libkadm5clnt.so is broken and produced a bad > file > > $ ls -la libkadm5clnt > > lrwxr-xr-x 1 root wheel 13 7 Jul 20:40 libkadm5clnt -> kadm5clnt_mit > > > > instead of assumed libkadm5clnt.so -> kadm5clnt_mit.so > > > > > > Please review: > > > > diff --git a/krb5/lib/kadm5clnt/Makefile b/krb5/lib/kadm5clnt/Makefile > > index e377f95f5b6e..be09dd3e210e 100644 > > --- a/krb5/lib/kadm5clnt/Makefile > > +++ b/krb5/lib/kadm5clnt/Makefile > > @@ -88,7 +88,7 @@ ${CHPASS_UTIL_STRINGS_ERR_C}: ${CHPASS_UTIL_STRINGS_ERR} > > rm -f et-c-${.PREFIX}.et et-c-${.PREFIX}.c > > > > afterinstall: > > - ${INSTALL_LIBSYMLINK} ${SHLIB} ${DESTDIR}${LIBDIR}/libkadm5clnt > > + ${INSTALL_LIBSYMLINK} ${SHLIB_NAME} ${DESTDIR}${LIBDIR}/libkadm5cln > t.so > > > > .include > > This produces a valid symlink that 'make delete-old' wants to > remove again: > > lrwxr-xr-x 1 root wheel 23 Jul 7 22:26 /usr/lib/libkadm5clnt.so -> > libkadm5clnt_mit.so.121 > > # make delete-old > >>> Removing old files (only deletes safe to delete libs) > remove /usr/lib/libkadm5clnt.so? Thanks Dima and Herbert for reporting this. It's been fixed. -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e**(i*pi)+1=0 From nobody Mon Jul 7 23:18:17 2025 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 4bbgCF6jFZz61VPR; Mon, 07 Jul 2025 23:18:17 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbgCF5wKNz41Bb; Mon, 07 Jul 2025 23:18:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751930297; 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=/cr8vf+6rEUwrEY4yXQVq9LHAm2a4i6zR1ai7fG1DxU=; b=r/xEhJ5yXzPM46baC3UNQZ5/+U19BRurCpCdzBbKSr1L0BkxvyyOypqxm8LTinbRQYT8IC mCt9UFJrZxINzVpoyMSXYn7zHPEElnLhHnRuy1sDmtW217KrLIj9Ly5r8lcN99cGJ+4Aj4 y6HGfBHEXbDH26TgfHbR1NDON0cHSaXzlgXBOzaXLH3wnNkt8Vv2jGa/OkJ3CQcbhdrn13 SZIV+7QZj0XvR8PJZj8iHw1xq68qZWL/Xb63xaxuKSsoLHUtvb9SRHHYvXte2cHsjFq/8U iLCIJaAs3fURgfIReNTYIN4Im5yQJpr2r0/HhdxdkZ5VrcMqx/3ZbwXNm/LXcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751930297; 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=/cr8vf+6rEUwrEY4yXQVq9LHAm2a4i6zR1ai7fG1DxU=; b=yrhlsITv7qqCH4AY5pi9vpbHWAm1EWdSwuoe4spDmhg+AE4oQaIl0OCW2crYQUMiTBjqUN 1lW7hR8o4TcA8G3UKJCQzObPkjb7FEmtA1sPN3fphzwedpxg5UF8Wjpx/TV5uMUkrqM59m r6BlsXQyPEM8yqKy53NDwfKX7kc3ryep8KHJBqE2cJIXj/smj+AiVprliQJpYjqkQXxUJH uoc1h0A59klyOeVp2lnJDwMkmRjtAI//5sCKUJT7Vi3kM00MLYcaKzj8sXHUlisd5tbeu3 oi5dMz59fnWkg4iLDicjx24+WE9RADa/vMyf5YVBDVwYE61zXCd1ei5lAbpLnA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751930297; a=rsa-sha256; cv=none; b=nktLfk0inzv8NLmqwD/eZ0vwkBa/ODRCWtW2yN9w05CltMZZ/y1n5nyewiyJAZC1O09ORW KMJlUzOBFH+CvkmJEMIw0vTQCvvRSpxMjJ/sdCJtrUfm8uq5RIen9QPCtg+dB1zOIMjDJC RzKmYs1CfF2S8ynfp6pKrP5Nc7roJsZmeA0MxjwvH0FJU/C17o4IDKY6C9hGarV/eHJZG1 eDcxX9Vwj9Py5SXufWYWasFFYRuylb4vVQ4MUoIEcbXnmPTM0znmXA80WCK08rDyY9rZU1 jh8xLXclrqEZtx8hJfv/UZX1VsaQwSySycM0v2d8fPgPG4M7PjsfpIie3IrIJg== 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 4bbgCF5D3rz19sd; Mon, 07 Jul 2025 23:18:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567NIHcR045585; Mon, 7 Jul 2025 23:18:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567NIHWS045582; Mon, 7 Jul 2025 23:18:17 GMT (envelope-from git) Date: Mon, 7 Jul 2025 23:18:17 GMT Message-Id: <202507072318.567NIHWS045582@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 5ac5ebfa7533 - main - cam/scsi: Use xpt_path_inq() instead of hand-rolled expansion 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5ac5ebfa7533d9c3d2b7dd0443a2dba04bf0c687 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=5ac5ebfa7533d9c3d2b7dd0443a2dba04bf0c687 commit 5ac5ebfa7533d9c3d2b7dd0443a2dba04bf0c687 Author: Warner Losh AuthorDate: 2025-07-07 20:04:24 +0000 Commit: Warner Losh CommitDate: 2025-07-07 23:17:00 +0000 cam/scsi: Use xpt_path_inq() instead of hand-rolled expansion Use xpt_path_inq() for all XPT_PATH_INQ requests. They all should be CAM_PRIORITY_NONE since XPT_PATH_INQ is an unqueued command, so the minor changes here from _NORMAL to _NONE don't matter. And the one place we preseve the priority doesn't matter either: It's an allocated CCB, true, but it only ever stores the CPI from XPT_PATH_INQ. Sponsored by: Netflix Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D51121 --- sys/cam/scsi/scsi_xpt.c | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/sys/cam/scsi/scsi_xpt.c b/sys/cam/scsi/scsi_xpt.c index 439dd2050a95..175716ca6a67 100644 --- a/sys/cam/scsi/scsi_xpt.c +++ b/sys/cam/scsi/scsi_xpt.c @@ -1945,10 +1945,7 @@ scsi_scan_bus(struct cam_periph *periph, union ccb *request_ccb) xpt_done(request_ccb); return; } - xpt_setup_ccb(&work_ccb->ccb_h, request_ccb->ccb_h.path, - request_ccb->ccb_h.pinfo.priority); - work_ccb->ccb_h.func_code = XPT_PATH_INQ; - xpt_action(work_ccb); + xpt_path_inq(&work_ccb->cpi, request_ccb->ccb_h.path); if (work_ccb->ccb_h.status != CAM_REQ_CMP) { request_ccb->ccb_h.status = work_ccb->ccb_h.status; xpt_free_ccb(work_ccb); @@ -2294,10 +2291,7 @@ scsi_scan_lun(struct cam_periph *periph, struct cam_path *path, CAM_DEBUG(path, CAM_DEBUG_TRACE, ("scsi_scan_lun\n")); - memset(&cpi, 0, sizeof(cpi)); - xpt_setup_ccb(&cpi.ccb_h, path, CAM_PRIORITY_NONE); - cpi.ccb_h.func_code = XPT_PATH_INQ; - xpt_action((union ccb *)&cpi); + xpt_path_inq(&cpi, path); if (cpi.ccb_h.status != CAM_REQ_CMP) { if (request_ccb != NULL) { @@ -2421,10 +2415,7 @@ scsi_devise_transport(struct cam_path *path) struct scsi_inquiry_data *inq_buf; /* Get transport information from the SIM */ - memset(&cpi, 0, sizeof(cpi)); - xpt_setup_ccb(&cpi.ccb_h, path, CAM_PRIORITY_NONE); - cpi.ccb_h.func_code = XPT_PATH_INQ; - xpt_action((union ccb *)&cpi); + xpt_path_inq(&cpi, path); inq_buf = NULL; if ((path->device->flags & CAM_DEV_INQUIRY_DATA_VALID) != 0) @@ -2732,10 +2723,7 @@ scsi_set_transfer_settings(struct ccb_trans_settings *cts, struct cam_path *path inq_data = &device->inq_data; scsi = &cts->proto_specific.scsi; - memset(&cpi, 0, sizeof(cpi)); - xpt_setup_ccb(&cpi.ccb_h, path, CAM_PRIORITY_NONE); - cpi.ccb_h.func_code = XPT_PATH_INQ; - xpt_action((union ccb *)&cpi); + xpt_path_inq(&cpi, path); /* SCSI specific sanity checking */ if ((cpi.hba_inquiry & PI_TAG_ABLE) == 0 @@ -3046,10 +3034,7 @@ _scsi_announce_periph(struct cam_periph *periph, u_int *speed, u_int *freq, stru return; /* Ask the SIM for its base transfer speed */ - memset(&cpi, 0, sizeof(cpi)); - xpt_setup_ccb(&cpi.ccb_h, path, CAM_PRIORITY_NORMAL); - cpi.ccb_h.func_code = XPT_PATH_INQ; - xpt_action((union ccb *)&cpi); + xpt_path_inq(&cpi, path); /* Report connection speed */ *speed = cpi.base_transfer_speed; From nobody Mon Jul 7 23:18:18 2025 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 4bbgCH23Wvz61VMX; Mon, 07 Jul 2025 23:18:19 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbgCG65kkz41Bd; Mon, 07 Jul 2025 23:18:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751930298; 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=C3aPPtUXBN5wwrkaA8Ef+19UKK1Wtfni1BUuIV+NtRk=; b=t3izSVrA5xfFK6Nsee0OkugNUvkE9fdXvqCk7DHGZeqGu0rcnmWztf6613wPmSWUinvMM6 0sm6ce5jV1FKimoRZjWtySfcTyZvXIjm250ozbbHSnXBlN/mMkjYy+FGfaez6VXgIBMfG0 XgjnULWE1TcfXgzXBlNCsV2BCXTF/4M6MkgeS+nQQKnvqquvg/jn1HNfGgBdNG9kEFjj4h TGzdEe2L8YMpatLze5PSU/GvLtGa20Ew25enDUX1ooDGgtgD4GDfRgpMv9q7fzILst1rEp GhfG9a5OGv1s1UsjIgAhUh7NV+IVQg0mnjnq4k8TTOoQ68vbhUc8i5QuNSEiEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751930298; 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=C3aPPtUXBN5wwrkaA8Ef+19UKK1Wtfni1BUuIV+NtRk=; b=HfgmNIjc9tiIoIWlm7aI8UatrDNxDirmL6XeURIEbsPHgeQTCvkDeXiu8IJ6pT72ny8HHF 2Mg5tjwwm++bbqo3kkMbRv38Xu4Y6YTuH10Aof+OYyJj0QB0Q76d8a+K9EmyflCpFA4dR9 zJu4qm6tnsICAlvY/CwdHnJa6r9OtYfa9i8z4xS7ykTp/TziTnWDilo8PSi0mX5xJ8D71N NuIoJt8D8ioMTK8yK9q87jCZ45LBqccZvgNno99WX2vcCEIEUdCcWHCkR2RhBaK158fdp+ 1a2cFo5UJcULc93jzeADTRl4UTLQLUZtk3v8dxvTuXnKcqKoVvrw8GA1omNdPQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751930298; a=rsa-sha256; cv=none; b=xXeOqDth1/VTU5UTIlfvf1QSVevtHdFMg/NwrsnTqSPaWKu2PvRPcUkw4j+ioxYR+7j+8A efb4cDkskePzghtVQS6XW2KRaTYLmqzOlvo2hRjmcP9fBBQ9tM02mRiGP1etoNSI+13yqB gfhFLPDYqQUfln1ESJuBsT0u+cgjrDmUlmNiIU0ppR2IcuESFJi9NjPrx2Z7ohAKdt5UVq 8J7qGozDW6uF7SwvjYGSn3Ka6cAGn5y7N1yT3qzXjXGEc9Alv6jJUUAl5fMD+ijMDWtZiW vlgFrpI5ZDI42imnWoI0qP00gyTF6naoHnJK5+jnvhhCI9jb6izddqgfBixfag== 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 4bbgCG5YLcz19m5; Mon, 07 Jul 2025 23:18:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567NIISD045618; Mon, 7 Jul 2025 23:18:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567NIIML045615; Mon, 7 Jul 2025 23:18:18 GMT (envelope-from git) Date: Mon, 7 Jul 2025 23:18:18 GMT Message-Id: <202507072318.567NIIML045615@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 034b3515ea27 - main - cam/xpt: improve comment on xpt_path_inq 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 034b3515ea274b144eb514e83b2e10be0e5b71a9 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=034b3515ea274b144eb514e83b2e10be0e5b71a9 commit 034b3515ea274b144eb514e83b2e10be0e5b71a9 Author: Warner Losh AuthorDate: 2025-07-07 20:04:33 +0000 Commit: Warner Losh CommitDate: 2025-07-07 23:17:00 +0000 cam/xpt: improve comment on xpt_path_inq Fix a comment about bzero maybe unnecessary. It can sometimes be redunant, but a common usage pattern puts the ccb_pathinq structure on the stack since it's small and for that scenario, it's required. It's reundant for the few places the ccb is allocated, and in those cases it does no harm. Sponsored by: Netflix Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D51166 --- sys/cam/cam_xpt.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/cam/cam_xpt.h b/sys/cam/cam_xpt.h index 06ef52580120..fa4bee97b8f7 100644 --- a/sys/cam/cam_xpt.h +++ b/sys/cam/cam_xpt.h @@ -145,8 +145,8 @@ uint32_t xpt_poll_setup(union ccb *start_ccb); void xpt_sim_poll(struct cam_sim *sim); /* - * Perform a path inquiry at the request priority. The bzero may be - * unnecessary. + * Perform a path inquiry at the request priority. bzero may be redundant for + * allocated CCBs, but for the on-stack CCBs it's required. */ static inline void xpt_path_inq(struct ccb_pathinq *cpi, struct cam_path *path) From nobody Mon Jul 7 23:18:19 2025 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 4bbgCJ38Fzz61VPX; Mon, 07 Jul 2025 23:18:20 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbgCH6vryz41MC; Mon, 07 Jul 2025 23:18:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751930300; 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=AFQnZXbCTdDLokdaTMwoqsQf5uTN1dCM96u0KJjDMpw=; b=ROhJTWSgMxqtEHZlOUqo/w0xQy0bsUt75dNww7LZB1sKTC7zKIyxd8p2uBVqqzCPFlsjpX Z+sCvvd9UXNWuvN//t8HuKnY312hWs1aVt8WhNeOIpA+lydr0TbNANDco0DUM+57WJNe3F cRVUtInbuXWvmn1X+xl5G883TfI/rwINnhSrIAEL/LIWCgRc8z1g/fSNRQhpMqTuYmm7ki yNCholiZekn+vTZHVtRjnF456Cb3i/4KrwUPgCUKFxGIL57d8ZP8QDvPbjI+vjDTM2LJko QtsbhKplPCNHG/SDfzdVmZ/cj/o4ZovDgXvmdJ6WS2VuOQM4EJhdKqGsPQjAtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751930300; 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=AFQnZXbCTdDLokdaTMwoqsQf5uTN1dCM96u0KJjDMpw=; b=bTUPigR/nvXpeQKGWKjy7lL1ZOOTJ4wQGxzFYEsvN6tvjzK1A3fdu9uvCYuXZi2yAiK6Xo 9o40iDzDLzfwOgL0WVP+gd+47WYabKy8W07yZJTTbRVzUrqnnkX016etgo39SyJhORU6kQ FedTSuX2l+OFhNNFULN2nU/+dxs+/zMzW+WRz3KFxXnThfPmjdu7FOiO5JlRGA+/9k6LyH mo4rin1sGuN/ix662bGmlpc3SexEbQr6AlUjwjnNN1KRF0sHOle7kCxSr5z3rpIhEvZdXp om5NVok2+hsadQTOWRhncQ0NE0l7iOj4XR38vowOdAsnJi/gPCVaErRGDID18A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751930300; a=rsa-sha256; cv=none; b=exWfNJhDIqh4j8mxuWg8zgsDo/gIBgYtMwpBTlOJC3FBve4xudnIJgtjW3w24Y4eadbt+Y 2sjuKEtZfw8Cv2CIG0suElWkvPq9bMewNJv09WdHi7TerVwCCggKiROT+yCvuplWPe/DNR Qepaall3+VqVHV5adFMA6DHm+EQVvcMagxah4we+2Mvvw70CgU+j5hQskQPqkr3tmEar0V vklBToNdwW4+2JodzcrdU6AdATeO2uz+OKzRXSAkCdrT8nkrE2Rysjdm4a+W1exsNgJBJC SDUUcWrRqN9qsG/iRHWZkQnbFLk6sUkmk17C4dPfi0c9MuG6jWGO9rql/r1ALg== 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 4bbgCH6MQZz19fN; Mon, 07 Jul 2025 23:18:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567NIJqH045653; Mon, 7 Jul 2025 23:18:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567NIJXe045650; Mon, 7 Jul 2025 23:18:19 GMT (envelope-from git) Date: Mon, 7 Jul 2025 23:18:19 GMT Message-Id: <202507072318.567NIJXe045650@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: c6dc5d367681 - main - xpt_path_inq: Use CAM_PRIORITY_NONE 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c6dc5d3676810d091fbdc26f3217af619d720fc2 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=c6dc5d3676810d091fbdc26f3217af619d720fc2 commit c6dc5d3676810d091fbdc26f3217af619d720fc2 Author: Warner Losh AuthorDate: 2025-07-07 20:04:42 +0000 Commit: Warner Losh CommitDate: 2025-07-07 23:17:00 +0000 xpt_path_inq: Use CAM_PRIORITY_NONE XPT_PATH_INQ is not a queued request. Therefore, the priority information is not relevant, and so should be marked with CAM_PRIORITY_NONE. Sponsored by: Netflix Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D51167 --- sys/cam/cam_xpt.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/cam/cam_xpt.h b/sys/cam/cam_xpt.h index fa4bee97b8f7..57225a0ae92d 100644 --- a/sys/cam/cam_xpt.h +++ b/sys/cam/cam_xpt.h @@ -153,7 +153,7 @@ xpt_path_inq(struct ccb_pathinq *cpi, struct cam_path *path) { bzero(cpi, sizeof(*cpi)); - xpt_setup_ccb(&cpi->ccb_h, path, CAM_PRIORITY_NORMAL); + xpt_setup_ccb(&cpi->ccb_h, path, CAM_PRIORITY_NONE); cpi->ccb_h.func_code = XPT_PATH_INQ; xpt_action((union ccb *)cpi); } From nobody Mon Jul 7 23:18:20 2025 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 4bbgCL4YThz61VVW; Mon, 07 Jul 2025 23:18:22 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbgCK4Rt5z41VN; Mon, 07 Jul 2025 23:18:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751930301; 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=5snfnYVx8mMTgIHe2Uw1NvSDf5rBhoCF9gpTDqcplaw=; b=WxrzRblZOEdxJvJeDsVv5SNVhWfgfHr3d+CKXYcMrmT5cAwy7fgOkJ5GxPQKvbwSxf9C5R sluov9LXcKb0nXFTo7NmRdpk+QmsQfLbGyq2vh1Etviz/ghe3Xy5poZkmXgnSXsAhM8hmN tw9u67TP1GFt1YGGSrIvzUaOeE4x3tlod9jXG8eywU9u7H5sPrO0SbFtlZ8Qrm6xQzmOpd PN48L0vBI4LSiRpTY6x6XZURBUA2EwcCsR3IwFN2OqT+qfN45mFYsQgzAto1qddKXP2FvP Dh7rbjdqmGiwkLQdXTJEgOFu+GV5KJaPHrdELBJgCdn2+8F6GoF8ui+lIO+rQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751930301; 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=5snfnYVx8mMTgIHe2Uw1NvSDf5rBhoCF9gpTDqcplaw=; b=gCGUDsZil6UT9kVRoJfaxGOM6yTvHpVb1/lmOx9BXAyB8gIvOBzMelo0IbDlPlt0YiKfHz HYY3RhozRlJVOOkBYgO2lCWFlozFZMzIONaErjaLUiEsnZVtLMN603Xb+ZtFvGrwR6EJ8K bI7VktSAzfT8UUdgKmoYyvqsP0Xxd7BYC3y33Ft9+K+1IIq6W/dk3aNr2p71GAvbKY0G3E Mk/rAtAjY098rV66spAaU2H3ttp5tWRj447uYRHsqMOYh6xL+04MTKLca+z5WuMLyxxztv h1msGQ0UwtfZ0UU50qTPnd57lapmc3A2hqQ4gaZ1S71JIJLBxmI1zWpBV3whrw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751930301; a=rsa-sha256; cv=none; b=BScOgaJvuB0pGd4qJxP0GopT/y7k3If78u5g7b6TpyEtw5HeiwkyxfkpZjKv7SzHa9m4zF giFaQUr8xEHagIuQ9dbeqHTfPNmWu/V4q2X+5fKqqwflh6NfEVFc/Zt9Hxq0XEC3yViI2O 36VRrEvqyMHWS1K1q6iHG+r1lAB9//LL8l7DbojgHBWZcCBa6/0klH0nluhLNc6RhlR6tX d6DWh70l/ytkr4KJzH1OtCW+gdCx3xVuDh93Fey6qQ59yujJ2LqwiWpZM9SmZco7EmWU9Z pEHsRfWC7lnMOh2KN89yRAiQQE7IgoaYYMrx05POzT7S6PpxnqGr/tbEeN2ppQ== 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 4bbgCJ73ZTz19pR; Mon, 07 Jul 2025 23:18:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567NIK0W045686; Mon, 7 Jul 2025 23:18:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567NIKW3045683; Mon, 7 Jul 2025 23:18:20 GMT (envelope-from git) Date: Mon, 7 Jul 2025 23:18:20 GMT Message-Id: <202507072318.567NIKW3045683@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: a2056e854957 - main - cam/mmc: Use xpt_path_inq instead of hand-rollded equivalent 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a2056e854957dce7f8a4c1feb7d0220be9697385 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=a2056e854957dce7f8a4c1feb7d0220be9697385 commit a2056e854957dce7f8a4c1feb7d0220be9697385 Author: Warner Losh AuthorDate: 2025-07-07 20:04:51 +0000 Commit: Warner Losh CommitDate: 2025-07-07 23:17:00 +0000 cam/mmc: Use xpt_path_inq instead of hand-rollded equivalent There's no reason to inline xpt_path_inq here. While there was a mismatch between this use (CAM_PRIORITY_NONE) and the old xpt_path_inq code (which used CAM_PRIORITY_NORMAL), xpt_path_inq has been corrected to use _NONE since this is a non-queued command. Sponsored by: Netflix Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D51168 --- sys/cam/mmc/mmc_da.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/sys/cam/mmc/mmc_da.c b/sys/cam/mmc/mmc_da.c index 9246f95a080e..3815561898bd 100644 --- a/sys/cam/mmc/mmc_da.c +++ b/sys/cam/mmc/mmc_da.c @@ -1523,10 +1523,7 @@ sdda_add_part(struct cam_periph *periph, u_int type, const char *name, bioq_init(&part->bio_queue); - bzero(&cpi, sizeof(cpi)); - xpt_setup_ccb(&cpi.ccb_h, periph->path, CAM_PRIORITY_NONE); - cpi.ccb_h.func_code = XPT_PATH_INQ; - xpt_action((union ccb *)&cpi); + xpt_path_inq(&cpi, periph->path); /* * Register this media as a disk From nobody Mon Jul 7 23:18:23 2025 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 4bbgCN27MZz61VDy; Mon, 07 Jul 2025 23:18:24 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbgCM2qtJz41KR; Mon, 07 Jul 2025 23:18:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751930303; 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=yPzzeUzw4qFF0qMDDwFBAm1cmxb4gVTfBYJE347W7cU=; b=CIuiBVlLooFHSkDwwfZ8IhSGm2Djmpjf/RJjrUCEiNuUV1DcU9hcV/Ej8Nx1//HDCZIbhE ZHsKAKDQPbjZyfXhZ9+SsRUiZQUqpAK7f2+KjQKE14Ff6VD4yy7asxbBM7OEVFu3ErirkH GK4aJlGpsXlr5hBdQoCBoJo8IPLXvLQWw430GxRkRXWRK1PUtssrLMShZe3ogpuIBFy09U 31xmehVyTNUosxAL7Gc6KhP/al5BVddjVOXDGPPvmd9fvfIDUaCJUsJB6TiVcKwxzKXdek EAyaiWgHUbxN79DLHHURD+bA8LvdwJORxDa0WvafhIb3hCoo6/mX5hg6dlT2QQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751930303; 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=yPzzeUzw4qFF0qMDDwFBAm1cmxb4gVTfBYJE347W7cU=; b=MY8X4tmCoOStEyQy917hMecWBGHbh7z7SEYJGGfBY806peDOMXPiRLgOIHOZAuhFulWf85 tg5+NVXQMSSaUt18OYgWtw4XtF0Az4XA8uowL3JBwuR8KJt9z22cmWFcvcGSGNjgTvHcim RwhEdlnplEKBlsTxBtjVfDLwRQatQrW92+UExeqKDnlG454zsMTV1CpNZFagYrEaKdD7uB eTIcIxcuJXxt/VjTVMwRZ8rvyT98B4oSYiGZZITzn3B/df6AGroVExYaaBGqy+YkITMDlP BXUL50D2kr90ngOtaBVZaNR/m5JFcVAUlpICg+6Zf1sdABLxb+PGhNxqGKxarA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751930303; a=rsa-sha256; cv=none; b=iepS4Z8xHlnKdIlG5GMnRmykyrn832NC5wav85jZv/1vvtb+nqN2BwSUF35kvMrKsASnqN G+xFoHKKKWniMUw7Mg7dVQXN6C/Wk6thP2JUINz3VdBtc2xj4EC/UGchnJ4p60iOmiDISz gOPuL8GawzXzdlnWJdyDOVYjHQvt6RZHLXuyvuYr3Gh2COgK8jg4284qsx6KGuyLSwt5w3 RauOUYhRM6DHdxaNjpSwgU2N/ZlVv60ISmOO7c3Ky0P549a8HpVK3oWzwtVsI6nowGO+Qy UYrSjIRrZiI4f8g8Q1UHkQafMErAG2hZZwTWQ0tbiMcE1fRVvr//SX9sLPMLdA== 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 4bbgCM1kx2z19sf; Mon, 07 Jul 2025 23:18:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567NINrp045760; Mon, 7 Jul 2025 23:18:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567NINWt045757; Mon, 7 Jul 2025 23:18:23 GMT (envelope-from git) Date: Mon, 7 Jul 2025 23:18:23 GMT Message-Id: <202507072318.567NINWt045757@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 5102c5f11342 - main - cam: Create free_scan_info helper function 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5102c5f1134281aadea878a61cfe4967cab0eb9e Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=5102c5f1134281aadea878a61cfe4967cab0eb9e commit 5102c5f1134281aadea878a61cfe4967cab0eb9e Author: Warner Losh AuthorDate: 2025-07-07 20:05:10 +0000 Commit: Warner Losh CommitDate: 2025-07-07 23:17:00 +0000 cam: Create free_scan_info helper function We free the scsi bug scan info in 4 places. 1 was wrong until I fixed a bug there in a recent commit. Introduce a helper function that will free the cpi always (it must always be valid since we set it right after allocation). Sponsored by: Netflix Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D51170 --- sys/cam/scsi/scsi_xpt.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/sys/cam/scsi/scsi_xpt.c b/sys/cam/scsi/scsi_xpt.c index 2506a9fba799..1dd149b00a87 100644 --- a/sys/cam/scsi/scsi_xpt.c +++ b/sys/cam/scsi/scsi_xpt.c @@ -1915,6 +1915,15 @@ typedef struct { int lunindex[0]; } scsi_scan_bus_info; +static void +free_scan_info(scsi_scan_bus_info *scan_info) +{ + KASSERT(scan_info->cpi != NULL, + ("scan_info (%p) missing its ccb_pathinq CCB\n", scan_info)); + xpt_free_ccb((union ccb *)scan_info->cpi); + free(scan_info, M_CAMXPT); +} + /* * To start a scan, request_ccb is an XPT_SCAN_BUS ccb. * As the scan progresses, scsi_scan_bus is used as the @@ -2034,16 +2043,14 @@ scsi_scan_bus(struct cam_periph *periph, union ccb *request_ccb) printf( "scsi_scan_bus: xpt_create_path failed with status %#x, bus scan halted\n", status); - xpt_free_ccb((union ccb *)scan_info->cpi); - free(scan_info, M_CAMXPT); + free_scan_info(scan_info); request_ccb->ccb_h.status = status; xpt_done(request_ccb); break; } work_ccb = xpt_alloc_ccb_nowait(); if (work_ccb == NULL) { - xpt_free_ccb((union ccb *)scan_info->cpi); - free(scan_info, M_CAMXPT); + free_scan_info(scan_info); xpt_free_path(path); request_ccb->ccb_h.status = CAM_RESRC_UNAVAIL; xpt_done(request_ccb); @@ -2205,12 +2212,11 @@ scsi_scan_bus(struct cam_periph *periph, union ccb *request_ccb) if (done) { mtx_unlock(mtx); xpt_free_ccb(request_ccb); - xpt_free_ccb((union ccb *)scan_info->cpi); request_ccb = scan_info->request_ccb; CAM_DEBUG(request_ccb->ccb_h.path, CAM_DEBUG_TRACE, ("SCAN done for %p\n", scan_info)); - free(scan_info, M_CAMXPT); + free_scan_info(scan_info); request_ccb->ccb_h.status = CAM_REQ_CMP; xpt_done(request_ccb); break; @@ -2230,9 +2236,8 @@ scsi_scan_bus(struct cam_periph *periph, union ccb *request_ccb) "scsi_scan_bus: xpt_create_path failed with status %#x, bus scan halted\n", status); xpt_free_ccb(request_ccb); - xpt_free_ccb((union ccb *)scan_info->cpi); request_ccb = scan_info->request_ccb; - free(scan_info, M_CAMXPT); + free_scan_info(scan_info); request_ccb->ccb_h.status = status; xpt_done(request_ccb); break; From nobody Mon Jul 7 23:18:22 2025 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 4bbgCM4Ksyz61VL6; Mon, 07 Jul 2025 23:18:23 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbgCL1rgKz41DL; Mon, 07 Jul 2025 23:18:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751930302; 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=LeFCyzXP1XLkOb1eee9Q+59tgjoTJLOdwnxCvWnEsN8=; b=lm8EunjZHQXcToZ9psBrZKBK9AW1YDY25XzTgkdo42QoOUOjEy627RDEBH4u7JCGYvkOU1 uiEAIn/XlXAYhxxp+I0SinJscwjb5J1ExwYnBGmIBIR42ggEgjeM7tS/Hp16AIcmOBwNOO kcLn9tLfyw1Cuaw4Alcl+BOLG5c3YZCo3uPd1RskHN+9Wpp2MYNIC7tiw+S1sltzrQSdcQ rNO7U3FYp+yHXsNxdYbbfr91Ck3OXAQrbjC6a4wUI/VDvpR7PPBqKZHrHrHpMYcDZ1As2p L27rBVYmaTK4loC7UzdCFbDRg/qAJr3RSOH1RGKKQ188kSGAR0ji59RdlRBUCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751930302; 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=LeFCyzXP1XLkOb1eee9Q+59tgjoTJLOdwnxCvWnEsN8=; b=P+u8e/9LXfStBReBflclCsXBhqSnlDdZXsDJb1wZOEC+f3Vl9TsCvpP/9Q+cD9l96vs0Gz +njKWZe15OEV3bNLKpVT6+RxVKqq3bUisSUga7ok/VqVjyFwKfmjNNIqW6hXnMURFYZMZU 1D4svuNJwFJuX3K483vehagMiECe4cH4HF/XFD0m4Gbo9rfotKmZ9HyCFO5+t1bIpB+yGn mX1OMYY6kl4pZGNPtLOZnU6Kse6cuTqRU7+d2GicAnlvyoFjL6NLrhq1izi4T4maQIMTyw YouWjj3xeAGXispPs0DTBekiFe/c+3CjCx4+36WHCk5vSrRsMhNV1u49SLYJeA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751930302; a=rsa-sha256; cv=none; b=o86cGhuFKOM6ZhN4LEBcpNP8wzWEz6SnGwwCBu2oJIAEKl9V1Kg4sjlJ1bsajQdM3xhB+P 1oCUgSl7QOveFDxIWapXZwil+lQ+NPbqE8I543/SJMPXYTQQO2u+10945uaQEK+SUZ82ol 4uT5SkgpYrtl1foGBx7KwaNb3wAsnWR7+g/zxKklkEsOsNrT1RiyvV8Hl3DyXewsISv8oT VG8Vg5V4JbxZHc6xznDpX9m51D9W8teuKmF9MIVty5bvOL/uJIdiiz/BdKkVkyK11VBuie rpMLx17je3m9UqGHx0VzFZ1s7yhZU8nd+pR9MMLQ4jEAvW5O2mdAYFsH5G5ECA== 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 4bbgCL18S4z19pS; Mon, 07 Jul 2025 23:18:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567NIM14045719; Mon, 7 Jul 2025 23:18:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567NIMmv045716; Mon, 7 Jul 2025 23:18:22 GMT (envelope-from git) Date: Mon, 7 Jul 2025 23:18:22 GMT Message-Id: <202507072318.567NIMmv045716@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 3b3591d3e1ac - main - cam: In scsi_scan_bus, fix an error case 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3b3591d3e1ac6423570201da0b23ab3d087816a9 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=3b3591d3e1ac6423570201da0b23ab3d087816a9 commit 3b3591d3e1ac6423570201da0b23ab3d087816a9 Author: Warner Losh AuthorDate: 2025-07-07 20:05:02 +0000 Commit: Warner Losh CommitDate: 2025-07-07 23:17:00 +0000 cam: In scsi_scan_bus, fix an error case If we can't allocate the new path when loopoing over the target range, then we have to free the scan_info->cpi CCB, not the work_ccb. This was accidentally correct for the first iteration (because work_ccb == scan_info->cpi), but incorrect after that since we'll be freeing the CCB for XPT_SCAN_LUN for the prior LUN we kicked off. Reorder the free so we free it before we free scan_info so the pointer is still valid. I do not have a test case for this since it requires that we fail in the second or later iteration of the loop due to low memory, and only fuzzing would catch that. Sponsored by: Netflix Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D51169 --- sys/cam/scsi/scsi_xpt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/cam/scsi/scsi_xpt.c b/sys/cam/scsi/scsi_xpt.c index 175716ca6a67..2506a9fba799 100644 --- a/sys/cam/scsi/scsi_xpt.c +++ b/sys/cam/scsi/scsi_xpt.c @@ -2034,9 +2034,9 @@ scsi_scan_bus(struct cam_periph *periph, union ccb *request_ccb) printf( "scsi_scan_bus: xpt_create_path failed with status %#x, bus scan halted\n", status); + xpt_free_ccb((union ccb *)scan_info->cpi); free(scan_info, M_CAMXPT); request_ccb->ccb_h.status = status; - xpt_free_ccb(work_ccb); xpt_done(request_ccb); break; } From nobody Mon Jul 7 23:18:24 2025 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 4bbgCQ1fBvz61V8Z; Mon, 07 Jul 2025 23:18:26 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbgCN3Wbvz41Vw; Mon, 07 Jul 2025 23:18:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751930304; 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=cboze8yx5UiCuAVFTWv7urE8uAbkt/+SiFKLflu7KXU=; b=Z0RFKXXJnYGINB5alnpg4Vs/U8XyVvFisyVcz83R4wAcm4Fb9XcCe6FUqYbyEvVeZP4eQP Qt/qMs7DjZcTOkK4WLE1ziv0LDqWg7wxvv/feudAa1C+CpaKggn5dnc7cZ3IrTSIP3Z3tb B/ntjIQBRoSxxwXqr6fyJI7dJJLPM2nhkjYYB36dlbl90kfNkbsQ1xPjaI+vXs+V4EUKNp jQtDwE0ahz6ML1gPI7iJmoPzhXI5MboFi+FMi9ghLyyupzqUPBgvk7h3+QngQgCFXJ0TLP Pv+ke6SbxTTGzLe42TwX7jlvOEEPChYdIVwjRrtatv/FGX7jeiNbh/JhuD6+GA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751930304; 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=cboze8yx5UiCuAVFTWv7urE8uAbkt/+SiFKLflu7KXU=; b=OI3VdqcSGqnTc42Qra4oZ5paQJghNEVox+jeknqLNTW7Wgr540ZhZ+3Ec7u/WxIfGtQu/7 4zTst/9k+tQarlsO3JFhGTSHCQOpd8T7kizc90fKgE5bASoQO+Z+UiNNrTTBf9haIo3MEk fIOFN1frFmkhhcv5SI78yozGhFoC0i2MOawVN1ceEYWY2D/wFzd56osKLCfzCsy3Gv9PGn ZBjglUM8hSZMpJM9Cxpowveo0EN445/70zVhfNzQxVmz+EO1l9aeN5SIYUEckOqrApgDlh +aiM0lsBjvbPWnHOvRSSAVE692hTWSqgxdy46vQeXqbYScNLhjbja1+l8cZgQw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751930304; a=rsa-sha256; cv=none; b=TAgralYAAw2S0cs4NFJQEnfELy6aMl7/vVL011IxX8c8vyeYr4pKphUw95DvvD4yYRMRVt j54bkVJKSOxp1RNnci4Uw7s4FdHAvc6TSjs2xX+07hviDvpbrQctRB3LB8jqYR4sZ25Lk3 GcUAjrs2qcEZ0+IDsABPTF12cIhckzlsBDlVo/gVhuwhNLKGsJ16ubwF7dhVqaWWU6E/yw e2wW0J5aFHCND+NH8JJAv9lmnYm5xt8sSIWvScpuDy3qxiKSVP23s6QtkEu4vK95+SdwoE LiAGprJbKTQDv+HIGtYsETzwozt9fpf2BLK/6HLLMVReBQ6yiiFg67P4mtcVig== 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 4bbgCN2y9Mz19YG; Mon, 07 Jul 2025 23:18:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567NIOVL045794; Mon, 7 Jul 2025 23:18:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567NIOHF045791; Mon, 7 Jul 2025 23:18:24 GMT (envelope-from git) Date: Mon, 7 Jul 2025 23:18:24 GMT Message-Id: <202507072318.567NIOHF045791@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 7462eb81cd5b - main - cam: Use bool for done 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7462eb81cd5b2ba6b42e13f49c777a474edea308 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=7462eb81cd5b2ba6b42e13f49c777a474edea308 commit 7462eb81cd5b2ba6b42e13f49c777a474edea308 Author: Warner Losh AuthorDate: 2025-07-07 20:05:16 +0000 Commit: Warner Losh CommitDate: 2025-07-07 23:17:01 +0000 cam: Use bool for done 'done' is a bool, so declare it like one. Sponsored by: Netflix Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D51171 --- sys/cam/scsi/scsi_xpt.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/cam/scsi/scsi_xpt.c b/sys/cam/scsi/scsi_xpt.c index 1dd149b00a87..bef35243af98 100644 --- a/sys/cam/scsi/scsi_xpt.c +++ b/sys/cam/scsi/scsi_xpt.c @@ -2183,16 +2183,16 @@ scsi_scan_bus(struct cam_periph *periph, union ccb *request_ccb) * Check to see if we scan any further luns. */ if (next_target) { - int done; + bool done; /* * Free the current request path- we're done with it. */ xpt_free_path(oldpath); hop_again: - done = 0; + done = false; if (scan_info->request_ccb->ccb_h.func_code == XPT_SCAN_TGT) { - done = 1; + done = true; } else if (scan_info->cpi->hba_misc & PIM_SEQSCAN) { scan_info->counter++; if (scan_info->counter == @@ -2201,12 +2201,12 @@ scsi_scan_bus(struct cam_periph *periph, union ccb *request_ccb) } if (scan_info->counter >= scan_info->cpi->max_target+1) { - done = 1; + done = true; } } else { scan_info->counter--; if (scan_info->counter == 0) { - done = 1; + done = true; } } if (done) { From nobody Mon Jul 7 23:46:58 2025 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 4bbgrM4BvYz60s9C for ; Mon, 07 Jul 2025 23:46:59 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbgrM2wh4z4H5Z; Mon, 07 Jul 2025 23:46:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751932019; 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=asU8bXWd1A82Yw3ykZoN8YwcSk/i0IGGiCbTQgmtMNU=; b=WeSIK/vgZfeKbBwNxqnOGEeDgQhv9yzIOMHLDBPT8m16iefl+LATDnHXhUIZV3g90AlsJA Wcux7AO9jeaQCUWSOOz+9nHQIHTlm/V9FIi15IkT21Tgc7JjryeBVjj4u31jx14DBi5I52 k4Rim3NkhsgtkyBDtbtRYesbxANTaojx7MZ6M4JUGxcWUNxrH0RwDnMQMK+mYOUoo9/Ca/ jummCxMlS6DqCqUdpuzHkRcKbN7VJQbfrb9ZovMr8YFcWfbVH+ROQpmy5sGZLq8YX96cDh dY8ynLsT5ZUBEWGlmtqAN96T74Q8Boh3X5M4+FdFxMD8K7ctuYNRSzeXIdalJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751932019; 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=asU8bXWd1A82Yw3ykZoN8YwcSk/i0IGGiCbTQgmtMNU=; b=G89Y3dOjfqaY3IqdBWJOSvOYKCBPK5/GpvqkjfufNETdZEQRskRtosqH+6okca7NisfYV0 yGy3d4IrVEtKG6AcCFc0o1q3D7R3da3bdvnGmIykuTTD04ERDa4CfxQJaULPEbN/oo9S1M 4+PywUOtt8+GYZOVJXx76WCnJwttO4Z056+BD4r/CgFX96fAnzYrP7yQjxRc+n29qaAH2H ETaEVVDBlNfI9JYo4qlhWP7G5l8cjcxLIqTca42YKL4k0nrBixltQCA5gBWuSCjo1ARIJ/ +O4DMs//KaqlA6L7PAjSa+d+5QPj8NB7A3Hz9E9xMRmn1j9dpZjPWuuEOBB5DQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751932019; a=rsa-sha256; cv=none; b=aiaXHsdOsOlTDoi8H6kQpdq49YON3jxGRTLd7KlJzs+HUh60Klia30zXRoauCRut70NGG5 2hKUiliSQtro8fqxS+eWOAaHKFvtQfb6KqLNv/ouLKnyO9X6vi1aSUVMAUrjdQ6/upRJeX vBeBIn43O7kIiCcRpxZJiyFZ51jU+5XsA2LQx32fPFKKwOmjnw/hA8EMCwpymu+i9FRvvj QNNSREXdQAJN90xbzwQgDT2VYePkKBuV8dDRhXCxs1E4oynJ72x3OMmVdO6ozNk2vaR15O VRElvL04aQ5ZdxIaLRC+D77yve96rFO7OTQKl8y9ZwO5XQvmFHeVuBEW/VVP9A== 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 4bbgrM1x1Qz1BKW; Mon, 07 Jul 2025 23:46:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567Nkwut001328; Mon, 7 Jul 2025 23:46:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567NkwtZ001327; Mon, 7 Jul 2025 23:46:58 GMT (envelope-from git) Date: Mon, 7 Jul 2025 23:46:58 GMT Message-Id: <202507072346.567NkwtZ001327@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Cy Schubert Subject: git: 657ea345f331..89922daaa168 - vendor/sqlite3 - vendor branch updated 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/vendor/sqlite3 X-Git-Reftype: branch X-Git-Commit: 89922daaa168292633b1a7a523bcd0559487c6ad X-Git-Oldrev: 657ea345f331704c612a35e5a74968bef9ffcfd8 X-Git-Newrev: 89922daaa168292633b1a7a523bcd0559487c6ad Auto-Submitted: auto-generated The branch vendor/sqlite3 has been updated by cy: URL: https://cgit.FreeBSD.org/src/log/?id=657ea345f331..89922daaa168 89922daaa168 sqlite3: Vendor import of sqlite3 3.50.2 From nobody Mon Jul 7 23:58:38 2025 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 4bbh5p6gF4z60txR; Mon, 07 Jul 2025 23:58:38 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbh5p3X59z4Q8S; Mon, 07 Jul 2025 23:58:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751932718; 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=z4UHNPraJXQAf90dVR86wVnV/USUYnAlyIcRaRWjuOo=; b=yKfDMGy8hB3f2LRilg10SRECrcI28CrGjNbJqfXW3NlZPiYsHGxxrkconRUIZmNWu2z3/U hJL9Ozld7xA0SmAazV+o+XyR7MXunpqhWPpuNAwNlLTWg499emtD8JEJ95+y1QeByUKtCG UFvMHY16KLekNPenAKNyYgLMXhz55YGCPwLHowlx4cnj9bbiaUo3Gn30pWaEDWdlBAi9E2 reoUdVewcSFg6MXWaIHhanVJRgDtMPR3wM1iVe4nESEy12AB0fy4UQlu0Peh6XqVlFdOXF M6v8jhEj6lN4s4TwLNgG1sKR/NQDhY8p4fhoV/Tr6jErTzt3QZ5rz7Us+seR7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751932718; 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=z4UHNPraJXQAf90dVR86wVnV/USUYnAlyIcRaRWjuOo=; b=Ng+yqpFuTzISZwXHFX2KgXfVeytOpml3G1ZeaFTRskc42mueK6Bfbo4jM0vPVFx9IBzW3a stJdGVEurD7X8b+hWHxRWp7vH4VNScf4pttZo+5LxkRXyBNYmH9gSiHS+nHVcqcWO5daMC kRmY6VaQ+CubffzPr4CjOikx65Mw+AZ/hv41sCiJkx7bqyhManswaxeMVYbeRJx7BJrgc4 KM4Pf/9fXs2U62GoMFHEZh0wQiYGVeCDetMG0BzYctZJBnfouZS3j0xrlQccWRr2kQ1tht YfM98r4KC6c1MfxFVvjHLeZTQ5F3FXiJiOWLDvP9xNeoTPs5iQyVXbPMLYq6Iw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751932718; a=rsa-sha256; cv=none; b=H6Ru2KDh/nvluvq+95+ID+yQotC989biRZPG9kx3s3zqF4MaOVWYHcsnhDkBNJPkblRDUo QhpSfCUJYpUrHoFJ3KkgLPdk5dLOf9OSZEG9tgvZF3syh0WnW6WlthcfUVjOzMASzHGjY4 zdGDD/U245sjpvWAQ34cGrkTWIIvoIW0TVi64JCZrltsrKj1FfBRaKQCOhGRd0L7ZMsGYF IZnh8vaBR0NN3I8VHym+JH72+ROuxG3TdxVBspWoZX2G65U4T4mY00F/MWYxro7+ZrYAoT mteFAYI1Ry9IFdUve3sR3cst9qKM3mnLEM0+vgRl77SJ5HIGjHkeo/I6IeFv5w== 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 4bbh5p2dbFz1BjR; Mon, 07 Jul 2025 23:58:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567Nwc3S019953; Mon, 7 Jul 2025 23:58:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567NwcLM019950; Mon, 7 Jul 2025 23:58:38 GMT (envelope-from git) Date: Mon, 7 Jul 2025 23:58:38 GMT Message-Id: <202507072358.567NwcLM019950@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: ac2e39b5ddf5 - main - ipfilter: End (cleanup) the iterative search key 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ac2e39b5ddf5d5c6bc3848e392670a00e5834450 Auto-Submitted: auto-generated The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=ac2e39b5ddf5d5c6bc3848e392670a00e5834450 commit ac2e39b5ddf5d5c6bc3848e392670a00e5834450 Author: Cy Schubert AuthorDate: 2025-07-07 23:37:07 +0000 Commit: Cy Schubert CommitDate: 2025-07-07 23:37:07 +0000 ipfilter: End (cleanup) the iterative search key This results in not finding nodes in subsequent hash table listings. MFC after: 3 days --- sbin/ipf/libipf/printhash_live.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sbin/ipf/libipf/printhash_live.c b/sbin/ipf/libipf/printhash_live.c index 3caaa5e022fe..b8ee31b27597 100644 --- a/sbin/ipf/libipf/printhash_live.c +++ b/sbin/ipf/libipf/printhash_live.c @@ -61,5 +61,8 @@ printhash_live(iphtable_t *hp, int fd, char *name, int opts, wordtab_t *fields) if ((opts & OPT_DEBUG) == 0) PRINTF(" };\n"); + + (void) ioctl(fd,SIOCIPFDELTOK, &iter.ili_key); + return (hp->iph_next); } From nobody Mon Jul 7 23:58:39 2025 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 4bbh5r5lg1z60vGh; Mon, 07 Jul 2025 23:58:40 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbh5r4MX8z4QKc; Mon, 07 Jul 2025 23:58:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751932720; 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=iEdoo7UjNVqhhTHy0Nq+W5TJmpY9expO6nB4ZiHCO6U=; b=i4NLGGexdXBB5iPdSZHdhaG2vc1FfxJJxHI8nFESBkt3y1zxGNs9sctcgsDXaFBzzGfGe2 YjMwITnGhNg8eyCgifGqmPvZCzzBfBCsWzqIm7wpZeunzV4CRVMWQFczk58A7Oxmh4aj9Z ZE35KY9CFCEhgYep6M5g4zqHEfi8lfiCp1ozRIj+7bWNniyKnge02qHD2GF/WFneF/Ks7e /e3Gfg/CmY96pSf1vVteDuNsNsFaD4JxvNJy1Ed0GHBq+KvY+zqT4XiumPwlwqIMJI+N77 1ADHIYgtEfebos7tXEa56S8U3CtbEFtLf/ABU2+mhRfWafu4VDJyvHynKvO3uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751932720; 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=iEdoo7UjNVqhhTHy0Nq+W5TJmpY9expO6nB4ZiHCO6U=; b=ZNCWl8S3nwIycDnXmE859Y54euvftXtYzdOz6ah5hMqSciL56+yyDRJ7C/yA2zo1OwpIFJ QQ+wSF2PfHPd2aYXgfa8qcRd1RDFtBBh8KuUHSJLkp4UonG5JDjlNGDuo66QVE9i37Jfjv PRn+//KVEILOCBPVZ67MV6PrqrKdHS08HhlU+y97ZA0Y5s/oDjHJpvALxruQp0JF385wYy iMdV3H+JH3a3sqrG9+wMbFn+cC3oPZcXcy9V0j6DRke6RkOApQBxB0EF9UDpUxAVcAaQ2o mEDdWGL/GCsIH+Y5q6ZQQ7y0/+0/+krHIEVnOhpKHZVoLzRX0eEx56TnP4eQwg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751932720; a=rsa-sha256; cv=none; b=ylh1gsh3goN3KCI0r1GILd4LXEQ2LIL5r5IfHi8VBeQoqoMzLzpbGx68S9/rvpUNN+oB7Y yaFmki49bgCrdKvX8XXTDNQZRZ0sIl+0VLqz+BY4QsbRhl86ruxpZedswK9GjuVtvi51s7 +i56tlCWmum2sLnUAatR8n/x8J09LYYy26SSUezLq+B9fmarO4c82VwvnX/vYdUSm11w2+ 4gEQ3U4JScyAYWkEbZnNmgqonLhI1W4w55LSijR+zA1YEs1H/BNDkbT9tw1TAtwfcEIN0i zvwXSG4D9LpfvBSEUSjY+DKrahLfg+4m4cSlovnnC1+t3aEV7fIRQUITuGBh9Q== 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 4bbh5r3jvBz1BjS; Mon, 07 Jul 2025 23:58:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 567NweAo019991; Mon, 7 Jul 2025 23:58:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 567NwdpO019989; Mon, 7 Jul 2025 23:58:39 GMT (envelope-from git) Date: Mon, 7 Jul 2025 23:58:39 GMT Message-Id: <202507072358.567NwdpO019989@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: 17f0f75308f2 - main - sqlite3: Vendor import of sqlite3 3.50.2 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 17f0f75308f287efea825457364e2a4de2e107d4 Auto-Submitted: auto-generated The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=17f0f75308f287efea825457364e2a4de2e107d4 commit 17f0f75308f287efea825457364e2a4de2e107d4 Merge: ac2e39b5ddf5 89922daaa168 Author: Cy Schubert AuthorDate: 2025-07-07 23:49:17 +0000 Commit: Cy Schubert CommitDate: 2025-07-07 23:49:17 +0000 sqlite3: Vendor import of sqlite3 3.50.2 Release notes at https://www.sqlite.org/releaselog/3_50_2.html. Obtained from: https://www.sqlite.org/2025/sqlite-autoconf-3500200.tar.gz MFC after: 1 month Merge commit '89922daaa168292633b1a7a523bcd0559487c6ad' contrib/sqlite3/INSTALL | 370 - contrib/sqlite3/Makefile.am | 19 - contrib/sqlite3/Makefile.in | 1326 +- contrib/sqlite3/Makefile.msc | 50 +- contrib/sqlite3/README.txt | 98 +- contrib/sqlite3/VERSION | 1 + contrib/sqlite3/aclocal.m4 | 10204 -------- contrib/sqlite3/auto.def | 25 + contrib/sqlite3/autosetup/LICENSE | 35 + contrib/sqlite3/autosetup/README.autosetup | 11 + contrib/sqlite3/autosetup/README.md | 453 + contrib/sqlite3/autosetup/autosetup | 2540 ++ .../autosetup-config.guess} | 111 +- .../{config.sub => autosetup/autosetup-config.sub} | 942 +- contrib/sqlite3/autosetup/autosetup-find-tclsh | 16 + contrib/sqlite3/autosetup/autosetup-test-tclsh | 20 + contrib/sqlite3/autosetup/cc-db.tcl | 15 + contrib/sqlite3/autosetup/cc-lib.tcl | 187 + contrib/sqlite3/autosetup/cc-shared.tcl | 113 + contrib/sqlite3/autosetup/cc.tcl | 758 + contrib/sqlite3/autosetup/find_tclconfig.tcl | 24 + contrib/sqlite3/autosetup/jimsh0.c | 24519 +++++++++++++++++++ contrib/sqlite3/autosetup/pkg-config.tcl | 168 + contrib/sqlite3/autosetup/proj.tcl | 2236 ++ contrib/sqlite3/autosetup/sqlite-config.tcl | 2174 ++ contrib/sqlite3/autosetup/system.tcl | 420 + contrib/sqlite3/autosetup/teaish/README.txt | 4 + contrib/sqlite3/autosetup/teaish/core.tcl | 2539 ++ contrib/sqlite3/autosetup/teaish/feature.tcl | 214 + contrib/sqlite3/autosetup/teaish/tester.tcl | 228 + contrib/sqlite3/compile | 348 - contrib/sqlite3/configure | 16891 +------------ contrib/sqlite3/configure.ac | 270 - contrib/sqlite3/depcomp | 791 - contrib/sqlite3/install-sh | 541 - contrib/sqlite3/ltmain.sh | 11251 --------- contrib/sqlite3/missing | 215 - contrib/sqlite3/shell.c | 7696 ++++-- contrib/sqlite3/sqlite3.c | 17725 +++++++++----- contrib/sqlite3/sqlite3.h | 618 +- contrib/sqlite3/sqlite3.pc.in | 2 +- contrib/sqlite3/sqlite3.rc | 2 +- contrib/sqlite3/sqlite3ext.h | 4 + contrib/sqlite3/sqlite3rc.h | 2 +- contrib/sqlite3/tea/Makefile.in | 1006 +- contrib/sqlite3/tea/README | 36 - contrib/sqlite3/tea/README.txt | 104 + contrib/sqlite3/tea/_teaish.tester.tcl.in | 49 + contrib/sqlite3/tea/aclocal.m4 | 9 - contrib/sqlite3/tea/auto.def | 8 + contrib/sqlite3/tea/configure | 10186 +------- contrib/sqlite3/tea/configure.ac | 227 - contrib/sqlite3/tea/doc/sqlite3.n | 4 +- contrib/sqlite3/tea/generic/tclsqlite3.c | 231 +- contrib/sqlite3/tea/pkgIndex.tcl.in | 40 +- contrib/sqlite3/tea/tclconfig/install-sh | 528 - contrib/sqlite3/tea/tclconfig/tcl.m4 | 4067 --- contrib/sqlite3/tea/teaish.tcl | 565 + contrib/sqlite3/tea/teaish.test.tcl | 14 + contrib/sqlite3/tea/win/makefile.vc | 430 - contrib/sqlite3/tea/win/nmakehlp.c | 815 - contrib/sqlite3/tea/win/rules.vc | 711 - 62 files changed, 56587 insertions(+), 68619 deletions(-) diff --cc contrib/sqlite3/VERSION index 000000000000,18d0478a0414..18d0478a0414 mode 000000,100644..100644 --- a/contrib/sqlite3/VERSION +++ b/contrib/sqlite3/VERSION diff --cc contrib/sqlite3/auto.def index 000000000000,c61d81e506f0..c61d81e506f0 mode 000000,100644..100644 --- a/contrib/sqlite3/auto.def +++ b/contrib/sqlite3/auto.def diff --cc contrib/sqlite3/autosetup/LICENSE index 000000000000,4fe636c9d912..4fe636c9d912 mode 000000,100644..100644 --- a/contrib/sqlite3/autosetup/LICENSE +++ b/contrib/sqlite3/autosetup/LICENSE diff --cc contrib/sqlite3/autosetup/README.autosetup index 000000000000,395298048038..395298048038 mode 000000,100644..100644 --- a/contrib/sqlite3/autosetup/README.autosetup +++ b/contrib/sqlite3/autosetup/README.autosetup diff --cc contrib/sqlite3/autosetup/README.md index 000000000000,3301f5739599..3301f5739599 mode 000000,100644..100644 --- a/contrib/sqlite3/autosetup/README.md +++ b/contrib/sqlite3/autosetup/README.md diff --cc contrib/sqlite3/autosetup/autosetup index 000000000000,239987554ff3..239987554ff3 mode 000000,100755..100755 --- a/contrib/sqlite3/autosetup/autosetup +++ b/contrib/sqlite3/autosetup/autosetup diff --cc contrib/sqlite3/autosetup/autosetup-find-tclsh index 000000000000,9f6d6e9402f4..9f6d6e9402f4 mode 000000,100755..100755 --- a/contrib/sqlite3/autosetup/autosetup-find-tclsh +++ b/contrib/sqlite3/autosetup/autosetup-find-tclsh diff --cc contrib/sqlite3/autosetup/autosetup-test-tclsh index 000000000000,75126d2444b6..75126d2444b6 mode 000000,100644..100644 --- a/contrib/sqlite3/autosetup/autosetup-test-tclsh +++ b/contrib/sqlite3/autosetup/autosetup-test-tclsh diff --cc contrib/sqlite3/autosetup/cc-db.tcl index 000000000000,12f1aed2c91b..12f1aed2c91b mode 000000,100644..100644 --- a/contrib/sqlite3/autosetup/cc-db.tcl +++ b/contrib/sqlite3/autosetup/cc-db.tcl diff --cc contrib/sqlite3/autosetup/cc-lib.tcl index 000000000000,01a0fb387760..01a0fb387760 mode 000000,100644..100644 --- a/contrib/sqlite3/autosetup/cc-lib.tcl +++ b/contrib/sqlite3/autosetup/cc-lib.tcl diff --cc contrib/sqlite3/autosetup/cc-shared.tcl index 000000000000,cbe568018e96..cbe568018e96 mode 000000,100644..100644 --- a/contrib/sqlite3/autosetup/cc-shared.tcl +++ b/contrib/sqlite3/autosetup/cc-shared.tcl diff --cc contrib/sqlite3/autosetup/cc.tcl index 000000000000,05c1b1cf4068..05c1b1cf4068 mode 000000,100644..100644 --- a/contrib/sqlite3/autosetup/cc.tcl +++ b/contrib/sqlite3/autosetup/cc.tcl diff --cc contrib/sqlite3/autosetup/find_tclconfig.tcl index 000000000000,c3d3df8ec3ab..c3d3df8ec3ab mode 000000,100644..100644 --- a/contrib/sqlite3/autosetup/find_tclconfig.tcl +++ b/contrib/sqlite3/autosetup/find_tclconfig.tcl diff --cc contrib/sqlite3/autosetup/jimsh0.c index 000000000000,b035524c9681..b035524c9681 mode 000000,100644..100644 --- a/contrib/sqlite3/autosetup/jimsh0.c +++ b/contrib/sqlite3/autosetup/jimsh0.c diff --cc contrib/sqlite3/autosetup/pkg-config.tcl index 000000000000,9ce7111f55c1..9ce7111f55c1 mode 000000,100644..100644 --- a/contrib/sqlite3/autosetup/pkg-config.tcl +++ b/contrib/sqlite3/autosetup/pkg-config.tcl diff --cc contrib/sqlite3/autosetup/proj.tcl index 000000000000,1335567064ee..1335567064ee mode 000000,100644..100644 --- a/contrib/sqlite3/autosetup/proj.tcl +++ b/contrib/sqlite3/autosetup/proj.tcl diff --cc contrib/sqlite3/autosetup/sqlite-config.tcl index 000000000000,85fe4143821c..85fe4143821c mode 000000,100644..100644 --- a/contrib/sqlite3/autosetup/sqlite-config.tcl +++ b/contrib/sqlite3/autosetup/sqlite-config.tcl diff --cc contrib/sqlite3/autosetup/system.tcl index 000000000000,05d378afdd26..05d378afdd26 mode 000000,100644..100644 --- a/contrib/sqlite3/autosetup/system.tcl +++ b/contrib/sqlite3/autosetup/system.tcl diff --cc contrib/sqlite3/autosetup/teaish/README.txt index 000000000000,e11519b042bd..e11519b042bd mode 000000,100644..100644 --- a/contrib/sqlite3/autosetup/teaish/README.txt +++ b/contrib/sqlite3/autosetup/teaish/README.txt diff --cc contrib/sqlite3/autosetup/teaish/core.tcl index 000000000000,09017029d77f..09017029d77f mode 000000,100644..100644 --- a/contrib/sqlite3/autosetup/teaish/core.tcl +++ b/contrib/sqlite3/autosetup/teaish/core.tcl diff --cc contrib/sqlite3/autosetup/teaish/feature.tcl index 000000000000,6c927d1a77e5..6c927d1a77e5 mode 000000,100644..100644 --- a/contrib/sqlite3/autosetup/teaish/feature.tcl +++ b/contrib/sqlite3/autosetup/teaish/feature.tcl diff --cc contrib/sqlite3/autosetup/teaish/tester.tcl index 000000000000,d8b5f7a0e8c2..d8b5f7a0e8c2 mode 000000,100644..100644 --- a/contrib/sqlite3/autosetup/teaish/tester.tcl +++ b/contrib/sqlite3/autosetup/teaish/tester.tcl diff --cc contrib/sqlite3/tea/README.txt index 000000000000,fb7cb1924854..fb7cb1924854 mode 000000,100644..100644 --- a/contrib/sqlite3/tea/README.txt +++ b/contrib/sqlite3/tea/README.txt diff --cc contrib/sqlite3/tea/_teaish.tester.tcl.in index 000000000000,59d11f0a8f6e..59d11f0a8f6e mode 000000,100644..100644 --- a/contrib/sqlite3/tea/_teaish.tester.tcl.in +++ b/contrib/sqlite3/tea/_teaish.tester.tcl.in diff --cc contrib/sqlite3/tea/auto.def index 000000000000,7170b3d1fe02..7170b3d1fe02 mode 000000,100644..100644 --- a/contrib/sqlite3/tea/auto.def +++ b/contrib/sqlite3/tea/auto.def diff --cc contrib/sqlite3/tea/teaish.tcl index 000000000000,9333495aa3da..9333495aa3da mode 000000,100644..100644 --- a/contrib/sqlite3/tea/teaish.tcl +++ b/contrib/sqlite3/tea/teaish.tcl diff --cc contrib/sqlite3/tea/teaish.test.tcl index 000000000000,b63c9426e395..b63c9426e395 mode 000000,100644..100644 --- a/contrib/sqlite3/tea/teaish.test.tcl +++ b/contrib/sqlite3/tea/teaish.test.tcl From nobody Tue Jul 8 01:18:23 2025 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 4bbjt53lJ3z6152k; Tue, 08 Jul 2025 01:18:37 +0000 (UTC) (envelope-from herbert@gojira.at) Received: from mail.bsd4all.net (mail.bsd4all.net [94.130.200.20]) (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 mx1.freebsd.org (Postfix) with ESMTPS id 4bbjt46hzJz47Jk; Tue, 08 Jul 2025 01:18:36 +0000 (UTC) (envelope-from herbert@gojira.at) Authentication-Results: mx1.freebsd.org; none Date: Tue, 8 Jul 2025 03:18:23 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=gojira.at; s=mail202005; t=1751937503; bh=XEbr8OZvAfafMUF1ojyLQazRQxnhbnRTA9BUD/WyIZA=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type; b=AjY4XXTmOr3Xp4BOruxsrUwM+857HVJPZblzHeOczo6pM+CV65VWnxlnpqfB4YYwD QPl8mNIsgFoqUDyBNyJWOf6zPK+u0KiTevAtNA/LpbM2d3jHYDTyx0EhcADaix2gAI 3ICiwuVa7c6llrhDi5kwFwRsAtsKz+Bt6lDY6XhStSVACoFLXlfbBp11lMJVtUvz/m BqzxvzwxWsil5sq+SfJqGqxOgCfDHL+beCOuIYt4KtdBXTnUCmNA6SY/xPztZWr2Vq 7iQwuB2/nUMk8NUrYtWig9oLt9r3SHnpkpEyZfA7JS7wiSp8D7tz1fdg6hYh++am3K DwbZUv8EAm/YQ== From: "Herbert J. Skuhra" To: Cy Schubert Cc: Dima Panov , Cy Schubert , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 7e35117eb07f - main - Makefile: Hook MIT KRB5 into the build Message-ID: References: <202506160251.55G2pwx4063231@gitrepo.freebsd.org> <20250620073050.7f03f74e@slippy> <20250707230446.F279E3A1@slippy.cwsent.com> 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250707230446.F279E3A1@slippy.cwsent.com> X-Rspamd-Queue-Id: 4bbjt46hzJz47Jk X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:24940, ipnet:94.130.0.0/16, country:DE] On Mon, Jul 07, 2025 at 04:04:46PM -0700, Cy Schubert wrote: > In message , "Herbert J. Skuhra" writes: > > On Mon, Jul 07, 2025 at 10:36:31PM +0300, Dima Panov wrote: > > > Hello! > > > > > > > > > BTW, it looks like symlink for libkadm5clnt.so is broken and produced a bad > > file > > > $ ls -la libkadm5clnt > > > lrwxr-xr-x 1 root wheel 13 7 Jul 20:40 libkadm5clnt -> kadm5clnt_mit > > > > > > instead of assumed libkadm5clnt.so -> kadm5clnt_mit.so > > > > > > > > > Please review: > > > > > > diff --git a/krb5/lib/kadm5clnt/Makefile b/krb5/lib/kadm5clnt/Makefile > > > index e377f95f5b6e..be09dd3e210e 100644 > > > --- a/krb5/lib/kadm5clnt/Makefile > > > +++ b/krb5/lib/kadm5clnt/Makefile > > > @@ -88,7 +88,7 @@ ${CHPASS_UTIL_STRINGS_ERR_C}: ${CHPASS_UTIL_STRINGS_ERR} > > > rm -f et-c-${.PREFIX}.et et-c-${.PREFIX}.c > > > > > > afterinstall: > > > - ${INSTALL_LIBSYMLINK} ${SHLIB} ${DESTDIR}${LIBDIR}/libkadm5clnt > > > + ${INSTALL_LIBSYMLINK} ${SHLIB_NAME} ${DESTDIR}${LIBDIR}/libkadm5cln > > t.so > > > > > > .include > > > > This produces a valid symlink that 'make delete-old' wants to > > remove again: > > > > lrwxr-xr-x 1 root wheel 23 Jul 7 22:26 /usr/lib/libkadm5clnt.so -> > > libkadm5clnt_mit.so.121 > > > > # make delete-old > > >>> Removing old files (only deletes safe to delete libs) > > remove /usr/lib/libkadm5clnt.so? > > Thanks Dima and Herbert for reporting this. It's been fixed. Cy, I am sorry for not being more precise. Dima's change, which hasn't been commited yet, fixes the real issue of creating a bad symlink. I just wanted to add that his fix also needs removal of usr/lib/libkadm5clnt.so in tools/build/mk/OptionalObsoleteFiles.inc. Maybe usr/lib/libkadm5clnt should be added to OptionalObsoleteFiles.inc? From nobody Tue Jul 8 03:04:25 2025 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 4bbmDB2dVnz61KsR; Tue, 08 Jul 2025 03:04:26 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbmDB19FLz3CFt; Tue, 08 Jul 2025 03:04:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751943866; 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=eic4AsYNh4iPHwk7/gEOsZCR3/sWlJWAumU4ebVT5i4=; b=rlQtb59OXBEUn5S1X0+SjiY8avedgEeKju7gPIjOleTlE+0qbqXoxM4QO3A+z8/LJExdy3 eV3XRSFi2Q7PCcHJd+ZLaVTe3AvF5uRdxs/Jzb2YnBtGhgn5kBsjpth3pdcEevz9NEtOqn npYSaYeEY+XY0YTd4fKC8Io6emB5Dpavy2fq5A2jh6frbNgep8jgSh27h34WojBtC/W+58 SIhpCunLgtIzfgoiLLmf9fAxC9mrQfqRofVhvH8NKD/rBUcsCSE3Inwdi8SVUB03q4cqrR mqI5S9giMhfrn5eOctzmFySYCkA/oVF/tfYXxHNf5J2KRtziFjS6MWNQOEPRwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751943866; 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=eic4AsYNh4iPHwk7/gEOsZCR3/sWlJWAumU4ebVT5i4=; b=pozEA5HMRYrwF0BrplycCany6d34u7DK3/sOQsATMvY+xvlQEVUSl3fppwafygbqjEhqIa A6q/x1JzNiu4RInHGxlUVA95rAiQbAl1toRxRgrYOYoHCnwn47+0+1J5icRwLOqwaqw3Tr 6r9Jh8ZFfMdBNoQoIias5Y5UcYyRtGLfNR0XnD3/BmMlKI/4rarN93+scNFIfd0vdgL+p0 DytyTh1nwyRGfMuDLox8l5BUp8qTFba3tygVvUTQC+3Xw51i/2AfAGIjL7Ra0E/OTPGnXI AZmJAaeh1u9XXU5olRYcrGFXHvZVg/d5rJi5yO2wz0/AMqM5NDD/bT3hREweCA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751943866; a=rsa-sha256; cv=none; b=GTC9jMW17Clh6tcZvDgIyxNjotD2Yzj4N82X2UmeqFja+zgFi/Ab1YtYrNiZakLXPPaLBi iGHrLYS9nY1s+meltycLtkc8lPBRUEdUEy4SVLCe5HhhJDDwOXprKOt8zJlvlir+E4Q25N mGpyD/EVN98+z3reUd5T6xUgz+BXNoCRpdBFSVvNwAIWTcZUHJx+eFVVMmx/ZlJHGwscDh ZxaEAzbYJHln9vsSSVjdqRkYurbtX8We4WlN3bPxb+Fdca6zy/qfP/LkCdVCfHfX5P4ywF KtTl1NvICyCWaJM6aXE0nKJvzu3/cAZen1HF11bjR33XZ+Fuj5LT//Um8zBdPQ== 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 4bbmDB0jsYz3nt; Tue, 08 Jul 2025 03:04:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56834QvK078467; Tue, 8 Jul 2025 03:04:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56834Pac078464; Tue, 8 Jul 2025 03:04:25 GMT (envelope-from git) Date: Tue, 8 Jul 2025 03:04:25 GMT Message-Id: <202507080304.56834Pac078464@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: e4c864e55505 - main - ip_htable: fix -Wtautological-pointer-compare warnings 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e4c864e5550544e5ff7e395309c5098d84058403 Auto-Submitted: auto-generated The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=e4c864e5550544e5ff7e395309c5098d84058403 commit e4c864e5550544e5ff7e395309c5098d84058403 Author: Siva Mahadevan AuthorDate: 2025-04-24 12:08:47 +0000 Commit: Cy Schubert CommitDate: 2025-07-08 03:02:19 +0000 ip_htable: fix -Wtautological-pointer-compare warnings This also fixes a few other trivial -Wunused-but-set-variable warnings. Pull Request: https://github.com/freebsd/freebsd-src/pull/1677 MFC after: 1 month --- sys/netpfil/ipfilter/netinet/ip_htable.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/sys/netpfil/ipfilter/netinet/ip_htable.c b/sys/netpfil/ipfilter/netinet/ip_htable.c index e54b739df361..91b375f80db1 100644 --- a/sys/netpfil/ipfilter/netinet/ip_htable.c +++ b/sys/netpfil/ipfilter/netinet/ip_htable.c @@ -604,7 +604,7 @@ ipf_htent_remove(ipf_main_softc_t *softc, void *arg, iphtable_t *iph, switch (iph->iph_type & ~IPHASH_ANON) { case IPHASH_GROUPMAP : - if (ipe->ipe_group != NULL) + if (ipe->ipe_ptr != NULL) ipf_group_del(softc, ipe->ipe_ptr, NULL); break; @@ -974,7 +974,6 @@ ipf_htent_find(iphtable_t *iph, iphtent_t *ipeo) { iphtent_t ipe, *ent; u_int hv; - int bits; bcopy((char *)ipeo, (char *)&ipe, sizeof(ipe)); ipe.ipe_addr.i6[0] &= ipe.ipe_mask.i6[0]; @@ -982,7 +981,6 @@ ipf_htent_find(iphtable_t *iph, iphtent_t *ipeo) ipe.ipe_addr.i6[2] &= ipe.ipe_mask.i6[2]; ipe.ipe_addr.i6[3] &= ipe.ipe_mask.i6[3]; if (ipe.ipe_family == AF_INET) { - bits = count4bits(ipe.ipe_mask.in4_addr); ipe.ipe_addr.i6[1] = 0; ipe.ipe_addr.i6[2] = 0; ipe.ipe_addr.i6[3] = 0; @@ -994,7 +992,6 @@ ipf_htent_find(iphtable_t *iph, iphtent_t *ipeo) } else #ifdef USE_INET6 if (ipe.ipe_family == AF_INET6) { - bits = count6bits(ipe.ipe_mask.i6); hv = IPE_V6_HASH_FN(ipe.ipe_addr.i6, ipe.ipe_mask.i6, iph->iph_size); } else From nobody Tue Jul 8 03:04:27 2025 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 4bbmDD0NYvz61KqF; Tue, 08 Jul 2025 03:04:28 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbmDC23DGz3C31; Tue, 08 Jul 2025 03:04:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751943867; 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=WDOcqKcrxxUulvVK3k7ZwRzauonIHcPYgtIoNfixjWY=; b=QBO5057DQ3iQUP52gfhnxzvB/YzFyLX6mtbDQfua+AoNb+axqseYUxLdrVElI0xULD7bwX PcbtQXsuZjpNHWvlwPeLJ6bMLUenlvPD1ZH3TINSItG1vO2LShe6NX6bp7FGj+sqZEU5E9 b9XSXmQ3eGJWgIWD4VxPxt80ijZAzUET50pcI/m6OURZNZcCjk3MPNFyXpw0PTrT+IqAPQ mEq/NexJDiqab9s4RQIeMaf3OLtDeLS7yC9D3s3zu0Q1y6BlsWzLaHohXVJ+vIs3n3Dnt3 6tYkuYHMDJYT6Pwnjy3GPQQ3LIh5vpV79bXRgMe5lLeFNWYW41bbj5fAK8OOEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751943867; 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=WDOcqKcrxxUulvVK3k7ZwRzauonIHcPYgtIoNfixjWY=; b=eBAaIii4oJnXAJiZaCyHk/SqSCQ4bnCjBKYIHj6+o13A/1Pa0CYQdHDZjdejbaESKZHQtq JU4lTScP+GY3EgLXIFnk2FKcsMc7t6CKuB6woo/SvI7HujbMZNtxYjIoRaPzjSO3dA4JLx zzPNq2phjyxpyvLso/Kxl5FIMc3XCjZd2Ck0hCHwW7Z01PxKrMsC85GB4vpHPY8SRrgeXd XfQwTtLMqdT6jttJXUboVy9EkpLjoSvoq/H15KOQy95pMHUrPvg7ho7jsaBsf+Vudd7eBu fU0FZFv6shEDahi9Ps4wyhE74/JPAFNT/xWW2ExQ+IgOmT/ywtmMUr8u0CB3qQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751943867; a=rsa-sha256; cv=none; b=BNsx73yjqynKMO7wsVSWB8pie506ea/J1gTzN7qFMPSM916dT5zXSKD4cOsagKitsWIfNu qZtz6VlN3aCHokfEzcDZ5BhGs+VPbswKBMkslMSg2ysfOBRpLG9aI9vK6rL0Wj8QweIzBX EOI7RzVdm2exADyAE61+PayCyWDSn/nq2hYk5IYLfP7m3cnAMHFdAWf+J0RnOTiHeqTGSY Itk472jvQSZw+8C9/UNZWI64hCXBKT+OZ7Ta4vFmlc6cuORduBSeu5IvuYmzgGbibLZlUC TOO9JHbCqkeASRb9mHJYd6/tcwk3OUE1VroKEBQstZI9Sv5rF7izD1ugDjgFRw== 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 4bbmDC1WPtz3GY; Tue, 08 Jul 2025 03:04:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56834R8F078500; Tue, 8 Jul 2025 03:04:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56834RS0078497; Tue, 8 Jul 2025 03:04:27 GMT (envelope-from git) Date: Tue, 8 Jul 2025 03:04:27 GMT Message-Id: <202507080304.56834RS0078497@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: 2bae5cad793b - main - ip_nat.c: fix non-trivial unused variable warnings 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2bae5cad793bd67c071ade7c7a8ae9d4b34e6b6c Auto-Submitted: auto-generated The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=2bae5cad793bd67c071ade7c7a8ae9d4b34e6b6c commit 2bae5cad793bd67c071ade7c7a8ae9d4b34e6b6c Author: Siva Mahadevan AuthorDate: 2025-04-24 12:08:47 +0000 Commit: Cy Schubert CommitDate: 2025-07-08 03:02:59 +0000 ip_nat.c: fix non-trivial unused variable warnings Pull Request: https://github.com/freebsd/freebsd-src/pull/1677 MFC after: 1 month --- sys/netpfil/ipfilter/netinet/ip_nat.c | 43 +++++++++++------------------------ 1 file changed, 13 insertions(+), 30 deletions(-) diff --git a/sys/netpfil/ipfilter/netinet/ip_nat.c b/sys/netpfil/ipfilter/netinet/ip_nat.c index a13c6129a287..972511f43bd5 100644 --- a/sys/netpfil/ipfilter/netinet/ip_nat.c +++ b/sys/netpfil/ipfilter/netinet/ip_nat.c @@ -3224,13 +3224,10 @@ ipf_nat_finalise(fr_info_t *fin, nat_t *nat) ipf_nat_softc_t *softn = softc->ipf_nat_soft; u_32_t sum1, sum2, sumd; frentry_t *fr; - u_32_t flags; #if SOLARIS && defined(_KERNEL) && defined(ICK_M_CTL_MAGIC) qpktinfo_t *qpi = fin->fin_qpi; #endif - flags = nat->nat_flags; - switch (nat->nat_pr[0]) { case IPPROTO_ICMP : @@ -3538,8 +3535,8 @@ ipf_nat_icmperrorlookup(fr_info_t *fin, int dir) { ipf_main_softc_t *softc = fin->fin_main_soft; ipf_nat_softc_t *softn = softc->ipf_nat_soft; - int flags = 0, type, minlen; - icmphdr_t *icmp, *orgicmp; + int flags = 0, minlen; + icmphdr_t *orgicmp; nat_stat_side_t *nside; tcphdr_t *tcp = NULL; u_short data[2]; @@ -3547,8 +3544,6 @@ ipf_nat_icmperrorlookup(fr_info_t *fin, int dir) ip_t *oip; u_int p; - icmp = fin->fin_dp; - type = icmp->icmp_type; nside = &softn->ipf_nat_stats.ns_side[fin->fin_out]; /* * Does it at least have the return (basic) IP header ? @@ -3999,9 +3994,7 @@ ipf_nat_inlookup(fr_info_t *fin, u_int flags, u_int p, ipf_main_softc_t *softc = fin->fin_main_soft; ipf_nat_softc_t *softn = softc->ipf_nat_soft; u_short sport, dport; - grehdr_t *gre; ipnat_t *ipn; - u_int sflags; nat_t *nat; int nflags; u_32_t dst; @@ -4009,9 +4002,7 @@ ipf_nat_inlookup(fr_info_t *fin, u_int flags, u_int p, u_int hv, rhv; ifp = fin->fin_ifp; - gre = NULL; dst = mapdst.s_addr; - sflags = flags & NAT_TCPUDPICMP; switch (p) { @@ -4330,14 +4321,12 @@ ipf_nat_outlookup(fr_info_t *fin, u_int flags, u_int p, ipf_main_softc_t *softc = fin->fin_main_soft; ipf_nat_softc_t *softn = softc->ipf_nat_soft; u_short sport, dport; - u_int sflags; ipnat_t *ipn; nat_t *nat; void *ifp; u_int hv; ifp = fin->fin_ifp; - sflags = flags & IPN_TCPUDPICMP; switch (p) { @@ -4756,7 +4745,6 @@ ipf_nat_checkout(fr_info_t *fin, u_32_t *passp) struct ifnet *ifp, *sifp; ipf_main_softc_t *softc; ipf_nat_softc_t *softn; - icmphdr_t *icmp = NULL; tcphdr_t *tcp = NULL; int rval, natfailed; u_int nflags = 0; @@ -4802,8 +4790,6 @@ ipf_nat_checkout(fr_info_t *fin, u_32_t *passp) nflags = IPN_UDP; break; case IPPROTO_ICMP : - icmp = fin->fin_dp; - /* * This is an incoming packet, so the destination is * the icmp_id and the source port equals 0 @@ -5463,7 +5449,10 @@ ipf_nat_in(fr_info_t *fin, nat_t *nat, int natadd, u_32_t nflags) { ipf_main_softc_t *softc = fin->fin_main_soft; ipf_nat_softc_t *softn = softc->ipf_nat_soft; - u_32_t sumd, ipsumd, sum1, sum2; + u_32_t sumd, sum1, sum2; +#if !defined(_KERNEL) || SOLARIS + u_32_t ipsumd; +#endif icmphdr_t *icmp; tcphdr_t *tcp; ipnat_t *np; @@ -5499,7 +5488,9 @@ ipf_nat_in(fr_info_t *fin, nat_t *nat, int natadd, u_32_t nflags) ipf_sync_update(softc, SMC_NAT, fin, nat->nat_sync); +#if !defined(_KERNEL) || SOLARIS ipsumd = nat->nat_ipsumd; +#endif /* * Fix up checksums, not by recalculating them, but * simply computing adjustments. @@ -5521,7 +5512,9 @@ ipf_nat_in(fr_info_t *fin, nat_t *nat, int natadd, u_32_t nflags) sum1 = nat->nat_osrcaddr; sum2 = nat->nat_nsrcaddr; CALC_SUMD(sum1, sum2, sumd); +#if !defined(_KERNEL) || SOLARIS ipsumd -= sumd; +#endif } fin->fin_ip->ip_dst = nat->nat_ndstip; fin->fin_daddr = nat->nat_ndstaddr; @@ -5538,7 +5531,9 @@ ipf_nat_in(fr_info_t *fin, nat_t *nat, int natadd, u_32_t nflags) sum1 = nat->nat_odstaddr; sum2 = nat->nat_ndstaddr; CALC_SUMD(sum1, sum2, sumd); +#if !defined(_KERNEL) || SOLARIS ipsumd -= sumd; +#endif } fin->fin_ip->ip_dst = nat->nat_osrcip; fin->fin_daddr = nat->nat_osrcaddr; @@ -7352,30 +7347,18 @@ ipf_nat_nextaddr(fr_info_t *fin, nat_addr_t *na, u_32_t *old, u_32_t *dst) { ipf_main_softc_t *softc = fin->fin_main_soft; ipf_nat_softc_t *softn = softc->ipf_nat_soft; - u_32_t amin, amax, new; + u_32_t new; i6addr_t newip; int error; new = 0; - amin = na->na_addr[0].in4.s_addr; switch (na->na_atype) { case FRI_RANGE : - amax = na->na_addr[1].in4.s_addr; - break; - case FRI_NETMASKED : case FRI_DYNAMIC : case FRI_NORMAL : - /* - * Compute the maximum address by adding the inverse of the - * netmask to the minimum address. - */ - amax = ~na->na_addr[1].in4.s_addr; - amax |= amin; - break; - case FRI_LOOKUP : break; From nobody Tue Jul 8 03:04:28 2025 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 4bbmDD6SX5z61L2y; Tue, 08 Jul 2025 03:04:28 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbmDD4BVpz3C9J; Tue, 08 Jul 2025 03:04:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751943868; 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=VT6Nv5EyoIsiM3RSkzGYUtY84KyqWH8jKt01MGx+80U=; b=MLSkVht1ak7rUqsCTf+9sn8LdENdXgLrJJqWcN76P87Hq8ArjFc6Tw8JqyUZdsg9MvVYXJ huNcx8ohUEk6hkc6By8i+TTDDo6rPh4o/QohdXhZXPNZxXinfpkiJMw+p/SJ/Mvc/ffiy/ RqF2JfqWsOI0NL4DT5znzqnSBANM/0X5kpYL+NgVB+uY4fFbUApj5TDO9PXuFQbDCUBhj9 pd4NVgiH26i28M1Jj9VAuziGyCeZpX2V2hW9B5ZxSzUjxPiSUD6GmN43pz/YjrZVjnPKgN bEAAhCHLTjJ9Zv/jcx5n1CfASqck0i4hs1aUzDdSrKuipb5mgQse1+vkuyLywg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751943868; 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=VT6Nv5EyoIsiM3RSkzGYUtY84KyqWH8jKt01MGx+80U=; b=JTE/GeeOVElqCmle5O1vgk7i3oMqkR3IRPJMesSul6CeD7Onx9ZZHr2fIWfv4MJ36Qk79u KdSq6yK2delsQV5CPgbPbqpd2LMkjmckIuxCNDZ9uCRI3ImGnUFd5ji5/tXZvVW1LNom/6 brI8Z6gFv9dWMsYScMV1lwUszGAOrHjdjvNZvI5vkvRB/Xfc1ZTHHTwpxtXjgsTB1p1kox dDI6nfPowIWpCfRIDwdRhQSNehAKObHYj3JDpnjilRUUGiHVsP75Rp/XxMVTknsWbM5MAu j9rJhrT3pQFgUn++pZgkYcKV8LKYn3AYpc9Y4ArY5QqOtHiBqzk7Un8wygvjFQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751943868; a=rsa-sha256; cv=none; b=RtPp0E4Wab/ddGJUy6y4J3gZpunpXgFIyTd3w6Sp4HxB1LRVJKbAanWEHDZU+5s7TKQMvV 98+TCm0kXCeNZanjnbnKpztRZ8zjOYKXP+Kxu8+Q5/QIz8FHLV1oPjuMQKhfZacLzixall L0IjolR5/nLTc9UUauTTft6FPL05AracO9YK15OjCN9qrXYT9dxd1MkrH8uUzP51Guwf0P 7oTDHP874RIHoPfrnZG06+paksvT0xuSYifbcspQF6H8EPud8TeIJcThhEEUMA4k5VUn8n KBowzQJKlubOjawKz2IVaBq+hYS1LgC+mKcZRyIGQW/nz24r3+m5WFwuTqaqKQ== 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 4bbmDD28Wpz3b7; Tue, 08 Jul 2025 03:04:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56834SuV078533; Tue, 8 Jul 2025 03:04:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56834SEW078530; Tue, 8 Jul 2025 03:04:28 GMT (envelope-from git) Date: Tue, 8 Jul 2025 03:04:28 GMT Message-Id: <202507080304.56834SEW078530@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: 2bbaeb717b69 - main - ip_nat6.c: fix non-trivial unused variable warnings 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2bbaeb717b690f796e751be63a656fb097ef786d Auto-Submitted: auto-generated The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=2bbaeb717b690f796e751be63a656fb097ef786d commit 2bbaeb717b690f796e751be63a656fb097ef786d Author: Siva Mahadevan AuthorDate: 2025-04-24 12:08:47 +0000 Commit: Cy Schubert CommitDate: 2025-07-08 03:03:11 +0000 ip_nat6.c: fix non-trivial unused variable warnings Pull Request: https://github.com/freebsd/freebsd-src/pull/1677 MFC after: 1 month --- sys/netpfil/ipfilter/netinet/ip_nat6.c | 52 +++++++++------------------------- 1 file changed, 14 insertions(+), 38 deletions(-) diff --git a/sys/netpfil/ipfilter/netinet/ip_nat6.c b/sys/netpfil/ipfilter/netinet/ip_nat6.c index dbe19c40c2f2..6d5913177b90 100644 --- a/sys/netpfil/ipfilter/netinet/ip_nat6.c +++ b/sys/netpfil/ipfilter/netinet/ip_nat6.c @@ -1130,9 +1130,6 @@ ipf_nat6_finalise(fr_info_t *fin, nat_t *nat) ipf_nat_softc_t *softn = softc->ipf_nat_soft; u_32_t sum1, sum2, sumd; frentry_t *fr; - u_32_t flags; - - flags = nat->nat_flags; switch (fin->fin_p) { @@ -1355,8 +1352,8 @@ ipf_nat6_icmperrorlookup(fr_info_t *fin, int dir) { ipf_main_softc_t *softc = fin->fin_main_soft; ipf_nat_softc_t *softn = softc->ipf_nat_soft; - struct icmp6_hdr *icmp6, *orgicmp; - int flags = 0, type, minlen; + struct icmp6_hdr *orgicmp; + int flags = 0, minlen; nat_stat_side_t *nside; tcphdr_t *tcp = NULL; u_short data[2]; @@ -1365,8 +1362,6 @@ ipf_nat6_icmperrorlookup(fr_info_t *fin, int dir) u_int p; minlen = 40; - icmp6 = fin->fin_dp; - type = icmp6->icmp6_type; nside = &softn->ipf_nat_stats.ns_side6[fin->fin_out]; /* * Does it at least have the return (basic) IP header ? @@ -1500,9 +1495,8 @@ ipf_nat6_ip6subtract(i6addr_t *ip1, i6addr_t *ip2) i6addr_t l1, l2, d; u_short *s1, *s2, *ds; u_32_t r; - int i, neg; + int i; - neg = 0; l1 = *ip1; l2 = *ip2; s1 = (u_short *)&l1; @@ -1519,7 +1513,6 @@ ipf_nat6_ip6subtract(i6addr_t *ip1, i6addr_t *ip2) } if (s2[0] > s1[0]) { ds[0] = s2[0] + 0x10000 - s1[0]; - neg = 1; } else { ds[0] = s2[0] - s1[0]; } @@ -1869,9 +1862,9 @@ ipf_nat6_inlookup(fr_info_t *fin, u_int flags, u_int p, ipf_main_softc_t *softc = fin->fin_main_soft; ipf_nat_softc_t *softn = softc->ipf_nat_soft; u_short sport, dport; - grehdr_t *gre; +#ifdef IPF_V6_PROXIES ipnat_t *ipn; - u_int sflags; +#endif nat_t *nat; int nflags; i6addr_t dst; @@ -1881,10 +1874,7 @@ ipf_nat6_inlookup(fr_info_t *fin, u_int flags, u_int p, ifp = fin->fin_ifp; sport = 0; dport = 0; - gre = NULL; dst.in6 = *mapdst; - sflags = flags & NAT_TCPUDPICMP; - switch (p) { case IPPROTO_TCP : @@ -1962,8 +1952,8 @@ ipf_nat6_inlookup(fr_info_t *fin, u_int flags, u_int p, if ((nat->nat_flags & IPN_TCPUDP) != 0) { - ipn = nat->nat_ptr; #ifdef IPF_V6_PROXIES + ipn = nat->nat_ptr; if ((ipn != NULL) && (nat->nat_aps != NULL)) if (appr_match(fin, nat) != 0) continue; @@ -2192,14 +2182,14 @@ ipf_nat6_outlookup(fr_info_t *fin, u_int flags, u_int p, ipf_main_softc_t *softc = fin->fin_main_soft; ipf_nat_softc_t *softn = softc->ipf_nat_soft; u_short sport, dport; - u_int sflags; +#ifdef IPF_V6_PROXIES ipnat_t *ipn; +#endif nat_t *nat; void *ifp; u_int hv; ifp = fin->fin_ifp; - sflags = flags & IPN_TCPUDPICMP; sport = 0; dport = 0; @@ -2280,8 +2270,8 @@ ipf_nat6_outlookup(fr_info_t *fin, u_int flags, u_int p, break; } - ipn = nat->nat_ptr; #ifdef IPF_V6_PROXIES + ipn = nat->nat_ptr; if ((ipn != NULL) && (nat->nat_aps != NULL)) if (appr_match(fin, nat) != 0) continue; @@ -2568,7 +2558,6 @@ ipf_nat6_checkout(fr_info_t *fin, u_32_t *passp) ipf_nat_softc_t *softn = softc->ipf_nat_soft; struct icmp6_hdr *icmp6 = NULL; struct ifnet *ifp, *sifp; - tcphdr_t *tcp = NULL; int rval, natfailed; ipnat_t *np = NULL; u_int nflags = 0; @@ -2621,9 +2610,6 @@ ipf_nat6_checkout(fr_info_t *fin, u_32_t *passp) default : break; } - - if ((nflags & IPN_TCPUDP)) - tcp = fin->fin_dp; } ipa = fin->fin_src6; @@ -2965,7 +2951,9 @@ ipf_nat6_checkin(fr_info_t *fin, u_32_t *passp) int rval, natfailed; struct ifnet *ifp; i6addr_t ipa, iph; - tcphdr_t *tcp; +#ifdef IPF_V6_PROXIES + tcphdr_t *tcp = NULL; +#endif u_short dport; ipnat_t *np; nat_t *nat; @@ -2973,7 +2961,6 @@ ipf_nat6_checkin(fr_info_t *fin, u_32_t *passp) if (softn->ipf_nat_stats.ns_rules == 0 || softn->ipf_nat_lock != 0) return (0); - tcp = NULL; icmp6 = NULL; dport = 0; natadd = 1; @@ -3014,7 +3001,9 @@ ipf_nat6_checkin(fr_info_t *fin, u_32_t *passp) } if ((nflags & IPN_TCPUDP)) { +#ifdef IPF_V6_PROXIES tcp = fin->fin_dp; +#endif dport = fin->fin_data[1]; } } @@ -3802,32 +3791,19 @@ ipf_nat6_nextaddr(fr_info_t *fin, nat_addr_t *na, i6addr_t *old, i6addr_t *dst) ipf_main_softc_t *softc = fin->fin_main_soft; ipf_nat_softc_t *softn = softc->ipf_nat_soft; i6addr_t newip, new; - u_32_t amin, amax; int error; new.i6[0] = 0; new.i6[1] = 0; new.i6[2] = 0; new.i6[3] = 0; - amin = na->na_addr[0].in4.s_addr; switch (na->na_atype) { case FRI_RANGE : - amax = na->na_addr[1].in4.s_addr; - break; - case FRI_NETMASKED : case FRI_DYNAMIC : case FRI_NORMAL : - /* - * Compute the maximum address by adding the inverse of the - * netmask to the minimum address. - */ - amax = ~na->na_addr[1].in4.s_addr; - amax |= amin; - break; - case FRI_LOOKUP : break; From nobody Tue Jul 8 03:04:29 2025 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 4bbmDG0xTkz61KsV; Tue, 08 Jul 2025 03:04: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbmDF3dr0z3C0b; Tue, 08 Jul 2025 03:04:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751943869; 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=7539tB2Q2vC29FEXrm93zkWx5GuLjRu6iG8I/Eq2/Yo=; b=iQrjRyQ6HyohspBvfGks/fxGs9/kMgEVuCRPxWydSshh1wBXlNVU1ZZi914dHYGqOma8hz 35dfepd1ckmAj9oPoviQgcXESfOkdG5peTqVzGDLctNpZkUSZfTp+fmFt/m489h6kJir42 pYJ7YRD6wzDPyYuInh8/OkC/pcmemrh3SLbPsjcQIj/a6JDjqvOVU8aMTQ6aTDz9e3LmTJ QyjH6ScG+BGOtPTLGjmOXKzSiNjbLmmwRBxFTPS+OY5eaH3AQIoqR6PfjagXz5b/g+p7rV bIIojYzwfEn41LZk4CbxfqNpFsiH0oqMZF+VX3vDNRFNLTadMPraNA2zIy/TtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751943869; 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=7539tB2Q2vC29FEXrm93zkWx5GuLjRu6iG8I/Eq2/Yo=; b=Fzkaij3cHbmeclHbS9R1/zdC/+UJEgPWjQrIeAhaDlW5PAyiTDTPquT+vjnXc+k8ZvipGn 6dn/9kmPOU7ZF8YnkWGDXyilgMvTGRMqz/QO4fvTh10JgMyarjwl6RPzYK/KVT8K9PYzBl So5Ry2et5S5fg6ZZocpyWOB1Fu6Iepz8ECLyjNFmTSkqAmXMQUAq0fOf4OI2TeiVZQroDT 76z7vQ6Yz3w4iAMabhj+Ys3gnYO2BrNcBTcmUXskQ262zhn3K8X49qQprAmplfzJzAA84J BEQ9Y2NMuxwnXitVmgXnJNIMrERc9YXlzb0GeeSLqkMTrTik7OLEDdLpTfeF5A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751943869; a=rsa-sha256; cv=none; b=O0gj+QJzN5bfAWgcihyekTMQ7CHykC+uQBuV1QMVlR2ID0TgWt2EJG1i2gq9YthXRL7WRj 1S0VSSHJUSHT0eltTnC5WO3KvIUIz7wQf/3iFOWSvO2BnH33C8ceVecgbKdlqsF1VeJbDK pAXxWrQ6J1tmhUvQRU6xvvof0yHXPRMQaxklFmNf3JaR3ggSt0cEu0WZ9nilUTe/c5pVT4 mIlffU8uBsHClklpyez1P+trU0tOkLt21MG/dflKPEZ8lVFLbVQRbMTHtSOTDPkOQV9DRw PeaEBLIfpNM0fho7+zDYeAOhXOCNDOIjdHU1RoRTVLOBSeNXXGX8u3S1J7Be7Q== 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 4bbmDF3Dc4z3GZ; Tue, 08 Jul 2025 03:04:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56834TJS078572; Tue, 8 Jul 2025 03:04:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56834TbQ078570; Tue, 8 Jul 2025 03:04:29 GMT (envelope-from git) Date: Tue, 8 Jul 2025 03:04:29 GMT Message-Id: <202507080304.56834TbQ078570@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: 79d23845179a - main - netpfil/ipfilter: fix remaining trivial unused variable warnings 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 79d23845179a534f533185763cb92032202729a7 Auto-Submitted: auto-generated The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=79d23845179a534f533185763cb92032202729a7 commit 79d23845179a534f533185763cb92032202729a7 Author: Siva Mahadevan AuthorDate: 2025-04-24 12:08:47 +0000 Commit: Cy Schubert CommitDate: 2025-07-08 03:03:20 +0000 netpfil/ipfilter: fix remaining trivial unused variable warnings Pull Request: https://github.com/freebsd/freebsd-src/pull/1677 MFC after: 1 month --- sys/netpfil/ipfilter/netinet/fil.c | 16 +++++----------- sys/netpfil/ipfilter/netinet/ip_ftp_pxy.c | 8 ++++---- sys/netpfil/ipfilter/netinet/ip_ipsec_pxy.c | 4 +--- sys/netpfil/ipfilter/netinet/ip_irc_pxy.c | 7 ++----- sys/netpfil/ipfilter/netinet/ip_lookup.c | 4 +--- sys/netpfil/ipfilter/netinet/ip_netbios_pxy.c | 5 +---- sys/netpfil/ipfilter/netinet/ip_pptp_pxy.c | 5 ----- sys/netpfil/ipfilter/netinet/ip_proxy.c | 4 +--- sys/netpfil/ipfilter/netinet/ip_raudio_pxy.c | 8 ++------ sys/netpfil/ipfilter/netinet/ip_rcmd_pxy.c | 8 +------- sys/netpfil/ipfilter/netinet/ip_rpcb_pxy.c | 8 ++------ sys/netpfil/ipfilter/netinet/ip_state.c | 22 ++-------------------- sys/netpfil/ipfilter/netinet/ip_tftp_pxy.c | 4 +--- sys/netpfil/ipfilter/netinet/ipf_rb.h | 2 -- 14 files changed, 23 insertions(+), 82 deletions(-) diff --git a/sys/netpfil/ipfilter/netinet/fil.c b/sys/netpfil/ipfilter/netinet/fil.c index 2a4feb17dbd3..2fcea433295f 100644 --- a/sys/netpfil/ipfilter/netinet/fil.c +++ b/sys/netpfil/ipfilter/netinet/fil.c @@ -437,7 +437,7 @@ static inline void ipf_pr_ipv6hdr(fr_info_t *fin) { ip6_t *ip6 = (ip6_t *)fin->fin_ip; - int p, go = 1, i, hdrcount; + int p, go = 1, i; fr_ip_t *fi = &fin->fin_fi; fin->fin_off = 0; @@ -464,7 +464,6 @@ ipf_pr_ipv6hdr(fr_info_t *fin) if (IN6_IS_ADDR_MULTICAST(&fi->fi_dst.in6)) fin->fin_flx |= FI_MULTICAST|FI_MBCAST; - hdrcount = 0; while (go && !(fin->fin_flx & FI_SHORT)) { switch (p) { @@ -542,7 +541,6 @@ ipf_pr_ipv6hdr(fr_info_t *fin) go = 0; break; } - hdrcount++; /* * It is important to note that at this point, for the @@ -2590,14 +2588,13 @@ ipf_scanlist(fr_info_t *fin, u_32_t pass) /* functions called from the IPFilter "mainline" in ipf_check(). */ /* ------------------------------------------------------------------------ */ frentry_t * -ipf_acctpkt(fr_info_t *fin, u_32_t *passp) +ipf_acctpkt(fr_info_t *fin, u_32_t *passp __unused) { ipf_main_softc_t *softc = fin->fin_main_soft; char group[FR_GROUPLEN]; frentry_t *fr, *frsave; u_32_t pass, rulen; - passp = passp; fr = softc->ipf_acct[fin->fin_out][softc->ipf_active]; if (fr != NULL) { @@ -4200,7 +4197,7 @@ ipf_getstat(ipf_main_softc_t *softc, friostat_t *fiop, int rev) (rev / 10000) % 100, (rev / 100) % 100); #else - rev = rev; + (void)rev; /* UNUSED */ (void) strncpy(fiop->f_version, ipfilter_version, sizeof(fiop->f_version)); #endif @@ -4408,13 +4405,12 @@ frrequest(ipf_main_softc_t *softc, int unit, ioctlcmd_t req, caddr_t data, OP_ZERO /* zero statistics and counters */ } addrem = OP_ADD; frentry_t frd, *fp, *f, **fprev, **ftail; - void *ptr, *uptr, *cptr; + void *ptr, *uptr; u_int *p, *pp; frgroup_t *fg; char *group; ptr = NULL; - cptr = NULL; fg = NULL; fp = &frd; if (makecopy != 0) { @@ -4532,7 +4528,6 @@ frrequest(ipf_main_softc_t *softc, int unit, ioctlcmd_t req, caddr_t data, } ptr = NULL; - cptr = NULL; if (FR_ISACCOUNT(fp->fr_flags)) unit = IPL_LOGCOUNT; @@ -7314,11 +7309,10 @@ ipf_resolvedest(ipf_main_softc_t *softc, char *base, frdest_t *fdp, int v) /* for both IPv4 and IPv6 on the same physical NIC. */ /* ------------------------------------------------------------------------ */ void * -ipf_resolvenic(ipf_main_softc_t *softc, char *name, int v) +ipf_resolvenic(ipf_main_softc_t *softc __unused, char *name, int v) { void *nic; - softc = softc; /* gcc -Wextra */ if (name[0] == '\0') return (NULL); diff --git a/sys/netpfil/ipfilter/netinet/ip_ftp_pxy.c b/sys/netpfil/ipfilter/netinet/ip_ftp_pxy.c index 482e0b456ae5..8c9317c38326 100644 --- a/sys/netpfil/ipfilter/netinet/ip_ftp_pxy.c +++ b/sys/netpfil/ipfilter/netinet/ip_ftp_pxy.c @@ -219,7 +219,7 @@ ipf_p_ftp_soft_destroy(ipf_main_softc_t *softc, void *arg) int -ipf_p_ftp_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) +ipf_p_ftp_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat __unused) { ftpinfo_t *ftp; ftpside_t *f; @@ -228,8 +228,6 @@ ipf_p_ftp_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) if (ftp == NULL) return (-1); - nat = nat; /* LINT */ - aps->aps_data = ftp; aps->aps_psiz = sizeof(ftpinfo_t); aps->aps_sport = htons(fin->fin_sport); @@ -1715,7 +1713,9 @@ ipf_p_ftp_eprt4(ipf_ftp_softc_t *softf, fr_info_t *fin, ip_t *ip, nat_t *nat, return (0); if (c != delim) return (0); - addr |= addr; +#if 0 + addr |= (addr << 0); +#endif /* * Get the port number diff --git a/sys/netpfil/ipfilter/netinet/ip_ipsec_pxy.c b/sys/netpfil/ipfilter/netinet/ip_ipsec_pxy.c index c6e4be17e22e..d5103c2944dc 100644 --- a/sys/netpfil/ipfilter/netinet/ip_ipsec_pxy.c +++ b/sys/netpfil/ipfilter/netinet/ip_ipsec_pxy.c @@ -341,15 +341,13 @@ ipf_p_ipsec_inout(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) * UDP/TCP port numbers). */ int -ipf_p_ipsec_match(fr_info_t *fin, ap_session_t *aps, nat_t *nat) +ipf_p_ipsec_match(fr_info_t *fin, ap_session_t *aps, nat_t *nat __unused) { ipsec_pxy_t *ipsec; u_32_t cookies[4]; mb_t *m; int off; - nat = nat; /* LINT */ - if ((fin->fin_dlen < sizeof(cookies)) || (fin->fin_flx & FI_FRAG)) return (-1); diff --git a/sys/netpfil/ipfilter/netinet/ip_irc_pxy.c b/sys/netpfil/ipfilter/netinet/ip_irc_pxy.c index 026459299efd..aa9e84be19ed 100644 --- a/sys/netpfil/ipfilter/netinet/ip_irc_pxy.c +++ b/sys/netpfil/ipfilter/netinet/ip_irc_pxy.c @@ -221,7 +221,7 @@ ipf_p_irc_complete(ircinfo_t *ircp, char *buf, size_t len) int -ipf_p_irc_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) +ipf_p_irc_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat __unused) { ircinfo_t *irc; @@ -232,8 +232,6 @@ ipf_p_irc_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) if (irc == NULL) return (-1); - nat = nat; /* LINT */ - aps->aps_data = irc; aps->aps_psiz = sizeof(ircinfo_t); @@ -422,8 +420,7 @@ ipf_p_irc_send(fr_info_t *fin, nat_t *nat) int -ipf_p_irc_out(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) +ipf_p_irc_out(void *arg, fr_info_t *fin, ap_session_t *aps __unused, nat_t *nat) { - aps = aps; /* LINT */ return (ipf_p_irc_send(fin, nat)); } diff --git a/sys/netpfil/ipfilter/netinet/ip_lookup.c b/sys/netpfil/ipfilter/netinet/ip_lookup.c index b46d1b875003..a52dbef00166 100644 --- a/sys/netpfil/ipfilter/netinet/ip_lookup.c +++ b/sys/netpfil/ipfilter/netinet/ip_lookup.c @@ -230,13 +230,11 @@ ipf_lookup_soft_destroy(ipf_main_softc_t *softc, void *arg) /* ------------------------------------------------------------------------ */ int ipf_lookup_ioctl(ipf_main_softc_t *softc, caddr_t data, ioctlcmd_t cmd, - int mode, int uid, void *ctx) + int mode __unused, int uid, void *ctx) { int err; SPL_INT(s); - mode = mode; /* LINT */ - SPL_NET(s); switch (cmd) diff --git a/sys/netpfil/ipfilter/netinet/ip_netbios_pxy.c b/sys/netpfil/ipfilter/netinet/ip_netbios_pxy.c index 2ad642adfbcd..f9c1ab50b8a2 100644 --- a/sys/netpfil/ipfilter/netinet/ip_netbios_pxy.c +++ b/sys/netpfil/ipfilter/netinet/ip_netbios_pxy.c @@ -67,7 +67,7 @@ ipf_p_netbios_main_unload(void) int -ipf_p_netbios_out(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) +ipf_p_netbios_out(void *arg, fr_info_t *fin, ap_session_t *aps __unused, nat_t *nat __unused) { char dgmbuf[6]; int off, dlen; @@ -75,9 +75,6 @@ ipf_p_netbios_out(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) ip_t *ip; mb_t *m; - aps = aps; /* LINT */ - nat = nat; /* LINT */ - m = fin->fin_m; dlen = fin->fin_dlen - sizeof(*udp); /* diff --git a/sys/netpfil/ipfilter/netinet/ip_pptp_pxy.c b/sys/netpfil/ipfilter/netinet/ip_pptp_pxy.c index 0ac19b067d2d..dc4c67dc14f0 100644 --- a/sys/netpfil/ipfilter/netinet/ip_pptp_pxy.c +++ b/sys/netpfil/ipfilter/netinet/ip_pptp_pxy.c @@ -281,7 +281,6 @@ ipf_p_pptp_nextmessage(fr_info_t *fin, nat_t *nat, pptp_pxy_t *pptp, int rev) tcphdr_t *tcp; int dlen, off; u_short len; - char *msg; tcp = fin->fin_dp; dlen = fin->fin_dlen - (TCP_OFF(tcp) << 2); @@ -310,8 +309,6 @@ ipf_p_pptp_nextmessage(fr_info_t *fin, nat_t *nat, pptp_pxy_t *pptp, int rev) return (-1); } - msg = (char *)fin->fin_dp + (TCP_OFF(tcp) << 2); - while (dlen > 0) { off += pptps->pptps_bytes; if (pptps->pptps_gothdr == 0) { @@ -337,7 +334,6 @@ ipf_p_pptp_nextmessage(fr_info_t *fin, nat_t *nat, pptp_pxy_t *pptp, int rev) } } dlen -= len; - msg += len; off += len; pptps->pptps_gothdr = 1; @@ -381,7 +377,6 @@ ipf_p_pptp_nextmessage(fr_info_t *fin, nat_t *nat, pptp_pxy_t *pptp, int rev) pptps->pptps_len = 0; start += len; - msg += len; dlen -= len; } diff --git a/sys/netpfil/ipfilter/netinet/ip_proxy.c b/sys/netpfil/ipfilter/netinet/ip_proxy.c index 9785fc37d3da..9fb6dbd2a9e1 100644 --- a/sys/netpfil/ipfilter/netinet/ip_proxy.c +++ b/sys/netpfil/ipfilter/netinet/ip_proxy.c @@ -679,14 +679,12 @@ ipf_proxy_ok(fr_info_t *fin, tcphdr_t *tcp, ipnat_t *np) /* ------------------------------------------------------------------------ */ int ipf_proxy_ioctl(ipf_main_softc_t *softc, caddr_t data, ioctlcmd_t cmd, - int mode, void *ctx) + int mode __unused, void *ctx) { ap_ctl_t ctl; caddr_t ptr; int error; - mode = mode; /* LINT */ - switch (cmd) { case SIOCPROXY : diff --git a/sys/netpfil/ipfilter/netinet/ip_raudio_pxy.c b/sys/netpfil/ipfilter/netinet/ip_raudio_pxy.c index 2cfaaa58200f..94f0e3ada707 100644 --- a/sys/netpfil/ipfilter/netinet/ip_raudio_pxy.c +++ b/sys/netpfil/ipfilter/netinet/ip_raudio_pxy.c @@ -49,12 +49,10 @@ ipf_p_raudio_main_unload(void) * Setup for a new proxy to handle Real Audio. */ int -ipf_p_raudio_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) +ipf_p_raudio_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat __unused) { raudio_t *rap; - nat = nat; /* LINT */ - if (fin->fin_v != 4) return (-1); @@ -72,7 +70,7 @@ ipf_p_raudio_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) int -ipf_p_raudio_out(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) +ipf_p_raudio_out(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat __unused) { raudio_t *rap = aps->aps_data; unsigned char membuf[512 + 1], *s; @@ -82,8 +80,6 @@ ipf_p_raudio_out(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) int len = 0; mb_t *m; - nat = nat; /* LINT */ - /* * If we've already processed the start messages, then nothing left * for the proxy to do. diff --git a/sys/netpfil/ipfilter/netinet/ip_rcmd_pxy.c b/sys/netpfil/ipfilter/netinet/ip_rcmd_pxy.c index 778f14f442de..b85794e75499 100644 --- a/sys/netpfil/ipfilter/netinet/ip_rcmd_pxy.c +++ b/sys/netpfil/ipfilter/netinet/ip_rcmd_pxy.c @@ -63,18 +63,12 @@ ipf_p_rcmd_main_unload(void) * Setup for a new RCMD proxy. */ int -ipf_p_rcmd_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) +ipf_p_rcmd_new(void *arg, fr_info_t *fin __unused, ap_session_t *aps, nat_t *nat) { tcphdr_t *tcp = (tcphdr_t *)fin->fin_dp; rcmdinfo_t *rc; ipnat_t *ipn; - ipnat_t *np; - int size; - fin = fin; /* LINT */ - - np = nat->nat_ptr; - size = np->in_size; KMALLOC(rc, rcmdinfo_t *); if (rc == NULL) { #ifdef IP_RCMD_PROXY_DEBUG diff --git a/sys/netpfil/ipfilter/netinet/ip_rpcb_pxy.c b/sys/netpfil/ipfilter/netinet/ip_rpcb_pxy.c index f8f4d2d325e1..c608f84d7b3b 100644 --- a/sys/netpfil/ipfilter/netinet/ip_rpcb_pxy.c +++ b/sys/netpfil/ipfilter/netinet/ip_rpcb_pxy.c @@ -144,12 +144,10 @@ ipf_p_rpcb_main_unload(void) /* Allocate resources for per-session proxy structures. */ /* -------------------------------------------------------------------- */ int -ipf_p_rpcb_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) +ipf_p_rpcb_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat __unused) { rpcb_session_t *rs; - nat = nat; /* LINT */ - if (fin->fin_v != 4) return (-1); @@ -1023,10 +1021,8 @@ ipf_p_rpcb_lookup(rpcb_session_t *rs, u_32_t xid) /* Free the RPCB transaction record rx from the chain of entries. */ /* -------------------------------------------------------------------- */ static void -ipf_p_rpcb_deref(rpcb_session_t *rs, rpcb_xact_t *rx) +ipf_p_rpcb_deref(rpcb_session_t *rs __unused, rpcb_xact_t *rx) { - rs = rs; /* LINT */ - if (rx == NULL) return; diff --git a/sys/netpfil/ipfilter/netinet/ip_state.c b/sys/netpfil/ipfilter/netinet/ip_state.c index 8fe11e3f1215..36fdf23cd062 100644 --- a/sys/netpfil/ipfilter/netinet/ip_state.c +++ b/sys/netpfil/ipfilter/netinet/ip_state.c @@ -883,7 +883,7 @@ ipf_state_putent(ipf_main_softc_t *softc, ipf_state_softc_t *softs, { ipstate_t *is, *isn; ipstate_save_t ips; - int error, out, i; + int error, i; frentry_t *fr; char *name; @@ -929,7 +929,6 @@ ipf_state_putent(ipf_main_softc_t *softc, ipf_state_softc_t *softs, return (ENOMEM); } bcopy((char *)&ips.ips_fr, (char *)fr, sizeof(*fr)); - out = fr->fr_flags & FR_OUTQUE ? 1 : 0; isn->is_rule = fr; ips.ips_is.is_rule = fr; MUTEX_NUKE(&fr->fr_lock); @@ -2207,20 +2206,6 @@ ipf_state_tcpinwindow(fr_info_t *fin, tcpdata_t *fdata, tcpdata_t *tdata, (ackskew >= -1) && (ackskew <= 1)) { inseq = 1; } else if (!(flags & IS_TCPFSM)) { - int i; - - i = (fin->fin_rev << 1) + fin->fin_out; - -#if 0 - if (is_pkts[i]0 == 0) { - /* - * Picking up a connection in the middle, the "next" - * packet seen from a direction that is new should be - * accepted, even if it appears out of sequence. - */ - inseq = 1; - } else -#endif if (!(fdata->td_winflags & (TCP_WSCALE_SEEN|TCP_WSCALE_FIRST))) { /* @@ -2616,7 +2601,7 @@ ipf_checkicmpmatchingstate(fr_info_t *fin) icmphdr_t *icmp; fr_info_t ofin; tcphdr_t *tcp; - int type, len; + int len; u_char pr; ip_t *oip; u_int hv; @@ -2634,7 +2619,6 @@ ipf_checkicmpmatchingstate(fr_info_t *fin) return (NULL); } ic = fin->fin_dp; - type = ic->icmp_type; oip = (ip_t *)((char *)ic + ICMPERR_ICMPHLEN); /* @@ -4362,7 +4346,6 @@ ipf_checkicmp6matchingstate(fr_info_t *fin) ip6_t *oip6; u_char pr; u_int hv; - int type; /* * Does it at least have the return (basic) IP header ? @@ -4377,7 +4360,6 @@ ipf_checkicmp6matchingstate(fr_info_t *fin) } ic6 = fin->fin_dp; - type = ic6->icmp6_type; oip6 = (ip6_t *)((char *)ic6 + ICMPERR_ICMPHLEN); if (fin->fin_plen < sizeof(*oip6)) { diff --git a/sys/netpfil/ipfilter/netinet/ip_tftp_pxy.c b/sys/netpfil/ipfilter/netinet/ip_tftp_pxy.c index d81de100120b..3c737b38aacc 100644 --- a/sys/netpfil/ipfilter/netinet/ip_tftp_pxy.c +++ b/sys/netpfil/ipfilter/netinet/ip_tftp_pxy.c @@ -151,7 +151,7 @@ ipf_p_tftp_in(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) int -ipf_p_tftp_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) +ipf_p_tftp_new(void *arg, fr_info_t *fin __unused, ap_session_t *aps, nat_t *nat) { udphdr_t *udp; tftpinfo_t *ti; @@ -159,8 +159,6 @@ ipf_p_tftp_new(void *arg, fr_info_t *fin, ap_session_t *aps, nat_t *nat) ipnat_t *np; int size; - fin = fin; /* LINT */ - np = nat->nat_ptr; size = np->in_size; diff --git a/sys/netpfil/ipfilter/netinet/ipf_rb.h b/sys/netpfil/ipfilter/netinet/ipf_rb.h index e047c7f44a4a..334311502aab 100644 --- a/sys/netpfil/ipfilter/netinet/ipf_rb.h +++ b/sys/netpfil/ipfilter/netinet/ipf_rb.h @@ -305,13 +305,11 @@ _n##_rb_walktree(struct _n##_rb_head *head, _n##_rb_walker_t func, void *arg)\ _t *prev; \ _t *next; \ _t *node = head->top._f.right; \ - _t *base; \ \ while (node != &_n##_rb_zero) \ node = node->_f.left; \ \ for (;;) { \ - base = node; \ prev = node; \ while ((node->_f.parent->_f.right == node) && \ (node != &_n##_rb_zero)) { \ From nobody Tue Jul 8 03:04:30 2025 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 4bbmDH1sLTz61L33; Tue, 08 Jul 2025 03:04:31 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbmDG5QfJz3CG0; Tue, 08 Jul 2025 03:04:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751943870; 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=LRb7sDdiQfiRqcXshI8Ui4gBOKvi0ylSfprDG8XO9/U=; b=K+MgQi5IyQHAjW402/GnwBjKI7ARVdNFyBZ1ksADZbEJr9vxJovM0Ewl6c0pMe+mVoiF/5 LROkp8Yi8Na1OjQGJevcTGqJV0C1/xloBPapl6t66VBMVI9B6AVI6D72YXjbIe+T6pD8u/ VJZlVJfgi0VwFsogguKSu7kekthLTs+Yt1hDmg4NBj/W3ifXtErGh27wslL8hRsUadg0KW pjlCEvi6Lfr3RhJnb7juw02xXpklhJZYLzVqJWRghcypR2EtepBGc7MPJ2DsGLpjeReXAL MASC+slCcWeFB7UQFsadMF9d+ZocUm6hYvcMdGJ1XBnkVxzgxwC5+XbPsuOgVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751943870; 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=LRb7sDdiQfiRqcXshI8Ui4gBOKvi0ylSfprDG8XO9/U=; b=lzHImP6ZbB3clRTICAgi4B11rkuy3eBG2MqFskoDZN9CiDQ9KYp3maVGHBRfdWetiPq0Tb BBMXll9ePfoHxNHzlnA/mo00g1h8nZb+ueaEIvzAFHFO5JN6QYS7j7ZP1/gGjbWcb6lUfH CfyH+SdHKBe9V1FCEkUqsbnuV82Ymd9yOSRwHL77gbu5CE7qlbeDR1U4mte+BP9VkXjjS8 ZsN3tPsO0OR8a0RdWRpMxhUNDJ97F1LLbtyaXWvTj8XlHQrypjT9/7nbEFGwZVOG5SzefK pPicqtjrj1sxeItjc2yq9UB2rK/4gS437jKEHwzm4Tk9TnrEHhVhS1vXkpIp4g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751943870; a=rsa-sha256; cv=none; b=LiNci+QuuahT7fxcDX2eBgJDVk/Bru8dbPh7Edmi3AgG7SVSiDh02XyjcvslBqJdmtMY61 rvBgyT+7yZERCTsv1jV9qCyYIzzFToUwVzDCX9PEavu+cIsjLILABRqm8IL4NieLTf+0Ys fEDAoxYa5oBpzJRGP2XUZbvfBh8QXcwNZjGMyNSTbb4OCq5vxN2nTQ0GHiItYuMEwq+Km3 C47fz9iHqkNk3M51Ou0az5sODX9DMtcMDbL0jA12XgvvLtBzZbjk8z/O5aae8M/3cHj1BB eEwwvQe+1bpftUsy4G7YhOOUZConJsQl9FHzGIqurvGOpgLMhyir/NzEXVruvg== 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 4bbmDG4xpRz3YS; Tue, 08 Jul 2025 03:04:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56834Uqv078607; Tue, 8 Jul 2025 03:04:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56834Um9078604; Tue, 8 Jul 2025 03:04:30 GMT (envelope-from git) Date: Tue, 8 Jul 2025 03:04:30 GMT Message-Id: <202507080304.56834Um9078604@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: 45730dd3ed33 - main - files: add new IPFILTER_C rule for netpfil/ipfilter sources 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 45730dd3ed334d265fc77cf6df1f82013fd5bf69 Auto-Submitted: auto-generated The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=45730dd3ed334d265fc77cf6df1f82013fd5bf69 commit 45730dd3ed334d265fc77cf6df1f82013fd5bf69 Author: Siva Mahadevan AuthorDate: 2025-04-24 12:08:47 +0000 Commit: Cy Schubert CommitDate: 2025-07-08 03:03:33 +0000 files: add new IPFILTER_C rule for netpfil/ipfilter sources This re-enables all compiler warnings for these sources. Pull Request: https://github.com/freebsd/freebsd-src/pull/1677 MFC after: 1 month --- sys/conf/files | 54 ++++++++++++++++++---------------------------------- sys/conf/kern.pre.mk | 4 ++++ 2 files changed, 22 insertions(+), 36 deletions(-) diff --git a/sys/conf/files b/sys/conf/files index 866901ba4c51..74d251c2b608 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -598,42 +598,24 @@ contrib/dev/acpica/components/utilities/utxface.c optional acpi contrib/dev/acpica/components/utilities/utxferror.c optional acpi contrib/dev/acpica/components/utilities/utxfinit.c optional acpi contrib/dev/acpica/os_specific/service_layers/osgendbg.c optional acpi acpi_debug -netpfil/ipfilter/netinet/fil.c optional ipfilter inet \ - compile-with "${NORMAL_C} ${NO_WSELF_ASSIGN} -Wno-unused -I$S/netpfil/ipfilter" -netpfil/ipfilter/netinet/ip_auth.c optional ipfilter inet \ - compile-with "${NORMAL_C} -Wno-unused -I$S/netpfil/ipfilter" -netpfil/ipfilter/netinet/ip_fil_freebsd.c optional ipfilter inet \ - compile-with "${NORMAL_C} -Wno-unused -I$S/netpfil/ipfilter" -netpfil/ipfilter/netinet/ip_frag.c optional ipfilter inet \ - compile-with "${NORMAL_C} -Wno-unused -I$S/netpfil/ipfilter" -netpfil/ipfilter/netinet/ip_log.c optional ipfilter inet \ - compile-with "${NORMAL_C} -I$S/netpfil/ipfilter" -netpfil/ipfilter/netinet/ip_nat.c optional ipfilter inet \ - compile-with "${NORMAL_C} -Wno-unused -I$S/netpfil/ipfilter" -netpfil/ipfilter/netinet/ip_proxy.c optional ipfilter inet \ - compile-with "${NORMAL_C} ${NO_WSELF_ASSIGN} -Wno-unused -I$S/netpfil/ipfilter" -netpfil/ipfilter/netinet/ip_state.c optional ipfilter inet \ - compile-with "${NORMAL_C} -Wno-unused -I$S/netpfil/ipfilter" -netpfil/ipfilter/netinet/ip_lookup.c optional ipfilter inet \ - compile-with "${NORMAL_C} ${NO_WSELF_ASSIGN} -Wno-unused -Wno-error -I$S/netpfil/ipfilter" -netpfil/ipfilter/netinet/ip_pool.c optional ipfilter inet \ - compile-with "${NORMAL_C} -Wno-unused -I$S/netpfil/ipfilter" -netpfil/ipfilter/netinet/ip_htable.c optional ipfilter inet \ - compile-with "${NORMAL_C} -Wno-unused -I$S/netpfil/ipfilter ${NO_WTAUTOLOGICAL_POINTER_COMPARE}" -netpfil/ipfilter/netinet/ip_sync.c optional ipfilter inet \ - compile-with "${NORMAL_C} -Wno-unused -I$S/netpfil/ipfilter" -netpfil/ipfilter/netinet/mlfk_ipl.c optional ipfilter inet \ - compile-with "${NORMAL_C} -I$S/netpfil/ipfilter" -netpfil/ipfilter/netinet/ip_nat6.c optional ipfilter inet \ - compile-with "${NORMAL_C} -Wno-unused -I$S/netpfil/ipfilter" -netpfil/ipfilter/netinet/ip_rules.c optional ipfilter inet \ - compile-with "${NORMAL_C} -I$S/netpfil/ipfilter" -netpfil/ipfilter/netinet/ip_scan.c optional ipfilter inet \ - compile-with "${NORMAL_C} -Wno-unused -I$S/netpfil/ipfilter" -netpfil/ipfilter/netinet/ip_dstlist.c optional ipfilter inet \ - compile-with "${NORMAL_C} -Wno-unused -I$S/netpfil/ipfilter" -netpfil/ipfilter/netinet/radix_ipf.c optional ipfilter inet \ - compile-with "${NORMAL_C} -I$S/netpfil/ipfilter" +netpfil/ipfilter/netinet/fil.c optional ipfilter inet compile-with "${IPFILTER_C}" +netpfil/ipfilter/netinet/ip_auth.c optional ipfilter inet compile-with "${IPFILTER_C}" +netpfil/ipfilter/netinet/ip_fil_freebsd.c optional ipfilter inet compile-with "${IPFILTER_C}" +netpfil/ipfilter/netinet/ip_frag.c optional ipfilter inet compile-with "${IPFILTER_C}" +netpfil/ipfilter/netinet/ip_log.c optional ipfilter inet compile-with "${IPFILTER_C}" +netpfil/ipfilter/netinet/ip_nat.c optional ipfilter inet compile-with "${IPFILTER_C}" +netpfil/ipfilter/netinet/ip_proxy.c optional ipfilter inet compile-with "${IPFILTER_C}" +netpfil/ipfilter/netinet/ip_state.c optional ipfilter inet compile-with "${IPFILTER_C}" +netpfil/ipfilter/netinet/ip_lookup.c optional ipfilter inet compile-with "${IPFILTER_C}" +netpfil/ipfilter/netinet/ip_pool.c optional ipfilter inet compile-with "${IPFILTER_C}" +netpfil/ipfilter/netinet/ip_htable.c optional ipfilter inet compile-with "${IPFILTER_C}" +netpfil/ipfilter/netinet/ip_sync.c optional ipfilter inet compile-with "${IPFILTER_C}" +netpfil/ipfilter/netinet/mlfk_ipl.c optional ipfilter inet compile-with "${IPFILTER_C}" +netpfil/ipfilter/netinet/ip_nat6.c optional ipfilter inet compile-with "${IPFILTER_C}" +netpfil/ipfilter/netinet/ip_rules.c optional ipfilter inet compile-with "${IPFILTER_C}" +netpfil/ipfilter/netinet/ip_scan.c optional ipfilter inet compile-with "${IPFILTER_C}" +netpfil/ipfilter/netinet/ip_dstlist.c optional ipfilter inet compile-with "${IPFILTER_C}" +netpfil/ipfilter/netinet/radix_ipf.c optional ipfilter inet compile-with "${IPFILTER_C}" contrib/libfdt/fdt.c optional fdt contrib/libfdt/fdt_ro.c optional fdt contrib/libfdt/fdt_rw.c optional fdt diff --git a/sys/conf/kern.pre.mk b/sys/conf/kern.pre.mk index e6e42b33a9b7..78178065e15b 100644 --- a/sys/conf/kern.pre.mk +++ b/sys/conf/kern.pre.mk @@ -290,6 +290,10 @@ BNXT_CFLAGS= -I$S/dev/bnxt/bnxt_en ${OFEDCFLAGS} BNXT_C_NOIMP= ${CC} -c -o ${.TARGET} ${BNXT_CFLAGS} ${WERROR} BNXT_C= ${BNXT_C_NOIMP} ${.IMPSRC} +# IP Filter +IPFILTER_CFLAGS= -I$S/netpfil/ipfilter +IPFILTER_C= ${NORMAL_C} ${IPFILTER_CFLAGS} + GEN_CFILES= $S/$M/$M/genassym.c ${MFILES:T:S/.m$/.c/} SYSTEM_CFILES= config.c env.c hints.c vnode_if.c SYSTEM_DEP= Makefile ${SYSTEM_OBJS} From nobody Tue Jul 8 04:28:25 2025 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 4bbp591NbPz61VDc; Tue, 08 Jul 2025 04:28:29 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta004.cacentral1.a.cloudfilter.net (omta002.cacentral1.a.cloudfilter.net [3.97.99.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbp584B1Pz49LW; Tue, 08 Jul 2025 04:28:28 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; none Received: from shw-obgw-4004a.ext.cloudfilter.net ([10.228.9.227]) by cmsmtp with ESMTPS id YygXuhMHY5MqyYzwRuY7pg; Tue, 08 Jul 2025 04:28:27 +0000 Received: from spqr.komquats.com ([70.66.136.217]) by cmsmtp with ESMTPSA id YzwQumImLJhBPYzwQuLY7M; Tue, 08 Jul 2025 04:28:27 +0000 X-Auth-User: cschuber X-Authority-Analysis: v=2.4 cv=QY3Fvdbv c=1 sm=1 tr=0 ts=686c9e6b a=h7br+8Ma+Xn9xscxy5znUg==:117 a=h7br+8Ma+Xn9xscxy5znUg==:17 a=kj9zAlcOel0A:10 a=Wb1JkmetP80A:10 a=6I5d2MoRAAAA:8 a=EkcXrb_YAAAA:8 a=S-1b6JwnAAAA:8 a=YxBL1-UpAAAA:8 a=Y9XXBGl_wdZf-F10BAYA:9 a=CjuIK1q_8ugA:10 a=LK5xJRSDVpKd5WXXoEvA:22 a=jHPkhvgQCurpnRnmkKlz:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id 7103EEC; Mon, 07 Jul 2025 21:28:25 -0700 (PDT) Received: by slippy.cwsent.com (Postfix, from userid 1000) id 669BF20E; Mon, 07 Jul 2025 21:28:25 -0700 (PDT) X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.8+dev Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: "Herbert J. Skuhra" cc: Cy Schubert , Dima Panov , Cy Schubert , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 7e35117eb07f - main - Makefile: Hook MIT KRB5 into the build In-reply-to: References: <202506160251.55G2pwx4063231@gitrepo.freebsd.org> <20250620073050.7f03f74e@slippy> <20250707230446.F279E3A1@slippy.cwsent.com> Comments: In-reply-to "Herbert J. Skuhra" message dated "Tue, 08 Jul 2025 03:18:23 +0200." 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 07 Jul 2025 21:28:25 -0700 Message-Id: <20250708042825.669BF20E@slippy.cwsent.com> X-CMAE-Envelope: MS4xfOdx1inv1ZxtqQ869X4bNLJ2ONGr44BoYLBfxgtHgNmP2+s2qFImO+QgGuPzhOqmfCQ9r7nCM+sXW55lN7O1QhU/zTANq0c/L789whyW8e1TYC0tLa3+ OSYwd2gzP1KAC8/ovjMNZL56ybsqoLj6ToJi8z31qzskAWRJpO9FTTK5rgTolvru7CJYJGJfRYYyRKKtbYOQpqGRHe9RBzTWh/5HKYSXi0X0TiwsbE7E6W8I bIxOaxtAj+N1PssgQnxIM5RYh6XzQff70rZt9UpB7o6iJr98hWRz3pvfUuxdmGcrmo91FmH43KDIen7aR+NGghe/z3S2bco3pTEcmpF07vwOadEDfBrQX7Vy lktiW8rLRRnSNDu53DwYapaIuTwS9g== X-Rspamd-Queue-Id: 4bbp584B1Pz49LW X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:16509, ipnet:3.96.0.0/15, country:US] In message , "Herbert J. Skuhra" writes: > On Mon, Jul 07, 2025 at 04:04:46PM -0700, Cy Schubert wrote: > > In message , "Herbert J. Skuhra" writes: > > > On Mon, Jul 07, 2025 at 10:36:31PM +0300, Dima Panov wrote: > > > > Hello! > > > > > > > > > > > > BTW, it looks like symlink for libkadm5clnt.so is broken and produced a > bad > > > file > > > > $ ls -la libkadm5clnt > > > > lrwxr-xr-x 1 root wheel 13 7 Jul 20:40 libkadm5clnt -> kadm5clnt_mit > > > > > > > > instead of assumed libkadm5clnt.so -> kadm5clnt_mit.so > > > > > > > > > > > > Please review: > > > > > > > > diff --git a/krb5/lib/kadm5clnt/Makefile b/krb5/lib/kadm5clnt/Makefile > > > > index e377f95f5b6e..be09dd3e210e 100644 > > > > --- a/krb5/lib/kadm5clnt/Makefile > > > > +++ b/krb5/lib/kadm5clnt/Makefile > > > > @@ -88,7 +88,7 @@ ${CHPASS_UTIL_STRINGS_ERR_C}: ${CHPASS_UTIL_STRINGS_E > RR} > > > > rm -f et-c-${.PREFIX}.et et-c-${.PREFIX}.c > > > > > > > > afterinstall: > > > > - ${INSTALL_LIBSYMLINK} ${SHLIB} ${DESTDIR}${LIBDIR}/libkadm5clnt > > > > + ${INSTALL_LIBSYMLINK} ${SHLIB_NAME} ${DESTDIR}${LIBDIR}/libkadm > 5cln > > > t.so > > > > > > > > .include > > > > > > This produces a valid symlink that 'make delete-old' wants to > > > remove again: > > > > > > lrwxr-xr-x 1 root wheel 23 Jul 7 22:26 /usr/lib/libkadm5clnt.so -> > > > libkadm5clnt_mit.so.121 > > > > > > # make delete-old > > > >>> Removing old files (only deletes safe to delete libs) > > > remove /usr/lib/libkadm5clnt.so? > > > > Thanks Dima and Herbert for reporting this. It's been fixed. > > Cy, I am sorry for not being more precise. > > Dima's change, which hasn't been commited yet, fixes the real issue of > creating a bad symlink. > > I just wanted to add that his fix also needs removal of > usr/lib/libkadm5clnt.so in tools/build/mk/OptionalObsoleteFiles.inc. > > Maybe usr/lib/libkadm5clnt should be added to OptionalObsoleteFiles.inc? libkadm5clnt.so is a legitimate symlink for both MIT and Heimdal. In the case of Heimdal it points to libkadm5clnt.so.11. Whereas for MIT it points to libkadm5clnt_mit.so.121. There is o libkadm5clnt in MIT. It is libkadm5clnt_mit. You can see this in the port with pkg info -l as follows: slippy$ pkg info -l krb5 | grep libkadm5clnt /usr/local/lib/libkadm5clnt.so /usr/local/lib/libkadm5clnt_mit.so /usr/local/lib/libkadm5clnt_mit.so.12 /usr/local/lib/libkadm5clnt_mit.so.12.0 slippy$ -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e**(i*pi)+1=0 From nobody Tue Jul 8 06:03:00 2025 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 4bbrBG5cFdz61h3l; Tue, 08 Jul 2025 06:03:02 +0000 (UTC) (envelope-from herbert@gojira.at) Received: from mail.bsd4all.net (mail.bsd4all.net [94.130.200.20]) (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 mx1.freebsd.org (Postfix) with ESMTPS id 4bbrBG1WFNz3nTn; Tue, 08 Jul 2025 06:03:02 +0000 (UTC) (envelope-from herbert@gojira.at) Authentication-Results: mx1.freebsd.org; none Date: Tue, 8 Jul 2025 08:03:00 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=gojira.at; s=mail202005; t=1751954580; bh=qLIvuLYlOuv7tFrDyCNfrouZvOi/S0wwd7M6jovdamk=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type; b=Q1PLETA0/a/jZb9ctRSIV2lJjluqIZevgd8KriYohYPrgFW7PkNzfI434GkqkXQF+ WR/Yx8dg8Ab81hwv0NiYcI8DkDsLQYCKmMQ9sB3vBF++eCwncrNa76G1fmQiU+TOlP REinvUTM77z2I+18CK03S6sia7Yr1mceurCf/pPuILE5vNxXVSOlqeLKI8x7eyX4ny 6iGQ/GF6AvYFCiE9KQsqtAxC+fAJwphdAreIX0xfmxgIrxvUF5Ec/ycd7pzt1rqJET fP7pIZIRSlaxLVqkm00fLIUkwCZvQhJk/m9wVb555FD5ITTNZPRagEu1LTtLP8/J4c m67y1FMR/pBYg== From: "Herbert J. Skuhra" To: Cy Schubert Cc: Dima Panov , Cy Schubert , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 7e35117eb07f - main - Makefile: Hook MIT KRB5 into the build Message-ID: References: <202506160251.55G2pwx4063231@gitrepo.freebsd.org> <20250620073050.7f03f74e@slippy> <20250707230446.F279E3A1@slippy.cwsent.com> <20250708042825.669BF20E@slippy.cwsent.com> 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250708042825.669BF20E@slippy.cwsent.com> X-Rspamd-Queue-Id: 4bbrBG1WFNz3nTn X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:24940, ipnet:94.130.0.0/16, country:DE] On Mon, Jul 07, 2025 at 09:28:25PM -0700, Cy Schubert wrote: > In message , "Herbert J. Skuhra" writes: > > On Mon, Jul 07, 2025 at 04:04:46PM -0700, Cy Schubert wrote: > > > In message , "Herbert J. Skuhra" writes: > > > > On Mon, Jul 07, 2025 at 10:36:31PM +0300, Dima Panov wrote: > > > > > Hello! > > > > > > > > > > > > > > > BTW, it looks like symlink for libkadm5clnt.so is broken and produced a > > bad > > > > file > > > > > $ ls -la libkadm5clnt > > > > > lrwxr-xr-x 1 root wheel 13 7 Jul 20:40 libkadm5clnt -> kadm5clnt_mit > > > > > > > > > > instead of assumed libkadm5clnt.so -> kadm5clnt_mit.so > > > > > > > > > > > > > > > Please review: > > > > > > > > > > diff --git a/krb5/lib/kadm5clnt/Makefile b/krb5/lib/kadm5clnt/Makefile > > > > > index e377f95f5b6e..be09dd3e210e 100644 > > > > > --- a/krb5/lib/kadm5clnt/Makefile > > > > > +++ b/krb5/lib/kadm5clnt/Makefile > > > > > @@ -88,7 +88,7 @@ ${CHPASS_UTIL_STRINGS_ERR_C}: ${CHPASS_UTIL_STRINGS_E > > RR} > > > > > rm -f et-c-${.PREFIX}.et et-c-${.PREFIX}.c > > > > > > > > > > afterinstall: > > > > > - ${INSTALL_LIBSYMLINK} ${SHLIB} ${DESTDIR}${LIBDIR}/libkadm5clnt > > > > > + ${INSTALL_LIBSYMLINK} ${SHLIB_NAME} ${DESTDIR}${LIBDIR}/libkadm > > 5cln > > > > t.so > > > > > > > > > > .include > > > > > > > > This produces a valid symlink that 'make delete-old' wants to > > > > remove again: > > > > > > > > lrwxr-xr-x 1 root wheel 23 Jul 7 22:26 /usr/lib/libkadm5clnt.so -> > > > > libkadm5clnt_mit.so.121 > > > > > > > > # make delete-old > > > > >>> Removing old files (only deletes safe to delete libs) > > > > remove /usr/lib/libkadm5clnt.so? > > > > > > Thanks Dima and Herbert for reporting this. It's been fixed. > > > > Cy, I am sorry for not being more precise. > > > > Dima's change, which hasn't been commited yet, fixes the real issue of > > creating a bad symlink. > > > > I just wanted to add that his fix also needs removal of > > usr/lib/libkadm5clnt.so in tools/build/mk/OptionalObsoleteFiles.inc. > > > > Maybe usr/lib/libkadm5clnt should be added to OptionalObsoleteFiles.inc? ^^^ no .so And maybe ObsoleteFiles.inc is the correct file to add this entry to. > libkadm5clnt.so is a legitimate symlink for both MIT and Heimdal. In the > case of Heimdal it points to libkadm5clnt.so.11. Whereas for MIT it points > to libkadm5clnt_mit.so.121. There is o libkadm5clnt in MIT. It is > libkadm5clnt_mit. You can see this in the port with pkg info -l as follows: > > slippy$ pkg info -l krb5 | grep libkadm5clnt > /usr/local/lib/libkadm5clnt.so > /usr/local/lib/libkadm5clnt_mit.so > /usr/local/lib/libkadm5clnt_mit.so.12 > /usr/local/lib/libkadm5clnt_mit.so.12.0 > slippy$ Without Dima's fix the following symlink is created: lrwxr-xr-x 1 root wheel 13 Jul 8 02:51 /usr/lib/libkadm5clnt -> kadm5clnt_mit No .so extension and /usr/lib/kadm5clnt_mit does not exist. $ file /usr/lib/libkadm5clnt /usr/lib/libkadm5clnt: broken symbolic link to kadm5clnt_mit With Dima's fix the following symlink is created: lrwxr-xr-x 1 root wheel 23 Jul 8 03:11 /usr/lib/libkadm5clnt.so -> libkadm5clnt_mit.so.121 This fix hasn't been committed yet. Commit aad5020c709ac4231af88d4b74588a28f87c9497 only removed /usr/lib/libkadm5clnt.so from OptionalObsoleteFiles. In my previous e-mail I was only suggesting to remove the broken symlink: usr/lib/libkadm5clnt. I really hope I don't add more confusion to this issue. From nobody Tue Jul 8 10:05:07 2025 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 4bbxYc0fvWz60j5B; Tue, 08 Jul 2025 10:05:08 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbxYb6thqz3Fp7; Tue, 08 Jul 2025 10:05:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751969108; 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=I0bt7bDpoRyWv1/ICXd0gRsoQejDL1nkPG4BmjmvulQ=; b=Omy/fGQQR+n2+ZQUV1zO+kDB4INRPgGmeYMUEzOeC9qb5BBby7lRzHmpfMv2iijsLUUICD PE3dbiURPYOVhrr0lhU4B4fAslsARP1wsXfVvBlH4LafK0lPoM55IV1v64cRT8ZFLA0ZZ4 gYGS49eqpInF/32kg9LEWMiisvje/s/GT+hxTnO4Dy8xqyB7BVp9Z6F/TuYAW5YHQZCcZl ibY8h15BEMqmI0MZE7AfFiXE6HT0NXi+Ls/hFY8otsi92SUX6PVRzGfoQiWtlrQddA7IcY buEpjEE+jnK6cIkherLaHhOvjjO2ipdxj+rRZJdTRoFsqN/f9vWSXNqysQSPCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751969108; 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=I0bt7bDpoRyWv1/ICXd0gRsoQejDL1nkPG4BmjmvulQ=; b=YIEdEbzltpzaQRMhH+VumIqUnftmnONq8H0u1tqBVW8EsE79SDKxv29dhGQstGmJD8gY6j L3FCNpKFOEpy62Nv4pZhhffDjGsrfL/P8gvleEzM6ndkYzPaEZcouu7/Ff4GGpWe0DVbn5 8mtoL8pW/m6zid75MQ7KF1dAdKtEjYpr9M8nd9tBSY9NqUVLo69D3C2kxheYKNpFsUh7iV rytY5ZTRMHft0KsQWpxlOtuEj/55gnJnhQuPJi5Ovgrm0aB1A1l8VXDzZdvUatPOY5t8E+ CQRhOu1up3ZUXPAhdkWkSNkfIFBtEetHtMflz35q/FPrzrTUxUrOt2LWQMGJwg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751969108; a=rsa-sha256; cv=none; b=izOK7dIiA4knDPMHhQxE5KXwykzQraigIcVddK9ePa6oSR4tvXyPNMJaz9qskozDpbBLAq sd4fwIKFYHEM03nxUYknPFBcoMst1j9lO/KEWGavXuqxTjPuTAfgLymMPQJ197Tb/gP5vI JjUJm3ZoAcxxQ6boUarkOjKGblEjWGSJnobM/cvv+92U7h2lBzuWTN9je2u8VHThYDClfe xhoDr3Ipa1Kf0X8fwzBNVvaWpLG4M610J5LhEfcGbGvWHERdEf331hSvHZ0B4oqHNN7ZCZ kLF2xrfti4ejVL1pMxewYXoxGqLWiuyr7fdkidtu3zVAse7uYdzzzXtHTWWkoQ== 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 4bbxYb6HYtzXnv; Tue, 08 Jul 2025 10:05:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 568A57GI067402; Tue, 8 Jul 2025 10:05:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 568A57fo067399; Tue, 8 Jul 2025 10:05:07 GMT (envelope-from git) Date: Tue, 8 Jul 2025 10:05:07 GMT Message-Id: <202507081005.568A57fo067399@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 2db01aea744f - stable/13 - pfsync: Remove a redundant assignment of if_type 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2db01aea744fcbae5d11bec6e42410e9acb58508 Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=2db01aea744fcbae5d11bec6e42410e9acb58508 commit 2db01aea744fcbae5d11bec6e42410e9acb58508 Author: Zhenlei Huang AuthorDate: 2025-06-16 14:12:03 +0000 Commit: Zhenlei Huang CommitDate: 2025-07-08 10:03:28 +0000 pfsync: Remove a redundant assignment of if_type On initializing the interface, if_alloc(IFT_PFSYNC) has set if_type already. No functional change intended. MFC after: 1 week (cherry picked from commit 48af70e7c82150942fd095a38131e454e47ad162) (cherry picked from commit 082a6da890f3487f1465c0757784798ebe38ef84) --- sys/netpfil/pf/if_pfsync.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/netpfil/pf/if_pfsync.c b/sys/netpfil/pf/if_pfsync.c index 8044f302ed35..412739513472 100644 --- a/sys/netpfil/pf/if_pfsync.c +++ b/sys/netpfil/pf/if_pfsync.c @@ -346,7 +346,6 @@ pfsync_clone_create(struct if_clone *ifc, int unit, caddr_t param) ifp->if_softc = sc; ifp->if_ioctl = pfsyncioctl; ifp->if_output = pfsyncoutput; - ifp->if_type = IFT_PFSYNC; ifp->if_hdrlen = sizeof(struct pfsync_header); ifp->if_mtu = ETHERMTU; mtx_init(&sc->sc_mtx, pfsyncname, NULL, MTX_DEF); From nobody Tue Jul 8 10:05:06 2025 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 4bbxYZ751Lz60hym; Tue, 08 Jul 2025 10:05:06 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbxYZ6CJTz3Fp5; Tue, 08 Jul 2025 10:05:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751969106; 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=A0QDfw+yf8k6ww1q5j6GR/oEvHiIvCVKTxOscmfipnU=; b=A7H3gbOmlmZ5tGmmIypMLP0qrXP7uMUfO9CI/TARpVmENFV0PZu/zex4KCjSRdxgZhxK6/ zS4agIMDZKU6UsGBHOpC7USECqT7SXfW2Jl9WuBPUIaP7iFrkwn7dVVWV2JH23NpZC7T/i P9BC6XakGf+OgjBWLDlgiVSNmgE+tqII8usBY11aaRBNYGSPBj63SUgrOXNjD969WCLMdl eLtpudvFYvk/Hjx5qlq9RZsDbKi2+aJKFcpr7mhGXQamRjWJRbM/1QbHDLMR0YDwfQBBbK zLZ4nhQiNoxv0CDN6IrV9DOqtKSwrgzZ1MLTjUYLFXLBBRHxZfGjg5tQ8IAdDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751969106; 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=A0QDfw+yf8k6ww1q5j6GR/oEvHiIvCVKTxOscmfipnU=; b=amBZJWipHJHYvZ8oXA8Qwa123THXki68RXci+cDw6lF4K4TWbn2rUQjIjgsH/ypMMn/0zv u5sm9HlqTZHYFgD++xr7Rzl0BxWcyzVCyv+0lG5WB262aezV9ldB8XMxf6ka4qp6Ug9Ohc nz44M39w5kX/PJBUuH2RxN20MbrNHAQ6GiophyM9ibP23R/O1jvzpGVqVw2xDw6jaZkMG3 VyhfHeJvH88unZ7fZRPHej88of0T36g4VHAS/gbRawhDbsnK6whDxHkJ43VVr0sdwjyr5j PNQWC3Zc0IcTafGVziH0jsecl1jkC9FfJMkR++jX5+1/0LYkgushn4SgrSFLXA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751969106; a=rsa-sha256; cv=none; b=vPbrExmqFcSDSGeHDvwMwT3e026Tj4fbnbK62/ewPAabZ2Zqnumsf81I3EaE4kMrmWRtfd k5VvRx0phBmzkriTzESBhzT6WuZU9WpYASTaZzIlrGfoq94QvpNynEpybQD7Zs6ShL9qfp WfqFp/brmurTpH+nKsXVvQRPjCYuoPs4onoyHXnY7L5vNPJmZW6sX6J3atRiom3/bNF0qL dlVlTg7Z2h/e2WCrC0X+V0qcTjSFDPGCj8Ke6zrv4F+4Ox726Tc69Rqlp9zQE4s8XUrXku dvi9wnV6eiE4A0YGRyBYNhLkzORJzxWPkpwmEMH+8HOFWXu8oMHq+d3CgywrJA== 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 4bbxYZ5k5BzXnt; Tue, 08 Jul 2025 10:05:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 568A564F067369; Tue, 8 Jul 2025 10:05:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 568A56Y6067366; Tue, 8 Jul 2025 10:05:06 GMT (envelope-from git) Date: Tue, 8 Jul 2025 10:05:06 GMT Message-Id: <202507081005.568A56Y6067366@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 12a1baa42bd0 - stable/13 - bridge: Remove a redundant assignment of if_type 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 12a1baa42bd0b2ed7b5c6a8b0807fd50929a8799 Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=12a1baa42bd0b2ed7b5c6a8b0807fd50929a8799 commit 12a1baa42bd0b2ed7b5c6a8b0807fd50929a8799 Author: Zhenlei Huang AuthorDate: 2025-06-16 14:35:40 +0000 Commit: Zhenlei Huang CommitDate: 2025-07-08 10:03:28 +0000 bridge: Remove a redundant assignment of if_type ether_ifattach() no longer sets if_type to IFT_ETHER and keeps it as is since the change [1]. [1] fc74a9f93a5f Stop embedding struct ifnet at the top of driver softcs No functional change intended. MFC after: 1 week (cherry picked from commit a07604e6264b88222941fa61c6f989bad5490765) (cherry picked from commit 193f0bde3b048559d36c3e6db5d6b2be7daeaf6f) --- sys/net/if_bridge.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c index b385772bdf73..e7c98958d2b1 100644 --- a/sys/net/if_bridge.c +++ b/sys/net/if_bridge.c @@ -785,7 +785,6 @@ bridge_clone_create(struct if_clone *ifc, int unit, caddr_t params) ether_ifattach(ifp, sc->sc_defaddr.octet); /* Now undo some of the damage... */ ifp->if_baudrate = 0; - ifp->if_type = IFT_BRIDGE; #ifdef VIMAGE ifp->if_reassign = bridge_reassign; #endif From nobody Tue Jul 8 10:05:05 2025 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 4bbxYY6zfzz60j53; Tue, 08 Jul 2025 10:05:05 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbxYY5R7Vz3G9q; Tue, 08 Jul 2025 10:05:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751969105; 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=/Iw0wKgT8QctkzJr6R5d1ZQhkGYtNP/6Q3gJRNPgtIk=; b=ytKjMRwSUmNpg4GStQ/Ee1R2HHb57DLoi3xLaGAJ2QGqF0ngPEDaUsOAK5DTTiP1+3oZFF U3V7jazy1Tvn0h/i0UEdxQSJWFzDAyScEDnwl6J7Ymp/7z8iNxXr6n87Sc7zyZmtmVVOIa X2h3SxZkRcM/6wTJjE6ts36REpKiGaCaNtu8W8Sw+JcFszwyV+Wpuy/MnKv6+mWDftKVG5 g75Ww2OjbBUL3EU9sc55KTacfZ0vGDlgo9Wz96cmTSwIk3Vk10DUaeSVMRyaFx9wbUY0mh uf6nMGgVvjAKGOnrvzJlGn0E3QdrugzYcpc6rb7u/r2UHRXJpaFBF+zJ6HVSCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751969105; 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=/Iw0wKgT8QctkzJr6R5d1ZQhkGYtNP/6Q3gJRNPgtIk=; b=gJ2Msz/my/v7A0Yl9UJrapxycNaLcGmS2kZZUkLoUB/eL54iRRmLsEpkLjHjzLB4L6ibJT Pu5K+zzo9MjyyJIQ4W4WGvt9Jyo/XbVwBfiL82KxOAoTO8CGHoUzzGnInnTtVWtZI2mQPX AKqGIC20eQsCY0ZJ+vmCDiU8KSerqzW2WXy5vAXJhCZZvjspZyBeLuRqSZK+oARxFDJhBf XssZBIh8Jd40cTBgcGGAB8tK9NEjGedIYKAnEAsG5UCqh/t42zIWY/sN/pB2xXqEc1Rtt9 MlcYfowvcMFAp72vlCspw81I2NfKjo5bK8LHSbCauaHt/sXLHjSJ1qO6lrvqIg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751969105; a=rsa-sha256; cv=none; b=aLCBUiMMVQEGAIwcjYZ4g/HiEczcso1PQxqAtR+HXF9Hnfqv2XYrvqGzh3Biq2ZKkLs/nB /F2yX1tcW7/jgq+WwMepTWPEIzGK6WfD5o2Md6M97uf6rp/yo1KkvxHdcyJslfKiUoBlwt 6W3QTj94GkezqfmoRwmljT9y43deGyRlhVtFxiisjr5WgDWbxcPV9flkbgUDrs3hJ4FDr/ NCcKxvJIsM6MIju2QIYrPDMI1rViD/oa9T5OqTr0kU7MWD+rqxg4xCgN2YWClMmxRXI3rS harGJvTGT47nfTjvTFiUSfBqtGHAewMwxZVAmNRPbyfcvnamuPxImcKbelQy6Q== 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 4bbxYY52kfzXjd; Tue, 08 Jul 2025 10:05:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 568A559X067326; Tue, 8 Jul 2025 10:05:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 568A55gu067323; Tue, 8 Jul 2025 10:05:05 GMT (envelope-from git) Date: Tue, 8 Jul 2025 10:05:05 GMT Message-Id: <202507081005.568A55gu067323@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 56a81f37332a - stable/13 - ng_iface(4): Remove a redundant assignment of if_type 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 56a81f37332a6b22562a4e810b1b99d058fa6c5b Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=56a81f37332a6b22562a4e810b1b99d058fa6c5b commit 56a81f37332a6b22562a4e810b1b99d058fa6c5b Author: Zhenlei Huang AuthorDate: 2025-06-13 10:07:18 +0000 Commit: Zhenlei Huang CommitDate: 2025-07-08 10:03:28 +0000 ng_iface(4): Remove a redundant assignment of if_type That is unnecessary since change [1], as if_alloc(IFT_PROPVIRTUAL) has set if_type already. [1] fc74a9f93a5f Stop embedding struct ifnet at the top of driver softcs No functional change intended. MFC after: 1 week (cherry picked from commit c43d6dadf7e34a94f4d119ff6d7113ad9a9b4d38) (cherry picked from commit 3da0853d71197610375262b8bb06cadda6c8f4dc) --- sys/netgraph/ng_iface.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/netgraph/ng_iface.c b/sys/netgraph/ng_iface.c index 6bc0e527bd82..8793a96d29cb 100644 --- a/sys/netgraph/ng_iface.c +++ b/sys/netgraph/ng_iface.c @@ -544,7 +544,6 @@ ng_iface_constructor(node_p node) ifp->if_ioctl = ng_iface_ioctl; ifp->if_mtu = NG_IFACE_MTU_DEFAULT; ifp->if_flags = (IFF_SIMPLEX|IFF_POINTOPOINT|IFF_NOARP|IFF_MULTICAST); - ifp->if_type = IFT_PROPVIRTUAL; /* XXX */ ifp->if_addrlen = 0; /* XXX */ ifp->if_hdrlen = 0; /* XXX */ ifp->if_baudrate = 64000; /* XXX */ From nobody Tue Jul 8 10:05:04 2025 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 4bbxYX5F4vz60j50; Tue, 08 Jul 2025 10:05:04 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbxYX4Xw5z3GD3; Tue, 08 Jul 2025 10:05:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751969104; 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=arH0TwZISjVDPeGXf6Ji8nCECeuzzQ3CewZ1ia+Yfxk=; b=IqRTJ0Tz0qJS4kjceQi3IVkb7X6HADPeXRyQK6bS8MAxN1xAPpSTeH+iS+WN/rwquXF8rl nozrc8n4+ykfuYpgQn5Jp0Y64E5tJoB9Eu+HGPx1JK6647mAX8EOxuktvCu0L9l3AzG7Ue oKHEnYXEWbCGHczGEnQG9hEk4ROPiidDkFGJ8uxbdEuHjUhD0IdPR8gGaNDz+vipefyKPU +G4ZvrtL6scYqoKogcVDfAT3x9V5buJ4RSD12oFq89LHM9swxbytK0qHI0Xs83COQ+KhBh SIh2sYwGTkRcH1hdhKKcUMCOviq2I97wEO3g6AGxBXlxH7JtrH5qgD+n+k4m8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751969104; 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=arH0TwZISjVDPeGXf6Ji8nCECeuzzQ3CewZ1ia+Yfxk=; b=b9AkSGgKwMVW5Abtyeg6TfaRX6HaJMxnGNqLeCfWKxrhQ80zM82Un3Ze31uGGtFDw9HRKV wqW+sfLSvb98Q5lY04Grf3soMEwEfzFUqdrQM6MGacYpyCI9fd4kbblZFXCL+YKyj8jZlS DMN6HTMJ7B/pFPOG3g/cBSK8G5rgA0XG6fbJbCzLUHSmz9Rir/6BMg4Q5Gdfv7mAuwjNJf a3vcu1eM2VejD9ycBsFYW0/90Eoea2LBLAQ48Tb3QI7w2OiiM3U7v9ctWva2bNyaXzocP/ oESdGRYQiQSpfVG4NdaNZSf80EMaMG21/k1HgHw2MWVICxFABJyhc3tmIEQ5+w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751969104; a=rsa-sha256; cv=none; b=UZ9Xz+xPu6y5OrG5fIvh9yuLWdw50YyOnzKKZWvv4PDAN+PQz/PDT2KJiK+C2pFLz2sge0 4ONwVMq4p0YR/rlBcCRewgp+9NSahLoGafxWMg1dbyNw6maK0GuHJD6k1yE6tFE/+lnBGX sHptA/xDSfoa1wuLUzTzkKDVLKLK1QMSFdCM5X+QAqRkjBLWiU3k74SQvOcDJaS0TazHDc HUjUo4SG9Ud0yQlNd78rdqLPxaZDj2lFBehfMIj/nF40XviskRAKgSWgipL0xLxd71BOvQ dPqTpZxVolWqrN+5OB0Bq6rOMKl/HL9emC4NAbUB85xBmwPZeuzQmPT1skmNJA== 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 4bbxYX44tTzXjc; Tue, 08 Jul 2025 10:05:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 568A54Ew067293; Tue, 8 Jul 2025 10:05:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 568A54Cf067290; Tue, 8 Jul 2025 10:05:04 GMT (envelope-from git) Date: Tue, 8 Jul 2025 10:05:04 GMT Message-Id: <202507081005.568A54Cf067290@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: e59f60d3c08c - stable/13 - if_vlan: Fix up if_type before attaching the interface 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e59f60d3c08c263f14bbd3cf7dde499e80d7335c Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=e59f60d3c08c263f14bbd3cf7dde499e80d7335c commit e59f60d3c08c263f14bbd3cf7dde499e80d7335c Author: Zhenlei Huang AuthorDate: 2025-06-26 16:37:13 +0000 Commit: Zhenlei Huang CommitDate: 2025-07-08 10:03:28 +0000 if_vlan: Fix up if_type before attaching the interface ether_ifattach() does not touch if_type, so it is not mandatory to fix the if_type after ether_ifattach(). Without this change, the event listeners, e.g. netlink, will see wrong interface type IFT_ETHER rather than the correct one IFT_L2VLAN. There is also a potential race that other threads see inconsistent interface type, i.e. initially IFT_ETHER and eventually IFT_L2VLAN. As a nice effect, this change eliminates the memory allocation for if_hw_addr, as vlan(4) interfaces do not support setting or retrieving the hardware MAC address yet [1]. [1] ddae57504b79 Persistently store NIC's hardware MAC address, and add a way to retrive it MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D50914 (cherry picked from commit a19b353d354d4ef808965c53253103cb6e7e6708) (cherry picked from commit ff54b680383bb0f212e813b74e7a3f76423d2238) --- sys/net/if_vlan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c index b098d09a8d9f..b45b8a8ac561 100644 --- a/sys/net/if_vlan.c +++ b/sys/net/if_vlan.c @@ -1138,10 +1138,10 @@ vlan_clone_create(struct if_clone *ifc, char *name, size_t len, caddr_t params) ifp->if_ratelimit_query = vlan_ratelimit_query; #endif ifp->if_flags = VLAN_IFFLAGS; + ifp->if_type = IFT_L2VLAN; ether_ifattach(ifp, eaddr); /* Now undo some of the damage... */ ifp->if_baudrate = 0; - ifp->if_type = IFT_L2VLAN; ifp->if_hdrlen = ETHER_VLAN_ENCAP_LEN; ifa = ifp->if_addr; sdl = (struct sockaddr_dl *)ifa->ifa_addr; From nobody Tue Jul 8 10:05:08 2025 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 4bbxYd2Xc3z60hVx; Tue, 08 Jul 2025 10:05:09 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbxYd12lTz3Fc8; Tue, 08 Jul 2025 10:05:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751969109; 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=tv4qI7+AfhceMwd+Tr2htA3NC09ddvPDKfeWgIHXtDI=; b=J/IYhDJDKcl+7lukFACZnFBjzuowpNWM9VSKLVQk/rAXjKnbWUgAY55rvLjrsuBcRCPpvX C37ctcH/yATZkoccvhtaW4pqIvkLd0w/BrFJGhY8opFlIwrna7FFaDWlP4M7SqpJRehlXx pB1e0JCKBb/julHd/ZCfk0kDdu5soZxub1N0kTwaLWsbzUUjVr3JJfDNyRI8tWJL6nIqJm hImSi06ISOFksNOkhgTDHWVV0Fs8qtlYqre965zfmq5qr/Bc6HsSP/b8AfCIGhuGeUKT9T oKZfskRcVXDeRTlD0uturK9paFWYwkRMV7JNH3hQu0aupyPkD8W/G+5e77/ksg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751969109; 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=tv4qI7+AfhceMwd+Tr2htA3NC09ddvPDKfeWgIHXtDI=; b=yj7Qx9hFjQmJx+7hUHSsD+/y6PcHE1M8vuJDr1LkqmDd7uNd/xUJUBYBHvpZg+wr9XB8ov z4WYe5/qBGRADOnM0aomNDm7PSp91GENtl7CSdzekMOeLLZClR9KeBuO5jhbXoIlEInApw 3TDwzIbocf6QLTXjVTFs+GwJ94YnZVw3TVJYC3u/IZ/ISd4dvAN9bgm3iSM5pphNu4t7Nz CMCkNnZLI+blPkoEZkJ95xCwkkiOyBNH+QU+WMRf0W7xuIsmkG7TvKvZuyvUahXeX+/yTR V1TEjnO+1xq+Pe2J3HpCDUbW2fOU2z03BTjVsurnc1nLM2L94rbVpkWHoBXuzg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751969109; a=rsa-sha256; cv=none; b=sxWXiXF+1li6QhIz8QMkvqGrQc4+UPbKMMvmD5C2lDOHWGVlQbhgDRK0tvx46y+6mxbQc4 zUENyocf5jnMFzbc49iOV7BVCS2/6EI8rybgtQYOFZknM+WbQw4QLjdyQ9lyEbGUKf5dA0 C4dn6ci25xYWJeC74Ieg318tRyO95+1Cbc/Qy78a8tA8ubjbF7xqtqtrWjT68CbUKPQ7yH o8q0C3gMwza92XMeuQJNpCXAodX4NQ9CRu1le8WiIBZVN89yHOhMa+Uzy+mZgrYRUo0Iu8 Rp4ERsnffKVKOYYP2y7CnSRbJfrhOQ5LR8B3zY7u18D+M9/52vFTmV2JoCb8jg== 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 4bbxYd0Q3HzYgg; Tue, 08 Jul 2025 10:05:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 568A58VA067434; Tue, 8 Jul 2025 10:05:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 568A58lE067431; Tue, 8 Jul 2025 10:05:08 GMT (envelope-from git) Date: Tue, 8 Jul 2025 10:05:08 GMT Message-Id: <202507081005.568A58lE067431@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 9d53e7eaab9e - stable/13 - pfsync: Destroy buckets mutexes on clone destroying interface 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 9d53e7eaab9e2e75491941dc035a345bc0f39c99 Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=9d53e7eaab9e2e75491941dc035a345bc0f39c99 commit 9d53e7eaab9e2e75491941dc035a345bc0f39c99 Author: Zhenlei Huang AuthorDate: 2025-06-28 15:46:51 +0000 Commit: Zhenlei Huang CommitDate: 2025-07-08 10:03:29 +0000 pfsync: Destroy buckets mutexes on clone destroying interface So that the associated data with them will be freed. Reviewed by: kp Fixes: 4fc65bcbe3fb pfsync: Performance improvement MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D51063 (cherry picked from commit 8213c07c20586a67bc7f7152bd7ff76c02cbc007) (cherry picked from commit efbaf14c5b681c8f1a04a47c7bf8740134fff098) --- sys/netpfil/pf/if_pfsync.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/netpfil/pf/if_pfsync.c b/sys/netpfil/pf/if_pfsync.c index 412739513472..9eef37ff9005 100644 --- a/sys/netpfil/pf/if_pfsync.c +++ b/sys/netpfil/pf/if_pfsync.c @@ -437,6 +437,10 @@ pfsync_clone_destroy(struct ifnet *ifp) mtx_destroy(&sc->sc_mtx); mtx_destroy(&sc->sc_bulk_mtx); + for (c = 0; c < pfsync_buckets; c++) { + b = &sc->sc_buckets[c]; + mtx_destroy(&b->b_mtx); + } free(sc->sc_buckets, M_PFSYNC); free(sc, M_PFSYNC); From nobody Tue Jul 8 11:09:02 2025 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 4bbyzQ3HHBz60qM3; Tue, 08 Jul 2025 11:09:06 +0000 (UTC) (envelope-from fluffy@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbyzP6Pxlz3h7Z; Tue, 08 Jul 2025 11:09:05 +0000 (UTC) (envelope-from fluffy@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751972945; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=+efOgWyg/IE+gkmUpiIYzwuCxbRgdJSn3xrO4dKfP5Y=; b=iH6/fEh0wY1h71TOP7UhvnmqKzVmwSfX3L/yitgAMKg0nkNbKetvTMkAxA7wvb0CQac0NN XhYhWF7PH11esd2+zbSUl/AdPOVKYb4wDHKv0vnG1z9N8J3DsJsO52yY3akuE1GUY+PQB2 yGbTIMOidaRjmaeCW0wtR9gdrJFj/Rj1Q1neNmG4m6p8vKe1PoB2n9KfzTXQpdrSv1BGUV +R8vbUs3KV34iAGg3Mrg8HBLwrv9/2CKNEdr4gSafCjvotN+Wt84ywrUz2EEBGef5nCCPg SuPi/sXtV99360PfccbXBn6oxdzn87zHuQqTabh15IYzdn6uj6AtigNoz/RZNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751972945; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=+efOgWyg/IE+gkmUpiIYzwuCxbRgdJSn3xrO4dKfP5Y=; b=fMdwkiOEdH98wvj2nctL+VaG0LdHEEfcUvZsPCWl57jczWtytMOlc/c7NESWrtw9lJNKlS fBeCgc5PnkGREnGbN6rPAGkUjV0Ywg3PsD0W3XvsHQIhiz8Zp/k1sMoY/oXTx4B5+hQPYx /T8KmNJcT6g21ukf7VDh6hnQReD76Ot9OBtgAQ6y4Ll1WvbRXullrvF+B5cwabPDyfvcW9 OkpiO+b4GOHhkhs4n/UiYJv+0fVxbFcKqu9JDj1OUSXIrM9E1nX7SMXnWezZKd4KT+b+fh Zq7qB9WiaugeQcwUuRy7UIaImdq3ipkUGkkEqyl9DU068pfOF1SHjSsUXRyFPA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751972945; a=rsa-sha256; cv=none; b=qr26rHYEHYU/anorjqoIxDSnZrSisFxDnIMCewKg6/KLGTiedH5B1aHK/rP3DB67xuRSKE fpePmeX3p5paaiH0rJ4kTaT20l42Y4eUd87Xo2cLoBrRQQAP26KXDpyzDvUhOgBl6b+8Ih 4cgA96nFd8KLb5tpKFCmXLJkreyptnBB+J6vhJVFI7IayKOh0htrqx/TrnJhI4ljk0aPyS S6UF07/nThrXb8F5T6k0T6nc+3IBxJhvYQCvDuN3ftW/JrkkzB/INVKyszFUOHpHFUGVFi jgpCdl/0TwFsudKgY7o/BwtoclbN1h18AtEUHLwVdRGDs37Ge7Hn1snge2XHqQ== Received: from [10.80.0.22] (unknown [89.150.40.109]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: fluffy) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bbyzN5rJ0zP2G; Tue, 08 Jul 2025 11:09:04 +0000 (UTC) (envelope-from fluffy@FreeBSD.org) Message-ID: Date: Tue, 8 Jul 2025 14:09:02 +0300 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: 7e35117eb07f - main - Makefile: Hook MIT KRB5 into the build To: Cy Schubert , "Herbert J. Skuhra" Cc: Cy Schubert , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202506160251.55G2pwx4063231@gitrepo.freebsd.org> <20250620073050.7f03f74e@slippy> <20250707230446.F279E3A1@slippy.cwsent.com> <20250708042825.669BF20E@slippy.cwsent.com> Content-Language: ru, en-GB From: Dima Panov Autocrypt: addr=fluffy@FreeBSD.org; keydata= xsFNBEp+xiUBEAD01RkOYcyzU/Fnam2FI7PPwYqW00SwVmfUHihvVniiaMwzaYzchb+mzSha NsqRgjIN/i59OBpnS25OXMLEpQP7jDJnY2xKyJN2H4qn1HPHkF9cYuqvqkm+r5459g+2ZoGY 9Sr1PA0XSzXJMSQ1nRK3cFfqlN/L2//P36U5VuOWXGZUTwr/n2B/N0HAsYsqDOdjofLg7x9z 8p8elqwJbT/O4ltg8JBVAnof+FzqefYW4CzqkHRjq/9ORiGYh14ST9ECsCaVpfdDUTor0wgp JqzCN1HsQcHqgdMmOqigWIgN7Eg4MRQU3LDCISrNJ/45zvcKUXR0RHOjnSuflYba74q58XhZ 4eCTqHeMHjA8st4IWRzy9l0V4RunnZxjOTb806jyIhdxcb2m8o5tXwsqjf0TQ7vYowDHrQ6g XlhPg4Jvvwf+BwlB2p+w7Cs/Y9QA0YHnIOIVZAwU1wv66YSI9IDL2AbnY2gQGx+dkHiC3S5L G8HcPrMcjayyThKKIi5KQsWa3snFeK5ky+cRpVEOPQfUXFOas++91v90Xe9j+lsmRofsyvuy gzoaZE2fud0kCsOgYEg+kiLPlQicNAx5IToOs8BrVFLcxmbPKuVBfbLdWsYLjXGzbXEmzV9f NDZ1r1uNmVema8YYCiNjUDZhxIfKt8nbp6cx8UgVLGRVDEfXeQARAQABzTdEaW1hIFBhbm92 IChGcmVlQlNELk9SRyBDb21taXR0ZXIpIDxmbHVmZnlARnJlZUJTRC5PUkc+wsF2BBMBAgAg BQJKfsYlAhsDBgsJCAcDAgQVAggDBBYCAwECHgECF4AACgkQ+4ugndU5jyk6dhAArHclTYjw VRjDnoRfO3Zfj9Ssab9Vrbo7DNFWeAqPE3OTCmiq9Q0fzRHzmhVyedYMm9qNA3i0J1De3KTn LanXOrBIqsmmZpSqmrp/xXdZngDLW5H6hpE0f2PeAPwxrb9uBQax8WMR7Z4STSHAP4GRjve3 0wNNS0MlawGllcs9VKRxG5PsDA8k3ACTSjdpQ76RWldORN4LA8M40yHRX377SGMzO+XsCeOw ad65GKyLrx+6Gnd3PMOjVCJCrqd04Jgqg9G0xKNImchwIZ5ulx9jAt+ixfNbY6hwslleqimr 2t5+MMqo6dRrvJ+BsR8NHt9vGi2Jy4+4smg05fR18fck0Sk4vCYyVvtvnOk3qZf0F8zJu06G cjWWC2ZbDPbmksWXFIMxoJbyVxK55xOqcFs0t12sR6gbVJb8Nb88WrQub3MgePyMF6R3Tkfa OqkjvQur1xC2AXESTxtJw1FkdGSb3UopNKgvSPHSLFW8B0LbyDxdYRTRWPGGEUhFP6tdXi5R vb1210ks2EQAqF4Cm3iRIhYgtZvQqQgMSiO9fVyeJ0U6dYGDtg2Boi+NtXKRdmtL7pRSnI3n fAbVJ05Hhd7PBnJeob6R08nHRo9DdAG7o8ToM+egUAuEsEvoRV+v4f6k3mShdxE7gG/anwVy eh3n6LGwg9KHDr1X2FODsLLxgUjOwU0ESn7GJQEQAMBTMHQgb0vcPMAiRvb357ihlh/YYA22 FXj4p3XTrDlBlRL0QCRq1I8XDeQmL3mG3s3NBtDXSefnNM06jZ3XCAfHIDBdxJJvQZZCXfvL p/JK7nnEuqoeqT6/oKs1MeZVdUnvh1nZhphs+Z6dl01GIE8YDpzT1JMD2f3G9PHChGi3Ddzq m3VdXt/87khYJkPbaf6EN5+vDthKgMjba8jwbQ+7IUPqkfnNFIZS6irZ2LYb79BLNI5JSl9l ReSfEX2d8ByQlLzuf0TS4voy3nWGeCyj6BIOMiRSxg+hZmJLYxhNkyK4GQVCt/rLT7dIfBQM syBbX0Qw2NOcfba9VgdPZBgdrawwB4/xF9SA3NB0J0lUjhjpH9iG8NxlpleEg8OSUApyFZEJ q2A/flns4kKzNH7AGYDOFORytDzA3qkgCJrZ7nzQSsdtZ2qbyAoze0tl+YrShJhOcmQBtFem omhWVeJ8T/Bw1KH8M1ihrENBTSzYzLvN18YjNP6P0Dh/7Zda5yYI8fNqd84K3Uq5xBiI0S6+ qxViw84z2tJj8TxiNqFAk7Tbeo2Ximtq7uQ9UnFRSK3jw96yi19KU9rQQZs0xUjN5gn/tF5l BZWKjwuZCkcOiI0EWHAR+ATAEsFNXcuoC9CAGK5HFW4nI4WtE3pv1KYvivlGtF1wzf0Qrhye RrmxABEBAAHCwV8EGAECAAkFAkp+xiUCGwwACgkQ+4ugndU5jymgKg//RvnI7zEDKv6nQUqK RyLawPTrCKCtQ2vSoWyTNgRB6byNS1w5wNSAMnqaESx2bdhauaxe167VEJYqgQy241yFslpC 6v/xlH25Ppos+Jg6AKaQG/JABHO6Co4tHtBbNmM+14HESxAodA4NJuEU19iIPjRhUKC8F8R9 xBmW1uLpPiljU9Km0P3EIKjAdtdZNeMLhwsbSHBwJROFrxFGiTzWNREWZoZpQxgSbHYhwYbx HEbJi1cybl9IQvSGHrysctZsxD04Jxh6ogaziiT8aV6ear6BNh008yRf61FvrinfG3USLR3i JO8aHap4QGCPjZ3cyT+DEq8/zVfDdeidTeNEhSgRKk856RcA+yAE79KYdKkvmDUiC8poAJ7F GEYHMB+g/1+LczCr2g9GYkiB/53boYfU9esYYlarxCgedCrwXv6T48FZ3xxoH3XJ2KV8K6M8 CUb04jj3kEeCwq+R6Bk2ZXrnMzyQmmn223X+Zp89B/gchH32JY8y3j7BICcoZmgMu62XNMgW I/hRgfi3JlVCne6XPj3/w00JYG7vo+eTJOflqYr3WRTPYh7DxzYtshZswHmmkZtwizUQUZzF 9dX2CM8nY7cKucEmtcnUpjGwXMOufa/DmCTlk8ggRZ0ukCUZOlIA4ILxp95sS2oqyucARv+p wMWvrqJ/LfbZexSsIjI= Organization: FreeBSD.org In-Reply-To: <20250708042825.669BF20E@slippy.cwsent.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------7w0oS5TSinnCFhs8yY5J5a0P" This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------7w0oS5TSinnCFhs8yY5J5a0P Content-Type: multipart/mixed; boundary="------------QTlriF2LyJq92piMDW0Gp8UF"; protected-headers="v1" From: Dima Panov To: Cy Schubert , "Herbert J. Skuhra" Cc: Cy Schubert , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Message-ID: Subject: Re: git: 7e35117eb07f - main - Makefile: Hook MIT KRB5 into the build References: <202506160251.55G2pwx4063231@gitrepo.freebsd.org> <20250620073050.7f03f74e@slippy> <20250707230446.F279E3A1@slippy.cwsent.com> <20250708042825.669BF20E@slippy.cwsent.com> In-Reply-To: <20250708042825.669BF20E@slippy.cwsent.com> --------------QTlriF2LyJq92piMDW0Gp8UF Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: base64 SGVsbG8hDQoNCk9uIDA4LjA3LjIwMjUgMDc6MjgsIEN5IFNjaHViZXJ0IHdyb3RlOg0KPiBJ biBtZXNzYWdlIDxhR3h4MzcxLUhWMzg0QTByQG1haWwuYnNkNGFsbC5uZXQ+LCAiSGVyYmVy dCBKLiBTa3VocmEiIHdyaXRlczoNCj4+IE9uIE1vbiwgSnVsIDA3LCAyMDI1IGF0IDA0OjA0 OjQ2UE0gLTA3MDAsIEN5IFNjaHViZXJ0IHdyb3RlOg0KPj4+IEluIG1lc3NhZ2UgPGFHd3Yw NnJHbGdXOHptSklAbWFpbC5ic2Q0YWxsLm5ldD4sICJIZXJiZXJ0IEouIFNrdWhyYSIgd3Jp dGVzOg0KPj4+PiBPbiBNb24sIEp1bCAwNywgMjAyNSBhdCAxMDozNjozMVBNICswMzAwLCBE aW1hIFBhbm92IHdyb3RlOg0KPj4+Pj4gSGVsbG8hDQo+Pj4+Pg0KPj4+Pj4NCj4+Pj4+IEJU VywgaXQgbG9va3MgbGlrZSBzeW1saW5rIGZvciBsaWJrYWRtNWNsbnQuc28gaXMgYnJva2Vu IGFuZCBwcm9kdWNlZCBhDQo+PiAgIGJhZA0KPj4+PiAgIGZpbGUNCj4+Pj4+ICQgbHMgLWxh IGxpYmthZG01Y2xudA0KPj4+Pj4gbHJ3eHIteHIteCAgMSByb290IHdoZWVsIDEzICA3IEp1 bCAyMDo0MCBsaWJrYWRtNWNsbnQgLT4ga2FkbTVjbG50X21pdA0KPj4+Pj4NCj4+Pj4+IGlu c3RlYWQgb2YgYXNzdW1lZCBsaWJrYWRtNWNsbnQuc28gLT4ga2FkbTVjbG50X21pdC5zbw0K Pj4+Pj4NCj4+Pj4+DQo+Pj4+PiBQbGVhc2UgcmV2aWV3Og0KPj4+Pj4NCj4+Pj4+IGRpZmYg LS1naXQgYS9rcmI1L2xpYi9rYWRtNWNsbnQvTWFrZWZpbGUgYi9rcmI1L2xpYi9rYWRtNWNs bnQvTWFrZWZpbGUNCj4+Pj4+IGluZGV4IGUzNzdmOTVmNWI2ZS4uYmUwOWRkM2UyMTBlIDEw MDY0NA0KPj4+Pj4gLS0tIGEva3JiNS9saWIva2FkbTVjbG50L01ha2VmaWxlDQo+Pj4+PiAr KysgYi9rcmI1L2xpYi9rYWRtNWNsbnQvTWFrZWZpbGUNCj4+Pj4+IEBAIC04OCw3ICs4OCw3 IEBAICR7Q0hQQVNTX1VUSUxfU1RSSU5HU19FUlJfQ306ICR7Q0hQQVNTX1VUSUxfU1RSSU5H U19FDQo+PiBSUn0NCj4+Pj4+ICAgICAgICAgIHJtIC1mIGV0LWMtJHsuUFJFRklYfS5ldCBl dC1jLSR7LlBSRUZJWH0uYw0KPj4+Pj4NCj4+Pj4+ICAgYWZ0ZXJpbnN0YWxsOg0KPj4+Pj4g LSAgICAgICAke0lOU1RBTExfTElCU1lNTElOS30gJHtTSExJQn0gJHtERVNURElSfSR7TElC RElSfS9saWJrYWRtNWNsbnQNCj4+Pj4+ICsgICAgICAgJHtJTlNUQUxMX0xJQlNZTUxJTkt9 ICR7U0hMSUJfTkFNRX0gJHtERVNURElSfSR7TElCRElSfS9saWJrYWRtDQo+PiA1Y2xuDQo+ Pj4+IHQuc28NCj4+Pj4+DQo+Pj4+PiAgIC5pbmNsdWRlIDxic2QubGliLm1rPg0KPj4+Pg0K Pj4+PiBUaGlzIHByb2R1Y2VzIGEgdmFsaWQgc3ltbGluayB0aGF0ICdtYWtlIGRlbGV0ZS1v bGQnIHdhbnRzIHRvDQo+Pj4+IHJlbW92ZSBhZ2FpbjoNCj4+Pj4NCj4+Pj4gbHJ3eHIteHIt eCAgMSByb290IHdoZWVsICAgICAyMyBKdWwgIDcgMjI6MjYgL3Vzci9saWIvbGlia2FkbTVj bG50LnNvIC0+DQo+Pj4+IGxpYmthZG01Y2xudF9taXQuc28uMTIxDQo+Pj4+DQo+Pj4+ICMg bWFrZSBkZWxldGUtb2xkDQo+Pj4+Pj4+IFJlbW92aW5nIG9sZCBmaWxlcyAob25seSBkZWxl dGVzIHNhZmUgdG8gZGVsZXRlIGxpYnMpDQo+Pj4+IHJlbW92ZSAvdXNyL2xpYi9saWJrYWRt NWNsbnQuc28/DQo+Pj4NCj4+PiBUaGFua3MgRGltYSBhbmQgSGVyYmVydCBmb3IgcmVwb3J0 aW5nIHRoaXMuIEl0J3MgYmVlbiBmaXhlZC4NCj4+DQo+PiBDeSwgSSBhbSBzb3JyeSBmb3Ig bm90IGJlaW5nIG1vcmUgcHJlY2lzZS4NCj4+DQo+PiBEaW1hJ3MgY2hhbmdlLCB3aGljaCBo YXNuJ3QgYmVlbiBjb21taXRlZCB5ZXQsIGZpeGVzIHRoZSByZWFsIGlzc3VlIG9mDQo+PiBj cmVhdGluZyBhIGJhZCBzeW1saW5rLg0KPj4NCj4+IEkganVzdCB3YW50ZWQgdG8gYWRkIHRo YXQgaGlzIGZpeCBhbHNvIG5lZWRzIHJlbW92YWwgb2YNCj4+IHVzci9saWIvbGlia2FkbTVj bG50LnNvIGluIHRvb2xzL2J1aWxkL21rL09wdGlvbmFsT2Jzb2xldGVGaWxlcy5pbmMuDQo+ Pg0KPj4gTWF5YmUgdXNyL2xpYi9saWJrYWRtNWNsbnQgc2hvdWxkIGJlIGFkZGVkIHRvIE9w dGlvbmFsT2Jzb2xldGVGaWxlcy5pbmM/DQo+IA0KPiBsaWJrYWRtNWNsbnQuc28gaXMgYSBs ZWdpdGltYXRlIHN5bWxpbmsgZm9yIGJvdGggTUlUIGFuZCBIZWltZGFsLiBJbiB0aGUNCj4g Y2FzZSBvZiBIZWltZGFsIGl0IHBvaW50cyB0byBsaWJrYWRtNWNsbnQuc28uMTEuIFdoZXJl YXMgZm9yIE1JVCBpdCBwb2ludHMNCj4gdG8gbGlia2FkbTVjbG50X21pdC5zby4xMjEuIFRo ZXJlIGlzIG8gbGlia2FkbTVjbG50IGluIE1JVC4gSXQgaXMNCj4gbGlia2FkbTVjbG50X21p dC4gWW91IGNhbiBzZWUgdGhpcyBpbiB0aGUgcG9ydCB3aXRoIHBrZyBpbmZvIC1sIGFzIGZv bGxvd3M6DQo+IA0KPiBzbGlwcHkkIHBrZyBpbmZvIC1sIGtyYjUgfCBncmVwIGxpYmthZG01 Y2xudA0KPiAgICAgICAgICAvdXNyL2xvY2FsL2xpYi9saWJrYWRtNWNsbnQuc28NCj4gICAg ICAgICAgL3Vzci9sb2NhbC9saWIvbGlia2FkbTVjbG50X21pdC5zbw0KPiAgICAgICAgICAv dXNyL2xvY2FsL2xpYi9saWJrYWRtNWNsbnRfbWl0LnNvLjEyDQo+ICAgICAgICAgIC91c3Iv bG9jYWwvbGliL2xpYmthZG01Y2xudF9taXQuc28uMTIuMA0KPiBzbGlwcHkkDQo+IA0KDQpD eSwgaXQgbG9va3MgeW91IHN0aWxsIGhhdmUgc29tZXRoaW5nIHN0YWxlZCBhdCB5b3VyIG1h Y2hpbmUgOigNCg0KT24gYSBjbGVhbiBidWlsZCBmb3IgcGtnYmFzZSBpbiBwb3VkcmllcmUg d2l0aG91dCBteSBwYXRjaCBpdCBzdGlsbCBwcm9kdWNlcyBhIGJhZCBzeW1saW5rIGFuZCBu byBjb21wYXQgaXMgcGFja2FnZWQgYXMgcmVzdWx0DQoNCnJvb3RAYWFyY2g2NDp+ICMgcGtn IGluZm8gLWwgLXgga3JiNSB8IGdyZXAgbGlia2FkbTVjbG50DQogICAgICAgICAvdXNyL2xp Yi9saWJrYWRtNWNsbnRfbWl0LnNvLjEyMQ0KICAgICAgICAgL3Vzci9saWIvZGVidWcvdXNy L2xpYi9saWJrYWRtNWNsbnRfbWl0LnNvLjEyMS5kZWJ1Zw0KICAgICAgICAgL3Vzci9saWIv ZGVidWcvdXNyL2xpYjMyL2xpYmthZG01Y2xudF9taXQuc28uMTIxLmRlYnVnDQogICAgICAg ICAvdXNyL2xpYi9saWJrYWRtNWNsbnRfbWl0LmENCiAgICAgICAgIC91c3IvbGliL2xpYmth ZG01Y2xudF9taXQuc28NCiAgICAgICAgIC91c3IvbGliMzIvbGlia2FkbTVjbG50X21pdC5h DQogICAgICAgICAvdXNyL2xpYjMyL2xpYmthZG01Y2xudF9taXQuc28NCiAgICAgICAgIC91 c3IvbGliMzIvbGlia2FkbTVjbG50X21pdC5zby4xMjENCg0KDQotLSANClNpbmNlcmVseSwN CkRpbWEgKGZsdWZmeUBGcmVlQlNELm9yZywgaHR0cHM6Ly90Lm1lL0ZsdWZmeUJTRCwgQGZs dWZmeTptYXRyaXgtZGV2LmZyZWVic2Qub3JnKQ0KKGRlc2t0b3AsIGtkZSwgeDExLCBvZmZp Y2UsIHBvcnRzLXNlY3RlYW0pQEZyZWVCU0QgdGVhbQ0KDQo= --------------QTlriF2LyJq92piMDW0Gp8UF-- --------------7w0oS5TSinnCFhs8yY5J5a0P Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature.asc" -----BEGIN PGP SIGNATURE----- wsF5BAABCAAjFiEELTAsy5mEEwxvh7r8+4ugndU5jykFAmhs/E4FAwAAAAAACgkQ+4ugndU5jykY YQ//Vqr0PugTySt6c17vPJKZV39n9jdKElEUvFGglYxNn/To4lA4l9TWssGTpA9LBGW5l2zfUEvL 8egE6jRhH2MGnwwMT73YqVXvGQam6+dsOfA9r7DMvzI8nCyhLiatN9H5C7jKd+QK0f9RD4v5fJUd dbAOrfDb7WBA+M3SFHEoeUFBX8tofAnWAoWq5GcTZlRVlxqmwT8JdwH6dRUZcm2jjke6Kx6yoKnf DGJaR348ATOcW3R/0tFvIJ6YlLMLSojFcHa+bsZywZaXa4fqln2neMk5UJUY3Hi2qh97JN8hp/YY AX27BLL7RmAvMsUqvfKh3DH3DsOgmzdDsPmnKgFQoafscJUJKk8e2W0eLaHRGg7TquASMZCI4ePa PJDqvIHSjRNjsNYPsP9DCfw8tQVdDfSsO8Mg7F5SPmUo7Os9XHJCHvaIflrbL0RrR2OW/24u5IRD xQuB/VrVPBeD62ht8reQ6r3eyqIGg9PQw6v/qObgiTMKUYiGXUrEPACeV6wcIW+cvWPVQ3OTUIRx +iep9eiZ6YllQKqDeynZxX+dDDDzTkxdNvx5qsolrU02rh8ANU+6jgbJdlK+//xAwjmjkChJEIfw +By+IR/CgHkxwGZTklgl/APa1B3VRp5JVW0IXp4sUx16jGJBBC5JVzvS4w6JVo+fip9jMZuooZTT uxc= =VeW3 -----END PGP SIGNATURE----- --------------7w0oS5TSinnCFhs8yY5J5a0P-- From nobody Tue Jul 8 11:38:37 2025 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 4bbzdT6hMYz60sYk; Tue, 08 Jul 2025 11:38:37 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbzdT5XPdz3thm; Tue, 08 Jul 2025 11:38:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751974717; 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=HLv+WJV9CKrjtLIss+V5OV4UgfYMVtT3NDh4hWxIpqY=; b=RoGKKm3OveVlUFQ7pGzakSnKn671NiV+zWzXRDtJFVYovVX2/9tFm/E5+yoZhzMjO6M+vg zMTE7F9oFxL9Q1iWdary25ARH9uTAi/209eHZFZJ011mgTs9gJakN7uqDTuZ+nmIBYkKUA iNCLj2+zXypoGgB/nrUYlQ6GkypBgiWJCtkRCVPcMnEoqLpR9aTS6LFr8o2ZM4ICXulyTo mL66KVUe0or0Uzvqoj6raINDGckgwjSY/e+zBHJXb9hykgpW9CmZRdQ3urOFIZifFBNptT A7MijT5g4m4WDrNjKpXz4rzJQ+po7q/83fcMFzoaK1uTr9AT/Y52K/jQIGKLQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751974717; 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=HLv+WJV9CKrjtLIss+V5OV4UgfYMVtT3NDh4hWxIpqY=; b=RbPZhe4VB1jW75/1DEmK0HXsNjRkqcovl335SxNaCp07hyF7012lYlWT+S+3ox0Sa3SBR9 4SRdhy9yEP/Ju3JaCiz7iS27wSZ2IOZxlg7nNjfI3pBD/feHozkv77XPKjrtPUGeyKzpi3 CeWeu7ldCHg1+NJH67AqGUAsQySJRAab663l7BSzd1XUAzlP0tYQAvSD1zDDrqwZNFfXXh 1JsWyK2MFWByA5llzOBuEsivwFWwnr6hGrR9XjotYJJYOIOeMnhH02Cr8EVCxiLIjGaeAF eo3ZhpciNHrd+atrI8z4v4H6sn8o3+XlA1a1d3XqmwmyIoNIITTjbruh/gci4g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751974717; a=rsa-sha256; cv=none; b=Ihn7I4V1YDK2usNFYdmwZoTI19NXdA+iyMg1zPjhi+sbLs4MFOKL6vxVmpecSl0M7bh3/h agj6Hef7N00HRnGBc5czBoNmY/Y/yeM6hfPoZWzZvbutq92pNc0aS/O5ixJvMrkrhsBnjg uRXAp0Oyl36haNzgk/JxeQ1QprEMvmbocwUcT+dIrP8vDkhb1cf48paAM8DgL00gfwh4pu j4bDZHqxKzhM+ihIaw4IexrzV9PiczH/1OLjKTMm3co2JqLEA6G3PKAQBF7D1P071Kq5Am 5h+Z8AqW7IQFkl6BlCkhLRrWk4pLKSwGm1t18w/6OLOfbfJmlkFIVCpmBCwIzA== 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 4bbzdT4pHmzbp7; Tue, 08 Jul 2025 11:38:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 568BcbB9036621; Tue, 8 Jul 2025 11:38:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 568BcbgG036618; Tue, 8 Jul 2025 11:38:37 GMT (envelope-from git) Date: Tue, 8 Jul 2025 11:38:37 GMT Message-Id: <202507081138.568BcbgG036618@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Li-Wen Hsu Subject: git: 2f50ea54c6e3 - main - tests/ci: fix race condition in bhyveload boot 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: lwhsu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2f50ea54c6e3b15f655e800eb680ddcb80e30b4f Auto-Submitted: auto-generated The branch main has been updated by lwhsu: URL: https://cgit.FreeBSD.org/src/commit/?id=2f50ea54c6e3b15f655e800eb680ddcb80e30b4f commit 2f50ea54c6e3b15f655e800eb680ddcb80e30b4f Author: Siva Mahadevan AuthorDate: 2025-07-07 17:16:13 +0000 Commit: Li-Wen Hsu CommitDate: 2025-07-08 11:32:17 +0000 tests/ci: fix race condition in bhyveload boot Currently, there is a race condition where the Makefile sh invocation of 'bhyveload -c stdio' exits before receiving any user input in the bootloader (e.g. in the form of a user typically pressing ), causing the 'expect' script to wrongly spawn the 'bhyve' invocation while still in the bootloader. This patch wraps bhyveload in expect(1) to ensure that stdio is correctly consumed before the process exits. Signed-off-by: Siva Mahadevan Sponsored by: The FreeBSD Foundation Pull Request: https://github.com/freebsd/freebsd-src/pull/1757 --- tests/ci/Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/ci/Makefile b/tests/ci/Makefile index 271fc377619b..44b19663fc49 100644 --- a/tests/ci/Makefile +++ b/tests/ci/Makefile @@ -210,7 +210,11 @@ ci-extract-meta: .PHONY ci-runtest: ci-buildimage-${TARGET_ARCH:tl} portinstall .PHONY .if ${MACHINE} == "amd64" && ( ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "i386" ) && ( !defined(USE_QEMU) || empty(USE_QEMU) ) /usr/sbin/bhyvectl --vm=${TEST_VM_NAME} --destroy || true - /usr/sbin/bhyveload -c stdio -m ${VM_MEM_SIZE} -d ${CIDISK} ${TEST_VM_NAME} + expect -c "set timeout ${TIMEOUT_EXPECT}; \ + spawn /usr/bin/timeout -k 5s 30s /usr/sbin/bhyveload \ + -c stdio -m ${VM_MEM_SIZE} -d ${CIDISK} ${TEST_VM_NAME}; \ + expect { eof }; \ + exit [lindex [wait] 3]" expect -c "set timeout ${TIMEOUT_EXPECT}; \ spawn /usr/bin/timeout -k 60 ${TIMEOUT_VM} /usr/sbin/bhyve \ -c ${PARALLEL_JOBS} -m ${VM_MEM_SIZE} -A -H -P \ From nobody Tue Jul 8 11:46:32 2025 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 4bbzpd4p2Sz60tG0; Tue, 08 Jul 2025 11:46:33 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bbzpd1chGz40cS; Tue, 08 Jul 2025 11:46:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751975193; 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=1dUBpNwUb0YzcyG9vD5a889V8UD+Syrx4YmMrXZxaM8=; b=v20y0yUxNspScDH1M9+eTXPU7g6McSYzewfI2DV2V2UbIJl0VAoLe7jjqVW1t08R4RVTSU M1GiGZWBLm+aBerWxIDupOdgR05LYVOW6esixBzF3gE8ilPXgO0SPAoWEt7zNYu0OldkBQ WT4JevTVTvYcs4hUL+Fala7uOqBRgIJThquS4Qc6k1t+wnsuEqnvbha73pR0VvsgsGv5ro me2Kb+InBfWCW52qnH9Tjx2+vMe0SoR57y2RVBDL7wCuu5OBOenzyekYE+toNFnkKChMMm ImGqg3SRa4IbMD+jLdoCU6c/KeP8fs6xhGilfX2pukFzTSROlJDBmgvQ+snA9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751975193; 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=1dUBpNwUb0YzcyG9vD5a889V8UD+Syrx4YmMrXZxaM8=; b=mP+O4XtL7cJHiTd8l2oNYIQr7mHD91zEi41XFwwu6i15zpZQutkPt4Gs/Mhdb45zm5IqL3 1x0Aye7uN6Rb1pjUPCY/uafZJaf51VhPBBQWyGJT9hZHHYa+nJkx3Aakwo6ypuIJOzqBUm +txnR5nr+DoZC06JMmv8DTnNvx8xM25L7yCTINpqDwwjkgNP+yUYJHDOEXibtetP+rLVSz Y5m5EplDAk3lMNBsMecUtFzG5JfIp4R2OirDd0gs7owlzOOWvz+fuNfzhNVr0uDjefw4UL rr+jsds0XRhyCvhmd0CAKbgYKorRHZ0xVMbJl6GzFZbEiaxmb00QH/Iwbjm31g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751975193; a=rsa-sha256; cv=none; b=yX6uyvRRmEA1lTflUIxvidashZkNSPPKbhvxLEAP1G7uOl/8T1aoCNVr1/YCa5ZZZExfuV Ry4ZVfsBqBiRe4DtEtLl6RIU3K7+CVJW4Mw+9ldar9eD1LvkIlzVYSCiBaPjkZmiff0gM2 x1Tw+HWoA5KnSXbcQPTCXgybASF1SsqA3sA5W1COoVRfv1LpHTxCmRgcvCBRrgbA5nRqZp IRyKH0NNZwm5q7FlXd+j4hUgAHJrOHzKE46hcrxpPHKHItGrWMfReSOJMGl41/pJWR1CSd fVy6tBYM6hH+pwiZ7c+shRC9qBglWbEtrJDCytledZdNVElVlVn7sHPD5uXrTQ== 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 4bbzpd0kRmzc2h; Tue, 08 Jul 2025 11:46:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 568BkWmg055558; Tue, 8 Jul 2025 11:46:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 568BkWW4055555; Tue, 8 Jul 2025 11:46:32 GMT (envelope-from git) Date: Tue, 8 Jul 2025 11:46:32 GMT Message-Id: <202507081146.568BkWW4055555@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Renato Botelho Subject: git: a9475bf3dfb2 - stable/14 - bectl: Print activate message in a single line 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: garga X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a9475bf3dfb23782ce9e1d4da16473b2f9597d6b Auto-Submitted: auto-generated The branch stable/14 has been updated by garga: URL: https://cgit.FreeBSD.org/src/commit/?id=a9475bf3dfb23782ce9e1d4da16473b2f9597d6b commit a9475bf3dfb23782ce9e1d4da16473b2f9597d6b Author: Renato Botelho AuthorDate: 2025-07-01 19:14:16 +0000 Commit: Renato Botelho CommitDate: 2025-07-08 11:46:24 +0000 bectl: Print activate message in a single line When -t parameter is used, bectl prints a complementary message "for next boot" on a second line. Change it to print entire message on a single line. Reviewed by: kevans MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D49439 (cherry picked from commit e690b6519ae70921b084d5df0e707abaf848d795) --- sbin/bectl/bectl.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sbin/bectl/bectl.c b/sbin/bectl/bectl.c index be95ca5cd36a..f37a1473680e 100644 --- a/sbin/bectl/bectl.c +++ b/sbin/bectl/bectl.c @@ -159,13 +159,15 @@ bectl_cmd_activate(int argc, char *argv[]) /* activate logic goes here */ if ((err = be_activate(be, argv[0], temp)) != 0) /* XXX TODO: more specific error msg based on err */ - printf("Did not successfully activate boot environment %s\n", + printf("Did not successfully activate boot environment %s", argv[0]); else - printf("Successfully activated boot environment %s\n", argv[0]); + printf("Successfully activated boot environment %s", argv[0]); if (temp) - printf("for next boot\n"); + printf(" for next boot"); + + printf("\n"); return (err); } From nobody Tue Jul 8 12:54:49 2025 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 4bc1Kb4ft2z60y2G; Tue, 08 Jul 2025 12:54:59 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qv1-xf32.google.com (mail-qv1-xf32.google.com [IPv6:2607:f8b0:4864:20::f32]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bc1KZ4vm3z3Ql8; Tue, 08 Jul 2025 12:54:58 +0000 (UTC) (envelope-from markjdb@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-qv1-xf32.google.com with SMTP id 6a1803df08f44-6fad4e6d949so24863596d6.0; Tue, 08 Jul 2025 05:54:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1751979292; x=1752584092; darn=freebsd.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=3GtIFfyFoq0fiOuBaPw2Qdeagt03q6Q55OZ0ziNeq7E=; b=PTZ0QWBqky5EuArIq1cYSfPkMBreZo7Wl7YlnRp9uXhO+fERvQa5IOFdI4gqRgO6Ry ol2337k4y3s8s/dIxKKGMx52mxKcxKi+r57mv5KxOyEDmXDLJ2A4LWRjIvHthQ2p59D4 Zcrs/JGeYMn4FSaLBsdt6OTtS5nPKQHEMboyKGfkt8lvnW/RCvG9j9fcMoS3PRQZJG86 wLN7rMOhSat936dhUwobEJw4kBalb9CdfgEjzjcKCvgsXEl4s77eX7i4zH5jqVmWOlOZ aLBW/C1B4yMUXne367cJ1mJch8WOx162lCbGdKkHSEYEBZ6faOv/1mB/BcEZr21KZ2Hy T7ww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751979292; x=1752584092; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3GtIFfyFoq0fiOuBaPw2Qdeagt03q6Q55OZ0ziNeq7E=; b=dyR1QcFYhhvpU2H+YW82MjRmaAFjLRRcvgTXTMc7Akm+p+Nn+aCBwgMPZpZsfP3Aju fnTPgSAr537X55knmkJ+1YQiRbhhs/sihAyeaDpPKdRkcJH56c+ljnrpeuqt4eg2+Eqg Tq5P4XVNvPCkM9bqwzm11zObF37FAp/gp6978eE1SeBbhDD6OPgbGz6IzTljgVn2inoI xn2E838seRXNHhz5bm3Fa7g3DvBnns4ZabTk91cXJFzeNxTrrwaXwQKPiNUaSvE/TnDe 9HbDGARQr8GSkCoy19igZusNGmRurhj2NOiJqaRbOrtdFm9+ijZYjym7YTq5znSbRLlY Iy/Q== X-Forwarded-Encrypted: i=1; AJvYcCU6uZXeUWgZsC9tdThTVv4As3X5aNedwS7MV4VX8u71MfL1PbSlxP5+beAt+DZpfqNRxsER+ecuUrBFYPuqoYjzKO0E@freebsd.org, AJvYcCWirzTCQBMi2pFwjjCkmyzG1ejPvpegppFZncyOiz0aad4mwwTJmV7s9THE3fIDSKx4SjTa+W/OuxoQk19QTQLz+NCS8ng=@freebsd.org X-Gm-Message-State: AOJu0YxBHnPfhhgUIV6ZYUgrpN2QACP3jVW8vEfq/PVhyNXxZMw4n8lU 2YfBcvyS91Ioph2Ebs9J2802h+tUmrGwU4YVgH/jK7eIB9jbDdK2gT4z9F+J1zrm8yA= X-Gm-Gg: ASbGncvHRD5bJNTqqkvOdxRxcfl9v3xJ9OE36w2X+0Pzx4ZrtHaGURnCq5N5XUHvnz5 BDJLMKCWqKLYRUgUusqnyrLhheFdyzt838f5Pe5A5wFBnmg/dpTSfhUdkG717iwB55OBRn+2/xc fWFWUrwbia58C5rwmPSE/H1YRT+h/uvBCCZks1KhdIKgWj7ZbkSEdGfqLL1XZjtkooxfhfqK7bN 1wAG9J36PedLNTDd1on9NEPZtX21nOHzinVhUdVr2Eci3e30kPTWTbBxZ97SOgoNmLRK90eVi6z urbMcDe/v9X6c5ogVgduOszlgAD6LJK3m5MxBZr/Ohl0akbKp4di6dJavAvCBvxDl08ivEGgRVm H X-Google-Smtp-Source: AGHT+IE6arMyyLvyM1BBJHplldK45/nZnwjdQ6kBKNiNLFehJhBIDjGeFDu0QeS/HebzeWNSofBThA== X-Received: by 2002:a05:6214:5905:b0:6fb:1c3:f527 with SMTP id 6a1803df08f44-702c8ce6b29mr274765996d6.39.1751979292068; Tue, 08 Jul 2025 05:54:52 -0700 (PDT) Received: from nuc (192-0-220-237.cpe.teksavvy.com. [192.0.220.237]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-702c4d5ac78sm74945396d6.91.2025.07.08.05.54.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Jul 2025 05:54:51 -0700 (PDT) Date: Tue, 8 Jul 2025 08:54:49 -0400 From: Mark Johnston To: Konstantin Belousov Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 01a679715f68 - main - err(3): print extended error if available Message-ID: References: <202507071928.567JSk8Y012639@gitrepo.freebsd.org> 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202507071928.567JSk8Y012639@gitrepo.freebsd.org> X-Rspamd-Queue-Id: 4bc1KZ4vm3z3Ql8 X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] On Mon, Jul 07, 2025 at 07:28:46PM +0000, Konstantin Belousov wrote: > The branch main has been updated by kib: > > URL: https://cgit.FreeBSD.org/src/commit/?id=01a679715f68d5e32efecafc1f158eecec3f781b > > commit 01a679715f68d5e32efecafc1f158eecec3f781b > Author: Konstantin Belousov > AuthorDate: 2025-06-16 21:26:22 +0000 > Commit: Konstantin Belousov > CommitDate: 2025-07-07 18:44:22 +0000 > > err(3): print extended error if available > > Reviewed by: asomers, brooks > Sponsored by: The FreeBSD Foundation > Differential revision: https://reviews.freebsd.org/D51141 This seems to cause extended errors to be printed unconditionally: root@freebsd:~ # truncate -r foo bar truncate: foo: No such file or directory (extended error No error) A number of tests fail due to this. Moreover, it doesn't seem useful to print a non-existent extended error. Can the extended error be suppressed in the "no error" case? From nobody Tue Jul 8 12:56:49 2025 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 4bc1Mk0dvVz60yQv; Tue, 08 Jul 2025 12:56:50 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bc1Mj5W7Vz3Rm4; Tue, 08 Jul 2025 12:56:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751979409; 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=KN5MOwNrMPpcUiA5foRhuPr1/XtiaH+g6pw80KFyM1Y=; b=m6aeUQ6hm/h9iZI/j9iaXYWlAb2zsXoKCSbzJ1wNghyJSnSpEchdtWosPj3KSx1WXN3ZrH AR4Z9Em6bD2cSgSemzXtV/kq/WT8kesW+51SecmzlsvepBI6DdcEAyae4xB4/mOV/SZuci b4Ho5Wr+5EE2nA9YVfJKs98u2L+66vKa094lhMOK1xmjKtBdBFQWUYZ4zyZkCm6vEZ3a+g krzujmJfHC5KIk8nAOnwZqEwBYRxOugQ4uRdaBY7U1lw07TwiCVke1zto/xpVu5wJfpllb N0rh2ondQS4yHTpSvV+2SQLDqj17MjxI11K6mTnkpK7Jy4a2luuHImo9gopo7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751979409; 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=KN5MOwNrMPpcUiA5foRhuPr1/XtiaH+g6pw80KFyM1Y=; b=LaKDf8u4Hyj+cXV8CGQIDHokLXahn7Kp+lCE8ZqohGDJs918vk+zGA5iDwH/jNQVeIVF8U mgFmK4jaYlJig6WFYI0SM5KZ3PSrw+t0Cqa/F0uO3M/9Vw5lE7ZqKzelgT57EmuXxoSDqj 1XWC+BjJ3OuV92F8+v6VvUD0pb0UJ3vMFCcoN4rxfpjseOMzmnmO7P2l3Fs/KIhMNa6q6m vpL6G6IbkD+Eu9eG5qn6oq1bszV3SwaRNYn0L4y5qD5ArvGimR7FWvCLNGDidjBdT1wqI2 KQ6TNOluDGgMPRNBerwzRw6Gco4pNYoSLYROdkGG+kuDl5c/26STzy2yCRP/xA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751979409; a=rsa-sha256; cv=none; b=H9D0oYxi8R7F/u5mSRKBLqu/DmXxoraCRckC+DSx5st7akSrETT69nw5IIU2FPVlXu/+mK MCGfMpaKmFOrUYfn0AO3TndTqOhPap/lqGN3lngrv/S43QWbV+iNFbU3L2zWReeZXZVBL6 OEVZWvFpUD6r1x6+7BY5b6Fy5aL7+qAnxYNw5wMPcAJWSCEBfSKYVOHfoq3zRrcqDim7BG X80HvwJizfNrfnB/AzpoiIncP1UbB9n7Zh/dSRdgu3rLhVymr+KeQiejw+r4NDDbGbRsZg Sr7rDEtzT0fzJHBgGbWQFOO89rxu9VnAtsqglzBJ6m2L+v+xTshRkPigGUd12w== 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 4bc1Mj4YpvzdHq; Tue, 08 Jul 2025 12:56:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 568Cunmk085963; Tue, 8 Jul 2025 12:56:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 568Cun1M085960; Tue, 8 Jul 2025 12:56:49 GMT (envelope-from git) Date: Tue, 8 Jul 2025 12:56:49 GMT Message-Id: <202507081256.568Cun1M085960@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: 1e570722dced - main - cap_dns/tests/dns_test: mark tests as needing network access 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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/main X-Git-Reftype: branch X-Git-Commit: 1e570722dced7a3afc0a35b10af047b835e51567 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=1e570722dced7a3afc0a35b10af047b835e51567 commit 1e570722dced7a3afc0a35b10af047b835e51567 Author: Siva Mahadevan AuthorDate: 2025-06-22 01:02:18 +0000 Commit: Mark Johnston CommitDate: 2025-07-08 12:55:30 +0000 cap_dns/tests/dns_test: mark tests as needing network access Signed-off-by: Siva Mahadevan Reviewed by: markj Pull Request: https://github.com/freebsd/freebsd-src/pull/1738 --- lib/libcasper/services/cap_dns/tests/dns_test.c | 37 ++++++++----------------- 1 file changed, 12 insertions(+), 25 deletions(-) diff --git a/lib/libcasper/services/cap_dns/tests/dns_test.c b/lib/libcasper/services/cap_dns/tests/dns_test.c index 76534bbbebad..56d867e474f5 100644 --- a/lib/libcasper/services/cap_dns/tests/dns_test.c +++ b/lib/libcasper/services/cap_dns/tests/dns_test.c @@ -198,18 +198,17 @@ hostent_compare(const struct hostent *hp0, const struct hostent *hp1) static void runtest(cap_channel_t *capdns, unsigned int expected) { - unsigned int result, failure; + unsigned int result; struct addrinfo *ais, *aic, hints, *hintsp; struct hostent *hps, *hpc; struct in_addr ip4; struct in6_addr ip6; int caperr, syserr; - failure = result = 0; + result = 0; hps = gethostbyname("example.com"); if (hps == NULL) { - failure |= GETHOSTBYNAME; fprintf(stderr, "Unable to resolve %s IPv4.\n", "example.com"); } else { hpc = cap_gethostbyname(capdns, "example.com"); @@ -219,7 +218,6 @@ runtest(cap_channel_t *capdns, unsigned int expected) hps = gethostbyname2("example.com", AF_INET); if (hps == NULL) { - failure |= GETHOSTBYNAME2_AF_INET; fprintf(stderr, "Unable to resolve %s IPv4.\n", "example.com"); } else { hpc = cap_gethostbyname2(capdns, "example.com", AF_INET); @@ -229,7 +227,6 @@ runtest(cap_channel_t *capdns, unsigned int expected) hps = gethostbyname2("example.com", AF_INET6); if (hps == NULL) { - failure |= GETHOSTBYNAME2_AF_INET6; fprintf(stderr, "Unable to resolve %s IPv6.\n", "example.com"); } else { hpc = cap_gethostbyname2(capdns, "example.com", AF_INET6); @@ -250,7 +247,6 @@ runtest(cap_channel_t *capdns, unsigned int expected) syserr = getaddrinfo("freebsd.org", "25", hintsp, &ais); if (syserr != 0) { - failure |= GETADDRINFO_AF_UNSPEC; fprintf(stderr, "Unable to issue [system] getaddrinfo() for AF_UNSPEC: %s\n", gai_strerror(syserr)); @@ -268,7 +264,6 @@ runtest(cap_channel_t *capdns, unsigned int expected) hints.ai_family = AF_INET; syserr = getaddrinfo("freebsd.org", "25", hintsp, &ais); if (syserr != 0) { - failure |= GETADDRINFO_AF_INET; fprintf(stderr, "Unable to issue [system] getaddrinfo() for AF_UNSPEC: %s\n", gai_strerror(syserr)); @@ -286,7 +281,6 @@ runtest(cap_channel_t *capdns, unsigned int expected) hints.ai_family = AF_INET6; syserr = getaddrinfo("freebsd.org", "25", hintsp, &ais); if (syserr != 0) { - failure |= GETADDRINFO_AF_INET6; fprintf(stderr, "Unable to issue [system] getaddrinfo() for AF_UNSPEC: %s\n", gai_strerror(syserr)); @@ -308,7 +302,6 @@ runtest(cap_channel_t *capdns, unsigned int expected) inet_pton(AF_INET, GOOGLE_DNS_IPV4, &ip4); hps = gethostbyaddr(&ip4, sizeof(ip4), AF_INET); if (hps == NULL) { - failure |= GETHOSTBYADDR_AF_INET; fprintf(stderr, "Unable to resolve %s.\n", GOOGLE_DNS_IPV4); } else { hpc = cap_gethostbyaddr(capdns, &ip4, sizeof(ip4), AF_INET); @@ -319,7 +312,6 @@ runtest(cap_channel_t *capdns, unsigned int expected) inet_pton(AF_INET6, GOOGLE_DNS_IPV6, &ip6); hps = gethostbyaddr(&ip6, sizeof(ip6), AF_INET6); if (hps == NULL) { - failure |= GETHOSTBYADDR_AF_INET6; fprintf(stderr, "Unable to resolve %s.\n", GOOGLE_DNS_IPV6); } else { hpc = cap_gethostbyaddr(capdns, &ip6, sizeof(ip6), AF_INET6); @@ -329,21 +321,6 @@ runtest(cap_channel_t *capdns, unsigned int expected) } } - /* - * If we had any failures, make sure that all lookups failed. If some - * succeeded and some failed, there's a problem with the test or the DNS - * and we should not fail silently. - */ - if (failure != 0) { - ATF_REQUIRE_MSG(failure == (GETHOSTBYNAME | - GETHOSTBYNAME2_AF_INET | GETHOSTBYNAME2_AF_INET6 | - GETADDRINFO_AF_UNSPEC | GETADDRINFO_AF_INET | - GETADDRINFO_AF_INET6 | - GETHOSTBYADDR_AF_INET | GETHOSTBYADDR_AF_INET6), - "expected all tests to fail, got 0x%x", failure); - atf_tc_skip( - "no name lookups succeeded, tests require Internet access"); - } ATF_REQUIRE_MSG(result == expected, "expected 0x%x, got 0x%x", expected, result); } @@ -367,6 +344,7 @@ cap_dns_init(void) ATF_TC(dns_no_limits); ATF_TC_HEAD(dns_no_limits, tc) { + atf_tc_set_md_var(tc, "require.config", "allow_network_access"); } ATF_TC_BODY(dns_no_limits, tc) { @@ -386,6 +364,7 @@ ATF_TC_BODY(dns_no_limits, tc) ATF_TC(dns_all_limits); ATF_TC_HEAD(dns_all_limits, tc) { + atf_tc_set_md_var(tc, "require.config", "allow_network_access"); } ATF_TC_BODY(dns_all_limits, tc) { @@ -417,6 +396,7 @@ ATF_TC_BODY(dns_all_limits, tc) ATF_TC(dns_name_limit); ATF_TC_HEAD(dns_name_limit, tc) { + atf_tc_set_md_var(tc, "require.config", "allow_network_access"); } ATF_TC_BODY(dns_name_limit, tc) { @@ -448,6 +428,7 @@ ATF_TC_BODY(dns_name_limit, tc) ATF_TC(dns_addr_limit); ATF_TC_HEAD(dns_addr_limit, tc) { + atf_tc_set_md_var(tc, "require.config", "allow_network_access"); } ATF_TC_BODY(dns_addr_limit, tc) { @@ -478,6 +459,7 @@ ATF_TC_BODY(dns_addr_limit, tc) ATF_TC(dns_inet_limit); ATF_TC_HEAD(dns_inet_limit, tc) { + atf_tc_set_md_var(tc, "require.config", "allow_network_access"); } ATF_TC_BODY(dns_inet_limit, tc) { @@ -509,6 +491,7 @@ ATF_TC_BODY(dns_inet_limit, tc) ATF_TC(dns_inet6_limit); ATF_TC_HEAD(dns_inet6_limit, tc) { + atf_tc_set_md_var(tc, "require.config", "allow_network_access"); } ATF_TC_BODY(dns_inet6_limit, tc) { @@ -540,6 +523,7 @@ ATF_TC_BODY(dns_inet6_limit, tc) ATF_TC(dns_name_inet_limit); ATF_TC_HEAD(dns_name_inet_limit, tc) { + atf_tc_set_md_var(tc, "require.config", "allow_network_access"); } ATF_TC_BODY(dns_name_inet_limit, tc) { @@ -581,6 +565,7 @@ ATF_TC_BODY(dns_name_inet_limit, tc) ATF_TC(dns_name_inet6_limit); ATF_TC_HEAD(dns_name_inet6_limit, tc) { + atf_tc_set_md_var(tc, "require.config", "allow_network_access"); } ATF_TC_BODY(dns_name_inet6_limit, tc) { @@ -622,6 +607,7 @@ ATF_TC_BODY(dns_name_inet6_limit, tc) ATF_TC(dns_addr_inet_limit); ATF_TC_HEAD(dns_addr_inet_limit, tc) { + atf_tc_set_md_var(tc, "require.config", "allow_network_access"); } ATF_TC_BODY(dns_addr_inet_limit, tc) { @@ -662,6 +648,7 @@ ATF_TC_BODY(dns_addr_inet_limit, tc) ATF_TC(dns_addr_inet6_limit); ATF_TC_HEAD(dns_addr_inet6_limit, tc) { + atf_tc_set_md_var(tc, "require.config", "allow_network_access"); } ATF_TC_BODY(dns_addr_inet6_limit, tc) { From nobody Tue Jul 8 12:56:50 2025 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 4bc1Ml3hYjz60ybK; Tue, 08 Jul 2025 12:56:51 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bc1Mk6hFHz3Rdh; Tue, 08 Jul 2025 12:56:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751979411; 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=nKxzf8V2+m82F+QPF0+AkjPoNtCk2nTBa9z7xmDQbsc=; b=NH7rOT5ymrfuHQOJxyLmyG6O6F2dRZS06yRBGk0XtIVkf4A7Cu+1u4sjgl+q6pXL+0Aaa1 DnTossEjBIEWqvA/l6L1FEr4kpb2BM28ZES+bwN3omuZyzTjMxtX98ifb5St/QRM0RvXLp gOPMlgcmcYkkpylclGSZyzGOgvZ3mUdVSE33hCbgJLm6ITOOlF4D2IKA4+D20X2EOl4UaN 6JGpk+jxw15nAij/5E27Y4a7yUsEFf14lecvZLSAHhW9In3nlNphKcnOnRMHjs5QdgFQni 7qxddHPOOEUVGpFwzSJYTsFO+mbia6318M+yLwRcnBQ6klzxq3BQx5fcEbkmIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751979411; 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=nKxzf8V2+m82F+QPF0+AkjPoNtCk2nTBa9z7xmDQbsc=; b=FCGEJLyvplPfTz23S2MHQ7JeC/IwwnzQ3G0JfANf11wZbX675sdZG0m+m7FX/JOGihLvTG 5+aDQBNQqFo2LM6MhtaZxh5+4axF7kIGJlQxUOBb9kZEJ4zBwzI60sFztWiJjeQTANsbfQ FLhwNzaosj/PJkjdY6hCJZc5nhXl+UfgwB0haCeA+gmqM56Z2+iWOp8nK0ia53jfFN4K3H yPCmGoryg6zLZOORC8+mvI5fuHGaSaezjfoGnLzVREyOJYspq9wKhoa2DNDC81w9e7FiZT YRXIHGGrgLTCiPF7cc2CBwshG38OadjXZs0kMDrvqdRHEmJTpe6ZgEBSc0Nw3g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751979411; a=rsa-sha256; cv=none; b=mRSIDCN2kh52cnV+Ac7CBu2HYeTLgz8qokxtVKoYDO6w0PyNSMXQxjA9bfpjjRHI++9OsA QsAQTyNDHVDhNhZ15Zuo5RVr0UbPfbuM9LwVthJ0GyMJAafDbreiZu13HmUQu9x5wSBIX4 Sp/xjx/tE86xEinBx9IY9/6RYSS37h1zgjQMC4zls/6cNWUlF84mGbplKH4/KR1rqYVKBM HBjVRTPzkXQsk7v92X7k2VHimsnfNMVuBFsateErH32qmD+6NsfvOwqLT3kTt+8oVcvf9M UoTzjRG7/JUa4mErSf81u7ddOCzFOvItKpQaT2estSqcjo8JEeL3XkW23vWEGg== 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 4bc1Mk5mpSzdX4; Tue, 08 Jul 2025 12:56:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 568CuomH085998; Tue, 8 Jul 2025 12:56:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 568CuoDO085995; Tue, 8 Jul 2025 12:56:50 GMT (envelope-from git) Date: Tue, 8 Jul 2025 12:56:50 GMT Message-Id: <202507081256.568CuoDO085995@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: 26e31700fc7d - main - sysctl_test: Print standard error if sysctl -ao fails 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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/main X-Git-Reftype: branch X-Git-Commit: 26e31700fc7d9bd033cb157f534c67bf9bc697dd Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=26e31700fc7d9bd033cb157f534c67bf9bc697dd commit 26e31700fc7d9bd033cb157f534c67bf9bc697dd Author: Mark Johnston AuthorDate: 2025-07-08 12:48:40 +0000 Commit: Mark Johnston CommitDate: 2025-07-08 12:56:00 +0000 sysctl_test: Print standard error if sysctl -ao fails MFC after: 1 week --- sbin/sysctl/tests/sysctl_test.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/sbin/sysctl/tests/sysctl_test.sh b/sbin/sysctl/tests/sysctl_test.sh index dfc32a87b212..b4cc7180a0f9 100644 --- a/sbin/sysctl/tests/sysctl_test.sh +++ b/sbin/sysctl/tests/sysctl_test.sh @@ -41,6 +41,7 @@ sysctl_aflag_body() # output and it would all otherwise be saved. sysctl -ao >/dev/null 2>stderr if [ $? -ne 0 ]; then + cat stderr atf_fail "sysctl -ao failed" elif [ -s stderr ]; then cat stderr From nobody Tue Jul 8 13:07:25 2025 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 4bc1c11K1Cz60ymH; Tue, 08 Jul 2025 13:07:29 +0000 (UTC) (envelope-from fluffy@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bc1c10Qmhz3X9p; Tue, 08 Jul 2025 13:07:29 +0000 (UTC) (envelope-from fluffy@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751980049; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=Ef5SHuVDjKhtfX+aQlfvkQuMLiWeH0XGFfPcsLEeJ9s=; b=sfspYY6YtHhs6AXWiSGY3TEDxdtTnJ0Jb9USv0ROOkd1k4JWj8veXVY2y9UmFGLBFuT3I1 IBpyQDyBCk6k0NwyuoQseYr3/w7nT4R1HjnoIKXtjTLxXzwCMXmKCJvAvIZSVWDYsEDv7y lqicZNYfuub7mLVhO5oZXjPh6hh+SGR2wz9d45t7tGtqxM2uvYeW8I6uNK8NF1IZn1sl4R fuZTmm7Www2lQXAkFw5gF6ZTiii+NyRVy1tHG3GSDKP2BZAGFrBAX9AKwFSh91tfyfvTEe DiFxeqAXv1HhKWC94n6Y3c4860hLjV7DbTCS89TfpnvAkQ4fzrDBRx4r1ZAgRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751980049; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=Ef5SHuVDjKhtfX+aQlfvkQuMLiWeH0XGFfPcsLEeJ9s=; b=mTzjvmvSVB+RFogjdeVmOFLtXCVA3ZXDVl94+m5w9LdyKGszkofjBUnTzJOOa70n2aKaPU CYmtREDqJ4B5rvzXuSprUemhVYnB0FDGRbOFhkgC3cjK+kWLOeYaX/5G5leDM4RvN/iTiK U8wosjXJHMuaywymZoexsi2WydCG6bxKU7s/nZo1xjJwiMqepLbBvRU7IN1nlkbAjP3xCP ihkLVqL4NF1Fcii0ZrVflDYDQr49w7iYoNf2wIyUALXaOzNeKn27+AimkKGyZs+HfSMIGG cxB/uDrRH1Xrh9e4Q5jcPo4GN8/fPUmkLNixAyniURJb4OcAsMQR5hY338syuA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751980049; a=rsa-sha256; cv=none; b=dB5lSd86d3qWZWPD7GQkx8Y9oCjqFyplpf0oVblLICNFlJkXO1WrNxniJ5AUmN7Cen3Ki3 Ou+hqZ2rWnqZt+KMx93o1eymeF35KDPllCF/WzUu7kXVkkkVNkygbsX/ifcNvdB0bIJYcB FCVy5N+MmiWW9dI8TclYXU79p8gy65wh5kda8KUlBEV3fzhAiU9AZ7jHzsNP06Cy/zdBOc xyT756FutAZRzyE5Zg2Zg8w96O6xzBWQ7z0hyltauQxbpYXu9vGbaQobTiH+jyLQcOTbiw QAR5jjJZoUeXkdu7gRKLMxAJ9WgtuqBTiwV1AaqjpL4KxpKp6lWKhSvdID4ccw== Received: from [10.80.0.22] (unknown [89.150.40.109]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: fluffy) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bc1bz6bXczRGL; Tue, 08 Jul 2025 13:07:27 +0000 (UTC) (envelope-from fluffy@FreeBSD.org) Message-ID: <68ffaac2-d1b1-4889-b93b-53513cbea5a8@FreeBSD.org> Date: Tue, 8 Jul 2025 16:07:25 +0300 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: 7e35117eb07f - main - Makefile: Hook MIT KRB5 into the build From: Dima Panov To: Cy Schubert , "Herbert J. Skuhra" Cc: Cy Schubert , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202506160251.55G2pwx4063231@gitrepo.freebsd.org> <20250620073050.7f03f74e@slippy> <20250707230446.F279E3A1@slippy.cwsent.com> <20250708042825.669BF20E@slippy.cwsent.com> Content-Language: ru, en-GB Autocrypt: addr=fluffy@FreeBSD.org; keydata= xsFNBEp+xiUBEAD01RkOYcyzU/Fnam2FI7PPwYqW00SwVmfUHihvVniiaMwzaYzchb+mzSha NsqRgjIN/i59OBpnS25OXMLEpQP7jDJnY2xKyJN2H4qn1HPHkF9cYuqvqkm+r5459g+2ZoGY 9Sr1PA0XSzXJMSQ1nRK3cFfqlN/L2//P36U5VuOWXGZUTwr/n2B/N0HAsYsqDOdjofLg7x9z 8p8elqwJbT/O4ltg8JBVAnof+FzqefYW4CzqkHRjq/9ORiGYh14ST9ECsCaVpfdDUTor0wgp JqzCN1HsQcHqgdMmOqigWIgN7Eg4MRQU3LDCISrNJ/45zvcKUXR0RHOjnSuflYba74q58XhZ 4eCTqHeMHjA8st4IWRzy9l0V4RunnZxjOTb806jyIhdxcb2m8o5tXwsqjf0TQ7vYowDHrQ6g XlhPg4Jvvwf+BwlB2p+w7Cs/Y9QA0YHnIOIVZAwU1wv66YSI9IDL2AbnY2gQGx+dkHiC3S5L G8HcPrMcjayyThKKIi5KQsWa3snFeK5ky+cRpVEOPQfUXFOas++91v90Xe9j+lsmRofsyvuy gzoaZE2fud0kCsOgYEg+kiLPlQicNAx5IToOs8BrVFLcxmbPKuVBfbLdWsYLjXGzbXEmzV9f NDZ1r1uNmVema8YYCiNjUDZhxIfKt8nbp6cx8UgVLGRVDEfXeQARAQABzTdEaW1hIFBhbm92 IChGcmVlQlNELk9SRyBDb21taXR0ZXIpIDxmbHVmZnlARnJlZUJTRC5PUkc+wsF2BBMBAgAg BQJKfsYlAhsDBgsJCAcDAgQVAggDBBYCAwECHgECF4AACgkQ+4ugndU5jyk6dhAArHclTYjw VRjDnoRfO3Zfj9Ssab9Vrbo7DNFWeAqPE3OTCmiq9Q0fzRHzmhVyedYMm9qNA3i0J1De3KTn LanXOrBIqsmmZpSqmrp/xXdZngDLW5H6hpE0f2PeAPwxrb9uBQax8WMR7Z4STSHAP4GRjve3 0wNNS0MlawGllcs9VKRxG5PsDA8k3ACTSjdpQ76RWldORN4LA8M40yHRX377SGMzO+XsCeOw ad65GKyLrx+6Gnd3PMOjVCJCrqd04Jgqg9G0xKNImchwIZ5ulx9jAt+ixfNbY6hwslleqimr 2t5+MMqo6dRrvJ+BsR8NHt9vGi2Jy4+4smg05fR18fck0Sk4vCYyVvtvnOk3qZf0F8zJu06G cjWWC2ZbDPbmksWXFIMxoJbyVxK55xOqcFs0t12sR6gbVJb8Nb88WrQub3MgePyMF6R3Tkfa OqkjvQur1xC2AXESTxtJw1FkdGSb3UopNKgvSPHSLFW8B0LbyDxdYRTRWPGGEUhFP6tdXi5R vb1210ks2EQAqF4Cm3iRIhYgtZvQqQgMSiO9fVyeJ0U6dYGDtg2Boi+NtXKRdmtL7pRSnI3n fAbVJ05Hhd7PBnJeob6R08nHRo9DdAG7o8ToM+egUAuEsEvoRV+v4f6k3mShdxE7gG/anwVy eh3n6LGwg9KHDr1X2FODsLLxgUjOwU0ESn7GJQEQAMBTMHQgb0vcPMAiRvb357ihlh/YYA22 FXj4p3XTrDlBlRL0QCRq1I8XDeQmL3mG3s3NBtDXSefnNM06jZ3XCAfHIDBdxJJvQZZCXfvL p/JK7nnEuqoeqT6/oKs1MeZVdUnvh1nZhphs+Z6dl01GIE8YDpzT1JMD2f3G9PHChGi3Ddzq m3VdXt/87khYJkPbaf6EN5+vDthKgMjba8jwbQ+7IUPqkfnNFIZS6irZ2LYb79BLNI5JSl9l ReSfEX2d8ByQlLzuf0TS4voy3nWGeCyj6BIOMiRSxg+hZmJLYxhNkyK4GQVCt/rLT7dIfBQM syBbX0Qw2NOcfba9VgdPZBgdrawwB4/xF9SA3NB0J0lUjhjpH9iG8NxlpleEg8OSUApyFZEJ q2A/flns4kKzNH7AGYDOFORytDzA3qkgCJrZ7nzQSsdtZ2qbyAoze0tl+YrShJhOcmQBtFem omhWVeJ8T/Bw1KH8M1ihrENBTSzYzLvN18YjNP6P0Dh/7Zda5yYI8fNqd84K3Uq5xBiI0S6+ qxViw84z2tJj8TxiNqFAk7Tbeo2Ximtq7uQ9UnFRSK3jw96yi19KU9rQQZs0xUjN5gn/tF5l BZWKjwuZCkcOiI0EWHAR+ATAEsFNXcuoC9CAGK5HFW4nI4WtE3pv1KYvivlGtF1wzf0Qrhye RrmxABEBAAHCwV8EGAECAAkFAkp+xiUCGwwACgkQ+4ugndU5jymgKg//RvnI7zEDKv6nQUqK RyLawPTrCKCtQ2vSoWyTNgRB6byNS1w5wNSAMnqaESx2bdhauaxe167VEJYqgQy241yFslpC 6v/xlH25Ppos+Jg6AKaQG/JABHO6Co4tHtBbNmM+14HESxAodA4NJuEU19iIPjRhUKC8F8R9 xBmW1uLpPiljU9Km0P3EIKjAdtdZNeMLhwsbSHBwJROFrxFGiTzWNREWZoZpQxgSbHYhwYbx HEbJi1cybl9IQvSGHrysctZsxD04Jxh6ogaziiT8aV6ear6BNh008yRf61FvrinfG3USLR3i JO8aHap4QGCPjZ3cyT+DEq8/zVfDdeidTeNEhSgRKk856RcA+yAE79KYdKkvmDUiC8poAJ7F GEYHMB+g/1+LczCr2g9GYkiB/53boYfU9esYYlarxCgedCrwXv6T48FZ3xxoH3XJ2KV8K6M8 CUb04jj3kEeCwq+R6Bk2ZXrnMzyQmmn223X+Zp89B/gchH32JY8y3j7BICcoZmgMu62XNMgW I/hRgfi3JlVCne6XPj3/w00JYG7vo+eTJOflqYr3WRTPYh7DxzYtshZswHmmkZtwizUQUZzF 9dX2CM8nY7cKucEmtcnUpjGwXMOufa/DmCTlk8ggRZ0ukCUZOlIA4ILxp95sS2oqyucARv+p wMWvrqJ/LfbZexSsIjI= Organization: FreeBSD.org In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------16CVFKb0TJ65yYUyMSEVpsrr" This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------16CVFKb0TJ65yYUyMSEVpsrr Content-Type: multipart/mixed; boundary="------------bcAZu0nbxcrqD15PExq8anzX"; protected-headers="v1" From: Dima Panov To: Cy Schubert , "Herbert J. Skuhra" Cc: Cy Schubert , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Message-ID: <68ffaac2-d1b1-4889-b93b-53513cbea5a8@FreeBSD.org> Subject: Re: git: 7e35117eb07f - main - Makefile: Hook MIT KRB5 into the build References: <202506160251.55G2pwx4063231@gitrepo.freebsd.org> <20250620073050.7f03f74e@slippy> <20250707230446.F279E3A1@slippy.cwsent.com> <20250708042825.669BF20E@slippy.cwsent.com> In-Reply-To: --------------bcAZu0nbxcrqD15PExq8anzX Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: base64 DQoNCk9uIDA4LjA3LjIwMjUgMTQ6MDksIERpbWEgUGFub3Ygd3JvdGU6DQo+IEhlbGxvIQ0K PiANCj4gT24gMDguMDcuMjAyNSAwNzoyOCwgQ3kgU2NodWJlcnQgd3JvdGU6DQo+PiBJbiBt ZXNzYWdlIDxhR3h4MzcxLUhWMzg0QTByQG1haWwuYnNkNGFsbC5uZXQ+LCAiSGVyYmVydCBK LiBTa3VocmEiIHdyaXRlczoNCj4+PiBPbiBNb24sIEp1bCAwNywgMjAyNSBhdCAwNDowNDo0 NlBNIC0wNzAwLCBDeSBTY2h1YmVydCB3cm90ZToNCj4+Pj4gSW4gbWVzc2FnZSA8YUd3djA2 ckdsZ1c4em1KSUBtYWlsLmJzZDRhbGwubmV0PiwgIkhlcmJlcnQgSi4gU2t1aHJhIiB3cml0 ZXM6DQo+Pj4+PiBPbiBNb24sIEp1bCAwNywgMjAyNSBhdCAxMDozNjozMVBNICswMzAwLCBE aW1hIFBhbm92IHdyb3RlOg0KPj4+Pj4+IEhlbGxvIQ0KPj4+Pj4+DQo+Pj4+Pj4NCj4+Pj4+ PiBCVFcsIGl0IGxvb2tzIGxpa2Ugc3ltbGluayBmb3IgbGlia2FkbTVjbG50LnNvIGlzIGJy b2tlbiBhbmQgcHJvZHVjZWQgYQ0KPj4+IMKgIGJhZA0KPj4+Pj4gwqAgZmlsZQ0KPj4+Pj4+ ICQgbHMgLWxhIGxpYmthZG01Y2xudA0KPj4+Pj4+IGxyd3hyLXhyLXjCoCAxIHJvb3Qgd2hl ZWwgMTPCoCA3IEp1bCAyMDo0MCBsaWJrYWRtNWNsbnQgLT4ga2FkbTVjbG50X21pdA0KPj4+ Pj4+DQo+Pj4+Pj4gaW5zdGVhZCBvZiBhc3N1bWVkIGxpYmthZG01Y2xudC5zbyAtPiBrYWRt NWNsbnRfbWl0LnNvDQo+Pj4+Pj4NCj4+Pj4+Pg0KPj4+Pj4+IFBsZWFzZSByZXZpZXc6DQo+ Pj4+Pj4NCj4+Pj4+PiBkaWZmIC0tZ2l0IGEva3JiNS9saWIva2FkbTVjbG50L01ha2VmaWxl IGIva3JiNS9saWIva2FkbTVjbG50L01ha2VmaWxlDQo+Pj4+Pj4gaW5kZXggZTM3N2Y5NWY1 YjZlLi5iZTA5ZGQzZTIxMGUgMTAwNjQ0DQo+Pj4+Pj4gLS0tIGEva3JiNS9saWIva2FkbTVj bG50L01ha2VmaWxlDQo+Pj4+Pj4gKysrIGIva3JiNS9saWIva2FkbTVjbG50L01ha2VmaWxl DQo+Pj4+Pj4gQEAgLTg4LDcgKzg4LDcgQEAgJHtDSFBBU1NfVVRJTF9TVFJJTkdTX0VSUl9D fTogJHtDSFBBU1NfVVRJTF9TVFJJTkdTX0UNCj4+PiBSUn0NCj4+Pj4+PiDCoMKgwqDCoMKg wqDCoMKgIHJtIC1mIGV0LWMtJHsuUFJFRklYfS5ldCBldC1jLSR7LlBSRUZJWH0uYw0KPj4+ Pj4+DQo+Pj4+Pj4gwqAgYWZ0ZXJpbnN0YWxsOg0KPj4+Pj4+IC3CoMKgwqDCoMKgwqAgJHtJ TlNUQUxMX0xJQlNZTUxJTkt9ICR7U0hMSUJ9ICR7REVTVERJUn0ke0xJQkRJUn0vbGlia2Fk bTVjbG50DQo+Pj4+Pj4gK8KgwqDCoMKgwqDCoCAke0lOU1RBTExfTElCU1lNTElOS30gJHtT SExJQl9OQU1FfSAke0RFU1RESVJ9JHtMSUJESVJ9L2xpYmthZG0NCj4+PiA1Y2xuDQo+Pj4+ PiB0LnNvDQo+Pj4+Pj4NCj4+Pj4+PiDCoCAuaW5jbHVkZSA8YnNkLmxpYi5taz4NCj4+Pj4+ DQo+Pj4+PiBUaGlzIHByb2R1Y2VzIGEgdmFsaWQgc3ltbGluayB0aGF0ICdtYWtlIGRlbGV0 ZS1vbGQnIHdhbnRzIHRvDQo+Pj4+PiByZW1vdmUgYWdhaW46DQo+Pj4+Pg0KPj4+Pj4gbHJ3 eHIteHIteMKgIDEgcm9vdCB3aGVlbMKgwqDCoMKgIDIzIEp1bMKgIDcgMjI6MjYgL3Vzci9s aWIvbGlia2FkbTVjbG50LnNvIC0+DQo+Pj4+PiBsaWJrYWRtNWNsbnRfbWl0LnNvLjEyMQ0K Pj4+Pj4NCj4+Pj4+ICMgbWFrZSBkZWxldGUtb2xkDQo+Pj4+Pj4+PiBSZW1vdmluZyBvbGQg ZmlsZXMgKG9ubHkgZGVsZXRlcyBzYWZlIHRvIGRlbGV0ZSBsaWJzKQ0KPj4+Pj4gcmVtb3Zl IC91c3IvbGliL2xpYmthZG01Y2xudC5zbz8NCj4+Pj4NCj4+Pj4gVGhhbmtzIERpbWEgYW5k IEhlcmJlcnQgZm9yIHJlcG9ydGluZyB0aGlzLiBJdCdzIGJlZW4gZml4ZWQuDQo+Pj4NCj4+ PiBDeSwgSSBhbSBzb3JyeSBmb3Igbm90IGJlaW5nIG1vcmUgcHJlY2lzZS4NCj4+Pg0KPj4+ IERpbWEncyBjaGFuZ2UsIHdoaWNoIGhhc24ndCBiZWVuIGNvbW1pdGVkIHlldCwgZml4ZXMg dGhlIHJlYWwgaXNzdWUgb2YNCj4+PiBjcmVhdGluZyBhIGJhZCBzeW1saW5rLg0KPj4+DQo+ Pj4gSSBqdXN0IHdhbnRlZCB0byBhZGQgdGhhdCBoaXMgZml4IGFsc28gbmVlZHMgcmVtb3Zh bCBvZg0KPj4+IHVzci9saWIvbGlia2FkbTVjbG50LnNvIGluIHRvb2xzL2J1aWxkL21rL09w dGlvbmFsT2Jzb2xldGVGaWxlcy5pbmMuDQo+Pj4NCj4+PiBNYXliZSB1c3IvbGliL2xpYmth ZG01Y2xudCBzaG91bGQgYmUgYWRkZWQgdG8gT3B0aW9uYWxPYnNvbGV0ZUZpbGVzLmluYz8N Cj4+DQo+PiBsaWJrYWRtNWNsbnQuc28gaXMgYSBsZWdpdGltYXRlIHN5bWxpbmsgZm9yIGJv dGggTUlUIGFuZCBIZWltZGFsLiBJbiB0aGUNCj4+IGNhc2Ugb2YgSGVpbWRhbCBpdCBwb2lu dHMgdG8gbGlia2FkbTVjbG50LnNvLjExLiBXaGVyZWFzIGZvciBNSVQgaXQgcG9pbnRzDQo+ PiB0byBsaWJrYWRtNWNsbnRfbWl0LnNvLjEyMS4gVGhlcmUgaXMgbyBsaWJrYWRtNWNsbnQg aW4gTUlULiBJdCBpcw0KPj4gbGlia2FkbTVjbG50X21pdC4gWW91IGNhbiBzZWUgdGhpcyBp biB0aGUgcG9ydCB3aXRoIHBrZyBpbmZvIC1sIGFzIGZvbGxvd3M6DQo+Pg0KPj4gc2xpcHB5 JCBwa2cgaW5mbyAtbCBrcmI1IHwgZ3JlcCBsaWJrYWRtNWNsbnQNCj4+IMKgwqDCoMKgwqDC oMKgwqAgL3Vzci9sb2NhbC9saWIvbGlia2FkbTVjbG50LnNvDQo+PiDCoMKgwqDCoMKgwqDC oMKgIC91c3IvbG9jYWwvbGliL2xpYmthZG01Y2xudF9taXQuc28NCj4+IMKgwqDCoMKgwqDC oMKgwqAgL3Vzci9sb2NhbC9saWIvbGlia2FkbTVjbG50X21pdC5zby4xMg0KPj4gwqDCoMKg wqDCoMKgwqDCoCAvdXNyL2xvY2FsL2xpYi9saWJrYWRtNWNsbnRfbWl0LnNvLjEyLjANCj4+ IHNsaXBweSQNCj4+DQo+IA0KPiBDeSwgaXQgbG9va3MgeW91IHN0aWxsIGhhdmUgc29tZXRo aW5nIHN0YWxlZCBhdCB5b3VyIG1hY2hpbmUgOigNCj4gDQo+IE9uIGEgY2xlYW4gYnVpbGQg Zm9yIHBrZ2Jhc2UgaW4gcG91ZHJpZXJlIHdpdGhvdXQgbXkgcGF0Y2ggaXQgc3RpbGwgcHJv ZHVjZXMgYSBiYWQgc3ltbGluayBhbmQgbm8gY29tcGF0IGlzIHBhY2thZ2VkIGFzIHJlc3Vs dA0KPiANCj4gcm9vdEBhYXJjaDY0On4gIyBwa2cgaW5mbyAtbCAteCBrcmI1IHwgZ3JlcCBs aWJrYWRtNWNsbnQNCj4gIMKgwqDCoMKgwqDCoMKgIC91c3IvbGliL2xpYmthZG01Y2xudF9t aXQuc28uMTIxDQo+ICDCoMKgwqDCoMKgwqDCoCAvdXNyL2xpYi9kZWJ1Zy91c3IvbGliL2xp YmthZG01Y2xudF9taXQuc28uMTIxLmRlYnVnDQo+ICDCoMKgwqDCoMKgwqDCoCAvdXNyL2xp Yi9kZWJ1Zy91c3IvbGliMzIvbGlia2FkbTVjbG50X21pdC5zby4xMjEuZGVidWcNCj4gIMKg wqDCoMKgwqDCoMKgIC91c3IvbGliL2xpYmthZG01Y2xudF9taXQuYQ0KPiAgwqDCoMKgwqDC oMKgwqAgL3Vzci9saWIvbGlia2FkbTVjbG50X21pdC5zbw0KPiAgwqDCoMKgwqDCoMKgwqAg L3Vzci9saWIzMi9saWJrYWRtNWNsbnRfbWl0LmENCj4gIMKgwqDCoMKgwqDCoMKgIC91c3Iv bGliMzIvbGlia2FkbTVjbG50X21pdC5zbw0KPiAgwqDCoMKgwqDCoMKgwqAgL3Vzci9saWIz Mi9saWJrYWRtNWNsbnRfbWl0LnNvLjEyMQ0KPiANCj4gDQoNCiR7U0hMSUJ9IG1hY3JvIGdp dmVzIGEgd3JvbmcgbmFtZSwgY2hlY2sgaXQ6DQoNCiQgbWFrZSAtViBTSExJQg0Ka2FkbTVj bG50X21pdA0KJCBtYWtlIC1WIFNITElCX0xJTksNCmxpYmthZG01Y2xudF9taXQuc28NCiQg cHdkDQovaG9tZS9mbHVmZnkvcmVwby9GcmVlQlNEL0ZyZWVCU0Qtc3JjL2tyYjUvbGliL2th ZG01Y2xudA0KDQoNClNvIHdlIHN0aWxsIG5lZWQgdG8gcGF0Y2ggaXQgOikNCg0KZGlmZiAt LWdpdCBhL2tyYjUvbGliL2thZG01Y2xudC9NYWtlZmlsZSBiL2tyYjUvbGliL2thZG01Y2xu dC9NYWtlZmlsZQ0KaW5kZXggZTM3N2Y5NWY1YjZlLi5kZGI5YjBlOWZlYzUgMTAwNjQ0DQot LS0gYS9rcmI1L2xpYi9rYWRtNWNsbnQvTWFrZWZpbGUNCisrKyBiL2tyYjUvbGliL2thZG01 Y2xudC9NYWtlZmlsZQ0KQEAgLTg4LDcgKzg4LDcgQEAgJHtDSFBBU1NfVVRJTF9TVFJJTkdT X0VSUl9DfTogJHtDSFBBU1NfVVRJTF9TVFJJTkdTX0VSUn0NCiAgICAgICAgIHJtIC1mIGV0 LWMtJHsuUFJFRklYfS5ldCBldC1jLSR7LlBSRUZJWH0uYw0KDQogIGFmdGVyaW5zdGFsbDoN Ci0gICAgICAgJHtJTlNUQUxMX0xJQlNZTUxJTkt9ICR7U0hMSUJ9ICR7REVTVERJUn0ke0xJ QkRJUn0vbGlia2FkbTVjbG50DQorICAgICAgICR7SU5TVEFMTF9MSUJTWU1MSU5LfSAke1NI TElCX0xJTkt9ICR7REVTVERJUn0ke0xJQkRJUn0vbGlia2FkbTVjbG50LnNvDQoNCiAgLmlu Y2x1ZGUgPGJzZC5saWIubWs+DQoNCg0KDQoNCi0tIA0KU2luY2VyZWx5LA0KRGltYSAoZmx1 ZmZ5QEZyZWVCU0Qub3JnLCBodHRwczovL3QubWUvRmx1ZmZ5QlNELCBAZmx1ZmZ5Om1hdHJp eC1kZXYuZnJlZWJzZC5vcmcpDQooZGVza3RvcCwga2RlLCB4MTEsIG9mZmljZSwgcG9ydHMt c2VjdGVhbSlARnJlZUJTRCB0ZWFtDQoNCg== --------------bcAZu0nbxcrqD15PExq8anzX-- --------------16CVFKb0TJ65yYUyMSEVpsrr Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature.asc" -----BEGIN PGP SIGNATURE----- wsF5BAABCAAjFiEELTAsy5mEEwxvh7r8+4ugndU5jykFAmhtGA0FAwAAAAAACgkQ+4ugndU5jymj OhAAw4y8zKphesPJpdXCYWqvnNblWUfvfzk/FCQ9thMBe4JZzLDIq9a94C09h/+FqNwezCpZYuSB inxdAsAIWYh0c1ba70EnBa3WXTIXolfuUCDw/BS1zPISyqU4zF56DcEyrlQpCcFuYWZUVqcQjxPd SNUUkH/vxDmCNmWPZ6Bo4V1287+TmcmSRe7S14jLzifab+OzUuGr5oRxf1LzVQBIEiOizYgDMJAD +nGKWzoPFCyxxYbKx58KBiQpYmwI8taz6+VDVnKKvHJQYowcYFyanTZ5QW4g/DtF78cU8sMw982o hjW61U5jIUrkrWVtR505HhdXKFYRSblaI0hpkwqb7tricsxXx7PbQKKvSuW6nz1q+lZpjfYc1oik 9S2iKlbAqXuxGgx+Q/XT77R6yuJwbKolVRoUkKuBR7/1PHGzpBfbPyefmgaXEy+XKRAgvDqh8CtO lim7GxVdXctOAr6z1obS0AtBsaKxxkkqXJEOq0KWcb2ct0Dq07JFdSQun7UCyVM0bWa/D65Gf6uR WsUpv2WrOrtAUPHoifkx1WQtCocbcW68hxKGiULN6Xp7U8n5lSjjmS+9f7rAm7mRLdgtVZFXI1k7 IzNbwQHlFshSsjzo2GvpXbsO46A3O9XAGXISugLt/ywOu7Lb4KAQthfCRhSoAmE5DjVX4hcecbJz zmA= =QCTT -----END PGP SIGNATURE----- --------------16CVFKb0TJ65yYUyMSEVpsrr-- From nobody Tue Jul 8 13:54:32 2025 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 4bc2fK15z0z612fs; Tue, 08 Jul 2025 13:54:33 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bc2fJ6dr0z3sQj; Tue, 08 Jul 2025 13:54:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751982873; 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=VrrNHMrOZLwS3arcXYusMOVg/IuLRe3zCrANVGD3Vho=; b=sCtbNrPLDkBisACGXEPiI7PB6BgYhj5pTtYcBRKGE6BKTsU3JK55llC1zwXUmBN16q6m5V TWdHfb5MkVMAJjahmuH1/BqEMO6fEw5JF7blybL4RrNn4f64DBjZO9/ZjnN/gV4n+DCIuB i3+XnrsdjsWvd35xkNJYDZj2nXFtMTKrHrbgU7xUgyOlZGF87DA8pviXGyVC2iia1QalxM IaYYpUUl9D8D9Xop1k3MkhDk4GySslGCAQPGcOlVqlyYyoek7qzEShMBFQ5KSl7dByY/KA VJgLC93lbglS1AgtVl66UKKuJ0d8Qm+QJhcZlD71MVpD4/OBT/G2t9FtFGgIOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751982872; 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=VrrNHMrOZLwS3arcXYusMOVg/IuLRe3zCrANVGD3Vho=; b=VN+FZQTRbmiVW+BK/1h4hbyAbRLDkGONVNCfayzsrdtlbYFJIXk+wYpPa71MV8sziZU2xu O2wGrQR9+k0m6qnx9xi/wke8CEQ3T6BsWRm4jMZunmPGmkzhNL1VGDXFyxSauavYfYaZ7d /LUE/V4EcFs7RTpZ2x5fqDPbycJCTChQm7U8FVo2drl/rCQHGOzL2nignXNR5seV7SUZar sWt/efQp4NVMVWWI63yc3F3Xm5aBxh0ZlO21O/26EtMW5LPHCwSHFF8BMmkgxy25xHRcqb c21sg0S3wHEU7e5ueMXi9hjJaECaMJ+sVv76fa7Ko/J2qpFl3nXo4xj+sw9gKg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751982873; a=rsa-sha256; cv=none; b=Q1Dlv9WeL/axibbIDDeeZyT/CLfwoiN4KHEXPT9pB7cDCxQP8tRf907MbZv6B3utNo2tHo AHTc56Ds6ZWIsLSTzD/xhFq1aO1Aw13DvfzvrDsVZSh0JdyRPibWyu5yIe8yKTBw0oYs37 6SedTr6PRAEDIssAC+ueny8PqK9o8WNMsaCKh5SJOt+yLWCMPY6t9ySFSO56kgUka2MZWK QIwUKjzlE3R8pgF9l2gKwtnuWfIA5DFaIHDnXCiBL752QgbiDjqgcYdx5fKW1ma5m7TMnh LpQecH0cppj8S/Pv10PtZP/nsUvNwtbl72u7P3B//rYRAFPd4Ts0F8RM6Ye7zg== 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 4bc2fJ6DfVzgH1; Tue, 08 Jul 2025 13:54:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 568DsWOb098025; Tue, 8 Jul 2025 13:54:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 568DsWnY098022; Tue, 8 Jul 2025 13:54:32 GMT (envelope-from git) Date: Tue, 8 Jul 2025 13:54:32 GMT Message-Id: <202507081354.568DsWnY098022@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: 0559f30a882d - main - krb5: Install the libkrb5clnt.so symlink with the .so 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0559f30a882d2f606782b68b9432a1e7362486fc Auto-Submitted: auto-generated The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=0559f30a882d2f606782b68b9432a1e7362486fc commit 0559f30a882d2f606782b68b9432a1e7362486fc Author: Cy Schubert AuthorDate: 2025-07-08 13:45:46 +0000 Commit: Cy Schubert CommitDate: 2025-07-08 13:54:27 +0000 krb5: Install the libkrb5clnt.so symlink with the .so For 34 days the libclntkrb5.so symlink was installed as libclntkrb5. Fix this and add the error to ObsoleteFiles.inc. Noted and Makefile patch by fluffy@. Fixes: ee3960cba106 --- ObsoleteFiles.inc | 3 +++ krb5/lib/kadm5clnt/Makefile | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 61f948a2c970..faf7c421af80 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -51,6 +51,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20250708: For 34 days 15.0-CURRENT installed libkadm5clnt symlink without .so +OLD_FILES+=usr/lib/libkadm5clnt + # 20250626: For 11 days 15.0-CURRENT installed libtpool to the wrong location MOVED_LIBS+=usr/lib/libtpool.so.2 diff --git a/krb5/lib/kadm5clnt/Makefile b/krb5/lib/kadm5clnt/Makefile index e377f95f5b6e..ddb9b0e9fec5 100644 --- a/krb5/lib/kadm5clnt/Makefile +++ b/krb5/lib/kadm5clnt/Makefile @@ -88,7 +88,7 @@ ${CHPASS_UTIL_STRINGS_ERR_C}: ${CHPASS_UTIL_STRINGS_ERR} rm -f et-c-${.PREFIX}.et et-c-${.PREFIX}.c afterinstall: - ${INSTALL_LIBSYMLINK} ${SHLIB} ${DESTDIR}${LIBDIR}/libkadm5clnt + ${INSTALL_LIBSYMLINK} ${SHLIB_LINK} ${DESTDIR}${LIBDIR}/libkadm5clnt.so .include From nobody Tue Jul 8 14:21:53 2025 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 4bc3Ft1Zc6z614Y4; Tue, 08 Jul 2025 14:21:54 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bc3Fs74zzz44v8; Tue, 08 Jul 2025 14:21:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751984514; 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=46I3BRzgi+IK5IlRs/grw3hr4LHVCSilXO/Fc1+DO7M=; b=XFmStEGhpd+VgEJOX/OxCf2gsU0f9kjJb08HWJnDqX9WnI7C085O3Pcl0KtiVgjLTE5HL2 jH3tNDXXZKsb32fk9L1abz9/HGTiIJwa+9cZu7TFLdHbiJjIF3MQ/Qr6+d3s/5+i+I60iy GFWWibCNJsTgRkkjmBfoMPb+20da/X0X0wdt85/66Ro7NdFeg1SH6nIjdZDXI5GKyV8lJ2 puyQXToTj6/G5+L+T0+/Q5dvOmW1aLWKacq/7DFGs31OeJLC8i5z/eDxeLmMFch1edurDA BezufIjNi2r+pYqu5xYsWg03Crah/ntUoFEvm+E4XGa3IjckMyBFoHhiU9lfXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751984514; 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=46I3BRzgi+IK5IlRs/grw3hr4LHVCSilXO/Fc1+DO7M=; b=FP2siglz0fliVndZlMweDfirGfww2jqDR4RYGvHGz95HbvRzcUBikjtGMxo8Xkalv2hhMV Q3ct+1oK5bmXMka+jfQv0NBFaSeg6tHFKBuqu5Fl4OPmJy+uzXz/CZ/bP0QFP8nlkFE0dy CIg67vHU34uuo6yHhdRxo64J3UN7PCpmXNM0//jH0EL4XzQG8pRAP6iKwGN2oSnZrVaSeU w8IA5glBHTjzeLtKlz8UjEpz6/Sq2yWqbHEWccCqPo6OD93HEyUskOa7Z5kM7omFxZM3Sx z4gz8Qt0TC9b7LRXLmKXOMu3QOEQ/cQGqZLXZ9vLb2wf1Dl6Wkj3AOC3BViiCw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751984514; a=rsa-sha256; cv=none; b=EqaE3NlL4Dq/C8jW/Zk8qzGvkhen+cwHZjynJMELc7k+K4gvpq9FbMOHETbeEHIyBoDeTL yZlVmgG5qcAQ7J95uFVlfXS2C3eNHUKVjVfWwNwx3tUW1bx6uYk1gTmX9BJY8tKhnvvxhw V8vFj7NqvwTXeMD/e2Yuyd99Kc7dfg/i869EdLb9CyCJW/zRjP58tNiMcaFyGCaWnKr/3Q G8Q+BFM2LphCXkM9OGVbNBkdehZK2+80/lvudgiJ4FEa/mb8fbPh0B1yiNnIHxzU9IOTgO aHEOgyWASAx0p11kYyIdyfUneHJZOFxFOz+Iih5zDFMkYsvY+Xctx3zwJQgG3g== 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 4bc3Fs6RKDzgwX; Tue, 08 Jul 2025 14:21:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 568ELrJO052227; Tue, 8 Jul 2025 14:21:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 568ELrEl052224; Tue, 8 Jul 2025 14:21:53 GMT (envelope-from git) Date: Tue, 8 Jul 2025 14:21:53 GMT Message-Id: <202507081421.568ELrEl052224@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Takanori Watanabe Subject: git: 879944679668 - main - ichiic: Add PCI id for Arrow Lake. 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: takawata X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 87994467966806ffbd1f500b510858909c736b88 Auto-Submitted: auto-generated The branch main has been updated by takawata: URL: https://cgit.FreeBSD.org/src/commit/?id=87994467966806ffbd1f500b510858909c736b88 commit 87994467966806ffbd1f500b510858909c736b88 Author: Takanori Watanabe AuthorDate: 2025-06-28 02:38:39 +0000 Commit: Takanori Watanabe CommitDate: 2025-07-08 14:21:03 +0000 ichiic: Add PCI id for Arrow Lake. Add PCI id for Arrow Lake to attach iic driver Reviewed by: wulf, mav Differential Revision: https://reviews.freebsd.org/D51107 --- sys/dev/ichiic/ig4_pci.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sys/dev/ichiic/ig4_pci.c b/sys/dev/ichiic/ig4_pci.c index 0195466150eb..3a49e220e335 100644 --- a/sys/dev/ichiic/ig4_pci.c +++ b/sys/dev/ichiic/ig4_pci.c @@ -186,6 +186,12 @@ static int ig4iic_pci_detach(device_t dev); #define PCI_CHIP_METEORLAKE_M_I2C_3 0x7e518086 #define PCI_CHIP_METEORLAKE_M_I2C_4 0x7e7a8086 #define PCI_CHIP_METEORLAKE_M_I2C_5 0x7e7b8086 +#define PCI_CHIP_ARROWLAKE_U_I2C_0 0x77788086 +#define PCI_CHIP_ARROWLAKE_U_I2C_1 0x77798086 +#define PCI_CHIP_ARROWLAKE_U_I2C_2 0x777a8086 +#define PCI_CHIP_ARROWLAKE_U_I2C_3 0x777b8086 +#define PCI_CHIP_ARROWLAKE_U_I2C_4 0x77508086 +#define PCI_CHIP_ARROWLAKE_U_I2C_5 0x77518086 struct ig4iic_pci_device { uint32_t devid; @@ -316,6 +322,12 @@ static struct ig4iic_pci_device ig4iic_pci_devices[] = { { PCI_CHIP_METEORLAKE_M_I2C_3, "Intel Meteor Lake-M I2C Controller-3", IG4_TIGERLAKE}, { PCI_CHIP_METEORLAKE_M_I2C_4, "Intel Meteor Lake-M I2C Controller-4", IG4_TIGERLAKE}, { PCI_CHIP_METEORLAKE_M_I2C_5, "Intel Meteor Lake-M I2C Controller-5", IG4_TIGERLAKE}, + { PCI_CHIP_ARROWLAKE_U_I2C_0, "Intel Arrow Lake-H/U I2C Controller-0", IG4_TIGERLAKE}, + { PCI_CHIP_ARROWLAKE_U_I2C_1, "Intel Arrow Lake-H/U I2C Controller-1", IG4_TIGERLAKE}, + { PCI_CHIP_ARROWLAKE_U_I2C_2, "Intel Arrow Lake-H/U I2C Controller-2", IG4_TIGERLAKE}, + { PCI_CHIP_ARROWLAKE_U_I2C_3, "Intel Arrow Lake-H/U I2C Controller-3", IG4_TIGERLAKE}, + { PCI_CHIP_ARROWLAKE_U_I2C_4, "Intel Arrow Lake-H/U I2C Controller-4", IG4_TIGERLAKE}, + { PCI_CHIP_ARROWLAKE_U_I2C_5, "Intel Arrow Lake-H/U I2C Controller-5", IG4_TIGERLAKE}, }; static int From nobody Tue Jul 8 14:32:09 2025 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 4bc3Tj5C25z614S2; Tue, 08 Jul 2025 14:32:09 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bc3Tj3t19z49F6; Tue, 08 Jul 2025 14:32:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751985129; 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=LSpEB7eRoNHUXbGGZqo7LHiAUNIfUaYlfpE4upZbGrM=; b=NwemQ/E7g7ly3nfmWQLPMLSL3P+umR5RKSbjwHn/68RqEgatgf4eXTjiz1A3lY+S4HX5pF zKU44+f0VJP5Dcy7Rao1U3UALstHn+l2wSTAyDMbrZsvjK7HqdOTUzSlcp2CYZfdsh9EUV vcD9f6LUdYV2G3/uxkbbf7lmkd+/vnza24x1rsoYGeY4INkd/7p1XGTbMKXkIA/AdAbfbn mEip48BYwQwR8NvsCmZFvv8LY5uHSt4wTAO2G/jY+SmfwKWtFuV8UMPj144SXiJfWX0rma oxg14y4SZqKWCyB2Qh6ADdTkQ6xe3z4DdfZYDbbQK7vzX0JLWIVAf1DL+8Z5kQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751985129; 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=LSpEB7eRoNHUXbGGZqo7LHiAUNIfUaYlfpE4upZbGrM=; b=fP+ukNe9fZt5dnP6hE0H6OtrkYCQ0aN7j0cgy7Hmyx8mfgenr4CDdi1Vd4QX5OqOleyRaH yJFBXUWBptUepL0n6/Azx3+HHoUabz/Ru8OH/h7xW1DT7U38uXdvE1kMkYIp1lPXRmndFp 2mxO9eFV5BV7hi1H2VADRtmD1POdLfw2UbJFoVdKrNzrZFogvpNUsVimetOnpbvGbDfexx jHWa10Os9dNpE1+HP0B0MFOQY146TmVTpkW3cqoD8jOm6RzhIuUfPUscMXciwm2yudx3LJ lVgwcFMRN3ZyY7NsJgcbIY6ZznP+ZlBF0MfBZuz3AotoFadr8cufZWChxyIeuw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751985129; a=rsa-sha256; cv=none; b=ICjaBzBeZSOgY9cG6GZkrbXwq3/q4Eu8zg07ewUOG5Sa+Nv7LTerK8QMn2QQk/G/Q+G5Hm krBJOOJwMB+Ks9tkIbFrBSJcbjp4w4HsmUiEcj36KSPq4BKA9GACSAk483ZbU6PXryhXCI F5n2MXliclXknS0Tx4DVKkJX2+aO8Ax5c0+PmZCjxUbRNuFHImgUmzx5VG1sIvQJGM+Viv +BcT+5cyG5CNc1P64WTjQMLPdyrqslg8N5sZ3rq/yZlLyTYpyC1324/81DRAQ4bvWsEq1I U+3gj8ktabM7uRDAV/iEb98ajaHqurHNAYYmcGUu9RNSy9gSvhzyuBZmrfy3+Q== 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 4bc3Tj3SvTzh30; Tue, 08 Jul 2025 14:32:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 568EW9s3071960; Tue, 8 Jul 2025 14:32:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 568EW9ws071957; Tue, 8 Jul 2025 14:32:09 GMT (envelope-from git) Date: Tue, 8 Jul 2025 14:32:09 GMT Message-Id: <202507081432.568EW9ws071957@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: e52f11f4bbc8 - stable/14 - libyaml: import libyaml vendor version 0.2.5 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e52f11f4bbc89df8114715a210adf2411ca4936d Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=e52f11f4bbc89df8114715a210adf2411ca4936d commit e52f11f4bbc89df8114715a210adf2411ca4936d Author: Baptiste Daroussin AuthorDate: 2025-06-26 06:57:37 +0000 Commit: Baptiste Daroussin CommitDate: 2025-07-08 14:06:59 +0000 libyaml: import libyaml vendor version 0.2.5 The yaml parser used in nuageinit is too incomplete, import libyaml in order to be able to use as a complete parser for nuageinit. (cherry picked from commit 0f5c86ddb0257f4b7620f1d8e898289be30b19bf) --- contrib/libyaml/.appveyor.yml | 29 + contrib/libyaml/.github/workflows/main.yml | 59 + contrib/libyaml/.gitignore | 46 + contrib/libyaml/.indent.pro | 1 + contrib/libyaml/.makefile | 63 + contrib/libyaml/.travis.yml | 28 + contrib/libyaml/CMakeLists.txt | 160 + contrib/libyaml/Changes | 372 ++ contrib/libyaml/License | 20 + contrib/libyaml/Makefile.am | 54 + contrib/libyaml/ReadMe.md | 46 + contrib/libyaml/announcement.msg | 89 + contrib/libyaml/bootstrap | 3 + contrib/libyaml/configure.ac | 73 + contrib/libyaml/doc/doxygen.cfg | 222 ++ contrib/libyaml/docker/README.mkd | 17 + contrib/libyaml/docker/alpine-3.7 | 26 + contrib/libyaml/docker/fedora-25 | 26 + contrib/libyaml/docker/ubuntu-14.04 | 29 + contrib/libyaml/docker/ubuntu-16.04 | 24 + contrib/libyaml/examples/anchors.yaml | 10 + contrib/libyaml/examples/array.yaml | 2 + contrib/libyaml/examples/global-tag.yaml | 14 + contrib/libyaml/examples/json.yaml | 1 + contrib/libyaml/examples/mapping.yaml | 2 + contrib/libyaml/examples/numbers.yaml | 1 + contrib/libyaml/examples/strings.yaml | 7 + contrib/libyaml/examples/tags.yaml | 7 + contrib/libyaml/examples/yaml-version.yaml | 3 + contrib/libyaml/include/Makefile.am | 17 + contrib/libyaml/include/yaml.h | 1985 +++++++++++ ...terfuzz-testcase-minimized-5607885063061504.yml | 1 + contrib/libyaml/src/Makefile.am | 4 + contrib/libyaml/src/api.c | 1393 ++++++++ contrib/libyaml/src/dumper.c | 394 +++ contrib/libyaml/src/emitter.c | 2358 +++++++++++++ contrib/libyaml/src/loader.c | 544 +++ contrib/libyaml/src/parser.c | 1375 ++++++++ contrib/libyaml/src/reader.c | 469 +++ contrib/libyaml/src/scanner.c | 3598 ++++++++++++++++++++ contrib/libyaml/src/writer.c | 141 + contrib/libyaml/src/yaml_private.h | 684 ++++ contrib/libyaml/tests/CMakeLists.txt | 27 + contrib/libyaml/tests/Makefile.am | 9 + contrib/libyaml/tests/ReadMe.md | 63 + contrib/libyaml/tests/example-deconstructor-alt.c | 800 +++++ contrib/libyaml/tests/example-deconstructor.c | 1127 ++++++ contrib/libyaml/tests/example-reformatter-alt.c | 217 ++ contrib/libyaml/tests/example-reformatter.c | 202 ++ contrib/libyaml/tests/run-all-tests.sh | 29 + contrib/libyaml/tests/run-dumper.c | 314 ++ contrib/libyaml/tests/run-emitter-test-suite.c | 290 ++ contrib/libyaml/tests/run-emitter.c | 327 ++ contrib/libyaml/tests/run-loader.c | 63 + contrib/libyaml/tests/run-parser-test-suite.c | 189 + contrib/libyaml/tests/run-parser.c | 63 + contrib/libyaml/tests/run-scanner.c | 63 + contrib/libyaml/tests/test-reader.c | 354 ++ contrib/libyaml/tests/test-version.c | 29 + contrib/libyaml/yaml-0.1.pc.in | 10 + contrib/libyaml/yamlConfig.cmake.in | 16 + lib/Makefile | 1 + lib/libyaml/Makefile | 29 + share/mk/src.libnames.mk | 1 + 64 files changed, 18620 insertions(+) diff --git a/contrib/libyaml/.appveyor.yml b/contrib/libyaml/.appveyor.yml new file mode 100644 index 000000000000..36d706aecdf5 --- /dev/null +++ b/contrib/libyaml/.appveyor.yml @@ -0,0 +1,29 @@ +version: 0.2.5.{build} + +image: +- Visual Studio 2015 +- Visual Studio 2013 + +build_script: + +# +# CMake based in-source build and tests using Visual Studio +# + +# Use 32-bit default generator ("Visual Studio 12 2013" or "Visual Studio 14 2015") +- cmake . +- cmake --build . --config Release --clean-first +- ctest -C Release + +# +# Autoconf based in-source build and tests under Cygwin using gcc +# + +# 32-bit cygwin build +- C:\cygwin\bin\sh -c "export PATH=/usr/bin:/usr/local/bin:$PATH && ./bootstrap && ./configure && make && make test && make distclean" +# 64-bit cygwin build +- C:\cygwin64\bin\sh -c "export PATH=/usr/bin:/usr/local/bin:$PATH && ./bootstrap && ./configure && make && make test && make distclean" +# 32-bit mingw-w64 build +- C:\cygwin\bin\sh -c "export PATH=/usr/bin:/usr/local/bin:$PATH && ./bootstrap && ./configure --host=i686-w64-mingw32 --target=i686-w64-mingw32 && make && make test && make distclean" +# 64-bit mingw-w64 build +- C:\cygwin64\bin\sh -c "export PATH=/usr/bin:/usr/local/bin:$PATH && ./bootstrap && ./configure --host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 && make && make test && make distclean" diff --git a/contrib/libyaml/.github/workflows/main.yml b/contrib/libyaml/.github/workflows/main.yml new file mode 100644 index 000000000000..c2bdef471011 --- /dev/null +++ b/contrib/libyaml/.github/workflows/main.yml @@ -0,0 +1,59 @@ +name: linux/mac + +on: + push: + branches: [ '*' ] + pull_request: + branches: [ master ] + +jobs: + + build: + + runs-on: ${{ matrix.os }} + strategy: + matrix: + compiler: + - gcc + - clang + os: + - ubuntu-latest + - macOS-latest + + steps: + - uses: actions/checkout@v2 + + - run: env | sort + - name: Install software + run: | + if [[ '${{ matrix.os }}' == macOS-latest ]]; then + brew install automake bash coreutils make + echo ::add-path::/usr/local/opt/coreutils/libexec/gnubin + echo ::add-path::/usr/local/opt/make/libexec/gnubin + fi + - name: Fetch branches + run: | + git config remote.origin.fetch +refs/heads/*:refs/remotes/origin/* + git fetch --unshallow + + - run: ./bootstrap + - run: ./configure + - run: make + - run: make test-all + + - run: | + git clean -d -x -f + rm -fr tests/run-test-suite + git worktree prune + + - name: Compiler version + run: ${{ matrix.compiler }} --version + env: + CC: ${{ matrix.compiler }} + - run: cmake . + env: + CC: ${{ matrix.compiler }} + - run: make + env: + CC: ${{ matrix.compiler }} + - run: make test diff --git a/contrib/libyaml/.gitignore b/contrib/libyaml/.gitignore new file mode 100644 index 000000000000..90840c8ac2de --- /dev/null +++ b/contrib/libyaml/.gitignore @@ -0,0 +1,46 @@ +*.BAK +*.a +*.cmake +*.dll +*.exe +*.la +*.lo +*.log +*.o +*.pc +*.so +*.trs +*~ +.deps/ +.libs/ +/Testing/ +/libtool +CMakeCache.txt +CMakeFiles/ +GNUmakefile +Makefile +Makefile.in +/aclocal.m4 +/autom4te.cache +/config +config.h* +/config.status +/configure +stamp-h1 +!config/config.h.in +/packaging/ +/tests/run-dumper +/tests/run-emitter +/tests/run-emitter-test-suite +/tests/run-loader +/tests/run-parser +/tests/run-parser-test-suite +/tests/run-scanner +/tests/example-deconstructor +/tests/example-deconstructor-alt +/tests/example-reformatter +/tests/example-reformatter-alt +/tests/run-test-suite +/tests/test-reader +/tests/test-version +/dist/ diff --git a/contrib/libyaml/.indent.pro b/contrib/libyaml/.indent.pro new file mode 100644 index 000000000000..d647720f74d6 --- /dev/null +++ b/contrib/libyaml/.indent.pro @@ -0,0 +1 @@ +-kr -nut -nce -l250 diff --git a/contrib/libyaml/.makefile b/contrib/libyaml/.makefile new file mode 100644 index 000000000000..9d526a4d3983 --- /dev/null +++ b/contrib/libyaml/.makefile @@ -0,0 +1,63 @@ +# This file is used for common development targets that can be done with +# needing the cumbersome bootstrapping process. +# +# You can use it like this: +# +# make -f .makefile indent +# +# If you copy or link this file to `GNUmakefile` then you can just do: +# +# make indent +# +# When copied to `GNUmakefile`, this file is can also be used for bootstrapping +# Makefile targets. Since GNUmakefile is loaded before Makefile, we do the +# bootstrapping tasks need to get a Makefile first, then we use the Makefile to +# make our target. + +# Remind user when they are using GNUmakefile: +ifeq ($(lastword $(MAKEFILE_LIST)),GNUmakefile) + $(info *** NOTE: GNUmakefile in use. ***) +endif + +MAKE_TARGETS := \ + all \ + all-am \ + all-recursive \ + install \ + test \ + test-all \ + test-suite \ + +# SOURCE_FILES := $(shell find . | grep '\.c$$') +SOURCE_FILES := $(shell find tests/run-test-suite | grep '\.c$$') +ifneq ($(shell which gindent),) +INDENT := gindent +else +INDENT := indent +endif + +# +# Proxy make targets: +# +default: all + +# Proxy these targets to the real Makefile, after bootstrapping is necessary. +$(MAKE_TARGETS): Makefile + @make -f $< $@ + +Makefile: Makefile.in + ./configure + +Makefile.in: + ./bootstrap + +# +# Development make targets: +# +indent: + $(INDENT) $(SOURCE_FILES) + +distclean purge: + git clean -dxf -e GNUmakefile + rm -fr tests/run-test-suite + git worktree prune diff --git a/contrib/libyaml/.travis.yml b/contrib/libyaml/.travis.yml new file mode 100644 index 000000000000..dca3bc73c4c5 --- /dev/null +++ b/contrib/libyaml/.travis.yml @@ -0,0 +1,28 @@ +language: c + +matrix: + include: + - os: linux + compiler: gcc + sudo: required + - os: linux + compiler: clang + sudo: required + - os: osx + compiler: gcc + - os: osx + compiler: clang + +before_install: + +# Travis branch-specific clone problem workaround: +- git config remote.origin.fetch +refs/heads/*:refs/remotes/origin/* +- git fetch +- env | sort + +- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then + pip install --user scikit-ci-addons==0.15.0; + ci_addons travis/install_cmake 3.2.0; + fi + +script: tests/run-all-tests.sh diff --git a/contrib/libyaml/CMakeLists.txt b/contrib/libyaml/CMakeLists.txt new file mode 100644 index 000000000000..4f811481779a --- /dev/null +++ b/contrib/libyaml/CMakeLists.txt @@ -0,0 +1,160 @@ + +cmake_minimum_required(VERSION 3.0) +project (yaml C) + +set (YAML_VERSION_MAJOR 0) +set (YAML_VERSION_MINOR 2) +set (YAML_VERSION_PATCH 5) +set (YAML_VERSION_STRING "${YAML_VERSION_MAJOR}.${YAML_VERSION_MINOR}.${YAML_VERSION_PATCH}") + +option(BUILD_SHARED_LIBS "Build libyaml as a shared library" OFF) +set(YAML_STATIC_LIB_NAME "yaml" CACHE STRING "Base name of static library output") + +# +# Output directories for a build tree +# +if(NOT DEFINED CMAKE_RUNTIME_OUTPUT_DIRECTORY) + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) +endif() + +# +# Install relative directories +# +if(NOT DEFINED INSTALL_LIB_DIR) + set(INSTALL_LIB_DIR lib) +endif() +if(NOT DEFINED INSTALL_BIN_DIR) + set(INSTALL_BIN_DIR bin) +endif() +if(NOT DEFINED INSTALL_INCLUDE_DIR) + set(INSTALL_INCLUDE_DIR include) +endif() +if(NOT DEFINED INSTALL_CMAKE_DIR) + set(INSTALL_CMAKE_DIR cmake) +endif() + +# +# Build library +# +set(SRCS + src/api.c + src/dumper.c + src/emitter.c + src/loader.c + src/parser.c + src/reader.c + src/scanner.c + src/writer.c + ) + +set(config_h ${CMAKE_CURRENT_BINARY_DIR}/include/config.h) +configure_file( + cmake/config.h.in + ${config_h} + ) + +add_library(yaml ${SRCS}) + +if(NOT BUILD_SHARED_LIBS) + set_target_properties(yaml + PROPERTIES OUTPUT_NAME ${YAML_STATIC_LIB_NAME} + ) +endif() + +set_target_properties(yaml + PROPERTIES DEFINE_SYMBOL YAML_DECLARE_EXPORT + ) + +target_compile_definitions(yaml + PRIVATE HAVE_CONFIG_H + PUBLIC + $<$>:YAML_DECLARE_STATIC> + $<$:_CRT_SECURE_NO_WARNINGS> + ) + +target_include_directories(yaml PUBLIC + $ + $ + $ + ) + +# +# Install rules +# +install( + FILES + include/yaml.h + DESTINATION include COMPONENT Development + ) + +install( + TARGETS yaml + EXPORT yamlTargets + RUNTIME DESTINATION "${INSTALL_BIN_DIR}" COMPONENT Runtime + LIBRARY DESTINATION "${INSTALL_LIB_DIR}" COMPONENT Development + ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" COMPONENT Development + ) + +# +# Add tests +# +include(CTest) # This module defines BUILD_TESTING option +if(BUILD_TESTING) + add_subdirectory(tests) +endif() + +# +# Generate 'yamlConfig.cmake', 'yamlConfigVersion.cmake' and 'yamlTargets.cmake' +# +include(CMakePackageConfigHelpers) + +# Configure 'yamlConfig.cmake' for a build tree +set(CONFIG_DIR_CONFIG ${PROJECT_BINARY_DIR}) +set(config_file ${PROJECT_BINARY_DIR}/yamlConfig.cmake) +configure_package_config_file( + yamlConfig.cmake.in + ${config_file} + INSTALL_DESTINATION ${PROJECT_BINARY_DIR} + PATH_VARS CONFIG_DIR_CONFIG + NO_CHECK_REQUIRED_COMPONENTS_MACRO + ) + +# Configure 'yamlTargets.cmake' for a build tree +export(TARGETS yaml + FILE ${PROJECT_BINARY_DIR}/yamlTargets.cmake + ) + +# Configure and install 'yamlConfig.cmake' for an install tree +set(CONFIG_DIR_CONFIG ${INSTALL_CMAKE_DIR}) +set(install_config_file ${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/yamlConfig.cmake ) +configure_package_config_file( + yamlConfig.cmake.in + ${install_config_file} + INSTALL_DESTINATION ${CMAKE_INSTALL_PREFIX}/${INSTALL_CMAKE_DIR} + PATH_VARS CONFIG_DIR_CONFIG + NO_CHECK_REQUIRED_COMPONENTS_MACRO + ) +install( + FILES ${install_config_file} + DESTINATION ${INSTALL_CMAKE_DIR} COMPONENT Development + ) + +# Configure and install 'yamlTargets.cmake' for an install tree +install(EXPORT yamlTargets + FILE yamlTargets.cmake + DESTINATION ${INSTALL_CMAKE_DIR} + COMPONENT Development + ) + +# Configure 'yamlConfigVersion.cmake' for a build tree +set(config_version_file ${PROJECT_BINARY_DIR}/yamlConfigVersion.cmake) +write_basic_package_version_file( + ${config_version_file} + VERSION ${YAML_VERSION_STRING} + COMPATIBILITY AnyNewerVersion +) +# ... and install for an install tree +install( + FILES ${config_version_file} + DESTINATION ${INSTALL_CMAKE_DIR} COMPONENT Development + ) diff --git a/contrib/libyaml/Changes b/contrib/libyaml/Changes new file mode 100644 index 000000000000..e4b96edcbef7 --- /dev/null +++ b/contrib/libyaml/Changes @@ -0,0 +1,372 @@ +0.2.5 2020-06-01 + +https://github.com/yaml/libyaml/pull/105 +Allow question marks in plain scalars in flow collections + +https://github.com/yaml/libyaml/pull/186 +Emitter: Don't output trailing space for empty scalar nodes + +https://github.com/yaml/libyaml/pull/185 +Emitter: Output space after an alias mapping key + +https://github.com/yaml/libyaml/pull/187 +Add -h and --flow (on|off|keep) to run-*-test-suite + +https://github.com/yaml/libyaml/pull/182 +Remove unnecessary include and malloc + +https://github.com/yaml/libyaml/pull/177 +Add specific files back to .gitignore + +https://github.com/yaml/libyaml/pull/181 +Output error position in run-parser-test-suite.c + +https://github.com/yaml/libyaml/pull/191 +A couple patches to improve test suite support + +0.2.4 2020-04-19 + + - https://github.com/yaml/libyaml/pull/143 + Add packaging/docker-dist to Makefile.am + + - https://github.com/yaml/libyaml/pull/174 + Fix logic for document end before directive + + +0.2.3 2020-04-11 + + - https://github.com/yaml/libyaml/pull/130 + Fixed typo. + + - https://github.com/yaml/libyaml/pull/144 + Fix typo in comment + + - https://github.com/yaml/libyaml/pull/140 + Use pointer to const for strings that aren't/shouldn't be modified + + - https://github.com/yaml/libyaml/pull/128 + Squash a couple of warnings in example-deconstructor-alt + + - https://github.com/yaml/libyaml/pull/151 + Fix spelling for error message + + - https://github.com/yaml/libyaml/pull/161 + Make appveyor config be a hidden file + + - https://github.com/yaml/libyaml/pull/159 + Add CHANGES file + + - https://github.com/yaml/libyaml/pull/160 + Always output document end before directive (YAML 1.2 compatibility) + + - https://github.com/yaml/libyaml/pull/162 + Output document end marker after open ended scalars + + - https://github.com/yaml/libyaml/pull/157 + change cmake target name from libOFF.a to libyaml.a + + - https://github.com/yaml/libyaml/pull/155 + include/yaml.h: fix comments + + - https://github.com/yaml/libyaml/pull/169 + Fixed missing token in example + + - https://github.com/yaml/libyaml/pull/127 + Avoid recursion in the document loader. + + - https://github.com/yaml/libyaml/pull/172 + Support %YAML 1.2 directives + + - https://github.com/yaml/libyaml/pull/66 + Change dllexport controlling macro to use _WIN32 + +0.2.2 2019-03-12 + + - https://github.com/yaml/libyaml/pull/95 + build: do not install config.h + + - https://github.com/yaml/libyaml/pull/97 + appveyor.yml: fix Release build + + - https://github.com/yaml/libyaml/pull/103 + Remove unused code in yaml_document_delete + + - https://github.com/yaml/libyaml/pull/104 + Allow colons in plain scalars inside flow collections + + - https://github.com/yaml/libyaml/pull/109 + Fix comparison in tests/run-emitter.c + + - https://github.com/yaml/libyaml/pull/117 + Fix typo error + + - https://github.com/yaml/libyaml/pull/119 + The closing single quote needs to be indented... + + - https://github.com/yaml/libyaml/pull/121 + fix token name typos in comments + + - https://github.com/yaml/libyaml/pull/122 + Revert removing of open_ended after top level plain scalar + + - https://github.com/yaml/libyaml/pull/125 + Cherry-picks from PR 27 + + - https://github.com/yaml/libyaml/pull/135 + Windows/C89 compatibility + + - https://github.com/yaml/libyaml/pull/136 + allow override of Windows static lib name + +0.2.1 2018-06-24 + + - https://github.com/yaml/libyaml/pull/10 + Support static and dynamic libraries + + - https://github.com/yaml/libyaml/pull/12 + Use .gitignore instead of .hgignore + + - https://github.com/yaml/libyaml/pull/13 + Add support for `make test` and travis + + - https://github.com/yaml/libyaml/pull/14 + Dockerfile for testing + + - https://github.com/yaml/libyaml/pull/15 + Apply old fix for `\/` that is not in master. + + - https://github.com/yaml/libyaml/pull/17 + Update license to include all years until now. + + - https://github.com/yaml/libyaml/pull/18 + Port bug fix from Perl binding + + - https://github.com/yaml/libyaml/pull/22 + Fix misspell: preceed + + - https://github.com/yaml/libyaml/pull/23 + Removed trailing-whitespaces + + - https://github.com/yaml/libyaml/pull/24 + Fix typo + + - https://github.com/yaml/libyaml/pull/25 + added an examples directory with a few yaml examples + + - https://github.com/yaml/libyaml/pull/26 + Added missing Cflags path in pkg-config file + + - https://github.com/yaml/libyaml/pull/31 + add unit tests to cmake configuration + + - https://github.com/yaml/libyaml/pull/32 + Include an example of a custom tag from Python + + - https://github.com/yaml/libyaml/pull/33 + Include an example of a %YAML tag + + - https://github.com/yaml/libyaml/pull/34 + Added an example of using a global tag + + - https://github.com/yaml/libyaml/pull/36 + Fix -Wformat compilation errors in tests + + - https://github.com/yaml/libyaml/pull/37 + Update bug report URL in LibYAML + + - https://github.com/yaml/libyaml/pull/38 + Use AM_CPPFLAGS since autotools deprecated INCLUDE + + - https://github.com/yaml/libyaml/pull/39 + Update bug report URL in README + + - https://github.com/yaml/libyaml/pull/41 + Add travis and Makefile support for libyaml-test + + - https://github.com/yaml/libyaml/pull/43 + Add Dockerfile for Fedora 25 + + - https://github.com/yaml/libyaml/pull/44 + WIP: Enable all warnings (-Wall) in libyaml and tests + + - https://github.com/yaml/libyaml/pull/45 + Fix typo + + - https://github.com/yaml/libyaml/pull/47 + Move travis script guts to separate file + + - https://github.com/yaml/libyaml/pull/48 + `yaml/libyaml-test` should become part of `yaml/libyaml` + + - https://github.com/yaml/libyaml/pull/50 + Add a GNUMakefile for immediate make targets + + - https://github.com/yaml/libyaml/pull/53 + Switch from test blacklist to whitelist + + - https://github.com/yaml/libyaml/pull/55 + Update defs for MingGW support on Windows + + - https://github.com/yaml/libyaml/pull/58 + Improve CMakeLists + + - https://github.com/yaml/libyaml/pull/64 + README: Update libyaml link + + - https://github.com/yaml/libyaml/pull/69 + Skip 5 tests in libyaml-emitter.list + + - https://github.com/yaml/libyaml/pull/74 + Forbid escaped singlequote in doublequotes + + - https://github.com/yaml/libyaml/pull/76 + Rewrite make test-suite + + - https://github.com/yaml/libyaml/pull/77 + Undefined PTRDIFF_MAX on HP-UX + + - https://github.com/yaml/libyaml/pull/78 + Fixed most compiler warnings -Wall -Wextra + + - https://github.com/yaml/libyaml/pull/82 + Move yaml-test-suite integration onto a separate branch. + + - https://github.com/yaml/libyaml/pull/86 + Fix problems in CI failures (travis and semaphore) + + - https://github.com/yaml/libyaml/pull/87 + appveyor.yml: add mingw-w64 builds + + - https://github.com/yaml/libyaml/pull/88 + add -no-undefined to src/Makefile.am + + - https://github.com/yaml/libyaml/pull/89 + Added alpine linux testing to dockerfiles + + - https://github.com/yaml/libyaml/pull/93 + remove need for PTRDIFF_MAX + + - https://github.com/yaml/libyaml/pull/94 + .gitignore: major cleanup + + - https://github.com/yaml/libyaml/pull/120 + Fix doc. + +0.1.7 2016-08-27 + + - Fixed segfault in yaml_string_write_handler. + + - Fixed invalid simple key assertion. + + - Fixed error handling in some examples (thank to Mathias Svensson). + + - Removed obsolete VS project files. + +0.1.6 2014-03-26 + + - https://github.com/yaml/libyaml/commit/d1003a9 + Fixed heap overflow in yaml_parser_scan_uri_escapes (Thanks + Ivan Fratric of the Google Security Team). + + - https://github.com/yaml/libyaml/commit/662f4be + Added tag 0.1.5 for changeset a5142b24428b + +0.1.5 2014-02-03 + + - https://github.com/yaml/libyaml/commit/303b455 + Manually define PTRDIFF_MAX for VS C compiler. + + - https://github.com/yaml/libyaml/commit/1ef1171 + Forgot to set the error state. + + - https://github.com/yaml/libyaml/commit/c9479c7 + Limit input size to SIZE_MAX/2. + + - https://github.com/yaml/libyaml/commit/c201bf6 + Guard against overflows in indent and flow_level. + + - https://github.com/yaml/libyaml/commit/bb8ab82 + Added .hgignore. + + - https://github.com/yaml/libyaml/commit/2d94fc5 + Prevent node index overflow (Reported by Florian Weimer). + + - https://github.com/yaml/libyaml/commit/df33f25 + Bumped the version number. + + - https://github.com/yaml/libyaml/commit/f56726b + Fixed invalid size_t->int cast (Thank to Florian Weimer). + + - https://github.com/yaml/libyaml/commit/01e8dad + Added a basic CMake project. + + - https://github.com/yaml/libyaml/commit/f54fc40 + Added tag 0.1.4 for changeset 3e6507fa0c26 + +0.1.4 2012-12-24 + + - Fixed a bug that prevented an empty mapping being used as a simple key + (thank to spitzak(at)rhythm(dot)com). + + - Fixed pointer overflow when calculating the position of a potential + simple key (thank to ppelletier(at)oblong(dot)com). + + - Fixed yaml.dll not exporting any symbols + (thank to pxn11432(at)nifty(dot)com). + + - Added pkg-config support (thank to rainwoodman(at)gmail(dot)com). + +0.1.3 2009-08-29 + + - This release fixes non-standard structure initialization and + a streaming-related issue. + +0.1.2 2008-12-27 + + - Minor bugfix release + +0.1.1 2006-08-01 + + - https://github.com/yaml/libyaml/commit/5e52c31 + Fixed a problem when the DOCUMENT-END event is not emitted until + the beginning of the next document is available. Fixed #51. + Thanks edward(at)sweetbytes.net for the bug report. + + - https://github.com/yaml/libyaml/commit/dd71484 + Add project files for Visual Studio 2003. + + - https://github.com/yaml/libyaml/commit/ce8a93e + Fix the example_deconstructor project. + + - https://github.com/yaml/libyaml/commit/c9b74de + Eliminate some warnings and add more doxygen definitions. + + - https://github.com/yaml/libyaml/commit/0122490 + Undefine the NDEBUG directive for the test programs. + + - https://github.com/yaml/libyaml/commit/071329a + Fix a bug in the emitter introduced while fixing warnings for VC6. + + - https://github.com/yaml/libyaml/commit/6f6bbb8 + Add VC6 projects for the test executables. + + - https://github.com/yaml/libyaml/commit/0174ed6 + Add win32 fixes and project files for VC6. + + - https://github.com/yaml/libyaml/commit/e27a3c8 + Add functions for constructing, parsing and emitting YAML documents. + + - https://github.com/yaml/libyaml/commit/a907bf8 + Add `const` qualifier for `yaml_parser_set_input_string` parameter `input`. + + - https://github.com/yaml/libyaml/commit/c83b67a + Force a new line at the end of the input stream even if there + are no a new line character. This fixes a nasty bug when libyaml hangs on + documents like `[[[[`. Thanks ciaranm for reporting the bug. + + - https://github.com/yaml/libyaml/commit/609cce0 + Older versions of gcc do not know about -Wno-pointer-sign. + +0.0.1 2006-08-01 + + - Initial release diff --git a/contrib/libyaml/License b/contrib/libyaml/License new file mode 100644 index 000000000000..3d82c281ee8c --- /dev/null +++ b/contrib/libyaml/License @@ -0,0 +1,20 @@ +Copyright (c) 2017-2020 Ingy döt Net +Copyright (c) 2006-2016 Kirill Simonov + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/contrib/libyaml/Makefile.am b/contrib/libyaml/Makefile.am new file mode 100644 index 000000000000..551c74071f7a --- /dev/null +++ b/contrib/libyaml/Makefile.am @@ -0,0 +1,54 @@ +## Run `./bootstrap` to generate the "Makefile.in" files in this directory and +## the "$SUBDIRS" subdirectories. + +SUBDIRS = include src . tests + +EXTRA_DIST = Changes ReadMe.md License CMakeLists.txt doc/doxygen.cfg + +LIBYAML_TEST_SUITE_RUN_REPO_DEFAULT := https://github.com/yaml/libyaml +LIBYAML_TEST_SUITE_RUN_REPO ?= $(LIBYAML_TEST_SUITE_RUN_REPO_DEFAULT) +LIBYAML_TEST_SUITE_RUN_BRANCH ?= run-test-suite + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = yaml-0.1.pc + +maintainer-clean-local: + rm -f aclocal.m4 config.h.in configure config/* + -find ${builddir} -name Makefile.in -exec rm -f '{}' ';' + +distclean-local: + rm -fr tests/run-test-suite packaging + -git worktree prune + +.PHONY: bootstrap +bootstrap: maintainer-clean + ./bootstrap + ./configure + make + +test: all + make -C tests check-TESTS + +test-suite: tests/run-test-suite all + make -C $< test + +test-all: test test-suite + +tests/run-test-suite: +ifeq ($(LIBYAML_TEST_SUITE_RUN_REPO),$(LIBYAML_TEST_SUITE_RUN_REPO_DEFAULT)) + -git branch --track $(LIBYAML_TEST_SUITE_RUN_BRANCH) origin/$(LIBYAML_TEST_SUITE_RUN_BRANCH) + -git worktree prune + git worktree add $@ $(LIBYAML_TEST_SUITE_RUN_BRANCH) + else + git clone --branch $(LIBYAML_TEST_SUITE_RUN_BRANCH) $(LIBYAML_TEST_SUITE_RUN_REPO) $@ + endif + +packaging: + -git branch --track $@ origin/$@ + git worktree add --force $@ $@ + +docker-dist: packaging + make -C $ To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: d9b415c9f1c8 - stable/14 - flua: add freebsd module implementing kldload/kldunload 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d9b415c9f1c8201e828dfc08640927eca8b2f64c Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=d9b415c9f1c8201e828dfc08640927eca8b2f64c commit d9b415c9f1c8201e828dfc08640927eca8b2f64c Author: Baptiste Daroussin AuthorDate: 2024-09-06 09:00:50 +0000 Commit: Baptiste Daroussin CommitDate: 2025-07-08 14:23:50 +0000 flua: add freebsd module implementing kldload/kldunload Reviewed by: markj, imp Approved by: imp Differential Revision: https://reviews.freebsd.org/D46558 --- etc/mtree/BSD.usr.dist | 4 + lib/flua/libfreebsd/Makefile | 3 + lib/flua/libfreebsd/sys/Makefile | 4 + lib/flua/libfreebsd/sys/linker/Makefile | 12 +++ .../libfreebsd/sys/linker/freebsd.sys.linker.3lua | 67 +++++++++++++ .../libfreebsd/sys/linker/lua_freebsd_sys_linker.c | 104 +++++++++++++++++++++ 6 files changed, 194 insertions(+) diff --git a/etc/mtree/BSD.usr.dist b/etc/mtree/BSD.usr.dist index 70dbd2b0eef2..3ff04fe4e716 100644 --- a/etc/mtree/BSD.usr.dist +++ b/etc/mtree/BSD.usr.dist @@ -74,6 +74,10 @@ engines-3 .. flua + freebsd + sys + .. + .. .. i18n .. diff --git a/lib/flua/libfreebsd/Makefile b/lib/flua/libfreebsd/Makefile new file mode 100644 index 000000000000..6ed0451055ff --- /dev/null +++ b/lib/flua/libfreebsd/Makefile @@ -0,0 +1,3 @@ +SUBDIR+= sys + +.include diff --git a/lib/flua/libfreebsd/sys/Makefile b/lib/flua/libfreebsd/sys/Makefile new file mode 100644 index 000000000000..9f38294536f2 --- /dev/null +++ b/lib/flua/libfreebsd/sys/Makefile @@ -0,0 +1,4 @@ +SUBDIR+= linker + +.include + diff --git a/lib/flua/libfreebsd/sys/linker/Makefile b/lib/flua/libfreebsd/sys/linker/Makefile new file mode 100644 index 000000000000..318cc5078b33 --- /dev/null +++ b/lib/flua/libfreebsd/sys/linker/Makefile @@ -0,0 +1,12 @@ +SHLIB_NAME= linker.so +SHLIBDIR= ${LIBDIR}/flua/freebsd/sys + +SRCS+= lua_freebsd_sys_linker.c + +CFLAGS+= \ + -I${SRCTOP}/contrib/lua/src \ + -I${SRCTOP}/lib/liblua \ + +MAN= freebsd.sys.linker.3lua + +.include diff --git a/lib/flua/libfreebsd/sys/linker/freebsd.sys.linker.3lua b/lib/flua/libfreebsd/sys/linker/freebsd.sys.linker.3lua new file mode 100644 index 000000000000..0ab8f185388a --- /dev/null +++ b/lib/flua/libfreebsd/sys/linker/freebsd.sys.linker.3lua @@ -0,0 +1,67 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.\" Copyright (c) 2024, Baptiste Daroussin +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.Dd September 6, 2024 +.Dt FREEBSD.SYS.LINKER 3lua +.Os +.Sh NAME +.Nm freebsd.sys.linker +.Nd Lua binding to +.Fx 's +Linker functions +.Sh SYNOPSIS +.Bd -literal +local linker = require('freebsd.sys.linker') +.Ed +.Pp +.Bl -tag -width XXXX -compact +.It Dv fileid, err, errno = linker.kldload(name) +.It Dv ok, err, errno = linker.kldunload(fileid|name) +.El +.Sh DESCRIPTION +The +.Nm +module is a binding to the +.Fx 's +linker functions. +List of functions: +.Bl -tag -width XXXX +.It Dv fileid, err = freebsd.sys.linker.kldload(name) +Load the kernel module named +.Fa name +and return the identifier +.Pq fileid +as an interger. +.It Dv ok, err, errno = freebsd.sys.linker.kldunload(fileid|name) +Unload the kernel module identifier either by +.Fa name +as a string, or +.Fa fileid +as an integer. +.El +.Sh SEE ALSO +.Xr kldload 2 , +.Xr kldunload 2 diff --git a/lib/flua/libfreebsd/sys/linker/lua_freebsd_sys_linker.c b/lib/flua/libfreebsd/sys/linker/lua_freebsd_sys_linker.c new file mode 100644 index 000000000000..a2dc3b487525 --- /dev/null +++ b/lib/flua/libfreebsd/sys/linker/lua_freebsd_sys_linker.c @@ -0,0 +1,104 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2024, Baptiste Daroussin + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + + +#include +#include + +#include +#include +#include + +#include +#include +#include + +int luaopen_freebsd_sys_linker(lua_State *L); + +static int +lua_kldload(lua_State *L) +{ + const char *name; + int ret; + + name = luaL_checkstring(L, 1); + ret = kldload(name); + if (ret == -1) { + lua_pushnil(L); + lua_pushstring(L, strerror(errno)); + lua_pushinteger(L, errno); + return (3); + } + lua_pushinteger(L, ret); + return (1); +} + +static int +lua_kldunload(lua_State *L) +{ + const char *name; + int ret, fileid; + + if (lua_isinteger(L, 1)) { + fileid = lua_tointeger(L, 1); + } else { + name = luaL_checkstring(L, 1); + fileid = kldfind(name); + } + if (fileid == -1) { + lua_pushnil(L); + lua_pushstring(L, strerror(errno)); + lua_pushinteger(L, errno); + return (3); + } + ret = kldunload(fileid); + lua_pushinteger(L, ret); + if (ret == -1) { + lua_pushnil(L); + lua_pushstring(L, strerror(errno)); + lua_pushinteger(L, errno); + return (3); + } + lua_pushinteger(L, 0); + return (1); +} + +#define REG_SIMPLE(n) { #n, lua_ ## n } +static const struct luaL_Reg freebsd_sys_linker[] = { + REG_SIMPLE(kldload), + REG_SIMPLE(kldunload), + { NULL, NULL }, +}; +#undef REG_SIMPLE + +int +luaopen_freebsd_sys_linker(lua_State *L) +{ + luaL_newlib(L, freebsd_sys_linker); + + return (1); +} From nobody Tue Jul 8 14:32:12 2025 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 4bc3Tn1NzDz614cp; Tue, 08 Jul 2025 14:32:13 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bc3Tm6gfgz49Km; Tue, 08 Jul 2025 14:32:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751985132; 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=b3Rtm+5oyelrIul1DikFteLOwD4QMsITchPcjqdLwaA=; b=fliDJNUdymeK8a6gFe+E9IrdjewxzpSCUc50z4CbuQiOuikz4q7buD725qnuD0LZbS6+hq coKcPVFkuw1Gj36tfo82yY1fl7dQ40xg83vXwVSxnJrj5reWUHYLZWmcA1USxGnKfRN1Ne qA8GTK55wUsvKToNUYqkz3xDMxjyO0y/bho72uOE6Q8ALoXQloX9PZZuLIXrzB34CPNnUd iR/WdBZ4is3XrlQtP011ECgqaFPe43ric8BTYIVVKBF/GU2GjGP2Ot8RENodBqUEi9Pixa o9V8I8PmQ8Sx9frpgpoBbl4STe6bO1HJwgC7GlFP/AF2wJXly9En9eLqsHtd9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751985132; 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=b3Rtm+5oyelrIul1DikFteLOwD4QMsITchPcjqdLwaA=; b=uD3EnvVWDqOaeYttlFe4qnYBs9NSxmea5jxj4HuDsUhsSvL5CpZJncKafWUUMvxLraDWSy dzjIG5OrZc4JhPySeWO7CrYPpDFcAMK+UhYiAkzx2Zkbs2V11fhkLAl2JoUkqllo4qDwAs wupJTJMEPSUJZ/BJsNyUCoRL7m4ECMHgBWMPCNISYxMmw+gUwVPNu53rY/9CdBYDHLLGUN /uLJ5LUdwR2tmpTeL6sAAGDmI/sqsEbL59W6rrNiX1J5hHUJmhxqn63pfe1zN1iIpr+WEr +3BbgyXjb1XSlZuOrTXJefgroko/TXKFGg4ZEb9JuG7LpzKOhpW5ugk3oRSs/Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751985132; a=rsa-sha256; cv=none; b=vbTyu9VqOCn7ThiQ/NZ/KZZ+jBBohafDSVmbTYnt8fqiRBUGwsnIsN+b28fsp7sjq3gN8f Iztv5njAPnVgiquuGzZW5DHejIj1YT53xIqQx/lqcXzltXMP2F11W248Guhn+hSswfgPth 5GDrcuVhAMGlESDnjK2xb2BpOTSeqJd5QZwTiQZ5D5dxI3gjMmRi83FzeFhfRnYt6xm2TA ke2AJ5icvFPcqpVbLhLDaCAkfujXx6rxLJAdpNhFCZbsr5CA9XQP7Xod4B3dhC6dbC5Ya3 WiUhpYQEt3QuXvl6MMizudktJAhSkCZDjT69B1CquXI86Yd41GU19P7VjOm28Q== 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 4bc3Tm6HBRzh32; Tue, 08 Jul 2025 14:32:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 568EWCjk072065; Tue, 8 Jul 2025 14:32:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 568EWCZj072062; Tue, 8 Jul 2025 14:32:12 GMT (envelope-from git) Date: Tue, 8 Jul 2025 14:32:12 GMT Message-Id: <202507081432.568EWCZj072062@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: 2cab763fc87f - stable/14 - freebsd.sys.linker: rename source file 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 2cab763fc87f316a5a2972f9e7feaf5ed41ebcd1 Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=2cab763fc87f316a5a2972f9e7feaf5ed41ebcd1 commit 2cab763fc87f316a5a2972f9e7feaf5ed41ebcd1 Author: Baptiste Daroussin AuthorDate: 2024-09-06 15:35:28 +0000 Commit: Baptiste Daroussin CommitDate: 2025-07-08 14:24:05 +0000 freebsd.sys.linker: rename source file Suggested by: markj (cherry picked from commit 705583b76f3fba9e8c3cf77142e8ac84de721ac1) --- lib/flua/libfreebsd/sys/linker/Makefile | 2 +- lib/flua/libfreebsd/sys/linker/{lua_freebsd_sys_linker.c => linker.c} | 0 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/flua/libfreebsd/sys/linker/Makefile b/lib/flua/libfreebsd/sys/linker/Makefile index 318cc5078b33..572b5949d2a1 100644 --- a/lib/flua/libfreebsd/sys/linker/Makefile +++ b/lib/flua/libfreebsd/sys/linker/Makefile @@ -1,7 +1,7 @@ SHLIB_NAME= linker.so SHLIBDIR= ${LIBDIR}/flua/freebsd/sys -SRCS+= lua_freebsd_sys_linker.c +SRCS+= linker.c CFLAGS+= \ -I${SRCTOP}/contrib/lua/src \ diff --git a/lib/flua/libfreebsd/sys/linker/lua_freebsd_sys_linker.c b/lib/flua/libfreebsd/sys/linker/linker.c similarity index 100% rename from lib/flua/libfreebsd/sys/linker/lua_freebsd_sys_linker.c rename to lib/flua/libfreebsd/sys/linker/linker.c From nobody Tue Jul 8 14:32:10 2025 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 4bc3Tl30L0z614cn; Tue, 08 Jul 2025 14:32:11 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bc3Tk5Ld7z49FB; Tue, 08 Jul 2025 14:32:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751985130; 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=4ZQ5yH17WcI064Aim1XM2iSKHAQvY3P0HPOFeXuCZSQ=; b=EuWURrlq1iubzdY6bkS8FvyWsMYxJRlMCJGLzH/LrYmVenUQJYQ0ybYykZH1VTyhz6ugWx b/JdzfZvvr7UMErmeXktDfvYLCJ7vM1NMUBSu5ezbzAPjuL34GWRYx6X7l8ol2VILaazTI bUBNpSZDZJUoEhGrTYflgDFZ7xp1Sh2UEzqEX1HYzuAi1ceTJfqclSaEzcZTn5CPBT0jMY e2Z0blcN1NC7atftX9SRTD7uv3x96Cwgq7WU9B5GdF68UJfxTVdFt+qZUkAN31v8AbIthi bZTTqWhoH3lY6eNcvbc4+XulftsCUVD/BW/yQbbNubCWdQILmKKxjLxtR1cyAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751985130; 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=4ZQ5yH17WcI064Aim1XM2iSKHAQvY3P0HPOFeXuCZSQ=; b=jc4o5RXjM9CVYYhGGaL4+zhSvnWBA2vMPtzigbiNaTAgBFGy911k4KoPm0y4VMYmpyG+iS JPb5aDp+HJ6w66YSqkWrwPnAcvIUc3+iCKTlazgk4tjrB5GTzX/U6+RBn+k2BCl07bdaVk 5EDyP5fA/nibD95KYibkFlUA7DetfuV+CRFTeDwa0lTaP/dCSPUOkkmYbgqDAmnnRNShoh oLxIkRgSx9zkbfuBeK5wNKdzimzh/I+O5N/IyK/VMt1f6u2CDlPQSzYB9VvNMwzQn/NYp8 UVghuMWuGI65MZ7r2DdT3oZ8dNklahxhPZ6R1piu+5tMxkSdowPaBN/KpJGTKw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751985130; a=rsa-sha256; cv=none; b=thnYJVWCHB0/AvkcBXbYbn0dHWrfwBeWMrLh+GopMR0WGdGMMslZtePVkDnRD61psGBUNE XqNeeuDycBl9hVtZY82e5Q+qRQCmuV7l5kmXhubsUTf82pb0wGJZQ82xYBNhvxAGe/YIE3 U5MxKdmcXdR+Eq4EtqYsvfWDD7SpXqBtL/XnCgKNj/7OijUSbjO2Wt1cLZXdYNBYN9nIQB hLjegrnny0F4TLAkTdgbonIG4e+9mdKf/G8eJ/TSmr7Vrq0kA5jIUvSICpBT1ovvyLHY+c qS3U039KqFDkr+zuhF+ctK8bHjjchipbiVSSJGYqLAo38m5OyuvNKtirPfG/Wg== 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 4bc3Tk4PXPzgxF; Tue, 08 Jul 2025 14:32:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 568EWA6S071999; Tue, 8 Jul 2025 14:32:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 568EWAvO071996; Tue, 8 Jul 2025 14:32:10 GMT (envelope-from git) Date: Tue, 8 Jul 2025 14:32:10 GMT Message-Id: <202507081432.568EWAvO071996@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: e6e6ac56887b - stable/14 - flua: make the ucl module a dynamic module 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e6e6ac56887b6072cc6cafce454cb0ef3a4e6ad9 Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=e6e6ac56887b6072cc6cafce454cb0ef3a4e6ad9 commit e6e6ac56887b6072cc6cafce454cb0ef3a4e6ad9 Author: Baptiste Daroussin AuthorDate: 2024-09-06 15:13:08 +0000 Commit: Baptiste Daroussin CommitDate: 2025-07-08 14:17:08 +0000 flua: make the ucl module a dynamic module Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D46569 (cherry picked from commit bb2d016afb009920f4bb2400c15a86e557b2d55a) --- lib/flua/Makefile | 1 + lib/flua/libucl/Makefile | 17 +++++++++++++++++ libexec/flua/Makefile | 9 ++------- libexec/flua/linit_flua.c | 2 -- 4 files changed, 20 insertions(+), 9 deletions(-) diff --git a/lib/flua/Makefile b/lib/flua/Makefile index 769736039f7e..168d05f54674 100644 --- a/lib/flua/Makefile +++ b/lib/flua/Makefile @@ -1,4 +1,5 @@ SUBDIR+= libhash SUBDIR+= libjail +SUBDIR+= libucl .include diff --git a/lib/flua/libucl/Makefile b/lib/flua/libucl/Makefile new file mode 100644 index 000000000000..7d2681b85fcb --- /dev/null +++ b/lib/flua/libucl/Makefile @@ -0,0 +1,17 @@ +SHLIB_NAME= ucl.so +SHLIBDIR= ${LIBDIR}/flua + +WARNS= 2 + +UCLSRC?= ${SRCTOP}/contrib/libucl +.PATH: ${UCLSRC}/lua +SRCS+= lua_ucl.c +CFLAGS+= \ + -I${SRCTOP}/contrib/lua/src \ + -I${SRCTOP}/lib/liblua \ + -I${UCLSRC}/include \ + -I${UCLSRC}/src \ + -I${UCLSRC}/uthash +LIBADD+= ucl + +.include diff --git a/libexec/flua/Makefile b/libexec/flua/Makefile index f79b00d0bbf9..4173e43baab2 100644 --- a/libexec/flua/Makefile +++ b/libexec/flua/Makefile @@ -5,7 +5,8 @@ LUASRC?= ${SRCTOP}/contrib/lua/src .PATH: ${LUASRC} PROG= flua -WARNS?= 2 +WARNS?= 3 +MAN= # No manpage; this is internal. CWARNFLAGS.gcc+= -Wno-format-nonliteral @@ -31,10 +32,4 @@ LIBADD+= edit LDFLAGS+= -Wl,-E .endif -UCLSRC?= ${SRCTOP}/contrib/libucl -.PATH: ${UCLSRC}/lua -SRCS+= lua_ucl.c -CFLAGS+= -I${UCLSRC}/include -I${UCLSRC}/src -I${UCLSRC}/uthash -LIBADD+= ucl - .include diff --git a/libexec/flua/linit_flua.c b/libexec/flua/linit_flua.c index 6bc300095c27..87cabb58deb2 100644 --- a/libexec/flua/linit_flua.c +++ b/libexec/flua/linit_flua.c @@ -35,7 +35,6 @@ #include "lauxlib.h" #include "lfs.h" #include "lposix.h" -#include "lua_ucl.h" /* ** these libs are loaded by lua.c and are readily available to any Lua @@ -60,7 +59,6 @@ static const luaL_Reg loadedlibs[] = { {"posix.sys.stat", luaopen_posix_sys_stat}, {"posix.sys.utsname", luaopen_posix_sys_utsname}, {"posix.unistd", luaopen_posix_unistd}, - {"ucl", luaopen_ucl}, {NULL, NULL} }; From nobody Tue Jul 8 14:32:13 2025 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 4bc3Tp2KH4z614r9; Tue, 08 Jul 2025 14:32:14 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bc3Tp0BY2z49SY; Tue, 08 Jul 2025 14:32:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751985134; 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=3h4am86X8tBto9PuPM1YuCda61HuV4wLCTS1s73az3g=; b=Aw2DFCv1mH//iZxRt/plZhszzxHKoU39y0i4DEP3mJjdexOG7GFjwBBBqa+Xag16cf/a/4 A+paHTSxm+tCnzQzGjAx1HmsJ5ClhhCV/QVGA6Oc8TTP2901E6NZrKn2rYiHQdT119CojW tzV2n74sggVYOhnyVPCLZ42WjNRy5bEVltvSbTqLc1Z2DrP+gFaEv+eD8vL+GR7hXzmJf8 058gi9WjWD636EixVf8VR7zdDYjn2ZZSwQCS9CHv3Gi0CbyOa6O3zNawc9H3YaxQb+upbc RWd4Ydl8hjA5gBWPw/+TO8P1Lzk6ogcNUtN13OB/V1Q9rNWjVirDx/XnLjPKig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751985134; 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=3h4am86X8tBto9PuPM1YuCda61HuV4wLCTS1s73az3g=; b=bpOdyzYT64oUsRltSCwKabEBcBmd4DW6P/RNtm0Dbpyj5s4f7oB0tl3YOcJZjCfBBWL0/K FRPPPZzMFjGjeLBOkYO8vPqOHc/Zsp8kctrWP8rsPSATPP85BSu8HXdTA33P2BsyY75u6s 47Utj5JsPbYL5UugA7IeBt1gNUEAVU2265DbXQsW+WZilGZ0WNdH2ZR1uZ89YYmSKMw2Vs yLkG0XPzjT+zYO099SKJbD3QcTF2m+gHyj1vTtcVaDaMwnwRqYaMAo02A2cPsBjHmVJpzu hyjfPX9x26BBGWAXaIQv+OB4Cl6bbHZzZ7Zemo01a9PYHI/sd1e9mV8sPsi91Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751985134; a=rsa-sha256; cv=none; b=Q58VhUzlYtrIlfyl9SwnYbE2LbkqJwMHn9XKzYa4WUapqOBvJaHIlqj4BfbRZs6mlWRluD Wm+ZlDQP0Ieypscf+nQU8uxW+6wph3hUniE7tnn0iyluc6PaQTNOsjdIdMC/f2xaYPGFK+ sU2mB0CifwEFbnWhCycOesXYzSvxlpuiT58T2zZDfxTxXTx80Sfvtosh6BKtsv9QRPC+Ua druhnsnO09eeb1TVIekgsSw6DqhPk35yCVbGSQq6mPa5aqUU7Pu0YVWIwGRnVn3sj5DPH0 VAXIdPlqsawZn9BZJ6dQuzPOCIrxUOSCYNVLgl4kRlZk2wPvYjz0lk5NVV1O4g== 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 4bc3Tn6rSnzhD6; Tue, 08 Jul 2025 14:32:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 568EWD90072097; Tue, 8 Jul 2025 14:32:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 568EWDuj072094; Tue, 8 Jul 2025 14:32:13 GMT (envelope-from git) Date: Tue, 8 Jul 2025 14:32:13 GMT Message-Id: <202507081432.568EWDuj072094@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: 15c15f78b120 - stable/14 - lua_ucl: make sure flua gets build after libucl 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 15c15f78b1209eead6d81f54d94aa7fd1915d5eb Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=15c15f78b1209eead6d81f54d94aa7fd1915d5eb commit 15c15f78b1209eead6d81f54d94aa7fd1915d5eb Author: Baptiste Daroussin AuthorDate: 2024-09-06 15:49:16 +0000 Commit: Baptiste Daroussin CommitDate: 2025-07-08 14:24:27 +0000 lua_ucl: make sure flua gets build after libucl --- lib/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Makefile b/lib/Makefile index 1b848ad77caa..855d7ca0279e 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -151,7 +151,7 @@ SUBDIR_DEPEND_nss_tacplus= libtacplus .if !defined(COMPAT_LIBCOMPAT) SUBDIR+= flua -SUBDIR_DEPEND_flua= libjail +SUBDIR_DEPEND_flua= libjail libucl .endif # NB: keep these sorted by MK_* knobs From nobody Tue Jul 8 14:32:14 2025 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 4bc3Tq4f8Fz614nw; Tue, 08 Jul 2025 14:32:15 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bc3Tq0vvXz49Kx; Tue, 08 Jul 2025 14:32:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751985135; 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=jHz2FzCrLj/KK15xxcagLvtHs2h7I032sLR1Y1KACOk=; b=GVjjtthGtfmbzuyawc76MNmMX9g9fSHdvAaFBSs7If7gSptFUA2kzmm9zxDbziL4nSCNoo lDBoiZ79FblS60BUnCr6o/W3ljYUlHKVCMj4mTXo2mEZ0XLA4zZBqFIbMlo7hcgoTBfCy8 sqHJzEYuUROtJWiuLp2ftGJ6+ktzQWiqYUE8e4xKxmS0UI8r2eNeej+rthG8EDqR9U6n/Y ArseO4UV6EyyqepVTv7gclmySY2Mi75wqeDLCl3SvgRsmX/JvQo9dWI7hVNgmcfDXQ+EGc s7XnqML3fx5YCH9WdrS7iQzw7eiGsq6Lfp0fY7hfG1nJ/625NcX5cWtwCgBkEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751985135; 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=jHz2FzCrLj/KK15xxcagLvtHs2h7I032sLR1Y1KACOk=; b=J73jgzraawh/e7BgrbwXyxcKTPi8f3GSMpxSARQCGroVLu/o24SuXqeyB6witebuf7ZZGS S7nUuwuUJU6ahsadgs0D6nMlJ3gY9BnYqY2ZXvSga2xaWmHHPEGdhgBzzPHNWyWJoiSai9 BBJTsybt7xLyP90xLZV6RAUINruAbzvmUZ/eKAjW2EHqfAsdEl3hU/9G6J5KvbvSwF1p6z BNKvWaX97zzHuWQF1SstrJoWnWCiplk8dnyrRtP0K48iXatUYH4SonlxpQ8xa+F8PsiAax qQIzPmWdoWGiHSFgdxKP/CouYjKcIcXou4zm0U2k6JFzD3F+KHltSKW2L9QR6w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751985135; a=rsa-sha256; cv=none; b=YTVuvmz6gxIVEUlKaMtFvFR8ZZ9bah3JUMY0Sehlg6oQSH9moS6Wrh2qg090EoB4xFXqCq h9skt7bLwqmIKC8wvi2o5Q54TxRq1dm/sUwmiS9L9xTX8zKYMpiGLKNkFSvv9ZmjbhZK1d mOuiUsLf4+iP8US07urymkcnKTfr1hSBhBlA8Fh5oAgD8RRMdG32sZ7+JGzwg8xIpEUiBM HzlZaZ0UlzK49KtkOIDv42ImH82Vremayz2YWynsvl+KW6SFKtRA6hMOlqUSmEu8uRJSLI ifeLwJLdbKXad5s4oBw6mn8y77EbTlLHTXUa9vrsInuqxQOLDjBEnc5ydTRYFA== 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 4bc3Tq0SzkzhJQ; Tue, 08 Jul 2025 14:32:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 568EWE9h072129; Tue, 8 Jul 2025 14:32:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 568EWELS072126; Tue, 8 Jul 2025 14:32:14 GMT (envelope-from git) Date: Tue, 8 Jul 2025 14:32:14 GMT Message-Id: <202507081432.568EWELS072126@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: c3d3155c55ce - stable/14 - flua: hook libfreebsd to the build 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c3d3155c55cec77a7fb3dc9e44f24bdb6ae9ea84 Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=c3d3155c55cec77a7fb3dc9e44f24bdb6ae9ea84 commit c3d3155c55cec77a7fb3dc9e44f24bdb6ae9ea84 Author: Baptiste Daroussin AuthorDate: 2024-09-06 15:52:08 +0000 Commit: Baptiste Daroussin CommitDate: 2025-07-08 14:24:52 +0000 flua: hook libfreebsd to the build --- lib/flua/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/flua/Makefile b/lib/flua/Makefile index 168d05f54674..d88e76f61062 100644 --- a/lib/flua/Makefile +++ b/lib/flua/Makefile @@ -1,3 +1,4 @@ +SUBDIR+= libfreebsd SUBDIR+= libhash SUBDIR+= libjail SUBDIR+= libucl From nobody Tue Jul 8 14:32:16 2025 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 4bc3Tr41m3z614nx; Tue, 08 Jul 2025 14:32:16 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bc3Tr1b10z49L3; Tue, 08 Jul 2025 14:32:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751985136; 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=3V1NBLT5v8sQwIQKYxLokBcxbB1UzjgSQ9ZgYOgokc0=; b=XZi3fNmpT3kL41F0MvsWP4inquxRteSM5OwLBUDR+z+u7Wjc7sZH9GSUQxcR+FfGdbK+rE CDaVDpfBME8FzQr3i+3R5VPkwJ+PLYZEKMui2LG8LaN9sh8iDvCRGYBhy8suxHxA6ikQIb yaxz4tFgO9PkguMtZWYGechGXENheGXKq8IU4wnv2uoc+IJLAtBdi8jUY2ukn1Fo38sex8 8bmyoHxRrzPUwQgtgYwVEvFTR2zaBNexD/XogCHXWkJbw+BpcgCg20146msz0OFAbMCAHk /LUZm5rWMbIWLArqFf9SnmRIPD2yDfq39MQEenvw5tIOdjHglwC6z/p33SkF1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751985136; 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=3V1NBLT5v8sQwIQKYxLokBcxbB1UzjgSQ9ZgYOgokc0=; b=ElIUDOcXP5pEjwtanM7ndcRw4B4JZfzOaeq/hQswoyKFwslrcuhr0pv+T/q7oMsAX6lBgH scaLaEzB6XDYk/Xg6rlJgDdDZg01gUk84ZzMchDXURlHsbgfs6onDxtMNTga69bUflCMpC mzo990vRC0lEKjWrFFza2aZp63NaaFNirco7BHiq0BdrwjI6mRgFNcejcWqgp05b5NjtrL wfVai3N3ACkpbvgks+kA21ZYP9oNKidU7bqozgu4slK26v1uawVugCsfcnAM/Xs0bnLAUK lN5WzOSX1ckjOAti3RbEySftqifdD0eHOHSPjWjKV2hCeGr0Pb3j3wOI6QbWYQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751985136; a=rsa-sha256; cv=none; b=s9xYyaV5sirKgOSBezgsxG33X7VjX4gsNA9vDRY4J90f/yDDb9ZIn0WQaZeavFSm0HvMUZ YsZ5Cwwd2J5Z9UREYtJCt/AUV0aCRc1ucvj7ySn/Gxjy3ZM2sFHaWFINjDM6YNKv2MKBfI EUPmcAF0xr8erf38ueLny+OnCNl15StM6+XTMNB5F+gSLaXpxR5NdA7lGNCtxT7WhDDYyc D6PVocM2DMv85NTOuxNuIfVEKFqHDmpJIGZUaS1+kToB8SH+DB+mprC+o+PlZ0U3bo5DkB r7q1+sTRM4moyXs1WoZgwUybv5J16dk1EIHvnjEWNAmYjx/F4eCOGS6LJEh0oQ== 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 4bc3Tr17RSzgxJ; Tue, 08 Jul 2025 14:32:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 568EWGHp072165; Tue, 8 Jul 2025 14:32:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 568EWGE5072162; Tue, 8 Jul 2025 14:32:16 GMT (envelope-from git) Date: Tue, 8 Jul 2025 14:32:16 GMT Message-Id: <202507081432.568EWGE5072162@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: 96c10cda41ee - stable/14 - flua: fix buildworld from a clean room 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 96c10cda41eee13182d1ac8b9e0842e5244711bf Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=96c10cda41eee13182d1ac8b9e0842e5244711bf commit 96c10cda41eee13182d1ac8b9e0842e5244711bf Author: Baptiste Daroussin AuthorDate: 2024-09-07 11:25:43 +0000 Commit: Baptiste Daroussin CommitDate: 2025-07-08 14:25:44 +0000 flua: fix buildworld from a clean room now that the flua ucl module is built the lib directory, it is being build at a moment where it cannot link yet to libucl, push libucl in the _prebuild_libs to ensure it is present in a path to be linked against at the time the lua ucl module is being built. While here, remove libucl from boostrap as a dependence of flua as it is not needed anymore now that flua ucl module is dynamically loadable. --- Makefile.inc1 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index d218ee62e697..656f2df9c9f8 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -2456,8 +2456,8 @@ ${_bt}-usr.sbin/kldxref: ${_bt_libelf_depend} # 13.0-CURRENT cycle, thus needs to be built on -older releases and stable # branches. .if ${BOOTSTRAPPING} < 1300059 -${_bt}-libexec/flua: ${_bt}-lib/liblua ${_bt}-lib/libucl -_flua= lib/liblua lib/libucl libexec/flua +${_bt}-libexec/flua: ${_bt}-lib/liblua +_flua= lib/liblua libexec/flua .endif # r245440 mtree -N support added @@ -3178,7 +3178,8 @@ _prebuild_libs= ${_kerberos5_lib_libasn1} \ lib/libutil lib/libpjdlog ${_lib_libypclnt} lib/libz lib/msun \ lib/libxo \ ${_secure_lib_libcrypto} ${_secure_lib_libssl} \ - ${_lib_libldns} ${_secure_lib_libssh} + ${_lib_libldns} ${_secure_lib_libssh} \ + lib/libucl .if ${MK_DIALOG} != "no" _prebuild_libs+= gnu/lib/libdialog From nobody Tue Jul 8 14:32:22 2025 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 4bc3Tz1rNpz614bV; Tue, 08 Jul 2025 14:32:23 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bc3Ty6SCcz49Qd; Tue, 08 Jul 2025 14:32:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751985142; 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=JtvEmMV8Y+do7CSsahiF762N59r8mQtjDzDyFxEPXpw=; b=Z9XF7ZcMXTEG8R6aOfLRM32vypp4jwo21X/W3MwumnEInEx1MrkauzY/YjtvdAWexxkPDw K0O2D15sUYu3N41VIQNJ4vmCbUteXUGgUdNXfygjJNkssufelxyRV3YXAb/3iNOh0Qdrzd +cGGhvQ16kecqQodbxybzTSLs7nuyYb6VWIYpn9oK7VlIfB641aogWxdqoDjKumv+YrOck iObL/PrWzfOY/aXLAHf/1EmoBuUBig93FyOM4yWQXhc89l5QDb0+uHdXWD8brhGEgtIOM7 VvmQmuJKb9768N4HaCwNTZy5R5EKy0BKgH5k6FxbG1ZpKRl1008WkrHkk/OoLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751985142; 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=JtvEmMV8Y+do7CSsahiF762N59r8mQtjDzDyFxEPXpw=; b=RroTTv8DlLChymRE0R2yjo+Bu2QOWPMmFxQycTLpjH6fAzzw6f+xABQZdDT5o5nFPII5Te PW9SmqkCv2FDW35YDYfGpHRZSDxEK1iAY4GZku7nkBtBIxnnBh4A7q6U6cTvfv+MoZnPZo KHN5TqAGHOyltkmYyc499GloBtQNgBGPEl0uGlg71SJrl1LV8Tc8nWToxSFFr3KIz/vq2y xx7RKVFIrwT4AoEJBOMkS3RzDJOJO/BBp8TGeCRR7M9lWKxQrU5Vck3rR5ruWMqNuCaJJK QpzbtIqYNZWwWFiwrf089ENlUxbYbnxAFM/qgARdCHEtBQd24oZDu/OLAjt9Sw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751985142; a=rsa-sha256; cv=none; b=WcxKI7TWYeyGteuugahSinIJAxFe0bzncwu75sdtxLHima+/rcbZAKiFzhZEkFOxxWiRL+ T5ETVvTgYRamQ9b+p0dVq0ZDrISQ29aJvnDGL2GiCJ6f83eGrc6o1DkRxTO4FxnpFqJKPT i+r/uDQM5JdNu8uAocWw4fd4V9lBEAicbBJwWfviNLYZj/blk8OoRCgf82LvdMLBREDv3P 4DNBjt7p6vBb8O1r56OTIgQd0hZ+I+8sErpoKi1OHKOMYJnttkglDUoojlB1UZzkOlwKpp CIlQ1P2FnRsXV/2WNPxfjDmopznEZv7zAe6jD1+UhgOMt/QXaeMe/Yl0WmwRhg== 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 4bc3Ty62tgzhM3; Tue, 08 Jul 2025 14:32:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 568EWMbl073432; Tue, 8 Jul 2025 14:32:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 568EWMAK073429; Tue, 8 Jul 2025 14:32:22 GMT (envelope-from git) Date: Tue, 8 Jul 2025 14:32:22 GMT Message-Id: <202507081432.568EWMAK073429@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: c508393e49fc - stable/14 - lyaml: vendor import lua bindings for libyaml 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c508393e49fc4d18cf40fa439a9e625bde93a68f Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=c508393e49fc4d18cf40fa439a9e625bde93a68f commit c508393e49fc4d18cf40fa439a9e625bde93a68f Author: Baptiste Daroussin AuthorDate: 2025-06-26 07:12:41 +0000 Commit: Baptiste Daroussin CommitDate: 2025-07-08 14:29:16 +0000 lyaml: vendor import lua bindings for libyaml (cherry picked from commit 2bc180ef045e5911cce0cea1c2a139cffd2b577a) --- contrib/lyaml/.gitignore | 9 + contrib/lyaml/.luacov | 8 + contrib/lyaml/AUTHORS | 6 + contrib/lyaml/LICENSE | 27 + contrib/lyaml/NEWS.md | 352 ++++++++++++ contrib/lyaml/README.md | 232 ++++++++ contrib/lyaml/build-aux/config.ld.in | 34 ++ contrib/lyaml/build-aux/luke | 672 ++++++++++++++++++++++ contrib/lyaml/doc/index.html | 97 ++++ contrib/lyaml/doc/ldoc.css | 303 ++++++++++ contrib/lyaml/doc/modules/lyaml.explicit.html | 267 +++++++++ contrib/lyaml/doc/modules/lyaml.functional.html | 236 ++++++++ contrib/lyaml/doc/modules/lyaml.html | 224 ++++++++ contrib/lyaml/doc/modules/lyaml.implicit.html | 533 +++++++++++++++++ contrib/lyaml/ext/yaml/emitter.c | 459 +++++++++++++++ contrib/lyaml/ext/yaml/lyaml.h | 161 ++++++ contrib/lyaml/ext/yaml/parser.c | 410 +++++++++++++ contrib/lyaml/ext/yaml/scanner.c | 340 +++++++++++ contrib/lyaml/ext/yaml/yaml.c | 66 +++ contrib/lyaml/lib/lyaml/explicit.lua | 120 ++++ contrib/lyaml/lib/lyaml/functional.lua | 87 +++ contrib/lyaml/lib/lyaml/implicit.lua | 283 +++++++++ contrib/lyaml/lib/lyaml/init.lua | 534 +++++++++++++++++ contrib/lyaml/lukefile | 47 ++ contrib/lyaml/lyaml-6.2.8-1.rockspec | 59 ++ contrib/lyaml/spec/ext_yaml_emitter_spec.yaml | 239 ++++++++ contrib/lyaml/spec/ext_yaml_parser_spec.yaml | 391 +++++++++++++ contrib/lyaml/spec/ext_yaml_scanner_spec.yaml | 380 ++++++++++++ contrib/lyaml/spec/lib_lyaml_functional_spec.yaml | 121 ++++ contrib/lyaml/spec/lib_lyaml_spec.yaml | 343 +++++++++++ contrib/lyaml/spec/spec_helper.lua | 277 +++++++++ libexec/flua/Makefile | 1 + libexec/flua/liblyaml/Makefile | 22 + 33 files changed, 7340 insertions(+) diff --git a/contrib/lyaml/.gitignore b/contrib/lyaml/.gitignore new file mode 100644 index 000000000000..19d7cbb6dd7d --- /dev/null +++ b/contrib/lyaml/.gitignore @@ -0,0 +1,9 @@ +*~ +*.o +*.so +*.src.rock +/ChangeLog +/build-aux/config.ld +/luacov.*.out +/lyaml-*.tar.gz +/TAGS diff --git a/contrib/lyaml/.luacov b/contrib/lyaml/.luacov new file mode 100644 index 000000000000..0aa52d25e0ea --- /dev/null +++ b/contrib/lyaml/.luacov @@ -0,0 +1,8 @@ +modules = { + ['lyaml'] = 'lib/lyaml/init.lua', + ['lyaml.*'] = 'lib', +} + +runreport = true + +tick = true diff --git a/contrib/lyaml/AUTHORS b/contrib/lyaml/AUTHORS new file mode 100644 index 000000000000..1eb673371bf7 --- /dev/null +++ b/contrib/lyaml/AUTHORS @@ -0,0 +1,6 @@ +lyaml is the work of several authors (see git history for +contributors). + +There is an earlier C LibYAML binding + + Copyright Andrew Danforth diff --git a/contrib/lyaml/LICENSE b/contrib/lyaml/LICENSE new file mode 100644 index 000000000000..402e64dfec29 --- /dev/null +++ b/contrib/lyaml/LICENSE @@ -0,0 +1,27 @@ +This software comprises files that are copyright their respective +authors (see the AUTHORS file for details), and distributed under +the terms of the MIT license (the same license as Lua itself), +unless noted otherwise in the body of that file. + +==================================================================== +Copyright (C) 2013-2022 Gary V. Vaughan + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without restriction, +including without limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of the Software, +and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGE- +MENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE +FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +==================================================================== diff --git a/contrib/lyaml/NEWS.md b/contrib/lyaml/NEWS.md new file mode 100644 index 000000000000..32611d83671a --- /dev/null +++ b/contrib/lyaml/NEWS.md @@ -0,0 +1,352 @@ +# lyaml NEWS - User visible changes + +## Noteworthy changes in release 6.2.8 (2022-10-22) [stable] + +### Bug fixes + + - `luke` no longer crashes in `std.normalize` require loops + occasionally in Lua 5.4. + + - lyaml emitter no longer leaks at least six bytes for every + map, sequence and scalar emitted. + + +## Noteworthy changes in release 6.2.7 (2020-11-27) [stable] + +### Bug fixes + + - Don't skip YAML entries from mixed key Lua tables. + + +## Noteworthy changes in release 6.2.6 (2020-08-28) [stable] + +### Bug fixes + + - `luke` really propagates `LDFLAGS` to module compilation + commands. + + +## Noteworthy changes in release 6.2.5 (2020-04-15) [stable] + +### Bug fixes + + - `luke` really propagates `YAML_BINDIR`, `YAML_DIR`, + `YAML_INCDIR` and `YAML_LIBDIR` to checksymbol test in lukefile + given the change to `external_dependencies` layout in 6.1.2. + + +## Noteworthy changes in release 6.2.4 (2019-07-20) [stable] + +### Bug fixes + + - `luke` works with upgraded bootstrap luarocks version of + `require`. + + +## Noteworthy changes in release 6.2.3 (2018-09-16) [stable] + +### New Features + + - Initial support for Lua 5.4. + + +## Noteworthy changes in release 6.2.2 (2018-03-28) [stable] + +### Bug fixes + + - Remove spurious dependency on `std.normalize` and `std._debug` + libraries. + + +## Noteworthy changes in release 6.2.1 (2018-02-20) [stable] + +### Bug fixes + + - `spec/spec_helper.lua` now looks in the correct objdir + for object modules built by luke, instead of adding unused + paths from old Autotools objdirs. So now specl is properly + running examples against the not yet installed lyaml objects. + + +## Noteworthy changes in release 6.2 (2017-11-26) [stable] + +### Bug fixes + + - `luke` uses the correct spelling of LIBFLAG to match luarocks now. + + - `luke` no longer throws spurious `cp: file exists` errors. + + - `luke` works on luajit again. + + +## Noteworthy changes in release 6.1.3 (2017-05-29) [stable] + +### Bug fixes + + - `luke` no longer bombs out with a nil concat error. + + +## Noteworthy changes in release 6.1.2 (2017-04-30) [stable] + +### Bug fixes + + - `luke` now propagates `LUA_DIR`, `YAML_INCDIR` and `YAML_LIBDIR` + correctly. + + +## Noteworthy changes in release 6.1.1 (2017-01-22) [stable] + +### New Features + + - Builds and installs with `luke` instead of Autotools. + + +## Noteworthy changes in release 6.1 (2016-10-08) [stable] + +### Bug fixes + + - `lyaml.load` now correctly reads implicit null scalars in a YAML + document as an `lyaml.null` reference, identical to the "~" + shorthand syntax, according to [the specification][nullspec]. + + ```yaml + empty: + canonical: ~ + english: null + ~: null key + ``` + + +## Noteworthy changes in release 6.0 (2015-07-27) [stable] + +### New Features + + - `lyaml.load` now correctly reads a !!bool tagged scalar from a + YAML document, or an implicit bool value, according to + [the specification][boolspec]. + + ```yaml + %TAG ! tag:yaml.org,2002: + --- + truthy: + - !bool Y + - !bool y + - !bool True + - !bool "on" + falsey: + - !bool n + - !bool OFF + - !bool garbage + ``` + + - `lyaml.load` now correctly reads a !!float tagged scalar from a + YAML document, or an implicit float value, according to + [the specification][floatspec]. + + - `lyaml.load` now correctly reads a !!int tagged scalar from a + YAML document, or an implicit integer value, according to + [the specification][intspec]. + + - `lyaml.load` now supports the !!merge key type according to + [the specification][mergespec]. + + ```yaml + - &MERGE { x: 1, y: 2 } + - &OVERRIDE { x: 0, z: 1 } + - + << : [&MERGE, &OVERRIDE] + z: 3 + ``` + + The anchored tables remain in the document too, so this results in + the following Lua table: + + ```lua + { -- START_STREAM + { -- START_DOCUMENT + { x = 1, y = 2 }, -- MERGE + { x = 0, z = 1 }, -- OVERRIDE + { x = 1, y = 2, z = 3}, -- <<< + } -- END_DOCUMENT + } -- END_STREAM + ``` + +### Bug fixes + + - Multi-line strings were previously being dumped using single quotes + which caused the dumped YAML to break. + + For example, { foo = "a\nmultiline\nstring" } would get dumped as: + + ```yaml + foo: 'a + + multiline + + string' + ``` + + Note the extra line-breaks in between each line. This also causes + YAML parsing to fail (since the blank lines didn't have the expected + indentation). + + This patch fixes the dump to use the YAML literal syntax for any + multi-line strings so the same example gets dumped as: + + ```yaml + foo: |- + a + multiline + string + ``` + + - `lyaml.load` now correctly reads the !!null tag in a YAML + document as an `lyaml.null` reference, identical to the "~" + shorthand syntax, according to [the specification][nullspec]. + +### Incompatible Changes + + - `lyaml.load` now takes a table of options as an optional second + argument, not a simple boolean to determine whether all documents + should be returned from the stream. For now, a `true` second + argument will be converted to the modern equivalent: + + ```lua + lyaml.load (document, { all = true }) + ``` + + - `lyaml.dump` now takes a table of options as an optional second + argument, not an initial table of anchors. For now, a second + argument without any new API keys will be converted to the modern + equivalent: + + ```lua + lyaml.dump (t, { anchors = arg2 }) + ``` + +[boolspec]: http://yaml.org/type/bool.html +[floatspec]: http://yaml.org/type/float.html +[intspec]: http://yaml.org/type/int.html +[mergespec]: http://yaml.org/type/merge.html +[nullspec]: http://yaml.org/type/null.html + + +## Noteworthy changes in release 5.1.4 (2015-01-01) [stable] + + - This release is functionally identical to the last. + + +## Noteworthy changes in release 5.1.3 (2015-01-01) [stable] + + - This release is functionally identical to the last. + + +## Noteworthy changes in release 5.1.2 (2014-12-27) [stable] + +### Bugs Fixed + + - No more spurious .travis.yml is out of date warnings during + `luarocks install lyaml`. + + +## Noteworthy changes in release 5.1.1 (2014-12-19) [stable] + +### Bugs Fixed + + - When using `sudo make install` instead of LuaRocks, `lyaml.so` + is now correctly installed to `$luaexecdir`. + + +## Noteworthy changes in release 5.1.0 (2014-12-17) [stable] + +### New Features + + - Lua 5.3.0 compatibility. + + +## Noteworthy changes in release 5 (2014-09-25) [beta] + +### Build + + - Significantly reduced pointer mismatch warnings from modern GNU + compilers. + +### New Features + + - `lyaml.dump` now takes a second argument containing a table of + potential anchor values in `ANCHOR_NAME = { "match", "elements" }` + pairs format. The first time any are matched in the table being + dumped, they are preceded by `&ANCHOR_NAME` in the output YAML + document; subsequent matches are not written out in full, but + shortened to the appropriate `*ANCHOR_NAME` alias. + +### Bugs Fixed + + - `yaml.emitter` no longer emits numbers in SINGLE_QUOTE style by + default. + + - `yaml.emitter ().emit` returns error strings correctly for invalid + STREAM_START encoding, and MAPPING_START, SEQUENCE_START & SCALAR + style fields. + + +## Noteworthy changes in release 4 (2013-09-11) [beta] + +### New Features + + - New yaml.emitter API returns an object with an emit method for + adding events using yaml_*_event_initialize() calls. + + - New yaml.parser API returns a Lua iterator that fetches the next + event using yaml_parser_parse(). + + - New yaml.scanner API returns a Lua iterator that fetches the next + token using yaml_parser_scan(). + + - Beginnings of Specl specs, starting with a reasonably comprehensive + specifications for the new APIs above. + + - C implementation of lyaml.dump has moved to Lua implementation as + yaml.dump. + + - C implementation of lyaml.load has moved to Lua implementation as + yaml.load. + + - The new Lua implementation of lyaml.load () handles multi-document + streams, and returns a table of documents when the new second + argument is `true`. + + +## Noteworthy changes in release 3 (2013-04-27) [beta] + + - This release is functionally identical to the last. + +### New Features + + - lyaml builds are now made against Lua 5.1, Lua 5.2 and luajit 2.0.0 + automatically, with every commit. + + - move to a cleaner, automated release system. + + +## Noteworthy changes in release 2 (2013-03-18) [beta] + + - This release is functionally identical to the last. + + - Use correct MIT license attribution, relicensing build files to match + Andrew Danforth''s MIT licensed lyaml.c too. + + +## Noteworthy changes in release 1 (2013-03-17) [beta] + +### New Features + + - A binding for libYAML, by Andrew Danforth: Updated for Lua 5.1 and + 5.2, and packaged as a luarock. + + - I spun this out of Specl (http://github.com/gvvaughan/specl) so that + other projects may use it, and to simplify the Specl build. + +### Known Issues + + - There's not really any documentation, sorry. Contributions welcome! diff --git a/contrib/lyaml/README.md b/contrib/lyaml/README.md new file mode 100644 index 000000000000..d1e96845ddfa --- /dev/null +++ b/contrib/lyaml/README.md @@ -0,0 +1,232 @@ +LYAML +===== + +Copyright (C) 2013-2022 Gary V. Vaughan + +[![License](https://img.shields.io/:license-mit-blue.svg)](https://mit-license.org) +[![workflow status](https://github.com/gvvaughan/lyaml/actions/workflows/spec.yml/badge.svg?branch=release-v6.2.8)](https://github.com/gvvaughan/lyaml/actions) +[![codecov.io](https://codecov.io/github/gvvaughan/lyaml/coverage.svg?branch=release-v6.2.8)](https://codecov.io/github/gvvaughan/lyaml?branch=release-v6.2.8) + +[LibYAML] binding for [Lua], with a fast C implementation +for converting between [%YAML 1.1][yaml11] and [Lua] tables, +and a low-level [YAML] event parser for implementing more +intricate [YAML] document loading. + +Usage +----- + +### High Level API + +These functions quickly convert back and forth between Lua tables +and [%YAML 1.1][yaml11] format strings. + +```lua +local lyaml = require "lyaml" +local t = lyaml.load (YAML-STRING, [OPTS-TABLE]) +local yamlstr = lyaml.dump (LUA-TABLE, [OPTS-TABLE]) +local null = lyaml.null () +``` + +#### `lyaml.load` + +`lyaml.load` accepts a YAML string for parsing. If the YAML string contains +multiple documents, only the first document will be returned by default. To +return multiple documents as a table, set `all = true` in the second +argument OPTS-TABLE. + +```lua +lyaml.load("foo: bar") +--> { foo = "bar" } + +lyaml.load("foo: bar", { all = true }) +--> { { foo = "bar" } } + +multi_doc_yaml = [[ +--- +one +... +--- +two +... +]] + +lyaml.load(multi_doc_yaml) +--> "one" + +lyaml.load(multi_doc_yaml, { all = true }) +--> { "one", "two" } +``` + +You can supply an alternative function for converting implicit plain +scalar values in the `implicit_scalar` field of the OPTS-TABLE argument; +otherwise a default is composed from the functions in the `lyaml.implicit` +module. + +You can also supply an alternative table for coverting explicitly tagged +scalar values in the `explicit_scalar` field of the OPTS-TABLE argument; +otherwise all supported tags are parsed by default using the functions +from the `lyaml.explicit` module. + +#### `lyaml.dump` + +`lyaml.dump` accepts a table of values to dump. Each value in the table +represents a single YAML document. To dump a table of lua values this means +the table must be wrapped in another table (the outer table represents the +YAML documents, the inner table is the single document table to dump). + +```lua +lyaml.dump({ { foo = "bar" } }) +--> --- +--> foo: bar +--> ... + +lyaml.dump({ "one", "two" }) +--> --- one +--> ... +--> --- two +--> ... +``` + +If you need to round-trip load a dumped document, and you used a custom +function for converting implicit scalars, then you should pass that same +function in the `implicit_scalar` field of the OPTS-TABLE argument to +`lyaml.dump` so that it can quote strings that might otherwise be +implicitly converted on reload. + +#### Nil Values + +[Lua] tables treat `nil` valued keys as if they were not there, +where [YAML] explicitly supports `null` values (and keys!). Lyaml +will retain [YAML] `null` values as `lyaml.null ()` by default, +though it is straight forward to wrap the low level APIs to use `nil`, +subject to the usual caveats of how nil values work in [Lua] tables. + + +### Low Level APIs + +```lua +local emitter = require ("yaml").emitter () + +emitter.emit {type = "STREAM_START"} +for _, event in ipairs (event_list) do + emitter.emit (event) +end +str = emitter.emit {type = "STREAM_END"} +``` + +The `yaml.emitter` function returns an emitter object that has a +single emit function, which you call with event tables, the last +`STREAM_END` event returns a string formatted as a [YAML 1.1][yaml11] +document. + +```lua +local iter = require ("yaml").scanner (YAML-STRING) + +for token_table in iter () do + -- process token table +end +``` + +Each time the iterator returned by `scanner` is called, it returns +a table describing the next token of YAML-STRING. See LibYAML's +[yaml.h] for details of the contents and semantics of the various +tokens produced by `yaml_parser_scan`, the underlying call made by +the iterator. + +[LibYAML] implements a fast parser in C using `yaml_parser_scan`, which +is also bound to lyaml, and easier to use than the token API above: + +```lua +local iter = require ("yaml").parser (YAML-STRING) + +for event_table in iter () do + -- process event table +end +``` + +Each time the iterator returned by `parser` is called, it returns +a table describing the next event from the "Parse" process of the +"Parse, Compose, Construct" processing model described in the +[YAML 1.1][yaml11] specification using [LibYAML]. + +Implementing the remaining "Compose" and "Construct" processes in +[Lua] is left as an exercise for the reader -- though, unlike the +high-level API, `lyaml.parser` exposes all details of the input +stream events, such as line and column numbers. + + +Installation +------------ + +There's no need to download an [lyaml] release, or clone the git repo, +unless you want to modify the code. If you use [LuaRocks], you can +use it to install the latest release from its repository: + + luarocks --server=http://rocks.moonscript.org install lyaml + +Or from the rockspec in a release tarball: + + luarocks make lyaml-?-1.rockspec + +To install current git master from [GitHub][lyaml] (for testing): + + luarocks install http://raw.github.com/gvvaughan/lyaml/master/lyaml-git-1.rockspec + +To install without [LuaRocks], clone the sources from the +[repository][lyaml], and then run the following commands: + +```sh +cd lyaml +build-aux/luke LYAML_DIR=LIBYAML-INSTALL-PREFIX +sudo build-aux/luke PREFIX=LYAML-INSTALL-PREFIX install +specl -v1freport spec/*_spec.yaml +``` + +The dependencies are listed in the dependencies entry of the file +[rockspec][L15]. + + +Bug reports and code contributions +---------------------------------- + +This library is maintained by its users. + +Please make bug reports and suggestions as [GitHub Issues][issues]. +Pull requests are especially appreciated. + +But first, please check that your issue has not already been reported by +someone else, and that it is not already fixed by [master][lyaml] in +preparation for the next release (see Installation section above for how +to temporarily install master with [LuaRocks][]). + +There is no strict coding style, but please bear in mind the following +points when proposing changes: + +0. Follow existing code. There are a lot of useful patterns and avoided + traps there. + +1. 3-character indentation using SPACES in Lua sources: It makes rogue + TABs easier to see, and lines up nicely with 'if' and 'end' keywords. + +2. Simple strings are easiest to type using single-quote delimiters, + saving double-quotes for where a string contains apostrophes. + +3. Save horizontal space by only using SPACEs where the parser requires + them. + +4. Use vertical space to separate out compound statements to help the + coverage reports discover untested lines. + +5. Prefer explicit string function calls over object methods, to mitigate + issues with monkey-patching in caller environment. + + +[issues]: http://github.com/gvvaughas/lyaml/issues +[libyaml]: http://pyyaml.org/wiki/LibYAML +[lua]: http://www.lua.org +[luarocks]: http://www.luarocks.org +[lyaml]: http://github.com/gvvaughan/lyaml +[L15]: http://github.com/gvvaughan/lyaml/blob/master/lyaml-git-1.rockspec#L15 +[yaml.h]: http://pyyaml.org/browser/libyaml/branches/stable/include/yaml.h +[yaml]: http://yaml.org +[yaml11]: http://yaml.org/spec/1.1/ diff --git a/contrib/lyaml/build-aux/config.ld.in b/contrib/lyaml/build-aux/config.ld.in new file mode 100644 index 000000000000..0d55b9e94c30 --- /dev/null +++ b/contrib/lyaml/build-aux/config.ld.in @@ -0,0 +1,34 @@ +--[[ + LYAML binding for Lua 5.1, 5.2, 5.3 & 5.4 + Copyright (C) 2013-2022 Gary V. Vaughan +]] + +title = '@package@ @version@ Reference' +project = '@package@ @version@' +description = [[ +# LYAML binding for Lua + +This is a Lua binding for the fast libYAML C library for converting +between `%YAML 1.1` and Lua tables, with a flexible Lua language +API to load and save YAML documents. + +It works with Lua 5.1 (including LuaJIT), 5.2, 5.3 and 5.4. + +## LICENSE + +The code is copyright by its respective authors, and released under the +MIT license (the same license as Lua itself). There is no warranty. +]] + +dir = '../doc' + +file = { + '../lib/lyaml/init.lua', + '../lib/lyaml/explicit.lua', + '../lib/lyaml/functional.lua', + '../lib/lyaml/implicit.lua', +} + +format = 'markdown' +backtick_references = false +sort = false diff --git a/contrib/lyaml/build-aux/luke b/contrib/lyaml/build-aux/luke new file mode 100755 index 000000000000..3d61f784cbca --- /dev/null +++ b/contrib/lyaml/build-aux/luke @@ -0,0 +1,672 @@ +#!/usr/bin/env lua +--[[ minified code follows, see --help text for source location! ]] +local require=function(modname)if package.loaded[modname]==nil then +if type(package.preload[modname])~="function"then +io.stderr:write("module '" .. modname .. "' not found:\n no valid field package.preload['" .. modname .. "']\n") +return nil +end +package.loaded[modname]=package.preload[modname](modname,"package.preload")end +return package.loaded[modname]end +package.preload['luke._base']=function() +local _ENV=require'std.normalize'{}local function fatal(...)local msg=(...)if select('#',...)>1 then +msg=format(...)end +stderr:write('luke: fatal: '..msg..'\n')exit(1)end +return{diagnose=function(predicate,...)if not predicate then +fatal(...)end +end,fatal=fatal,} +end +package.preload['luke.cli']=function() +local _ENV=require'std.normalize'{'luke._base','luke.lukefile','luke.platforms','std.functional',}local function version()print[[ +luke (Luke) 0.2.3 +Written by Gary V. Vaughan , 2014 + +Copyright (C) 2022, Gary V. Vaughan +Luke comes with ABSOLUTELY NO WARRANTY. +You may redistribute copies of Luke under the terms of the MIT license; +it may be used for any purpose at absolutely no cost, without permission. +See for details. +]]exit(0)end +local function help()print[[ +Usage: luke [OPTION]... [VAR=VALUE]... [TARGET] + +Use the source, Luke! + + --help print this help, then exit + --version print version number, then exit + --file=FILE use FILE instead of lukefile + --value=NAME print the value of variable NAME + --quiet without any output + --verbose provide more progress output + +Each TARGET can be one of the module table keys from lukefile, or: + + all build all targets in lukefile + install copy all built targets to $PREFIX + +If no TARGET is given, 'all' is implied. + +Report bugs to https://github.com/gvvaughan/luke/issues.]]exit(0)end +local function opterr(...)local msg=(...)if select('#',...)>1 then +msg=format(...)end +msg=gsub(msg,'%.$','')stderr:write('luke: error: '..msg..'.\n')stderr:write("luke: try '"..arg[0].." --help' for help.\n")exit(2)end +local function display(...)return stdout:write(concat{...})end +local function dump(...)local s=concat(map(list(...),str))if len(s)>0 then +gsub(concat(map(list(...),str)),'\n*$','\n'):gsub('(.-)\n',function(line)stderr:write(' DEBUG: '..line..'\n')end)end +end +local function interpolate_to_substitute(s)return(gsub(s,'%$([%w_]+)','@%1@'))end +return{parse_arguments=function(args)local r={clidefs={},valreqs={},fname='lukefile',install={},log=nop,targets={},verbose=nop,write=display,}map(args,function(opt)case(opt,{['--debug']=function()r.log=dump +end,['%-%-file=(.+)']=function(optarg)r.fname=optarg +end,['%-%-value=(.+)']=function(optarg)r.valreqs[#r.valreqs+1]=optarg +end,['--quiet']=function()r.write=nop +end,['--verbose']=function()r.verbose=display +end,['--help']=help,['--version']=version,['([^-][^=]-)=(.+)']=function(name,value)r.clidefs[name]=value +end,function(opt)if match(opt,'^-')~=nil then +opterr("unrecognized option '%s'",opt)end +append(r.targets,opt)end,})end)return r +end,validate_arguments=function(parsed)local luke,err=loadluke(parsed.fname)diagnose(luke~=nil,'bad %s: %s',parsed.fname,err)if isempty(luke.modules or{})then +fatal("no modules table in '%s', nothing to build",parsed.fname)end +local targets=call(function()if isempty(parsed.targets)or contains(parsed.targets,'all')then +return except(flatten(parsed.targets,keys(luke.modules)),'all')end +local r=filter(parsed.targets,function(target)if target~='install'and luke.modules[target]==nil then +fatal("no rule to make target '%s'",target)end +return true +end)assert(len(r)>0,"no build targets specified")return r +end)local install +local build=pluck(targets,luke.modules)if contains(targets,'install')then +install=build or luke.modules +end +luke.modules=build +if isempty(luke.modules)then +luke.external_dependencies=nil +end +luke.substitute=merge(luke.substitute or{},{package=interpolate_to_substitute(luke.package),version=interpolate_to_substitute(luke.version),})luke.variables=merge(luke.variables or{},collect_variables(luke),{LUA_DIR='/usr',LUA_BINDIR='$LUA_DIR/bin',LUA_INCDIR='$LUA_DIR/include/lua$LUAVERSION',LUA_LIBDIR='$LUA_DIR/lib',objdir=platforms[1],package=luke.package,version=luke.version,})return{clidefs=parsed.clidefs,install=install,log=parsed.log,luke=luke,valreqs=parsed.valreqs,verbose=parsed.verbose,write=parsed.write,}end,} +end +package.preload['luke.compile']=function() +local _ENV=require'std.normalize'{'luke._base','luke.environment','std.functional','type.context-manager','type.path',SHELLMETACHARS='[%s%$"]',}local function spawn(env,...)local command=interpolate(env,concat({...},' '))return with(TmpFile(),TmpFile(),function(out,err)local pipe=concat{command,' >',out.filename,' 2>',err.filename,'; printf $?'}return tonumber(slurp(Pipe(pipe))),slurp(File(err.filename)),slurp(File(out.filename))end)end +local function run(L,env,command)L.write(interpolate(env,concat(command,' ')),'\n')local status,err,out=spawn(env,unpack(command))if status~=0 then +if L.write==nop then +stdout:write(concat(command,' ')..'\n')end +stderr:write(err..'\n')end +return status,out,err +end +local function defines(env,deftables)return zip_with(merge({},unpack(deftables)),function(name,value)local fmt=cond({[int(value)==1]='-D%s'},{[match(value,SHELLMETACHARS)~=nil]="-D%s='%s'"},{[true]='-D%s=%s'})return format(fmt,name,value)end)end +local function incdirs(...)return map(flatten(...),function(v)return'-I'..v +end)end +local function libdirs(...)return map(flatten(...),function(v)return'-L'..v +end)end +local function c_module_path(objdir,name)return format('%s/%s.$LIB_EXTENSION',objdir,gsub(name,'%.','/'))end +local function c_source(module,objdir)local path=gsub(module,'%.','/')local src=c_module_path(objdir,path)return src,(gsub('$INST_LIBDIR/'..path,'/[^/]+$',''))end +local function lua_source(module,src)local abspath='$INST_LUADIR/'..gsub(module,'%.','/')if match(src,'/init%.lua$')then +abspath=abspath..'/init'end +abspath=abspath..'.lua'return src,(gsub(abspath,'/[^/]+%.lua$',''))end +local function module_to_path(module,sources,objdir)return dropuntil(sources,function(source)return case(source,{['.*%.[ch]']=bind(c_source,{module,objdir}),['(.*%.[ch])%.in']=bind(c_source,{module,objdir}),['.*%.lua']=bind(lua_source,{module}),['(.*%.lua)%.in']=bind(lua_source,{module}),function(src)fatal("unsupported source type '%s'",src)end,})end)end +return{build_c_module=function(L,env,luke,name)local rules=luke.modules[name]local c_module=c_module_path(luke.variables.objdir,name)local command={'$MAKEDIRS',dirname(c_module)}local status,err,out=spawn(env,unpack(command))if status~=0 then +stdout:write(concat(command,' ')..'\n')stderr:write(err..'\n')exit(status)end +return run(L,env,flatten('$CC $CFLAGS $LIBFLAG $PKGFLAGS $CPPFLAGS',defines(env,except(list(rules.defines,luke.defines),nil)),incdirs(rules.incdirs,luke.incdirs),rules.sources,'-o',c_module,'$LDFLAGS',libdirs(rules.libdirs,luke.libdirs),'$LIBS',rules.libraries,luke.libraries))end,c_modules=function(modules)return filter(keys(modules),function(name)return dropuntil(modules[name].sources,bind(match,{[2]='%.[ch]$'}))end)end,incdirs=incdirs,install_modules=function(L,env,luke,modules)return reduce(keys(modules),0,function(status,name)if status==0 then +local src,dir=module_to_path(name,modules[name].sources,luke.variables.objdir)if not exists(interpolate(env,dir))then +status=run(L,env,{'$MAKEDIRS',dir})end +if status==0 then +status=run(L,env,{'$INSTALL',src,dir..'/'})end +end +return status +end)end,libdirs=libdirs,run_command=run,spawn=spawn,} +end +package.preload['luke.configure']=function() +local _ENV=require'std.normalize'{'luke._base','luke.compile','luke.environment','std.functional','type.context-manager','type.dict',CCPROGS={'cc','gcc','clang'},}local function logspawn(L,env,...)local status,err=spawn(env,...)if status~=0 and err~=''then +L.log(err)end +return status +end +local function checking(L,...)L.verbose('checking ',concat({...},' '),'... ')end +local function found_library(L,x)if x==nil or x==''then +L.verbose'none required'elseif isempty(x)then +L.verbose'not supported'else +L.verbose(x)end +L.verbose'\n'return x +end +local function found_prog(L,x)L.verbose(x and'yes\n'or'no\n')return x +end +local function found_result(L,x)L.verbose(x==0 and'yes\n'or'no\n')return x~=0 and 0 or 1 +end +local function bindirs(...)return map(flatten(...),function(v)return v..':'end)end +local function compile_command(L,env,config,filename)local command=flatten('$CC','-c','$CFLAGS',incdirs(config.incdir),'$CPPFLAGS',filename)L.log(interpolate(env,concat(command,' ')))return unpack(command)end +local function link_command(L,env,config,a_out,source,lib)local command=flatten('$CC','$CFLAGS',incdirs(config.incdir),'$CPPFLAGS','-o',a_out,source,libdirs(config.libdir),'$LDFLAGS',lib,'$libs',CONFIGENV.libs)L.log(interpolate(env,concat(command,' ')))return unpack(command)end +local function check_executable_in_path(L,env,config,prog)local PATH=concat(bindirs(config.bindir))..getenv('PATH')local found=dropuntil(gmatch(PATH,'[^:]+'),function(path)local progpath=path..'/'..prog +return with(File(progpath,'r'),function(h)return h and isfile(h.context)and progpath or nil +end)end)L.log(found and'found '..found or prog..' not found')return found~=nil +end +local function check_header_compile(L,env,config,header,extra_hdrs)return with(CTest(),function(conftest)conftest:write(format('%s\n#include "%s"\n',extra_hdrs,header))return logspawn(L,env,compile_command(L,env,config,conftest.filename))end)end +local function check_struct_member_compile(L,env,config,structname,member,extra_hdrs)return with(CTest(),function(conftest)conftest:write(format([[ +%s +int main () { +static %s aggr; +if (sizeof aggr.%s) + return 0; +return 0; +} +]],extra_hdrs,structname,member))return logspawn(L,env,compile_command(L,env,config,conftest.filename))end)end +local function try_link(L,env,config,lib,symbol)return with(CTest(),TmpFile(),function(conftest,a_out)conftest:write(format([[ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char %s (); +int main () { +return %s (); +} +]],symbol,symbol))return logspawn(L,env,link_command(L,env,config,a_out.filename,conftest.filename,lib))end)end +local function try_compile(L,env,config,headers)return with(CTest(),TmpFile(),function(conftest,a_out)conftest:write(format([[ +%s +#if !defined %s || %s == -1 +choke me +#endif +int +main() +{ +return 0; +} +]],headers,config.ifdef,config.ifdef))return logspawn(L,env,link_command(L,env,config,a_out.filename,conftest.filename))end)end +local function check_func_decl(L,env,config,fname,extra_hdrs)return with(CTest(),function(conftest)conftest:write(format([[ +%s +int +main() +{ +#ifndef %s +(void) %s; +#endif +return 0; +} +]],extra_hdrs,fname,fname))return logspawn(L,env,compile_command(L,env,config,conftest.filename))end)end +local function check_func_link(L,env,config,fname)return with(CTest(),TmpFile(),function(conftest,a_out)conftest:write(format([[ +/* Define to an innocous variant, in case declares it. + For example, HP-UX 11i declares gettimeofday. */ +#define %s innocuous_%s + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with declaration below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef %s + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char %s (); + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_%s || defined __stub__%s +choke me +#endif + +int main () { +return %s (); +} +]],fname,fname,fname,fname,fname,fname,fname))return logspawn(L,env,link_command(L,env,config,a_out.filename,conftest.filename))end)end +local function add_external_deps(env,config,prefix)if prefix~=nil then +for k,v in next,{bindir='$%s_BINDIR',incdir='$%s_INCDIR',libdir='$%s_LIBDIR'}do +local envvar=interpolate(env,format(v,prefix))if envvar~=''then +config[k]=envvar +end +end +end +end +local function format_includes(includes)return map(includes or{},function(include)return format('#include "%s"',include)end)end +local configure=setmetatable(OrderedDict({checkprog=function(L,env,config)return dropuntil(config.progs,function(prog)checking(L,'for',prog)if found_prog(L,check_executable_in_path(L,env,config,prog))then *** 6606 LINES SKIPPED *** From nobody Tue Jul 8 14:32:20 2025 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 4bc3Tw6FSFz614lf; Tue, 08 Jul 2025 14:32:20 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bc3Tw4V2Cz49N6; Tue, 08 Jul 2025 14:32:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751985140; 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=oEgDzuS5DoyzXSqgv/UooXLtK2JzWYfZzNkPCpGW+VI=; b=ZHXlTfl1HLK+TTUEzYmoNGqXFGhedxf6BCJnp4stgewNXSDIR5paBIu6FKww7I5/4L8j+C jcakOhTZafnrfyGHoWZgCXWdAPcUG8Ux5aNjoLAhUfbB0xgtGul8EoiV5awZs2TrNr9WfI HWPZwEAJJ2Ix51zTW4KFziJtG4kFDM8ZliG5+hsY6EhUZ8oQf3AgOo3bMJLQZYkCGyuz4a XMu1eJPQHmW75oiFyDq/KV7u4e7IFvusL2/zcQF8STe0iyOBFAVkXl6PrqIayk9jwcnMqH 0bSradSlnUrdZdCI8FgXmUdP32TnLX9k6K4QAKnMNkZ08zQvyrw+VON0lAARGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751985140; 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=oEgDzuS5DoyzXSqgv/UooXLtK2JzWYfZzNkPCpGW+VI=; b=y1S8LHKH7EHaMD60ecDtNc0gG5Gi+NSR+x3ocLwucQUvjQGaBFHJtk3yRuIpdWZQvr7sTN dImSGWF1z7i9Q2X29D8F675pFy8P7KpHs+2UewCnZhJFK1VpfoyZeqCP56ie+0vSIHCXRO eR220orxhtPUQc3xXEENBvJmenB7pWU6U/V9YjMZhKsyIFyi4gKVaT7CsalYJI/xzKBoSb L+sVl9Z6gwSwVPbumXOQ2lZvEKIYi7oFdYvmw+dLjfcxD+U7ze3ur1u8OsTmMs1xqiT4k7 AdBw3qonMw+YUi7PK8g+H8TdCL659hVC8M9GlqP7qgn7oERRW3QGmO4fmdtz0g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751985140; a=rsa-sha256; cv=none; b=ojC6xty/aXeCcmY2a444BL7rmEfkFbQsO20+EE7eoDlICTvGc5ToYrEnazlmODSTuvvGvA Rae7qHRjtwK6WQjZOARJxGomZhnWacDqRbbRT8mIwapZ2fuKxM0+oJRDnASE90H1JaEhUi BDh0TNBD00Jm8QuzR3WNTB4kJUpazfFwtgi74zf84z0E/1O7uEuYMQSu6Y5zXFY33zN0hl jo0vCkavW9MlEceeG6QeDtBYELkimReVNA/ER63VjMn5FztPE3GcKW5f6t7KDYWh3rPTnJ UvpHITBS/Ix+ljvZoqu/w4nXscbTXaRJJXka4TrAv67VKpEMTz6qBEYuWLWDHA== 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 4bc3Tw45hYzh3B; Tue, 08 Jul 2025 14:32:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 568EWKjk072296; Tue, 8 Jul 2025 14:32:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 568EWK60072293; Tue, 8 Jul 2025 14:32:20 GMT (envelope-from git) Date: Tue, 8 Jul 2025 14:32:20 GMT Message-Id: <202507081432.568EWK60072293@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: 178a01e3b9a4 - stable/14 - freebsd.sys.linker: remove license to only keep SPDX line 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 178a01e3b9a4497a424ca0f80f456f189bf6a635 Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=178a01e3b9a4497a424ca0f80f456f189bf6a635 commit 178a01e3b9a4497a424ca0f80f456f189bf6a635 Author: Baptiste Daroussin AuthorDate: 2024-09-13 05:06:39 +0000 Commit: Baptiste Daroussin CommitDate: 2025-07-08 14:28:00 +0000 freebsd.sys.linker: remove license to only keep SPDX line (cherry picked from commit fa4b5aa51f1b3971e92f831b8e67e83aaed3c212) --- .../libfreebsd/sys/linker/freebsd.sys.linker.3lua | 21 --------------------- libexec/flua/libfreebsd/sys/linker/linker.c | 22 ---------------------- 2 files changed, 43 deletions(-) diff --git a/libexec/flua/libfreebsd/sys/linker/freebsd.sys.linker.3lua b/libexec/flua/libfreebsd/sys/linker/freebsd.sys.linker.3lua index 0ab8f185388a..34198d20463e 100644 --- a/libexec/flua/libfreebsd/sys/linker/freebsd.sys.linker.3lua +++ b/libexec/flua/libfreebsd/sys/linker/freebsd.sys.linker.3lua @@ -3,27 +3,6 @@ .\" .\" Copyright (c) 2024, Baptiste Daroussin .\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\" notice, this list of conditions and the following disclaimer in the -.\" documentation and/or other materials provided with the distribution. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -.\" SUCH DAMAGE. -.\" .Dd September 6, 2024 .Dt FREEBSD.SYS.LINKER 3lua .Os diff --git a/libexec/flua/libfreebsd/sys/linker/linker.c b/libexec/flua/libfreebsd/sys/linker/linker.c index a2dc3b487525..87eccfb651f0 100644 --- a/libexec/flua/libfreebsd/sys/linker/linker.c +++ b/libexec/flua/libfreebsd/sys/linker/linker.c @@ -2,30 +2,8 @@ * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2024, Baptiste Daroussin - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. */ - #include #include From nobody Tue Jul 8 14:32:24 2025 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 4bc3V13DLbz614qm; Tue, 08 Jul 2025 14:32:25 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bc3V112N8z49Cb; Tue, 08 Jul 2025 14:32:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751985145; 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=OpHdORxcefN1aQHGarIHYvVEtTJEWqc6sR4PR3GYwwc=; b=tsUURKsXveu7RLrRM0KTbiTB9AOOPiJ9hhX4Q5MnkJNWkr+MwfQfH6Scb5y1z7yN2NxGQb QDkm5eO7e0S2BIkLDF4zP5mlsrQDj4/VcSZq7x16qwvLJcy8hF3Sx3HDOORN3EYzr3ADdN 6qmGgTQSNNJLBFOOlfC6jxXMqpBHUdiz2Y9u1GwxPwEnGKXKnAR3+zYaBW4U8DoN0sDRG8 da6czrBizeg812XKOKyy4FUD42x2cswVi1IrhGuEAamozDGn7OPbEgEU2u0oOhd3Ehqz+H 0mWL/OVTMyAc5acCofoMtqm8w76Rl+Ot3Nv+CQLxC174zDTNm4N4NVWPCpUQzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751985145; 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=OpHdORxcefN1aQHGarIHYvVEtTJEWqc6sR4PR3GYwwc=; b=BiQ4vtIa/sC7A8FMxge/o8RRJayjRH19OBBR2m+AV1CDuF83t3vtMRul3629lb0cQv7Le6 sUyx4Pn6WNwXRi+ugB/usUxa/+ABMkxdiyRqZfRfRlYbkwBq8a80b/hZoroMrTXrWfYzd1 m4LQhqfEygoDstT04zI7Boj+fsIpLwAUAOmslvAw/yw3pA+gBmoaEcPll27Yzp/FHKNAmd H+S1sY/QPEq3FNWU8KSK33FGsmWJ+z6VnbBq8Bgo5CfUAfdcq/92FMB7CZFYgC4/zjWCyc 6FPYDb6FhZ6QeiCLiemL5hGxahtK1RhrLeDAShypSJRqgQgzA2752bw/Ypz24w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751985145; a=rsa-sha256; cv=none; b=NqmJCgpMGxSL8MZjEh/6yVW8htCcVBgmUrjbSCp6GiCRhwQx4YOqcmkN6ARn0xb5GZRLbN fEwVJMAwAtDa3AhEUsLgmp5Qj2YXr/TxgMVV8fVYI7DSoXy9IaN0kBhXP7LpP7xpMJ9Jsw BjBiLj0vBhYQ/0tK/pcYdM3GVa7a6P9/dvaJmE+IWHJeU0LshVFNN/iea7nqe2MKltx6Fi NSv9tzntKFT3/vjZmSjF34H5zAi7lK//u+GqWlXCzLQLf0/CcBP9/YwBKtQSRroMrB4nWa EJIAJVjTKCAHOCYOq/YD6kYqivbuuvl5mi7B+Fi24RSUQ+uzC/AWJ4tHQi2u8w== 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 4bc3V10dBgzhGd; Tue, 08 Jul 2025 14:32:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 568EWOtg073498; Tue, 8 Jul 2025 14:32:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 568EWOO2073495; Tue, 8 Jul 2025 14:32:24 GMT (envelope-from git) Date: Tue, 8 Jul 2025 14:32:24 GMT Message-Id: <202507081432.568EWOO2073495@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: ee1fd6b260c0 - stable/14 - nuageinit: launch post network script with postnet citype 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ee1fd6b260c04560f424e4dc974b966b41af8dba Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=ee1fd6b260c04560f424e4dc974b966b41af8dba commit ee1fd6b260c04560f424e4dc974b966b41af8dba Author: Sebastien Baylocq AuthorDate: 2025-06-25 15:20:50 +0000 Commit: Baptiste Daroussin CommitDate: 2025-07-08 14:31:47 +0000 nuageinit: launch post network script with postnet citype Sponsored by: OVHCloud (cherry picked from commit dba00b1c6bc1bb9753bf0a554eab04077e85e214) --- libexec/rc/rc.d/nuageinit_post_net | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libexec/rc/rc.d/nuageinit_post_net b/libexec/rc/rc.d/nuageinit_post_net index bea4c5e37c5f..6d2591a603af 100755 --- a/libexec/rc/rc.d/nuageinit_post_net +++ b/libexec/rc/rc.d/nuageinit_post_net @@ -16,8 +16,8 @@ rcvar="nuageinit_enable" execute_post_net() { - test -f /var/cache/nuageinit/post_network_config || return - /usr/libexec/nuageinit /var/cache/nuageinit/post_network_config | tee -a /var/log/nuageinit.log + test -f /var/cache/nuageinit/user_data -o -f /var/cache/nuageinit/user-data || return + /usr/libexec/nuageinit /var/cache/nuageinit/ postnet | tee -a /var/log/nuageinit.log } # Share the same config as nuageinit From nobody Tue Jul 8 14:32:23 2025 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 4bc3V02B12z614ql; Tue, 08 Jul 2025 14:32:24 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bc3V00F3qz49M1; Tue, 08 Jul 2025 14:32:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751985144; 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=24FTLD+MnV8D9EFGKBs5/0P8NC/UvxHsP7YVilByli0=; b=Gjq6BWPL5hpDzX04YODzCGVW72GY8dDvSAmktCUfMRhnPTRxkbOb9VSs/ylBSiwxAK0NoH 2+IHQvZy+aqI+kHUqiA2YVmIpuobyt3q6lIpx/9RGtuyVqKT0v7K3rk+0MHXAg3xv0hQLn WAeA32iOsggQmhueT0APD3LvTvQHT5QgtBY5cxRKv85NMTLphPW6a20ZtIMVn15Am8/Vj0 ZcpBz/wzsfLaOH7UOkOjWh0h7HApynwMoy3B70yo9Fp+JjSCVYJgg1OmAHGEqh3PrXVk2P BYw2l2vpp2rkpIgfPmNnK8CKBQBBmxP320GCxAMddO0hQlZ6YqBKKQ+QCTzm4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751985144; 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=24FTLD+MnV8D9EFGKBs5/0P8NC/UvxHsP7YVilByli0=; b=x9itZXQpbbTF8pcuR5g7lDU775bSbvaRsJJEqVseg5kXJcsjU0mNpWS7MQcBwBwS9r5XFd Vv+eLyQ/38jCt9dZseF4kudKpTebopHFHxfeFu0PjBkrPDPAw33s2z4MpoOXgUozhlg/x+ vteoPLpa4AEsQw/+nSrPsV7/OBbHt7HvV3h3ocPMEOde0ctVP8fRiyFxBEwML6R/M5eZgm 20hBzG869IQZzZEMJhKGDgPpV9JyhCTfE0gr8+EE6NV79uf7ekT1VWTEb1vQLEVd/yqSYP m5bbrYw6QxQandQRhVsk0AG5WbpvB5IPTCuboNGWCHWfo3y5/vTuKdR2v1lsUg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751985144; a=rsa-sha256; cv=none; b=fersqMDxygRtxz1gmOZvLdfHHjpPEdtdSPawKfKc7Pisn/vNzEtUwBDssu7Wl/y9dUKz8H /2YdVIO8XGePFQxScYruC5zVL3meoTRtdLDMpMeAzWfyHQ0UglUxomc9IB4+TkuZ+cy7mk K9xb0QTgKLXea4o46UoTsIATG5BH15ef4GCXuYWvOuBkCLNmFDoEffsK/P71/SFlHwJcMD h4xOBvTTrmnkzCsl+dk3+yakgvYZbGf+4NMEBkeOu25B9SoS08Itd33L9BiLXYFVL+Viaw MjNt6XUc5B1dhwWqM2a1xScUh4qeiv2+ZT9OULDXxj8UX3tKT5aTa4kLs9sgPg== 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 4bc3Tz6pmNzgnF; Tue, 08 Jul 2025 14:32:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 568EWN25073465; Tue, 8 Jul 2025 14:32:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 568EWNV2073462; Tue, 8 Jul 2025 14:32:23 GMT (envelope-from git) Date: Tue, 8 Jul 2025 14:32:23 GMT Message-Id: <202507081432.568EWNV2073462@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: 823f1076c7cd - stable/14 - nuageinit: use lyaml to parse yaml files 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 823f1076c7cd28f4eebe18aeb576d719a0148fee Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=823f1076c7cd28f4eebe18aeb576d719a0148fee commit 823f1076c7cd28f4eebe18aeb576d719a0148fee Author: Baptiste Daroussin AuthorDate: 2025-06-26 06:49:07 +0000 Commit: Baptiste Daroussin CommitDate: 2025-07-08 14:31:25 +0000 nuageinit: use lyaml to parse yaml files This fixes case where vendors or cloudinit consumers are using all features from yaml. KDE is using reference for its CI for example. lima-vm uses syntax for which our previous yaml.lua has bug in the parser (https://github.com/lima-vm/lima/issues/1508) (cherry picked from commit 40dafa08b2e7a04d2662b601ef89b48132c1b6c1) --- ObsoleteFiles.inc | 3 + libexec/nuageinit/Makefile | 2 +- libexec/nuageinit/nuageinit | 6 +- libexec/nuageinit/tests/nuageinit.sh | 9 +- libexec/nuageinit/yaml.lua | 587 ----------------------------------- 5 files changed, 13 insertions(+), 594 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 5195dba6d58e..cecfc8c47a75 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -51,6 +51,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20250708: replace yaml.lua with lyaml +OLD_FILES+=usr/share/flua/yaml.lua + # 20250524: don't install zoneinfo version OLD_FILES+=usr/share/zoneinfo/version diff --git a/libexec/nuageinit/Makefile b/libexec/nuageinit/Makefile index a4d8e0de5777..755ecb7ff418 100644 --- a/libexec/nuageinit/Makefile +++ b/libexec/nuageinit/Makefile @@ -1,6 +1,6 @@ PACKAGE= nuageinit SCRIPTS= nuageinit -FILES= nuage.lua yaml.lua +FILES= nuage.lua FILESDIR= ${SHAREDIR}/flua MAN= nuageinit.7 diff --git a/libexec/nuageinit/nuageinit b/libexec/nuageinit/nuageinit index 1550440940df..5af1b84c1848 100755 --- a/libexec/nuageinit/nuageinit +++ b/libexec/nuageinit/nuageinit @@ -6,7 +6,7 @@ local nuage = require("nuage") local ucl = require("ucl") -local yaml = require("yaml") +local yaml = require("lyaml") local sys_stat = require("posix.sys.stat") if #arg ~= 2 then @@ -408,7 +408,7 @@ elseif citype == "nocloud" then if err then nuage.err("error parsing nocloud meta-data: " .. err) end - local obj = yaml.eval(f:read("*a")) + local obj = yaml.load(f:read("*a")) f:close() if not obj then nuage.err("error parsing nocloud meta-data") @@ -466,7 +466,7 @@ if line == "#cloud-config" then } f = io.open(ni_path .. "/" .. ud) - local obj = yaml.eval(f:read("*a")) + local obj = yaml.load(f:read("*a")) f:close() if not obj then nuage.err("error parsing cloud-config file: " .. ud) diff --git a/libexec/nuageinit/tests/nuageinit.sh b/libexec/nuageinit/tests/nuageinit.sh index f344e7f6c710..44830f67e4c8 100644 --- a/libexec/nuageinit/tests/nuageinit.sh +++ b/libexec/nuageinit/tests/nuageinit.sh @@ -477,6 +477,7 @@ EOF MIIBxwIBAAJhAKD0YSHy73nUgysO13XsJmd4fHiFyQ+00R7VVu2iV9Qco ... -----END RSA PRIVATE KEY----- + " atf_check -o inline:"${_expected}" cat ${PWD}/etc/ssh/ssh_host_rsa_key _expected="ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAGEAoPRhIfLvedSDKw7Xd ...\n" @@ -484,7 +485,9 @@ MIIBxwIBAAJhAKD0YSHy73nUgysO13XsJmd4fHiFyQ+00R7VVu2iV9Qco _expected="-----BEGIN OPENSSH PRIVATE KEY----- blabla ... ------END OPENSSH PRIVATE KEY-----\n" +-----END OPENSSH PRIVATE KEY----- + +" atf_check -o inline:"${_expected}" cat ${PWD}/etc/ssh/ssh_host_ed25519_key _expected="ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIK+MH4E8KO32N5CXRvXVqvyZVl0+6ue4DobdhU0FqFd+\n" atf_check -o inline:"${_expected}" cat ${PWD}/etc/ssh/ssh_host_ed25519_key.pub @@ -728,7 +731,7 @@ config2_userdata_runcmd_body() runcmd: EOF chmod 755 "${PWD}"/media/nuageinit/user_data - atf_check -s exit:1 -e match:"attempt to index a nil value" /usr/libexec/nuageinit "${PWD}"/media/nuageinit config-2 + atf_check /usr/libexec/nuageinit "${PWD}"/media/nuageinit config-2 cat > media/nuageinit/user_data << 'EOF' #cloud-config runcmd: @@ -767,7 +770,7 @@ config2_userdata_packages_body() packages: EOF chmod 755 "${PWD}"/media/nuageinit/user_data - atf_check -s exit:1 -e match:"attempt to index a nil value" /usr/libexec/nuageinit "${PWD}"/media/nuageinit postnet + atf_check /usr/libexec/nuageinit "${PWD}"/media/nuageinit postnet cat > media/nuageinit/user_data << 'EOF' #cloud-config packages: diff --git a/libexec/nuageinit/yaml.lua b/libexec/nuageinit/yaml.lua deleted file mode 100644 index 2cd50c29a469..000000000000 --- a/libexec/nuageinit/yaml.lua +++ /dev/null @@ -1,587 +0,0 @@ ---- --- SPDX-License-Identifier: MIT --- --- Copyright (c) 2017 Dominic Letz dominicletz@exosite.com - -local table_print_value -table_print_value = function(value, indent, done) - indent = indent or 0 - done = done or {} - if type(value) == "table" and not done [value] then - done [value] = true - - local list = {} - for key in pairs (value) do - list[#list + 1] = key - end - table.sort(list, function(a, b) return tostring(a) < tostring(b) end) - local last = list[#list] - - local rep = "{\n" - local comma - for _, key in ipairs (list) do - if key == last then - comma = '' - else - comma = ',' - end - local keyRep - if type(key) == "number" then - keyRep = key - else - keyRep = string.format("%q", tostring(key)) - end - rep = rep .. string.format( - "%s[%s] = %s%s\n", - string.rep(" ", indent + 2), - keyRep, - table_print_value(value[key], indent + 2, done), - comma - ) - end - - rep = rep .. string.rep(" ", indent) -- indent it - rep = rep .. "}" - - done[value] = false - return rep - elseif type(value) == "string" then - return string.format("%q", value) - else - return tostring(value) - end -end - -local table_print = function(tt) - print('return '..table_print_value(tt)) -end - -local table_clone = function(t) - local clone = {} - for k,v in pairs(t) do - clone[k] = v - end - return clone -end - -local string_trim = function(s, what) - what = what or " " - return s:gsub("^[" .. what .. "]*(.-)["..what.."]*$", "%1") -end - -local push = function(stack, item) - stack[#stack + 1] = item -end - -local pop = function(stack) - local item = stack[#stack] - stack[#stack] = nil - return item -end - -local context = function (str) - if type(str) ~= "string" then - return "" - end - - str = str:sub(0,25):gsub("\n","\\n"):gsub("\"","\\\""); - return ", near \"" .. str .. "\"" -end - -local Parser = {} -function Parser.new (self, tokens) - self.tokens = tokens - self.parse_stack = {} - self.refs = {} - self.current = 0 - return self -end - -local exports = {version = "1.2"} - -local word = function(w) return "^("..w..")([%s$%c])" end - -local tokens = { - {"comment", "^#[^\n]*"}, - {"indent", "^\n( *)"}, - {"space", "^ +"}, - {"true", word("enabled"), const = true, value = true}, - {"true", word("true"), const = true, value = true}, - {"true", word("yes"), const = true, value = true}, - {"true", word("on"), const = true, value = true}, - {"false", word("disabled"), const = true, value = false}, - {"false", word("false"), const = true, value = false}, - {"false", word("no"), const = true, value = false}, - {"false", word("off"), const = true, value = false}, - {"null", word("null"), const = true, value = nil}, - {"null", word("Null"), const = true, value = nil}, - {"null", word("NULL"), const = true, value = nil}, - {"null", word("~"), const = true, value = nil}, - {"id", "^\"([^\"]-)\" *(:[%s%c])"}, - {"id", "^'([^']-)' *(:[%s%c])"}, - {"string", "^\"([^\"]-)\"", force_text = true}, - {"string", "^'([^']-)'", force_text = true}, - {"timestamp", "^(%d%d%d%d)-(%d%d?)-(%d%d?)%s+(%d%d?):(%d%d):(%d%d)%s+(%-?%d%d?):(%d%d)"}, - {"timestamp", "^(%d%d%d%d)-(%d%d?)-(%d%d?)%s+(%d%d?):(%d%d):(%d%d)%s+(%-?%d%d?)"}, - {"timestamp", "^(%d%d%d%d)-(%d%d?)-(%d%d?)%s+(%d%d?):(%d%d):(%d%d)"}, - {"timestamp", "^(%d%d%d%d)-(%d%d?)-(%d%d?)%s+(%d%d?):(%d%d)"}, - {"timestamp", "^(%d%d%d%d)-(%d%d?)-(%d%d?)%s+(%d%d?)"}, - {"timestamp", "^(%d%d%d%d)-(%d%d?)-(%d%d?)"}, - {"doc", "^%-%-%-[^%c]*"}, - {",", "^,"}, - {"string", "^%b{} *[^,%c]+", noinline = true}, - {"{", "^{"}, - {"}", "^}"}, - {"string", "^%b[] *[^,%c]+", noinline = true}, - {"[", "^%["}, - {"]", "^%]"}, - {"-", "^%-", noinline = true}, - {":", "^:"}, - {"pipe", "^(|)(%d*[+%-]?)", sep = "\n"}, - {"pipe", "^(>)(%d*[+%-]?)", sep = " "}, - {"id", "^([%w][%w %-_]*)(:[%s%c])"}, - {"string", "^[^%c]+", noinline = true}, - {"string", "^[^,%]}%c ]+"} -}; -exports.tokenize = function (str) - local token - local row = 0 - local ignore - local indents = 0 - local lastIndents - local stack = {} - local indentAmount = 0 - local inline = false - str = str:gsub("\r\n","\010") - - while #str > 0 do - for i in ipairs(tokens) do - local captures = {} - if not inline or tokens[i].noinline == nil then - captures = {str:match(tokens[i][2])} - end - - if #captures > 0 then - captures.input = str:sub(0, 25) - token = table_clone(tokens[i]) - token[2] = captures - local str2 = str:gsub(tokens[i][2], "", 1) - token.raw = str:sub(1, #str - #str2) - str = str2 - - if token[1] == "{" or token[1] == "[" then - inline = true - elseif token.const then - -- Since word pattern contains last char we're re-adding it - str = token[2][2] .. str - token.raw = token.raw:sub(1, #token.raw - #token[2][2]) - elseif token[1] == "id" then - -- Since id pattern contains last semi-colon we're re-adding it - str = token[2][2] .. str - token.raw = token.raw:sub(1, #token.raw - #token[2][2]) - -- Trim - token[2][1] = string_trim(token[2][1]) - elseif token[1] == "string" then - -- Finding numbers - local snip = token[2][1] - if not token.force_text then - if snip:match("^(-?%d+%.%d+)$") or snip:match("^(-?%d+)$") then - token[1] = "number" - end - end - - elseif token[1] == "comment" then - ignore = true; - elseif token[1] == "indent" then - row = row + 1 - inline = false - lastIndents = indents - if indentAmount == 0 then - indentAmount = #token[2][1] - end - - if indentAmount ~= 0 then - indents = (#token[2][1] / indentAmount); - else - indents = 0 - end - - if indents == lastIndents then - ignore = true; - elseif indents > lastIndents + 2 then - error("SyntaxError: invalid indentation, got " .. tostring(indents) - .. " instead of " .. tostring(lastIndents) .. context(token[2].input)) - elseif indents > lastIndents + 1 then - push(stack, token) - elseif indents < lastIndents then - local input = token[2].input - token = {"dedent", {"", input = ""}} - token.input = input - while lastIndents > indents + 1 do - lastIndents = lastIndents - 1 - push(stack, token) - end - end - end -- if token[1] == XXX - token.row = row - break - end -- if #captures > 0 - end - - if not ignore then - if token then - push(stack, token) - token = nil - else - error("SyntaxError " .. context(str)) - end - end - - ignore = false; - end - - return stack -end - -Parser.peek = function (self, offset) - offset = offset or 1 - return self.tokens[offset + self.current] -end - -Parser.advance = function (self) - self.current = self.current + 1 - return self.tokens[self.current] -end - -Parser.advanceValue = function (self) - return self:advance()[2][1] -end - -Parser.accept = function (self, type) - if self:peekType(type) then - return self:advance() - end -end - -Parser.expect = function (self, type, msg) - return self:accept(type) or - error(msg .. context(self:peek()[1].input)) -end - -Parser.expectDedent = function (self, msg) - return self:accept("dedent") or (self:peek() == nil) or - error(msg .. context(self:peek()[2].input)) -end - -Parser.peekType = function (self, val, offset) - return self:peek(offset) and self:peek(offset)[1] == val -end - -Parser.ignore = function (self, items) - local advanced - repeat - advanced = false - for _,v in pairs(items) do - if self:peekType(v) then - self:advance() - advanced = true - end - end - until advanced == false -end - -Parser.ignoreSpace = function (self) - self:ignore{"space"} -end - -Parser.ignoreWhitespace = function (self) - self:ignore{"space", "indent", "dedent"} -end - -Parser.parse = function (self) - - local ref = nil - if self:peekType("string") and not self:peek().force_text then - local char = self:peek()[2][1]:sub(1,1) - if char == "&" then - ref = self:peek()[2][1]:sub(2) - self:advanceValue() - self:ignoreSpace() - elseif char == "*" then - ref = self:peek()[2][1]:sub(2) - return self.refs[ref] - end - end - - local result - local c = { - indent = self:accept("indent") and 1 or 0, - token = self:peek() - } - push(self.parse_stack, c) - - if c.token[1] == "doc" then - result = self:parseDoc() - elseif c.token[1] == "-" then - result = self:parseList() - elseif c.token[1] == "{" then - result = self:parseInlineHash() - elseif c.token[1] == "[" then - result = self:parseInlineList() - elseif c.token[1] == "id" then - result = self:parseHash() - elseif c.token[1] == "string" then - result = self:parseString("\n") - elseif c.token[1] == "timestamp" then - result = self:parseTimestamp() - elseif c.token[1] == "number" then - result = tonumber(self:advanceValue()) - elseif c.token[1] == "pipe" then - result = self:parsePipe() - elseif c.token.const == true then - self:advanceValue(); - result = c.token.value - else - error("ParseError: unexpected token '" .. c.token[1] .. "'" .. context(c.token.input)) - end - - pop(self.parse_stack) - while c.indent > 0 do - c.indent = c.indent - 1 - local term = "term "..c.token[1]..": '"..c.token[2][1].."'" - self:expectDedent("last ".. term .." is not properly dedented") - end - - if ref then - self.refs[ref] = result - end - return result -end - -Parser.parseDoc = function (self) - self:accept("doc") - return self:parse() -end - -Parser.inline = function (self) - local current = self:peek(0) - if not current then - return {}, 0 - end - - local inline = {} - local i = 0 - - while self:peek(i) and not self:peekType("indent", i) and current.row == self:peek(i).row do - inline[self:peek(i)[1]] = true - i = i - 1 - end - return inline, -i -end - -Parser.isInline = function (self) - local _, i = self:inline() - return i > 0 -end - -Parser.parent = function(self, level) - level = level or 1 - return self.parse_stack[#self.parse_stack - level] -end - -Parser.parentType = function(self, type, level) - return self:parent(level) and self:parent(level).token[1] == type -end - -Parser.parseString = function (self) - if self:isInline() then - local result = self:advanceValue() - - --[[ - - a: this looks - flowing: but is - no: string - --]] - local types = self:inline() - if types["id"] and types["-"] then - if not self:peekType("indent") or not self:peekType("indent", 2) then - return result - end - end - - --[[ - a: 1 - b: this is - a flowing string - example - c: 3 - --]] - if self:peekType("indent") then - self:expect("indent", "text block needs to start with indent") - local addtl = self:accept("indent") - - result = result .. "\n" .. self:parseTextBlock("\n") - - self:expectDedent("text block ending dedent missing") - if addtl then - self:expectDedent("text block ending dedent missing") - end - end - return result - else - --[[ - a: 1 - b: - this is also - a flowing string - example - c: 3 - --]] - return self:parseTextBlock("\n") - end -end - -Parser.parsePipe = function (self) - local pipe = self:expect("pipe") - self:expect("indent", "text block needs to start with indent") - local result = self:parseTextBlock(pipe.sep) - self:expectDedent("text block ending dedent missing") - return result -end - -Parser.parseTextBlock = function (self, sep) - local token = self:advance() - local result = string_trim(token.raw, "\n") - local indents = 0 - while self:peek() ~= nil and ( indents > 0 or not self:peekType("dedent") ) do - local newtoken = self:advance() - while token.row < newtoken.row do - result = result .. sep - token.row = token.row + 1 - end - if newtoken[1] == "indent" then - indents = indents + 1 - elseif newtoken[1] == "dedent" then - indents = indents - 1 - else - result = result .. string_trim(newtoken.raw, "\n") - end - end - return result -end - -Parser.parseHash = function (self, hash) - hash = hash or {} - local indents = 0 - - if self:isInline() then - local id = self:advanceValue() - self:expect(":", "expected semi-colon after id") - self:ignoreSpace() - if self:accept("indent") then - indents = indents + 1 - hash[id] = self:parse() - else - hash[id] = self:parse() - if self:accept("indent") then - indents = indents + 1 - end - end - self:ignoreSpace(); - end - - while self:peekType("id") do - local id = self:advanceValue() - self:expect(":","expected semi-colon after id") - self:ignoreSpace() - hash[id] = self:parse() - self:ignoreSpace(); - end - - while indents > 0 do - self:expectDedent("expected dedent") - indents = indents - 1 - end - - return hash -end - -Parser.parseInlineHash = function (self) - local id - local hash = {} - local i = 0 - - self:accept("{") - while not self:accept("}") do - self:ignoreSpace() - if i > 0 then - self:expect(",","expected comma") - end - - self:ignoreWhitespace() - if self:peekType("id") then - id = self:advanceValue() - if id then - self:expect(":","expected semi-colon after id") - self:ignoreSpace() - hash[id] = self:parse() - self:ignoreWhitespace() - end - end - - i = i + 1 - end - return hash -end - -Parser.parseList = function (self) - local list = {} - while self:accept("-") do - self:ignoreSpace() - list[#list + 1] = self:parse() - - self:ignoreSpace() - end - return list -end - -Parser.parseInlineList = function (self) - local list = {} - local i = 0 - self:accept("[") - while not self:accept("]") do - self:ignoreSpace() - if i > 0 then - self:expect(",","expected comma") - end - - self:ignoreSpace() - list[#list + 1] = self:parse() - self:ignoreSpace() - i = i + 1 - end - - return list -end - -Parser.parseTimestamp = function (self) - local capture = self:advance()[2] - - return os.time{ - year = capture[1], - month = capture[2], - day = capture[3], - hour = capture[4] or 0, - min = capture[5] or 0, - sec = capture[6] or 0, - isdst = false, - } - os.time{year=1970, month=1, day=1, hour=8} -end - -exports.eval = function (str) - return Parser:new(exports.tokenize(str)):parse() -end - -exports.dump = table_print - -return exports From nobody Tue Jul 8 14:32:17 2025 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 4bc3Ts5SMGz614ny; Tue, 08 Jul 2025 14:32:17 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bc3Ts2PxTz49My; Tue, 08 Jul 2025 14:32:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751985137; 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=/xism9DI4PLGiY9repgLI+9E7QDJ7C4kXnkwvrJTB58=; b=iWY11aKxqvLMd7SeaoZEfXyuZi8p9+PxgsP4As7eLC8j9GpgO3ZS/s9ZjEMjL0nG5UFHsI sEoKoYS4SlAo6AD9rxSRONSY/pu/SqvDnHo9m5XTSlidRORfPk/FbI/DrUA2zfH0bmo0T+ oWfwRltYh7G/8oKEzoqk/6enQXlZ9Yo7IoFWMeafiD0Si1jWMXAIT/7M/MUEmaTvEJ+mjM UksD0Y+xdk7D0h7DYQ5X6Di6xBtFAAU3DpgplJRUncTJJq52Qgy3/6qeAPFa1sval6R4i3 iSUFrOBnRPq8P/dyp2ezJ5hCS70fcN2piJTWQl7rS9J+e48PA4aQGuWOE7ReNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751985137; 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=/xism9DI4PLGiY9repgLI+9E7QDJ7C4kXnkwvrJTB58=; b=gZ9pbISTd0K5Ol5HNSqGyvemT0GfJUNhQvha9yzXYjXvcHktwrKrHIe8ExS4IzIFWArCGE DQrhotTFFFf6D6JZB+d/wVg0VFNG/9LQvaminor8StNUoDhZMBwhlLCIvzOYFo3l2DxWal /Ik6kkNo53WYt1J7atU4N6L6L58nB3wH4PYLj5Yu0vY2NS11CSgoJsc1LMvOPIWomhYh1P NDSBawz0ogc2lIZCJZ7sWI5eqyZNEfpL0KEpbc6qULjDYZu93ECyX4JnMxj0qYXNpYxE40 +w9MdqOFTz7BuoKl4ISEvu41hdUCWSMsqX7tpEU1Jj7EbhR7zksjDPzjAlVIzw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751985137; a=rsa-sha256; cv=none; b=Ps8xkfax/O4y0avzwIJhEk2GOEjqwFCyB8HmZZlOkS8Qzz7Dnq45BoD5rn9gjdX1FU9uYZ FhUCTXepQqCWl4idElutkVaWQwjryJMxi/OWJ6mI6qvlrJHJO8TCVj/mAKrRCe/Q35MUSj Cr+mnrvDxsKFlNcoDdbpqr4GkVTMZX3YgIexuRRC9DGta6JXJzwiXcal2sDOEZv6HEQI9u f1zwfM6cfAg4HnDXJ7w7R7hqFFHOTF8rKOpEQYxzGt3nbx31GMTorm1MXTpY1/Ut2ZEjHP AuTNW6mSy1C8XQmJcnyokSbmxoKTDoPYdLhullxD7lusXemSvY2dP760Hx04Ug== 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 4bc3Ts1mSKzh33; Tue, 08 Jul 2025 14:32:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 568EWHv0072199; Tue, 8 Jul 2025 14:32:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 568EWHYB072196; Tue, 8 Jul 2025 14:32:17 GMT (envelope-from git) Date: Tue, 8 Jul 2025 14:32:17 GMT Message-Id: <202507081432.568EWHYB072196@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: 0b31a05166b3 - stable/14 - prebuild_libs: register libucl dependency on libm 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0b31a05166b3594ade1ca3ab28df73b746b8bdd1 Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=0b31a05166b3594ade1ca3ab28df73b746b8bdd1 commit 0b31a05166b3594ade1ca3ab28df73b746b8bdd1 Author: Baptiste Daroussin AuthorDate: 2024-09-07 12:19:33 +0000 Commit: Baptiste Daroussin CommitDate: 2025-07-08 14:25:58 +0000 prebuild_libs: register libucl dependency on libm Reported by: Rainer Hurling (cherry picked from commit 9f0f4e23a584b5aa965aae774bb2dc1e5892d24a) --- Makefile.inc1 | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile.inc1 b/Makefile.inc1 index 656f2df9c9f8..cb193f677b30 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -3235,6 +3235,7 @@ _generic_libs+= ${_DIR} lib/libtacplus__L: lib/libmd__L lib/libpam/libpam__L lib/libxo__L: lib/libutil__L +lib/libucl__L: lib/msun__L .if ${MK_CDDL} != "no" _cddl_lib_libumem= cddl/lib/libumem From nobody Tue Jul 8 14:32:21 2025 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 4bc3Tx6WCvz614tn; Tue, 08 Jul 2025 14:32:21 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bc3Tx5LX8z49Lh; Tue, 08 Jul 2025 14:32:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751985141; 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=01sUur/HOJPoATB/Uzl02MzYs2Jf6qZpU71f7I1UNaQ=; b=R4ypncxTK4auAAwsKpUlWJbuInCTFdW70Ty8r0GEkT+PzxGLoYMVbzmL71P5gfiBVgi4W1 ncSL3zMsXMiZ0JWWlVKGpuZUG/jEJiVTcSsMHp/9AXeFPS5p6F0EuLCjJZQM0YGTLOMet9 IHjDG1kVXlu3n1kZYWybGrlcdDcItwpTNHA/z9m7lmX3+a1pgOupH/N629uAMc/UDis6tF SjzmfgtCN/gpwaN8ZtEi2ajc7VEhc+4OOTAJe6htHEHXTn4CLXF5nt3539bE6Tv0QkdFRD brx6carH12rSx62cTXsiTae9vbxlXWQNQkBjg4IalG4WTi33nSetiCUhqlSYgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751985141; 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=01sUur/HOJPoATB/Uzl02MzYs2Jf6qZpU71f7I1UNaQ=; b=S7U8XI7Zf4KO2z3ZvWwIibYkIC6v+kqARWm5Q8kx7fLH0tAcRMrpzPA07d4/gzK/lOA36J 69Oycuh47GArhlupAJeR6aLDVq0Db7Rkkr/NWMy9WhZMe+5ZIJ8FCRWiWQxIeCEB7Q79w3 YZFdxftBeXig6vF8XA+A9h1q3Cz+mKwFeU21exJtVfBWKqkQBeXZp0wcvljHS0r7uJaS+x u7ZDZole3Lt27YzBlNJrP+Bwaey8F/jHWb4EU2UFTBaNC5UF7h/Bam/8eAy5a0XNFv5giQ NaWalkpD8YTc1ya0w4iqtO83q/tzDmaV9Jy5PhADrHf7txbTEfWEleIpLgbZKA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751985141; a=rsa-sha256; cv=none; b=KdwOYIfnhB77aj9eol5Tx8ycj4EM4N/x3ttyH3hSTctPUM1Y3dco+fa2qWVT2xbHUieZK5 3/BaP4IJ2OMukXtY4TysFS3U/21quEIj3ck0QLkJttcvuPRR2aRBo9/HSUZfg0476SvauM +GPkT3dkZoI2TV6qZ8Y3ROSdlORNEBPVY5KHFLAbcrD7sLQYRn0RP2/ocpw2uf4LPMwc/Q Nza492A3I4AyueW9xFfJ++DwMTRM3n1NRwjplp7TqewyVit4fvGU/eO8qvbegkYuwLdXaF fVLV5CWvzkizfhdVTrl2+kYAVXwBCpvMCacfwS257rsgTx1ZZYHghnPdOShSaQ== 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 4bc3Tx4y5tzhGY; Tue, 08 Jul 2025 14:32:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 568EWL4x072406; Tue, 8 Jul 2025 14:32:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 568EWLZ0072390; Tue, 8 Jul 2025 14:32:21 GMT (envelope-from git) Date: Tue, 8 Jul 2025 14:32:21 GMT Message-Id: <202507081432.568EWLZ0072390@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: 4ea761b726fe - stable/14 - flua: add freebsd.kenv, kenv(2) bindings 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4ea761b726fe6a3531a7f7a17933226c03a7c772 Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=4ea761b726fe6a3531a7f7a17933226c03a7c772 commit 4ea761b726fe6a3531a7f7a17933226c03a7c772 Author: Baptiste Daroussin AuthorDate: 2024-09-12 12:42:01 +0000 Commit: Baptiste Daroussin CommitDate: 2025-07-08 14:28:16 +0000 flua: add freebsd.kenv, kenv(2) bindings Add bindings for kenv(2) right now only get() has been created it allows do dump into a key/value table the kernel environement if no argument is passed, or it returns the value associated to the provided key. Reviewed by: imp, kevans, markj Accepted by: imp, kevans Differential Revision: https://reviews.freebsd.org/D46654 (cherry picked from commit 696922fbfa3e1c400701a3a39dcadf7dee12b06c) --- libexec/flua/libfreebsd/Makefile | 1 + libexec/flua/libfreebsd/Makefile.inc | 2 + libexec/flua/libfreebsd/kenv/Makefile | 5 ++ libexec/flua/libfreebsd/kenv/freebsd.kenv.3lua | 44 ++++++++++++ libexec/flua/libfreebsd/kenv/kenv.c | 96 ++++++++++++++++++++++++++ 5 files changed, 148 insertions(+) diff --git a/libexec/flua/libfreebsd/Makefile b/libexec/flua/libfreebsd/Makefile index 6ed0451055ff..36d39d6b0502 100644 --- a/libexec/flua/libfreebsd/Makefile +++ b/libexec/flua/libfreebsd/Makefile @@ -1,3 +1,4 @@ +SUBDIR+= kenv SUBDIR+= sys .include diff --git a/libexec/flua/libfreebsd/Makefile.inc b/libexec/flua/libfreebsd/Makefile.inc index 01b5f23410c8..26a1540482c7 100644 --- a/libexec/flua/libfreebsd/Makefile.inc +++ b/libexec/flua/libfreebsd/Makefile.inc @@ -1 +1,3 @@ +SHLIBDIR?= ${LIBDIR}/flua/freebsd + .include "../Makefile.inc" diff --git a/libexec/flua/libfreebsd/kenv/Makefile b/libexec/flua/libfreebsd/kenv/Makefile new file mode 100644 index 000000000000..1726c892c515 --- /dev/null +++ b/libexec/flua/libfreebsd/kenv/Makefile @@ -0,0 +1,5 @@ +SHLIB_NAME= kenv.so +SRCS+= kenv.c +MAN= freebsd.kenv.3lua + +.include diff --git a/libexec/flua/libfreebsd/kenv/freebsd.kenv.3lua b/libexec/flua/libfreebsd/kenv/freebsd.kenv.3lua new file mode 100644 index 000000000000..d254dd22c91c --- /dev/null +++ b/libexec/flua/libfreebsd/kenv/freebsd.kenv.3lua @@ -0,0 +1,44 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.\" Copyright (c) 2024, Baptiste Daroussin +.\" +.Dd September 6, 2024 +.Dt FREEBSD.KENV 3lua +.Os +.Sh NAME +.Nm freebsd.kenv +.Nd Lua binding to +.Fx 's +Linker functions +.Sh SYNOPSIS +.Bd -literal +local kenv = require('freebsd.kenv') +.Ed +.Pp +.Bl -tag -width XXXX -compact +.It Dv table = kenv.get() +.It Dv value = kenv.get(key) +.El +.Sh DESCRIPTION +The +.Nm +module is a binding to the +.Xr kenv 2 +function. +.Pp +List of functions: +.Bl -tag -width XXXX +.It Dv table = freebsd.kenv.get() +Dump the kernel environnement into a key/value +.Fa table . +.It Dv value = freebsd.kenv.get(key) +Return the +.Fa value +associated to the +.Fa key , +if it exists, or +.Va nil +otherwise. +.Sh SEE ALSO +.Xr kenv 2 diff --git a/libexec/flua/libfreebsd/kenv/kenv.c b/libexec/flua/libfreebsd/kenv/kenv.c new file mode 100644 index 000000000000..954baa00facb --- /dev/null +++ b/libexec/flua/libfreebsd/kenv/kenv.c @@ -0,0 +1,96 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2024, Baptiste Daroussin + */ + +#include +#include +#include +#include +#include + +#include +#include +#include + +int luaopen_freebsd_kenv(lua_State *L); + +static int +lua_kenv_get(lua_State *L) +{ + const char *env; + int ret, n; + char value[1024]; + + n = lua_gettop(L); + if (n == 0) { + char *buf, *bp, *cp; + int size; + + size = kenv(KENV_DUMP, NULL, NULL, 0); + if (size < 0) { + lua_pushnil(L); + lua_pushstring(L, strerror(errno)); + lua_pushinteger(L, errno); + return (3); + } + size += 1; + buf = malloc(size); + if (buf == NULL) { + lua_pushnil(L); + lua_pushstring(L, strerror(errno)); + lua_pushinteger(L, errno); + return (3); + } + if (kenv(KENV_DUMP, NULL, buf, size) < 0) { + free(buf); + lua_pushnil(L); + lua_pushstring(L, strerror(errno)); + lua_pushinteger(L, errno); + return (3); + } + + lua_newtable(L); + for (bp = buf; *bp != '\0'; bp += strlen(bp) + 1) { + cp = strchr(bp, '='); + if (cp == NULL) + continue; + *cp++ = '\0'; + lua_pushstring(L, cp); + lua_setfield(L, -2, bp); + bp = cp; + } + free(buf); + return (1); + } + env = luaL_checkstring(L, 1); + ret = kenv(KENV_GET, env, value, sizeof(value)); + if (ret == -1) { + if (errno == ENOENT) { + lua_pushnil(L); + return (1); + } + lua_pushnil(L); + lua_pushstring(L, strerror(errno)); + lua_pushinteger(L, errno); + return (3); + } + lua_pushstring(L, value); + return (1); +} + +#define REG_SIMPLE(n) { #n, lua_kenv_ ## n } +static const struct luaL_Reg freebsd_kenv[] = { + REG_SIMPLE(get), + { NULL, NULL }, +}; +#undef REG_SIMPLE + +int +luaopen_freebsd_kenv(lua_State *L) +{ + luaL_newlib(L, freebsd_kenv); + + return (1); +} From nobody Tue Jul 8 14:32:19 2025 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 4bc3Tv5z3tz614bT; Tue, 08 Jul 2025 14:32:19 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bc3Tv40JMz49Fh; Tue, 08 Jul 2025 14:32:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751985139; 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=3rBiuGdh/d0dSh4g8IBzLt6fBIwEWoIcDIBitMIQz+Y=; b=beSDZa9am8qRlAr1ap3TZvBg/RPdBAbVTWaU+3LcE9vOyOMJ4Fa16a7XBXoVJ3QMbQlnpL L95NL19erAOeIQ/JgHoWf3kOhHa+T0t02/V/tM5p8Lzor2y9lEFwNKuj4PAGVNiDMJQ8A9 9STum525PLUQwfaAHahQRuOtCBGGe/tr2+9fnbIFX93uPOD28sr9/bIlPzJism1tMGBRo1 xO8PyQ1/YiPPMbO2/ze+h43HFmFUPQ+URkqyBEu3q24mzAAH9/0I5/U9iEINiH4QxG0EXv wb3nVFRt0PJrmPt5q40ZCUp6mdHJF+AxbcTTOjjjHEgFNj9/r8qPbAQk+rJLmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751985139; 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=3rBiuGdh/d0dSh4g8IBzLt6fBIwEWoIcDIBitMIQz+Y=; b=hBOin9uHB/y50kVWVnLHOrpJOD16Q2X+Tcokjt76X35evC222GKAsxfIzOqSLD48+sOhvx 7KVZA9S6CV5zYVbZ9kh/CsfKEsV63DB8y1OAAdsmB7FTX59nhZLO7AB+NCu3A+B4lhrzEE A53MBA7OL1/Bmpla8e9Sd8jnr/TZTPiz+c0H6H3jqhBB8prlFbdW/3o+kfsBi8BzlN1j9I xfyv5t3HwWsh/50PY6RBbc3N8BzGHnEqo5BxVcIOAcqw8ztWCkLrEvy9NVBe2xdCbmQT4x NCQEUL3TWqdLI9Zl8Vv14is+6RQJ7rfUV9UYs7GzEJCw0htPzsAvyAfDOm7A3g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751985139; a=rsa-sha256; cv=none; b=oEVwiO/dt1K0wqshgCEfvoTDIBSwzZeMcm7qIQ2hQsHY194JpFk7vqYhupYJBvGZ7ZZZLt EK6y7QNJFjEOKHriCUPN4gjSSf5FXbPor6OZlmJStBOLZRxJWauj4zLlWaaJRjtlTknHa/ +99KxlmP4/cZY+ulqTIiEPpjBSoM6iA89eJV8E5nmgGwwC1msQ5pfzFMu2xDOQMJEYwx41 67Xs1duqN3WCDPjQ7lSltn9J3qN5ixlXU/YhJ/4pHTFwTehzXR7RzsjDt06+Ohk15vSGwX K9hr7Moga4pp9xQoUF3VU7nhN8pclB6gMgHTGWntmoXU47F/LA60V7jxVP9IGQ== 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 4bc3Tv3YdBzhSw; Tue, 08 Jul 2025 14:32:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 568EWJW1072263; Tue, 8 Jul 2025 14:32:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 568EWJ03072260; Tue, 8 Jul 2025 14:32:19 GMT (envelope-from git) Date: Tue, 8 Jul 2025 14:32:19 GMT Message-Id: <202507081432.568EWJ03072260@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: 7a83385d4754 - stable/14 - flua: install linker in the right patch 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7a83385d4754542ddf4e1cac36787d3973ced86b Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=7a83385d4754542ddf4e1cac36787d3973ced86b commit 7a83385d4754542ddf4e1cac36787d3973ced86b Author: Baptiste Daroussin AuthorDate: 2024-09-12 12:42:01 +0000 Commit: Baptiste Daroussin CommitDate: 2025-07-08 14:27:55 +0000 flua: install linker in the right patch When moving the freebsd.sys.linker sources the installation path was lost. Fixes 7899f917b1c0ea178f1d2be0cfb452086d079d23 (cherry picked from commit cbf53f5e370e2f6ed0dbd2305b48719fcfc6cec8) --- libexec/flua/libfreebsd/sys/Makefile.inc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libexec/flua/libfreebsd/sys/Makefile.inc b/libexec/flua/libfreebsd/sys/Makefile.inc index 01b5f23410c8..ca2630721733 100644 --- a/libexec/flua/libfreebsd/sys/Makefile.inc +++ b/libexec/flua/libfreebsd/sys/Makefile.inc @@ -1 +1,3 @@ +SHLIBDIR?= ${LIBDIR}/flua/freebsd/sys + .include "../Makefile.inc" From nobody Tue Jul 8 14:32:18 2025 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 4bc3Tt5BRKz614qh; Tue, 08 Jul 2025 14:32:18 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bc3Tt3Sj3z49L8; Tue, 08 Jul 2025 14:32:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751985138; 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=PSN52kThE5FUCOkVGW86rTMlP0rczKh0/nbSGOSjwyQ=; b=ts38RFYCCiV+uKElTmI2VBgTKBxWpXu6cHCsKSRZJr7aub9i+y9mXUyjY7YZDLW9Xezp12 orK4EuEvfkp3CCReoBTTnwTyXcp1rH15WyaY7hUaQHkEzhweEq5aUFePR+laFj4c6Nol6Y ShaTzV5CtvIrQ63gjEgiRXQ6ZreVtoHyGW+LBYyCfceeeG65YRkvwZ5WpvHynK4U3k1uEu bBlMFoc5LXVzRsp/pb3MJKljf83EYPAwHwDOJpN0de/VbBpFqMRHDUynj2N2ROwCA4Cq5c yT0xngKJteYKdjn7LgckCHHFOevZam9WNkNRQVkXegYl/ADYjmNCKfLPhHA4tw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751985138; 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=PSN52kThE5FUCOkVGW86rTMlP0rczKh0/nbSGOSjwyQ=; b=vqDuhrx77PjpTm9t85N7ti1FNiKD1XCuAp2UkcV/CK7VUwtmoP2aBQgXedyJTMKUzYFDB7 5RsprhjmACtKWt8+HUmP7Gd0GY/Ozx1XVbx/fTMPe+6lRyRtsXYcMEo76cBePsskSQiDGM nnW/lNE6BB6Dgw+hNYbEkuePPfomus/R7Iv2g3avDCsAlpp7HbinESFg88vYs8TK5sAbAW aQYrH1IT637M7jBL8hntM0hUbVHwEFmVfLF77ohzivI6FtzcMXaaxeKGtQ3zCdrjiWJA+B fUorZP8NjBFiJJiyW5L1rdYOcYPxQvb/fc6Bf3zp9FJs6DB3GC4kG1hA0iIy7w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751985138; a=rsa-sha256; cv=none; b=kv5o2hv0Fh8mZQbw75lhIE+QyOb4cND7FTo5ucqhGDdXJEnJJxPawChFriR90XZUp7ZZ1r rIIz6Jv57COq2p4hRJj3Fd240UuMOl2lw7qaMLrAIKjROMS5awWtsWse4vtnpiM2MUv410 Pfs3BNt7PSinnmDU7uTEOrN13+uvjl9txjWLaqUfVK9YMwGpn7SdAhLqR/Zyjf9H9x1SYx 9/PRV4bB/UFM1bDJVf02NVaFd8UntTX1Ney611v+r9hT3n2jaqlYIbodk3+yMMARY07M/y xo4CwjutvfgoaeoxyOwK1/NqMWfBPAbxmJs6wplA8yM9welSU9cTg4rcbGGx4Q== 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 4bc3Tt32b4zhGW; Tue, 08 Jul 2025 14:32:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 568EWIUo072231; Tue, 8 Jul 2025 14:32:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 568EWIXk072228; Tue, 8 Jul 2025 14:32:18 GMT (envelope-from git) Date: Tue, 8 Jul 2025 14:32:18 GMT Message-Id: <202507081432.568EWIXk072228@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: cf48057f3ea9 - stable/14 - flua: move modules source into the main source directory 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: cf48057f3ea9cf19e31fb03404bc2a73cc35ba43 Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=cf48057f3ea9cf19e31fb03404bc2a73cc35ba43 commit cf48057f3ea9cf19e31fb03404bc2a73cc35ba43 Author: Baptiste Daroussin AuthorDate: 2024-09-09 15:17:27 +0000 Commit: Baptiste Daroussin CommitDate: 2025-07-08 14:27:17 +0000 flua: move modules source into the main source directory Follow the path of what is done with bsnmp, build the modules along with the main binary, this allows to build the modules at a moment where all needed libraries are already built and available in the linker path instead of having to declare all the libraries which a flua module will be linked to in _prebuild_libs. Discused with: markj Reviewed by: markj, jrtc27, kevans, imp Accepted by: kevans, imp Differential Revision: https://reviews.freebsd.org/D46610 (cherry picked from commit 7899f917b1c0ea178f1d2be0cfb452086d079d23) --- Makefile.inc1 | 4 +--- lib/Makefile | 5 ----- lib/flua/Makefile | 6 ------ lib/flua/libfreebsd/sys/linker/Makefile | 12 ------------ lib/flua/libhash/Makefile | 14 -------------- libexec/flua/Makefile | 5 +++++ libexec/flua/Makefile.inc | 5 +++++ {lib => libexec}/flua/libfreebsd/Makefile | 0 libexec/flua/libfreebsd/Makefile.inc | 1 + {lib => libexec}/flua/libfreebsd/sys/Makefile | 0 libexec/flua/libfreebsd/sys/Makefile.inc | 1 + libexec/flua/libfreebsd/sys/linker/Makefile | 7 +++++++ .../flua/libfreebsd/sys/linker/freebsd.sys.linker.3lua | 0 {lib => libexec}/flua/libfreebsd/sys/linker/linker.c | 0 libexec/flua/libhash/Makefile | 9 +++++++++ {lib => libexec}/flua/libhash/hash.3lua | 0 {lib => libexec}/flua/libhash/lhash.c | 0 {lib => libexec}/flua/libhash/lhash.h | 0 {lib => libexec}/flua/libjail/Makefile | 5 ----- {lib => libexec}/flua/libjail/jail.3lua | 0 {lib => libexec}/flua/libjail/lua_jail.c | 0 {lib => libexec}/flua/libucl/Makefile | 3 --- stand/defs.mk | 2 +- 23 files changed, 30 insertions(+), 49 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index cb193f677b30..d9ac4491ef77 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -3178,8 +3178,7 @@ _prebuild_libs= ${_kerberos5_lib_libasn1} \ lib/libutil lib/libpjdlog ${_lib_libypclnt} lib/libz lib/msun \ lib/libxo \ ${_secure_lib_libcrypto} ${_secure_lib_libssl} \ - ${_lib_libldns} ${_secure_lib_libssh} \ - lib/libucl + ${_lib_libldns} ${_secure_lib_libssh} .if ${MK_DIALOG} != "no" _prebuild_libs+= gnu/lib/libdialog @@ -3235,7 +3234,6 @@ _generic_libs+= ${_DIR} lib/libtacplus__L: lib/libmd__L lib/libpam/libpam__L lib/libxo__L: lib/libutil__L -lib/libucl__L: lib/msun__L .if ${MK_CDDL} != "no" _cddl_lib_libumem= cddl/lib/libumem diff --git a/lib/Makefile b/lib/Makefile index 855d7ca0279e..2fa992731715 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -149,11 +149,6 @@ SUBDIR_DEPEND_libpcap= ofed .endif SUBDIR_DEPEND_nss_tacplus= libtacplus -.if !defined(COMPAT_LIBCOMPAT) -SUBDIR+= flua -SUBDIR_DEPEND_flua= libjail libucl -.endif - # NB: keep these sorted by MK_* knobs SUBDIR.${MK_BEARSSL}+= libbearssl libsecureboot diff --git a/lib/flua/Makefile b/lib/flua/Makefile deleted file mode 100644 index d88e76f61062..000000000000 --- a/lib/flua/Makefile +++ /dev/null @@ -1,6 +0,0 @@ -SUBDIR+= libfreebsd -SUBDIR+= libhash -SUBDIR+= libjail -SUBDIR+= libucl - -.include diff --git a/lib/flua/libfreebsd/sys/linker/Makefile b/lib/flua/libfreebsd/sys/linker/Makefile deleted file mode 100644 index 572b5949d2a1..000000000000 --- a/lib/flua/libfreebsd/sys/linker/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -SHLIB_NAME= linker.so -SHLIBDIR= ${LIBDIR}/flua/freebsd/sys - -SRCS+= linker.c - -CFLAGS+= \ - -I${SRCTOP}/contrib/lua/src \ - -I${SRCTOP}/lib/liblua \ - -MAN= freebsd.sys.linker.3lua - -.include diff --git a/lib/flua/libhash/Makefile b/lib/flua/libhash/Makefile deleted file mode 100644 index f166ff90a392..000000000000 --- a/lib/flua/libhash/Makefile +++ /dev/null @@ -1,14 +0,0 @@ -SHLIB_NAME= hash.so -SHLIBDIR= ${LIBDIR}/flua - -SRCS+= lhash.c - -CFLAGS+= \ - -I${SRCTOP}/contrib/lua/src \ - -I${SRCTOP}/lib/liblua \ - -LIBADD+= md - -MAN= hash.3lua - -.include diff --git a/libexec/flua/Makefile b/libexec/flua/Makefile index 4173e43baab2..4b4b2c94eca4 100644 --- a/libexec/flua/Makefile +++ b/libexec/flua/Makefile @@ -1,6 +1,11 @@ .include +SUBDIR+= libfreebsd +SUBDIR+= libhash +SUBDIR+= libjail +SUBDIR+= libucl + LUASRC?= ${SRCTOP}/contrib/lua/src .PATH: ${LUASRC} diff --git a/libexec/flua/Makefile.inc b/libexec/flua/Makefile.inc new file mode 100644 index 000000000000..34505d54d7df --- /dev/null +++ b/libexec/flua/Makefile.inc @@ -0,0 +1,5 @@ +SHLIBDIR?= ${LIBDIR}/flua + +CFLAGS+= \ + -I${SRCTOP}/contrib/lua/src \ + -I${SRCTOP}/lib/liblua diff --git a/lib/flua/libfreebsd/Makefile b/libexec/flua/libfreebsd/Makefile similarity index 100% rename from lib/flua/libfreebsd/Makefile rename to libexec/flua/libfreebsd/Makefile diff --git a/libexec/flua/libfreebsd/Makefile.inc b/libexec/flua/libfreebsd/Makefile.inc new file mode 100644 index 000000000000..01b5f23410c8 --- /dev/null +++ b/libexec/flua/libfreebsd/Makefile.inc @@ -0,0 +1 @@ +.include "../Makefile.inc" diff --git a/lib/flua/libfreebsd/sys/Makefile b/libexec/flua/libfreebsd/sys/Makefile similarity index 100% rename from lib/flua/libfreebsd/sys/Makefile rename to libexec/flua/libfreebsd/sys/Makefile diff --git a/libexec/flua/libfreebsd/sys/Makefile.inc b/libexec/flua/libfreebsd/sys/Makefile.inc new file mode 100644 index 000000000000..01b5f23410c8 --- /dev/null +++ b/libexec/flua/libfreebsd/sys/Makefile.inc @@ -0,0 +1 @@ +.include "../Makefile.inc" diff --git a/libexec/flua/libfreebsd/sys/linker/Makefile b/libexec/flua/libfreebsd/sys/linker/Makefile new file mode 100644 index 000000000000..1adf547b503c --- /dev/null +++ b/libexec/flua/libfreebsd/sys/linker/Makefile @@ -0,0 +1,7 @@ +SHLIB_NAME= linker.so + +SRCS+= linker.c + +MAN= freebsd.sys.linker.3lua + +.include diff --git a/lib/flua/libfreebsd/sys/linker/freebsd.sys.linker.3lua b/libexec/flua/libfreebsd/sys/linker/freebsd.sys.linker.3lua similarity index 100% rename from lib/flua/libfreebsd/sys/linker/freebsd.sys.linker.3lua rename to libexec/flua/libfreebsd/sys/linker/freebsd.sys.linker.3lua diff --git a/lib/flua/libfreebsd/sys/linker/linker.c b/libexec/flua/libfreebsd/sys/linker/linker.c similarity index 100% rename from lib/flua/libfreebsd/sys/linker/linker.c rename to libexec/flua/libfreebsd/sys/linker/linker.c diff --git a/libexec/flua/libhash/Makefile b/libexec/flua/libhash/Makefile new file mode 100644 index 000000000000..b7c8d7ee9948 --- /dev/null +++ b/libexec/flua/libhash/Makefile @@ -0,0 +1,9 @@ +SHLIB_NAME= hash.so + +SRCS+= lhash.c + +LIBADD+= md + +MAN= hash.3lua + +.include diff --git a/lib/flua/libhash/hash.3lua b/libexec/flua/libhash/hash.3lua similarity index 100% rename from lib/flua/libhash/hash.3lua rename to libexec/flua/libhash/hash.3lua diff --git a/lib/flua/libhash/lhash.c b/libexec/flua/libhash/lhash.c similarity index 100% rename from lib/flua/libhash/lhash.c rename to libexec/flua/libhash/lhash.c diff --git a/lib/flua/libhash/lhash.h b/libexec/flua/libhash/lhash.h similarity index 100% rename from lib/flua/libhash/lhash.h rename to libexec/flua/libhash/lhash.h diff --git a/lib/flua/libjail/Makefile b/libexec/flua/libjail/Makefile similarity index 50% rename from lib/flua/libjail/Makefile rename to libexec/flua/libjail/Makefile index c7649c724c0a..2786c9b0e8f3 100644 --- a/lib/flua/libjail/Makefile +++ b/libexec/flua/libjail/Makefile @@ -1,13 +1,8 @@ SHLIB_NAME= jail.so -SHLIBDIR= ${LIBDIR}/flua SRCS+= lua_jail.c -CFLAGS+= \ - -I${SRCTOP}/contrib/lua/src \ - -I${SRCTOP}/lib/liblua \ - LIBADD+= jail MAN= jail.3lua diff --git a/lib/flua/libjail/jail.3lua b/libexec/flua/libjail/jail.3lua similarity index 100% rename from lib/flua/libjail/jail.3lua rename to libexec/flua/libjail/jail.3lua diff --git a/lib/flua/libjail/lua_jail.c b/libexec/flua/libjail/lua_jail.c similarity index 100% rename from lib/flua/libjail/lua_jail.c rename to libexec/flua/libjail/lua_jail.c diff --git a/lib/flua/libucl/Makefile b/libexec/flua/libucl/Makefile similarity index 72% rename from lib/flua/libucl/Makefile rename to libexec/flua/libucl/Makefile index 7d2681b85fcb..a88c8bda6bfc 100644 --- a/lib/flua/libucl/Makefile +++ b/libexec/flua/libucl/Makefile @@ -1,5 +1,4 @@ SHLIB_NAME= ucl.so -SHLIBDIR= ${LIBDIR}/flua WARNS= 2 @@ -7,8 +6,6 @@ UCLSRC?= ${SRCTOP}/contrib/libucl .PATH: ${UCLSRC}/lua SRCS+= lua_ucl.c CFLAGS+= \ - -I${SRCTOP}/contrib/lua/src \ - -I${SRCTOP}/lib/liblua \ -I${UCLSRC}/include \ -I${UCLSRC}/src \ -I${UCLSRC}/uthash diff --git a/stand/defs.mk b/stand/defs.mk index a1cb39f8b4a0..9f4154d59219 100644 --- a/stand/defs.mk +++ b/stand/defs.mk @@ -69,7 +69,7 @@ BINDIR?= /boot # LUAPATH is where we search for and install lua scripts. LUAPATH?= /boot/lua FLUASRC?= ${SRCTOP}/libexec/flua -FLUALIB?= ${SRCTOP}/lib/flua +FLUALIB?= ${SRCTOP}/libexec/flua LIBSA= ${BOOTOBJ}/libsa/libsa.a .if ${MACHINE} == "i386" From nobody Tue Jul 8 14:32:26 2025 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 4bc3V25jX2z614bW; Tue, 08 Jul 2025 14:32:26 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bc3V21zrQz49Fx; Tue, 08 Jul 2025 14:32:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751985146; 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=ek/nIu9CZnL1a16nfJ2hGEnEQzorh6oh8oqZECtfc8k=; b=nskL307anhvJw3/R71tbdzsDdWxS3G6t/agYfOwIO1QvVZqxY7ut/W74nDNwJBEAJvt6Ey lmMUuOuk/Wq543Apk8swCNlTrBobcGwGqXjLVUufAgQwo4YcSkkTHvNricYC2f/Vh/tdTG PxdEWjgdiEFyRRsAiFkjbfUntVkNq/wCjSKe/LWoTBZXPinJE5c8PGNpY2/PT1m506j0by x1WE2jHyWVkhSfkhOt1bzQD4mVehrZy55doloyC8AXOhro/CC+YRJEKUKIBw2+CEBxLt5n JpkK4VP1kxFSdEyIR8bDXdJtarNoZp9BOQ2tGAhnoHs0ddDCynnj6mez1BUkjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751985146; 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=ek/nIu9CZnL1a16nfJ2hGEnEQzorh6oh8oqZECtfc8k=; b=Rfi6fkaFGk9t7No9xVgwCB/Sqf6VLMDNx+jVEgHJ/lpjdJVJHC38xzlbmL8WrkEGVsV/eg M819VY03a8bOEtNfsE1OVRsFelptiFhQK1nzWF+EXEJZDj3ZjxsNF1OONL2WFc8jwvvK4/ Y1DD6buCWd+ukbUZKzsijqO57dvp/vPgN0v+hEiKMhBj5XsfJGe9yrPW7tankn7GwcjFvb os1sQM8yzglpI/5+1yc2BgSkOQro/OiaEC6EYc/hi0Lnpa/bEUMd85Ly9wfCVtCY4zixXv gU80/f5/+4ZHwP4CINranZfr4NkYd8697+q/tejQ91QnYzxX5xYUfI7Nz86Bvw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751985146; a=rsa-sha256; cv=none; b=njQ0eVeJJBxq56BPlDSXEc1pMlcoQC2aBM2bbOamqSbGQTljWgwmTnVdrPMT4RVR/BkG1z OKY1CYvD7IJrvH5Py1LHRRUks5xRbrX07S8UG2h3BYMVvSeCVO0m6GCWkVdGxeJCLgE9I5 OJlsDzPTkZqPJGvR+1lePTxylKlIPG8HoPjROUB0Rt3ZFNVQcVNvijczyf8caNtU6OTlOK U49OCxHxnmeT1bZch9ywzXJjS6TfTsypleQl1cGvccmKFkn/qqzitQFPTK6o//pw2Yray9 RtlBJVdkZ15+D+PefN0cT51HBC3iYniUOxXqX+be/YErnHCmQAffxSIwQqd51A== 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 4bc3V21YZ9zh3D; Tue, 08 Jul 2025 14:32:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 568EWQuD073531; Tue, 8 Jul 2025 14:32:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 568EWQSh073528; Tue, 8 Jul 2025 14:32:26 GMT (envelope-from git) Date: Tue, 8 Jul 2025 14:32:26 GMT Message-Id: <202507081432.568EWQSh073528@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: d056f72c358b - stable/14 - nuageinit: implement write_files 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d056f72c358b4f962b09f5c752567ff543fe87c6 Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=d056f72c358b4f962b09f5c752567ff543fe87c6 commit d056f72c358b4f962b09f5c752567ff543fe87c6 Author: Baptiste Daroussin AuthorDate: 2025-06-26 11:32:07 +0000 Commit: Baptiste Daroussin CommitDate: 2025-07-08 14:31:47 +0000 nuageinit: implement write_files write_files is a list of files that should be created at the first boot each file content can be either plain text or encoded in base64 (note that cloudinit specify that gzip is supported, but we do not support it yet.) All other specifier from cloudinit should work: by default all files will juste overwrite exesiting files except if "append" is set to true, permissions, ownership can be specified. The files are create before packages are being installed and user created. if "defer" is set to true then the file is being created after packages installation and package manupulation. This feature is requested for KDE's CI. (cherry picked from commit 19a7ea3cc4de5af80e2913fda70bd65ad72835c0) --- libexec/nuageinit/nuage.lua | 88 +++++++++++++++++++++++++++++++++++- libexec/nuageinit/nuageinit | 25 +++++++++- libexec/nuageinit/nuageinit.7 | 38 +++++++++++++++- libexec/nuageinit/tests/Makefile | 1 + libexec/nuageinit/tests/addfile.lua | 71 +++++++++++++++++++++++++++++ libexec/nuageinit/tests/nuage.sh | 10 +++- libexec/nuageinit/tests/nuageinit.sh | 37 ++++++++++++++- 7 files changed, 264 insertions(+), 6 deletions(-) diff --git a/libexec/nuageinit/nuage.lua b/libexec/nuageinit/nuage.lua index deb441ee25ba..cdc0fc6cf2a7 100644 --- a/libexec/nuageinit/nuage.lua +++ b/libexec/nuageinit/nuage.lua @@ -7,6 +7,39 @@ local unistd = require("posix.unistd") local sys_stat = require("posix.sys.stat") local lfs = require("lfs") +local function decode_base64(input) + local b = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' + input = string.gsub(input, '[^'..b..'=]', '') + + local result = {} + local bits = '' + + -- convert all characters in bits + for i = 1, #input do + local x = input:sub(i, i) + if x == '=' then + break + end + local f = b:find(x) - 1 + for j = 6, 1, -1 do + bits = bits .. (f % 2^j - f % 2^(j-1) > 0 and '1' or '0') + end + end + + for i = 1, #bits, 8 do + local byte = bits:sub(i, i + 7) + if #byte == 8 then + local c = 0 + for j = 1, 8 do + c = c + (byte:sub(j, j) == '1' and 2^(8 - j) or 0) + end + table.insert(result, string.char(c)) + end + end + + return table.concat(result) +end + local function warnmsg(str, prepend) if not str then return @@ -441,6 +474,58 @@ local function upgrade_packages() return run_pkg_cmd("upgrade") end +local function addfile(file, defer) + if type(file) ~= "table" then + return false, "Invalid object" + end + if defer and not file.defer then + return true + end + if not defer and file.defer then + return true + end + if not file.path then + return false, "No path provided for the file to write" + end + local content = nil + if file.content then + if file.encoding then + if file.encoding == "b64" or file.encoding == "base64" then + content = decode_base64(file.content) + else + return false, "Unsupported encoding: " .. file.encoding + end + else + content = file.content + end + end + local mode = "w" + if file.append then + mode = "a" + end + + local root = os.getenv("NUAGE_FAKE_ROOTDIR") + if not root then + root = "" + end + local filepath = root .. file.path + local f = assert(io.open(filepath, mode)) + if content then + f:write(content) + end + f:close() + if file.permissions then + -- convert from octal to decimal + local perm = tonumber(file.permissions, 8) + sys_stat.chmod(file.path, perm) + end + if file.owner then + local owner, group = string.match(file.owner, "([^:]+):([^:]+)") + unistd.chown(file.path, owner, group) + end + return true +end + local n = { warn = warnmsg, err = errmsg, @@ -456,7 +541,8 @@ local n = { install_package = install_package, update_packages = update_packages, upgrade_packages = upgrade_packages, - addsudo = addsudo + addsudo = addsudo, + addfile = addfile } return n diff --git a/libexec/nuageinit/nuageinit b/libexec/nuageinit/nuageinit index 5af1b84c1848..84133d4373c5 100755 --- a/libexec/nuageinit/nuageinit +++ b/libexec/nuageinit/nuageinit @@ -188,6 +188,25 @@ local function install_packages(packages) end end +local function write_files(files, defer) + if not files then + return + end + for n, file in pairs(files) do + local r, errstr = nuage.addfile(file, defer) + if not r then + nuage.warn("Skipping write_files entry number " .. n .. ": " .. errstr) + end + end +end + +local function write_files_not_defered(obj) + write_files(obj.write_files, false) +end + +local function write_files_defered(obj) + write_files(obj.write_files, true) +end -- Set network configuration from user_data local function network_config(obj) if obj.network == nil then return end @@ -456,13 +475,15 @@ if line == "#cloud-config" then ssh_authorized_keys, network_config, ssh_pwauth, - runcmd + runcmd, + write_files_not_defered, } local post_network_calls = { packages, users, - chpasswd + chpasswd, + write_files_defered, } f = io.open(ni_path .. "/" .. ud) diff --git a/libexec/nuageinit/nuageinit.7 b/libexec/nuageinit/nuageinit.7 index 1d2f83fe62e0..3bb440ebac95 100644 --- a/libexec/nuageinit/nuageinit.7 +++ b/libexec/nuageinit/nuageinit.7 @@ -2,7 +2,7 @@ .\" .\" Copyright (c) 2025 Baptiste Daroussin .\" -.Dd June 16, 2025 +.Dd June 26, 2025 .Dt NUAGEINIT 7 .Os .Sh NAME @@ -239,6 +239,42 @@ where x is a number, then the password is considered encrypted, otherwise the password is considered plaintext. .El .El +.It Ic write_files +An array of objects representing files to be created at first boot. +The files are being created before the installation of any packages +and the creation of the users. +The only mandatory field is: +.Ic path . +It accepts the following keys for each objects: +.Bl -tag -width "permissions" +.It Ic content +The content to be written to the file. +If this key is not existing then an empty file will be created. +.It Ic encoding +Specifiy the encoding used for content. +If not specified, then plain text is considered. +Only +.Ar b64 +and +.Ar base64 +are supported for now. +.It Ic path +The path of the file to be created. +.Pq Note intermerdiary directories will not be created . +.It Ic permissions +A string representing the permission of the file in octal. +.It Ic owner +A string representing the owner, two forms are possible: +.Ar user +or +.Ar user:group . +.It Ic append +A boolean to specify the content should be appended to the file if the file +exists. +.It Ic defer +A boolean to specify that the files should be created after the packages are +installed and the users are created. +.El .El .Sh EXAMPLES Here is an example of a YAML configuration for diff --git a/libexec/nuageinit/tests/Makefile b/libexec/nuageinit/tests/Makefile index ccb81c090445..0b813dbd98be 100644 --- a/libexec/nuageinit/tests/Makefile +++ b/libexec/nuageinit/tests/Makefile @@ -9,5 +9,6 @@ ${PACKAGE}FILES+= dirname.lua ${PACKAGE}FILES+= err.lua ${PACKAGE}FILES+= sethostname.lua ${PACKAGE}FILES+= warn.lua +${PACKAGE}FILES+= addfile.lua .include diff --git a/libexec/nuageinit/tests/addfile.lua b/libexec/nuageinit/tests/addfile.lua new file mode 100644 index 000000000000..98d020e557c0 --- /dev/null +++ b/libexec/nuageinit/tests/addfile.lua @@ -0,0 +1,71 @@ +#!/bin/libexec/flua + +local n = require("nuage") +local lfs = require("lfs") + +local f = { + content = "plop" +} + +local r, err = n.addfile(f, false) +if r or err ~= "No path provided for the file to write" then + n.err("addfile should not accept a file to write without a path") +end + +local function addfile_and_getres(file) + local r, err = n.addfile(file, false) + if not r then + n.err(err) + end + local root = os.getenv("NUAGE_FAKE_ROOTDIR") + if not root then + root = "" + end + local filepath = root .. file.path + local resf = assert(io.open(filepath, "r")) + local str = resf:read("*all") + resf:close() + return str +end + +-- simple file +f.path="/tmp/testnuage" +local str = addfile_and_getres(f) +if str ~= f.content then + n.err("Invalid file content") +end + +-- the file is overwriten +f.content = "test" + +str = addfile_and_getres(f) +if str ~= f.content then + n.err("Invalid file content, not overwritten") +end + +-- try to append now +f.content = "more" +f.append = true + +str = addfile_and_getres(f) +if str ~= "test" .. f.content then + n.err("Invalid file content, not appended") +end + +-- base64 +f.content = "YmxhCg==" +f.encoding = "base64" +f.append = false + +str = addfile_and_getres(f) +if str ~= "bla\n" then + n.err("Invalid file content, base64 decode") +end + +-- b64 +f.encoding = "b64" +str = addfile_and_getres(f) +if str ~= "bla\n" then + n.err("Invalid file content, b64 decode") + print("==>" .. str .. "<==") +end diff --git a/libexec/nuageinit/tests/nuage.sh b/libexec/nuageinit/tests/nuage.sh index 293a0a4a9a83..91260fc33a2f 100644 --- a/libexec/nuageinit/tests/nuage.sh +++ b/libexec/nuageinit/tests/nuage.sh @@ -1,5 +1,5 @@ #- -# Copyright (c) 2022 Baptiste Daroussin +# Copyright (c) 2022-2025 Baptiste Daroussin # # SPDX-License-Identifier: BSD-2-Clause # @@ -10,6 +10,7 @@ atf_test_case sethostname atf_test_case addsshkey atf_test_case adduser atf_test_case addgroup +atf_test_case addfile sethostname_body() { @@ -56,10 +57,17 @@ addgroup_body() atf_check -o inline:"impossible_groupname:*:1001:\n" grep impossible_groupname etc/group } +addfile_body() +{ + mkdir tmp + atf_check /usr/libexec/flua $(atf_get_srcdir)/addfile.lua +} + atf_init_test_cases() { atf_add_test_case sethostname atf_add_test_case addsshkey atf_add_test_case adduser atf_add_test_case addgroup + atf_add_test_case addfile } diff --git a/libexec/nuageinit/tests/nuageinit.sh b/libexec/nuageinit/tests/nuageinit.sh index 44830f67e4c8..639c87181f95 100644 --- a/libexec/nuageinit/tests/nuageinit.sh +++ b/libexec/nuageinit/tests/nuageinit.sh @@ -1,5 +1,5 @@ #- -# Copyright (c) 2022 Baptiste Daroussin +# Copyright (c) 2022-2025 Baptiste Daroussin # # SPDX-License-Identifier: BSD-2-Clause # @@ -29,6 +29,7 @@ atf_test_case config2_userdata_update_packages atf_test_case config2_userdata_upgrade_packages atf_test_case config2_userdata_shebang atf_test_case config2_userdata_fqdn_and_hostname +atf_test_case config2_userdata_write_files setup_test_adduser() { @@ -847,6 +848,39 @@ EOF fi } +config2_userdata_write_files_body() +{ + mkdir -p media/nuageinit + setup_test_adduser + printf "{}" > media/nuageinit/meta_data.json + cat > media/nuageinit/user_data < To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: 56054f0c6521 - stable/14 - nuageinit: write_files fix typo breaking 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 56054f0c6521d89d18e9f1b368e25ca0d4a1d958 Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=56054f0c6521d89d18e9f1b368e25ca0d4a1d958 commit 56054f0c6521d89d18e9f1b368e25ca0d4a1d958 Author: Baptiste Daroussin AuthorDate: 2025-06-26 12:25:12 +0000 Commit: Baptiste Daroussin CommitDate: 2025-07-08 14:31:48 +0000 nuageinit: write_files fix typo breaking tests (cherry picked from commit d9a4c24df1c438e7cd561396e57937be3b105135) --- libexec/nuageinit/nuage.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libexec/nuageinit/nuage.lua b/libexec/nuageinit/nuage.lua index 161b95c60d56..dc323a6accbf 100644 --- a/libexec/nuageinit/nuage.lua +++ b/libexec/nuageinit/nuage.lua @@ -523,11 +523,11 @@ local function addfile(file, defer) if file.permissions then -- convert from octal to decimal local perm = tonumber(file.permissions, 8) - sys_stat.chmod(file.path, perm) + sys_stat.chmod(filepath, perm) end if file.owner then local owner, group = string.match(file.owner, "([^:]+):([^:]+)") - unistd.chown(file.path, owner, group) + unistd.chown(filepath, owner, group) end return true end From nobody Tue Jul 8 14:32:28 2025 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 4bc3V45J9Fz614tr; Tue, 08 Jul 2025 14:32:28 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bc3V42zKjz49Nh; Tue, 08 Jul 2025 14:32:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751985148; 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=U+sZ04YDH6lh9znMxopxsTuLXPdkGU1U4xsQWBiwFSg=; b=e4pLkGetuGK72McB9hYlXH3eOnwRsxAsgGQ0fET30MF0s8Ci+LNBIRf0TqJUHkgLPpiweg XVox47lGc73MgVkMbTxIy1sxizpoA1nOMsC4VsB2txMYNSnmMjBbniap+SrZLtHPenUZ1w aqhTCrTfyHZbwocjJSTG/PXWofSg9EhfuIlIpL9NpSWDnIKAEZG1bX+ynJ7eA0Xr3U45Pk wqllsLTwos45ycsHugJY+gzxFZyXGGOS7E7PIE/yh59U6I7TvIn/unN81j08mSOmjyRIxN W5q34jxIz6s8yKNQLkyfJdbOWbLUmj4yWgm80aqA+lwiAA7xrHvLc/EZl2Qj9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751985148; 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=U+sZ04YDH6lh9znMxopxsTuLXPdkGU1U4xsQWBiwFSg=; b=J15UevlQqg2mu+BYmXKSeOFnOZcAdlG0lW7VwsOnDKJYst3CxMs+frz+MjbuEU6GgbNoex Xbx9NUmLKMWPWU2Sm2cbpfDtSlK17ldVkWE+Mlvo+3q5UAKwCuGOpC4E1YCx9X9RUYSJVa lU1Z5PzX1QKSjoj2PNa/3QxdMkAZ1XPjxr1AZ4Bab5ocM3mqF2Yhfhlkb6UZeG8L7v3hXV D0yXtatGnrpsgDMvVUbKeM8R4YGsraBJalaDyGO5UBD2Lx2lQ1DpDejQVoQAZjA6I/TCxi fNq9MkElYbv4X/OeNVPY7FBSeJVAihQCuo1kYCI7Yimnyqh6agLiKo14OjuzAA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751985148; a=rsa-sha256; cv=none; b=kQJPFviMvhdfSxtVcuYqZ/C/PlD4mSJ3Y7f6qB7XodJ60gp6RtD6NTIzDsWLBiSpdOUlMw pDjiGlxh5GmXMYmCZbMO1pmwCzQvV58gfXJYNIE36Ih6avFP6SKiZyh3yeQSrplfanht5N SUrzjnXCAecTfAaUZj7lVlk3sBNxXPsHvJAnkeNg3wPE7KRTxBfVwP8b/SQMkMKJgbm1Tm s4efoRsqQxCIThQnQdSa9xR7UTtOTSx8VkJx3VCfKn/ZycVKlkquGtCfRW+XYgoYcoFujb UQDAtGbfoXzt5hx/0wz3B/CAD9yIq0CCwE/+AipZa2CR9ZIXtKV/Z171ej8Cqg== 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 4bc3V42Z9szh3F; Tue, 08 Jul 2025 14:32:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 568EWSTJ073605; Tue, 8 Jul 2025 14:32:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 568EWSY8073600; Tue, 8 Jul 2025 14:32:28 GMT (envelope-from git) Date: Tue, 8 Jul 2025 14:32:28 GMT Message-Id: <202507081432.568EWSY8073600@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: 7508443b1604 - stable/14 - nuageinit: enhance sudo support 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7508443b1604bf1adae99f866770deac1bcdce29 Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=7508443b1604bf1adae99f866770deac1bcdce29 commit 7508443b1604bf1adae99f866770deac1bcdce29 Author: Baptiste Daroussin AuthorDate: 2025-06-26 12:32:27 +0000 Commit: Baptiste Daroussin CommitDate: 2025-07-08 14:31:47 +0000 nuageinit: enhance sudo support from the cloudinit specification sudo rules can be a string or an array of string (cherry picked from commit b56d2195f124d48ce54369d179aa1d4663e5e64a) --- libexec/nuageinit/nuage.lua | 8 +++++++- libexec/nuageinit/nuageinit.7 | 2 +- libexec/nuageinit/tests/nuageinit.sh | 8 +++++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/libexec/nuageinit/nuage.lua b/libexec/nuageinit/nuage.lua index cdc0fc6cf2a7..161b95c60d56 100644 --- a/libexec/nuageinit/nuage.lua +++ b/libexec/nuageinit/nuage.lua @@ -287,7 +287,13 @@ local function addsudo(pwd) warnmsg("impossible to open " .. sudoers) return end - f:write(pwd.name .. " " .. pwd.sudo .. "\n") + if type(pwd.sudo) == "string" then + f:write(pwd.name .. " " .. pwd.sudo .. "\n") + elseif type(pwd.sudo) == "table" then + for _, str in ipairs(pwd.sudo) do + f:write(pwd.name .. " " .. str .. "\n") + end + end f:close() if chmodsudoers then sys_stat.chmod(sudoers, 416) diff --git a/libexec/nuageinit/nuageinit.7 b/libexec/nuageinit/nuageinit.7 index 3bb440ebac95..327ce160e151 100644 --- a/libexec/nuageinit/nuageinit.7 +++ b/libexec/nuageinit/nuageinit.7 @@ -211,7 +211,7 @@ The list of other groups the user should belong to. .It Ic locked Boolean to determine if the user account should be locked. .It Ic sudo -An entry which should be appended to +A string or an array of strings which which should be appended to .Pa /usr/local/etc/sudoers.d/90-nuageinit-users .El .Pp diff --git a/libexec/nuageinit/tests/nuageinit.sh b/libexec/nuageinit/tests/nuageinit.sh index 639c87181f95..849f1c258b62 100644 --- a/libexec/nuageinit/tests/nuageinit.sh +++ b/libexec/nuageinit/tests/nuageinit.sh @@ -121,6 +121,10 @@ users: sudo: ALL=(ALL) NOPASSWD:ALL groups: users passwd: $6$j212wezy$7H/1LT4f9/N3wpgNunhsIqtMj62OKiS3nyNwuizouQc3u7MbYCarYeAHWYPYb2FT.lbioDm2RrkJPb9BZMN1O/ + - name: bla + sudo: + - "ALL=(ALL) NOPASSWD:/usr/sbin/pw" + - "ALL=(ALL) ALL" EOF atf_check /usr/libexec/nuageinit "${PWD}"/media/nuageinit nocloud atf_check /usr/libexec/nuageinit "${PWD}"/media/nuageinit postnet @@ -131,17 +135,19 @@ admingroup:*:1001:root,sys cloud-users:*:1002: freebsd:*:1003: foobar:*:1004: +bla:*:1005: EOF cat > expectedpasswd << 'EOF' root:*:0:0::0:0:Charlie &:/root:/bin/sh sys:*:1:0::0:0:Sys:/home/sys:/bin/sh freebsd:freebsd:1001:1003::0:0:FreeBSD User:/home/freebsd:/bin/sh foobar:$6$j212wezy$7H/1LT4f9/N3wpgNunhsIqtMj62OKiS3nyNwuizouQc3u7MbYCarYeAHWYPYb2FT.lbioDm2RrkJPb9BZMN1O/:1002:1004::0:0:Foo B. Bar:/home/foobar:/bin/sh +bla::1003:1005::0:0:bla User:/home/bla:/bin/sh EOF sed -i "" "s/freebsd:.*:1001/freebsd:freebsd:1001/" "${PWD}"/etc/master.passwd atf_check -o file:expectedpasswd cat "${PWD}"/etc/master.passwd atf_check -o file:expectedgroup cat "${PWD}"/etc/group - atf_check -o inline:"foobar ALL=(ALL) NOPASSWD:ALL\n" cat ${PWD}/usr/local/etc/sudoers.d/90-nuageinit-users + atf_check -o inline:"foobar ALL=(ALL) NOPASSWD:ALL\nbla ALL=(ALL) NOPASSWD:/usr/sbin/pw\nbla ALL=(ALL) ALL\n" cat ${PWD}/usr/local/etc/sudoers.d/90-nuageinit-users } nocloud_network_head() From nobody Tue Jul 8 14:32:27 2025 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 4bc3V35Jgsz614tq; Tue, 08 Jul 2025 14:32:27 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bc3V32SMwz49Ch; Tue, 08 Jul 2025 14:32:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751985147; 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=qeots3caiepu2G9X8cuH6rjTF/mlI3VIREcUhR4bhvk=; b=NKekZvPKTCYSQhPJuyAnb2DMD/aaWxaQsRpVPW4bUWFTbs0F5198tTUsp0UE+O1J2tdo7U Cng77WQYWN68Ube80y4TC3GC1yKYXnS1iui97kduAY2laUKFvkLNqRN7RPzsasTCw0mphu raagbpdE+cgGht43xDDIIb6gWKsNJKfzKtWuxvzshg8W6pTk06dxeAEoz9QHobgjH8Duuv w6Mu4/ZUHGEsII/sAw11P/Q5G1TysoPfZElwu8Eh6uVNUor800wbKmL1lgzbWdGnMCE53q 7lFOWw63A7HW3YawUY7zwKt4k7Xum4Wv312KKZrzXHT7IJCv+fXRbG+Juxichg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751985147; 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=qeots3caiepu2G9X8cuH6rjTF/mlI3VIREcUhR4bhvk=; b=xbTyHlZldS9o7zOuVV7pknB6tdWo4Pm/QIhkNqdiywEPP7qFlX+eHvwbyZ/5W8apv3qwqy TVD+a6r8wA8bCd91xejD+W4etpk2nINA3RIiBCshB3xGTBxxcUt2XIRr67iqc/g/wNzrnm 6HA6aRdrpbO5jD5yX8CUvWaQg6hEhqX0hM2PcQzeOCiwa39wObREsT1ntyCIQZALi8obz5 10AXN05GORH7EJuDhxY+45pP6k4RhKlaq7blBeFQETkPZpl4L3zT0yDcoO0wBUzPdRrfeW bcMtvn0DWpHD0LMxUao+HcBehg1OWzqJM26X2H6w9YHmphf1TJ2ENPJ5AL2iTw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751985147; a=rsa-sha256; cv=none; b=uQ6Y9Bgv8KMB/l621XvYQEDH7NKDM//++WloE/hEeic17zrhtw0bEwdPiqN7xh6JQ+h816 z7xiv7A8Dh42j+cDaOra/o/uYjcCRE2JC6+INBVBCIP6JDWPudW7kvIb4PYcwv58WxM6/8 Zd+PSadJMnSgCsdk7XDJARIgvFane/fXF3YEKsWC5PWuJC41NBWcB2eBIa69aZFMTRzQdR T2T79/IkpO5/dsousf5xO25W1F0OzaDeES7Nv/wLaEs9h8sbLOffeKwv5IqfcyNQuxKWbR NBKD8m5P/zag93eBu1kS72btSUqGZ/YEF2w01romwyS5M4xzH5sVKPOor//oQQ== 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 4bc3V3232gzhM5; Tue, 08 Jul 2025 14:32:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 568EWRtk073564; Tue, 8 Jul 2025 14:32:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 568EWRow073561; Tue, 8 Jul 2025 14:32:27 GMT (envelope-from git) Date: Tue, 8 Jul 2025 14:32:27 GMT Message-Id: <202507081432.568EWRow073561@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: 8800003ecf9b - stable/14 - libyaml: add missing mtree entry 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8800003ecf9bbee04fba4447645f94c2d15cb74f Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=8800003ecf9bbee04fba4447645f94c2d15cb74f commit 8800003ecf9bbee04fba4447645f94c2d15cb74f Author: Baptiste Daroussin AuthorDate: 2025-06-26 11:31:12 +0000 Commit: Baptiste Daroussin CommitDate: 2025-07-08 14:31:47 +0000 libyaml: add missing mtree entry (cherry picked from commit 442472e1b72a8b540df3fe038ed96615fc0abd68) --- etc/mtree/BSD.usr.dist | 2 ++ 1 file changed, 2 insertions(+) diff --git a/etc/mtree/BSD.usr.dist b/etc/mtree/BSD.usr.dist index 3ff04fe4e716..39e5d925a109 100644 --- a/etc/mtree/BSD.usr.dist +++ b/etc/mtree/BSD.usr.dist @@ -30,6 +30,8 @@ .. ucl .. + yaml + .. zstd .. .. From nobody Tue Jul 8 14:32:31 2025 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 4bc3V76gsPz614qq; Tue, 08 Jul 2025 14:32:31 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bc3V74mP3z49Yh; Tue, 08 Jul 2025 14:32:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751985151; 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=G1yClM9zcEjXUNpwZctwwKt3IqfqfT+QgACv0g72HCM=; b=smuF4b3V5Tmar9zQG//i4w8gM+VeO/yj10nDaDtcZUGXx6+y1NquSKnpfDIoWXfZAhE4BY KYloffBcdH8OvsuF2NEhRdcJSIdIKRaNdCk7lUYxrQ322BfmhFLIxHQh1B4StQ3+LyGpW0 1Rz6HVBCWHeuP2bKsekUu1lx6q/wohoz7w0a5ur9p0KT7oGsDsxfhjVJWY1HYd2O1wwJ5G hv/TvlY1CDUtj6yOJCAa5qnD7usmd4jODkmaO9PDhWRn433LMqarkZFE5JzFpnKhXQ+5Jo BEPEmcxDldwNsg74Syy4kGuIWaL2lJOKiaJkLm0rx5QtpAl2aW3G9kkQvH5cDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751985151; 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=G1yClM9zcEjXUNpwZctwwKt3IqfqfT+QgACv0g72HCM=; b=ErOSSR7GLcBvtowj2ZzPT7umx96PYkmvYJHIYT6biAqqPZLztcKfmHZ+VqoQkNN0J/o0Wt jypiDD80Qry15tfVkcjYacte+b+D9xOi0IPOQacDLadYeTj/Cck1NVbVZK4izsmRdn+vkj r1f9X9M/eDPMTZl03J9hUUZ2/NFr342SnIOKv7mRAMM/qUfz+Kqyr4UK2vblPoPP+pnDmC vFOghv6WTMWGq1blWqx8oCzMga4HgoB6a2YjSmVbCAsaoCA8PhYFc60MlNOZDIZYCZvduo 9cXhJX9ihWj47yYrWB2cIE5bpjkqbhIMmr/+uUhpvVV4oC7q2tUFGijFHo4jIA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751985151; a=rsa-sha256; cv=none; b=ujcjR2ac/WMGaM2tEBumDmuPSWdgoExAZqRe1/sk1R1+7qHglQXRQP0O7CHJYbbKYLNwtY hgmDIHwF8GqNfWXWuyh+AYfPLmPN7H5TFo0pCtN2siFxP28XRsxrgTMppBEONGimIZ2qTs fRY+1K8W5JhzpL+HAY2YpTjcR3Z0t4G0qKjUSCVvfE9g/HeWGkCn3k+RKzyvPhiuXAbe2P 65JAC3xMDkzsR8aXakLcpILcQz6mezoyagfcBky4mejQL0Uqx+ZhGQNOiAj8fXh9rvGe/D 8dn+mKLbMEe+yDn6TfLU853vE6jyxbp08N16vP1u7cVReRr/yDbpkBqPP2aR7A== 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 4bc3V74LSYzhM7; Tue, 08 Jul 2025 14:32:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 568EWVrv073706; Tue, 8 Jul 2025 14:32:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 568EWVGt073703; Tue, 8 Jul 2025 14:32:31 GMT (envelope-from git) Date: Tue, 8 Jul 2025 14:32:31 GMT Message-Id: <202507081432.568EWVGt073703@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: 0dabd0382cf7 - stable/14 - nuageinit: fix log name 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0dabd0382cf7bba6c94078589a65c9342b4d6479 Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=0dabd0382cf7bba6c94078589a65c9342b4d6479 commit 0dabd0382cf7bba6c94078589a65c9342b4d6479 Author: Sebastien Baylocq AuthorDate: 2025-06-27 14:27:49 +0000 Commit: Baptiste Daroussin CommitDate: 2025-07-08 14:31:48 +0000 nuageinit: fix log name (cherry picked from commit 7ad574b3e3a948113c3c16cbe90e27888dc7a423) --- libexec/rc/rc.d/nuageinit_user_data_script | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libexec/rc/rc.d/nuageinit_user_data_script b/libexec/rc/rc.d/nuageinit_user_data_script index cea7fb5c6aa0..decb6bf1483e 100755 --- a/libexec/rc/rc.d/nuageinit_user_data_script +++ b/libexec/rc/rc.d/nuageinit_user_data_script @@ -20,7 +20,7 @@ execute_user_data_script() /var/cache/nuageinit/runcmds 2>&1 | tee -a /var/log/nuageinit.log fi test -x /var/cache/nuageinit/user_data || return - echo "Executing user_data script" | tee -a /var/log/nuageinnit.log + echo "Executing user_data script" | tee -a /var/log/nuageinit.log /var/cache/nuageinit/user_data 2>&1 | tee -a /var/log/nuageinit.log } From nobody Tue Jul 8 14:32:30 2025 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 4bc3V66D8xz614rL; Tue, 08 Jul 2025 14:32: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bc3V63yzqz49GJ; Tue, 08 Jul 2025 14:32:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751985150; 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=55wTfQKAgu12505xOZpCI+gHlkMxetSXCx40ho3qoEc=; b=r9fmCZw6JuBpiwTPx+P2vXOhh+P1SG7Dvz7Vh1TiePhM0oXWX0OfsWoAHo/3h4ninkdFY8 qqyzS1speVr209fXk+H9Wro3Rkdbk003fKxIlFDIuN6GcH5quCWf8vivkK/tPzhxoEV7+9 Tt6jbNFcOMDsrwYAhXfuWuYjh4aQNgZisErwlo2ANQWK1JXWUXO1eXcUbeOcXXE4wLoLFN eJK9zANe41giLsSJdz97MoQaijWgy9J1q9Lo0C6HlB9xson9Azycp23gK3hUy94qYDnsPx 76aiMeEivufkkJH+aKKW0E1Vj4kkcmYr9hUH1ho+ClWkHlTKKxg1/OAlxIFKow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751985150; 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=55wTfQKAgu12505xOZpCI+gHlkMxetSXCx40ho3qoEc=; b=GJAEsI0ZPXO4fJzpCOKcH1Yp4YGIWCHO+IwWtjY9BD8buDoBckCJsuloL16GNlIjIWR2OS j7y1n/oSa/ZuIreLU6GPTG9QTuVKmbRvSjf3jsxQ8++znBvqVU0653Gi/QKrZomjTJD97c 3mj1psWa53AHn7Md+0Re8gJMthLD/45YrynTIkyLz/1qd2RvzxmrdcZTdTs6MpFzj9rM2h hUU+r0b1XKHmkEYZJknWs4BZQpTMzZycfE2o+F6dULQmVuokOIrmoNL7BN31gx6E81kR2f DrSMjvaK2/xRdZ+kI6TIBG2sFgHVyspKno+E6/Amvx6KXBJxc0mpHrF2kkWt8g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751985150; a=rsa-sha256; cv=none; b=haYaDTULM/fe+bVVm9OP6aAkhxaP/LQjAe0SrH6QY4XZXNsO0ndlJmLx3wl8JweaucDaqA 1eb8DZupP3qOOeNTlp3RCmbggIez0l4bpavzr/lIzWiKvF939ueyUqypBhL8Dpx9sKMuzL 2PDdV1dtWv9Mh1M/9fFrF04eKCApEwFqi04qYVgulLoAbSJG73qSMrWy/kkPZodGPsMyQq 5B5hSm8S1leN1B6G+4uFcNFr9+tIBBUms123nDxjt76C5Rny69BHNxMRtAkib6f2ROj4RX 7cHUsk1ac88dO9QCSPT0stw7aPFIURAeOREMCCmf1JJ5SYMrs+k380+kgB09Bw== 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 4bc3V63XnHzhM6; Tue, 08 Jul 2025 14:32:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 568EWUc5073672; Tue, 8 Jul 2025 14:32:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 568EWUES073669; Tue, 8 Jul 2025 14:32:30 GMT (envelope-from git) Date: Tue, 8 Jul 2025 14:32:30 GMT Message-Id: <202507081432.568EWUES073669@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: 7151c780ac95 - stable/14 - nuageinit: fix setting owner when only the user is set 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7151c780ac95f90cc5f601eb06849f32e073d5b7 Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=7151c780ac95f90cc5f601eb06849f32e073d5b7 commit 7151c780ac95f90cc5f601eb06849f32e073d5b7 Author: Baptiste Daroussin AuthorDate: 2025-06-26 12:29:05 +0000 Commit: Baptiste Daroussin CommitDate: 2025-07-08 14:31:48 +0000 nuageinit: fix setting owner when only the user is set (cherry picked from commit 3969965c7f156f0fe3e1dc8799362375cb53208a) --- libexec/nuageinit/nuage.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libexec/nuageinit/nuage.lua b/libexec/nuageinit/nuage.lua index dc323a6accbf..11958e8b5cc2 100644 --- a/libexec/nuageinit/nuage.lua +++ b/libexec/nuageinit/nuage.lua @@ -527,6 +527,9 @@ local function addfile(file, defer) end if file.owner then local owner, group = string.match(file.owner, "([^:]+):([^:]+)") + if not owner then + owner = file.owner + end unistd.chown(filepath, owner, group) end return true From nobody Tue Jul 8 15:12:40 2025 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 4bc4NS6nskz6175L; Tue, 08 Jul 2025 15:12:40 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bc4NS54r1z3JTw; Tue, 08 Jul 2025 15:12:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751987560; 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=Vu/IZjMMnpzDYYMqaAHjuV6erZj/FIILVmMjHRYMSoM=; b=qYrUA5lpJljEqmkz1O95cxlodvwKoT7b63ORkxAAcH2InXWAaQfIlAuftzyTX7VQZAD+2B XCzgP58ShaR8GR3vY/HQZEdUFbnfOojmntd5I4BpO8hPhr75lykKckE+x5uo/e5k7obC2t sMHiwHaDOeDRnP3cdjJByd0w2Dx/FJfd+lRqFvLkXJeVlsn4Erv7hGaX+EFZ2O6vyiW0ju 0wbKGoQsuXuank8opqLSCCYcNBkQPX51ureWrtmo3zlzR+J0wvQ3eaZ6RFhbztAY2cCjsR rw5b0FE7Yn6MAlUaX7dc6d3gR8I6t8V4vPokl/fKpK3KOw6IT4ErMdmJDTe+hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751987560; 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=Vu/IZjMMnpzDYYMqaAHjuV6erZj/FIILVmMjHRYMSoM=; b=WLLztq2hehoSem8Os9WSBgqKsWbuJg7GyLJJecNf2f8WsQy3PFeF0XPoCNTFG3Wqsi2kvq DAMH6H7x5yNxPJzBJ/1jyqgly1JxrgHwAoyOtov68ZkV7Vec0OdgWCUIWnDE+1T9u67lkW G5QgukiWXaQ/qD+VX9KgdYFAoMasu78aRWhLfLlL8hEZ0G9OWR6W1NnK+NN1NBkZk1ElR5 SqZ5hiVDwOkZghMv4aM1o+Bia4BUhW/TsEJg4Ono4S6EpPEyZpxXgJpeLACBmKyT9XrAZw WA9aSzfqsTbZ6x1g5XfHd4gDpD1br2zVVYCE0qPxKaCpnZaCvz84sPQTom2erg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751987560; a=rsa-sha256; cv=none; b=cz5z6a6DTB5HQ3F2oXBFIrw3hVZNJxxbg/tOPLuZlCmOcqSpH8hNZ/09+AYqWJhAtNJaV3 umAfdf7ie8m+KVtaAJtaT6dEaIdXRfhHHjCLyW3XSsNI4PVdCmMAforxvFc6NTu5QYlEDO PeJ07OJocPAjn0ES9CwqMCkW+OTx5fcNZ94zGpxntw9OUWQPsav+thNfaWuMo1rclnHDUZ go3o/EgSdexkanLV9YO+3Ki+WbxhNkm8Op9iapKhzxl+BbQOY7LGS77ChksqiF4MsPE+eq TjqefESFDs6QW3SKnxPuvmH09WAnncXGswFUvi9LpWwb7jizHwWDVb1A7onjAg== 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 4bc4NS4Vrtzj8k; Tue, 08 Jul 2025 15:12:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 568FCe6g049410; Tue, 8 Jul 2025 15:12:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 568FCeX8049407; Tue, 8 Jul 2025 15:12:40 GMT (envelope-from git) Date: Tue, 8 Jul 2025 15:12:40 GMT Message-Id: <202507081512.568FCeX8049407@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: ShengYi Hung Subject: git: f84a0da4e060 - main - libusb: rename bNumDeviceCapabilities to bNumDeviceCaps for compatibility with libusb 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: aokblast X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f84a0da4e0608a970c775f3d605f8de2b0b8d322 Auto-Submitted: auto-generated The branch main has been updated by aokblast: URL: https://cgit.FreeBSD.org/src/commit/?id=f84a0da4e0608a970c775f3d605f8de2b0b8d322 commit f84a0da4e0608a970c775f3d605f8de2b0b8d322 Author: ShengYi Hung AuthorDate: 2025-06-07 19:43:15 +0000 Commit: ShengYi Hung CommitDate: 2025-07-08 15:11:41 +0000 libusb: rename bNumDeviceCapabilities to bNumDeviceCaps for compatibility with libusb THe member bNumDeviceCapabilities is referred to as bNumDeviceCaps in the upstream libusb project. To improve compatibility, we are renaming the member accordingly. For backward compatibility, a mocro will be defined to map bNumDeviceCapabilities to bNumDeviceCaps. See: https://github.com/libusb/libusb/commit/02ebafc85d3f219842cbabaf78abc8100b6656e5 Reviewed by: kevans Approved by: markj (mentor) MFC after: 2 weeks Sponsored by: FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D50740 --- lib/libusb/libusb.h | 5 ++++- lib/libusb/libusb10_desc.c | 11 ++++++----- lib/libusb/libusb20_desc.h | 6 +++++- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/lib/libusb/libusb.h b/lib/libusb/libusb.h index 0aad29aa4ecc..491af3d0a5ec 100644 --- a/lib/libusb/libusb.h +++ b/lib/libusb/libusb.h @@ -418,7 +418,10 @@ typedef struct libusb_bos_descriptor { uint8_t bLength; uint8_t bDescriptorType; uint16_t wTotalLength; - uint8_t bNumDeviceCapabilities; +#ifndef bNumDeviceCapabilities +#define bNumDeviceCapabilities bNumDeviceCaps +#endif + uint8_t bNumDeviceCaps; struct libusb_usb_2_0_device_capability_descriptor *usb_2_0_ext_cap; struct libusb_ss_usb_device_capability_descriptor *ss_usb_cap; struct libusb_bos_dev_capability_descriptor **dev_capability; diff --git a/lib/libusb/libusb10_desc.c b/lib/libusb/libusb10_desc.c index 3e36009cbb3a..5f4c46740688 100644 --- a/lib/libusb/libusb10_desc.c +++ b/lib/libusb/libusb10_desc.c @@ -470,10 +470,11 @@ libusb_parse_bos_descriptor(const void *buf, int len, ptr->bDescriptorType = dtype; ptr->wTotalLength = ((const uint8_t *)buf)[2] | (((const uint8_t *)buf)[3] << 8); - ptr->bNumDeviceCapabilities = ((const uint8_t *)buf)[4]; + ptr->bNumDeviceCaps = ((const uint8_t *)buf)[4]; ptr->usb_2_0_ext_cap = NULL; ptr->ss_usb_cap = NULL; - ptr->dev_capability = calloc(ptr->bNumDeviceCapabilities, sizeof(void *)); + ptr->dev_capability = calloc(ptr->bNumDeviceCaps, + sizeof(void *)); if (ptr->dev_capability == NULL) { free(ptr); return (LIBUSB_ERROR_NO_MEM); @@ -485,7 +486,7 @@ libusb_parse_bos_descriptor(const void *buf, int len, if (dlen >= 3 && ptr != NULL && dtype == LIBUSB_DT_DEVICE_CAPABILITY) { - if (index != ptr->bNumDeviceCapabilities) { + if (index != ptr->bNumDeviceCaps) { ptr->dev_capability[index] = malloc(dlen); if (ptr->dev_capability[index] == NULL) { libusb_free_bos_descriptor(ptr); @@ -542,7 +543,7 @@ libusb_parse_bos_descriptor(const void *buf, int len, } if (ptr != NULL) { - ptr->bNumDeviceCapabilities = index; + ptr->bNumDeviceCaps = index; return (0); /* success */ } @@ -557,7 +558,7 @@ libusb_free_bos_descriptor(struct libusb_bos_descriptor *bos) if (bos == NULL) return; - for (i = 0; i != bos->bNumDeviceCapabilities; i++) + for (i = 0; i != bos->bNumDeviceCaps; i++) free(bos->dev_capability[i]); free(bos->dev_capability); free(bos); diff --git a/lib/libusb/libusb20_desc.h b/lib/libusb/libusb20_desc.h index 017148a34b1c..0f7c9294ebc8 100644 --- a/lib/libusb/libusb20_desc.h +++ b/lib/libusb/libusb20_desc.h @@ -298,11 +298,15 @@ LIBUSB20_MAKE_STRUCT(LIBUSB20_USB_20_DEVCAP_DESC); LIBUSB20_MAKE_STRUCT(LIBUSB20_SS_USB_DEVCAP_DESC); +#ifndef bNumDeviceCapabilities +#define bNumDeviceCapabilities bNumDeviceCaps +#endif + #define LIBUSB20_BOS_DESCRIPTOR(m,n) \ m(n, UINT8_T, bLength, ) \ m(n, UINT8_T, bDescriptorType, ) \ m(n, UINT16_T, wTotalLength, ) \ - m(n, UINT8_T, bNumDeviceCapabilities, ) \ + m(n, UINT8_T, bNumDeviceCaps, ) \ LIBUSB20_MAKE_STRUCT(LIBUSB20_BOS_DESCRIPTOR); From nobody Tue Jul 8 15:20:42 2025 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 4bc4Yp5D1wz617fh; Tue, 08 Jul 2025 15:20:46 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta004.cacentral1.a.cloudfilter.net (omta002.cacentral1.a.cloudfilter.net [3.97.99.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bc4Yp01gzz3LnM; Tue, 08 Jul 2025 15:20:45 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; none Received: from shw-obgw-4003a.ext.cloudfilter.net ([10.228.9.183]) by cmsmtp with ESMTPS id Z585uhXCu5MqyZA7huhMSn; Tue, 08 Jul 2025 15:20:45 +0000 Received: from spqr.komquats.com ([70.66.136.217]) by cmsmtp with ESMTPSA id ZA7fulQOXWbOaZA7gu0CHg; Tue, 08 Jul 2025 15:20:45 +0000 X-Auth-User: cschuber X-Authority-Analysis: v=2.4 cv=Q5lx4J2a c=1 sm=1 tr=0 ts=686d374d a=h7br+8Ma+Xn9xscxy5znUg==:117 a=h7br+8Ma+Xn9xscxy5znUg==:17 a=IkcTkHD0fZMA:10 a=Wb1JkmetP80A:10 a=6I5d2MoRAAAA:8 a=EkcXrb_YAAAA:8 a=S-1b6JwnAAAA:8 a=YxBL1-UpAAAA:8 a=x7Y1GQRRBOaA60SGN5cA:9 a=QEXdDO2ut3YA:10 a=LK5xJRSDVpKd5WXXoEvA:22 a=jHPkhvgQCurpnRnmkKlz:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id C445E97; Tue, 08 Jul 2025 08:20:42 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (Postfix) with ESMTP id B0B86302; Tue, 08 Jul 2025 08:20:42 -0700 (PDT) Date: Tue, 8 Jul 2025 08:20:42 -0700 From: Cy Schubert To: Dima Panov Cc: "Herbert J. Skuhra" , Cy Schubert , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 7e35117eb07f - main - Makefile: Hook MIT KRB5 into the build Message-ID: <20250708082036.039eb96f@slippy> In-Reply-To: <68ffaac2-d1b1-4889-b93b-53513cbea5a8@FreeBSD.org> References: <202506160251.55G2pwx4063231@gitrepo.freebsd.org> <20250620073050.7f03f74e@slippy> <20250707230446.F279E3A1@slippy.cwsent.com> <20250708042825.669BF20E@slippy.cwsent.com> <68ffaac2-d1b1-4889-b93b-53513cbea5a8@FreeBSD.org> Organization: KOMQUATS X-Mailer: Claws Mail 3.21.0 (GTK+ 2.24.33; amd64-portbld-freebsd15.0) 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-CMAE-Envelope: MS4xfL24ZvSFkXm2w0E3+QIE9lBbf6RpSHIkbFfTcNDbTH07NiIvTRVqbSox2KW+cK0me+s78XhSyeque+2f4gSKn+34p1Z1z9DZf3Hiat1edGlc/vw579xX 3FAdn4k5m/9GDvwasuQeEqP0z6mdAB5Mx4ROb0guSzGIUBplea+sPNAwQLB0QccodefNwIebYtS4ckpPMyZW8qXTCMU7+DbQJMruOSpuim92LIRL8ROSF+2M iGx8w/XzNzbBm4N1SPgIwirUYvT0gaT0ZJNwW4KKQUtahW24wDkQDYkq8LINRXVyaJcEn2lkAlTI2MaRiFR08GAdDHcHVsJZcx1quq2uXYrbBPuelmphS1HB XmVhS4Mqzg5CFARvJe/owjpN8u2DRA== X-Rspamd-Queue-Id: 4bc4Yp01gzz3LnM X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:16509, ipnet:3.96.0.0/15, country:US] On Tue, 8 Jul 2025 16:07:25 +0300 Dima Panov wrote: > On 08.07.2025 14:09, Dima Panov wrote: > > Hello! > >=20 > > On 08.07.2025 07:28, Cy Schubert wrote: =20 > >> In message , "Herbert J. Skuhra" wr= ites: =20 > >>> On Mon, Jul 07, 2025 at 04:04:46PM -0700, Cy Schubert wrote: =20 > >>>> In message , "Herbert J. Skuhra" = writes: =20 > >>>>> On Mon, Jul 07, 2025 at 10:36:31PM +0300, Dima Panov wrote: =20 > >>>>>> Hello! > >>>>>> > >>>>>> > >>>>>> BTW, it looks like symlink for libkadm5clnt.so is broken and produ= ced a =20 > >>> =C2=A0 bad =20 > >>>>> =C2=A0 file =20 > >>>>>> $ ls -la libkadm5clnt > >>>>>> lrwxr-xr-x=C2=A0 1 root wheel 13=C2=A0 7 Jul 20:40 libkadm5clnt ->= kadm5clnt_mit > >>>>>> > >>>>>> instead of assumed libkadm5clnt.so -> kadm5clnt_mit.so > >>>>>> > >>>>>> > >>>>>> Please review: > >>>>>> > >>>>>> diff --git a/krb5/lib/kadm5clnt/Makefile b/krb5/lib/kadm5clnt/Make= file > >>>>>> index e377f95f5b6e..be09dd3e210e 100644 > >>>>>> --- a/krb5/lib/kadm5clnt/Makefile > >>>>>> +++ b/krb5/lib/kadm5clnt/Makefile > >>>>>> @@ -88,7 +88,7 @@ ${CHPASS_UTIL_STRINGS_ERR_C}: ${CHPASS_UTIL_STRI= NGS_E =20 > >>> RR} =20 > >>>>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 rm -f et-c-${.PRE= FIX}.et et-c-${.PREFIX}.c > >>>>>> > >>>>>> =C2=A0 afterinstall: > >>>>>> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ${INSTALL_LIBSYMLINK} ${SHLI= B} ${DESTDIR}${LIBDIR}/libkadm5clnt > >>>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ${INSTALL_LIBSYMLINK} ${SHLI= B_NAME} ${DESTDIR}${LIBDIR}/libkadm =20 > >>> 5cln =20 > >>>>> t.so =20 > >>>>>> > >>>>>> =C2=A0 .include =20 > >>>>> > >>>>> This produces a valid symlink that 'make delete-old' wants to > >>>>> remove again: > >>>>> > >>>>> lrwxr-xr-x=C2=A0 1 root wheel=C2=A0=C2=A0=C2=A0=C2=A0 23 Jul=C2=A0 = 7 22:26 /usr/lib/libkadm5clnt.so -> > >>>>> libkadm5clnt_mit.so.121 > >>>>> > >>>>> # make delete-old =20 > >>>>>>>> Removing old files (only deletes safe to delete libs) =20 > >>>>> remove /usr/lib/libkadm5clnt.so? =20 > >>>> > >>>> Thanks Dima and Herbert for reporting this. It's been fixed. =20 > >>> > >>> Cy, I am sorry for not being more precise. > >>> > >>> Dima's change, which hasn't been commited yet, fixes the real issue of > >>> creating a bad symlink. > >>> > >>> I just wanted to add that his fix also needs removal of > >>> usr/lib/libkadm5clnt.so in tools/build/mk/OptionalObsoleteFiles.inc. > >>> > >>> Maybe usr/lib/libkadm5clnt should be added to OptionalObsoleteFiles.i= nc? =20 > >> > >> libkadm5clnt.so is a legitimate symlink for both MIT and Heimdal. In t= he > >> case of Heimdal it points to libkadm5clnt.so.11. Whereas for MIT it po= ints > >> to libkadm5clnt_mit.so.121. There is o libkadm5clnt in MIT. It is > >> libkadm5clnt_mit. You can see this in the port with pkg info -l as fol= lows: > >> > >> slippy$ pkg info -l krb5 | grep libkadm5clnt > >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /usr/local/lib/libkad= m5clnt.so > >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /usr/local/lib/libkad= m5clnt_mit.so > >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /usr/local/lib/libkad= m5clnt_mit.so.12 > >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /usr/local/lib/libkad= m5clnt_mit.so.12.0 > >> slippy$ > >> =20 > >=20 > > Cy, it looks you still have something staled at your machine :( > >=20 > > On a clean build for pkgbase in poudriere without my patch it still pro= duces a bad symlink and no compat is packaged as result > >=20 > > root@aarch64:~ # pkg info -l -x krb5 | grep libkadm5clnt > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /usr/lib/libkadm5clnt_mit.s= o.121 > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /usr/lib/debug/usr/lib/libk= adm5clnt_mit.so.121.debug > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /usr/lib/debug/usr/lib32/li= bkadm5clnt_mit.so.121.debug > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /usr/lib/libkadm5clnt_mit.a > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /usr/lib/libkadm5clnt_mit.so > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /usr/lib32/libkadm5clnt_mit= .a > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /usr/lib32/libkadm5clnt_mit= .so > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /usr/lib32/libkadm5clnt_mit= .so.121 > >=20 > > =20 >=20 > ${SHLIB} macro gives a wrong name, check it: >=20 > $ make -V SHLIB > kadm5clnt_mit > $ make -V SHLIB_LINK > libkadm5clnt_mit.so > $ pwd > /home/fluffy/repo/FreeBSD/FreeBSD-src/krb5/lib/kadm5clnt >=20 >=20 > So we still need to patch it :) >=20 > diff --git a/krb5/lib/kadm5clnt/Makefile b/krb5/lib/kadm5clnt/Makefile > index e377f95f5b6e..ddb9b0e9fec5 100644 > --- a/krb5/lib/kadm5clnt/Makefile > +++ b/krb5/lib/kadm5clnt/Makefile > @@ -88,7 +88,7 @@ ${CHPASS_UTIL_STRINGS_ERR_C}: ${CHPASS_UTIL_STRINGS_ERR} > rm -f et-c-${.PREFIX}.et et-c-${.PREFIX}.c >=20 > afterinstall: > - ${INSTALL_LIBSYMLINK} ${SHLIB} ${DESTDIR}${LIBDIR}/libkadm5clnt > + ${INSTALL_LIBSYMLINK} ${SHLIB_LINK} ${DESTDIR}${LIBDIR}/libkadm5c= lnt.so >=20 > .include Thanks for the patch. I've pushed this with an ObsoleteFiles.inc change to fix the brokenness. Thanks for pointing this out. --=20 Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e**(i*pi)+1=3D0 From nobody Tue Jul 8 15:44:06 2025 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 4bc54l1q5Jz619CL; Tue, 08 Jul 2025 15:44:07 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bc54k6tBsz3XQS; Tue, 08 Jul 2025 15:44:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751989447; 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=t6IBlw3fcVEurwcHvaG+8xKqjlb/ePpuJuJPIFCh5G4=; b=GVqw9knXE+BY1IfEODMfV5tUwh2WRN89L2ndqzfoQt+EOyUUNBd6SexIeMv8tQy3QRFrk8 wZRCsM3bkYfyv40xd6yywOc8v0HqmrymiSXOhSgdpoU9NC+h3hHPg1n1RbUNdVHA2QdmUe qyrYxw6Imyr54cXXYW/0yjThQDMapMsVaBOSOHvlakHRuR+zRNxQOQEhNmDpnE9Cjj6ItF Ed0v04BxF3kECJF39tbKIcGkaSdkRULXvhDgpb0s3SHYQp4JuSZkwPgt+liJQ1pDzITphp g5NeUjs7guy7/tVWCw24aHs45TlcJE531NYeTTnUZsavEvBgaLDOW6TovvLltg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751989447; 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=t6IBlw3fcVEurwcHvaG+8xKqjlb/ePpuJuJPIFCh5G4=; b=IgW6YEtyqYLlEuW1QRPW0+UJCAsJj4nnnBb8pT3K3nDvxqz9rIoZGGgTVwt6USmnHU4ioK fVOPW8/JYda2b9l8olS5xNCcSfc7oGCnBGfyZpZ+qq/tQ1tx/G5ySInMKQZrR+Ig4juH24 6jdMozxNf1UD8UUYgwLwqCu0N6hIuK1ekBqt+58RyzkDfdx65FvcxCpVI+XinAJ2/fn0Ih 38rsMNpurqifj/WgcWnNngj67/borfFQdmfW6KVfi9nafqOt5P4ON/c+DuO4ybQn1a2hnG 35T8glHHp22jJ51+PK95uI/pNUkC1SQjb4J0toj+nvz4+q7OHIRQ6LMYgrXzhg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751989447; a=rsa-sha256; cv=none; b=GZuCJATlSqdbVLIcAxrfcHy4OP0FKyRdPFKU3VdKp4pIHzZS6b1IXHZ0tLcbpCNVzXXuhT x2R16ZCRRSiPt1tyRa8y+gUW01J6t2r54X+wJPuv49vCiX86nGi4cSwUkbpEEpXkPqi6xn yt9+5XBmlpE/5FGupwz0qBr2kuqcM2gpxHpWRdeEOP3PG352B2nbSHRPP+6CXrwX7i3u6C Bw6+wCGzDWs8gchCV5Ir80JV9gRJ1EwzQMmX4jIbabnohDnI+wytbHXQdIaYwGLD8hzkgw xx690WlOhbc/n63bjmQcsS1mISQFcQjBDSBGFxkdbwJfENbwGKeo8Jto32gw1Q== 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 4bc54k6Rsqzk63; Tue, 08 Jul 2025 15:44:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 568Fi68a005532; Tue, 8 Jul 2025 15:44:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 568Fi6uN005529; Tue, 8 Jul 2025 15:44:06 GMT (envelope-from git) Date: Tue, 8 Jul 2025 15:44:06 GMT Message-Id: <202507081544.568Fi6uN005529@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: 9911028f53d5 - main - libc: mkostemp(3) should support O_CLOFORK 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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/main X-Git-Reftype: branch X-Git-Commit: 9911028f53d5c7504256289d3e56f6592a5a1247 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=9911028f53d5c7504256289d3e56f6592a5a1247 commit 9911028f53d5c7504256289d3e56f6592a5a1247 Author: Ricardo Branco AuthorDate: 2025-07-07 16:05:01 +0000 Commit: Mark Johnston CommitDate: 2025-07-08 15:43:39 +0000 libc: mkostemp(3) should support O_CLOFORK Reviewed by: kib, markj MFC after: 1 month Pull Request: https://github.com/freebsd/freebsd-src/pull/1758 --- lib/libc/stdio/mktemp.3 | 7 ++++--- lib/libc/stdio/mktemp.c | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/libc/stdio/mktemp.3 b/lib/libc/stdio/mktemp.3 index 2b8b2d6c9e44..8d38dd2cd57e 100644 --- a/lib/libc/stdio/mktemp.3 +++ b/lib/libc/stdio/mktemp.3 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd July 29, 2019 +.Dd July 07, 2025 .Dt MKTEMP 3 .Os .Sh NAME @@ -101,9 +101,10 @@ The permitted flags are .Dv O_DIRECT , .Dv O_SHLOCK , .Dv O_EXLOCK , -.Dv O_SYNC +.Dv O_SYNC , +.Dv O_CLOEXEC and -.Dv O_CLOEXEC . +.Dv O_CLOFORK . .Pp The .Fn mkstemps diff --git a/lib/libc/stdio/mktemp.c b/lib/libc/stdio/mktemp.c index 8aff226acf14..a2f80ee7b0dd 100644 --- a/lib/libc/stdio/mktemp.c +++ b/lib/libc/stdio/mktemp.c @@ -121,7 +121,7 @@ _gettemp(int dfd, char *path, int *doopen, int domkdir, int slen, int oflags) if ((doopen != NULL && domkdir) || slen < 0 || (oflags & ~(O_APPEND | O_DIRECT | O_SHLOCK | O_EXLOCK | O_SYNC | - O_CLOEXEC)) != 0) { + O_CLOEXEC | O_CLOFORK)) != 0) { errno = EINVAL; return (0); } From nobody Tue Jul 8 15:55:58 2025 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 4bc5LR2kmWz619Xk; Tue, 08 Jul 2025 15:55:59 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bc5LR20RHz3bZ2; Tue, 08 Jul 2025 15:55:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751990159; 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=SRxIU92VwywbsA12F4xYbWhk1UWp37GcCpLwPSlGIQI=; b=HW8Cnyz31SIyaBp4hnsKPWKdvbK7gTtQBCOX5iDieZzim8/Ai93iVciZ6E6Ohwj6ZeddJF JtDjgvEcpsRp6SMF0TM+ED+u86rPprPQbaUAZLBJ0X8iHeYT0e04D4DgHGU3VNRLrd0WbM jSL5AwM/o1N2BP4TMmDmdfGbQhxgrNJYMa9wHz0WLstBJ4wk1yefPhAGpvTaT6an84Aypq BGSbFUZTX/IIYFaMi2XddobKc3VhS83NOMxm0maFVCDDXBabuKOIWH3BrsZz4Z9hKJEMgw W2R/AXy702leFNxYxga1pqqEc+42WPFazhbxI0/XK/HiY1CGHoxC4VCUJOEqMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751990159; 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=SRxIU92VwywbsA12F4xYbWhk1UWp37GcCpLwPSlGIQI=; b=SisehNfWtZCDHSs49LqZZoqrjTooFOSnc7tXPwBPFWEJaftTG8oYBUnzRyNMcbV15BcsxY hU/gjILoa0Rl2UcMbxXv8r3bNCPMPH26E1ffnS9DEhmhDo5QsxBeeSRpUnShH+2EIdR7kh 1xt1+bXf8AafDhBXLfJCOlTl7Dra5GU0061QqI0k7lIC4f5mKnVEAmQhl68v2PyDIWk03V dDLeTcxN8rU+NnkUbK2XSU35agQdxWyGBwZ/1QRUXhv7yksu98gT0cbnFc4FjWsSSsCRcN 6nQKVlWFUJXdq9qD42ewarohwSblubLqMxZh++og5B3wOMRlInAr34am/yPQuA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751990159; a=rsa-sha256; cv=none; b=aXuGB3DpaZvfq79MUBrnGRL0uWSLhCA12E9EtHvGSEsFRogmJdwztudnpMNoIcmwGS1oX/ ZObUovWian1LVLm91IBizbv0qb3EdKbMWpDPAstMAXgKKJ3RGYhVvNe9iWuAHZDYDrBjF2 bsaf4DFOvMjhP1GJGY4iqrbP4mlGRF4ms9iQUDQxb3NdhjrKgGTDiBgrTatsRkMjnnuP7p eucTyv6yDza2hSEI4NWMWhXLcD/N2Sc8Av+0bOjDGsyY8hr5gKGiV0b1TuV2TEL9B+YXqu O2rJ6oiUenBIVANbRvz1L6cmHQjrJXVEJeHDot0QwuGNINtLxy5Wymnl9aaCdg== 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 4bc5LR1Jmpzjpg; Tue, 08 Jul 2025 15:55:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 568FtwHa024691; Tue, 8 Jul 2025 15:55:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 568FtwIH024688; Tue, 8 Jul 2025 15:55:58 GMT (envelope-from git) Date: Tue, 8 Jul 2025 15:55:58 GMT Message-Id: <202507081555.568FtwIH024688@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 72c848089f3b - main - libc: only append exterr herald and text if exterr was recorded 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 72c848089f3b03ee31208ca18f652a16d8fb8352 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=72c848089f3b03ee31208ca18f652a16d8fb8352 commit 72c848089f3b03ee31208ca18f652a16d8fb8352 Author: Konstantin Belousov AuthorDate: 2025-07-08 14:01:32 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-08 15:55:54 +0000 libc: only append exterr herald and text if exterr was recorded __uexterr_format: return empty string on no error, instead of "No error" err(): check for the first symbol of the exterr to decide if there is anything to print. Requested and reviewed by: markj Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D51204 --- lib/libc/gen/err.c | 2 +- lib/libc/gen/uexterr_format.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libc/gen/err.c b/lib/libc/gen/err.c index cdce20af5a91..16cbe27693e7 100644 --- a/lib/libc/gen/err.c +++ b/lib/libc/gen/err.c @@ -119,7 +119,7 @@ vexterr(bool doexterr, int code, const char *fmt, va_list ap) fprintf(err_file, ": "); } fprintf(err_file, "%s", strerror(code)); - if (doexterr && extstatus == 0) + if (doexterr && extstatus == 0 && exterr[0] != '\0') fprintf(err_file, " (extended error %s)", exterr); fprintf(err_file, "\n"); } diff --git a/lib/libc/gen/uexterr_format.c b/lib/libc/gen/uexterr_format.c index 86ba40234ae4..e8ddfbd578e3 100644 --- a/lib/libc/gen/uexterr_format.c +++ b/lib/libc/gen/uexterr_format.c @@ -20,7 +20,7 @@ __uexterr_format(const struct uexterror *ue, char *buf, size_t bufsz) if (bufsz > UEXTERROR_MAXLEN) bufsz = UEXTERROR_MAXLEN; if (ue->error == 0) { - strlcpy(buf, "No error", bufsz); + strlcpy(buf, "", bufsz); return (0); } if (ue->msg[0] == '\0') { From nobody Tue Jul 8 19:09:32 2025 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 4bc9dn4k8qz61NXh; Tue, 08 Jul 2025 19:09:33 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bc9dn3Wwtz40Pm; Tue, 08 Jul 2025 19:09:33 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752001773; 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: in-reply-to:in-reply-to:references:references; bh=15XHbGCgodpIKypuAMBaBj13ZRLmWPNL2wkTPxBEr08=; b=F3Wv1JiF5pId0TdjHHqsmLkZoMhvwUsUrVMjSU/Y3TUbQEG56bTTRIvZGO1bKRJlxhyycW TwxnG6ohUwokVEvuKL9UGKikLNdTWwVvMHviYbuYmsH8uj6/z8mXfM6n4wegj3Qqk1yLin RQpNHfgkxAlhSLJxGDF0DQ7jywefVGJxkVCy3POdBfT8jNyjjkDv3gyUbLMC3kvUsfvCsO SSP2g/uK05ZISuG/LvEZ/g+Ziz+wnYRaEl+5l7+28TsyRsYZ8TxFlfGpKakPAmRPmhP8D+ wlTuybYtcTy4uhXGWaBGRgNODK6jg0mCkjqNnQ3oS9LR1NJbRQZizwe3lpv0JQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752001773; 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: in-reply-to:in-reply-to:references:references; bh=15XHbGCgodpIKypuAMBaBj13ZRLmWPNL2wkTPxBEr08=; b=mSfVWf+rHDBuGJjc79Bdf5N16namVndqfGKdgAPbiZP0LVUHu3MZ7gsvhPBYjTMoL2HX4T iuAsbvhKODHl5+gVOGEVX/gTGlk7Nu4r36sPlwkQccKJFx5N8naHMm4N8I1IfyGWsMOkcS pfE/E0cEfY5vEYM1SUX7t3U4dumVeJMO8McOzC9yZKYeZS+ttWC6uuh+/QcSCtWsC0F1mc IOnT1Ms/En4daz0m3WelfDsDgNyutSnNP+w2oXTP8mz0lU2D95ItiSbJAHT7DIiyWlbczg HkpXHMvFvPQQy5eZjUQB5SrJbsLyMrpdP2jiYImZ24M+8o2MMV6qRhujMC3fEg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752001773; a=rsa-sha256; cv=none; b=YM9nrQVIaYLyvzgLp9Y8AxetjP7GOPkZDd7r4R3Zzh9w6kp99YMd2LMjgnN9jXrycitywS iA3B/v4DZbClR+oRK5QmTc0/5gSCITlc902Bh49bb7dZBgjVdU09P8gbsmMM9CooEunZTK 9NoBfyKOe+ZAxv7tH8OGU+/Uli4pYxuPSGB6Vh3d3fuL/Ef11eSUK5FwA/Z8OkGyJHxAqu /ejDvXf1TztdmuQIJKGpybStL7Z1Zdx4JH1kECKrmMV+XWOXVnC2tWmpH0t9xAAjCIM1r7 euDxiGfxYCH3EVt3paINtcKMsTCI8JHjIopuNyt96WT3XztN6XRTBJyO3trVZg== Received: from [IPV6:2601:5c0:4200:b830:7819:6f52:6cbb:eb54] (unknown [IPv6:2601:5c0:4200:b830:7819:6f52:6cbb:eb54]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bc9dn1PhZzqQg; Tue, 08 Jul 2025 19:09:33 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: Date: Tue, 8 Jul 2025 15:09:32 -0400 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: 01a679715f68 - main - err(3): print extended error if available Content-Language: en-US To: Konstantin Belousov , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202507071928.567JSk8Y012639@gitrepo.freebsd.org> From: John Baldwin In-Reply-To: <202507071928.567JSk8Y012639@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 7/7/25 15:28, Konstantin Belousov wrote: > The branch main has been updated by kib: > > URL: https://cgit.FreeBSD.org/src/commit/?id=01a679715f68d5e32efecafc1f158eecec3f781b > > commit 01a679715f68d5e32efecafc1f158eecec3f781b > Author: Konstantin Belousov > AuthorDate: 2025-06-16 21:26:22 +0000 > Commit: Konstantin Belousov > CommitDate: 2025-07-07 18:44:22 +0000 > > err(3): print extended error if available > > Reviewed by: asomers, brooks > Sponsored by: The FreeBSD Foundation > Differential revision: https://reviews.freebsd.org/D51141 It looks like this broke cross-building as all of the GitHub cross-build actions are failing now after this commit, e.g.: https://github.com/freebsd/freebsd-src/actions/runs/16126095376/job/45503237749 /home/runner/work/freebsd-src/freebsd-src/lib/libc//gen/err.c:33:10: fatal error: sys/exterrvar.h: No such file or directory 33 | #include | ^~~~~~~~~~~~~~~~~ compilation terminated. --- err.o --- *** [err.o] Error code 1 bmake[3]: stopped making "all" in /home/runner/work/freebsd-src/freebsd-src/tools/build bmake[3]: 1 error bmake[3]: stopped making "all" in /home/runner/work/freebsd-src/freebsd-src/tools/build --- legacy --- *** [legacy] Error code 2 bmake[2]: stopped making "legacy" in /home/runner/work/freebsd-src/freebsd-src bmake[2]: 1 error bmake[2]: stopped making "legacy" in /home/runner/work/freebsd-src/freebsd-src Command exited with non-zero status 2 3.30user 0.79system 0:01.27elapsed 321%CPU (0avgtext+0avgdata 71296maxresident)k 1200inputs+2984outputs (8major+109216minor)pagefaults 0swaps --- _legacy --- bmake[1]: stopped making "kernel-toolchain" in /home/runner/work/freebsd-src/freebsd-src --- kernel-toolchain --- bmake: stopped making "kernel-toolchain" in /home/runner/work/freebsd-src/freebsd-src Error: Process completed with exit code 2. Presumably we are building a native libegacy on Linux that includes err.c, so we need to either guard the new #include or add a compat header with a stub implementation? -- John Baldwin From nobody Tue Jul 8 19:16:57 2025 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 4bc9pb6fjcz61P2X; Tue, 08 Jul 2025 19:17:11 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (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 mx1.freebsd.org (Postfix) with ESMTPS id 4bc9pb3HGgz43Kv; Tue, 08 Jul 2025 19:17:11 +0000 (UTC) (envelope-from kostikbel@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: from tom.home (kib@localhost [127.0.0.1] (may be forged)) by kib.kiev.ua (8.18.1/8.18.1) with ESMTP id 568JGvY7064701; Tue, 8 Jul 2025 22:17:00 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 568JGvY7064701 Received: (from kostik@localhost) by tom.home (8.18.1/8.18.1/Submit) id 568JGv6D064700; Tue, 8 Jul 2025 22:16:57 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 8 Jul 2025 22:16:57 +0300 From: Konstantin Belousov To: John Baldwin Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 01a679715f68 - main - err(3): print extended error if available Message-ID: References: <202507071928.567JSk8Y012639@gitrepo.freebsd.org> 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on tom.home X-Rspamd-Queue-Id: 4bc9pb3HGgz43Kv X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] On Tue, Jul 08, 2025 at 03:09:32PM -0400, John Baldwin wrote: > On 7/7/25 15:28, Konstantin Belousov wrote: > > The branch main has been updated by kib: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=01a679715f68d5e32efecafc1f158eecec3f781b > > > > commit 01a679715f68d5e32efecafc1f158eecec3f781b > > Author: Konstantin Belousov > > AuthorDate: 2025-06-16 21:26:22 +0000 > > Commit: Konstantin Belousov > > CommitDate: 2025-07-07 18:44:22 +0000 > > > > err(3): print extended error if available > > Reviewed by: asomers, brooks > > Sponsored by: The FreeBSD Foundation > > Differential revision: https://reviews.freebsd.org/D51141 > > It looks like this broke cross-building as all of the GitHub cross-build > actions are failing now after this commit, e.g.: > > https://github.com/freebsd/freebsd-src/actions/runs/16126095376/job/45503237749 > > /home/runner/work/freebsd-src/freebsd-src/lib/libc//gen/err.c:33:10: fatal error: sys/exterrvar.h: No such file or directory > 33 | #include > | ^~~~~~~~~~~~~~~~~ > compilation terminated. > --- err.o --- > *** [err.o] Error code 1 > > bmake[3]: stopped making "all" in /home/runner/work/freebsd-src/freebsd-src/tools/build > bmake[3]: 1 error > > bmake[3]: stopped making "all" in /home/runner/work/freebsd-src/freebsd-src/tools/build > --- legacy --- > *** [legacy] Error code 2 > > bmake[2]: stopped making "legacy" in /home/runner/work/freebsd-src/freebsd-src > bmake[2]: 1 error > > bmake[2]: stopped making "legacy" in /home/runner/work/freebsd-src/freebsd-src > Command exited with non-zero status 2 > 3.30user 0.79system 0:01.27elapsed 321%CPU (0avgtext+0avgdata 71296maxresident)k > 1200inputs+2984outputs (8major+109216minor)pagefaults 0swaps > --- _legacy --- > > bmake[1]: stopped making "kernel-toolchain" in /home/runner/work/freebsd-src/freebsd-src > --- kernel-toolchain --- > > bmake: stopped making "kernel-toolchain" in /home/runner/work/freebsd-src/freebsd-src > Error: Process completed with exit code 2. > > Presumably we are building a native libegacy on Linux that includes err.c, so we > need to either guard the new #include or add a compat header with > a stub implementation? I think that the guard would be not enough, the real compat header with some content like #define UEXTERROR_MAXLEN 128 static inline int uexterr_gettext(char *buf, size_t len) { if (len > 0) buf[0] = '\0'; return (0); } should work better. From nobody Tue Jul 8 19:37:26 2025 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 4bcBFz0kkKz61QJV; Tue, 08 Jul 2025 19:37:27 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcBFy67gsz4DMv; Tue, 08 Jul 2025 19:37:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752003446; 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=pzeNIXdHLzSnTS3vfqdJJWZy259PHBgvDZkIV2CgpxU=; b=sGWiKDx6sKR7t5CciNvCdCRwUhCb43Eg4LesNCB1S1prNuf30817KKkt9H2VbZ2AA3AOM9 73AGYk4n3zIeMcfrSDtZ7RoDOFABDm+C69odAlEJfMQDOwalRfOjDbC28j3yhoEfPQcSEX YyxzhuAjjyrRZ1PukH0IQH+Nwa/vzj07aTzJQorE7+8qZNk+a3KigTdvRSm55HFXVIMZBg AsC4YeCo4dWNchIiAEwKntcnsF9iWTwaXVuEbJkLGjQnPeeYHpEubGY2exwNkRhtmIVuxq Ly9D54zmOAAk5iHax6QfOYy0FaQYd6yGG1YlR97iy5+k9YtdcvYbS/x+Eok6Hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752003446; 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=pzeNIXdHLzSnTS3vfqdJJWZy259PHBgvDZkIV2CgpxU=; b=kqYJUhcYpnd04XLlClWiuOtYtMDMLlDXrpg6JTEmxmuPaIcA3ePSRyDOOgiPR04aqQy65i jkcduulhoT4xArYo4X05jFNHDckfs3FKvRgYoGna9oalCGWYQWNaNBgzsRQjnPaYLW3jbU RNUyYQj+nh1HX1Z35NhmJZdotEA7xegglfAWdsJiyfSkOjP1XiUMACfvE/PE2uXo69OCHU Ox2rcVWPyHmizJuD10u76MB/EAObU1Mu5SAf/SqDEL8qxeLnID2q9NibqFrzfyhIxANnWY W2HLhyHuWDpWhCBP66q4Py93bb90aqE4mMEnA6Lu62ZGE86TtalU1/9+jJhjkQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752003446; a=rsa-sha256; cv=none; b=LFZpAuqxl+EAJz+Ixr+eK2CUhy5mJ5OSCGTQNS36oEmgDd/uMVbOaEPkO0XCbzfPbN+Ka9 hujoL7Rh+6NK7LaQYAFZCFEryx3is3aQcsr8Xe28It6frvhI8YfsO88LgcyN9qCvvIhsVi 1K/Z7MBvM5W4m0Qd3VCdFhp4TtvEstILtunsiUXVC5VlpDd/WGaVA6o5NS4KXVZf/hQDIp 6ezAm3dcTQqVyAhbKtHAdG9oTrh1zeF6Kpy1exV8FNbZYcKWEDXI4KbzuBiC2qM+2p8NPB q4tvpPkf8y01Ugj6ED5rnIGl3CTHHmKm9toIEEp2ez3unxAblcnaflOzl1dqIw== 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 4bcBFy5Hglzr4v; Tue, 08 Jul 2025 19:37:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 568JbQ87040270; Tue, 8 Jul 2025 19:37:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 568JbQN0040267; Tue, 8 Jul 2025 19:37:26 GMT (envelope-from git) Date: Tue, 8 Jul 2025 19:37:26 GMT Message-Id: <202507081937.568JbQN0040267@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Adrian Chadd Subject: git: dcd47304acb1 - main - net80211: update ieee80211_output_seqno_assign() to 802.11-2020 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dcd47304acb1f1713a27f407a153e2bb54c574ba Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=dcd47304acb1f1713a27f407a153e2bb54c574ba commit dcd47304acb1f1713a27f407a153e2bb54c574ba Author: Adrian Chadd AuthorDate: 2025-06-04 21:48:23 +0000 Commit: Adrian Chadd CommitDate: 2025-07-08 19:37:03 +0000 net80211: update ieee80211_output_seqno_assign() to 802.11-2020 Update ieee80211_output_seqno_assign() to support the transmitter sequence number assignment outlined in 802.11-2020 10.3.2.14.2 (Transmitter Requirements). Notably this correctly assigns the QoS NULL frames a seqno outside of the TID seqno space. Leave stub comments for the currently supported sequence number decisions. Add two new functions to access and increment the sequence number space, which will ensure that things wrap correctly. This should simplify drivers needing to constantly invent their own methods of fetching and incrementing the sequence number space. Differential Revision: https://reviews.freebsd.org/D50691 Reviewed by: bz --- sys/net80211/ieee80211_node.c | 30 ++++++++++++++++++++++++++++ sys/net80211/ieee80211_node.h | 6 ++++++ sys/net80211/ieee80211_output.c | 44 ++++++++++++++++++++++++++--------------- 3 files changed, 64 insertions(+), 16 deletions(-) diff --git a/sys/net80211/ieee80211_node.c b/sys/net80211/ieee80211_node.c index ad17af6778a1..a201d1b278f0 100644 --- a/sys/net80211/ieee80211_node.c +++ b/sys/net80211/ieee80211_node.c @@ -3137,6 +3137,36 @@ ieee80211_getsignal(struct ieee80211vap *vap, int8_t *rssi, int8_t *noise) *rssi = ieee80211_getrssi(vap); } +/** + * @brief Increment the given TID TX sequence, return the current one. + * + * @param ni ieee80211_node to operate on + * @param tid TID, or IEEE80211_NONQOS_TID + * @returns sequence number, from 0 .. 4095 inclusive, post increments + */ +ieee80211_seq ieee80211_tx_seqno_fetch_incr(struct ieee80211_node *ni, + uint8_t tid) +{ + ieee80211_seq seq; + + seq = ni->ni_txseqs[tid]; + ni->ni_txseqs[tid] = (ni->ni_txseqs[tid] + 1) % IEEE80211_SEQ_RANGE; + return (seq); +} + +/** + * @brief Return the current sequence number for the given TID + * + * @param ni ieee80211_node to operate on + * @param tid TID, or IEEE80211_NONQOS_TID + * @returns sequence number, from 0 .. 4095 inclusive + */ +ieee80211_seq ieee80211_tx_seqno_fetch(const struct ieee80211_node *ni, + uint8_t tid) +{ + return (ni->ni_txseqs[tid]); +} + /** * @brief return a dot11rate / ratecode representing the current transmit rate * diff --git a/sys/net80211/ieee80211_node.h b/sys/net80211/ieee80211_node.h index c83eee04a8dc..ef25fa0d7fdd 100644 --- a/sys/net80211/ieee80211_node.h +++ b/sys/net80211/ieee80211_node.h @@ -531,6 +531,12 @@ void ieee80211_node_leave(struct ieee80211_node *); int8_t ieee80211_getrssi(struct ieee80211vap *); void ieee80211_getsignal(struct ieee80211vap *, int8_t *, int8_t *); +/* TX sequence space related routines */ +ieee80211_seq ieee80211_tx_seqno_fetch_incr(struct ieee80211_node *, + uint8_t); +ieee80211_seq ieee80211_tx_seqno_fetch(const struct ieee80211_node *, + uint8_t); + /* * Node transmit rate specific manipulation. * diff --git a/sys/net80211/ieee80211_output.c b/sys/net80211/ieee80211_output.c index a4151f807882..afe83ea0805c 100644 --- a/sys/net80211/ieee80211_output.c +++ b/sys/net80211/ieee80211_output.c @@ -4195,17 +4195,15 @@ ieee80211_tx_complete(struct ieee80211_node *ni, struct mbuf *m, int status) * Check the frame type and TID and assign a suitable sequence number * from the correct sequence number space. * + * This implements the components of 802.11-2020 10.3.2.14.2 + * (Transmitter Requirements) that net80211 currently supports. + * * It assumes the mbuf has been encapsulated, and has the TID assigned * if it is a QoS frame. * * Note this also clears any existing fragment ID in the header, so it * must be called first before assigning fragment IDs. * - * For now this implements parts of 802.11-2012; it doesn't do all of - * the needed checks for full compliance (notably QoS-Data NULL frames). - * - * TODO: update to 802.11-2020 10.3.2.14.2 (Transmitter Requirements) - * * @param ni ieee80211_node this frame will be transmitted to * @param arg_tid A temporary check, existing callers may set * this to a TID variable they were using, and this routine @@ -4239,16 +4237,30 @@ ieee80211_output_seqno_assign(struct ieee80211_node *ni, int arg_tid, "%s: called; TID mismatch; tid=%u, arg_tid=%d\n", __func__, tid, arg_tid); - if (IEEE80211_HAS_SEQ(type, subtype)) { - /* - * 802.11-2012 9.3.2.10 - QoS multicast frames - * come out of a different seqno space. - */ - if (IEEE80211_IS_MULTICAST(wh->i_addr1)) - seqno = ni->ni_txseqs[IEEE80211_NONQOS_TID]++; - else - seqno = ni->ni_txseqs[tid]++; - } else + + /* 802.11-2020 10.3.2.14.2 (Transmitter Requirements) sections */ + + /* SNS7 - unicast PV1 management frame */ + + /* SNS6 - unicast PV1 data frame */ + + /* SNS5 - QoS NULL frames */ + if (IEEE80211_QOS_HAS_SEQ(wh) && IEEE80211_IS_QOS_NULL(wh)) + seqno = ieee80211_tx_seqno_fetch_incr(ni, IEEE80211_NONQOS_TID); + + /* SNS4 - QMF STA transmitting a QMF */ + + /* SNS3 - QoS STA; Time Priority Management frame */ + + /* SNS2 - unicast QoS STA, data frame, excluding SNS5 */ + else if (IEEE80211_QOS_HAS_SEQ(wh) && + !IEEE80211_IS_MULTICAST(wh->i_addr1)) + seqno = ieee80211_tx_seqno_fetch_incr(ni, tid); + + /* SNS1 - Baseline (everything else) */ + else if (IEEE80211_HAS_SEQ(type, subtype)) + seqno = ieee80211_tx_seqno_fetch_incr(ni, IEEE80211_NONQOS_TID); + else seqno = 0; /* @@ -4276,7 +4288,7 @@ ieee80211_output_beacon_seqno_assign(struct ieee80211_node *ni, struct mbuf *m) wh = mtod(m, struct ieee80211_frame *); - seqno = ni->ni_txseqs[IEEE80211_NONQOS_TID]++; + seqno = ieee80211_tx_seqno_fetch_incr(ni, IEEE80211_NONQOS_TID); *(uint16_t *)&wh->i_seq[0] = htole16(seqno << IEEE80211_SEQ_SEQ_SHIFT); M_SEQNO_SET(m, seqno); From nobody Tue Jul 8 19:40:33 2025 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 4bcBKw1my8z61QgP; Tue, 08 Jul 2025 19:40:52 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com [IPv6:2a00:1450:4864:20::129]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcBKv5wqtz4FmD; Tue, 08 Jul 2025 19:40:51 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-lf1-x129.google.com with SMTP id 2adb3069b0e04-553dceb342aso4236751e87.1; Tue, 08 Jul 2025 12:40:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1752003648; x=1752608448; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=kMVWtV2ayEpCQniX8zi68QIJNpwLxwXYVfVdTz3WxGo=; b=eRVxdbhvUI3yP1URYwOHHpN3uPp3hFg8klGAuhr+Ll7Q+6uXTp446ih7yPm9BrrkGv Dflxd4aaQZqlH/r+NnGK7SwbwTDNkzt5LnpEFdwZ/V8VM0pEsnOQnVjV0wQh9mhDlwjM 7nQnHVCBGv7hOR5IejZyzgQY+YqkiHybxqC8zqmzFYOeZ7u3zbRGuxyt5bnSzeYtar5F 7m6LroQVyQLWs52DaPFhKMsagTnSM3G4sv0ZMxrr5g4AifCmyaxu4jNn9ZZJIb/SmRv4 txYiJcctLPcMlkT04HgiTWSMQx1GgM36MXTMun3LtFn0NMGv03AfR6EA4zrgbGzQxX3q 0nHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752003648; x=1752608448; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=kMVWtV2ayEpCQniX8zi68QIJNpwLxwXYVfVdTz3WxGo=; b=TfqOU99cBeA09APhz2C3Jn7UyCCgudFYl/LrlfQrxC9szM+bLoK3eqIGM1R1XnZwAg +uQ3cFGI6ngOoiXyiA8UHyqGsAJBQPj+lwy7jwpRl4DhlfDhwJxeyGFr3guDk0dAdOo9 nbDOyyYFv0Zeu9uYeP9Sls+hwVst8BCnUNxd3xc3MGT+CBRJ5O3Feyhw3KlTArHkwDay H6+0N4NOBJi2UUDb0j16jebc0sDi84icbE8A43biAgykZy3G7XDn605pf8/+3h5uMXYR 7Y8ElYl3jBCMs9qiAiOGLEkrS8iEvnlPydSh+CfigPM2OdcmsPcknKcVlwH4m6UXv9ZD x5ug== X-Forwarded-Encrypted: i=1; AJvYcCW6tVRlHmCoeeWYb4LfFq53E6IlJ43wUaathwXxbd1nFit16xrMdNPDssM/E0FVzpldkbxOxOfNAnqfd2leaJOZsTqxe9Y=@freebsd.org, AJvYcCWYXJbGEeLohaHunVclY3yNx1WcehtmMxH/0/5wFSisZp7yNXx/35/T10Iq55+lBPJVfnYtiGeOGwjUXmGfDVbHDQYe@freebsd.org X-Gm-Message-State: AOJu0Yx76ZsKkfrMaD72O1/4j+e2/+PSWKfllTEAHcP3Y6270FFLFaNY yXoumI7b+qQn1e1Qmr6/kKrZSrdpYviZ1qy8lAiy7k5vOVkyGdnk7EJgUnWS+jEtbLq0Re/2f8h Fh09KrRkREGI2oehgqUQjwWjsSEoUTK1/rA== X-Gm-Gg: ASbGncsy+mACLhPr9wE8W6JEZ39wIS+b6PC2HefHeeGAQc+sP0fcJswgDg2QJn3uFx4 Vp65mW2uDj5hZFE7VtfamIgw8c4aLtsDJlsqUrqqS8OD2tVBe2UKVIBii6yLgCHnKOjhps90jTZ Kiond2m9O4T2XI+XsTjL80ppqo2B0D+4XoH92FCbN/nx7U X-Google-Smtp-Source: AGHT+IFXal+DSVIuEpmq4UHXxvQikF8KPzpaNT3LLZlRUa3CBlFKR027vU+BbQLMWphXQ/8LFo88sFGhk+ZFg2KQfq8= X-Received: by 2002:a05:6512:ac4:b0:553:3486:1d9b with SMTP id 2adb3069b0e04-558f9aaa4d1mr133734e87.30.1752003647785; Tue, 08 Jul 2025 12:40:47 -0700 (PDT) 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 References: <202507081512.568FCeX8049407@gitrepo.freebsd.org> In-Reply-To: <202507081512.568FCeX8049407@gitrepo.freebsd.org> From: Adrian Chadd Date: Tue, 8 Jul 2025 12:40:33 -0700 X-Gm-Features: Ac12FXzWx1bL8fUVCoSJX8g970XvaLugGgAQbKpcWSOVSwSttwhHq-fuI0riwKQ Message-ID: Subject: Re: git: f84a0da4e060 - main - libusb: rename bNumDeviceCapabilities to bNumDeviceCaps for compatibility with libusb To: ShengYi Hung Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="000000000000124ea00639702305" X-Rspamd-Queue-Id: 4bcBKv5wqtz4FmD X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] --000000000000124ea00639702305 Content-Type: text/plain; charset="UTF-8" hi! Thanks for this! Could we possibly wrap stuff like these compat macros in a #define that we can undefine? So we can make sure no new code shows up that uses the "old" paths? eg LIBUSB10_NO_BACKWARDS_COMPAT / LIBUSB20_NO_BACKWARDS_COMPAT ? Thanks! -adrian On Tue, 8 Jul 2025 at 08:12, ShengYi Hung wrote: > The branch main has been updated by aokblast: > > URL: > https://cgit.FreeBSD.org/src/commit/?id=f84a0da4e0608a970c775f3d605f8de2b0b8d322 > > commit f84a0da4e0608a970c775f3d605f8de2b0b8d322 > Author: ShengYi Hung > AuthorDate: 2025-06-07 19:43:15 +0000 > Commit: ShengYi Hung > CommitDate: 2025-07-08 15:11:41 +0000 > > libusb: rename bNumDeviceCapabilities to bNumDeviceCaps for > compatibility with libusb > > THe member bNumDeviceCapabilities is referred to as bNumDeviceCaps in > the upstream libusb project. > > To improve compatibility, we are renaming the member accordingly. > > For backward compatibility, a mocro will be defined to map > bNumDeviceCapabilities to bNumDeviceCaps. > > See: > https://github.com/libusb/libusb/commit/02ebafc85d3f219842cbabaf78abc8100b6656e5 > > Reviewed by: kevans > Approved by: markj (mentor) > MFC after: 2 weeks > Sponsored by: FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D50740 > --- > lib/libusb/libusb.h | 5 ++++- > lib/libusb/libusb10_desc.c | 11 ++++++----- > lib/libusb/libusb20_desc.h | 6 +++++- > 3 files changed, 15 insertions(+), 7 deletions(-) > > diff --git a/lib/libusb/libusb.h b/lib/libusb/libusb.h > index 0aad29aa4ecc..491af3d0a5ec 100644 > --- a/lib/libusb/libusb.h > +++ b/lib/libusb/libusb.h > @@ -418,7 +418,10 @@ typedef struct libusb_bos_descriptor { > uint8_t bLength; > uint8_t bDescriptorType; > uint16_t wTotalLength; > - uint8_t bNumDeviceCapabilities; > +#ifndef bNumDeviceCapabilities > +#define bNumDeviceCapabilities bNumDeviceCaps > +#endif > + uint8_t bNumDeviceCaps; > struct libusb_usb_2_0_device_capability_descriptor > *usb_2_0_ext_cap; > struct libusb_ss_usb_device_capability_descriptor *ss_usb_cap; > struct libusb_bos_dev_capability_descriptor **dev_capability; > diff --git a/lib/libusb/libusb10_desc.c b/lib/libusb/libusb10_desc.c > index 3e36009cbb3a..5f4c46740688 100644 > --- a/lib/libusb/libusb10_desc.c > +++ b/lib/libusb/libusb10_desc.c > @@ -470,10 +470,11 @@ libusb_parse_bos_descriptor(const void *buf, int len, > ptr->bDescriptorType = dtype; > ptr->wTotalLength = ((const uint8_t *)buf)[2] | > (((const uint8_t *)buf)[3] << 8); > - ptr->bNumDeviceCapabilities = ((const uint8_t > *)buf)[4]; > + ptr->bNumDeviceCaps = ((const uint8_t *)buf)[4]; > ptr->usb_2_0_ext_cap = NULL; > ptr->ss_usb_cap = NULL; > - ptr->dev_capability = > calloc(ptr->bNumDeviceCapabilities, sizeof(void *)); > + ptr->dev_capability = calloc(ptr->bNumDeviceCaps, > + sizeof(void *)); > if (ptr->dev_capability == NULL) { > free(ptr); > return (LIBUSB_ERROR_NO_MEM); > @@ -485,7 +486,7 @@ libusb_parse_bos_descriptor(const void *buf, int len, > if (dlen >= 3 && > ptr != NULL && > dtype == LIBUSB_DT_DEVICE_CAPABILITY) { > - if (index != ptr->bNumDeviceCapabilities) { > + if (index != ptr->bNumDeviceCaps) { > ptr->dev_capability[index] = malloc(dlen); > if (ptr->dev_capability[index] == NULL) { > libusb_free_bos_descriptor(ptr); > @@ -542,7 +543,7 @@ libusb_parse_bos_descriptor(const void *buf, int len, > } > > if (ptr != NULL) { > - ptr->bNumDeviceCapabilities = index; > + ptr->bNumDeviceCaps = index; > return (0); /* success */ > } > > @@ -557,7 +558,7 @@ libusb_free_bos_descriptor(struct > libusb_bos_descriptor *bos) > if (bos == NULL) > return; > > - for (i = 0; i != bos->bNumDeviceCapabilities; i++) > + for (i = 0; i != bos->bNumDeviceCaps; i++) > free(bos->dev_capability[i]); > free(bos->dev_capability); > free(bos); > diff --git a/lib/libusb/libusb20_desc.h b/lib/libusb/libusb20_desc.h > index 017148a34b1c..0f7c9294ebc8 100644 > --- a/lib/libusb/libusb20_desc.h > +++ b/lib/libusb/libusb20_desc.h > @@ -298,11 +298,15 @@ LIBUSB20_MAKE_STRUCT(LIBUSB20_USB_20_DEVCAP_DESC); > > LIBUSB20_MAKE_STRUCT(LIBUSB20_SS_USB_DEVCAP_DESC); > > +#ifndef bNumDeviceCapabilities > +#define bNumDeviceCapabilities bNumDeviceCaps > +#endif > + > #define LIBUSB20_BOS_DESCRIPTOR(m,n) \ > m(n, UINT8_T, bLength, ) \ > m(n, UINT8_T, bDescriptorType, ) \ > m(n, UINT16_T, wTotalLength, ) \ > - m(n, UINT8_T, bNumDeviceCapabilities, ) \ > + m(n, UINT8_T, bNumDeviceCaps, ) \ > > LIBUSB20_MAKE_STRUCT(LIBUSB20_BOS_DESCRIPTOR); > > --000000000000124ea00639702305 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
hi! Thanks for this!

Could w= e possibly wrap stuff like these compat macros in a #define that we can und= efine? So we can make sure no new code shows up that uses the "old&quo= t; paths?

eg LIBUSB10_NO_BACKWARDS_COMPAT / LIBUSB= 20_NO_BACKWARDS_COMPAT ?

Thanks!



-adrian

On Tue, 8 Jul 2025 at 08:12, ShengYi Hung <aokblast@freebsd.org> wrote:
The branch main has been update= d by aokblast:

URL: https://cgit.= FreeBSD.org/src/commit/?id=3Df84a0da4e0608a970c775f3d605f8de2b0b8d322
commit f84a0da4e0608a970c775f3d605f8de2b0b8d322
Author:=C2=A0 =C2=A0 =C2=A0ShengYi Hung <aokblast@FreeBSD.org>
AuthorDate: 2025-06-07 19:43:15 +0000
Commit:=C2=A0 =C2=A0 =C2=A0ShengYi Hung <aokblast@FreeBSD.org>
CommitDate: 2025-07-08 15:11:41 +0000

=C2=A0 =C2=A0 libusb: rename bNumDeviceCapabilities to bNumDeviceCaps for c= ompatibility with libusb

=C2=A0 =C2=A0 THe member bNumDeviceCapabilities is referred to as bNumDevic= eCaps in
=C2=A0 =C2=A0 the upstream libusb project.

=C2=A0 =C2=A0 To improve compatibility, we are renaming the member accordin= gly.

=C2=A0 =C2=A0 For backward compatibility, a mocro will be defined to map =C2=A0 =C2=A0 bNumDeviceCapabilities to bNumDeviceCaps.

=C2=A0 =C2=A0 See: h= ttps://github.com/libusb/libusb/commit/02ebafc85d3f219842cbabaf78abc8100b66= 56e5

=C2=A0 =C2=A0 Reviewed by:=C2=A0 =C2=A0 kevans
=C2=A0 =C2=A0 Approved by:=C2=A0 =C2=A0 markj (mentor)
=C2=A0 =C2=A0 MFC after:=C2=A0 =C2=A0 =C2=A0 2 weeks
=C2=A0 =C2=A0 Sponsored by:=C2=A0 =C2=A0FreeBSD Foundation
=C2=A0 =C2=A0 Differential Revision: https://reviews.freebsd.org/D= 50740
---
=C2=A0lib/libusb/libusb.h=C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2=A0 5 ++++-
=C2=A0lib/libusb/libusb10_desc.c | 11 ++++++-----
=C2=A0lib/libusb/libusb20_desc.h |=C2=A0 6 +++++-
=C2=A03 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/lib/libusb/libusb.h b/lib/libusb/libusb.h
index 0aad29aa4ecc..491af3d0a5ec 100644
--- a/lib/libusb/libusb.h
+++ b/lib/libusb/libusb.h
@@ -418,7 +418,10 @@ typedef struct libusb_bos_descriptor {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 uint8_t bLength;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 uint8_t bDescriptorType;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 uint16_t wTotalLength;
-=C2=A0 =C2=A0 =C2=A0 =C2=A0uint8_t bNumDeviceCapabilities;
+#ifndef bNumDeviceCapabilities
+#define bNumDeviceCapabilities bNumDeviceCaps
+#endif
+=C2=A0 =C2=A0 =C2=A0 =C2=A0uint8_t bNumDeviceCaps;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 struct libusb_usb_2_0_device_capability_descrip= tor *usb_2_0_ext_cap;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 struct libusb_ss_usb_device_capability_descript= or *ss_usb_cap;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 struct libusb_bos_dev_capability_descriptor **d= ev_capability;
diff --git a/lib/libusb/libusb10_desc.c b/lib/libusb/libusb10_desc.c
index 3e36009cbb3a..5f4c46740688 100644
--- a/lib/libusb/libusb10_desc.c
+++ b/lib/libusb/libusb10_desc.c
@@ -470,10 +470,11 @@ libusb_parse_bos_descriptor(const void *buf, int len,=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 ptr->bDescriptorType =3D dtype;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 ptr->wTotalLength =3D ((const uint8_t *)buf)[2] |
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 (((const uint8_t *)buf)[3] << 8);
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0ptr->bNumDeviceCapabilities =3D ((const uint8_t *)buf)[4];
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0ptr->bNumDeviceCaps =3D ((const uint8_t *)buf)[4];
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 ptr->usb_2_0_ext_cap =3D NULL;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 ptr->ss_usb_cap =3D NULL;
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0ptr->dev_capability =3D calloc(ptr->bNumDeviceCapabilities,= sizeof(void *));
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0ptr->dev_capability =3D calloc(ptr->bNumDeviceCaps,
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0sizeof(void *));
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 if (ptr->dev_capability =3D=3D NULL) {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 free(ptr);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return (LIBUSB_ERROR_NO_MEM);
@@ -485,7 +486,7 @@ libusb_parse_bos_descriptor(const void *buf, int len, =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (dlen >=3D 3 = &&
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ptr != =3D NULL &&
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 dtype= =3D=3D LIBUSB_DT_DEVICE_CAPABILITY) {
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0if (index !=3D ptr->bNumDeviceCapabilities) {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0if (index !=3D ptr->bNumDeviceCaps) {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ptr->dev_capability[index] =3D ma= lloc(dlen);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (ptr->dev_capability[index] = =3D=3D NULL) {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 libusb_f= ree_bos_descriptor(ptr);
@@ -542,7 +543,7 @@ libusb_parse_bos_descriptor(const void *buf, int len, =C2=A0 =C2=A0 =C2=A0 =C2=A0 }

=C2=A0 =C2=A0 =C2=A0 =C2=A0 if (ptr !=3D NULL) {
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0ptr->bNumDeviceC= apabilities =3D index;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0ptr->bNumDeviceC= aps =3D index;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return (0);=C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0/* success */
=C2=A0 =C2=A0 =C2=A0 =C2=A0 }

@@ -557,7 +558,7 @@ libusb_free_bos_descriptor(struct libusb_bos_descriptor= *bos)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 if (bos =3D=3D NULL)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return;

-=C2=A0 =C2=A0 =C2=A0 =C2=A0for (i =3D 0; i !=3D bos->bNumDeviceCapabili= ties; i++)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0for (i =3D 0; i !=3D bos->bNumDeviceCaps; i+= +)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 free(bos->dev_ca= pability[i]);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 free(bos->dev_capability);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 free(bos);
diff --git a/lib/libusb/libusb20_desc.h b/lib/libusb/libusb20_desc.h
index 017148a34b1c..0f7c9294ebc8 100644
--- a/lib/libusb/libusb20_desc.h
+++ b/lib/libusb/libusb20_desc.h
@@ -298,11 +298,15 @@ LIBUSB20_MAKE_STRUCT(LIBUSB20_USB_20_DEVCAP_DESC);
=C2=A0LIBUSB20_MAKE_STRUCT(LIBUSB20_SS_USB_DEVCAP_DESC);

+#ifndef bNumDeviceCapabilities
+#define bNumDeviceCapabilities bNumDeviceCaps
+#endif
+
=C2=A0#define=C2=A0 =C2=A0 =C2=A0 =C2=A0 LIBUSB20_BOS_DESCRIPTOR(m,n) \
=C2=A0 =C2=A0m(n, UINT8_T,=C2=A0 bLength, ) \
=C2=A0 =C2=A0m(n, UINT8_T,=C2=A0 bDescriptorType, ) \
=C2=A0 =C2=A0m(n, UINT16_T, wTotalLength, ) \
-=C2=A0 m(n, UINT8_T,=C2=A0 bNumDeviceCapabilities, ) \
+=C2=A0 m(n, UINT8_T,=C2=A0 bNumDeviceCaps, ) \

=C2=A0LIBUSB20_MAKE_STRUCT(LIBUSB20_BOS_DESCRIPTOR);

--000000000000124ea00639702305-- From nobody Tue Jul 8 19:44:42 2025 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 4bcBQN3rxzz61R55; Tue, 08 Jul 2025 19:44:44 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcBQN37BBz4K7j; Tue, 08 Jul 2025 19:44:44 +0000 (UTC) (envelope-from kevans@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752003884; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UyZGMx9sMYvh8EidQA15n0pe/82w3Q8s4ip+z4hP7/c=; b=nk5E61xeSn63Ewc1fAGzXUd/iLC95N1HvQPulaHPm4K1h9YsBM27fINc+WSxXU46JyTlLD Kx9j6skk/rhCx5L/Ev01Zhmq0/byjQpWAi9HDzDFfT+C2E9hA2Si9wRxgWqoO+CYeGdD/g iZs3e0K3qMoI6mv1eWfhS8M7F6v6eRCwvQQDu5syYVzyRUy+518+QkQQpiJTlgz05R6I3x N7ibHVv43ecyj7TcQYsmmqz1Wv+tbyZ8qw9lbHCW8KlYSRdM1wkiTSYH8+q7t3MVLd2rgr bVW7gd+KnH4n7/Yt1VdiQ75Ne68+mxMF9Uz2T60cuf1YwTCtVmgOJMkqYHBmZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752003884; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UyZGMx9sMYvh8EidQA15n0pe/82w3Q8s4ip+z4hP7/c=; b=HqZc4f4pB5lOO20JIA0oSx6MpxLUy7DVREnMm8BswE40Un+nfnSUZurtaYRcnKNITXV12h LVFmnCq1H/+WC3DNnHDMmn1AdlsyQuh7wtd+tdj0Gr96ZN1imKseGBJ98UrRTRd9uU/Ws2 kp8dHz4eScg6aJT1XqgsHKlLGh2f33oEDhrELH8+URtQkeveWtZ1w95DBh47z9bLfjYJz4 /Dw8rnGjKDNhb0/Y9wtFR2JEtj+8dUjPAKcYJvgPGuFTpAUh2cWGWyjbu85fZdx/Is80FT 9HluDwzu2K/uV9DMOH3v4LZohUnRkxVnDawvGoLOPTEErMWto74H3Xp4J7G5JQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752003884; a=rsa-sha256; cv=none; b=M2eskOFW64rq3kWAAuJCZfHdrVBQc2crSOd6Wd06vup/Dyx1k0VpPDfuk4qfzhVRKwCPpg /8gecosaLel2EmdE4hucU1KeiaiUNFx96UXsCP9eKwIZ2LVUYbpndTIs4UgOrbVg64zvHL DyoYo+g4KDuhlk11G3mYxOK/c3u7KDeWBH7P6stXTfb2lRi9sC5QO7x7pnab0CZucLfMPK qHZCKe95GFYPfIVpkK0sLgbOz+NRw0PA0Uxx28mwVOTlnQViE2d2t/hdxpWn4vldYXyYRF Vttc9W7bf2hNP8q9DN7InZAAV+awU7j2RAWY6XtnC45hI85WpgQfD+qCJ+wLVw== Received: from [10.9.4.95] (unknown [209.182.120.176]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: kevans/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bcBQM6RKGzrsn; Tue, 08 Jul 2025 19:44:43 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Message-ID: Date: Tue, 8 Jul 2025 14:44:42 -0500 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: f84a0da4e060 - main - libusb: rename bNumDeviceCapabilities to bNumDeviceCaps for compatibility with libusb To: Adrian Chadd , ShengYi Hung Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202507081512.568FCeX8049407@gitrepo.freebsd.org> Content-Language: en-US From: Kyle Evans In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 7/8/25 14:40, Adrian Chadd wrote: > hi! Thanks for this! > > Could we possibly wrap stuff like these compat macros in a #define that > we can undefine? So we can make sure no new code shows up that uses the > "old" paths? > > eg LIBUSB10_NO_BACKWARDS_COMPAT / LIBUSB20_NO_BACKWARDS_COMPAT ? > > Thanks! > The latter, please. +1 Thanks, Kyle Evans > > > -adrian > > > On Tue, 8 Jul 2025 at 08:12, ShengYi Hung > wrote: > > The branch main has been updated by aokblast: > > URL: https://cgit.FreeBSD.org/src/commit/? > id=f84a0da4e0608a970c775f3d605f8de2b0b8d322 cgit.FreeBSD.org/src/commit/? > id=f84a0da4e0608a970c775f3d605f8de2b0b8d322> > > commit f84a0da4e0608a970c775f3d605f8de2b0b8d322 > Author:     ShengYi Hung > AuthorDate: 2025-06-07 19:43:15 +0000 > Commit:     ShengYi Hung > CommitDate: 2025-07-08 15:11:41 +0000 > >     libusb: rename bNumDeviceCapabilities to bNumDeviceCaps for > compatibility with libusb > >     THe member bNumDeviceCapabilities is referred to as > bNumDeviceCaps in >     the upstream libusb project. > >     To improve compatibility, we are renaming the member accordingly. > >     For backward compatibility, a mocro will be defined to map >     bNumDeviceCapabilities to bNumDeviceCaps. > >     See: https://github.com/libusb/libusb/ > commit/02ebafc85d3f219842cbabaf78abc8100b6656e5 libusb/libusb/commit/02ebafc85d3f219842cbabaf78abc8100b6656e5> > >     Reviewed by:    kevans >     Approved by:    markj (mentor) >     MFC after:      2 weeks >     Sponsored by:   FreeBSD Foundation >     Differential Revision: https://reviews.freebsd.org/D50740 > > --- >  lib/libusb/libusb.h        |  5 ++++- >  lib/libusb/libusb10_desc.c | 11 ++++++----- >  lib/libusb/libusb20_desc.h |  6 +++++- >  3 files changed, 15 insertions(+), 7 deletions(-) > > diff --git a/lib/libusb/libusb.h b/lib/libusb/libusb.h > index 0aad29aa4ecc..491af3d0a5ec 100644 > --- a/lib/libusb/libusb.h > +++ b/lib/libusb/libusb.h > @@ -418,7 +418,10 @@ typedef struct libusb_bos_descriptor { >         uint8_t bLength; >         uint8_t bDescriptorType; >         uint16_t wTotalLength; > -       uint8_t bNumDeviceCapabilities; > +#ifndef bNumDeviceCapabilities > +#define bNumDeviceCapabilities bNumDeviceCaps > +#endif > +       uint8_t bNumDeviceCaps; >         struct libusb_usb_2_0_device_capability_descriptor > *usb_2_0_ext_cap; >         struct libusb_ss_usb_device_capability_descriptor *ss_usb_cap; >         struct libusb_bos_dev_capability_descriptor **dev_capability; > diff --git a/lib/libusb/libusb10_desc.c b/lib/libusb/libusb10_desc.c > index 3e36009cbb3a..5f4c46740688 100644 > --- a/lib/libusb/libusb10_desc.c > +++ b/lib/libusb/libusb10_desc.c > @@ -470,10 +470,11 @@ libusb_parse_bos_descriptor(const void *buf, > int len, >                         ptr->bDescriptorType = dtype; >                         ptr->wTotalLength = ((const uint8_t *)buf)[2] | >                             (((const uint8_t *)buf)[3] << 8); > -                       ptr->bNumDeviceCapabilities = ((const > uint8_t *)buf)[4]; > +                       ptr->bNumDeviceCaps = ((const uint8_t *)buf)[4]; >                         ptr->usb_2_0_ext_cap = NULL; >                         ptr->ss_usb_cap = NULL; > -                       ptr->dev_capability = calloc(ptr- > >bNumDeviceCapabilities, sizeof(void *)); > +                       ptr->dev_capability = calloc(ptr- > >bNumDeviceCaps, > +                           sizeof(void *)); >                         if (ptr->dev_capability == NULL) { >                                 free(ptr); >                                 return (LIBUSB_ERROR_NO_MEM); > @@ -485,7 +486,7 @@ libusb_parse_bos_descriptor(const void *buf, int > len, >                 if (dlen >= 3 && >                     ptr != NULL && >                     dtype == LIBUSB_DT_DEVICE_CAPABILITY) { > -                       if (index != ptr->bNumDeviceCapabilities) { > +                       if (index != ptr->bNumDeviceCaps) { >                                 ptr->dev_capability[index] = > malloc(dlen); >                                 if (ptr->dev_capability[index] == > NULL) { > > libusb_free_bos_descriptor(ptr); > @@ -542,7 +543,7 @@ libusb_parse_bos_descriptor(const void *buf, int > len, >         } > >         if (ptr != NULL) { > -               ptr->bNumDeviceCapabilities = index; > +               ptr->bNumDeviceCaps = index; >                 return (0);             /* success */ >         } > > @@ -557,7 +558,7 @@ libusb_free_bos_descriptor(struct > libusb_bos_descriptor *bos) >         if (bos == NULL) >                 return; > > -       for (i = 0; i != bos->bNumDeviceCapabilities; i++) > +       for (i = 0; i != bos->bNumDeviceCaps; i++) >                 free(bos->dev_capability[i]); >         free(bos->dev_capability); >         free(bos); > diff --git a/lib/libusb/libusb20_desc.h b/lib/libusb/libusb20_desc.h > index 017148a34b1c..0f7c9294ebc8 100644 > --- a/lib/libusb/libusb20_desc.h > +++ b/lib/libusb/libusb20_desc.h > @@ -298,11 +298,15 @@ LIBUSB20_MAKE_STRUCT(LIBUSB20_USB_20_DEVCAP_DESC); > >  LIBUSB20_MAKE_STRUCT(LIBUSB20_SS_USB_DEVCAP_DESC); > > +#ifndef bNumDeviceCapabilities > +#define bNumDeviceCapabilities bNumDeviceCaps > +#endif > + >  #define        LIBUSB20_BOS_DESCRIPTOR(m,n) \ >    m(n, UINT8_T,  bLength, ) \ >    m(n, UINT8_T,  bDescriptorType, ) \ >    m(n, UINT16_T, wTotalLength, ) \ > -  m(n, UINT8_T,  bNumDeviceCapabilities, ) \ > +  m(n, UINT8_T,  bNumDeviceCaps, ) \ > >  LIBUSB20_MAKE_STRUCT(LIBUSB20_BOS_DESCRIPTOR); > From nobody Tue Jul 8 19:49:54 2025 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 4bcBXL6dKgz61RPZ; Tue, 08 Jul 2025 19:49:54 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcBXL5cnyz4MQF; Tue, 08 Jul 2025 19:49:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752004194; 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=iSNcIDHevSJppgeQkwVi/9MEMKgwVzpfgYg4XMcFfjA=; b=vtM3wP0kVV9AVrlWObje22s8xmh1u1REfcRh/RGTm79ThyQT3ZgKZPpQdsRRuJ1cHpaWJ4 uTuGI4mU3Ury8SQSSx/Dr/k85S17wN0DUwOYa3DXkMppTS8Ie21qD9fpzk4n79CWf5XmT4 BCdvH/Gl42V3fxCjBqWKg+4N5T1z50x7jG5Y9ZM6OlY+4wWHPey+bIbRWwF2IXToHkNZwd NhdzizOqpBUgl3on2AiReZJ/OzYqly8IlEtNI+ipoRif3lSg4xVKIfR+7/MvQjC4E0gI4t WXJKqeHgB6RmklomqRkvDVkd8S6/ihwVCxhkDmtk1lvAbtqZpSSSffjRGS/Chw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752004194; 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=iSNcIDHevSJppgeQkwVi/9MEMKgwVzpfgYg4XMcFfjA=; b=Dg2KesvGGB0KHW5OER8cdR0BfvXkqqexwed0+Qtit90RzzIjCynzJ7WbCRLYcASoJd3LFS 4KP9CFvk3NQntljUJmnfEkBM0mdpZgTCiaAyul0Xt5WGW+U4nDALqs8f/8uPC9i48yg1r/ RN+lfkvxxEU/HG06uYxlYFqpEz0kFOWiY+v/5tHfuWDGsH+dJi7X0RVGe6Ukarbv9SEoNe LiYNVypTXtx2nYCF8aHWzPpDYz10wRrV9vYGdh/3fjo4qyB/n0oLqnJn37Zn2IOWIVjNcd bkCM9zfZIGjoNEI5yPHmU3LbpC30ZRo5jV9uTQH+UUCbi5B13w/h3/jj8i7qpA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752004194; a=rsa-sha256; cv=none; b=GPGtuEh4svmFp3pg2+3Qs2/wr1Kn7OQSTbHO/jinebIJ1+DjgYQrGC//rsQKiGjCgx2x2Q +eHrojE1lMBV/bBqKp7UVh/8uTTrLEIAdG2pUgww5bvVrCnqnttgY7b3PsEkrEeJgeSlGI zXdFfVoyiU6IKDGYH3ml9eLCryutmdmlSE5pWteg/1HAI63cj0lPaWZCGjtsvizRt9/Ci5 Q2VEGIx0hYumrB/qBi/y+4URvyJ7ie4F+ESe7vPGsiTxXidiuvk7K0nL1s4ggWvdhGSLcA ynL0l1f2EonqQVCBy5u+Q2st4yIdGPiNACFFhVIsGcPnhT2UPCwnrNe+CJ7ECQ== 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 4bcBXL4dV0zqrs; Tue, 08 Jul 2025 19:49:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 568Jns67060162; Tue, 8 Jul 2025 19:49:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 568JnsfN060159; Tue, 8 Jul 2025 19:49:54 GMT (envelope-from git) Date: Tue, 8 Jul 2025 19:49:54 GMT Message-Id: <202507081949.568JnsfN060159@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: c08e019c6ce4 - main - opendir, fdopendir: Add tests, clean up. 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c08e019c6ce4fc637b195f1bb0878763c3fefe9e Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=c08e019c6ce4fc637b195f1bb0878763c3fefe9e commit c08e019c6ce4fc637b195f1bb0878763c3fefe9e Author: Dag-Erling Smørgrav AuthorDate: 2025-07-08 19:40:55 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-07-08 19:41:21 +0000 opendir, fdopendir: Add tests, clean up. * Add test cases for opendir() and fdopendir(). * Drop O_NONBLOCK from opendir(); it was added a long time ago to avoid blocking if given a closed named pipe, but now we use O_DIRECTORY, which ensures that we get ENOTDIR in that case. * While here, remove unused #includes left over from the split. Sponsored by: Klara, Inc. Reviewed by: kevans, markj Differential Revision: https://reviews.freebsd.org/D51126 --- lib/libc/gen/fdopendir.c | 7 +- lib/libc/gen/opendir.c | 7 -- lib/libc/gen/opendir2.c | 6 +- lib/libc/tests/gen/Makefile | 1 + lib/libc/tests/gen/opendir_test.c | 144 ++++++++++++++++++++++++++++++++++++++ 5 files changed, 151 insertions(+), 14 deletions(-) diff --git a/lib/libc/gen/fdopendir.c b/lib/libc/gen/fdopendir.c index 67c0766b6d83..df6709fbcb85 100644 --- a/lib/libc/gen/fdopendir.c +++ b/lib/libc/gen/fdopendir.c @@ -30,14 +30,13 @@ */ #include "namespace.h" -#include +#include +#include #include #include #include -#include -#include -#include +#include #include "un-namespace.h" #include "gen-private.h" diff --git a/lib/libc/gen/opendir.c b/lib/libc/gen/opendir.c index 956c92c321e8..08d9eb10eaa2 100644 --- a/lib/libc/gen/opendir.c +++ b/lib/libc/gen/opendir.c @@ -30,14 +30,7 @@ */ #include "namespace.h" -#include - #include -#include -#include -#include -#include -#include #include "un-namespace.h" #include "gen-private.h" diff --git a/lib/libc/gen/opendir2.c b/lib/libc/gen/opendir2.c index b9ac23e6d9fd..928145b468c1 100644 --- a/lib/libc/gen/opendir2.c +++ b/lib/libc/gen/opendir2.c @@ -30,11 +30,12 @@ */ #include "namespace.h" -#include +#include #include #include #include +#include #include #include #include @@ -52,8 +53,7 @@ __opendir2(const char *name, int flags) if ((flags & (__DTF_READALL | __DTF_SKIPREAD)) != 0) return (NULL); - if ((fd = _open(name, - O_RDONLY | O_NONBLOCK | O_DIRECTORY | O_CLOEXEC)) == -1) + if ((fd = _open(name, O_DIRECTORY | O_RDONLY | O_CLOEXEC)) == -1) return (NULL); dir = __opendir_common(fd, flags, false); diff --git a/lib/libc/tests/gen/Makefile b/lib/libc/tests/gen/Makefile index a967ad5ddf91..8c2151105209 100644 --- a/lib/libc/tests/gen/Makefile +++ b/lib/libc/tests/gen/Makefile @@ -20,6 +20,7 @@ ATF_TESTS_C+= glob2_test ATF_TESTS_C+= glob_blocks_test .endif ATF_TESTS_C+= makecontext_test +ATF_TESTS_C+= opendir_test ATF_TESTS_C+= popen_test ATF_TESTS_C+= posix_spawn_test ATF_TESTS_C+= realpath2_test diff --git a/lib/libc/tests/gen/opendir_test.c b/lib/libc/tests/gen/opendir_test.c new file mode 100644 index 000000000000..89be2becc607 --- /dev/null +++ b/lib/libc/tests/gen/opendir_test.c @@ -0,0 +1,144 @@ +/*- + * Copyright (c) 2025 Klara, Inc. + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#include + +#include +#include +#include +#include +#include + +#include + +/* + * Create a directory with a single subdirectory. + */ +static void +opendir_prepare(const struct atf_tc *tc) +{ + ATF_REQUIRE_EQ(0, mkdir("dir", 0755)); + ATF_REQUIRE_EQ(0, mkdir("dir/subdir", 0755)); +} + +/* + * Assuming dirp represents the directory created by opendir_prepare(), + * verify that readdir() returns what we expected to see there. + */ +static void +opendir_check(const struct atf_tc *tc, DIR *dirp) +{ + struct dirent *ent; + + ATF_REQUIRE((ent = readdir(dirp)) != NULL); + ATF_CHECK_EQ(1, ent->d_namlen); + ATF_CHECK_STREQ(".", ent->d_name); + ATF_CHECK_EQ(DT_DIR, ent->d_type); + ATF_REQUIRE((ent = readdir(dirp)) != NULL); + ATF_CHECK_EQ(2, ent->d_namlen); + ATF_CHECK_STREQ("..", ent->d_name); + ATF_CHECK_EQ(DT_DIR, ent->d_type); + ATF_REQUIRE((ent = readdir(dirp)) != NULL); + ATF_CHECK_EQ(sizeof("subdir") - 1, ent->d_namlen); + ATF_CHECK_STREQ("subdir", ent->d_name); + ATF_CHECK_EQ(DT_DIR, ent->d_type); + ATF_CHECK(readdir(dirp) == NULL); +} + +ATF_TC(opendir_ok); +ATF_TC_HEAD(opendir_ok, tc) +{ + atf_tc_set_md_var(tc, "descr", "Open a directory."); +} +ATF_TC_BODY(opendir_ok, tc) +{ + DIR *dirp; + + opendir_prepare(tc); + ATF_REQUIRE((dirp = opendir("dir")) != NULL); + opendir_check(tc, dirp); + ATF_CHECK_EQ(0, closedir(dirp)); +} + +ATF_TC(opendir_fifo); +ATF_TC_HEAD(opendir_fifo, tc) +{ + atf_tc_set_md_var(tc, "descr", "Do not hang if given a named pipe."); +} +ATF_TC_BODY(opendir_fifo, tc) +{ + DIR *dirp; + int fd; + + ATF_REQUIRE((fd = mkfifo("fifo", 0644)) >= 0); + ATF_REQUIRE_EQ(0, close(fd)); + ATF_REQUIRE((dirp = opendir("fifo")) == NULL); + ATF_CHECK_EQ(ENOTDIR, errno); +} + +ATF_TC(fdopendir_ok); +ATF_TC_HEAD(fdopendir_ok, tc) +{ + atf_tc_set_md_var(tc, "descr", + "Open a directory from a directory descriptor."); +} +ATF_TC_BODY(fdopendir_ok, tc) +{ + DIR *dirp; + int dd; + + opendir_prepare(tc); + ATF_REQUIRE((dd = open("dir", O_DIRECTORY | O_RDONLY)) >= 0); + ATF_REQUIRE((dirp = fdopendir(dd)) != NULL); + opendir_check(tc, dirp); + ATF_CHECK_EQ(dd, fdclosedir(dirp)); + ATF_CHECK_EQ(0, close(dd)); +} + +ATF_TC(fdopendir_ebadf); +ATF_TC_HEAD(fdopendir_ebadf, tc) +{ + atf_tc_set_md_var(tc, "descr", + "Open a directory from an invalid descriptor."); +} +ATF_TC_BODY(fdopendir_ebadf, tc) +{ + DIR *dirp; + int dd; + + ATF_REQUIRE_EQ(0, mkdir("dir", 0755)); + ATF_REQUIRE((dd = open("dir", O_DIRECTORY | O_RDONLY)) >= 0); + ATF_CHECK_EQ(0, close(dd)); + ATF_REQUIRE((dirp = fdopendir(dd)) == NULL); + ATF_CHECK_EQ(EBADF, errno); +} + +ATF_TC(fdopendir_enotdir); +ATF_TC_HEAD(fdopendir_enotdir, tc) +{ + atf_tc_set_md_var(tc, "descr", + "Open a directory from a non-directory descriptor."); +} +ATF_TC_BODY(fdopendir_enotdir, tc) +{ + DIR *dirp; + int fd; + + ATF_REQUIRE((fd = open("file", O_CREAT | O_RDWR, 0644)) >= 0); + ATF_REQUIRE((dirp = fdopendir(fd)) == NULL); + ATF_CHECK_EQ(ENOTDIR, errno); + ATF_CHECK_EQ(0, close(fd)); +} + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, opendir_ok); + ATF_TP_ADD_TC(tp, fdopendir_ok); + ATF_TP_ADD_TC(tp, fdopendir_ebadf); + ATF_TP_ADD_TC(tp, fdopendir_enotdir); + ATF_TP_ADD_TC(tp, opendir_fifo); + return (atf_no_error()); +} From nobody Tue Jul 8 21:22:40 2025 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 4bcDbN5rNxz60YC9; Tue, 08 Jul 2025 21:22:40 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcDbN3Dcbz43KJ; Tue, 08 Jul 2025 21:22:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752009760; 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=yLv37XZG3uBxfHmCyWoCbww+NghSQvtwX8M60x5huGg=; b=aMJ7vTHGSmws0gjOBvaagf+yVaARzpBtlbsbF3NjYmkZGTdEk5rswx9Cb7QRmBm7uZJvwb UmT0FfO/0QBwK1hYkcNCzlCGT6sw4PxAXWZoM2j9uJ8mLs8oNH/l5n3nG93QWFcc6csY6B Gn8B69y8YkfEXtXFBhN6K668000ijiv7nacploaGdpEnMv96NgXP9w48/mrqCYqExrbfcs g/uvLPgf0XZC2CrONHJhyKJ0gRUZJStSLehUOP+yc9ONtnsOhhSEdGd29dLbM8CBtLlckb UXcBy6XXHxBKXSBHJjloDPbUfl++9XDCCX0itgWvnxjhgjqlFKm6iRFEfonKWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752009760; 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=yLv37XZG3uBxfHmCyWoCbww+NghSQvtwX8M60x5huGg=; b=NeUDKbR3J05Xh9Ztw5B8LycvC1KU2qYDB52DI8cAWj/Pvl1t5zG/FmlsXai8h34LxPlC7d 2R3dn1+pF6tm8/LVGToo1CE+/4yGS3tACgDvK7VPdL1T+JLdApij/eGxazpmk00kshfT4S FA+84m+sXHVQT5YxtxJtSxtrYokag28WRayVfyfzCe5G1TWPeId7QddhIWPJLZKjNlsG/K WRaJh0X+DK06dVuZC/RMFc7IWVuWwNV8YccAF2y9zTvljR82M8rajs6MGKyXBj6FZRNAcM //FEtC10vkfTTDznCeRLQoocR/LWWKVkVNrUeIkpM6WEoGK8Z2N9Zp2iSlVjfg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752009760; a=rsa-sha256; cv=none; b=EWoTB236CsQm16cTTUF0dD2Xd7Txr+8uBY0AdEDAB0SGomtj/tNeHMxe3WPFsVnoOKuzfD rvemrNu1uhCOwC0j4rHSDQSIGuKhLsD1uADcFuGoO7/vQPQy7q2l6fE1E88m/ZVxN7cF3h /fMvMR5Q/fWPSTAhUnH8XCGUvpBhcd5zObGrhj7MYn0ulbJJAociPLohcGRwhZhq0BUXYk 9ie43ZOOkMiyB7IJWPuW67KcwanSKQrkAyniyWEkGygDfVz9BPGhfEWYsjxJdJKEPxdnhM 71AhkdYJDmfJ/H/ps3vV2UIE+SRy3S5b6BS7L1vCZuhKs+k5xWTPhER22ohIlw== 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 4bcDbN2Zc4ztb8; Tue, 08 Jul 2025 21:22:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 568LMeaO046441; Tue, 8 Jul 2025 21:22:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 568LMe2Z046438; Tue, 8 Jul 2025 21:22:40 GMT (envelope-from git) Date: Tue, 8 Jul 2025 21:22:40 GMT Message-Id: <202507082122.568LMe2Z046438@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: 4b472968f8ee - main - devd.conf.5: Consistently use Li to markup literal strings 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 4b472968f8ee9efcf58d70e45da923d3bb77bcee Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=4b472968f8ee9efcf58d70e45da923d3bb77bcee commit 4b472968f8ee9efcf58d70e45da923d3bb77bcee Author: John Baldwin AuthorDate: 2025-07-08 21:22:07 +0000 Commit: John Baldwin CommitDate: 2025-07-08 21:22:07 +0000 devd.conf.5: Consistently use Li to markup literal strings This doesn't affect terminal output but does affect the fonts used in other formats such as postscript and HTML. Sponsored by: Chelsio Communications --- sbin/devd/devd.conf.5 | 54 +++++++++++++++++++++++++-------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/sbin/devd/devd.conf.5 b/sbin/devd/devd.conf.5 index adeeec7fd611..44667858ed13 100644 --- a/sbin/devd/devd.conf.5 +++ b/sbin/devd/devd.conf.5 @@ -38,7 +38,7 @@ .\" ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS .\" SOFTWARE. .\" -.Dd April 29, 2025 +.Dd July 8, 2025 .Dt DEVD.CONF 5 .Os .Sh NAME @@ -372,14 +372,14 @@ Command timeouts. Events related to the .Xr carp 4 protocol. -.It CARP Ta Ar vhid@inet Ta Ta +.It Li CARP Ta Ar vhid@inet Ta Ta The .Dq subsystem contains the actual CARP vhid and the name of the network interface on which the event took place. -.It CARP Ta Ar vhid@inet Ta MASTER Ta +.It Li CARP Ta Ar vhid@inet Ta Li MASTER Ta Node become the master for a virtual host. -.It CARP Ta Ar vhid@inet Ta BACKUP Ta +.It Li CARP Ta Ar vhid@inet Ta Li BACKUP Ta Node become the backup for a virtual host. .El .Pp @@ -520,25 +520,25 @@ Power has been applied to the AC power line. .It Li PMU Ta Li "AC" Ta Li unplugged Ta Power has been removed from the AC power line. .It Li PMU Ta Li Battery Ta Ta -.It Li PMU Ta Li Battery Ta absent Ta +.It Li PMU Ta Li Battery Ta Li absent Ta Battery is no longer absent. -.It Li PMU Ta Li Battery Ta charged Ta +.It Li PMU Ta Li Battery Ta Li charged Ta The battery has become charged. -.It Li PMU Ta Li Battery Ta charging Ta +.It Li PMU Ta Li Battery Ta Li charging Ta The battery has started charging. -.It Li PMU Ta Li Battery Ta disconnected Ta +.It Li PMU Ta Li Battery Ta Li disconnected Ta The battery has been disconnected. -.It Li PMU Ta Li Battery Ta high-temp Ta +.It Li PMU Ta Li Battery Ta Li high-temp Ta The battery reported a temperature over the limit. -.It Li PMU Ta Li Battery Ta low-temp Ta +.It Li PMU Ta Li Battery Ta Li low-temp Ta The battery reported a temperature under the limit. -.It Li PMU Ta Li Battery Ta plugged Ta +.It Li PMU Ta Li Battery Ta Li plugged Ta The battery has become plugged (eg connected). -.It Li PMU Ta Li Battery Ta shutdown-threshold Ta +.It Li PMU Ta Li Battery Ta Li shutdown-threshold Ta The power in the battery has fallen below the shutdown threshold. -.It Li PMU Ta Li Battery Ta warning-threshold Ta +.It Li PMU Ta Li Battery Ta Li warning-threshold Ta The power in the battery has fallen below the warn the user threshold. -.It Li PMU Ta Li Button Ta pressed Ta +.It Li PMU Ta Li Button Ta Li pressed Ta A button on a .Xr adb 4 or @@ -548,35 +548,35 @@ has been pressed. One of the keys on the .Xr adb 4 keyboard has been pressed. -.It Li PMU Ta Li keys Ta brightness Ta +.It Li PMU Ta Li keys Ta Li brightness Ta A brightness level change has been requested. Direction is in the $notify variable. -.It Li PMU Ta Li keys Ta mute Ta +.It Li PMU Ta Li keys Ta Li mute Ta The mute key -.It Li PMU Ta Li keys Ta volume Ta +.It Li PMU Ta Li keys Ta Li volume Ta A volume level change has been requested. Direction is in the $notify variable. -.It Li PMU Ta Li keys Ta eject Ta +.It Li PMU Ta Li keys Ta Li eject Ta An ejection has been requested. -.It Li PMU Ta Li lid Ta close Ta +.It Li PMU Ta Li lid Ta Li close Ta The .Xr pmc 4 device has detected the lid closing. -.It Li PMU Ta Li lid Ta open Ta +.It Li PMU Ta Li lid Ta Li open Ta The .Xr pmc 4 device has detected the lid openinging. -.It Li PMU Ta Li POWER Ta ACLINE Ta +.It Li PMU Ta Li POWER Ta Li ACLINE Ta The .Xr pmc 4 device has detected an AC line state ($notify=0x00 is offline, 0x01 is online). -.It Li PMU Ta Li USB Ta overvoltage Ta +.It Li PMU Ta Li USB Ta Li overvoltage Ta An over-voltage condition on the power lines for the USB power pins. -.It Li PMU Ta Li USB Ta plugged Ta +.It Li PMU Ta Li USB Ta Li plugged Ta A device has been plugged into a USB device. -.It Li PMU Ta Li USB Ta undervoltage Ta +.It Li PMU Ta Li USB Ta Li undervoltage Ta An under-voltage condition on the power lines for the USB power pins. -.It Li PMU Ta Li USB Ta unplugged Ta +.It Li PMU Ta Li USB Ta Li unplugged Ta A device has been unplugged into a USB device. .El .Pp @@ -620,7 +620,7 @@ Notification of a filesystem being unmounted. .Pp .Bl -column "System" "Subsystem" "1234567" -compact .Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" -.It Li VT Ta BELL Ta RING Ta +.It Li VT Ta Li BELL Ta Li RING Ta Notification that the console bell has rung. See .Xr vt 4 @@ -629,7 +629,7 @@ for details. .Pp .Bl -column "System" "Subsystem" "1234567" -compact .Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" -.It Li ZFS Ta ZFS Ta Ta +.It Li ZFS Ta Li ZFS Ta Ta Events about the ZFS subsystem. See .Xr zfsd 8 From nobody Tue Jul 8 21:22:41 2025 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 4bcDbQ0Mxnz60Y4g; Tue, 08 Jul 2025 21:22:42 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcDbP3wDwz43BC; Tue, 08 Jul 2025 21:22:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752009761; 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=J8F4Ql1y+ZYQQ5y0U65jtQper6rvULEV9mAsaACyndM=; b=GVZQt0rjPN74B3jpmo/ll7Hz90//aySUrxsEAWPgzWeEUwSr91s5kLSJkYaRGrW0isjOHE Uyy4biGO6hsFACwil8cOcLqIg6/Fs2I25hexgKvZMmUmDD2SJiPuv/mQS3GRpsIALOnFH9 5orPj9CIur2V2nVBe9gNuUCBmiefzduiGO/EgxpaF2LM0lFHUNUzTI5+bVdh6F3JYiQfV0 MwRv7NfX2lqUK/L6riEg8MLqrCKSNELh5ZH9lMCCYIbnxWb+zATtBbeczA+ocWkNBMjnyD rQr3IzRXTd0G+QaMNa43+oCw1O55rwHpqczh3jtcepSuWXcMh160cc16ZXht2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752009761; 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=J8F4Ql1y+ZYQQ5y0U65jtQper6rvULEV9mAsaACyndM=; b=hK95ob7NWyx0LIGOFPEkWrVFaqXj6vNjP1eZqQmaZRo6l/y3dQcmB+u7loy0VCFU5fSF5S NjDWk1Xq57+5RHqHs+BQ6oLcc3AKOiVRJ5jxJQUraqaQgrK9O58LA9DDiPlwm/e2vaXSkg xVeT3o4qSHBspPMUiFvYNylO/HqbOXs7paL6+uoj7DrYQpO7nDnQR68AEPvMbR8PTK6oJ9 l6RfOj4yOIR+vt+Ue9LW5S7LiTaJHuoLdfuZAytXoSXSOxKlf77PgyKLRQbOP9cqEfqjpH kKn+Hj7ktVXwoOXgwhI/D64zEGbIWtnsKVV//6KjUr4u/OK3b/2q+GrstmVW6A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752009761; a=rsa-sha256; cv=none; b=bSnmR4LJacsbgqoInx6Ipz1TadPEZHhn9laV/37ojxI5O3nwzJuPKhr3etTQI7Tsi+Z/tf ipxGuaL6Er93fIpnTe303MWdPAwg5slUvcTitGBysnAFQoT0sToPuWKAtrc1dOATJGyTVd IwTWSZXGsmUGxi5PLKbkj72k2bDnWWEhTW/NJxd4wAMZoW5wkihxJzu7TF9uVW3GZ3y7An TyeT9A0puEcaP2dbXHccdsYmIs8bP9x0aq/1s0KP/tXilLjBMVGVx+Z3V/8QF0uT/Z/qsi NyLl8jLnYgJ/6gNJhlWphgn1i5zcPn5ePTzbQiNRabFQNvu6bUX48b5iaItGSw== 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 4bcDbP3V3tztt3; Tue, 08 Jul 2025 21:22:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 568LMfr1046475; Tue, 8 Jul 2025 21:22:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 568LMfus046472; Tue, 8 Jul 2025 21:22:41 GMT (envelope-from git) Date: Tue, 8 Jul 2025 21:22:41 GMT Message-Id: <202507082122.568LMfus046472@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: b00d9fa1dd7c - main - devd.conf.5: Expand the width of various columns 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: b00d9fa1dd7cc3d8022388f667d4b53f4d5e263c Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=b00d9fa1dd7cc3d8022388f667d4b53f4d5e263c commit b00d9fa1dd7cc3d8022388f667d4b53f4d5e263c Author: John Baldwin AuthorDate: 2025-07-08 21:22:16 +0000 Commit: John Baldwin CommitDate: 2025-07-08 21:22:16 +0000 devd.conf.5: Expand the width of various columns Using upper case for column width templates avoids overfull columns when using groff to generate a postscript version of the manpage but doesn't affect the terminal version. Use a wider default column (8 characters) for the "Type" column and use wider widths for tables with longer event types. In the terminal, man(1) forces a line break after overfull column items, but in the postscript and HTML versions the column just overflows into the adjacent column without any separation. Sponsored by: Chelsio Communications --- sbin/devd/devd.conf.5 | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/sbin/devd/devd.conf.5 b/sbin/devd/devd.conf.5 index 44667858ed13..188bd90d1c9f 100644 --- a/sbin/devd/devd.conf.5 +++ b/sbin/devd/devd.conf.5 @@ -322,7 +322,7 @@ mechanism. .\" for each of the tables so that things line up in columns nicely. .\" Please do not omit the type column for notifiers that omit it. .Pp -.Bl -column "System" "Subsystem" "1234567" -compact +.Bl -column "SYSTEM" "SUBSYSTEM" "12345678" -compact .Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" .It Li ACPI Ta Ta Ta Events related to the ACPI Subsystem. @@ -346,13 +346,13 @@ Suspend notification. Thermal zone events. .El .Pp -.Bl -column "System" "Subsystem" "1234567" -compact +.Bl -column "SYSTEM" "SUBSYSTEM" "12345678" -compact .Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" .It Li AEON Ta Li power Ta Li press Ta The power button on an Amiga has been pressed. .El .Pp -.Bl -column "System" "Subsystem" "1234567" -compact +.Bl -column "SYSTEM" "SUBSYSTEM" "12345678" -compact .Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" .It Li CAM Ta Ta Ta Events related to the @@ -366,7 +366,7 @@ Generic errors. Command timeouts. .El .Pp -.Bl -column "System" "Subsystem" "1234567" -compact +.Bl -column "SYSTEM" "SUBSYSTEM" "12345678" -compact .Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" .It Li CARP Ta Ta Ta Events related to the @@ -383,7 +383,7 @@ Node become the master for a virtual host. Node become the backup for a virtual host. .El .Pp -.Bl -column "System" "Subsystem" "1234567" -compact +.Bl -column "CORETEMP" "SUBSYSTEM" "TEMPERATURE" -compact .Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" .It Li coretemp Ta Ta Ta Events related to the @@ -395,7 +395,7 @@ Notification that the CPU core has reached critical temperature. String containing the temperature of the core that has become too hot. .El .Pp -.Bl -column "System" "Subsystem" "1234567" -compact +.Bl -column "SYSTEM" "SUBSYSTEM" "12345678" -compact .Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" .It Li DEVFS .It Li DEVFS Ta Li CDEV Ta Li CREATE Ta @@ -408,7 +408,7 @@ The node is destroyed. .El .Pp -.Bl -column "System" "Subsystem" "1234567" -compact +.Bl -column "SYSTEM" "SUBSYSTEM" "12345678" -compact .Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" .It Li ETHERNET Ta Ar inet Ta IFATTACH Ta Notification when the default VNET instance of the @@ -416,7 +416,7 @@ Notification when the default VNET instance of the interface is attached. .El .Pp -.Bl -column "System" "Subsystem" "1234567" -compact +.Bl -column "SYSTEM" "SUBSYSTEM" "GEOM::ROTATION_RATE" -compact .Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" .It Li GEOM Ta Ta Ta Events related to the @@ -447,7 +447,7 @@ A provider size has changed. .El .Pp -.Bl -column "System" "Subsystem" "1234567" -compact +.Bl -column "SYSTEM" "SUBSYSTEM" "LINK_DOWN" -compact .Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" .It Li IFNET .It Li IFNET Ta Em inet Ta Ta @@ -471,7 +471,7 @@ The network interface address added. The network interface address removed. .El .Pp -.Bl -column "System" "Subsystem" "1234567" -compact +.Bl -column "SYSTEM" "SUBSYSTEM" "12345678" -compact .Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" .It Li kernel Ta Li signal Ta Li coredump Ta Notification that a process has crashed and dumped core. @@ -479,7 +479,7 @@ Notification that a process has crashed and dumped core. Notification that the system has woken from the suspended state. .El .Pp -.Bl -column "System" "Subsystem" "1234567" -compact +.Bl -column "SYSTEM" "SUBSYSTEM" "SMART_ERROR" -compact .Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" .It Li nvme Ta Li controller Ta Li SMART_ERROR Ta A SMART Critical Warning State change has happened. @@ -507,7 +507,7 @@ controller reset, and a timeout while waiting for the controller to reset respectively. .El .Pp -.Bl -column "System" "Subsystem" "1234567" -compact +.Bl -column "SYSTEM" "SUBSYSTEM" "SHUTDOWN-THRESHOLD" -compact .Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" .It Li PMU Ta Ta Ta Notification of events from various types of Power Management Units. @@ -580,7 +580,7 @@ An under-voltage condition on the power lines for the USB power pins. A device has been unplugged into a USB device. .El .Pp -.Bl -column "System" "Subsystem" "1234567" -compact +.Bl -column "SYSTEM" "SUBSYSTEM" "12345678" -compact .Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" .It Li RCTL Ta Ta Ta Events related to the @@ -590,7 +590,7 @@ framework. A rule with action specified as "devctl" was triggered. .El .Pp -.Bl -column "System" "Subsystem" "1234567" -compact +.Bl -column "SYSTEM" "SUBSYSTEM" "12345678" -compact .Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" .It Li USB Ta Ta Ta Events related to the USB subsystem. @@ -604,7 +604,7 @@ USB interface is attached to a device. USB interface is detached from a device. .El .Pp -.Bl -column "System" "Subsystem" "1234567" -compact +.Bl -column "SYSTEM" "SUBSYSTEM" "12345678" -compact .Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" .It Li VFS Ta Ta Ta Events from the vfs system. @@ -618,7 +618,7 @@ Notification of a filesystem is remounted (whether or not the options actually c Notification of a filesystem being unmounted. .El .Pp -.Bl -column "System" "Subsystem" "1234567" -compact +.Bl -column "SYSTEM" "SUBSYSTEM" "12345678" -compact .Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" .It Li VT Ta Li BELL Ta Li RING Ta Notification that the console bell has rung. @@ -627,7 +627,7 @@ See for details. .El .Pp -.Bl -column "System" "Subsystem" "1234567" -compact +.Bl -column "SYSTEM" "SUBSYSTEM" "12345678" -compact .Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" .It Li ZFS Ta Li ZFS Ta Ta Events about the ZFS subsystem. From nobody Tue Jul 8 21:22:42 2025 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 4bcDbR1fljz60YZG; Tue, 08 Jul 2025 21:22:43 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcDbQ4S3Nz43H7; Tue, 08 Jul 2025 21:22:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752009762; 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=S+gQWIveYESWVxaVjPhSK7aTRQXze0K41M9WN6HqsGs=; b=Nom3dIrVMVEd5E777q1s92GvIIzkw+LCJ0piPacsQMAH0o82DH5Cm58tXeFCIPLfWjRxRE qtjk11eZj615fnG9gEm1tu9gs4kvz7f8Ju4Vxih0vjS6qWZM0SzNP9GErXyBPavop1oOvB BafuUOBBMF5oKOgwhYZJOKsaQB+wUwpjl0+aLSwxv41m9mHUM84IEl74CQZCAtSShD6uLG o30sVaTroYIIZnxObvUJ32g4Fppwi1+znX4joFx7UFwThuo+DoHPKyQhLvxMxVutYUmgp+ zLec/8/Q9EWJfe+inz5lMytbOWHIvxhg7WDnEq3K6yI+ERNBvcnTQ7zub5lZSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752009762; 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=S+gQWIveYESWVxaVjPhSK7aTRQXze0K41M9WN6HqsGs=; b=nX8FZLznIF7/e6qIy53O4/8XAJ2E22sLNShFvRuiP8MaFX3guWWsB8NeeM/E1F9pYiUq17 9L5ca29HNSRm3TfBEbG35zCfrm6tU6I+w8uZWy4HaIvqLGSD/fyBaaOnFiEXO9csfTyxTd a3hzD/I8FUFZxcr7hLWpHcF0UGLfYOHgU4T064ODW7t7P7DE7Lnu9YsOWGTAQva6Ak9V3O uVrRFPfrvhY1NMm7ng+pufnW/3Mh+JIBrMGEP5qDgxGyZcKpbC9BTkifYcPfOiroLMHVQD w+ML08Nz2PGBX+6Qdl8+ilFiLAQ/z+dt/cHg/3OInA/tW+KFXrOzbNyc4yXteg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752009762; a=rsa-sha256; cv=none; b=C0M+1o0+mANYs5kTV0PERGz3nEdQ2FlVKW4FnuL8R53ATP+sl73RQ6EHW3kJzdu2cy0y7E OhjsjaE/Cwouq7aXveoWlzHssCzzqy6k+lH+z/x1ikS/uhKX0rQtcPl82ULFC7hBj3/tX7 MnC7aygkjFQSJcz6a3fnoW1C/Q1v1b661B7txcDq+uJgTHez4S1anTNuhs8Iih0ICPCAJ/ EfKqv3I1Rbv7gNrl4yJcEuJ442H9aLC0K28FT46leUAq14u6Bi1zqll4LVBfwqrEJRgfoK hrsOqwai6zttkZGyz54SDA0cGBYbTY6pTWg4xq9zOP1462d6pmP6t6JH9DN24A== 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 4bcDbQ40rLztYZ; Tue, 08 Jul 2025 21:22:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 568LMgxj046516; Tue, 8 Jul 2025 21:22:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 568LMgWG046513; Tue, 8 Jul 2025 21:22:42 GMT (envelope-from git) Date: Tue, 8 Jul 2025 21:22:42 GMT Message-Id: <202507082122.568LMgWG046513@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: 6aca71321b95 - main - devd.conf.5: Describe $name used with nvme events 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 6aca71321b9541c44d007d3f1a9d42e1b77736d5 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=6aca71321b9541c44d007d3f1a9d42e1b77736d5 commit 6aca71321b9541c44d007d3f1a9d42e1b77736d5 Author: John Baldwin AuthorDate: 2025-07-08 21:22:23 +0000 Commit: John Baldwin CommitDate: 2025-07-08 21:22:23 +0000 devd.conf.5: Describe $name used with nvme events While here, fix a couple of nearby nits. Sponsored by: Chelsio Communications --- sbin/devd/devd.conf.5 | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sbin/devd/devd.conf.5 b/sbin/devd/devd.conf.5 index 188bd90d1c9f..f038efc5fdd6 100644 --- a/sbin/devd/devd.conf.5 +++ b/sbin/devd/devd.conf.5 @@ -481,11 +481,16 @@ Notification that the system has woken from the suspended state. .Pp .Bl -column "SYSTEM" "SUBSYSTEM" "SMART_ERROR" -compact .Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" +.It Li nvme Ta Li controller Ta Ta +Controller events provide the controller name +.Pq for example, Li nvme0 +in $name. .It Li nvme Ta Li controller Ta Li SMART_ERROR Ta A SMART Critical Warning State change has happened. $state has a hex bitmask of the bits that changed, as defined in the NVMe Standard for Critical Warning field of log page 2 .Dq SMART / Health Information Log : +.Pp .Bl -column "Bit Value" "Meaning" -compact .Sy "Bit Value" Ta Sy "Meaning" .It 0x1 Ta Spare capacity below threshold @@ -503,7 +508,7 @@ $event is one of and .Dq timed_out representing the start of a controller reset, the successful completion of a -controller reset, and a timeout while waiting for the controller to reset +controller reset, or a timeout while waiting for the controller to reset, respectively. .El .Pp @@ -577,7 +582,7 @@ A device has been plugged into a USB device. .It Li PMU Ta Li USB Ta Li undervoltage Ta An under-voltage condition on the power lines for the USB power pins. .It Li PMU Ta Li USB Ta Li unplugged Ta -A device has been unplugged into a USB device. +A device has been unplugged from a USB device. .El .Pp .Bl -column "SYSTEM" "SUBSYSTEM" "12345678" -compact From nobody Tue Jul 8 21:22:43 2025 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 4bcDbS0Xf0z60YZP; Tue, 08 Jul 2025 21:22:44 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcDbR5L71z43Dt; Tue, 08 Jul 2025 21:22:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752009763; 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=YbEEPF2PeiaZkCnkQqC5nOqxLZ0Gqxh45qOoz2ejcmc=; b=qx531BmuNlUeZCu2cdt9+/zRcPdwzC/oBnJ0i8waTTwvF+Ydh241Humq1fLs406sTbZWYE e6wWYqGr4hoMvKBTSnEDBL8C+xzb7ngFkvC3e+SP9qVFQzw9hGqUAiwfGntbbWfo/B89rw foRwgGUo2oL4eb4IwKk5J2W2S85I0pFm1nfKVk77HGAj/nsGoQq4WXnWKCVHr0IhDjjqho zr0kFYmurEFs3xCKiJ5ENgQnWkxxmdNhS2EBHZ///R6XmGr/7Mm7nBQqplUPxyneNSdm4o mAWX1li/U3V8P90AJ5aX/SdcyrQRDnwZDXkhS9A496dAh+SOKPUvkcx1P+Exew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752009763; 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=YbEEPF2PeiaZkCnkQqC5nOqxLZ0Gqxh45qOoz2ejcmc=; b=yWohYpu3g/zJQSlhcWbe48I5EnyzUiCymf2HsUH2NNf4msu7vNgfNWjmUxpoZKn6fSbe/C BKU9qoBOhx+osnkEozQeK55IRLSlh4x7QBAQYOtBde1zamKOFQ9/uz6gg8Zn+Zl9mullvy la6N3VbuDQx4hBBJi/XIFrmt58hEpVfRi1pMJr1h+cBoSY9y/92NITbKxgIPqZlk+6wG2j 5LradpCEExSwZZynFioPhiLq4wyFVkuJmWa+tQe1aCgX/NiJSxIGHywHKtzAzZNKp1lg7C 0o/vQM6UGY2d48dnP23+7ATt3wszMvkBxhFtJpB9ze6iHSUvw+J+peBHp03wYg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752009763; a=rsa-sha256; cv=none; b=YD6E9D0CidKl5YMC2X0vwOubeYi2pNNUY9GigmO+foGrd4rwF8wzrFnfDXPubg5+pnjoCb KJ1uWx+7R5A05Yw4lklKZ99e0ua7nQnBcVJUYOi1afdboJWebijElH3w1soe4cJgFUF4UH ToXNaJGX9q+2MLcBdKY6guA+s8cIpmhVS4tw6bFFXtyKno8q2rkZqtr6PUxter0dpWOrDQ Jx30htr3isRNNKNAaAAnr6XsqCc8aAsD3vAXtgQreA4fFElF2Xp3vDRrkdQ76r/m0QkadK nLxqlOgGjT9MAADXTnJUQku01YUaOKKIX5FlcAHDvAh42I1EPTRfSGvretZjMA== 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 4bcDbR4xmhztsT; Tue, 08 Jul 2025 21:22:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 568LMhG9046549; Tue, 8 Jul 2025 21:22:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 568LMhPM046546; Tue, 8 Jul 2025 21:22:43 GMT (envelope-from git) Date: Tue, 8 Jul 2025 21:22:43 GMT Message-Id: <202507082122.568LMhPM046546@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: 9ad1589c7334 - main - devd.conf.5: Use a tag list block for NVMe SMART errors 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 9ad1589c733434e695f1a0954d428725a5339893 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=9ad1589c733434e695f1a0954d428725a5339893 commit 9ad1589c733434e695f1a0954d428725a5339893 Author: John Baldwin AuthorDate: 2025-07-08 21:22:30 +0000 Commit: John Baldwin CommitDate: 2025-07-08 21:22:30 +0000 devd.conf.5: Use a tag list block for NVMe SMART errors groff doesn't seem to handle nested column list blocks correctly for postscript and HTML output causing the subsequent nvme event to be indented incorrectly. Using a tag list block works around this. Sponsored by: Chelsio Communications --- sbin/devd/devd.conf.5 | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/sbin/devd/devd.conf.5 b/sbin/devd/devd.conf.5 index f038efc5fdd6..4dbd7338edb1 100644 --- a/sbin/devd/devd.conf.5 +++ b/sbin/devd/devd.conf.5 @@ -491,14 +491,21 @@ $state has a hex bitmask of the bits that changed, as defined in the NVMe Standard for Critical Warning field of log page 2 .Dq SMART / Health Information Log : .Pp -.Bl -column "Bit Value" "Meaning" -compact -.Sy "Bit Value" Ta Sy "Meaning" -.It 0x1 Ta Spare capacity below threshold -.It 0x2 Ta Temperature outside acceptable range -.It 0x4 Ta Reliability of media degraded -.It 0x8 Ta Media placed into read-only mode -.It 0x10 Ta Volatime memory backup failure -.It 0x20 Ta Persistent memory read-only or degraded +.Bl -tag -width "Bit Value" -compact +.It Sy "Bit Value" +.Sy Meaning +.It 0x1 +Spare capacity below threshold +.It 0x2 +Temperature outside acceptable range +.It 0x4 +Reliability of media degraded +.It 0x8 +Media placed into read-only mode +.It 0x10 +Volatime memory backup failure +.It 0x20 +Persistent memory read-only or degraded .El .It Li nvme Ta Li controller Ta Li RESET Ta A controller reset event has happened. From nobody Tue Jul 8 21:39:22 2025 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 4bcDyg3ZYzz60ZVt; Tue, 08 Jul 2025 21:39:23 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcDyg0ZkXz3GYc; Tue, 08 Jul 2025 21:39:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752010763; 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=6xBwA9FzQm702+Ld2EvaKENmyyCiopsxWpeP4QGudNQ=; b=J7U16WYvQWvGkrrrmuCs6QNK76sukNwUDTay9aMemCWnEHa6QS3r7h0kdpkwQmXj4eJy47 LEuM1uBP0vWF0d+r5KZGW2YyyQhVluA8QQCCi+B95zaiGKRPJG9D8N4ue4Y/v+miMA31p6 +QmIAcHsNXiVyPSMNpNgb5aCe1hdHv08TgshPT/iFcu1b4kC7JXTRGOGCVY0SJgzU3vR0X 8CaEZb2c83qUw2NmtiN82y/poQSZhjheJjdvcdq4SZdqoEcEE/7cncKGf8HbybSosPCYeR 1P+Q9aQHTF7RXOdHHavJDYi/zqZwMgibDJ0UNnIrBI7jC/VI0K/u/zNZLcAXHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752010763; 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=6xBwA9FzQm702+Ld2EvaKENmyyCiopsxWpeP4QGudNQ=; b=Ot/7XLx3WAjBJRSF+kSNmMM31U/0R4/ceyr/fA4RLpAgV5tbnDAlTqW/B8TZEg3sEbM4zR wLDj7S31ag45JXURQWEMZH2rX9b+5tjsRvy0RfLpEXTdpEg++/kKgQcr8qBpVNvhZM1ZXb p8hfnuK9tZS2zesuYkvLnruaOzW1GsnEUO02ahMmPKvMP8n4e4vzm5mDgZ37bWm8gZ0GGe dqUG0nBBuB+0ltyj0e1ZfSTnNP3HTzVGeZkMtoKKNkqAUZrdmiOoAuVDXLNLpa8rsVah22 Z18sMBCwxBKCwb732pUiWtq7zX8q8SmC9JSNLpTeRZ/lH2975BdhpNajB/BGDg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752010763; a=rsa-sha256; cv=none; b=PrdnGaT4k5YJK2gQXhukLDsO7VW9J9b+XxyvoulUQFADEzOFp7j7AofdSd62aLxf+8kKAP WJmdPCJPUDZQOcaOsB/oyhX2Nsybqih26YN4NKa+g6c6NvZipmxaBPOSGU40dwUhgnyRby 2uBe42MW28KjvDOUEZM2zB2hAv2t3uv5KNgHG7LOcB8Jcy4H9Q0BYMswPNn7KTXb0EhnH4 hCI7HkFCM6Mku+3c3SaYUueatuAII1GYZV/dgLhuGN8xuVdXwlFmDVGi0yzC/raRNpSvFK Uic7t9iL62G52UFJLjQFmEaCPlRfLopZV17sq5BDh0565/pBMIpy0VhK+z4agA== 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 4bcDyf70f2zv43; Tue, 08 Jul 2025 21:39:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 568LdMhr067625; Tue, 8 Jul 2025 21:39:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 568LdMaW067622; Tue, 8 Jul 2025 21:39:22 GMT (envelope-from git) Date: Tue, 8 Jul 2025 21:39:22 GMT Message-Id: <202507082139.568LdMaW067622@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jilles Tjoelker Subject: git: da9e73e5d483 - main - wordexp(3): Handle ECHILD from waitpid 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jilles X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: da9e73e5d483c47e67b3094356dd4b640749849e Auto-Submitted: auto-generated The branch main has been updated by jilles: URL: https://cgit.FreeBSD.org/src/commit/?id=da9e73e5d483c47e67b3094356dd4b640749849e commit da9e73e5d483c47e67b3094356dd4b640749849e Author: Kenny Levinsen AuthorDate: 2025-04-21 12:13:43 +0000 Commit: Jilles Tjoelker CommitDate: 2025-07-08 21:27:33 +0000 wordexp(3): Handle ECHILD from waitpid If the calling process has used SIG_IGN as handler or set the SA_NOCLDWAIT flag for SIGCHLD, processes will be automatically reaped on exit and calls to waitpid(3) will therefore fail with ECHILD. We waitpid primarily to reap our child so that the caller does not have to worry about it. ECHILD indicates that there is no child to reap, so we can just treat that as a success and move on. Signed-off-by: Kenny Levinsen Tested by: Jan Beich Pull Request: https://github.com/freebsd/freebsd-src/pull/1675 --- lib/libc/gen/wordexp.c | 10 +++++++++- lib/libc/tests/gen/wordexp_test.c | 26 ++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/lib/libc/gen/wordexp.c b/lib/libc/gen/wordexp.c index f1437e30bbe2..f8080c20d121 100644 --- a/lib/libc/gen/wordexp.c +++ b/lib/libc/gen/wordexp.c @@ -265,7 +265,15 @@ cleanup: errno = serrno; return (error); } - if (wpid < 0 || !WIFEXITED(status) || WEXITSTATUS(status) != 0) + /* + * Check process exit status, but ignore ECHILD as the child may have + * been automatically reaped if the process had set SIG_IGN or + * SA_NOCLDWAIT for SIGCHLD, and our reason for waitpid was just to + * reap our own child on behalf of the calling process. + */ + if (wpid < 0 && errno != ECHILD) + return (WRDE_NOSPACE); /* abort for unknown reason */ + if (wpid >= 0 && (!WIFEXITED(status) || WEXITSTATUS(status) != 0)) return (WRDE_NOSPACE); /* abort for unknown reason */ /* diff --git a/lib/libc/tests/gen/wordexp_test.c b/lib/libc/tests/gen/wordexp_test.c index 909097fbf51e..a8b9d5509633 100644 --- a/lib/libc/tests/gen/wordexp_test.c +++ b/lib/libc/tests/gen/wordexp_test.c @@ -292,6 +292,31 @@ ATF_TC_BODY(with_SIGCHILD_handler_test, tc) ATF_REQUIRE(r == 0); } +ATF_TC_WITHOUT_HEAD(with_SIGCHILD_ignore_test); +ATF_TC_BODY(with_SIGCHILD_ignore_test, tc) +{ + struct sigaction sa; + wordexp_t we; + int r; + + /* With SIGCHLD set to ignore so that the kernel auto-reaps zombies. */ + sa.sa_flags = 0; + sigemptyset(&sa.sa_mask); + sa.sa_handler = SIG_IGN; + r = sigaction(SIGCHLD, &sa, NULL); + ATF_REQUIRE(r == 0); + r = wordexp("hello world", &we, 0); + ATF_REQUIRE(r == 0); + ATF_REQUIRE(we.we_wordc == 2); + ATF_REQUIRE(strcmp(we.we_wordv[0], "hello") == 0); + ATF_REQUIRE(strcmp(we.we_wordv[1], "world") == 0); + ATF_REQUIRE(we.we_wordv[2] == NULL); + wordfree(&we); + sa.sa_handler = SIG_DFL; + r = sigaction(SIGCHLD, &sa, NULL); + ATF_REQUIRE(r == 0); +} + ATF_TC_WITHOUT_HEAD(with_unused_non_default_IFS_test); ATF_TC_BODY(with_unused_non_default_IFS_test, tc) { @@ -350,6 +375,7 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, WRDE_BADCHAR_test); ATF_TP_ADD_TC(tp, WRDE_SYNTAX_test); ATF_TP_ADD_TC(tp, with_SIGCHILD_handler_test); + ATF_TP_ADD_TC(tp, with_SIGCHILD_ignore_test); ATF_TP_ADD_TC(tp, with_unused_non_default_IFS_test); ATF_TP_ADD_TC(tp, with_used_non_default_IFS_test); From nobody Tue Jul 8 21:49:16 2025 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 4bcFB508Jbz60b4C; Tue, 08 Jul 2025 21:49:17 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcFB45BPjz3NPq; Tue, 08 Jul 2025 21:49:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752011356; 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=PxCV7V/6L2UPK55Yw229tC+Iw4euDybcdPu6YlTz5y8=; b=U/pfvdkRI32C7I8ULD5JcfRsN2h7YhIyct1VDuv7E/nXrWETbLiJpKw1isC9xeIzB4fz6h OYkUucJ7V7MkC9uoB6x4byIDkUgJc7EqJOE3P/60QMlMfFGTyy4AaMgg/3pI+g4LxYDcR9 SAB1MuEHi758w5jIOfiwQAnp44n6IzgQdGKcJvxrBrfhOs1u9ydeoRtwInQgFDIdGj3XPJ 0SpzsjJ7zwgwGSbEXUjNY1cjwXPgRAk529+jq7BF+KNsxgeftT9pRedlltpGYD2/fiqt65 BufpkHVAvT1Z6JES8mrFHriJUolkTKfnoizQbVNnE+Qcg01Ol2j3Qu0ef0MFug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752011356; 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=PxCV7V/6L2UPK55Yw229tC+Iw4euDybcdPu6YlTz5y8=; b=CL7hozZ0vxTgqqGVbZQ+TX8HsZAF6m+yFg3wxacz3TdY6l3eQr9eGCOwt+JgYMvTb3P6+h 7skgsuPEkuJIKsCzfxurC/3FCpg+LWFAs+XDDcfNruKZmf6eohCCvw4+lKNMlbiZno2MX6 d/smWKJU+X2KYYIVNlpDSSuurIAS5WbTCtJu7pUxWSITO7PMkk2g3FWcDy1/5XutKDxt5+ vmlF8dZ4em5WucAJc7C9j9HMG6XoPsNP06Nmr4pTaGwl5T947SvoweW0wkj8qWQ9OLELJD R294S+uIobz3QT2Y+AqJ/yoBHqmn5imu378A9P0mCdQ5dG0LNGCfZLGaiW2Vwg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752011356; a=rsa-sha256; cv=none; b=ndZEV8t66bhJIed2LH412NQhP+NAdkcRg4SBQ845VKImiNrGejk+hShlhpmYM9wrFxmBEs eqmP1hhjvCMXBcxF3/drlOLt2zxBs3bvNUGAhF5PhuLvHFYQJ3PD59hbplwXBwMWi2x4Ae 6xCG9xdRrYZd4OCv0PVpXJsXGlGWSmNGucpzN3dk2Vdus8SgQVFdRtnggY9s+Y3xRGZCuJ f9sWowoM2SQ9h19YRvBr3UJQNs9+V8U6qnWObTTVNgSnRQzSC4MXCLyWmZi6IfwRCoF6Ay XHRVum0RWAAm72yLO3cHuxV9ikNw5oLxdh1jScfxU++P1Y4OkFbOfLDib5OuFg== 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 4bcFB44cLczvBj; Tue, 08 Jul 2025 21:49:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 568LnGvu086306; Tue, 8 Jul 2025 21:49:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 568LnGOU086303; Tue, 8 Jul 2025 21:49:16 GMT (envelope-from git) Date: Tue, 8 Jul 2025 21:49:16 GMT Message-Id: <202507082149.568LnGOU086303@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: ba0d9b43e940 - main - kern_descrip.c: provide helpers to translate between fd flags namespace 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ba0d9b43e940077f4025e7e4e85d16c8d525db79 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=ba0d9b43e940077f4025e7e4e85d16c8d525db79 commit ba0d9b43e940077f4025e7e4e85d16c8d525db79 Author: Konstantin Belousov AuthorDate: 2025-07-08 16:30:29 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-08 21:48:59 +0000 kern_descrip.c: provide helpers to translate between fd flags namespace Reviewed by: markj Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D51206 --- sys/kern/kern_descrip.c | 110 +++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 90 insertions(+), 20 deletions(-) diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index 406236fc2723..2e1da2fdee29 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -480,6 +480,90 @@ kern_fcntl_freebsd(struct thread *td, int fd, int cmd, intptr_t arg) return (error); } +struct flags_trans_elem { + u_int f; + u_int t; +}; + +static u_int +flags_trans(const struct flags_trans_elem *ftes, int nitems, u_int from_flags) +{ + u_int res; + int i; + + res = 0; + for (i = 0; i < nitems; i++) { + if ((from_flags & ftes[i].f) != 0) + res |= ftes[i].t; + } + return (res); +} + +static uint8_t +fd_to_fde_flags(int fd_flags) +{ + static const struct flags_trans_elem fd_to_fde_flags_s[] = { + { .f = FD_CLOEXEC, .t = UF_EXCLOSE }, + { .f = FD_CLOFORK, .t = UF_FOCLOSE }, + { .f = FD_RESOLVE_BENEATH, .t = UF_RESOLVE_BENEATH }, + }; + + return (flags_trans(fd_to_fde_flags_s, nitems(fd_to_fde_flags_s), + fd_flags)); +} + +static int +fde_to_fd_flags(uint8_t fde_flags) +{ + static const struct flags_trans_elem fde_to_fd_flags_s[] = { + { .f = UF_EXCLOSE, .t = FD_CLOEXEC }, + { .f = UF_FOCLOSE, .t = FD_CLOFORK }, + { .f = UF_RESOLVE_BENEATH, .t = FD_RESOLVE_BENEATH }, + }; + + return (flags_trans(fde_to_fd_flags_s, nitems(fde_to_fd_flags_s), + fde_flags)); +} + +static uint8_t +fddup_to_fde_flags(int fddup_flags) +{ + static const struct flags_trans_elem fddup_to_fde_flags_s[] = { + { .f = FDDUP_FLAG_CLOEXEC, .t = UF_EXCLOSE }, + { .f = FDDUP_FLAG_CLOFORK, .t = UF_FOCLOSE }, + }; + + return (flags_trans(fddup_to_fde_flags_s, nitems(fddup_to_fde_flags_s), + fddup_flags)); +} + +static uint8_t +close_range_to_fde_flags(int close_range_flags) +{ + static const struct flags_trans_elem close_range_to_fde_flags_s[] = { + { .f = CLOSE_RANGE_CLOEXEC, .t = UF_EXCLOSE }, + { .f = CLOSE_RANGE_CLOFORK, .t = UF_FOCLOSE }, + }; + + return (flags_trans(close_range_to_fde_flags_s, + nitems(close_range_to_fde_flags_s), close_range_flags)); +} + +static uint8_t +open_to_fde_flags(int open_flags, bool sticky_orb) +{ + static const struct flags_trans_elem open_to_fde_flags_s[] = { + { .f = O_CLOEXEC, .t = UF_EXCLOSE }, + { .f = O_CLOFORK, .t = UF_FOCLOSE }, + { .f = O_RESOLVE_BENEATH, .t = UF_RESOLVE_BENEATH }, + }; + _Static_assert(open_to_fde_flags_s[nitems(open_to_fde_flags_s) - 1].f == + O_RESOLVE_BENEATH, "O_RESOLVE_BENEATH must be last, for sticky_orb"); + + return (flags_trans(open_to_fde_flags_s, nitems(open_to_fde_flags_s) - + (sticky_orb ? 0 : 1), open_flags)); +} + int kern_fcntl(struct thread *td, int fd, int cmd, intptr_t arg) { @@ -534,11 +618,7 @@ kern_fcntl(struct thread *td, int fd, int cmd, intptr_t arg) FILEDESC_SLOCK(fdp); fde = fdeget_noref(fdp, fd); if (fde != NULL) { - td->td_retval[0] = - ((fde->fde_flags & UF_EXCLOSE) ? FD_CLOEXEC : 0) | - ((fde->fde_flags & UF_FOCLOSE) ? FD_CLOFORK : 0) | - ((fde->fde_flags & UF_RESOLVE_BENEATH) ? - FD_RESOLVE_BENEATH : 0); + td->td_retval[0] = fde_to_fd_flags(fde->fde_flags); error = 0; } FILEDESC_SUNLOCK(fdp); @@ -553,10 +633,7 @@ kern_fcntl(struct thread *td, int fd, int cmd, intptr_t arg) * UF_RESOLVE_BENEATH is sticky and cannot be cleared. */ fde->fde_flags = (fde->fde_flags & ~UF_EXCLOSE) | - ((arg & FD_CLOEXEC) != 0 ? UF_EXCLOSE : 0) | - ((arg & FD_CLOFORK) != 0 ? UF_FOCLOSE : 0) | - ((arg & FD_RESOLVE_BENEATH) != 0 ? - UF_RESOLVE_BENEATH : 0); + fd_to_fde_flags(arg); error = 0; } FILEDESC_XUNLOCK(fdp); @@ -991,10 +1068,7 @@ kern_dup(struct thread *td, u_int mode, int flags, int old, int new) goto unlock; if (mode == FDDUP_FIXED && old == new) { td->td_retval[0] = new; - if ((flags & FDDUP_FLAG_CLOEXEC) != 0) - fdp->fd_ofiles[new].fde_flags |= UF_EXCLOSE; - if ((flags & FDDUP_FLAG_CLOFORK) != 0) - fdp->fd_ofiles[new].fde_flags |= UF_FOCLOSE; + fdp->fd_ofiles[new].fde_flags |= fddup_to_fde_flags(flags); error = 0; goto unlock; } @@ -1070,8 +1144,7 @@ kern_dup(struct thread *td, u_int mode, int flags, int old, int new) filecaps_copy_finish(&oldfde->fde_caps, &newfde->fde_caps, nioctls); newfde->fde_flags = (oldfde->fde_flags & ~(UF_EXCLOSE | UF_FOCLOSE)) | - ((flags & FDDUP_FLAG_CLOEXEC) != 0 ? UF_EXCLOSE : 0) | - ((flags & FDDUP_FLAG_CLOFORK) != 0 ? UF_FOCLOSE : 0); + fddup_to_fde_flags(flags); #ifdef CAPABILITIES seqc_write_end(&newfde->fde_seqc); #endif @@ -1444,8 +1517,7 @@ close_range_flags(struct thread *td, u_int lowfd, u_int highfd, int flags) struct filedescent *fde; int fd, fde_flags; - fde_flags = ((flags & CLOSE_RANGE_CLOEXEC) != 0 ? UF_EXCLOSE : 0) | - ((flags & CLOSE_RANGE_CLOFORK) != 0 ? UF_FOCLOSE : 0); + fde_flags = close_range_to_fde_flags(flags); fdp = td->td_proc->p_fd; FILEDESC_XLOCK(fdp); fdt = atomic_load_ptr(&fdp->fd_files); @@ -2194,9 +2266,7 @@ _finstall(struct filedesc *fdp, struct file *fp, int fd, int flags, seqc_write_begin(&fde->fde_seqc); #endif fde->fde_file = fp; - fde->fde_flags = ((flags & O_CLOEXEC) != 0 ? UF_EXCLOSE : 0) | - ((flags & O_CLOFORK) != 0 ? UF_FOCLOSE : 0) | - ((flags & O_RESOLVE_BENEATH) != 0 ? UF_RESOLVE_BENEATH : 0); + fde->fde_flags = open_to_fde_flags(flags, true); if (fcaps != NULL) filecaps_move(fcaps, &fde->fde_caps); else From nobody Tue Jul 8 23:04:47 2025 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 4bcGsC6JVDz60hH0; Tue, 08 Jul 2025 23:04:47 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcGsC5MGjz49Lf; Tue, 08 Jul 2025 23:04:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752015887; 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=Fn9u3oyJAi59g1fwTTP3fXWgjEbuYAyvGIw1DAqUJZo=; b=jJ7xDhG2ObQwBhNtYh8Lu/jx/1ilRoFQ1pZ2L18s+y65ONe0zDGCddxWbSFD5A1TYxPdMY f+C0NdbG+zj2ObKPp2XHR9YeQau12Y+Nju4vZA2oXo0uv/I/By2eugV/3t9vQUBNm6mNsa sQD7lWKSY+sa+ot/j/fb5nPFkk3CZSrGFO+M8O2wNaph/hri5L54bcIarN2C4rcQfTfa7y 9T3jTaFjezZZ+eF9q+uZEFjiHlz9OGPo6HGfeW69yRUme9auk0J/3CkTA0EIO1KiRyVTOq QdUnvq7IhWSriVNlbQWp5xUyGVjrC0/6q0pIHisLghgLW2+wlwXRYSt6LcUtGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752015887; 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=Fn9u3oyJAi59g1fwTTP3fXWgjEbuYAyvGIw1DAqUJZo=; b=Dt4GcOw7dgTg+TSH4V4OY0sdaAlwTqfk/il6U3PUP6RZVuppJG2rv5kd7/bmYDRea9CuU9 OLSEEHbxcOP6fdpHp0kQB+Sx6w/Ki0VsOKKo85RAYU/o5h+UkLIQiq77P3DLf7JhDoL2xR NAcE4qk5JP/UYXw/3nbYwzU7PilJH13QSNUsjkVx1whDXRMnLQuvPc/j8q0/SC2xNA7h0R LmphPxsR6I/gvIXu81DUotLySyY7/EkNDEEwJ6KTyvSJFbjZqKlGW8mBAPBjNefvU+6UnF 7trKU8i0KFaL7XjD6+e4HuwbJcdNknqXWWPsFoUxs3p+4NbQSlS0H6XU799EGQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752015887; a=rsa-sha256; cv=none; b=Uwof5j44ldHu7Uo/AfOd08vyIfDpXAaAVVkDwvF96OmPCYbCqNH8pXdt1det1f7eVK9GvN owIPTmxxkkLxByno+Qvz4LEt0TVdPsLxaMUr9Hu2KZ2Ci2iQrE8ZLVbId7N444bfMuPwvb GnYMcPY2AqIVPlopIUF2G2CMGRGsRog/3lghE7moRu+xsUXWsjwYehZJBJuyZnlph8f6v9 IG4W2bdTDb+heCl9V3kjg3X3DdD0cWvTL4mfGouozzjOGhB9hNUsz4UGPi0GlsbLGVu9ku N7msnKzAxEC+xwkz5T7fVwdR4I+FZYeHpUKV5Xe3cSUWWqHJ37THot8gKBdARA== 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 4bcGsC3t8szx8l; Tue, 08 Jul 2025 23:04:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 568N4ldq035556; Tue, 8 Jul 2025 23:04:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 568N4lii035553; Tue, 8 Jul 2025 23:04:47 GMT (envelope-from git) Date: Tue, 8 Jul 2025 23:04:47 GMT Message-Id: <202507082304.568N4lii035553@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 0849d876b1ac - main - cam/mmc: style(9) pass: put { starting functions on its own line 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0849d876b1ac414e55643e408464be63bc9b1a71 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=0849d876b1ac414e55643e408464be63bc9b1a71 commit 0849d876b1ac414e55643e408464be63bc9b1a71 Author: Warner Losh AuthorDate: 2025-07-08 16:01:56 +0000 Commit: Warner Losh CommitDate: 2025-07-08 22:52:04 +0000 cam/mmc: style(9) pass: put { starting functions on its own line Sponsored by: Netflix --- sys/cam/mmc/mmc_da.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/sys/cam/mmc/mmc_da.c b/sys/cam/mmc/mmc_da.c index 3815561898bd..f7c478076144 100644 --- a/sys/cam/mmc/mmc_da.c +++ b/sys/cam/mmc/mmc_da.c @@ -789,7 +789,8 @@ sddaregister(struct cam_periph *periph, void *arg) static int mmc_exec_app_cmd(struct cam_periph *periph, union ccb *ccb, - struct mmc_command *cmd) { + struct mmc_command *cmd) +{ int err; /* Send APP_CMD first */ @@ -843,7 +844,8 @@ mmc_exec_app_cmd(struct cam_periph *periph, union ccb *ccb, } static int -mmc_app_get_scr(struct cam_periph *periph, union ccb *ccb, uint32_t *rawscr) { +mmc_app_get_scr(struct cam_periph *periph, union ccb *ccb, uint32_t *rawscr) +{ int err; struct mmc_command cmd; struct mmc_data d; @@ -869,7 +871,8 @@ mmc_app_get_scr(struct cam_periph *periph, union ccb *ccb, uint32_t *rawscr) { static int mmc_send_ext_csd(struct cam_periph *periph, union ccb *ccb, - uint8_t *rawextcsd, size_t buf_len) { + uint8_t *rawextcsd, size_t buf_len) +{ int err; struct mmc_data d; @@ -966,14 +969,16 @@ mmc_switch(struct cam_periph *periph, union ccb *ccb, } static uint32_t -mmc_get_spec_vers(struct cam_periph *periph) { +mmc_get_spec_vers(struct cam_periph *periph) +{ struct sdda_softc *softc = (struct sdda_softc *)periph->softc; return (softc->csd.spec_vers); } static uint64_t -mmc_get_media_size(struct cam_periph *periph) { +mmc_get_media_size(struct cam_periph *periph) +{ struct sdda_softc *softc = (struct sdda_softc *)periph->softc; return (softc->mediasize); @@ -992,7 +997,8 @@ mmc_get_cmd6_timeout(struct cam_periph *periph) static int mmc_sd_switch(struct cam_periph *periph, union ccb *ccb, uint8_t mode, uint8_t grp, uint8_t value, - uint8_t *res) { + uint8_t *res) +{ struct mmc_data mmc_d; uint32_t arg; int err; @@ -1069,7 +1075,8 @@ mmc_set_timing(struct cam_periph *periph, } static void -sdda_start_init_task(void *context, int pending) { +sdda_start_init_task(void *context, int pending) +{ union ccb *new_ccb; struct cam_periph *periph; @@ -1088,7 +1095,8 @@ sdda_start_init_task(void *context, int pending) { } static void -sdda_set_bus_width(struct cam_periph *periph, union ccb *ccb, int width) { +sdda_set_bus_width(struct cam_periph *periph, union ccb *ccb, int width) +{ struct sdda_softc *softc = (struct sdda_softc *)periph->softc; struct mmc_params *mmcp = &periph->path->device->mmc_ident_data; int err; From nobody Wed Jul 9 00:38:54 2025 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 4bcJxr00Jxz60nqw; Wed, 09 Jul 2025 00:38:56 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcJxp6m5Vz4BNQ; Wed, 09 Jul 2025 00:38:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752021535; 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=SoYjbedoTMd3VQYjG+RBil7n6u7wXO4cIQvEXx1wCOk=; b=T+vtKBglvCgJbfghHYjTTeS81w3ZCezOlXLlwnFiKrlBqfh2yP98eGJU7aqsgw8Xd/fc7H KWtEmir6FG85PqYDYvsXhvEh3oiMfdXx5wMBzuaQ4i6LUxAtlKTduBJ/axgEutklN/Hlwi DLvmEuESDm0M+ZmcU1rzniDV1uMtETRmPhL0A1fZ34acWtte374L3t/R1mszEHTTH+JwgV UDAJozl41X7bG8ZLYSWSu+Ydr9TolK/KJC/3nzntir2oOQACGwPS78PWE7E8qxLrlTwvzG FeCgZROClIyWN09F5YgJun52j5DeQwkIwsNMjuPYqhjkr6oF3zE9+yIsfglrCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752021535; 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=SoYjbedoTMd3VQYjG+RBil7n6u7wXO4cIQvEXx1wCOk=; b=tGfIe7PhboaBv3QAZpJxQZIpYiOpiKChtQXcQi+8nZHow+ZmoFMcc3H7vpGWW3SRaYeNMe kFjB4sqvWxuogWKjylyaLsVBHUFFxmTDqdh6QBHwz8i+m7w6MhU2ch3sioa9t0ZPajX0JB mT1A2cX0BAkUkmpxSV09zh96OFL9KDAuXQBFLAZ9Vpqbdf6mo0Oh4KI6AEz6hD0XWdl2Ww b1QDBdO549nyB9KSb+WHDUcfaeMmwq/LP+zyncUEUzbpu/YDZiKNVPqmlrbf8SzsyVyylr RfUIP/6YZFZM4aF7JZl6d8l5yrDw7TuVB5J7U/6p6/QFI5ycUBpkpvSl1nwQ0g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752021535; a=rsa-sha256; cv=none; b=QxDbL7udCoDaaO13Xp5QAng7hLu7MJVQJ/CVmQuVa10il0zQVpN9tZNIcjW2X9NpF6oYmy qPZKe329XBDcSVggBY4fGR23ay2b9Zcv51fDVbpSRuCKso5DTr5YjU2iFs2fLLfnZyuDc2 uj2h0Vc9iVJhaQmR6XF0QEy2RYvwAgrSBSzf6OZJSipJKX13jsFGUhN1ePttbEV6nbHDDu oIRjHb5IVlPO9XpyiSr55GvzG0X2bGSqoYYIaAJ31MsnTCJbrI/WgnIEFSFKyOusDoEuBD Ee2eVSlsL0OzfhdqZSV+bbH7WaqC/eaWcaPzU8bUQyHbOO03jxv1JuatY5/BJA== 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 4bcJxp6MLMz108b; Wed, 09 Jul 2025 00:38:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5690cs4o004439; Wed, 9 Jul 2025 00:38:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5690cssx004436; Wed, 9 Jul 2025 00:38:54 GMT (envelope-from git) Date: Wed, 9 Jul 2025 00:38:54 GMT Message-Id: <202507090038.5690cssx004436@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 6750c124c71c - stable/14 - md: Restore guards in mddestroy() 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 6750c124c71c83eb6c4a6a349572ec24d7668441 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=6750c124c71c83eb6c4a6a349572ec24d7668441 commit 6750c124c71c83eb6c4a6a349572ec24d7668441 Author: Mark Johnston AuthorDate: 2025-07-03 13:10:49 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-09 00:28:29 +0000 md: Restore guards in mddestroy() (cherry picked from commit 5ae9f8e9ac5e1307fed4f7f2549347576f01b3fa) --- sys/dev/md/md.c | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/sys/dev/md/md.c b/sys/dev/md/md.c index e89c5e858c32..95926706443b 100644 --- a/sys/dev/md/md.c +++ b/sys/dev/md/md.c @@ -1561,19 +1561,26 @@ mddestroy(struct md_s *sc, struct thread *td) mtx_destroy(&sc->queue_mtx); switch (sc->type) { case MD_VNODE: - vn_lock(sc->s_vnode.vnode, LK_EXCLUSIVE | LK_RETRY); - sc->s_vnode.vnode->v_vflag &= ~VV_MD; - VOP_UNLOCK(sc->s_vnode.vnode); - (void)vn_close(sc->s_vnode.vnode, sc->flags & MD_READONLY ? - FREAD : (FREAD|FWRITE), sc->cred, td); - kva_free(sc->s_vnode.kva, maxphys + PAGE_SIZE); + if (sc->s_vnode.vnode != NULL) { + vn_lock(sc->s_vnode.vnode, LK_EXCLUSIVE | LK_RETRY); + sc->s_vnode.vnode->v_vflag &= ~VV_MD; + VOP_UNLOCK(sc->s_vnode.vnode); + (void)vn_close(sc->s_vnode.vnode, + sc->flags & MD_READONLY ? FREAD : (FREAD|FWRITE), + sc->cred, td); + } + if (sc->s_vnode.kva != 0) + kva_free(sc->s_vnode.kva, maxphys + PAGE_SIZE); break; case MD_SWAP: - vm_object_deallocate(sc->s_swap.object); + if (sc->s_swap.object != NULL) + vm_object_deallocate(sc->s_swap.object); break; case MD_MALLOC: - destroy_indir(sc, sc->s_malloc.indir); - uma_zdestroy(sc->s_malloc.uma); + if (sc->s_malloc.indir != NULL) + destroy_indir(sc, sc->s_malloc.indir); + if (sc->s_malloc.uma != NULL) + uma_zdestroy(sc->s_malloc.uma); break; case MD_PRELOAD: case MD_NULL: From nobody Wed Jul 9 00:44:39 2025 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 4bcK4S10dwz60pBS; Wed, 09 Jul 2025 00:44:40 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcK4R6fjvz4HgW; Wed, 09 Jul 2025 00:44:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752021879; 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=Walp1zkXqIBxmFggRDwJwLG40aYhE8iLFhMf9I1nP2k=; b=rOuA+AaGstOPUIupNhE9wv7a3HATbMAxFvo/zVq796xq/KoZDLmszCBTIQ9cPDtAAv/69u +H9DdQxylj1QOXrO80AuKfVeyzWiboARfuU5aiH09enAuNYUlpbBBVsMG2FosX7DOzCBDp kx60WBeDwfKLXiTx12b62/zCK3ZSzJNL4dWDMK3tIQvfRivi7qlgZ7CmrA6uvXOE6MGtFC iwiSa0/N5AGHreGOIIVOAEs3UeY3HKa7O7LDyIfe0b0sVX4ICk6OrEkX5Y1l62n7BIuI1s zG0yuOrxWplrerch9Klv+DK2O56x6fsfYcobVs+RWeBZPk5oeeZkn9zUttWk1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752021879; 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=Walp1zkXqIBxmFggRDwJwLG40aYhE8iLFhMf9I1nP2k=; b=fT/wIFVkkFLWZyaQqnw/d34sa55IqELf4+dt4TuI/pd6CAc34e8yVgRaNgrOxftx0XCxCJ mfGCWSIoPam9ZcVI2q9bu0d8BubrCe2xq+T1IBgRZk+GnLahODc/1HYVVC0YN05/dz5MTh pajWp+izk0vD14uJS7UobhZwrZLja3wp6iC4tL1qBFj9cmzmJxcSpYdAhehZwoOQD+ocNd H+A4M3BFpdav9OfgNuOaDhChyUAfBwbNpQC3l++KlLUL+ne9kyuF4O6M1WGavK6ns/0NWP JwssQ4zLFoPBFBwKq044g+syv0kPBLs+V9khv9Cokv7SN+awzVmgsORqqDZ7lg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752021879; a=rsa-sha256; cv=none; b=l66GlOk12vECXMGQow9DHWX6rDmIAZ5VdBvsXEpkHDUWDnLAVgTjRh1KuBHBFRnZd5ulJ2 K3ZS4gfkyyLLvP8TXmnXMvcY5xQzBbJbFMvlgkSzj425CMs6CxKkeKTGPQcAVr0EkLDoxU jBloD3wiute04FZQG3awSSwmm+Akj0SXo9sTqIGpnikLfVZ9dd7J6XRNuCkKdYPfpgWVnQ ycu6q0SxLkS0q5t40Olw979DGKZb9G7ryIZF/W5+LP+z3CLPMbdcUPH/UNvCisD5Zdo/qL /g+B/xgdw63i+ME9eBMzXg3BkMuhkTwgqFOotgutpFoKZaQwNzPX/0NmrgxV0Q== 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 4bcK4R68JMz10fl; Wed, 09 Jul 2025 00:44:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5690id9L022505; Wed, 9 Jul 2025 00:44:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5690idNo022502; Wed, 9 Jul 2025 00:44:39 GMT (envelope-from git) Date: Wed, 9 Jul 2025 00:44:39 GMT Message-Id: <202507090044.5690idNo022502@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: d162d59c393d - stable/14 - localedef: Use consistent sorting order 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: d162d59c393dacdcd6867e5ed7af2edc5cc0cddf Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=d162d59c393dacdcd6867e5ed7af2edc5cc0cddf commit d162d59c393dacdcd6867e5ed7af2edc5cc0cddf Author: Mark Johnston AuthorDate: 2025-06-20 16:10:37 +0000 Commit: Mark Johnston CommitDate: 2025-07-09 00:42:52 +0000 localedef: Use consistent sorting order In several modules we build up an RB tree keyed by wide characters. wchar_t has different signedness on different platforms, so iteration over such a tree results in platform-dependent ordering. The ctype module uses this ordering when writing the output file, which creates reproducibility problems when comparing the results of cross builds and native builds (e.g., native amd64 vs. cross-building on arm64). Modify such comparisons to always be unsigned. Introduce a helper function for this purpose. In the other modules I believe the sort order does not affect program output. On systems with signed wchar_t, of the files in /usr/share/locale this only affects zh_CN.GB18030/LC_CTYPE. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D50756 (cherry picked from commit 770fba248daff6cc72ce0bfbd1f2a941c90dc99a) --- usr.bin/localedef/charmap.c | 2 +- usr.bin/localedef/collate.c | 2 +- usr.bin/localedef/ctype.c | 2 +- usr.bin/localedef/localedef.h | 15 +++++++++++++++ 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/usr.bin/localedef/charmap.c b/usr.bin/localedef/charmap.c index 1da4d8921ecb..a36d4ccd174e 100644 --- a/usr.bin/localedef/charmap.c +++ b/usr.bin/localedef/charmap.c @@ -236,7 +236,7 @@ cmap_compare_wc(const void *n1, const void *n2) const charmap_t *c1 = n1; const charmap_t *c2 = n2; - return ((c1->wc < c2->wc) ? -1 : (c1->wc > c2->wc) ? 1 : 0); + return (wchar_cmp(c1->wc, c2->wc)); } void diff --git a/usr.bin/localedef/collate.c b/usr.bin/localedef/collate.c index da3f26b4d0ba..39f1ba250be6 100644 --- a/usr.bin/localedef/collate.c +++ b/usr.bin/localedef/collate.c @@ -422,7 +422,7 @@ collchar_compare(const void *n1, const void *n2) wchar_t k1 = ((const collchar_t *)n1)->wc; wchar_t k2 = ((const collchar_t *)n2)->wc; - return (k1 < k2 ? -1 : k1 > k2 ? 1 : 0); + return (wchar_cmp(k1, k2)); } RB_GENERATE_STATIC(collchars, collchar, entry, collchar_compare); diff --git a/usr.bin/localedef/ctype.c b/usr.bin/localedef/ctype.c index ab7b76e57b2d..f86a267b0b32 100644 --- a/usr.bin/localedef/ctype.c +++ b/usr.bin/localedef/ctype.c @@ -93,7 +93,7 @@ ctype_compare(const void *n1, const void *n2) const ctype_node_t *c1 = n1; const ctype_node_t *c2 = n2; - return (c1->wc < c2->wc ? -1 : c1->wc > c2->wc ? 1 : 0); + return (wchar_cmp(c1->wc, c2->wc)); } void diff --git a/usr.bin/localedef/localedef.h b/usr.bin/localedef/localedef.h index 4b141ac8dc09..25e75eab8a7b 100644 --- a/usr.bin/localedef/localedef.h +++ b/usr.bin/localedef/localedef.h @@ -38,6 +38,7 @@ #include #include #include +#include extern int com_char; extern int esc_char; @@ -173,5 +174,19 @@ void werr(const char *, ...); const char *get_wide_encoding(void); int max_wide(void); +/* + * A helper function to compare wide characters when sorting. Forcibly cast to + * an unsigned type to help ensure that output is consistent no matter the + * signedness of wchar_t. + */ +static inline int +wchar_cmp(const wchar_t a, const wchar_t b) +{ + return ((uint32_t)a < (uint32_t)b ? -1 : + ((uint32_t)a > (uint32_t)b ? 1 : 0)); +} +_Static_assert(sizeof(wchar_t) == sizeof(uint32_t), + "wchar_t must be 32 bits wide"); + //#define _(x) gettext(x) #define INTERR fprintf(stderr,"internal fault (%s:%d)\n", __FILE__, __LINE__) From nobody Wed Jul 9 00:44:40 2025 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 4bcK4T1S3Vz60pJD; Wed, 09 Jul 2025 00:44:41 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcK4T04M1z4HPk; Wed, 09 Jul 2025 00:44:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752021881; 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=2qbPTZOSCiuFPxwSuN2vsr1rBAWwPgbXVR5SLL+Ba8I=; b=Ej/NfdF6Tt1eXKOdzHbHdHze993focwWkAedQATDQYff0wT7Pf/MSQYPiEbDZbrinLmOt1 wBSkppw+8r8lzEnm80EAK5/qy8dxUBRsPezDYC4vFHCRcNwPDY8fvEBWStbiZ0IB86yEU/ vewEkJUHY62sYjxmq8DWCjkq5RNPf/5H6pZSevQsTf5CZaYNlPn/40sF9FRLoTBVhcNcvs Yt1ZmwjLGmvwaLtoq0QOj5k/gckT7bvlHs5MtAfnJnNnVNkYFV433UagmHxat8cJ0rv2RV 0eWKEFm0LFFhMYk+67fHxkEQrz3vS3NiviPgZq/J+VepgwiVdcRyaGD55e6YZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752021881; 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=2qbPTZOSCiuFPxwSuN2vsr1rBAWwPgbXVR5SLL+Ba8I=; b=H1fyfY6gf4GAC44vsTMM+AspfrI8jNDJGgUEOAB+pkXItrJf5I4ys/v7n5wCQIomRXKZEK YJeCx2290IPqkdbrJPdRJZi+1o8743gmsxSoZpPWlx6A7TuyNbxMr99qo+PJfyyyUP7Nu/ 3Juq+7sAauE9624luwrnR5HzZi2QdLIsJdZ9K8hs569DU1DMKQkV8R+ZHvQ/ci/eRpLl7f lffaUo51usxH06S8P+Ltgz9yQCHpYGqpDIQSzqdBYMgPzWOQeuM6rVxhiVESPc13vBpRbU W5XPu59TGRXewJjTq6mIGGQS50ahLN14tS6EOswKDu3N+7Sd3W/QUab+6fWmtA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752021881; a=rsa-sha256; cv=none; b=InTbubh1XR/NOJj+j63Duf2PGqZS/U8xRzgggpfk4dbzG2jXtqe48Iox43QAINNu8szkqU AfhHoVAknYhAqGGTyQlBvNm1wbg98AVR3hN373rXjNwpUVRg4bvu+b2Wdwd4nCAbU0rbJ4 jYtifWSK0XU4SwypdQaxYIat3fL5770jp30oe3hRrz3rAmopleX4KB9LQ5im4kbCX8ptOe AZIDwHi4Bp/KecfF1GQ5pnJ/hsTdnMR0PgGFrg1UveGqlaGKo7zH+R4aZDJcmNWz/oRllP w1utEhQ7dBVEkTqEmpkqKFEGbRaIFzxLkSeu2Q6c36l7OzJjfCjjcGcCCXvsmg== 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 4bcK4S6nCgz10qd; Wed, 09 Jul 2025 00:44:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5690ie01022540; Wed, 9 Jul 2025 00:44:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5690ieIa022537; Wed, 9 Jul 2025 00:44:40 GMT (envelope-from git) Date: Wed, 9 Jul 2025 00:44:40 GMT Message-Id: <202507090044.5690ieIa022537@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: 5098a5b48357 - stable/14 - md: Use a larger buffer for the ident string 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 5098a5b48357d4d51ad8369330d292e6bbd7490e Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=5098a5b48357d4d51ad8369330d292e6bbd7490e commit 5098a5b48357d4d51ad8369330d292e6bbd7490e Author: Mark Johnston AuthorDate: 2025-06-25 21:12:33 +0000 Commit: Mark Johnston CommitDate: 2025-07-09 00:44:18 +0000 md: Use a larger buffer for the ident string With the old size, the string could easily be truncated, resulting in non-unique identifiers. PR: 287679 Reported by: Phil Krylov Reviewed by: kib MFC after: 2 weeks (cherry picked from commit 5286b96c56ff5aa3c1cee824ab8564f0ffffc381) --- sys/dev/md/md.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/md/md.c b/sys/dev/md/md.c index 95926706443b..1b434eda19a5 100644 --- a/sys/dev/md/md.c +++ b/sys/dev/md/md.c @@ -258,7 +258,7 @@ struct md_s { unsigned opencount; unsigned fwheads; unsigned fwsectors; - char ident[32]; + char ident[DISK_IDENT_SIZE]; unsigned flags; char name[20]; struct proc *procp; From nobody Wed Jul 9 00:44:38 2025 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 4bcK4R192fz60pBR; Wed, 09 Jul 2025 00:44:39 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcK4Q5hB0z4Hd4; Wed, 09 Jul 2025 00:44:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752021878; 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=qFhzRBV0iKRc5cejpkCRx72/+I9M7GC4W7oUKk31JeE=; b=nQCkSp2Vtbx0BTTu2S/0XPyNOntxrghWkpRm6vxU6IJevT3uSH1+ZkrnwlQBMV0EhdgPzH UYYbbkmkYJ1HR+Q4Z4yMGbS4UJkDiwe7PJESe+qtCtMwmaxov7vIL8/oIwvpAIFj7W0P6G AQNpnrjmS+H2V2XVvp8M9Waer79HTAUg9mU9tpOwJM6bK6nPBM2J1DJm/BTxl0uOv83zpq Y90kjW1ZUEvTKW6HAmcqSaJDOkoC9tD4dgy9pxT//Uc/cgMor9Wgev7QW9tE+bA54/Ziwx 8dSZzZf6ttzWDBAnPYX3rOOKEJo+2OWbql925oWRw7WgFV4VpcsP9lm2TmIsGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752021878; 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=qFhzRBV0iKRc5cejpkCRx72/+I9M7GC4W7oUKk31JeE=; b=yt/wuecZNcExO5BGH0pKEaLfcvWlFRe/Bvy7UDdoXAyfhG2F+Z9scUPaaliZ+zsSGcjgOb 775nugbqCIfJ52Z+MmvFgz86/7OjCOjsUSSgsZ8u+l6jHkhVOkVt4f0b1X80DShoLzC+uL wUvpWKCVc1wXnCpcWHveW86nuCDG2A7WIfOa59JWoqVyq2u4ESClndKjT4+WPaVqUV4OLX FxuBgAH1kfpALqqLNJQV4qqv4mbX6b46ahIBN5gHDQCsru/JzIdfC+pUJzze4mdL7MqPmR O/i8E9a3GCo8/fPNFsixEbN/FhgRRQHoduzUT5LGri/oUekDy6rrpU3VnQvZ/g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752021878; a=rsa-sha256; cv=none; b=Ov4KFJ3cFhheTnH7MjfuWo3m9iD+9XoFhEmOK6ojK8rsTmkC2d9a/zOOSzJzwnbJGDiGND RQ0o19nudk1U9j2V8vxSh3Z9OLynDFFcYT+ZjxBeaaP4VC1D/odkZvlZ71lVed2GOsz090 d0yQZIUt+NqPXXshfwRMXRUQAnPzd2K22tSygcv/xyNnI0tzhfo/0OWn5PbiUOIpRzO2bj xA5k+RhGGQRbsYNnFqDFvxqpVureApWotv6NjzgEffWRyfuE6VXvjv16oeOwx90b2lezau 4e6qk/mDVdSnlffxQo/mcFMVW6BAmSIHQ+z/xX/lNxiS1FrwrsY2xA7kORqNTw== 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 4bcK4Q5D42z1097; Wed, 09 Jul 2025 00:44:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5690icZ0022467; Wed, 9 Jul 2025 00:44:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5690iciP022464; Wed, 9 Jul 2025 00:44:38 GMT (envelope-from git) Date: Wed, 9 Jul 2025 00:44:38 GMT Message-Id: <202507090044.5690iciP022464@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: 10d14a37206e - stable/14 - localedef: Fix a wchar_t comparison 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 10d14a37206e77e050676c8fbd96600f9101cf8b Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=10d14a37206e77e050676c8fbd96600f9101cf8b commit 10d14a37206e77e050676c8fbd96600f9101cf8b Author: Mark Johnston AuthorDate: 2025-06-20 16:10:57 +0000 Commit: Mark Johnston CommitDate: 2025-07-09 00:42:52 +0000 localedef: Fix a wchar_t comparison The intent here is to characterize wide characters which fit in a single byte. When wchar_t is signed, this comparison is insufficient. On systems with signed wchar_t, of the files in /usr/share/locale this only affects zh_CN.GB18030/LC_COLLATE. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D50757 (cherry picked from commit a37bc4cb8d2c5c8402341c9df75580f60bb34186) --- usr.bin/localedef/collate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/localedef/collate.c b/usr.bin/localedef/collate.c index 2a080773a95e..da3f26b4d0ba 100644 --- a/usr.bin/localedef/collate.c +++ b/usr.bin/localedef/collate.c @@ -1273,7 +1273,7 @@ dump_collate(void) RB_FOREACH(cc, collchars, &collchars) { int undef = 0; /* we already gathered those */ - if (cc->wc <= UCHAR_MAX) + if ((uint32_t)cc->wc <= UCHAR_MAX) continue; for (j = 0; j < NUM_WT; j++) { if ((pri = get_weight(cc->ref[j], j)) < 0) { From nobody Wed Jul 9 01:08:17 2025 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 4bcKbq5h5Jz60qF3; Wed, 09 Jul 2025 01:08:23 +0000 (UTC) (envelope-from aokblast@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcKbq2lxMz3Fyv; Wed, 09 Jul 2025 01:08:23 +0000 (UTC) (envelope-from aokblast@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752023303; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BcZWbELluYIHLqrB69V4J1CbHOEN82mmMdc05P/senY=; b=lf/zbavMIC1hulIVwBGfE7Yk5eKbBM7NgKJcqu7aMPzzQoqNkcASjSHDQsVeNOXf5f5ZCT IX/Y6cJumHFr+9Iv8Cb7AGpHWcC5fWffnI9cy2iTKjW/BBlfEcgqQ0lx7FVjGHSEJHZGPH 7TulgQA6EIxKYJgc0sE6UlG+FiB1ocEkm2pQ2lQDvGfiWftZO5eYoZEs6EC7BB0j8WY7cZ 5Mv4tk91tVwKmJKvNXb0px4EUrzQRtjRHUzXzCbAsyPfRn93iH+SfSrsoVtTFT0SjybkHd VBztz4gvwRwRAfmLVN6RLFKBr5MW0/nrcvjISELpOl7DYZIIRcluXHTXKh/9Yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752023303; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BcZWbELluYIHLqrB69V4J1CbHOEN82mmMdc05P/senY=; b=cOhZp3IJCqhLX/vNh9oUnHWXp9o+XUlZHcmq4ULeihW7uXvr7rtHTmMXBuK7uqKqoBy6vZ Nlc3mHH4/C3jMXju3i8Xv4AC4x4JRKFQ7wnbrsvOaA0JRtRjamXsPmPE/Aya6XgtmGySqc /xCm0iDrIMqBXeBjEqIhT8gbyBco+d5kgz1s6sD6/Cg9xDhSnxJPmDR06jD3LgxSW1nKI9 gYetBkwmkK+tGkR1Q4foAwIXw30j8ocmwUoQt5FRINNluSUPxQwT9XwuEpNTT09r0ksmPm s81Qq5lTkK7hKaIZ1pZoOhuuNKsOk8qs0jWyO92UbKSWUfynf+hTU8YpXbXX8w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752023303; a=rsa-sha256; cv=none; b=s4vmDumocnqBvHwiZHLVscjeRhdy6cnip+rlVwIMff7adGvlKGo2PZYibjVAmfYKzMvGwT oL50I+zk1tqHhVHsgfHjwZzjljpLkNCFUCgSNU8kjEKpR1Y3ncI2jU7jwqwFsLt4LXXdrR M+Ido3D+9VDjv7ukxO9ZUEfD3TaTwENAzppEBpATj/2ho/TRExgmtZ09zR4vJ6gVfN+g9e gCCxKvMTL0u4puYfClpCQ5gkutvF39L+ULhqou9m8tIps9T9DCwG+TnHIgRiaS27bslAvS jYyHBLrJYx1Ce9FcydSpssV7LJYUGNlB3MNJU1CaDMYShel3Ig+qc+pKL7jH1Q== Received: from aokblastdeMacBook-Pro.local (118-232-110-206.dynamic.kbronet.com.tw [118.232.110.206]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: aokblast) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bcKbm6f97zyMw; Wed, 09 Jul 2025 01:08:20 +0000 (UTC) (envelope-from aokblast@freebsd.org) From: ShengYi Hung To: Kyle Evans Cc: Adrian Chadd , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: f84a0da4e060 - main - libusb: rename bNumDeviceCapabilities to bNumDeviceCaps for compatibility with libusb In-Reply-To: (Kyle Evans's message of "Tue, 8 Jul 2025 14:44:42 -0500") References: <202507081512.568FCeX8049407@gitrepo.freebsd.org> User-Agent: mu4e 1.12.11; emacs 30.1 Date: Wed, 09 Jul 2025 09:08:17 +0800 Message-ID: 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello. Do you mean LIBUSB20_NO_BACKWARDS_COMPAT applies only to libusb20, or to both libusb10 and libusb20. Since I don't think there is a= nyone use libusb20 directly and the structure in libusb20 is for decoding only. > On 7/8/25 14:40, Adrian Chadd wrote: >> hi! Thanks for this! >> Could we possibly wrap stuff like these compat macros in a #define >> that we can undefine? So we can make sure no new code shows up that >> uses the "old" paths? >> eg LIBUSB10_NO_BACKWARDS_COMPAT / LIBUSB20_NO_BACKWARDS_COMPAT ? >> Thanks! >>=20 > > The latter, please. +1 > > Thanks, > > Kyle Evans > >> -adrian >> On Tue, 8 Jul 2025 at 08:12, ShengYi Hung > > wrote: >> The branch main has been updated by aokblast: >> URL: https://cgit.FreeBSD.org/src/commit/? >> id=3Df84a0da4e0608a970c775f3d605f8de2b0b8d322 > cgit.FreeBSD.org/src/commit/? >> id=3Df84a0da4e0608a970c775f3d605f8de2b0b8d322> >> commit f84a0da4e0608a970c775f3d605f8de2b0b8d322 >> Author:=C2=A0 =C2=A0 =C2=A0ShengYi Hung >> AuthorDate: 2025-06-07 19:43:15 +0000 >> Commit:=C2=A0 =C2=A0 =C2=A0ShengYi Hung >> CommitDate: 2025-07-08 15:11:41 +0000 >> =C2=A0 =C2=A0 libusb: rename bNumDeviceCapabilities to bNumDeviceCa= ps for >> compatibility with libusb >> =C2=A0 =C2=A0 THe member bNumDeviceCapabilities is referred to as >> bNumDeviceCaps in >> =C2=A0 =C2=A0 the upstream libusb project. >> =C2=A0 =C2=A0 To improve compatibility, we are renaming the member >> accordingly. >> =C2=A0 =C2=A0 For backward compatibility, a mocro will be defined t= o map >> =C2=A0 =C2=A0 bNumDeviceCapabilities to bNumDeviceCaps. >> =C2=A0 =C2=A0 See: https://github.com/libusb/libusb/ >> commit/02ebafc85d3f219842cbabaf78abc8100b6656e5 > libusb/libusb/commit/02ebafc85d3f219842cbabaf78abc8100b6656e5> >> =C2=A0 =C2=A0 Reviewed by:=C2=A0 =C2=A0 kevans >> =C2=A0 =C2=A0 Approved by:=C2=A0 =C2=A0 markj (mentor) >> =C2=A0 =C2=A0 MFC after:=C2=A0 =C2=A0 =C2=A0 2 weeks >> =C2=A0 =C2=A0 Sponsored by:=C2=A0 =C2=A0FreeBSD Foundation >> =C2=A0 =C2=A0 Differential Revision: https://reviews.freebsd.org/D5= 0740 >> >> --- >> =C2=A0lib/libusb/libusb.h=C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2=A0 5 ++++- >> =C2=A0lib/libusb/libusb10_desc.c | 11 ++++++----- >> =C2=A0lib/libusb/libusb20_desc.h |=C2=A0 6 +++++- >> =C2=A03 files changed, 15 insertions(+), 7 deletions(-) >> diff --git a/lib/libusb/libusb.h b/lib/libusb/libusb.h >> index 0aad29aa4ecc..491af3d0a5ec 100644 >> --- a/lib/libusb/libusb.h >> +++ b/lib/libusb/libusb.h >> @@ -418,7 +418,10 @@ typedef struct libusb_bos_descriptor { >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 uint8_t bLength; >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 uint8_t bDescriptorType; >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 uint16_t wTotalLength; >> -=C2=A0 =C2=A0 =C2=A0 =C2=A0uint8_t bNumDeviceCapabilities; >> +#ifndef bNumDeviceCapabilities >> +#define bNumDeviceCapabilities bNumDeviceCaps >> +#endif >> +=C2=A0 =C2=A0 =C2=A0 =C2=A0uint8_t bNumDeviceCaps; >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 struct libusb_usb_2_0_device_capability= _descriptor >> *usb_2_0_ext_cap; >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 struct libusb_ss_usb_device_capability_= descriptor *ss_usb_cap; >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 struct libusb_bos_dev_capability_descri= ptor **dev_capability; >> diff --git a/lib/libusb/libusb10_desc.c b/lib/libusb/libusb10_desc.c >> index 3e36009cbb3a..5f4c46740688 100644 >> --- a/lib/libusb/libusb10_desc.c >> +++ b/lib/libusb/libusb10_desc.c >> @@ -470,10 +470,11 @@ libusb_parse_bos_descriptor(const void *buf, >> int len, >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 ptr->bDescriptorType =3D dtype; >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 ptr->wTotalLength =3D ((const uint8_t *)buf)[2] | >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (((const uint8_t *)buf)[3] << 8); >> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0ptr->bNumDeviceCapabilities =3D ((const >> uint8_t *)buf)[4]; >> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0ptr->bNumDeviceCaps =3D ((const uint8_t *)buf)[4]; >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 ptr->usb_2_0_ext_cap =3D NULL; >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 ptr->ss_usb_cap =3D NULL; >> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0ptr->dev_capability =3D calloc(ptr- >> >bNumDeviceCapabilities, sizeof(void *)); >> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0ptr->dev_capability =3D calloc(ptr- >> >bNumDeviceCaps, >> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0sizeof(void *)); >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 if (ptr->dev_capability =3D=3D NULL) { >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 free(ptr); >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return (LIBUSB_ERROR_NO_MEM); >> @@ -485,7 +486,7 @@ libusb_parse_bos_descriptor(const void *buf, int >> len, >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (dlen >= =3D 3 && >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 ptr !=3D NULL && >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 dtype =3D=3D LIBUSB_DT_DEVICE_CAPABILITY) { >> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0if (index !=3D ptr->bNumDeviceCapabilities) { >> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0if (index !=3D ptr->bNumDeviceCaps) { >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ptr->dev_capability[index] =3D >> malloc(dlen); >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (ptr->dev_capability[index= ] =3D=3D >> NULL) { >> libusb_free_bos_descript= or(ptr); >> @@ -542,7 +543,7 @@ libusb_parse_bos_descriptor(const void *buf, int >> len, >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 } >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (ptr !=3D NULL) { >> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0ptr->bNumDev= iceCapabilities =3D index; >> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0ptr->bNumDev= iceCaps =3D index; >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return (0);= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0/* success */ >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 } >> @@ -557,7 +558,7 @@ libusb_free_bos_descriptor(struct >> libusb_bos_descriptor *bos) >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (bos =3D=3D NULL) >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return; >> -=C2=A0 =C2=A0 =C2=A0 =C2=A0for (i =3D 0; i !=3D bos->bNumDeviceCapa= bilities; i++) >> +=C2=A0 =C2=A0 =C2=A0 =C2=A0for (i =3D 0; i !=3D bos->bNumDeviceCaps= ; i++) >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 free(bos->d= ev_capability[i]); >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 free(bos->dev_capability); >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 free(bos); >> diff --git a/lib/libusb/libusb20_desc.h b/lib/libusb/libusb20_desc.h >> index 017148a34b1c..0f7c9294ebc8 100644 >> --- a/lib/libusb/libusb20_desc.h >> +++ b/lib/libusb/libusb20_desc.h >> @@ -298,11 +298,15 @@ LIBUSB20_MAKE_STRUCT(LIBUSB20_USB_20_DEVCAP_DE= SC); >> =C2=A0LIBUSB20_MAKE_STRUCT(LIBUSB20_SS_USB_DEVCAP_DESC); >> +#ifndef bNumDeviceCapabilities >> +#define bNumDeviceCapabilities bNumDeviceCaps >> +#endif >> + >> =C2=A0#define=C2=A0 =C2=A0 =C2=A0 =C2=A0 LIBUSB20_BOS_DESCRIPTOR(m,= n) \ >> =C2=A0 =C2=A0m(n, UINT8_T,=C2=A0 bLength, ) \ >> =C2=A0 =C2=A0m(n, UINT8_T,=C2=A0 bDescriptorType, ) \ >> =C2=A0 =C2=A0m(n, UINT16_T, wTotalLength, ) \ >> -=C2=A0 m(n, UINT8_T,=C2=A0 bNumDeviceCapabilities, ) \ >> +=C2=A0 m(n, UINT8_T,=C2=A0 bNumDeviceCaps, ) \ >> =C2=A0LIBUSB20_MAKE_STRUCT(LIBUSB20_BOS_DESCRIPTOR); >>=20 --=20 Best Regards. ShengYi Hung. From nobody Wed Jul 9 02:21:00 2025 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 4bcMCd0zw1z60w0M; Wed, 09 Jul 2025 02:21:01 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcMCc5TVHz3v3N; Wed, 09 Jul 2025 02:21:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752027660; 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=0UaZwqQEtSAvX3P2D/nC6sK7tIHi1N8qmdGEHuDOmok=; b=mDriVXYAoNsRWf1zDOQQykSh58zQsGi16D46/H2l4Ow1f8GzdRBMfcvmq6VOegfx740rN/ 5IY1xQg6X6QfMYIqngsZURR7kE8HwH174zUNl+9Pol1nXXKNu0G5EJwWx2ndqbN3iCxpIQ uYcj3NUJpJqBbmmxhzPqXYHn1cfesnJFGZb9kiII6arDDfXH9YsAIMBeEMWrRpP2i+C/6R XhCZrfaM+D/GaoDHbkk3Iy8Bxy9AJeho42Rjhs0z4hqU2ZEGILnnLaTkdgoEtME06IFvit qMbSjrVmAzu4kaZF65mUHstNGN/pknJMA6mlRPd/QvPk519ZNaWrkSPybsvpCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752027660; 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=0UaZwqQEtSAvX3P2D/nC6sK7tIHi1N8qmdGEHuDOmok=; b=ABuMuTfePVwee4vnUP7y/cCoM3i2Eqib1ppLUvjiBJ6zc0zfFF+oNgBviA58aSutj+kPUh MdSQdiwH74u4OfI0IrVTA90rRLLr0w9eSsOaZszDMnGDLMP+ghyTF7CwQ57htSPmOGQl90 dIpv59snjlFk0fufW+xGQ1IHcj/osXpxSOCdW2eQvpcG4bQoOaIUQ+5+NPPGvPIZNuBJQK +7Aqs2alPCuUm9kjqd90pt94Xv5A5LjSQIRwPUZd8nIAmoguRLcCEW7QzzNX5cD+eEXn0/ Z9t/3LDgRmU25aXMm21fc4WKob3480LZBTVXaFtavFRllWz3lNwq12xGCn38Vw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752027660; a=rsa-sha256; cv=none; b=r6ncNa19Z+8ERiHKy2C9H+b8eC8voLw6rjBkLGirGmOy1VjmVD+jFTSNy2XirXEvQGu95V +mOQBf/TpJsO7QHSB1PduHN8H5tZkMEG8z4Cp+aZYAVFJuXFQUIUNwuhENx13FrIK4qT32 iHivle/zBGgFmM3t5NqWvn3Lh5DobPTGPiecOUvibCjOEKcXs9IvuG9RDbLP9KeCl8Vxo8 9fjJjqcfVA89g/eD7Thl2vnErNObjAhT2vPPmr0cGJlsh2S+757QEwbVOkrF/zwxxnOn4l QSQrmxXmM6VoWxpECIid00uqGXzD8hiLsW8lA3rqNIF65PTquXEN463dgMD3Mg== 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 4bcMCc4pFpz12hq; Wed, 09 Jul 2025 02:21:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5692L0wr002779; Wed, 9 Jul 2025 02:21:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5692L0ia002776; Wed, 9 Jul 2025 02:21:00 GMT (envelope-from git) Date: Wed, 9 Jul 2025 02:21:00 GMT Message-Id: <202507090221.5692L0ia002776@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: ShengYi Hung Subject: git: bca5df45652a - main - libusb: replace LOG_LEVEL with DEBUG_LEVEL 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: aokblast X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bca5df45652ae4edd14fa032be8f271e044d32b2 Auto-Submitted: auto-generated The branch main has been updated by aokblast: URL: https://cgit.FreeBSD.org/src/commit/?id=bca5df45652ae4edd14fa032be8f271e044d32b2 commit bca5df45652ae4edd14fa032be8f271e044d32b2 Author: ShengYi Hung AuthorDate: 2025-06-04 09:57:30 +0000 Commit: ShengYi Hung CommitDate: 2025-07-09 02:19:47 +0000 libusb: replace LOG_LEVEL with DEBUG_LEVEL The libusb set debug level by libusb_log_level instead of libusb_debug_level. We switch to libusb_log_level for better compatibility with the upstream libusb. Additionally, The upstream libusb has an option allows user to override the log function with a user-defined callback. To support the callback function with a single string without va_arg, we refactor the log facility as a function instead of a macro and parse all va_args inside. The legacy debug_level enum has been removed to enforce maintainer migrate from their deprecated source code. Reviewed by: kevans Approved by: markj (mentor), lwhsu (mentor) MFC after: 2 weeks Sponsored by: FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D50680 --- lib/libusb/libusb.h | 11 ----------- lib/libusb/libusb10.c | 47 +++++++++++++++++++++++++++++++++++++++-------- lib/libusb/libusb10.h | 24 ++++++------------------ lib/libusb/libusb10_io.c | 20 ++++++++++---------- 4 files changed, 55 insertions(+), 47 deletions(-) diff --git a/lib/libusb/libusb.h b/lib/libusb/libusb.h index 491af3d0a5ec..17d341d1b91c 100644 --- a/lib/libusb/libusb.h +++ b/lib/libusb/libusb.h @@ -243,17 +243,6 @@ enum libusb_log_level { LIBUSB_LOG_LEVEL_DEBUG }; -/* XXX */ -/* libusb_set_debug should take parameters from libusb_log_level - * above according to - * https://libusb.sourceforge.io/api-1.0/group__libusb__lib.html - */ -enum libusb_debug_level { - LIBUSB_DEBUG_NO=0, - LIBUSB_DEBUG_FUNCTION=1, - LIBUSB_DEBUG_TRANSFER=2, -}; - #define LIBUSB_HOTPLUG_MATCH_ANY -1 typedef enum { diff --git a/lib/libusb/libusb10.c b/lib/libusb/libusb10.c index 3e81f234a735..173f51aa88b3 100644 --- a/lib/libusb/libusb10.c +++ b/lib/libusb/libusb10.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -48,6 +49,7 @@ #endif #define libusb_device_handle libusb20_device +#define LIBUSB_LOG_BUFFER_SIZE 1024 #include "libusb20.h" #include "libusb20_desc.h" @@ -128,7 +130,7 @@ libusb_interrupt_event_handler(libusb_context *ctx) err = eventfd_write(ctx->event, 1); if (err < 0) { /* ignore error, if any */ - DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "Waking up event loop failed!"); + DPRINTF(ctx, LIBUSB_LOG_LEVEL_ERROR, "Waking up event loop failed!"); } } @@ -253,7 +255,7 @@ libusb_init_context(libusb_context **context, if (context) *context = ctx; - DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_init complete"); + DPRINTF(ctx, LIBUSB_LOG_LEVEL_INFO, "libusb_init complete"); signal(SIGPIPE, SIG_IGN); @@ -625,7 +627,7 @@ libusb_open_device_with_vid_pid(libusb_context *ctx, uint16_t vendor_id, if (ctx == NULL) return (NULL); /* be NULL safe */ - DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_open_device_with_vid_pid enter"); + DPRINTF(ctx, LIBUSB_LOG_LEVEL_DEBUG, "libusb_open_device_with_vid_pid enter"); if ((i = libusb_get_device_list(ctx, &devs)) < 0) return (NULL); @@ -649,7 +651,7 @@ libusb_open_device_with_vid_pid(libusb_context *ctx, uint16_t vendor_id, } libusb_free_device_list(devs, 1); - DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_open_device_with_vid_pid leave"); + DPRINTF(ctx, LIBUSB_LOG_LEVEL_DEBUG, "libusb_open_device_with_vid_pid leave"); return (pdev); } @@ -1536,7 +1538,7 @@ libusb_submit_transfer(struct libusb_transfer *uxfer) dev = libusb_get_device(uxfer->dev_handle); - DPRINTF(dev->ctx, LIBUSB_DEBUG_FUNCTION, "libusb_submit_transfer enter"); + DPRINTF(dev->ctx, LIBUSB_LOG_LEVEL_DEBUG, "libusb_submit_transfer enter"); sxfer = (struct libusb_super_transfer *)( (uint8_t *)uxfer - sizeof(*sxfer)); @@ -1571,7 +1573,7 @@ libusb_submit_transfer(struct libusb_transfer *uxfer) CTX_UNLOCK(dev->ctx); - DPRINTF(dev->ctx, LIBUSB_DEBUG_FUNCTION, "libusb_submit_transfer leave %d", err); + DPRINTF(dev->ctx, LIBUSB_LOG_LEVEL_DEBUG, "libusb_submit_transfer leave %d", err); return (err); } @@ -1600,7 +1602,7 @@ libusb_cancel_transfer(struct libusb_transfer *uxfer) dev = libusb_get_device(devh); - DPRINTF(dev->ctx, LIBUSB_DEBUG_FUNCTION, "libusb_cancel_transfer enter"); + DPRINTF(dev->ctx, LIBUSB_LOG_LEVEL_DEBUG, "libusb_cancel_transfer enter"); sxfer = (struct libusb_super_transfer *)( (uint8_t *)uxfer - sizeof(*sxfer)); @@ -1661,7 +1663,7 @@ libusb_cancel_transfer(struct libusb_transfer *uxfer) CTX_UNLOCK(dev->ctx); - DPRINTF(dev->ctx, LIBUSB_DEBUG_FUNCTION, "libusb_cancel_transfer leave"); + DPRINTF(dev->ctx, LIBUSB_LOG_LEVEL_DEBUG, "libusb_cancel_transfer leave"); return (retval); } @@ -1811,3 +1813,32 @@ libusb_has_capability(uint32_t capability) return (0); } } + +void +libusb_log_va_args(struct libusb_context *ctx, enum libusb_log_level level, + const char *fmt, ...) +{ + static const char *log_prefix[5] = { + [LIBUSB_LOG_LEVEL_ERROR] = "LIBUSB_ERROR", + [LIBUSB_LOG_LEVEL_WARNING] = "LIBUSB_WARN", + [LIBUSB_LOG_LEVEL_INFO] = "LIBUSB_INFO", + [LIBUSB_LOG_LEVEL_DEBUG] = "LIBUSB_DEBUG", + }; + + char buffer[LIBUSB_LOG_BUFFER_SIZE]; + char new_fmt[LIBUSB_LOG_BUFFER_SIZE]; + va_list args; + + ctx = GET_CONTEXT(ctx); + + if (ctx->debug < level) + return; + + va_start(args, fmt); + + snprintf(new_fmt, sizeof(new_fmt), "%s: %s\n", log_prefix[level], fmt); + vsnprintf(buffer, sizeof(buffer), new_fmt, args); + fputs(buffer, stdout); + + va_end(args); +} diff --git a/lib/libusb/libusb10.h b/lib/libusb/libusb10.h index 70b5525df537..9ad08edf075b 100644 --- a/lib/libusb/libusb10.h +++ b/lib/libusb/libusb10.h @@ -29,6 +29,7 @@ #define __LIBUSB10_H__ #ifndef LIBUSB_GLOBAL_INCLUDE_FILE +#include #include #include #include @@ -46,24 +47,11 @@ #define HOTPLUG_LOCK(ctx) pthread_mutex_lock(&(ctx)->hotplug_lock) #define HOTPLUG_UNLOCK(ctx) pthread_mutex_unlock(&(ctx)->hotplug_lock) -#define DPRINTF(ctx, dbg, format, ...) do { \ - switch (dbg) { \ - case LIBUSB_DEBUG_FUNCTION: \ - if ((ctx)->debug & LIBUSB_DEBUG_FUNCTION) { \ - printf("LIBUSB_FUNCTION: " \ - format "\n", ## __VA_ARGS__); \ - } \ - break; \ - case LIBUSB_DEBUG_TRANSFER: \ - if ((ctx)->debug & LIBUSB_DEBUG_TRANSFER) { \ - printf("LIBUSB_TRANSFER: " \ - format "\n", ## __VA_ARGS__); \ - } \ - break; \ - default: \ - break; \ - } \ -} while (0) +void libusb_log_va_args(struct libusb_context *ctx, enum libusb_log_level level, + const char *fmt, ...) __printflike(3, 4); + +#define DPRINTF(ctx, dbg, format, ...) \ + libusb_log_va_args(ctx, dbg, format, ##__VA_ARGS__) /* internal structures */ diff --git a/lib/libusb/libusb10_io.c b/lib/libusb/libusb10_io.c index f1e31c2a7416..dd541b09caa6 100644 --- a/lib/libusb/libusb10_io.c +++ b/lib/libusb/libusb10_io.c @@ -108,7 +108,7 @@ libusb10_handle_events_sub(struct libusb_context *ctx, struct timeval *tv) int i; int err; - DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb10_handle_events_sub enter"); + DPRINTF(ctx, LIBUSB_LOG_LEVEL_DEBUG, "libusb10_handle_events_sub enter"); nfds = 0; i = 0; @@ -230,7 +230,7 @@ do_done: /* Wakeup other waiters */ pthread_cond_broadcast(&ctx->ctx_cond); - DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb10_handle_events_sub complete"); + DPRINTF(ctx, LIBUSB_LOG_LEVEL_DEBUG, "libusb10_handle_events_sub complete"); return (err); } @@ -314,7 +314,7 @@ libusb_wait_for_event(libusb_context *ctx, struct timeval *tv) int err; ctx = GET_CONTEXT(ctx); - DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_wait_for_event enter"); + DPRINTF(ctx, LIBUSB_LOG_LEVEL_DEBUG, "libusb_wait_for_event enter"); if (tv == NULL) { pthread_cond_wait(&ctx->ctx_cond, @@ -358,7 +358,7 @@ libusb_handle_events_timeout_completed(libusb_context *ctx, ctx = GET_CONTEXT(ctx); - DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_handle_events_timeout_completed enter"); + DPRINTF(ctx, LIBUSB_LOG_LEVEL_DEBUG, "libusb_handle_events_timeout_completed enter"); libusb_lock_events(ctx); @@ -374,7 +374,7 @@ libusb_handle_events_timeout_completed(libusb_context *ctx, libusb_unlock_events(ctx); - DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_handle_events_timeout_completed exit"); + DPRINTF(ctx, LIBUSB_LOG_LEVEL_DEBUG, "libusb_handle_events_timeout_completed exit"); return (err); } @@ -523,7 +523,7 @@ libusb10_do_transfer_cb(struct libusb_transfer *transfer) ctx = libusb10_get_context_by_device_handle(transfer->dev_handle); - DPRINTF(ctx, LIBUSB_DEBUG_TRANSFER, "sync I/O done"); + DPRINTF(ctx, LIBUSB_LOG_LEVEL_DEBUG, "sync I/O done"); pdone = transfer->user_data; *pdone = 1; @@ -613,12 +613,12 @@ libusb_bulk_transfer(libusb_device_handle *devh, ctx = libusb10_get_context_by_device_handle(devh); - DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_bulk_transfer enter"); + DPRINTF(ctx, LIBUSB_LOG_LEVEL_DEBUG, "libusb_bulk_transfer enter"); ret = libusb10_do_transfer(devh, endpoint, data, length, transferred, timeout, LIBUSB_TRANSFER_TYPE_BULK); - DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_bulk_transfer leave"); + DPRINTF(ctx, LIBUSB_LOG_LEVEL_DEBUG, "libusb_bulk_transfer leave"); return (ret); } @@ -632,12 +632,12 @@ libusb_interrupt_transfer(libusb_device_handle *devh, ctx = libusb10_get_context_by_device_handle(devh); - DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_interrupt_transfer enter"); + DPRINTF(ctx, LIBUSB_LOG_LEVEL_DEBUG, "libusb_interrupt_transfer enter"); ret = libusb10_do_transfer(devh, endpoint, data, length, transferred, timeout, LIBUSB_TRANSFER_TYPE_INTERRUPT); - DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_interrupt_transfer leave"); + DPRINTF(ctx, LIBUSB_LOG_LEVEL_DEBUG, "libusb_interrupt_transfer leave"); return (ret); } From nobody Wed Jul 9 03:44:49 2025 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 4bcP4K6CNTz611sl; Wed, 09 Jul 2025 03:44:49 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcP4K54nMz3lLW; Wed, 09 Jul 2025 03:44:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752032689; 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=7jyYLSL3fY/2IluHz9RV4sGDwkasJ+jbRXJCE5pQY5Y=; b=q9nL1PfhYP5Zy2OlQiQ1hrmRE8u9Suqwz6Q0rY0LijGW5XVpRCEiQ90idK5q3idgIogCn9 IUhQ2jrSV+MOb/mDeouY6h7plFuj3vXlxr1q4vmhpes7T71al0TK8BCiZYKZQ7uLFrlI19 opXjidUDmwoNTgFgUtzh5H7lJC8wX4VxWsov2U9NQFp90UmMKM5E/BeuSLUguOL6Ug+vkc 83mybUSVFGtPOo8eWrMJHdYlzB3LHrzNtJ6ML/mMYOse4TSOdx1676JR29BvbWxqASCRoF Ak6UIoqeqqa8VGk2mF5vl2zu5exBkX5mJFhLU2r1qVznXjZdIcuy4s/JPnIGeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752032689; 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=7jyYLSL3fY/2IluHz9RV4sGDwkasJ+jbRXJCE5pQY5Y=; b=gp8WxaqGFGDtzjgzmAqnBMvVB+beldSqeJCpvsKbQMTvkyIaf+2DJZnDo1s3nt5m0DuXRX YtIZbrC3kxyEGBC1OtD1stkdlKGIv3ZNlA9TOE0zlQRUVApkOwPAG9JNGim/FBOoFkoJmd 5CguqQL6OLs9IVV0c/tcJHxxSGCJsm5GVN9Wmac9HR7eYd0njSreWo0Ehj2z0hifArca8L lQOLP8FhhpLrgjMneMFC82Q/Is224caTgafIlMtL5ZIxw0cTl/vpjdUUH0rXFxk+dq5ej8 fS+L6eV/YOK8xAE5XuSNGrX1Dk6p1rM+oqDus0EVIVR5XxkK122vpuIDVq2h2Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752032689; a=rsa-sha256; cv=none; b=JV6sVwc6szauwXP1dUXu9Yfun4jyGDHXl8XX84qDQGuj5ueI5VJdC25jp84icAvUZNoM+0 HwXdjLaKnBu6IwGuqVpdcLe9yjYMPWR9cbstDc+X4P4nirHk4S/4oT3mALfbiwR8/uh6Mt 7LGQsZwV18JY8ETg+EVwkCc4AADMA+LGSNWrrXLeCvNKhKOYbJWvmWBKiiH3lbhcEAfpLL 6XpSEMw9dbVPiu/FjpYbWMos3TjydjG9bV0upNtQzRfC1q35A9NFx1gSrxXQExV6guC6Nj wiim77Qs8X2scokIctzTTcKynkO3EN9RwAwyWYbjsGzWRzyRlV04Riy5wmdXSA== 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 4bcP4K4Th7z159B; Wed, 09 Jul 2025 03:44:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5693inrQ061619; Wed, 9 Jul 2025 03:44:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5693inx0061616; Wed, 9 Jul 2025 03:44:49 GMT (envelope-from git) Date: Wed, 9 Jul 2025 03:44:49 GMT Message-Id: <202507090344.5693inx0061616@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: d9cc5dd87b50 - main - fcntl(F_SETFD): make FD_CLOFORK non-sticky 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d9cc5dd87b50348b60ca8aea1d3445c25e9c1a1c Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=d9cc5dd87b50348b60ca8aea1d3445c25e9c1a1c commit d9cc5dd87b50348b60ca8aea1d3445c25e9c1a1c Author: Konstantin Belousov AuthorDate: 2025-07-08 21:53:08 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-09 03:44:28 +0000 fcntl(F_SETFD): make FD_CLOFORK non-sticky There is no reason for it to be non-modifing by F_SETFD. Reviewed by: markj Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D51212 --- sys/kern/kern_descrip.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index 2e1da2fdee29..93bdd41d1515 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -632,8 +632,8 @@ kern_fcntl(struct thread *td, int fd, int cmd, intptr_t arg) /* * UF_RESOLVE_BENEATH is sticky and cannot be cleared. */ - fde->fde_flags = (fde->fde_flags & ~UF_EXCLOSE) | - fd_to_fde_flags(arg); + fde->fde_flags = (fde->fde_flags & + ~(UF_EXCLOSE | UF_FOCLOSE)) | fd_to_fde_flags(arg); error = 0; } FILEDESC_XUNLOCK(fdp); From nobody Wed Jul 9 05:12:53 2025 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 4bcR1x36gBz6172T; Wed, 09 Jul 2025 05:12:53 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcR1x1z8xz3LQ9; Wed, 09 Jul 2025 05:12:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752037973; 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=Y15FpRDnDqExAD4Oro7aCjPc3cPmv7ntDFrdomXqCmo=; b=s5ts5r6jyvrNzlJZfCHFLvDTRPzdja0u+D4xdbAkuUdGfzJ0ekqT/o6gbea4aZCF5NK+7L 1K30TTE9j8uB61WHCGlKwB2WREQqmd+2QRL/nsTqmzpb0kdQL9gK5u7OS/P5LRYEKCq7+8 xJMKJYz3fVG5A9aD3hFQcwW8shMHELb8kveYpN7jiqCgCul+CjqDNfLPpnoQSFeMnclUPK 9lXYobQwCk8VKa+h+uKz9lVlJ4Bjs81j+Q3MN9nq0X+cNUbbfm8kAi18N0iMbY5gi3a5zK ozSWRiDe8O6D9+VwXdFYF/p22Dz3oCOcM9m6cwYGgBTBuqR5FhA4O1SEC+sg/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752037973; 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=Y15FpRDnDqExAD4Oro7aCjPc3cPmv7ntDFrdomXqCmo=; b=x0tEvRjULKi/HHSdxwJCrluNtVg8EPW5Wug9vADoiSo221LPwkyEW2p9TcDfUO0xwpSGZx R8sNqSWJu22z6RaYXVSg6enpaREP6r+Wo9iXdlKpyN5+n7nKzn3J5Pdy2EIR61KO13tblF TfOYp+yhI7kpIezmmBK8ZJXkT80aiVXmBFaNC9udyl4XmPtMBmvYtK1m2hVORvB2giwghN z6chlQE2afZz2JinQGjyI9At8uo4R4Q0WAEZx3dsgWGu8urvC3J08YCM1mXhS3wAX7k1bu pIeYKjrg2+hH601HT6lYoMSIrtQcaX3XihbIXZFEg/ipr78+jYU78quVVuGRMw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752037973; a=rsa-sha256; cv=none; b=Z/K/BYmfY1458EvM1nb7TI7yu1keW25lU2Rid9OZhCUdxiYKkq2jjdo7mqTn2nw/EyWx2g gxdPuwpWf+ybwgWx7TnuhyxUGloV9gYnQiayAcsSKwJC6A8R/0V4IUzWdVHwBmjQDvBr9G SktBSf9rTPL/QPfc9zjrud1h8VAXJnUca2s6H+FF2etkTZ/YE8H4UsrHZFq2VX84QC9maf M+UpVLigeFJy64tLTaDdubqNVwD3XoVQLFhoMLw2kEXgSRuUNa5Ynq+auo0VmufvdoTQQO kfazKIqwQc45opUB8BrZrJV+ICsggJIX/LUMo5pnk+Eq12c/FNSD5u6BRTRKRA== 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 4bcR1x1RD0z17KQ; Wed, 09 Jul 2025 05:12:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5695CrFN030455; Wed, 9 Jul 2025 05:12:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5695Crp0030452; Wed, 9 Jul 2025 05:12:53 GMT (envelope-from git) Date: Wed, 9 Jul 2025 05:12:53 GMT Message-Id: <202507090512.5695Crp0030452@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 0610ba6cdbf2 - main - flua: fbsd: avoid leaking stdin pipes on error 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0610ba6cdbf2d8bed2619ae78ef2da5ee9c30b94 Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=0610ba6cdbf2d8bed2619ae78ef2da5ee9c30b94 commit 0610ba6cdbf2d8bed2619ae78ef2da5ee9c30b94 Author: Kyle Evans AuthorDate: 2025-07-09 05:12:31 +0000 Commit: Kyle Evans CommitDate: 2025-07-09 05:12:31 +0000 flua: fbsd: avoid leaking stdin pipes on error Additionally, there's no way to get to the end without a valid stdin_pipe[1] at the moment, so don't check for it. stdin_pipe[0] is closed earlier, as the parent shouldn't need the read-side of the pipe. While we're here, also free the file actions earlier and on error -- they're not necessary once posix_spawnp() has returned. Reviewed by: bapt Differential Revision: https://reviews.freebsd.org/D50537 --- libexec/flua/modules/lfbsd.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/libexec/flua/modules/lfbsd.c b/libexec/flua/modules/lfbsd.c index 30cafcc7309e..6279474f8388 100644 --- a/libexec/flua/modules/lfbsd.c +++ b/libexec/flua/modules/lfbsd.c @@ -88,13 +88,22 @@ lua_exec(lua_State *L) argv = luaL_checkarraystrings(L, 1); if (0 != (r = posix_spawnp(&pid, argv[0], &action, NULL, (char*const*)argv, environ))) { + close(stdin_pipe[0]); + close(stdin_pipe[1]); + posix_spawn_file_actions_destroy(&action); + lua_pushnil(L); lua_pushstring(L, strerror(r)); lua_pushinteger(L, r); return (3); } + + close(stdin_pipe[0]); + posix_spawn_file_actions_destroy(&action); + while (waitpid(pid, &pstat, 0) == -1) { if (errno != EINTR) { + close(stdin_pipe[1]); lua_pushnil(L); lua_pushstring(L, strerror(r)); lua_pushinteger(L, r); @@ -109,12 +118,7 @@ lua_exec(lua_State *L) return (3); } - posix_spawn_file_actions_destroy(&action); - - if (stdin_pipe[0] != -1) - close(stdin_pipe[0]); - if (stdin_pipe[1] != -1) - close(stdin_pipe[1]); + close(stdin_pipe[1]); lua_pushinteger(L, pid); return 1; } From nobody Wed Jul 9 05:12:54 2025 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 4bcR1y60FNz61770; Wed, 09 Jul 2025 05:12:54 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcR1y3C22z3LVb; Wed, 09 Jul 2025 05:12:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752037974; 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=MUBKf2uf4OFy+KgjfM8lvY5TwJvkRbUM0kDrZDhrng4=; b=Ek1o9kctWv+G6lDH41XZOs00/wTpNlNtGAzkJ1RKmxKC4xVM5javdukQtg4Ohn0jh8YAAa tseUWkuZkH3vI7l+e5EKWAIqsH5JuLzC/hJZZW9UA1uQH8SGScSIiDGd7cjRrqZDnB+fHo evIVypJUxygMlK11kUIyb+MtdXES+GIbd0PXrHlOUizUgiXqlhcd9ttfoznhrkO1YJ0oUj oCQn/r7AXVd1ToANJz8xIsWlexpnRsORbBOjs8xK1Eq7aCI4Xk2lDQABVYzfI+jvU/zgoh 2mzoUdFopKBWIIrG2gXLJJ3doh9pvoNoSU24ncBZbd6sGzVMAWeT4GINRq6VEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752037974; 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=MUBKf2uf4OFy+KgjfM8lvY5TwJvkRbUM0kDrZDhrng4=; b=NNXLbwi6Nut9/vJ/sQuW3uD0yZYeMdjeGx7Ck7tfLsYKrBmE1uPt82pZD3auH2pUpRqJbE DbQJU2BWAc522gUakU/BPAgtiJWW1KElQP7lfwnQy69FsSSK/IrmN/U7HBpBw/NIDl0+GY KUQHgiGyPp0n8FpENA2zphNlAaayy2hY3AgwTXNhc+aaODZpd718Z2UhyrBZiRneO2u00K Id7A7t2ocn130QycHCCSYtPPMMkMXznGne1fPwa0uZG/6R7IVV3Db28BlL3KHRFdMjQQZf /8z3wDjKSoFQUBvYGbULyDQ+U3qD3C0QCp3P5+qfbCJ2/eMTiWCi4t6ONF4wNQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752037974; a=rsa-sha256; cv=none; b=sl01I39sVPzm8Cj5eayRDQ8epsHSqVBiP2INiaEYNc0OdgEtaZmeYiWmzC1RZCTBI+M/AW kTqMr0FAvP9ih+DubWp0yfbZJSb/NMKXZKOQPVR0usoYTUoGY2+qXZSuWpyITjTrLg/MFH leMFIrMtqmIjzFpKkFPmnszbLNsKnjJFnCRJBGbKUzGK26cEgFNUMNLYtYV5nm9a8NIcIO WB+cn4aBFUsOOjbUvp0GKmPe1egeirHtu8HBPOpPZkPw3jbxvYj8Cy0m1xrF8X7hxaG6WG mEmpmkSXYzaVCk6wkVpT4VpLHViDtPk32u1uRhISZqgpi1T03XqGXULPh2AZyA== 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 4bcR1y2fvMz17KR; Wed, 09 Jul 2025 05:12:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5695CsWm030490; Wed, 9 Jul 2025 05:12:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5695CsMC030487; Wed, 9 Jul 2025 05:12:54 GMT (envelope-from git) Date: Wed, 9 Jul 2025 05:12:54 GMT Message-Id: <202507090512.5695CsMC030487@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 6a2c624b35a0 - main - flua: fbsd: return a process handle to operate on when we exec() 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6a2c624b35a0c760b00b9a34c10b7ea0c240c677 Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=6a2c624b35a0c760b00b9a34c10b7ea0c240c677 commit 6a2c624b35a0c760b00b9a34c10b7ea0c240c677 Author: Kyle Evans AuthorDate: 2025-07-09 05:12:31 +0000 Commit: Kyle Evans CommitDate: 2025-07-09 05:12:31 +0000 flua: fbsd: return a process handle to operate on when we exec() This gives us some way to be able to write to stdin if we want to, or as a future improvement, will allow us to extract stdout from the process. The handle is setup to close and waitpid() on close/gc so that existing users wouldn't necessarily leak for the lifetime of the script if they weren't adopted to the new model. Reviewed by: bapt Differential Revision: https://reviews.freebsd.org/D50538 --- libexec/flua/modules/lfbsd.c | 94 ++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 86 insertions(+), 8 deletions(-) diff --git a/libexec/flua/modules/lfbsd.c b/libexec/flua/modules/lfbsd.c index 6279474f8388..a361fa25601b 100644 --- a/libexec/flua/modules/lfbsd.c +++ b/libexec/flua/modules/lfbsd.c @@ -2,6 +2,7 @@ * SPDX-License-Identifier: BSD-2-Clause * * Copyright 2023 Baptiste Daroussin + * Copyright (C) 2025 Kyle Evans * * Redistribution and use in source and binary forms, with or without * modification, are permitted providing that the following conditions~ @@ -38,6 +39,13 @@ #include "lauxlib.h" #include "lfbsd.h" +#define FBSD_PROCESSHANDLE "fbsd_process_t*" + +struct fbsd_process { + int pid; + int stdin_fileno; +}; + extern char **environ; static const char** @@ -65,7 +73,8 @@ luaL_checkarraystrings(lua_State *L, int arg) static int lua_exec(lua_State *L) { - int r, pstat; + struct fbsd_process *proc; + int r; posix_spawn_file_actions_t action; int stdin_pipe[2] = {-1, -1}; pid_t pid; @@ -81,6 +90,9 @@ lua_exec(lua_State *L) return (3); } + proc = lua_newuserdata(L, sizeof(*proc)); + proc->stdin_fileno = stdin_pipe[1]; + posix_spawn_file_actions_init(&action); posix_spawn_file_actions_adddup2(&action, stdin_pipe[0], STDIN_FILENO); posix_spawn_file_actions_addclose(&action, stdin_pipe[1]); @@ -91,6 +103,7 @@ lua_exec(lua_State *L) close(stdin_pipe[0]); close(stdin_pipe[1]); posix_spawn_file_actions_destroy(&action); + lua_pop(L, 2); /* Pop off the process handle and args. */ lua_pushnil(L); lua_pushstring(L, strerror(r)); @@ -98,12 +111,26 @@ lua_exec(lua_State *L) return (3); } + lua_pop(L, 1); + close(stdin_pipe[0]); posix_spawn_file_actions_destroy(&action); - while (waitpid(pid, &pstat, 0) == -1) { - if (errno != EINTR) { - close(stdin_pipe[1]); + proc->pid = pid; + luaL_setmetatable(L, FBSD_PROCESSHANDLE); + + return 1; +} + +static int +lua_process_close(lua_State *L) +{ + struct fbsd_process *proc; + int pstat, r; + + proc = luaL_checkudata(L, 1, FBSD_PROCESSHANDLE); + while (waitpid(proc->pid, &pstat, 0) == -1) { + if ((r = errno) != EINTR) { lua_pushnil(L); lua_pushstring(L, strerror(r)); lua_pushinteger(L, r); @@ -111,18 +138,60 @@ lua_exec(lua_State *L) } } - if (WEXITSTATUS(pstat) != 0) { + if (!WIFEXITED(pstat) || WEXITSTATUS(pstat) != 0) { lua_pushnil(L); lua_pushstring(L, "Abnormal termination"); + return (2); + } + + if (proc->stdin_fileno >= 0) + close(proc->stdin_fileno); + proc->stdin_fileno = -1; + + lua_pushboolean(L, 1); + return 1; +} + +static int +lua_process_stdin(lua_State *L) +{ + struct fbsd_process *proc; + luaL_Stream *p; + FILE *fp; + int r; + + proc = luaL_checkudata(L, 1, FBSD_PROCESSHANDLE); + fp = fdopen(proc->stdin_fileno, "w"); + if (fp == NULL) { + r = errno; + + lua_pushnil(L); + lua_pushstring(L, strerror(r)); lua_pushinteger(L, r); return (3); } - close(stdin_pipe[1]); - lua_pushinteger(L, pid); - return 1; + p = lua_newuserdata(L, sizeof(*p)); + p->closef = &lua_process_close; + p->f = fp; + luaL_setmetatable(L, LUA_FILEHANDLE); + return (1); } +#define PROCESS_SIMPLE(n) { #n, lua_process_ ## n } +static const struct luaL_Reg fbsd_process[] = { + PROCESS_SIMPLE(close), + PROCESS_SIMPLE(stdin), + { NULL, NULL }, +}; + +static const struct luaL_Reg fbsd_process_meta[] = { + { "__index", NULL }, + { "__gc", lua_process_close }, + { "__close", lua_process_close }, + { NULL, NULL }, +}; + #define REG_SIMPLE(n) { #n, lua_ ## n } static const struct luaL_Reg fbsd_lib[] = { REG_SIMPLE(exec), @@ -134,5 +203,14 @@ int luaopen_fbsd(lua_State *L) { luaL_newlib(L, fbsd_lib); + + luaL_newmetatable(L, FBSD_PROCESSHANDLE); + luaL_setfuncs(L, fbsd_process_meta, 0); + + luaL_newlibtable(L, fbsd_process); + luaL_setfuncs(L, fbsd_process, 0); + lua_setfield(L, -2, "__index"); + lua_pop(L, 1); + return (1); } From nobody Wed Jul 9 05:12:55 2025 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 4bcR2011HHz616rX; Wed, 09 Jul 2025 05:12:56 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcR1z4fRwz3LhR; Wed, 09 Jul 2025 05:12:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752037975; 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=Cu+KDEtxfrEKyWM0gvbmOErnacktkTnzy+hxfdY8x0E=; b=rIDLZ5DfgLE2sEbzU5riksl48r3alPcGvgeoUOHoS4Bnhx7ehprExHb22obs+yQ+exxI04 SXd9Ds0mp2268b3BhH03wHZgMcN5KyCQzzpRIUHOZCzgI05ZUx3CNaKsvrmpDxWqQFsAvs UAQ2kdFeL8P7pBNgC20/JPW4OzV/8YerjusjEHZHThIqlMtb1sxDo3lhJ5nFqgX7MVlQr3 Dm9LdHqrANDcK+cO/zft5oGEgW7reZjhfx0h8joLEOmPxILnZobEL4RkEsC7/sM0xMAMq7 VVe+SDKCYmgmWTKBY3L+BOZMZgKlBWWIkrsa3Gx28jI/gNSbzWTBJ5vk05UMdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752037975; 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=Cu+KDEtxfrEKyWM0gvbmOErnacktkTnzy+hxfdY8x0E=; b=AyJRwlknxueKgImIyCtkoDY1YG89V57YNYCFE1KaCycyJuztKygKHdqxULuQESAKlMDcyP Ouq7K/ymtQJuyquZZpv3dPQ+tE4beJkU52H9hAbjUl0WBRbL0oAbuI/vhwCALs+o8vuRVe WPyPSkUZVwMWUwJjoBoBCOqt4ZeyWrSG/kLCszUX+fOWUqquomcqHaZp3bHk2ID+VypM1G 5W2u5jAvgStGNy5MePce+yPDWTC8jVmZ92+SaF9fk0ScMbOmVdw3OvbN8LNAOrr6cIRNx2 4IPVMAxM+59qsT60qp0o//uOpaMOXq9p76aDzVzT0i+mbMXYp1keCOW55wQ7Nw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752037975; a=rsa-sha256; cv=none; b=wCLdzYKIp+v0T0SBe3esX2NqeRzQ/p5wrE2Vmi0DumgHsVloBrvZfrggVP+i9mL7USK+x1 Q/I01vial6vjzSKtrrAwZnNBGPz1lA28BXQqjBMk+/mw+g1heQpRBMO3RnqzmglVkN7DXX NLRYEqfF7t58Nn4RPtNt7ymcbzN6DcI498b5sdvU60IywM+X48zFA4r+DNVAIxrnvHfgC1 vGONNFrG6eZ/633MyZ7bD9EpdyVB8s5A3YojtHDJ7WTkkQpP2Nq++rqwcv8omNRUCQuf58 4pkI77gM7d+L4dBRAg71uyloeOf0CQ0gjRwXf0bvL3tdVmqd9PSB/EyeOMZ7yQ== 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 4bcR1z3dTMz17gC; Wed, 09 Jul 2025 05:12:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5695Ctdc030527; Wed, 9 Jul 2025 05:12:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5695CtTH030524; Wed, 9 Jul 2025 05:12:55 GMT (envelope-from git) Date: Wed, 9 Jul 2025 05:12:55 GMT Message-Id: <202507090512.5695CtTH030524@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 3f0e1092097e - main - flua: fbsd: allow stdout to be captured for exec() processes 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3f0e1092097ed63b83a02518395e370c3cac01be Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=3f0e1092097ed63b83a02518395e370c3cac01be commit 3f0e1092097ed63b83a02518395e370c3cac01be Author: Kyle Evans AuthorDate: 2025-07-09 05:12:32 +0000 Commit: Kyle Evans CommitDate: 2025-07-09 05:12:32 +0000 flua: fbsd: allow stdout to be captured for exec() processes This allows us to do things like: ``` local fp = assert(fbsd.exec({"ls", "-l"}, true)) local fpout = assert(fp:stdout()) while true do local line = fpout:read("l") if not line then break end print("Read: " .. line) end fp:close() ``` The makeman lua rewrite will use it to capture `make showconfig` output for processing. Reviewed by: bapt Differential Revision: https://reviews.freebsd.org/D50539 --- libexec/flua/modules/lfbsd.c | 95 ++++++++++++++++++++++++++++++++++++++------ 1 file changed, 82 insertions(+), 13 deletions(-) diff --git a/libexec/flua/modules/lfbsd.c b/libexec/flua/modules/lfbsd.c index a361fa25601b..ef660ba9fd77 100644 --- a/libexec/flua/modules/lfbsd.c +++ b/libexec/flua/modules/lfbsd.c @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -44,6 +45,7 @@ struct fbsd_process { int pid; int stdin_fileno; + int stdout_fileno; }; extern char **environ; @@ -70,6 +72,16 @@ luaL_checkarraystrings(lua_State *L, int arg) return ret; } +static void +close_pipes(int pipes[2]) +{ + + if (pipes[0] != -1) + close(pipes[0]); + if (pipes[1] != -1) + close(pipes[1]); +} + static int lua_exec(lua_State *L) { @@ -77,31 +89,57 @@ lua_exec(lua_State *L) int r; posix_spawn_file_actions_t action; int stdin_pipe[2] = {-1, -1}; + int stdout_pipe[2] = {-1, -1}; pid_t pid; const char **argv; int n = lua_gettop(L); - luaL_argcheck(L, n == 1, n > 1 ? 2 : n, - "fbsd.exec takes exactly one argument"); + bool capture_stdout; + luaL_argcheck(L, n > 0 && n <= 2, n >= 2 ? 2 : n, + "fbsd.exec takes exactly one or two arguments"); + capture_stdout = lua_toboolean(L, 2); if (pipe(stdin_pipe) < 0) { lua_pushnil(L); lua_pushstring(L, strerror(errno)); lua_pushinteger(L, errno); return (3); } + if (capture_stdout && pipe(stdout_pipe) < 0) { + close_pipes(stdin_pipe); + lua_pushnil(L); + lua_pushstring(L, strerror(errno)); + lua_pushinteger(L, errno); + return (3); + } proc = lua_newuserdata(L, sizeof(*proc)); proc->stdin_fileno = stdin_pipe[1]; - + proc->stdout_fileno = stdout_pipe[1]; posix_spawn_file_actions_init(&action); posix_spawn_file_actions_adddup2(&action, stdin_pipe[0], STDIN_FILENO); posix_spawn_file_actions_addclose(&action, stdin_pipe[1]); + if (stdin_pipe[0] != STDIN_FILENO) + posix_spawn_file_actions_addclose(&action, stdin_pipe[0]); + + /* + * Setup stdout to be captured if requested. Otherwise, we just let it + * go to our own stdout. + */ + if (stdout_pipe[0] != -1) { + posix_spawn_file_actions_adddup2(&action, stdout_pipe[0], + STDOUT_FILENO); + posix_spawn_file_actions_addclose(&action, stdout_pipe[1]); + if (stdout_pipe[0] != STDOUT_FILENO) { + posix_spawn_file_actions_addclose(&action, + stdout_pipe[0]); + } + } argv = luaL_checkarraystrings(L, 1); if (0 != (r = posix_spawnp(&pid, argv[0], &action, NULL, (char*const*)argv, environ))) { - close(stdin_pipe[0]); - close(stdin_pipe[1]); + close_pipes(stdin_pipe); + close_pipes(stdout_pipe); posix_spawn_file_actions_destroy(&action); lua_pop(L, 2); /* Pop off the process handle and args. */ @@ -114,12 +152,14 @@ lua_exec(lua_State *L) lua_pop(L, 1); close(stdin_pipe[0]); + if (stdout_pipe[0] != -1) + close(stdout_pipe[0]); posix_spawn_file_actions_destroy(&action); proc->pid = pid; luaL_setmetatable(L, FBSD_PROCESSHANDLE); - return 1; + return (1); } static int @@ -144,24 +184,34 @@ lua_process_close(lua_State *L) return (2); } - if (proc->stdin_fileno >= 0) + if (proc->stdin_fileno >= 0) { close(proc->stdin_fileno); - proc->stdin_fileno = -1; + proc->stdin_fileno = -1; + } + + if (proc->stdout_fileno >= 0) { + close(proc->stdout_fileno); + proc->stdout_fileno = -1; + } lua_pushboolean(L, 1); - return 1; + return (1); } static int -lua_process_stdin(lua_State *L) +lua_process_makestdio(lua_State *L, int fd, const char *mode) { - struct fbsd_process *proc; luaL_Stream *p; FILE *fp; int r; - proc = luaL_checkudata(L, 1, FBSD_PROCESSHANDLE); - fp = fdopen(proc->stdin_fileno, "w"); + if (fd == -1) { + lua_pushnil(L); + lua_pushstring(L, "Stream not captured"); + return (2); + } + + fp = fdopen(fd, mode); if (fp == NULL) { r = errno; @@ -178,10 +228,29 @@ lua_process_stdin(lua_State *L) return (1); } +static int +lua_process_stdin(lua_State *L) +{ + struct fbsd_process *proc; + + proc = luaL_checkudata(L, 1, FBSD_PROCESSHANDLE); + return (lua_process_makestdio(L, proc->stdin_fileno, "w")); +} + +static int +lua_process_stdout(lua_State *L) +{ + struct fbsd_process *proc; + + proc = luaL_checkudata(L, 1, FBSD_PROCESSHANDLE); + return (lua_process_makestdio(L, proc->stdout_fileno, "r")); +} + #define PROCESS_SIMPLE(n) { #n, lua_process_ ## n } static const struct luaL_Reg fbsd_process[] = { PROCESS_SIMPLE(close), PROCESS_SIMPLE(stdin), + PROCESS_SIMPLE(stdout), { NULL, NULL }, }; From nobody Wed Jul 9 08:58:59 2025 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 4bcX2q72kpz61NKW; Wed, 09 Jul 2025 08:58:59 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcX2q6Hf7z3bvT; Wed, 09 Jul 2025 08:58:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752051539; 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=Q6qkcO+ZWqcyBU87VofTkMAR+O0UEO8Xs9h8B6eQvVs=; b=QfSPTqqrTr52sIdPwlz+9iHdthDrc86KDaN0Nf9QmHimwUzY0A0bFY5uRv5TPQSqP/Yt48 PqSPu/61IWiBYX8ZM9R3qwwHgegMiJ3DQ7V5Ga9kJkpfflvwvlCFEREbFxujHcRrLW01zF a4fJFf/j4MM6QtROuJ+bW+Z/QyLMxQMuLZ7Kiec2/T8E/OAKyTJ5Escf0D7fJvWBXhAhBd B0xKS+81QUVPswEzbaJ572I5clQSlh8MTD9wRW/TktIFftiCv6o8Uk9wikbbLcNk0cw8ec ZP0qKDygdqSnYJsuH5SNNkDyZGgdbu9SIlVhkvOf56kcKas80OXdvhGFoRaZtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752051539; 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=Q6qkcO+ZWqcyBU87VofTkMAR+O0UEO8Xs9h8B6eQvVs=; b=iX25Ds2uj/YtmHXEPm4xJk+l6Vk+HrIMpzGwepyK5Jw/erpwtdOfylnLI/U0ZJ4sHtd9Sg AcV1ryXFh/2P2MkP7t+/WMawxsIM41yKlpcphGrS4AOh44mcQwIjYOF/6ZJYG8V1nOLi8i pS6R9n0XiyUpda0Llsjy+gzcyDDy1q51Bf6eMhigoFlmVWxf3vPj11lFzgrGwUI7DPp+Gk EIh2lwxbA7TDZAM1GZqXFqPzPeDD8vTQYVndOfwQQI+XNv6ipZARb9NE7ioNQU75HMZpz9 P+XvlgIwf1YbIMh22s/RraHGeMDmUpmGeU0Oylv3JV9k7V7Dp/caLo3o3bVTHQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752051539; a=rsa-sha256; cv=none; b=vsVpZhoQvqs5N5jM450OkYiUdpO8TV51XfcNUObQf0LRVR6LUuLu0ZVa2BfIkwmjqD1YPY hwXrrxjE2Oz1mxdvY5OJgrGdG8SxqQiDWKgJliojm/VbpfDG/4mv9nsqGC6TOSwOYn7wm0 WYLFzSBBMWlNXvw7z5iGXVtGHiUJTNiUg4TyQ9stxw4Asi/EwUT7kkQuXpGyJpjfzB+OSV HJYn4PBtDPmZFR3StTNes55P5j+l7Aeyxwdg+tDB0O+oS3nT7Ta8Ap3UPlM3QCnGwJxV+3 xpTdliWlaqNelGgUFfE8Cwn/I4i8RFF34mSSLNwwIazLRuHBwVXW8MGDVh7pFA== 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 4bcX2q5sZJz19Q; Wed, 09 Jul 2025 08:58:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5698wx2o044742; Wed, 9 Jul 2025 08:58:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5698wxMF044739; Wed, 9 Jul 2025 08:58:59 GMT (envelope-from git) Date: Wed, 9 Jul 2025 08:58:59 GMT Message-Id: <202507090858.5698wxMF044739@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 2811ec176c40 - main - pfctl: Fix file descriptor leak due to popfile() never closing the main config file. 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2811ec176c402ab007ce1897f4c1a344cdb02723 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=2811ec176c402ab007ce1897f4c1a344cdb02723 commit 2811ec176c402ab007ce1897f4c1a344cdb02723 Author: Kristof Provost AuthorDate: 2025-07-03 09:13:41 +0000 Commit: Kristof Provost CommitDate: 2025-07-09 08:57:48 +0000 pfctl: Fix file descriptor leak due to popfile() never closing the main config file. The fix is the same as for other parse.y files in the tree (see bgpd(8) or unwind(8)) ok bluhm@ Obtained from: OpenBSD, tobhe , da1e1ceac5 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/parse.y | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index af1fb95398f8..dd6fb0116aea 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -95,7 +95,7 @@ static struct file { int eof_reached; int lineno; int errors; -} *file; +} *file, *topfile; struct file *pushfile(const char *, int); int popfile(void); int check_file_secrecy(int, const char *); @@ -6743,7 +6743,7 @@ lgetc(int quotec) if (quotec) { if ((c = igetc()) == EOF) { yyerror("reached end of file while parsing quoted string"); - if (popfile() == EOF) + if (file == topfile || popfile() == EOF) return (EOF); return (quotec); } @@ -6771,7 +6771,7 @@ lgetc(int quotec) return ('\n'); } while (c == EOF) { - if (popfile() == EOF) + if (file == topfile || popfile() == EOF) return (EOF); c = igetc(); } @@ -7069,17 +7069,17 @@ popfile(void) { struct file *prev; - if ((prev = TAILQ_PREV(file, files, entry)) != NULL) { + if ((prev = TAILQ_PREV(file, files, entry)) != NULL) prev->errors += file->errors; - TAILQ_REMOVE(&files, file, entry); - fclose(file->stream); - free(file->name); - free(file->ungetbuf); - free(file); - file = prev; - return (0); - } - return (EOF); + + TAILQ_REMOVE(&files, file, entry); + fclose(file->stream); + free(file->name); + free(file->ungetbuf); + free(file); + file = prev; + + return (file ? 0 : EOF); } int @@ -7102,6 +7102,7 @@ parse_config(char *filename, struct pfctl *xpf) warn("cannot open the main config file!"); return (-1); } + topfile = file; yyparse(); errors = file->errors; From nobody Wed Jul 9 08:59:00 2025 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 4bcX2s16cWz61NHV; Wed, 09 Jul 2025 08:59:01 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcX2s0L9tz3cQd; Wed, 09 Jul 2025 08:59:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752051541; 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=Q/xv5Dp+IIA/O8wOq4dDfbtXfx4Q00PvSA0FFKCzAUc=; b=YKjvaXKHLwkR6ZKzel00tIFUQalOwTY0ZpujT5jFdiMnp6gtVkjgs+Rc1jwUrETnSD60nG 7SQ/RVz8Ij20e2d49Aa7s2wKg52868txyL6VG1qyM6Y8KUV1smyYZ79+mbotxp/k7Em2HW +fFMoKMyu2jvXTl9BNELpXBcy0rCHxj0hD6lfHPkhU7Wa6xx8oG75SaTCT1xlwzKy36+8h AD5IDD+Ep2NNRGOa2JTC/6uGyyDdiWcpzpqJyFRbXa5r/ZbqagD9hBH142kzGSWzuh+6Uv m2TYMRNc59UebSGAFl6UfNvoihTjIdQvqqP1pvL63ohrmLluxgKlzEUWgsGJ/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752051541; 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=Q/xv5Dp+IIA/O8wOq4dDfbtXfx4Q00PvSA0FFKCzAUc=; b=IRFrRd1RquXpenjTUcNhrvdilh4ok0Eu0jucmZlLy63L8yyG0K+DDMNB+1gOzjdcXEtay2 hjkdYumwndiHES+PRpQXHs1djF1GQbvB8K5h1dMoUlUqjDm9On8nrNtmoAOaPcbrN8Ewb+ m2+xid/AfOAXo+xFxbj1GkNBxZ3JklBAMzo6iVJGlWuMZsFqsA+SrgCn+jfN0ex3HhRd8g aq6Uf007fSv/pyFqhzKdekp3cbcbFNU6Gqx2ybyXsZznFVkHw0AQFoXuTMcdI60g4aerAt M4ShVjtsfOWfyXna3ZjYtriMEc/3w8EN3CfLOYkWzLSr4+zLcAwJdXX5vwJneQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752051541; a=rsa-sha256; cv=none; b=kIlR6bW1w5Oe8esRjSaGlFFwZwkOyDijAm/XCkjKUD/1sQq21FII4VxErvcWViKXtAJbUT NhbA6odfuJS6mAXiJmxTe1o4It/rHMPAoj99CVtbe0lU5NckUdlKt8bHOxmDJ3OFFfqz/Y L01XSp/eUZz25FNh2MfF9rwDQxrtkUSiIIkfdp1lbLBVydozKBaIrklxfkMDjpMd0kpL10 7hHFJcRQLVO8Ko+u2PIol02NiYbVJ7Pzu+oWKGL6/f1BDvHCJUP+KkqEeRGfSx/gQgJuXJ HyozSZhTyH/+hvFz/AGO0m5RCFeufx3ECZ9gMFLNG5WoG0+ejDZvCUo/UIrIiQ== 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 4bcX2r6pMhz19R; Wed, 09 Jul 2025 08:59:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5698x0YC044782; Wed, 9 Jul 2025 08:59:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5698x0Sv044780; Wed, 9 Jul 2025 08:59:00 GMT (envelope-from git) Date: Wed, 9 Jul 2025 08:59:00 GMT Message-Id: <202507090859.5698x0Sv044780@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: cface4d97af3 - main - pf: Use -1 to indicate an invalid uid/gid, not UID_MAX and GID_MAX. 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cface4d97af3a84b7c4caa1ccd9090afcafe4a66 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=cface4d97af3a84b7c4caa1ccd9090afcafe4a66 commit cface4d97af3a84b7c4caa1ccd9090afcafe4a66 Author: Kristof Provost AuthorDate: 2025-07-03 09:26:37 +0000 Commit: Kristof Provost CommitDate: 2025-07-09 08:57:48 +0000 pf: Use -1 to indicate an invalid uid/gid, not UID_MAX and GID_MAX. This is clearer and more consistent with the rest of the kernel. OK deraadt@ sashan@ Obtained from: OpenBSD, millert , d04cdf616e Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/if_pflog.c | 2 +- sys/netpfil/pf/pf.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/netpfil/pf/if_pflog.c b/sys/netpfil/pf/if_pflog.c index 6a87ea2471cb..0a84f9d680ac 100644 --- a/sys/netpfil/pf/if_pflog.c +++ b/sys/netpfil/pf/if_pflog.c @@ -289,7 +289,7 @@ pflog_packet(uint8_t action, u_int8_t reason, if (pd->lookup.done > 0) hdr.uid = pd->lookup.uid; else - hdr.uid = UID_MAX; + hdr.uid = -1; hdr.pid = NO_PID; hdr.rule_uid = rm->cuid; hdr.rule_pid = rm->cpid; diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 127b29320acb..d5f01e5c4956 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -4579,7 +4579,7 @@ pf_match_port(u_int8_t op, u_int16_t a1, u_int16_t a2, u_int16_t p) static int pf_match_uid(u_int8_t op, uid_t a1, uid_t a2, uid_t u) { - if (u == UID_MAX && op != PF_OP_EQ && op != PF_OP_NE) + if (u == -1 && op != PF_OP_EQ && op != PF_OP_NE) return (0); return (pf_match(op, a1, a2, u)); } @@ -4587,7 +4587,7 @@ pf_match_uid(u_int8_t op, uid_t a1, uid_t a2, uid_t u) static int pf_match_gid(u_int8_t op, gid_t a1, gid_t a2, gid_t g) { - if (g == GID_MAX && op != PF_OP_EQ && op != PF_OP_NE) + if (g == -1 && op != PF_OP_EQ && op != PF_OP_NE) return (0); return (pf_match(op, a1, a2, g)); } @@ -4914,8 +4914,8 @@ pf_socket_lookup(struct pf_pdesc *pd) struct inpcbinfo *pi; struct inpcb *inp; - pd->lookup.uid = UID_MAX; - pd->lookup.gid = GID_MAX; + pd->lookup.uid = -1; + pd->lookup.gid = -1; switch (pd->proto) { case IPPROTO_TCP: From nobody Wed Jul 9 08:59:01 2025 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 4bcX2t2xQdz61N2W; Wed, 09 Jul 2025 08:59:02 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcX2t1NBjz3cQn; Wed, 09 Jul 2025 08:59:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752051542; 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=HiwRI8ova0KrSJbbOwY1rhUn7cMZhlkcBx72NIJ2nsE=; b=tkTMZTWJyn6GMUaC3hU8wwe8npK7F1fOuvAX86/a+48FFGNuXW4IMsACSm+1a6iErunuYd eLu4o1GM06XrcBcPXgk1WDBmkBL4tysx+G+rSJnguNJ+vCHy1TzPaN9kYvmnaxoO2TQyjV RCNKTiIK2WLQPeF3uttzCFEmXhDWFhD77KdTyTBuoCYJM9j3po/eEIQ5xFu3q+S9cyagoj 8RiRUQO0KkDuXWbeDygZM7iqNRNSKY39HiwQmrEvNg94NfA5aHveb+6EQXqyvywMR1DVtw 8jbV52TWRGAD0T5ZVQKAuFW6R5wdpqAH3HKqS0Z+8bkokPs0qMddEmGyXtgAbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752051542; 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=HiwRI8ova0KrSJbbOwY1rhUn7cMZhlkcBx72NIJ2nsE=; b=wARM7sDsNe5G+Ewepvyq4yBJURliBbXs415MGjkpCRgNj0n+cIi9tCSjJB4amh1UQJeOJ+ OmjpdYUommvKRWh71lsHb5bEMxfQitSrHcUcNsJhvDUIC2GEqb8gKHefsE5WaZsFgI+Kur OIwf0DvW0qSMGPQsTVcUeUjIvJ6hpb0/mvJA7/yl2yKEgyLtDzmcSLrWygZtihKRhovCIm dDAFCpq62CjIM/jO6d9HCeY8c5xTEPXYQQ+gCIHGrkC+KutOP/BzRynMOo9SYXOVeWcCif ogcP/Hjd5RLmAk4GqSlqJtJDv9PRrr7ShQmgEG3++878zG3jpthNjuzTEsKjxQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752051542; a=rsa-sha256; cv=none; b=I4TscnBFq12fPISXn6RvFI0Jt99xqD8iQWANw6etXRaTT8duQQpcyUooxtNAwrFLEyM020 MgdksFS8XXNon/NDtV5lALFZvL8hY4WVymva2IrHkjqqG49nGaK0pkUGKOz6GRsMgTj/vK MMkppnd4G3Lx1f2jtLR82SzTml/JE0j+GPB1udmSpHzNrTgKiguQi80fttimIBly1UHcjt hB74Mq0J04yJwbpD+uAta8etsj8ST+GsYV4jzaVwBzdHs0qKknq7KzGeyWrC4oK6RubAQa itpn6uDIxs1tLnH6xxvlHfHoCp2S9bUF0jtfRRBNHpjvASHB/zb3093Sb5cdMw== 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 4bcX2t0fQ7z15m; Wed, 09 Jul 2025 08:59:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5698x1qi044822; Wed, 9 Jul 2025 08:59:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5698x1bu044819; Wed, 9 Jul 2025 08:59:01 GMT (envelope-from git) Date: Wed, 9 Jul 2025 08:59:01 GMT Message-Id: <202507090859.5698x1bu044819@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 19973701098c - main - pfctl: Use -1 to indicate an invalid uid/gid, not UID_MAX and GID_MAX. 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 19973701098c8fce38a990ee78f66fab4f4f6a5c Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=19973701098c8fce38a990ee78f66fab4f4f6a5c commit 19973701098c8fce38a990ee78f66fab4f4f6a5c Author: Kristof Provost AuthorDate: 2025-07-03 12:01:41 +0000 Commit: Kristof Provost CommitDate: 2025-07-09 08:57:48 +0000 pfctl: Use -1 to indicate an invalid uid/gid, not UID_MAX and GID_MAX. This is the userland portion. OK deraadt@ sashan@ Obtained from: OpenBSD, millert , b4de054894 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/parse.y | 12 ++++++------ sbin/pfctl/pfctl_parser.c | 16 +++++++--------- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index dd6fb0116aea..28f461bf715d 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -3905,7 +3905,7 @@ uid_item : uid { $$->tail = $$; } | unaryop uid { - if ($2 == UID_MAX && $1 != PF_OP_EQ && $1 != PF_OP_NE) { + if ($2 == -1 && $1 != PF_OP_EQ && $1 != PF_OP_NE) { yyerror("user unknown requires operator = or " "!="); YYERROR; @@ -3920,7 +3920,7 @@ uid_item : uid { $$->tail = $$; } | uid PORTBINARY uid { - if ($1 == UID_MAX || $3 == UID_MAX) { + if ($1 == -1 || $3 == -1) { yyerror("user unknown requires operator = or " "!="); YYERROR; @@ -3938,7 +3938,7 @@ uid_item : uid { uid : STRING { if (!strcmp($1, "unknown")) - $$ = UID_MAX; + $$ = -1; else { uid_t uid; @@ -3983,7 +3983,7 @@ gid_item : gid { $$->tail = $$; } | unaryop gid { - if ($2 == GID_MAX && $1 != PF_OP_EQ && $1 != PF_OP_NE) { + if ($2 == -1 && $1 != PF_OP_EQ && $1 != PF_OP_NE) { yyerror("group unknown requires operator = or " "!="); YYERROR; @@ -3998,7 +3998,7 @@ gid_item : gid { $$->tail = $$; } | gid PORTBINARY gid { - if ($1 == GID_MAX || $3 == GID_MAX) { + if ($1 == -1 || $3 == -1) { yyerror("group unknown requires operator = or " "!="); YYERROR; @@ -4016,7 +4016,7 @@ gid_item : gid { gid : STRING { if (!strcmp($1, "unknown")) - $$ = GID_MAX; + $$ = -1; else { gid_t gid; diff --git a/sbin/pfctl/pfctl_parser.c b/sbin/pfctl/pfctl_parser.c index 26a213c3ffd9..29d51214e2e5 100644 --- a/sbin/pfctl/pfctl_parser.c +++ b/sbin/pfctl/pfctl_parser.c @@ -68,7 +68,7 @@ void print_op (u_int8_t, const char *, const char *); void print_port (u_int8_t, u_int16_t, u_int16_t, const char *, int); -void print_ugid (u_int8_t, unsigned, unsigned, const char *, unsigned); +void print_ugid (u_int8_t, id_t, id_t, const char *); void print_flags (uint16_t); void print_fromto(struct pf_rule_addr *, pf_osfp_t, struct pf_rule_addr *, sa_family_t, u_int8_t, int, int); @@ -364,14 +364,14 @@ print_port(u_int8_t op, u_int16_t p1, u_int16_t p2, const char *proto, int numer } void -print_ugid(u_int8_t op, unsigned u1, unsigned u2, const char *t, unsigned umax) +print_ugid(u_int8_t op, id_t i1, id_t i2, const char *t) { char a1[11], a2[11]; - snprintf(a1, sizeof(a1), "%u", u1); - snprintf(a2, sizeof(a2), "%u", u2); + snprintf(a1, sizeof(a1), "%lu", i1); + snprintf(a2, sizeof(a2), "%lu", i2); printf(" %s", t); - if (u1 == umax && (op == PF_OP_EQ || op == PF_OP_NE)) + if (i1 == -1 && (op == PF_OP_EQ || op == PF_OP_NE)) print_op(op, "unknown", a2); else print_op(op, a1, a2); @@ -977,11 +977,9 @@ print_rule(struct pfctl_rule *r, const char *anchor_call, int verbose, int numer printf(" %sreceived-on %s", r->rcvifnot ? "!" : "", r->rcv_ifname); if (r->uid.op) - print_ugid(r->uid.op, r->uid.uid[0], r->uid.uid[1], "user", - UID_MAX); + print_ugid(r->uid.op, r->uid.uid[0], r->uid.uid[1], "user"); if (r->gid.op) - print_ugid(r->gid.op, r->gid.gid[0], r->gid.gid[1], "group", - GID_MAX); + print_ugid(r->gid.op, r->gid.gid[0], r->gid.gid[1], "group"); if (r->flags || r->flagset) { printf(" flags "); print_flags(r->flags); From nobody Wed Jul 9 08:59:03 2025 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 4bcX2w02Fkz61N2X; Wed, 09 Jul 2025 08:59:04 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcX2v2Yb4z3cL9; Wed, 09 Jul 2025 08:59:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752051543; 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=oCoEQHr4+pueIBjdMNV1BVCGiJd+iSJNqevsgIjFCjw=; b=H9L0N1mNfpTNVKACKS68qiaxJb4XuhhJDuCmgR61yN5Wrre838ZroEaAN24sxz2ZNX4iqb vLNwi6XfzdhrZ0HuTmLCZbOpSGysr49rjXPPPfKPokj3OYa2RddnX3CzR2GLvbTUu2AnPT TOYHFy6oV8fAUnf0laU7bZYR4BxcWuIE54bkSn9tcCfFt2pIbldARy0j8vrTD826URX/7a bXgRhMlosjiRIeeihaQe+EnDsLJn9ErJRyiq76tnysJ0zNK0XflD5d8nvhqgcC9tPtmfbX VSfu0BBVH3xZ1dyacq/GZg/RQ0+W7mEXTKJQ1FMb/P3+so3uckY58j2csEAbfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752051543; 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=oCoEQHr4+pueIBjdMNV1BVCGiJd+iSJNqevsgIjFCjw=; b=q9YqcBSllzM8EjHKlUsajU03GDdVduoWJiBtQaDqZO+ZRHsS/v2U0m9f2SURDe4PKKdQYO LeYcKU+15mMIFUky5bd3hf3KnpVwWsWkf5tN8japSMBaV4XriTcmRYMaVAJ63ppd1PuuOr cEbsZjAyyaABANV/A33scOGkorldRi/JWFLE1dsekIVpyDBF7vtiLN8Vc2EsScQYp/ln8f wsTGpPopyhClkeLdSOW4HZ5soKVRQbthb7yZQtFfGxtlPnVPpyvIz+EGQuzRFf4VVgjUvt Foarc3lL1ZSOwh5r6+RrrC8S8uZzPmuWRBKgYs/IW2RBdY4+UGWTutgyr+mW4g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752051543; a=rsa-sha256; cv=none; b=X9SjEmIOfXocJFxtF9h871otkFhbtaGJzD+ru18jZjQkQtTARwoKAmpDAE3VyuXt4Yo4dN yM0pRXkrcJ6pPuRUeZqpKbyS0qjWqV3cFP8Kb+iJmybkYOyW5X1FhYKanu43rqnUqlJN7h 6nW5wUKetpH6M2WDUnXdWCCciYuW0flPbWmLvwzoUO+zxu2/tXPZH9lNuj/RCbcfxmp/PO UpcuPAxVl5uEn4N28ookmnOiVRx1OAz5tZScrrDWTMZtDKQWvC4LkKyeCQQ/FKrJj8qIXG tRc4jcHikzdRG5fBTgM9zMcJNCwfdX7dwcFPKSTviN2hypc6NjtWqwSmLOqOlw== 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 4bcX2v1clBz1GH; Wed, 09 Jul 2025 08:59:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5698x3kn044857; Wed, 9 Jul 2025 08:59:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5698x3gw044854; Wed, 9 Jul 2025 08:59:03 GMT (envelope-from git) Date: Wed, 9 Jul 2025 08:59:03 GMT Message-Id: <202507090859.5698x3gw044854@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 4869cc8e545d - main - pf: Use proper NUL byte not zero with strings 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4869cc8e545d795fa1274b06aa3bcc43db20ef33 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=4869cc8e545d795fa1274b06aa3bcc43db20ef33 commit 4869cc8e545d795fa1274b06aa3bcc43db20ef33 Author: Kristof Provost AuthorDate: 2025-07-03 12:13:08 +0000 Commit: Kristof Provost CommitDate: 2025-07-09 08:57:48 +0000 pf: Use proper NUL byte not zero with strings No object change OK sashan Obtained from: OpenBSD, kn , ad87be15a4 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf_ioctl.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index 357b2be194a5..9cd7cea340a6 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -2699,7 +2699,7 @@ pf_ioctl_get_addr(struct pf_nl_pooladdr *pp) PF_RULES_RLOCK_TRACKER; - pp->anchor[sizeof(pp->anchor) - 1] = 0; + pp->anchor[sizeof(pp->anchor) - 1] = '\0'; PF_RULES_RLOCK(); pool = pf_get_kpool(pp->anchor, pp->ticket, pp->r_action, @@ -2732,7 +2732,7 @@ pf_ioctl_get_rulesets(struct pfioc_ruleset *pr) PF_RULES_RLOCK_TRACKER; - pr->path[sizeof(pr->path) - 1] = 0; + pr->path[sizeof(pr->path) - 1] = '\0'; PF_RULES_RLOCK(); if ((ruleset = pf_find_kruleset(pr->path)) == NULL) { @@ -2771,7 +2771,7 @@ pf_ioctl_get_ruleset(struct pfioc_ruleset *pr) return (ENOENT); } - pr->name[0] = 0; + pr->name[0] = '\0'; if (ruleset == &pf_main_ruleset) { /* XXX kludge for pf_main_ruleset */ RB_FOREACH(anchor, pf_kanchor_global, &V_pf_anchors) @@ -3502,7 +3502,7 @@ DIOCADDRULENV_error: break; } - pr->anchor[sizeof(pr->anchor) - 1] = 0; + pr->anchor[sizeof(pr->anchor) - 1] = '\0'; /* Frees rule on error */ error = pf_ioctl_addrule(rule, pr->ticket, pr->pool_ticket, @@ -3514,7 +3514,7 @@ DIOCADDRULENV_error: case DIOCGETRULES: { struct pfioc_rule *pr = (struct pfioc_rule *)addr; - pr->anchor[sizeof(pr->anchor) - 1] = 0; + pr->anchor[sizeof(pr->anchor) - 1] = '\0'; error = pf_ioctl_getrules(pr); @@ -3653,7 +3653,7 @@ DIOCGETRULENV_error: u_int32_t nr = 0; int rs_num; - pcr->anchor[sizeof(pcr->anchor) - 1] = 0; + pcr->anchor[sizeof(pcr->anchor) - 1] = '\0'; if (pcr->action < PF_CHANGE_ADD_HEAD || pcr->action > PF_CHANGE_GET_TICKET) { @@ -4498,7 +4498,7 @@ DIOCGETSTATESV2_full: struct pf_kruleset *ruleset; struct pfi_kkif *kif = NULL; - pca->anchor[sizeof(pca->anchor) - 1] = 0; + pca->anchor[sizeof(pca->anchor) - 1] = '\0'; if (pca->action < PF_CHANGE_ADD_HEAD || pca->action > PF_CHANGE_REMOVE) { @@ -4629,7 +4629,7 @@ DIOCCHANGEADDR_error: case DIOCGETRULESETS: { struct pfioc_ruleset *pr = (struct pfioc_ruleset *)addr; - pr->path[sizeof(pr->path) - 1] = 0; + pr->path[sizeof(pr->path) - 1] = '\0'; error = pf_ioctl_get_rulesets(pr); break; @@ -4638,7 +4638,7 @@ DIOCCHANGEADDR_error: case DIOCGETRULESET: { struct pfioc_ruleset *pr = (struct pfioc_ruleset *)addr; - pr->path[sizeof(pr->path) - 1] = 0; + pr->path[sizeof(pr->path) - 1] = '\0'; error = pf_ioctl_get_ruleset(pr); break; @@ -5362,7 +5362,7 @@ DIOCCHANGEADDR_error: PF_RULES_WLOCK(); /* First makes sure everything will succeed. */ for (i = 0, ioe = ioes; i < io->size; i++, ioe++) { - ioe->anchor[sizeof(ioe->anchor) - 1] = 0; + ioe->anchor[sizeof(ioe->anchor) - 1] = '\0'; switch (ioe->rs_num) { case PF_RULESET_ETH: ers = pf_find_keth_ruleset(ioe->anchor); From nobody Wed Jul 9 08:59:04 2025 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 4bcX2w5D72z61NVm; Wed, 09 Jul 2025 08:59:04 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcX2w3Fxqz3cRC; Wed, 09 Jul 2025 08:59:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752051544; 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=rA7TMfjk5fTH22fJ2jGkFSSWWURSY6D/G3ZwYNaUh34=; b=DSFgF4SSxWk+472T0ouNjNR3BcP6SzrZcpwcJCVVznI4NIAEut/OsehV8wsvzb0h943cL4 RgX32cDJRKGIcmGSZ3EniaepwcUvB5pPjrOd9YZEdpDOlLNS71wt6ig/EUQEvJkr3zJXXj cL7QkhRBdEYQoS/4iVE1LdicByxd2+go5epvqsHwkB/9mR8swAybAbbtWSozPrkpCU9n0C QIU867zpyhs8YMFO8bM9oArBW/2l8J5ohh4Lva3Ru9fyFU8V3ex9BdKl9MgYg4LoOrBm5e 85CBtbmPD8vib2Qr3ST5Ss1Hv7N+3wnwvrQ/06RBzI8L9FPvEYrGDroUFTL+pw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752051544; 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=rA7TMfjk5fTH22fJ2jGkFSSWWURSY6D/G3ZwYNaUh34=; b=hhPYOAiBscq4ovH/e0x/h6ggTg+HGA0qA/ySCfWvdicA4AkbPLXoNe+qTGPHU+ZvzAliUz vuwsuxm1cbd/wAK+mHv9OMa+iZRBKr8y3ZgxOMLckBC0taq75aoZlQkS+DFHnVHVkexZn0 U4/oCT97bSyWR5xbSL7DMt9z1nRfto1wtS9FuREs2//epcJHXWZBTZ8ttX77kfeLmgzRm2 eK9/mXz9kCnJHySCTan4a0zQ6HiX12d1bocz7kOpwkkyZB9DX1YX272PcZH+NAaFaK+Y/p gx3YouLjTxHMqnt4CXpp9Q9x6BK027xigRXPMGEbu67PA9fPNZejxcRxQbMX+w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752051544; a=rsa-sha256; cv=none; b=Z+NVNwKZUBW7whj7nubiYGUs8HmH7q04tsxutu5lKErcj0wrugRYBUUYxBjWpPfgd/eG4v zRqq54Q8lo5TUqBC4iHqfQ8cK5IGaOLsxhpnguneKqRnSKPaJ9oFdONdtL3LxOiyHzeIYt /bVk+3/ldeSNiYJiW7bGBYVt2ddOvIx4j9Gx7GxbneltxHHDvvmjXozv6B5axWVlZy9gDi TsuV6gmZwRkfLxDjDKceijiuEhzKzxFp98ZfB8ammhhfAfzMPw+77Aq3ikKAVENwU/gQ7/ YlIwJxGyZWNtWQFUL7+g0ey0g1IDzn/3Irav+j/CC0ivn60VP+Y1gpgoGeuu3w== 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 4bcX2w2YCgz13H; Wed, 09 Jul 2025 08:59:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5698x4Cx044892; Wed, 9 Jul 2025 08:59:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5698x4Fc044889; Wed, 9 Jul 2025 08:59:04 GMT (envelope-from git) Date: Wed, 9 Jul 2025 08:59:04 GMT Message-Id: <202507090859.5698x4Fc044889@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 881c36681d9d - main - pfctl: Fix function name in error message (zap trailing s) 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 881c36681d9deabd69b87c4d533ec683965e106b Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=881c36681d9deabd69b87c4d533ec683965e106b commit 881c36681d9deabd69b87c4d533ec683965e106b Author: Kristof Provost AuthorDate: 2025-07-03 12:48:07 +0000 Commit: Kristof Provost CommitDate: 2025-07-09 08:57:49 +0000 pfctl: Fix function name in error message (zap trailing s) Obtained from: OpenBSD, kn , 5b2c7c2215 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/pfctl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c index defba3b56c44..8c6d6833dd3b 100644 --- a/sbin/pfctl/pfctl.c +++ b/sbin/pfctl/pfctl.c @@ -2038,8 +2038,8 @@ pfctl_load_ruleset(struct pfctl *pf, char *path, struct pfctl_ruleset *rs, if ((pf->opts & PF_OPT_NOACTION) == 0 && (error = pfctl_ruleset_trans(pf, path, rs->anchor, false))) { - printf("pfctl_load_rulesets: " - "pfctl_ruleset_trans %d\n", error); + printf("%s: " + "pfctl_ruleset_trans %d\n", __func__, error); goto error; } } else if (pf->opts & PF_OPT_VERBOSE) From nobody Wed Jul 9 08:59:05 2025 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 4bcX2x5NqGz61NKh; Wed, 09 Jul 2025 08:59:05 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcX2x3qjhz3cLl; Wed, 09 Jul 2025 08:59:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752051545; 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=YXjl1onoV/L8Tk2xkKvtXWi1NRkUvgwVUbugoBnlfLk=; b=fMze+y5VVRbtiiAbZ+zTSy1N60BZdNVyHohLZdspDfjHndfSZUTFDC5BKZX7gW/mDVj3Re 9zHKld5/Yx71+zCApdktAFGwIr3JTsZcPRo4Foy/uLCf4qe3ilDhPaef2fV1IkEyS2u2cm rGvBF7jMi5QpQPzxscR1UU2AoN9sXBzNnhfMBu353x1Kujr8ltUZuR35dCXeWNuUz7qPgv Lsl5QCoJZJuaIgRFGNnLixG4cQmhKQ7qhkOxmvMtPXfscgr65ANWPGmsKNcqet+SFVzcFj gtzRVO3aFEtOa2ktBbjNl1eNiaE4ar7IHM3d1iEuhFb8FyZu/bQp8oaD12KNvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752051545; 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=YXjl1onoV/L8Tk2xkKvtXWi1NRkUvgwVUbugoBnlfLk=; b=iV2b/rmqA2AkWAqIb/xl6Me7i1yLCIPZ1WhLb7Ef2NEL+mjKJtbDR0WwBOsKzsvwBWwrfW DBh5XQsWwwZj4jMZjPIJBXGH8KVnz/HQK1Y9adv6SfaQw1OZcF9TT0NvOMJRkHjJEUD0DI nlX3hI4o16XPAodULSoqt7S84+8wcxZYBgkscpXe4sm/6AKcoOwswlbM7spqitqWy8ICY1 a2wnKc9oWqFvt7lD2a5noTutMxJupTSTn8CgT6HFtOdGev9oJhpSUmGwr84lWQj3x4i6JA xXiOcgUvM7eJKzBYwVZZAMSiUiSi5fPejV/zDBL+/FjmLiCI/Id/90syhOwy+w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752051545; a=rsa-sha256; cv=none; b=vqPMi45yfZVdckj5K9Wo2AddeCiFpfRJDt4gacrU9gMAeCD8VMhBbeQ4xJqpyJloQ17WnJ WFKO9H2FHkuOIjbq4XbD1J8d/+ZpP57z86v2uNT3IewWjLjRFW8VqM7GyRvb/uH2vVwhmq hSLoNmV7pMes7dFaLYnLbL+LqukZC/MDytzs3MWR4YfNMdciM0fsQ0cc1G8BflksswOrD/ BD9rPqeN3pK6hsN78wi8872mij4x+eR8Wa7RGG2kN7xnR93AE+sZzdmhhbKuLiqdxXRYB3 LRGhoi9cdQkI8ChUjF35pG5S4i0Swc4VGJ84Ll7WbyB2OD1T/Wj7qDFK7UkuwQ== 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 4bcX2x3Gk4z1D2; Wed, 09 Jul 2025 08:59:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5698x5fH044925; Wed, 9 Jul 2025 08:59:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5698x5gD044922; Wed, 9 Jul 2025 08:59:05 GMT (envelope-from git) Date: Wed, 9 Jul 2025 08:59:05 GMT Message-Id: <202507090859.5698x5gD044922@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: f97839e05c06 - main - pfctl: Avoid optimizing empty rulesets 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f97839e05c062a74940b2c501a08b1dd972cdc33 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=f97839e05c062a74940b2c501a08b1dd972cdc33 commit f97839e05c062a74940b2c501a08b1dd972cdc33 Author: Kristof Provost AuthorDate: 2025-07-03 12:49:32 +0000 Commit: Kristof Provost CommitDate: 2025-07-09 08:57:49 +0000 pfctl: Avoid optimizing empty rulesets All optimizations work on actual rules; if there are none, return early. While here, tell which ruleset/anchor is being optimized to make the debug message actually useful. OK mikeb Obtained from: OpenBSD, kn , 757f1589f1 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/pfctl_optimize.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sbin/pfctl/pfctl_optimize.c b/sbin/pfctl/pfctl_optimize.c index b58bace326c2..e727324bbf40 100644 --- a/sbin/pfctl/pfctl_optimize.c +++ b/sbin/pfctl/pfctl_optimize.c @@ -273,7 +273,10 @@ pfctl_optimize_ruleset(struct pfctl *pf, struct pfctl_ruleset *rs) struct pfctl_rule *r; struct pfctl_rulequeue *old_rules; - DEBUG("optimizing ruleset"); + if (TAILQ_EMPTY(rs->rules[PF_RULESET_FILTER].active.ptr)) + return (0); + + DEBUG("optimizing ruleset \"%s\"", rs->anchor->path); memset(&table_buffer, 0, sizeof(table_buffer)); skip_init(); TAILQ_INIT(&opt_queue); From nobody Wed Jul 9 08:59:06 2025 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 4bcX2y6yW9z61NSj; Wed, 09 Jul 2025 08:59:06 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcX2y4vGKz3cWK; Wed, 09 Jul 2025 08:59:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752051546; 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=XdBAJdIXCdAuiN6O8vGlfsRtxPnG8ZIGsFfLgUo6ls8=; b=RSpoX9Z7tbM9JLnVzD/rsJVkVxODpLHLa5LQ+u8XDnPHEx6uzXJYThqxdCvGDQe5JPk/ep u+mdIJlOeUrY4mI0IdELIO+5TIXfZp1fG50qycdRtXs4oyx087oFpe7lv5LNm9c3HsJOi9 KTI4oR1jxF4SkdhGxtN6iEiv5FC069vUoT/8oIzGiilLQ9cMdiNmZKSf2CXYmlu7+VCExq MlLAuokIZrO59SAA1oqcPMA3vrKbhGA4SwRByutuZAp5RQ4wSZQFrEsyeSUybUgrHEIgNc uX/vhDyJ82bAapAhTvCSUtYRK1dVbPN6A/AuuvgKHdnu/cEG4FQHgziWbCRMEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752051546; 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=XdBAJdIXCdAuiN6O8vGlfsRtxPnG8ZIGsFfLgUo6ls8=; b=kKwJ+YsW/8DIL7HRe8dy+8QOWYLhzvx06TenqE2MLF+ATiib+McQrXbNzHjxqJKlz0Deyx RKGVPG5FwhQ4ceJpqXQFjAvRjFXFtQF4FajO9wHrwYd/eskuXrMJnI19dnNsITMaE/t80j m3g1yJQPWoUm99S0XUvjRE5sBPpRiptoPlZvoPF7oUbUaGVn57V04Y4kkDt1+M5pjHi7qq 8/bRuAckFLnWaajvqwK/bhexxFv7MQnOLTSC8BD9nvKmQQWb4mQqgYr69QIXVN9Y+d1kdk s8oEvkf8mUXLb7s9JYq2bPdHh+MWI7Xn15PSUECjoKIoMpaXWGQIX3rvyGm9hg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752051546; a=rsa-sha256; cv=none; b=O4tytP3FRpIsepaPHehcIKxaxdFSZ+BVew1UNWRS+nK9pm9CEcCBcFor7aUUZoY70tjkbH hvBVW1OJdYuZyaV4sSoAb3YaxQRlpU/uIbWWYnCcSbcJZSzkbQEUoWwhCeyL6JSvAWTX8m xxjIp349lfqhgUpV4YpZn81NPlM6b/jEimksqeb77uLF4U8/691Yimlk9LO5nBd7lVIopx 5xuK61eMHEI51ahCelVnav1hufNoY95VToSzRBKPFV2GKShiS0DbETDb12xT3racCMkfDO 4Ja1v7eZ7ydE72Ymjw6qZxQZH5tcrNg1fDhjJ28NylEqkJRBv/d/daZUHcKhUA== 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 4bcX2y4V8Vz190; Wed, 09 Jul 2025 08:59:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5698x6qq044958; Wed, 9 Jul 2025 08:59:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5698x6Iv044955; Wed, 9 Jul 2025 08:59:06 GMT (envelope-from git) Date: Wed, 9 Jul 2025 08:59:06 GMT Message-Id: <202507090859.5698x6Iv044955@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: e5a99196e269 - main - pf: deduplicate the ioctl and netlink NATLOOK handling 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e5a99196e269bd397a0c533dea792eaceb80a2a4 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=e5a99196e269bd397a0c533dea792eaceb80a2a4 commit e5a99196e269bd397a0c533dea792eaceb80a2a4 Author: Kristof Provost AuthorDate: 2025-07-03 15:16:21 +0000 Commit: Kristof Provost CommitDate: 2025-07-09 08:57:49 +0000 pf: deduplicate the ioctl and netlink NATLOOK handling Factor out handling of NATLOOK to a separate function so we can use it for both the ioctl and netlink implementation. Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/net/pfvar.h | 1 + sys/netpfil/pf/pf_ioctl.c | 97 +++++++++++++++++++++++++---------------------- sys/netpfil/pf/pf_nl.c | 68 +++++++-------------------------- 3 files changed, 66 insertions(+), 100 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 1416f0c2cdbe..0970f041cb1b 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -2670,6 +2670,7 @@ int pf_ioctl_get_addrs(struct pf_nl_pooladdr *); int pf_ioctl_get_addr(struct pf_nl_pooladdr *); int pf_ioctl_get_rulesets(struct pfioc_ruleset *); int pf_ioctl_get_ruleset(struct pfioc_ruleset *); +int pf_ioctl_natlook(struct pfioc_natlook *); void pf_krule_free(struct pf_krule *); void pf_krule_clear_counters(struct pf_krule *); diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index 9cd7cea340a6..8a3f311d7d30 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -2796,6 +2796,56 @@ pf_ioctl_get_ruleset(struct pfioc_ruleset *pr) return (error); } +int +pf_ioctl_natlook(struct pfioc_natlook *pnl) +{ + struct pf_state_key *sk; + struct pf_kstate *state; + struct pf_state_key_cmp key; + int m = 0, direction = pnl->direction; + int sidx, didx; + + /* NATLOOK src and dst are reversed, so reverse sidx/didx */ + sidx = (direction == PF_IN) ? 1 : 0; + didx = (direction == PF_IN) ? 0 : 1; + + if (!pnl->proto || + PF_AZERO(&pnl->saddr, pnl->af) || + PF_AZERO(&pnl->daddr, pnl->af) || + ((pnl->proto == IPPROTO_TCP || + pnl->proto == IPPROTO_UDP) && + (!pnl->dport || !pnl->sport))) + return (EINVAL); + + bzero(&key, sizeof(key)); + key.af = pnl->af; + key.proto = pnl->proto; + pf_addrcpy(&key.addr[sidx], &pnl->saddr, pnl->af); + key.port[sidx] = pnl->sport; + pf_addrcpy(&key.addr[didx], &pnl->daddr, pnl->af); + key.port[didx] = pnl->dport; + + state = pf_find_state_all(&key, direction, &m); + if (state == NULL) + return (ENOENT); + + if (m > 1) { + PF_STATE_UNLOCK(state); + return (E2BIG); /* more than one state */ + } + + sk = state->key[sidx]; + pf_addrcpy(&pnl->rsaddr, + &sk->addr[sidx], sk->af); + pnl->rsport = sk->port[sidx]; + pf_addrcpy(&pnl->rdaddr, + &sk->addr[didx], sk->af); + pnl->rdport = sk->port[didx]; + PF_STATE_UNLOCK(state); + + return (0); +} + static int pfioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags, struct thread *td) { @@ -4133,51 +4183,8 @@ DIOCGETSTATESV2_full: case DIOCNATLOOK: { struct pfioc_natlook *pnl = (struct pfioc_natlook *)addr; - struct pf_state_key *sk; - struct pf_kstate *state; - struct pf_state_key_cmp key; - int m = 0, direction = pnl->direction; - int sidx, didx; - - /* NATLOOK src and dst are reversed, so reverse sidx/didx */ - sidx = (direction == PF_IN) ? 1 : 0; - didx = (direction == PF_IN) ? 0 : 1; - - if (!pnl->proto || - PF_AZERO(&pnl->saddr, pnl->af) || - PF_AZERO(&pnl->daddr, pnl->af) || - ((pnl->proto == IPPROTO_TCP || - pnl->proto == IPPROTO_UDP) && - (!pnl->dport || !pnl->sport))) - error = EINVAL; - else { - bzero(&key, sizeof(key)); - key.af = pnl->af; - key.proto = pnl->proto; - pf_addrcpy(&key.addr[sidx], &pnl->saddr, pnl->af); - key.port[sidx] = pnl->sport; - pf_addrcpy(&key.addr[didx], &pnl->daddr, pnl->af); - key.port[didx] = pnl->dport; - - state = pf_find_state_all(&key, direction, &m); - if (state == NULL) { - error = ENOENT; - } else { - if (m > 1) { - PF_STATE_UNLOCK(state); - error = E2BIG; /* more than one state */ - } else { - sk = state->key[sidx]; - pf_addrcpy(&pnl->rsaddr, - &sk->addr[sidx], sk->af); - pnl->rsport = sk->port[sidx]; - pf_addrcpy(&pnl->rdaddr, - &sk->addr[didx], sk->af); - pnl->rdport = sk->port[didx]; - PF_STATE_UNLOCK(state); - } - } - } + + error = pf_ioctl_natlook(pnl); break; } diff --git a/sys/netpfil/pf/pf_nl.c b/sys/netpfil/pf/pf_nl.c index d5d6dc70255e..73933c022ca2 100644 --- a/sys/netpfil/pf/pf_nl.c +++ b/sys/netpfil/pf/pf_nl.c @@ -1256,23 +1256,13 @@ pf_handle_clear_status(struct nlmsghdr *hdr, struct nl_pstate *npt) return (0); } -struct pf_nl_natlook { - sa_family_t af; - uint8_t direction; - uint8_t proto; - struct pf_addr src; - struct pf_addr dst; - uint16_t sport; - uint16_t dport; -}; - -#define _OUT(_field) offsetof(struct pf_nl_natlook, _field) +#define _OUT(_field) offsetof(struct pfioc_natlook, _field) static const struct nlattr_parser nla_p_natlook[] = { { .type = PF_NL_AF, .off = _OUT(af), .cb = nlattr_get_uint8 }, { .type = PF_NL_DIRECTION, .off = _OUT(direction), .cb = nlattr_get_uint8 }, { .type = PF_NL_PROTO, .off = _OUT(proto), .cb = nlattr_get_uint8 }, - { .type = PF_NL_SRC_ADDR, .off = _OUT(src), .cb = nlattr_get_in6_addr }, - { .type = PF_NL_DST_ADDR, .off = _OUT(dst), .cb = nlattr_get_in6_addr }, + { .type = PF_NL_SRC_ADDR, .off = _OUT(saddr), .cb = nlattr_get_in6_addr }, + { .type = PF_NL_DST_ADDR, .off = _OUT(daddr), .cb = nlattr_get_in6_addr }, { .type = PF_NL_SRC_PORT, .off = _OUT(sport), .cb = nlattr_get_uint16 }, { .type = PF_NL_DST_PORT, .off = _OUT(dport), .cb = nlattr_get_uint16 }, }; @@ -1282,63 +1272,31 @@ NL_DECLARE_PARSER(natlook_parser, struct genlmsghdr, nlf_p_empty, nla_p_natlook) static int pf_handle_natlook(struct nlmsghdr *hdr, struct nl_pstate *npt) { - struct pf_nl_natlook attrs = {}; - struct pf_state_key_cmp key = {}; + struct pfioc_natlook attrs = {}; struct nl_writer *nw = npt->nw; - struct pf_state_key *sk; - struct pf_kstate *state; struct genlmsghdr *ghdr_new; - int error, m = 0; - int sidx, didx; + int error; error = nl_parse_nlmsg(hdr, &natlook_parser, npt, &attrs); if (error != 0) return (error); - if (attrs.proto == 0 || - PF_AZERO(&attrs.src, attrs.af) || - PF_AZERO(&attrs.dst, attrs.af) || - ((attrs.proto == IPPROTO_TCP || attrs.proto == IPPROTO_UDP) && - (attrs.sport == 0 || attrs.dport == 0))) - return (EINVAL); - - /* NATLOOK src and dst are reversed, so reverse sidx/didx */ - sidx = (attrs.direction == PF_IN) ? 1 : 0; - didx = (attrs.direction == PF_IN) ? 0 : 1; - - key.af = attrs.af; - key.proto = attrs.proto; - pf_addrcpy(&key.addr[sidx], &attrs.src, attrs.af); - key.port[sidx] = attrs.sport; - pf_addrcpy(&key.addr[didx], &attrs.dst, attrs.af); - key.port[didx] = attrs.dport; - - state = pf_find_state_all(&key, attrs.direction, &m); - if (state == NULL) - return (ENOENT); - if (m > 1) { - PF_STATE_UNLOCK(state); - return (E2BIG); - } + error = pf_ioctl_natlook(&attrs); + if (error != 0) + return (error); - if (!nlmsg_reply(nw, hdr, sizeof(struct genlmsghdr))) { - PF_STATE_UNLOCK(state); + if (!nlmsg_reply(nw, hdr, sizeof(struct genlmsghdr))) return (ENOMEM); - } ghdr_new = nlmsg_reserve_object(nw, struct genlmsghdr); ghdr_new->cmd = PFNL_CMD_NATLOOK; ghdr_new->version = 0; ghdr_new->reserved = 0; - sk = state->key[sidx]; - - nlattr_add_in6_addr(nw, PF_NL_SRC_ADDR, &sk->addr[sidx].v6); - nlattr_add_in6_addr(nw, PF_NL_DST_ADDR, &sk->addr[didx].v6); - nlattr_add_u16(nw, PF_NL_SRC_PORT, sk->port[sidx]); - nlattr_add_u16(nw, PF_NL_DST_PORT, sk->port[didx]); - - PF_STATE_UNLOCK(state); + nlattr_add_in6_addr(nw, PF_NL_SRC_ADDR, &attrs.rsaddr.v6); + nlattr_add_in6_addr(nw, PF_NL_DST_ADDR, &attrs.rdaddr.v6); + nlattr_add_u16(nw, PF_NL_SRC_PORT, attrs.rsport); + nlattr_add_u16(nw, PF_NL_DST_PORT, attrs.rdport); if (!nlmsg_end(nw)) { nlmsg_abort(nw); From nobody Wed Jul 9 08:59:07 2025 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 4bcX300yXtz61NQ5; Wed, 09 Jul 2025 08:59:08 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcX2z5K5bz3cWb; Wed, 09 Jul 2025 08:59:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752051547; 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=JWC8VkEer5V4/KJii3mwfhvlGP3duq/ZvivWBpGVzaQ=; b=SP94KoAj4IgypnBdsh3hHfJzKuvB5S/1UDdOeRzpFM4GxarCzSWIWakb6WadaEeV14VsPj ao8ID/7zOGhhn4JkF3t8pOSGqqfvWZhnnBYHZBSFxVX1/L3yr/fSO+kTK73ZC2NzL6m9XY rZNLCWPEH+OJ8dal/JyIrLCTPMhTSpxwaeMYrrgv4TDjX7vqitUF4UT6+UPN88gf1swbt6 b3omIVzD3wSGM2zHiUFEAkyt5zTXfObKlJVwFVsP6Z2/QF/ULSflKh2NnoCUfYDHwu8Fx3 n1jOhL+vfEFkKdWhto6CqI2+9KLIJ1sOJA5Z0nEYMcOyD1TnGd0w8PB1DFx2Jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752051547; 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=JWC8VkEer5V4/KJii3mwfhvlGP3duq/ZvivWBpGVzaQ=; b=Ce0Qx7dw9non2r5eUkTLPV8mY7cyC+RD/oTTT9GYKsxGnY17m5l3vhADvDh0FDz8MTPRLG iTBO1FD99XhWCW4lxLeE6wWWWl+3mpDAEdtJHpdr2UpGUxb3dm5KLJrkk/rPSIuXDdAmT6 VVHZwITnFscEqd6vwSIu37Cm+NQNBSrnX5G5zDGMzgTDiYjFDs9NChlgKfbwjhfBFHAK6v MlNoEHYXEZ14jYzD9R/o7uFZ6k5ODQTXffjQefZ/U2cP3hfpY7ePD0QJXdMkuziV+8a/W/ m59fryvHa4/l8ydGjNVfnIvwJ+O+o7y5s/y5DlHz4Og5M5i+AMU0Ni+ELLswBg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752051547; a=rsa-sha256; cv=none; b=PBEc7YeONtJUExw7mmlOidmvuK7PK0CL0qZfPMVCxpFFthn5oUw0OOpHBDHNza1jLVKfjP tkc8LnYUvta2KAajccukcTTDRxHbGKrscywQkXtv3VEE8350XXyyfhZCA02sMqtQEuqWkk pwzfnD/DLsLw1b8Ip83liUlicN4dNyv1fWAH6kbLrf2gAXFEebnd81bi1TbZNaS/wADo92 3SJgFzFD1ON6mbcW+J8eJwfm0hY2NVNkWok3K7DKBUGmkAaU8QwfEl/uENCUgIP/CojUOl AnhfR+/nn1lzJHqc9OJBM7jDquIe79rJf0AY9oiI7DqisRWOb8jZ4IGtabFLjQ== 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 4bcX2z4tm1z1D3; Wed, 09 Jul 2025 08:59:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5698x7Ac044992; Wed, 9 Jul 2025 08:59:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5698x7HA044989; Wed, 9 Jul 2025 08:59:07 GMT (envelope-from git) Date: Wed, 9 Jul 2025 08:59:07 GMT Message-Id: <202507090859.5698x7HA044989@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: e97ce7c66ee0 - main - pf: improve DIOCNATLOOK validation 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e97ce7c66ee0ab0afe58695b6922ff310262d7c5 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=e97ce7c66ee0ab0afe58695b6922ff310262d7c5 commit e97ce7c66ee0ab0afe58695b6922ff310262d7c5 Author: Kristof Provost AuthorDate: 2025-07-03 15:23:46 +0000 Commit: Kristof Provost CommitDate: 2025-07-09 08:57:49 +0000 pf: improve DIOCNATLOOK validation Check address family of pf ioctl(2) DIOCNATLOOK parameter at kernel entry instead of calling panic() due to unhandled af. Reported-by: syzbot+92be143c2dd1746cf2af@syzkaller.appspotmail.com from Benjamin Baier Also validate the direction. Obtained from: OpenBSD, bluhm , 4804479228 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf_ioctl.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index 8a3f311d7d30..737f9ca060c5 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -2817,6 +2817,28 @@ pf_ioctl_natlook(struct pfioc_natlook *pnl) (!pnl->dport || !pnl->sport))) return (EINVAL); + switch (pnl->direction) { + case PF_IN: + case PF_OUT: + case PF_INOUT: + break; + default: + return (EINVAL); + } + + switch (pnl->af) { +#ifdef INET + case AF_INET: + break; +#endif /* INET */ +#ifdef INET6 + case AF_INET6: + break; +#endif /* INET6 */ + default: + return (EAFNOSUPPORT); + } + bzero(&key, sizeof(key)); key.af = pnl->af; key.proto = pnl->proto; From nobody Wed Jul 9 08:59:08 2025 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 4bcX312CJYz61N2Z; Wed, 09 Jul 2025 08:59:09 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcX306qthz3ccM; Wed, 09 Jul 2025 08:59:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752051549; 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=OIisq4u4Qiunf3hEs5i7FrBAw93QTuPEBEXfkhBngZ4=; b=Tc4vpOONNKI5M4rHTExD2+pq0p1Cmo98d/i2AyolOzHLqlJmHXG1imO5aXf4I8NsUAqU3L g7V58pHoK72pNXzFsXfRebyMsODtpEIjUvCXwaYUmckjvwmnGE7a21l4i3FjMhzqyFChhs zHZvfL+kDV7IX2J0zoy3MvOafOLo4yGJch5B8GNBX47cs7SDt9mBydAmdYwFZsPz0HKKOc lMHaNx/lkoTGX6/jGrnNBgv1niBFM3XUKkvC6SBKMGP4G49521VnElOAsOQR/CaFcaXB5T g67QulAbq09lLlgW37LHhQiqRDkcrrIe7wjoOVa0tkECLBxIOsPujH6MURcbqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752051549; 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=OIisq4u4Qiunf3hEs5i7FrBAw93QTuPEBEXfkhBngZ4=; b=pvvPtlmvHoRH2nrXKZ32mt4iNb/osHSyXPrQsdFvQLwWFye3Kevz3PifTXn3RaRwY7ArN5 b2SbWEGT2CAUSgCt3MxJXeZ8pqcGgec5HhTq9UoNOOm3KOyqwzdOmvJGoi8sLrJj6CeZEl 6odd9NkU/8eit+kyZOPU3M/d4VCAoOjb3q29Yk48lW/b0rSJM8JWOEsq+Jo8kOiClH5hR0 8n99tXkcrzJFtZN/+tbKPqWrOZEgKGibNvf+QkuYTrwe9OIEcNo4uz/a7uef/cWsrzMsa+ boCjp4EA4FqbL99Im8MDUtcfQ1zs3097CNut3/0uFG0zYLRh3W8iLuRvF35JbQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752051549; a=rsa-sha256; cv=none; b=fLHAEkX5B6uppNJ1MKVxM+Fx8TD/Z1pwremBASQ54wAGCAlsW57RpuWRjf5vcg1S6ur8aY 4QdSSlv2Tm1CTlG+xx+m2IMqhn0p5+LFdXqhOy8zmq/6KgP3P/tKP2DZbWbfr659SiLWtu vSEsiW3JEgSo3Mq1QAOTYAXhsc3WX88w5j0zfAPVGlmNx7qJrRUEuyQS4feanTAtMorxHq hVqu89ycZwELA+VoArwwNXvJC3/UhGGAWWYGnsiI+uRr7lkSXxeWEEdXVzXgzSON6wMFVF TvjOcogBoS/IPcOkqTtAbaeqxKCbGVToFGthWJlp6YK8AoMPHc6LQ4w//mrUag== 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 4bcX3066xXz4v; Wed, 09 Jul 2025 08:59:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5698x8gA045030; Wed, 9 Jul 2025 08:59:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5698x8Q8045027; Wed, 9 Jul 2025 08:59:08 GMT (envelope-from git) Date: Wed, 9 Jul 2025 08:59:08 GMT Message-Id: <202507090859.5698x8Q8045027@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 6b95d258a96b - main - pf tests: test DIOCNATLOOK validation 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6b95d258a96b7f3a7d61af5c3fb028194ca8f204 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=6b95d258a96b7f3a7d61af5c3fb028194ca8f204 commit 6b95d258a96b7f3a7d61af5c3fb028194ca8f204 Author: Kristof Provost AuthorDate: 2025-07-03 15:07:52 +0000 Commit: Kristof Provost CommitDate: 2025-07-09 08:57:49 +0000 pf tests: test DIOCNATLOOK validation Sponsored by: Rubicon Communications, LLC ("Netgate") --- tests/sys/netpfil/pf/ioctl/validation.c | 35 +++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/tests/sys/netpfil/pf/ioctl/validation.c b/tests/sys/netpfil/pf/ioctl/validation.c index 1ce8999dcb91..18fafe11c6ab 100644 --- a/tests/sys/netpfil/pf/ioctl/validation.c +++ b/tests/sys/netpfil/pf/ioctl/validation.c @@ -32,6 +32,7 @@ #include #include +#include #include #include @@ -893,6 +894,39 @@ ATF_TC_CLEANUP(rpool_mtx2, tc) COMMON_CLEANUP(); } +ATF_TC_WITH_CLEANUP(natlook); +ATF_TC_HEAD(natlook, tc) +{ + atf_tc_set_md_var(tc, "require.user", "root"); +} + +ATF_TC_BODY(natlook, tc) +{ + struct pfioc_natlook nl = { 0 }; + + COMMON_HEAD(); + + nl.af = AF_INET; + nl.proto = IPPROTO_ICMP; + nl.saddr.v4.s_addr = 0x01020304; + nl.daddr.v4.s_addr = 0x05060708; + + /* Invalid direction */ + nl.direction = 42; + + ATF_CHECK_ERRNO(EINVAL, ioctl(dev, DIOCNATLOOK, &nl) == -1); + + /* Invalid af */ + nl.direction = PF_IN; + nl.af = 99; + + ATF_CHECK_ERRNO(EAFNOSUPPORT, ioctl(dev, DIOCNATLOOK, &nl) == -1); +} + +ATF_TC_CLEANUP(natlook, tc) +{ + COMMON_CLEANUP(); +} ATF_TP_ADD_TCS(tp) { @@ -918,6 +952,7 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, tag); ATF_TP_ADD_TC(tp, rpool_mtx); ATF_TP_ADD_TC(tp, rpool_mtx2); + ATF_TP_ADD_TC(tp, natlook); return (atf_no_error()); } From nobody Wed Jul 9 08:59:09 2025 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 4bcX322Hrwz61NB4; Wed, 09 Jul 2025 08:59:10 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcX320HYbz3cjC; Wed, 09 Jul 2025 08:59:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752051550; 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=ddpEG+FyyKpWbeBd4buCkd5srtixFTD1HeLt4MmPD2I=; b=EigVDXNQMf/SlS1OEBt9bwRAz44isahgwd1F3QKUtkBm7XZl0mrSztdgri+mqBabYrv4lR 2O18okeQQgHLbK40kJU+Tu6wEAO/7w+R7u/59Cxts41z92Q8XnMhGD7Hu10Q6B7pnMpAUA P8L3tZ/kzugq45NpJwoTwAtvEo4CVSXVPiLVzfQt4IdA0f8yICmfYKmfjMe/FLA13+GPbb l7FqfcSFfeNilr07Uh4PFe6GuE0CMuv/yJ+lsw84n1ZTslK4yzB206YVVUCtm1p2PE1zJI ELUUOsCvM/yXdlbSbXpZRRQXOpdwiWB19jrwOJtaMZh2WpsT8kiZ5KUMuhQ9fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752051550; 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=ddpEG+FyyKpWbeBd4buCkd5srtixFTD1HeLt4MmPD2I=; b=IEiFqLyFx9y+PACxGUiemRY11q2OmgycNOTkmy+YZAIAKgjWvhf9JNUUnk+mgfq4H9Zogx eZNjwu6Jll5+F7dvF5TaTgFUQtn85NQ+MmmIKjdjgmFcMQL5/K9qWsjjDW1tXmTtNtlPUs cRsyfuX6A9GbGOmNZhMyh9Qbe1Vg28XsojC1djCYTv0V41Vh/h8ssyFu1KqCUCkg3QbWVn L1O0FdhIQ6lXJLQGHlYt2628dDL4Z6qDnlA5sSOUKIpIpkTt1nlEAvaMQwPMkhWwymm4lw MFZLbmGjqsul42+EsC3LIzQqH9am9Qys1iCjAJdBBpqi2IHcfAV2ciLdf0GERw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752051550; a=rsa-sha256; cv=none; b=CIogkSKhsJBabAzC2WKOQnoHZy7htH6l/MMylcHhtVpcwUuvFZNoYmWge+P4IxqkOhKdhY RtaBrk6uV2IZLHureAmf9kDyt5AfBK16zIx0y8ofMCW62Yy5iztbwZvtSuhN2+/lf9jsEY PbTqbOPErphGZYa2QuKA8xAQ6NmgEC250hzgJS0hU/O+cduCvLeY6Cnf+IvoqRheVsjhVf Xye2EKvfgrQJim8N7GAmeLRMjh8mvSCAHJWEn9DjYJ/KuYMtjmOPj7viHKeloIEwvwbrK0 LGT5H1Stf/ZOXibfEaecEGvilL66qP7nG/cWuYZDj/XtPCJVn2qWCng9Ix215A== 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 4bcX316n19z191; Wed, 09 Jul 2025 08:59:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5698x9Bh045064; Wed, 9 Jul 2025 08:59:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5698x9kQ045061; Wed, 9 Jul 2025 08:59:09 GMT (envelope-from git) Date: Wed, 9 Jul 2025 08:59:09 GMT Message-Id: <202507090859.5698x9kQ045061@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 1f86253fabc8 - main - pf: assert that we call pf_addrcpy() with a valid address family 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1f86253fabc8a2db79e8fe7c43602a4776c1a8b1 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=1f86253fabc8a2db79e8fe7c43602a4776c1a8b1 commit 1f86253fabc8a2db79e8fe7c43602a4776c1a8b1 Author: Kristof Provost AuthorDate: 2025-07-03 15:08:31 +0000 Commit: Kristof Provost CommitDate: 2025-07-09 08:57:50 +0000 pf: assert that we call pf_addrcpy() with a valid address family Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/net/pfvar.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 0970f041cb1b..36fab1a03ee6 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -551,6 +551,9 @@ extern struct sx pf_end_lock; #endif /* PF_INET_INET6 */ #ifdef _KERNEL + +void unhandled_af(int) __dead2; + static void inline pf_addrcpy(struct pf_addr *dst, const struct pf_addr *src, sa_family_t af) { @@ -565,6 +568,8 @@ pf_addrcpy(struct pf_addr *dst, const struct pf_addr *src, sa_family_t af) memcpy(&dst->v6, &src->v6, sizeof(dst->v6)); break; #endif /* INET6 */ + default: + unhandled_af(af); } } #endif @@ -2300,7 +2305,6 @@ VNET_DECLARE(struct pf_krule *, pf_rulemarker); #define V_pf_rulemarker VNET(pf_rulemarker) #endif -void unhandled_af(int) __dead2; int pf_start(void); int pf_stop(void); void pf_initialize(void); From nobody Wed Jul 9 08:59:11 2025 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 4bcX333x6jz61NQ9; Wed, 09 Jul 2025 08:59:11 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcX331NT1z3cZG; Wed, 09 Jul 2025 08:59:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752051551; 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=b6WRYVMccrXdDIVM4tuhi+nnMXXCunxGgEZDUqGEKWE=; b=xxWAOG68YLQWAAx6R41Fu07vOEm5YAzs2to/J+Tt4EedEW3BSIAzfh8hipI+Xlt3JxXozc SsA2Q5nfY4sycr9n/49TNICuGTAXarIr2nYabtxU0Yg4bdACovIOUDuZ8friFXrxsoFR7m gOnFJzR91eej3I9KSrBWzvu8EjD3MqsX30Moo3Q26Os1KDbrjyjm56IHRJL8tW+C6OK/fJ C07sDF4NyRWtaGERdFg3NFW/Ox8rCV7W9gieQocyKlTjnH12Opi2Tr9/uAVx2avWhkNbM1 wk6507XA/iIRZ6Cx/uXUvtlIy8uCXGUNZPM7l8tZPkDpyD1xayvvQ4aqmc299Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752051551; 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=b6WRYVMccrXdDIVM4tuhi+nnMXXCunxGgEZDUqGEKWE=; b=hfNxv5WWcdRc0lmcFwxYZM9dJdvrp1LVJqbC19AudQ7GfYL2nc9WACqSu7XCFL7ITu63GL 39GK61bpj/Bz9KkHQ20EVWXfbwCSOF06LB/JfJqnoA9qnFP+Hr5KeVn4OroRriXlsUsPXP mX5lcO3gklBkC4BKhmDfP15SjVqO25hP+ubTOEZczNcbU5ZPczuZA7W9KJ9k4ZSLrM2kjn ZqJeOit/XBlsFqPJvJM015pky3o1IU17Ad8RYqOBv0mYdaTSsA4Nwu+j+U+o1gnw1/7+qA SKXqLmuDj8TsPN5G3tM4B+drLi7bYSgznZoJBgrhuLj+Sm6XZF6YX0WCl1Aifw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752051551; a=rsa-sha256; cv=none; b=F1D2UBlXCVb2C13x+DnvlLpU0nl4/xtv0YF88AKDGUXh/Nygbl354FtvfrQ5OaHm8zZmCi Pdmh4Mdk3Zq5TGMUYvQdm0qnvOdfUXGIY9QkBd5G3YuS7WDdHkucLg0rPY3PJ/g+oWPElQ Is6IQBE+4uKn+XR/JJsipcbJ9uWPDVoJ2a/xi/0fhYxD4GoE0W/nSZ4uT5R2p4c8j3pTYt j7CyqaU3OVW9mekQeVeVa6f5JF4x/knj+NAA2naFkxxtBDu0wKBHYRuK76BNZvBCsjRxoN vDsCNGxm5cOKss339ffexiMD6IHFZiyDpGisrivJ82oj/1P2ZCprh+528m/eKA== 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 4bcX330w52z192; Wed, 09 Jul 2025 08:59:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5698xBMB045096; Wed, 9 Jul 2025 08:59:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5698xBgw045093; Wed, 9 Jul 2025 08:59:11 GMT (envelope-from git) Date: Wed, 9 Jul 2025 08:59:11 GMT Message-Id: <202507090859.5698xBgw045093@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: be763b0e57be - main - pf: clean up pf_ioctl_addrule() error handling 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: be763b0e57be7de314c543452ef909f0e65a29f0 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=be763b0e57be7de314c543452ef909f0e65a29f0 commit be763b0e57be7de314c543452ef909f0e65a29f0 Author: Kristof Provost AuthorDate: 2025-07-04 11:06:56 +0000 Commit: Kristof Provost CommitDate: 2025-07-09 08:57:50 +0000 pf: clean up pf_ioctl_addrule() error handling On error immediately stop work rather than continuing and handling the error later. Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf_ioctl.c | 38 +++++++++++++++++--------------------- 1 file changed, 17 insertions(+), 21 deletions(-) diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index 737f9ca060c5..c96741023db9 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -2155,51 +2155,51 @@ pf_ioctl_addrule(struct pf_krule *rule, uint32_t ticket, rule->rcv_kif = NULL; if (rule->rtableid > 0 && rule->rtableid >= rt_numfibs) - error = EBUSY; + ERROUT(EBUSY); #ifdef ALTQ /* set queue IDs */ if (rule->qname[0] != 0) { if ((rule->qid = pf_qname2qid(rule->qname)) == 0) - error = EBUSY; + ERROUT(EBUSY); else if (rule->pqname[0] != 0) { if ((rule->pqid = pf_qname2qid(rule->pqname)) == 0) - error = EBUSY; + ERROUT(EBUSY); } else rule->pqid = rule->qid; } #endif if (rule->tagname[0]) if ((rule->tag = pf_tagname2tag(rule->tagname)) == 0) - error = EBUSY; + ERROUT(EBUSY); if (rule->match_tagname[0]) if ((rule->match_tag = pf_tagname2tag(rule->match_tagname)) == 0) - error = EBUSY; + ERROUT(EBUSY); if (rule->rt && !rule->direction) - error = EINVAL; + ERROUT(EINVAL); if (!rule->log) rule->logif = 0; if (! pf_init_threshold(&rule->pktrate, rule->pktrate.limit, rule->pktrate.seconds)) - error = ENOMEM; + ERROUT(ENOMEM); if (pf_addr_setup(ruleset, &rule->src.addr, rule->af)) - error = ENOMEM; + ERROUT(ENOMEM); if (pf_addr_setup(ruleset, &rule->dst.addr, rule->af)) - error = ENOMEM; + ERROUT(ENOMEM); if (pf_kanchor_setup(rule, ruleset, anchor_call)) - error = EINVAL; + ERROUT(EINVAL); if (rule->scrub_flags & PFSTATE_SETPRIO && (rule->set_prio[0] > PF_PRIO_MAX || rule->set_prio[1] > PF_PRIO_MAX)) - error = EINVAL; + ERROUT(EINVAL); for (int i = 0; i < 3; i++) { TAILQ_FOREACH(pa, &V_pf_pabuf[i], entries) if (pa->addr.type == PF_ADDR_TABLE) { pa->addr.p.tbl = pfr_attach_table(ruleset, pa->addr.v.tblname); if (pa->addr.p.tbl == NULL) - error = ENOMEM; + ERROUT(ENOMEM); } } @@ -2207,7 +2207,7 @@ pf_ioctl_addrule(struct pf_krule *rule, uint32_t ticket, if (rule->overload_tblname[0]) { if ((rule->overload_tbl = pfr_attach_table(ruleset, rule->overload_tblname)) == NULL) - error = EINVAL; + ERROUT(EINVAL); else rule->overload_tbl->pfrkt_flags |= PFR_TFLAG_ACTIVE; @@ -2230,23 +2230,19 @@ pf_ioctl_addrule(struct pf_krule *rule, uint32_t ticket, if (((rule->action == PF_NAT) || (rule->action == PF_RDR) || (rule->action == PF_BINAT)) && rule->anchor == NULL && TAILQ_FIRST(&rule->rdr.list) == NULL) { - error = EINVAL; + ERROUT(EINVAL); } if (rule->rt > PF_NOPFROUTE && (TAILQ_FIRST(&rule->route.list) == NULL)) { - error = EINVAL; + ERROUT(EINVAL); } if (rule->action == PF_PASS && (rule->rdr.opts & PF_POOL_STICKYADDR || rule->nat.opts & PF_POOL_STICKYADDR) && !rule->keep_state) { - error = EINVAL; + ERROUT(EINVAL); } - if (error) { - pf_free_rule(rule); - rule = NULL; - ERROUT(error); - } + MPASS(error == 0); rule->nat.cur = TAILQ_FIRST(&rule->nat.list); rule->rdr.cur = TAILQ_FIRST(&rule->rdr.list); From nobody Wed Jul 9 08:59:12 2025 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 4bcX343rPLz61NB6; Wed, 09 Jul 2025 08:59:12 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcX341jdlz3cgW; Wed, 09 Jul 2025 08:59:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752051552; 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=NMUUWKCglIZD3L1MBRSH1kn64ZUADtbY6Kj5w190W2Y=; b=VOxKt5b39+hrOPRqhiNFceFJLx0HBTNJ13qyWtT378tSel4l3UnkuDiWh4f7ts1hMeiyad QVWcIR0fFNrng63hPMtLIfScAF/iQObf4KNQBA4CgBljOk4bK5lTzXIgee1Z28SXwDniV6 6ul8ZorKhGNNBZ0T1CFgnaK4vqb6psIBb26qnBP/NQ7B5X2i3ageaTBIFuH0mxteFUeyi/ SLqa6tL8PlXRKXogJ7mAFMAOq6KZq0e3DUu86rwSQMYdTDtmfCpLZpzWYf3OLGI5muRZ42 RRkZwYM8RYUOcJCOJRua8wnvCKhFtnisuTv5MMIVmgOLRVZak9RxV9DNgQq++Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752051552; 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=NMUUWKCglIZD3L1MBRSH1kn64ZUADtbY6Kj5w190W2Y=; b=yMfEXgpr2aFc8PftoDzC+ZuJlfUsTRLUu7W6I95hVYAwopALWBKLd8t/SqRLK/5yNTLPWU h8kFYMsZm/Rlos+98jounlQmYMuDk5LczcwX94pj3PRuOh3E/Y1i/aAV7hONA2Az+8RrV5 QKGupvFbX3LmLUyC97B1DpgmYCNhQYsbmynZ3yYRcAb3ND6SpoC4Ho2fg1tGbXExTn52ew gcp9vsu3AZGP5zjGD7XWtVw2jiIwM3rTUN6To1C8O//VmiLGO1ekavcDn0etHadWxcck2P jrEq6FBcvtaw853R+g3Qfs8cL0DSVHoRzOvKCR41Kl8Fr50DykFX60qI/fPGWA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752051552; a=rsa-sha256; cv=none; b=kCy380VEPdzTWxRdW/sKylq7zIwdoiaVMTysze4e2adCmf8lQcFioFgCxYqBmSNsxyGFIj ByD3y6sdcHTvqBu+YE7V9qrsbtvpU0uirbMy7lU1g8VEwM7E+229kIgYcrdachREuGzoTb VSFNG4ZzqEZdHN7Qwkbk5Pg18qUhhMIVZ56hzy5a0Y0Jd+xcguE/5w3C/w7ahKC8sKB1C5 QkuqDRxDlVM3bsLpym7WrGfM6axU+86T8EWczaMPbr1ZG6Sk61SVE/5gR286l96qHZ64DA pFyTmC7T/D6A9KNcgyuKGLRijxTid0z/reRaR7YvfjbPOCDLzsroQfWIvE5+7w== 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 4bcX341KPhz15n; Wed, 09 Jul 2025 08:59:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5698xC4k045128; Wed, 9 Jul 2025 08:59:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5698xCc6045125; Wed, 9 Jul 2025 08:59:12 GMT (envelope-from git) Date: Wed, 9 Jul 2025 08:59:12 GMT Message-Id: <202507090859.5698xCc6045125@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 041ce1d690f1 - main - pfctl: recursively flush rules and tables 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 041ce1d690f1c58bd4a93ab808ded53444af2092 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=041ce1d690f1c58bd4a93ab808ded53444af2092 commit 041ce1d690f1c58bd4a93ab808ded53444af2092 Author: Kristof Provost AuthorDate: 2025-07-04 21:34:48 +0000 Commit: Kristof Provost CommitDate: 2025-07-09 08:57:50 +0000 pfctl: recursively flush rules and tables The recursive operation ("pfctl -a '*' ...") works for '-s' option already. This change enables the same thing for '-F' option, so "pfctl -a '*' -Fa" will flush everything from PF driver. The idea was discussed with many on tech@ in spring 2019. OK kn@ Obtained from: OpenBSD, sashan , ae711728d4 Obtained from: OpenBSD, sashan , 7abd52e24a Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/pfctl.8 | 9 +- sbin/pfctl/pfctl.c | 289 +++++++++++++++++++++++++++++++++++++++------- sbin/pfctl/pfctl.h | 12 +- sbin/pfctl/pfctl_osfp.c | 2 +- sbin/pfctl/pfctl_parser.h | 1 + sbin/pfctl/pfctl_table.c | 15 ++- 6 files changed, 277 insertions(+), 51 deletions(-) diff --git a/sbin/pfctl/pfctl.8 b/sbin/pfctl/pfctl.8 index 28efff896956..2566bca57a28 100644 --- a/sbin/pfctl/pfctl.8 +++ b/sbin/pfctl/pfctl.8 @@ -24,7 +24,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd July 2, 2025 +.Dd July 4, 2025 .Dt PFCTL 8 .Os .Sh NAME @@ -186,6 +186,13 @@ as the anchor name: .Bd -literal -offset indent # pfctl -a '*' -sr .Ed +.Pp +To flush all rulesets and tables recursively, specify only +.Sq * +as the anchor name: +.Bd -literal -offset indent +# pfctl -a '*' -Fa +.Ed .It Fl D Ar macro Ns = Ns Ar value Define .Ar macro diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c index 8c6d6833dd3b..254bd054ae4a 100644 --- a/sbin/pfctl/pfctl.c +++ b/sbin/pfctl/pfctl.c @@ -59,6 +59,8 @@ #include #include #include +#include +#include #include "pfctl_parser.h" #include "pfctl.h" @@ -72,7 +74,7 @@ void pfctl_check_skip_ifaces(char *); void pfctl_adjust_skip_ifaces(struct pfctl *); void pfctl_clear_interface_flags(int, int); void pfctl_flush_eth_rules(int, int, char *); -void pfctl_flush_rules(int, int, char *); +int pfctl_flush_rules(int, int, char *); void pfctl_flush_nat(int, int, char *); int pfctl_clear_altq(int, int); void pfctl_clear_src_nodes(int, int); @@ -124,6 +126,17 @@ int pfctl_load_ruleset(struct pfctl *, char *, int pfctl_load_rule(struct pfctl *, char *, struct pfctl_rule *, int); const char *pfctl_lookup_option(char *, const char * const *); void pfctl_reset(int, int); +int pfctl_walk_show(int, struct pfioc_ruleset *, void *); +int pfctl_walk_get(int, struct pfioc_ruleset *, void *); +int pfctl_walk_anchors(int, int, const char *, + int(*)(int, struct pfioc_ruleset *, void *), void *); +struct pfr_anchors * + pfctl_get_anchors(int, char *, int); +int pfctl_recurse(int, int, char *, + int(*)(int, int, struct pfr_anchoritem *)); +int pfctl_call_clearrules(int, int, struct pfr_anchoritem *); +int pfctl_call_cleartables(int, int, struct pfr_anchoritem *); +int pfctl_call_clearanchors(int, int, struct pfr_anchoritem *); static struct pfctl_anchor_global pf_anchors; struct pfctl_anchor pf_main_anchor; @@ -151,6 +164,7 @@ int dev = -1; struct pfctl_handle *pfh = NULL; static int first_title = 1; static int labels = 0; +static int exit_val = 0; #define INDENT(d, o) do { \ if (o) { \ @@ -269,6 +283,40 @@ usage(void) exit(1); } +void +pfctl_err(int opts, int eval, const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + + if ((opts & PF_OPT_IGNFAIL) == 0) + verr(eval, fmt, ap); + else + vwarn(fmt, ap); + + va_end(ap); + + exit_val = eval; +} + +void +pfctl_errx(int opts, int eval, const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + + if ((opts & PF_OPT_IGNFAIL) == 0) + verrx(eval, fmt, ap); + else + vwarnx(fmt, ap); + + va_end(ap); + + exit_val = eval; +} + /* * Cache protocol number to name translations. * @@ -361,7 +409,7 @@ pfctl_clear_stats(struct pfctl_handle *h, int opts) { int ret; if ((ret = pfctl_clear_status(h)) != 0) - errc(1, ret, "DIOCCLRSTATUS"); + pfctl_err(opts, 1, "DIOCCLRSTATUS"); if ((opts & PF_OPT_QUIET) == 0) fprintf(stderr, "pf: statistics cleared\n"); } @@ -469,16 +517,19 @@ pfctl_flush_eth_rules(int dev, int opts, char *anchorname) fprintf(stderr, "Ethernet rules cleared\n"); } -void +int pfctl_flush_rules(int dev, int opts, char *anchorname) { int ret; ret = pfctl_clear_rules(dev, anchorname); - if (ret != 0) - err(1, "pfctl_clear_rules"); - if ((opts & PF_OPT_QUIET) == 0) + if (ret != 0) { + pfctl_err(opts, 1, "%s", __func__); + return (1); + } else if ((opts & PF_OPT_QUIET) == 0) fprintf(stderr, "rules cleared\n"); + + return (0); } void @@ -515,7 +566,7 @@ void pfctl_clear_src_nodes(int dev, int opts) { if (ioctl(dev, DIOCCLRSRCNODES)) - err(1, "DIOCCLRSRCNODES"); + pfctl_err(opts, 1, "DIOCCLRSRCNODES"); if ((opts & PF_OPT_QUIET) == 0) fprintf(stderr, "source tracking entries cleared\n"); } @@ -530,13 +581,13 @@ pfctl_clear_iface_states(int dev, const char *iface, int opts) memset(&kill, 0, sizeof(kill)); if (iface != NULL && strlcpy(kill.ifname, iface, sizeof(kill.ifname)) >= sizeof(kill.ifname)) - errx(1, "invalid interface: %s", iface); + pfctl_errx(opts, 1, "invalid interface: %s", iface); if (opts & PF_OPT_KILLMATCH) kill.kill_match = true; if ((ret = pfctl_clear_states_h(pfh, &kill, &killed)) != 0) - errc(1, ret, "DIOCCLRSTATES"); + pfctl_err(opts, 1, "DIOCCLRSTATUS"); if ((opts & PF_OPT_QUIET) == 0) fprintf(stderr, "%d states cleared\n", killed); } @@ -687,7 +738,7 @@ pfctl_net_kill_states(int dev, const char *iface, int opts) memset(&last_dst, 0xff, sizeof(last_dst)); if (iface != NULL && strlcpy(kill.ifname, iface, sizeof(kill.ifname)) >= sizeof(kill.ifname)) - errx(1, "invalid interface: %s", iface); + pfctl_errx(opts, 1, "invalid interface: %s", iface); if (state_killers == 2 && (strcmp(state_kill[0], "nat") == 0)) { kill.nat = true; @@ -740,13 +791,13 @@ pfctl_net_kill_states(int dev, const char *iface, int opts) resp[1]->ai_addr); if ((ret = pfctl_kill_states_h(pfh, &kill, &newkilled)) != 0) - errc(1, ret, "DIOCKILLSTATES"); + pfctl_errx(opts, 1, "DIOCKILLSTATES"); killed += newkilled; } freeaddrinfo(res[1]); } else { if ((ret = pfctl_kill_states_h(pfh, &kill, &newkilled)) != 0) - errc(1, ret, "DIOCKILLSTATES"); + pfctl_errx(opts, 1, "DIOCKILLSTATES"); killed += newkilled; } } @@ -778,7 +829,7 @@ pfctl_gateway_kill_states(int dev, const char *iface, int opts) memset(&last_src, 0xff, sizeof(last_src)); if (iface != NULL && strlcpy(kill.ifname, iface, sizeof(kill.ifname)) >= sizeof(kill.ifname)) - errx(1, "invalid interface: %s", iface); + pfctl_errx(opts, 1, "invalid interface: %s", iface); if (opts & PF_OPT_KILLMATCH) kill.kill_match = true; @@ -799,7 +850,7 @@ pfctl_gateway_kill_states(int dev, const char *iface, int opts) copy_satopfaddr(&kill.rt_addr.addr.v.a.addr, resp->ai_addr); if (pfctl_kill_states_h(pfh, &kill, &newkilled)) - err(1, "DIOCKILLSTATES"); + pfctl_errx(opts, 1, "DIOCKILLSTATES"); killed += newkilled; } @@ -823,7 +874,7 @@ pfctl_label_kill_states(int dev, const char *iface, int opts) memset(&kill, 0, sizeof(kill)); if (iface != NULL && strlcpy(kill.ifname, iface, sizeof(kill.ifname)) >= sizeof(kill.ifname)) - errx(1, "invalid interface: %s", iface); + pfctl_errx(opts, 1, "invalid interface: %s", iface); if (opts & PF_OPT_KILLMATCH) kill.kill_match = true; @@ -833,7 +884,7 @@ pfctl_label_kill_states(int dev, const char *iface, int opts) errx(1, "label too long: %s", state_kill[1]); if ((ret = pfctl_kill_states_h(pfh, &kill, &killed)) != 0) - errc(1, ret, "DIOCKILLSTATES"); + pfctl_errx(opts, 1, "DIOCKILLSTATES"); if ((opts & PF_OPT_QUIET) == 0) fprintf(stderr, "killed %d states\n", killed); @@ -871,7 +922,7 @@ pfctl_id_kill_states(int dev, const char *iface, int opts) } if ((ret = pfctl_kill_states_h(pfh, &kill, &killed)) != 0) - errc(1, ret, "DIOCKILLSTATES"); + pfctl_errx(opts, 1, "DIOCKILLSTATES"); if ((opts & PF_OPT_QUIET) == 0) fprintf(stderr, "killed %d states\n", killed); @@ -895,7 +946,7 @@ pfctl_key_kill_states(int dev, const char *iface, int opts) if (iface != NULL && strlcpy(kill.ifname, iface, sizeof(kill.ifname)) >= sizeof(kill.ifname)) - errx(1, "invalid interface: %s", iface); + pfctl_errx(opts, 1, "invalid interface: %s", iface); s = strdup(state_kill[1]); if (!s) @@ -931,7 +982,7 @@ pfctl_key_kill_states(int dev, const char *iface, int opts) errx(1, "invalid host: %s", tokens[didx]); if ((ret = pfctl_kill_states_h(pfh, &kill, &killed)) != 0) - errc(1, ret, "DIOCKILLSTATES"); + pfctl_errx(opts, 1, "DIOCKILLSTATES"); if ((opts & PF_OPT_QUIET) == 0) fprintf(stderr, "killed %d states\n", killed); @@ -2805,7 +2856,7 @@ pfctl_set_interface_flags(struct pfctl *pf, char *ifname, int flags, int how) if ((pf->opts & PF_OPT_NOACTION) == 0) { if (how == 0) { if (ioctl(pf->dev, DIOCCLRIFFLAG, &pi)) - err(1, "DIOCCLRIFFLAG"); + pfctl_err(pf->opts, 1, "DIOCCLRIFFLAG"); } else { if (ioctl(pf->dev, DIOCSETIFFLAG, &pi)) err(1, "DIOCSETIFFLAG"); @@ -2864,17 +2915,56 @@ pfctl_test_altqsupport(int dev, int opts) } int -pfctl_show_anchors(int dev, int opts, char *anchorname) +pfctl_walk_show(int opts, struct pfioc_ruleset *pr, void *warg) +{ + if (pr->path[0]) { + if (pr->path[0] != '_' || (opts & PF_OPT_VERBOSE)) + printf(" %s/%s\n", pr->path, pr->name); + } else if (pr->name[0] != '_' || (opts & PF_OPT_VERBOSE)) + printf(" %s\n", pr->name); + + return (0); +} + +int +pfctl_walk_get(int opts, struct pfioc_ruleset *pr, void *warg) +{ + struct pfr_anchoritem *pfra; + struct pfr_anchors *anchors; + int e; + + anchors = (struct pfr_anchors *)warg; + + pfra = malloc(sizeof(*pfra)); + if (pfra == NULL) + err(1, "%s", __func__); + + if (pr->path[0]) + e = asprintf(&pfra->pfra_anchorname, "%s/%s", pr->path, + pr->name); + else + e = asprintf(&pfra->pfra_anchorname, "%s", pr->name); + + if (e == -1) + err(1, "%s", __func__); + + SLIST_INSERT_HEAD(anchors, pfra, pfra_sle); + + return (0); +} + +int +pfctl_walk_anchors(int dev, int opts, const char *anchor, + int(walkf)(int, struct pfioc_ruleset *, void *), void *warg) { struct pfioc_ruleset pr; u_int32_t mnr, nr; int ret; memset(&pr, 0, sizeof(pr)); - if ((ret = pfctl_get_rulesets(pfh, anchorname, &mnr)) != 0) { + if ((ret = pfctl_get_rulesets(pfh, anchor, &mnr)) != 0) { if (ret == EINVAL) - fprintf(stderr, "Anchor '%s' not found.\n", - anchorname); + fprintf(stderr, "Anchor '%s' not found.\n", anchor); else errc(1, ret, "DIOCGETRULESETS"); return (-1); @@ -2882,24 +2972,122 @@ pfctl_show_anchors(int dev, int opts, char *anchorname) for (nr = 0; nr < mnr; ++nr) { char sub[MAXPATHLEN]; - if ((ret = pfctl_get_ruleset(pfh, anchorname, nr, &pr)) != 0) + if ((ret = pfctl_get_ruleset(pfh, anchor, nr, &pr)) != 0) errc(1, ret, "DIOCGETRULESET"); if (!strcmp(pr.name, PF_RESERVED_ANCHOR)) continue; sub[0] = '\0'; - if (pr.path[0]) { - strlcat(sub, pr.path, sizeof(sub)); - strlcat(sub, "/", sizeof(sub)); - } - strlcat(sub, pr.name, sizeof(sub)); - if (sub[0] != '_' || (opts & PF_OPT_VERBOSE)) - printf(" %s\n", sub); - if ((opts & PF_OPT_VERBOSE) && pfctl_show_anchors(dev, opts, sub)) + if (walkf(opts, &pr, warg)) + return (-1); + + if (pr.path[0]) + snprintf(sub, sizeof(sub), "%s/%s", pr.path, pr.name); + else + snprintf(sub, sizeof(sub), "%s", pr.name); + if (pfctl_walk_anchors(dev, opts, sub, walkf, warg)) return (-1); } return (0); } +int +pfctl_show_anchors(int dev, int opts, char *anchor) +{ + return ( + pfctl_walk_anchors(dev, opts, anchor, pfctl_walk_show, NULL)); +} + +struct pfr_anchors * +pfctl_get_anchors(int dev, char *anchor, int opts) +{ + struct pfioc_ruleset pr; + static struct pfr_anchors anchors; + char *n; + + SLIST_INIT(&anchors); + + memset(&pr, 0, sizeof(pr)); + if (*anchor != '\0') { + n = dirname(anchor); + if (n[0] != '.' && n[1] != '\0') + strlcpy(pr.path, n, sizeof(pr.path)); + n = basename(anchor); + if (n != NULL) + strlcpy(pr.name, n, sizeof(pr.name)); + } + + /* insert a root anchor first. */ + pfctl_walk_get(opts, &pr, &anchors); + + if (pfctl_walk_anchors(dev, opts, anchor, pfctl_walk_get, &anchors)) + errx(1, "%s failed to retrieve list of anchors, can't continue", + __func__); + + return (&anchors); +} + +int +pfctl_call_cleartables(int dev, int opts, struct pfr_anchoritem *pfra) +{ + /* + * PF_OPT_QUIET makes pfctl_clear_tables() to stop printing number of + * tables cleared for given anchor. + */ + opts |= PF_OPT_QUIET; + return ((pfctl_do_clear_tables(pfra->pfra_anchorname, opts) == -1) ? + 1 : 0); +} + +int +pfctl_call_clearrules(int dev, int opts, struct pfr_anchoritem *pfra) +{ + /* + * PF_OPT_QUIET makes pfctl_clear_rules() to stop printing a 'rules + * cleared' message for every anchor it deletes. + */ + opts |= PF_OPT_QUIET; + return (pfctl_flush_rules(dev, opts, pfra->pfra_anchorname)); +} + +int +pfctl_call_clearanchors(int dev, int opts, struct pfr_anchoritem *pfra) +{ + int rv = 0; + + rv |= pfctl_call_cleartables(dev, opts, pfra); + rv |= pfctl_call_clearrules(dev, opts, pfra); + + return (rv); +} + +int +pfctl_recurse(int dev, int opts, char *anchorname, + int(*walkf)(int, int, struct pfr_anchoritem *)) +{ + int rv = 0; + struct pfr_anchors *anchors; + struct pfr_anchoritem *pfra, *pfra_save; + + anchors = pfctl_get_anchors(dev, anchorname, opts); + /* + * While traversing the list, pfctl_clear_*() must always return + * so that failures on one anchor do not prevent clearing others. + */ + opts |= PF_OPT_IGNFAIL; + printf("Removing:\n"); + SLIST_FOREACH_SAFE(pfra, anchors, pfra_sle, pfra_save) { + printf(" %s\n", + (*pfra->pfra_anchorname == '\0') ? "" : + pfra->pfra_anchorname); + rv |= walkf(dev, opts, pfra); + SLIST_REMOVE(anchors, pfra, pfr_anchoritem, pfra_sle); + free(pfra->pfra_anchorname); + free(pfra); + } + + return (rv); +} + int pfctl_show_eth_anchors(int dev, int opts, char *anchorname) { @@ -2990,7 +3178,6 @@ pfctl_reset(int dev, int opts) int main(int argc, char *argv[]) { - int error = 0; int ch; int mode = O_RDONLY; int opts = 0; @@ -3218,7 +3405,7 @@ main(int argc, char *argv[]) if (opts & PF_OPT_DISABLE) if (pfctl_disable(dev, opts)) - error = 1; + exit_val = 1; if ((path = calloc(1, MAXPATHLEN)) == NULL) errx(1, "%s: calloc", __func__); @@ -3259,7 +3446,7 @@ main(int argc, char *argv[]) pfctl_show_status(dev, opts); break; case 'R': - error = pfctl_show_running(dev); + exit_val = pfctl_show_running(dev); break; case 't': pfctl_show_timeouts(dev, opts); @@ -3321,7 +3508,11 @@ main(int argc, char *argv[]) pfctl_flush_eth_rules(dev, opts, anchorname); break; case 'r': - pfctl_flush_rules(dev, opts, anchorname); + if (opts & PF_OPT_RECURSE) + pfctl_recurse(dev, opts, anchorname, + pfctl_call_clearrules); + else + pfctl_flush_rules(dev, opts, anchorname); break; case 'n': pfctl_flush_nat(dev, opts, anchorname); @@ -3347,7 +3538,13 @@ main(int argc, char *argv[]) pfctl_flush_eth_rules(dev, opts, anchorname); pfctl_flush_rules(dev, opts, anchorname); pfctl_flush_nat(dev, opts, anchorname); - pfctl_do_clear_tables(anchorname, opts); + if (opts & PF_OPT_RECURSE) + pfctl_recurse(dev, opts, anchorname, + pfctl_call_clearanchors); + else { + pfctl_do_clear_tables(anchorname, opts); + pfctl_flush_rules(dev, opts, anchorname); + } if (!*anchorname) { pfctl_clear_altq(dev, opts); pfctl_clear_iface_states(dev, ifaceopt, opts); @@ -3361,7 +3558,11 @@ main(int argc, char *argv[]) pfctl_clear_fingerprints(dev, opts); break; case 'T': - pfctl_do_clear_tables(anchorname, opts); + if ((opts & PF_OPT_RECURSE) == 0) + pfctl_do_clear_tables(anchorname, opts); + else + pfctl_recurse(dev, opts, anchorname, + pfctl_call_cleartables); break; case 'R': pfctl_reset(dev, opts); @@ -3385,7 +3586,7 @@ main(int argc, char *argv[]) pfctl_kill_src_nodes(dev, opts); if (tblcmdopt != NULL) { - error = pfctl_table(argc, argv, tableopt, + exit_val = pfctl_table(argc, argv, tableopt, tblcmdopt, rulesopt, anchorname, opts); rulesopt = NULL; } @@ -3411,17 +3612,17 @@ main(int argc, char *argv[]) if (rulesopt != NULL && !(opts & PF_OPT_MERGE) && !anchorname[0] && (loadopt & PFCTL_FLAG_OPTION)) if (pfctl_file_fingerprints(dev, opts, PF_OSFP_FILE)) - error = 1; + exit_val = 1; if (rulesopt != NULL) { if (pfctl_rules(dev, rulesopt, opts, optimize, anchorname, NULL)) - error = 1; + exit_val = 1; } if (opts & PF_OPT_ENABLE) if (pfctl_enable(dev, opts)) - error = 1; + exit_val = 1; if (debugopt != NULL) { switch (*debugopt) { @@ -3440,5 +3641,5 @@ main(int argc, char *argv[]) } } - exit(error); + exit(exit_val); } diff --git a/sbin/pfctl/pfctl.h b/sbin/pfctl/pfctl.h index d8196c129187..5b5b3d3e5fff 100644 --- a/sbin/pfctl/pfctl.h +++ b/sbin/pfctl/pfctl.h @@ -55,6 +55,13 @@ struct pfr_buffer { (var) != NULL; \ (var) = pfr_buf_next((buf), (var))) +struct pfr_anchoritem { + SLIST_ENTRY(pfr_anchoritem) pfra_sle; + char *pfra_anchorname; +}; + +SLIST_HEAD(pfr_anchors, pfr_anchoritem); + int pfr_get_fd(void); int pfr_add_table(struct pfr_table *, int *, int); int pfr_del_table(struct pfr_table *, int *, int); @@ -81,7 +88,7 @@ int pfi_get_ifaces(const char *, struct pfi_kif *, int *); int pfi_clr_istats(const char *, int *, int); void pfctl_print_title(char *); -void pfctl_do_clear_tables(const char *, int); +int pfctl_do_clear_tables(const char *, int); void pfctl_show_tables(const char *, int); int pfctl_table(int, char *[], char *, const char *, char *, const char *, int); @@ -150,4 +157,7 @@ void expand_label(char *, size_t, struct pfctl_rule *); const char *pfctl_proto2name(int); +void pfctl_err(int, int, const char *, ...); +void pfctl_errx(int, int, const char *, ...); + #endif /* _PFCTL_H_ */ diff --git a/sbin/pfctl/pfctl_osfp.c b/sbin/pfctl/pfctl_osfp.c index 3a94c2e8c81b..5770c8343a46 100644 --- a/sbin/pfctl/pfctl_osfp.c +++ b/sbin/pfctl/pfctl_osfp.c @@ -264,7 +264,7 @@ void pfctl_clear_fingerprints(int dev, int opts) { if (ioctl(dev, DIOCOSFPFLUSH)) - err(1, "DIOCOSFPFLUSH"); + pfctl_err(opts, 1, "DIOCOSFPFLUSH"); } /* flush pfctl's view of the fingerprints */ diff --git a/sbin/pfctl/pfctl_parser.h b/sbin/pfctl/pfctl_parser.h index b91d37c791ae..778105c2b96d 100644 --- a/sbin/pfctl/pfctl_parser.h +++ b/sbin/pfctl/pfctl_parser.h @@ -55,6 +55,7 @@ #define PF_OPT_RECURSE 0x04000 #define PF_OPT_KILLMATCH 0x08000 #define PF_OPT_NODNS 0x10000 +#define PF_OPT_IGNFAIL 0x20000 #define PF_NAT_PROXY_PORT_LOW 50001 #define PF_NAT_PROXY_PORT_HIGH 65535 diff --git a/sbin/pfctl/pfctl_table.c b/sbin/pfctl/pfctl_table.c index 0842b042df41..0b52f88eafbb 100644 --- a/sbin/pfctl/pfctl_table.c +++ b/sbin/pfctl/pfctl_table.c @@ -79,7 +79,8 @@ static const char *istats_text[2][2][2] = { if ((!(opts & PF_OPT_NOACTION) || \ (opts & PF_OPT_DUMMYACTION)) && \ (fct)) { \ - radix_perror(); \ + if ((opts & PF_OPT_RECURSE) == 0) \ + radix_perror(); \ goto _error; \ } \ } while (0) @@ -103,11 +104,17 @@ static const char *istats_text[2][2][2] = { table.pfrt_flags &= ~PFR_TFLAG_PERSIST; \ } while(0) -void +int pfctl_do_clear_tables(const char *anchor, int opts) { - if (pfctl_table(0, NULL, NULL, "-F", NULL, anchor, opts)) - exit(1); + int rv; + + if ((rv = pfctl_table(0, NULL, NULL, "-F", NULL, anchor, opts)) == -1) { + if ((opts & PF_OPT_IGNFAIL) == 0) + exit(1); + } + + return (rv); } void From nobody Wed Jul 9 08:59:13 2025 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 4bcX361vkWz61N2f; Wed, 09 Jul 2025 08:59:14 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcX3533gyz3cZh; Wed, 09 Jul 2025 08:59:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752051553; 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=zAhjHUlnM4o5+7W8Qq1Ozskp1AlBTWWRcj1L3mBmios=; b=ArrByezgcPpcAQHikwGb38sIIc0fb4FOhjBgMz4WbyTDZhlrksHmQoVLtQVL1RznYKMXWJ OVZNhHF6u4PS3UOYHXfm3JH42hKAWuTPjfXoz5GU9/0YY6Vq48mOv5JL0iLrGgCnubrbd9 HyJGVpBg3mNTvXg0Nk5mY7hKxYpQu5HqX5ocjYUUkgRYUsVW7zU3N4r0plFLmbo+QaRUEJ K83V7lmDU6uLGxPM9QN2yiZdnG8McuatPhHtKuBRWaLGhtQf8wsqhFS9DIE453sFcpgllS 7Oa6l8vvUl+oKMBePQUIMS2mX66i9YytKs/vJ1di3EEWsd4UbrIR9YU7jiw5QA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752051553; 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=zAhjHUlnM4o5+7W8Qq1Ozskp1AlBTWWRcj1L3mBmios=; b=KyfVjTyYHtfkttIxPJKXlmiSsGflN8cKuEpHYYRDz0KzldYIsUT06Ic89BDMTn4IeIamuo FvHoilhGgIF1zoZFY7uSsm4gTBdREeGXdqhraXozNTTRMXRUMP1W7/42SL+CrNWPQhQtxG bUnYklzHphjD5kxTivDOG97ZEFG+2o9xUMzTo5JTTPcTvA3zxmO/zKZqHLKtagxcXmiOJv IyQyykaC6TQ6qzV+jZaoF2IYdZnewjCQj1NUXeQKGw5pr2Q/IwV/22fwMOujycDNup9toj 5xEwRDXyh8roE8QDxy9CC3JhVAF1my2BvTk3h0wAV1v25P0zSxtR9Ae/ZWZvJA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752051553; a=rsa-sha256; cv=none; b=btVFHQZXopaGjw3wBaaxJltUP/VeF7xEqf2MsBMZTx+vfP2HNtOb+INzTfxockr03PRoNG nvNMrvp3NlvK2f6YgDty5wFZDL0giC+6a+zPqWplM+8ElZ9sm6kT7fw9YrCMnR4vfMJxE8 LPJfzl8mqNiEGZ3URUyW8vcLHpZQrgP6ZnFP7hGBAq+FPltyfz6G54Q/uGnAVCdP0NoyZD qc1JaZmhWV7EXNkBuadFx+l3ptavDB2GhU19gxT57xsgqEB16iI2d4x86TXDTnJ8CA2p+B fu9CVpOfMdFKu+yNkYcvgXmHh0yF2MjE6npGaSVzZlXc+4Luuho1jIuLlSUsvg== 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 4bcX352YRyz1D4; Wed, 09 Jul 2025 08:59:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5698xDhI045161; Wed, 9 Jul 2025 08:59:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5698xDwx045159; Wed, 9 Jul 2025 08:59:13 GMT (envelope-from git) Date: Wed, 9 Jul 2025 08:59:13 GMT Message-Id: <202507090859.5698xDwx045159@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 05c33e5acb67 - main - pfctl tests: recursive flush test case 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 05c33e5acb67f1f36feae77b7e400d9a066db441 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=05c33e5acb67f1f36feae77b7e400d9a066db441 commit 05c33e5acb67f1f36feae77b7e400d9a066db441 Author: Kristof Provost AuthorDate: 2025-07-04 21:36:33 +0000 Commit: Kristof Provost CommitDate: 2025-07-09 08:57:50 +0000 pfctl tests: recursive flush test case Sponsored by: Rubicon Communications, LLC ("Netgate") --- tests/sys/netpfil/pf/anchor.sh | 57 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/tests/sys/netpfil/pf/anchor.sh b/tests/sys/netpfil/pf/anchor.sh index b4b52d7a24d6..4692c06142df 100644 --- a/tests/sys/netpfil/pf/anchor.sh +++ b/tests/sys/netpfil/pf/anchor.sh @@ -437,6 +437,62 @@ quick_cleanup() pft_cleanup } +atf_test_case "recursive_flush" "cleanup" +recursive_flush_head() +{ + atf_set descr 'Test recursive flushing of rules' + atf_set require.user root +} + +recursive_flush_body() +{ + pft_init + + epair=$(vnet_mkepair) + vnet_mkjail alcatraz ${epair}a + + ifconfig ${epair}b 192.0.2.2/24 up + jexec alcatraz ifconfig ${epair}a 192.0.2.1/24 up + + # Sanity check + atf_check -s exit:0 -o ignore ping -c 1 192.0.2.1 + + jexec alcatraz pfctl -e + pft_set_rules alcatraz \ + "block" \ + "anchor \"foo\" {\n\ + pass\n\ + }" + + # We can ping thanks to the pass rule in foo + atf_check -s exit:0 -o ignore ping -c 1 192.0.2.1 + + # Only reset the main rules. I.e. not a recursive flush + pft_set_rules alcatraz \ + "block" \ + "anchor \"foo\"" + + # "foo" still has the pass rule, so this works + jexec alcatraz pfctl -a "*" -sr + atf_check -s exit:0 -o ignore ping -c 1 192.0.2.1 + + # Now do a recursive flush + atf_check -s exit:0 -e ignore -o ignore \ + jexec alcatraz pfctl -a "*" -Fr + pft_set_rules alcatraz \ + "block" \ + "anchor \"foo\"" + + # So this fails + jexec alcatraz pfctl -a "*" -sr + atf_check -s exit:2 -o ignore ping -c 1 192.0.2.1 +} + +recursive_flush_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "pr183198" @@ -450,4 +506,5 @@ atf_init_test_cases() atf_add_test_case "nat" atf_add_test_case "include" atf_add_test_case "quick" + atf_add_test_case "recursive_flush" } From nobody Wed Jul 9 08:59:14 2025 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 4bcX366K06z61NW2; Wed, 09 Jul 2025 08:59:14 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcX36435mz3cdb; Wed, 09 Jul 2025 08:59:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752051554; 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=pC3k3TBEbwVZMLTYoAAynkI/2YqGDQQLfcS4lkH/ISY=; b=NLMNhM4kSN+ra8+FZyWS5woadiIq8pOBmwibeye89V0kd85yKx+JvzSB08i1sLSdWOlQga BImJq1tYPhSQP0RYpxUJuhcDpGKFbeACRbqObe7owAs8L45rW5/9cZjJAuX6JsTCJhE2q2 om9RMA7t+gpGK+sIgi5/3G93eUQYHMr7oA3l6/991hgcE3Xa3hKRhi76dygf4Wlh4bGQ1e ooFCQy/NzpQqMdCXcKxKEsCniQM3ytRVOBcGakqHkCp6xYCUlfbhsDCkYWWFaRo4NUBuT+ j8NzWUb5ZvtCW8lvn4NkeirriquPb1RRiNsPBcqdWfYFQwmBLWsQy7iYVGF8Qw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752051554; 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=pC3k3TBEbwVZMLTYoAAynkI/2YqGDQQLfcS4lkH/ISY=; b=U4hl6j2nJRAsE89VdLHCONnGZopHg+AfyFr6g7XfINtCTNiIvrjf9YZlhOpaZ4O+S8N3Ix jnF5l4BF/CItkJr8FsXK2DPed+BhMXDwTA2kpMoFmA3BtFp15uQ9XtBXjktxO9f0SNIXLx 4d1INcDVWkS+lLcJUf61d8IyXOByOtshQD9O6MJGWU5QnOqEguItHzZwH08hmKW3wEHcQC T1tTy8cwZyaQGnLD28sLp9THzKWrRCONgmYhkOCQkU+JsVdPLceJXL4yMzokHWeZIVuv8L kJsIloLzpcx6eQF+o39CUTVC1oh5Pkh2bx5hy00eAltfJbC5BwUmib9lj5Zi/w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752051554; a=rsa-sha256; cv=none; b=XMDQ4DcSHk6OGWFhrKjOW8nFQYWSkXfcsiCcwxUsi1PQBIdpDJmNxMt/Do/8Kz8ncr30v5 W2b767q/GHHaeEXYCrWxz8JkZlAeoAOeDZ470U2b9rK2MN6O6hsX8QOFa3JW5iyBYwcn+T OpdcX03d2DglrIr+inNJIrdKmrciHivXzlrHWLfsfiAtbyrV2XAYMXOxkWZCwYfbaBEKiM ndfuNkUC4J3UAy/cgRhK11E9stk+FqH5svzuCkJ/uS/TPuZaHJXyg7jNAoQg7DEPNXlLif tAXQrDemSB2ZQJI/YJHOnuCMgaQhuM1ZRsYM1d3P8XYdnZLnFPuaB3IcidFkFg== 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 4bcX363WyGz1D5; Wed, 09 Jul 2025 08:59:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5698xEoE045200; Wed, 9 Jul 2025 08:59:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5698xE5E045197; Wed, 9 Jul 2025 08:59:14 GMT (envelope-from git) Date: Wed, 9 Jul 2025 08:59:14 GMT Message-Id: <202507090859.5698xE5E045197@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: fb0d388e5d53 - main - pfctl: Print the main ruleset/anchor as "/" not "" for consistency 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fb0d388e5d53db18deb6f2646cd797fcf58cd9bb Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=fb0d388e5d53db18deb6f2646cd797fcf58cd9bb commit fb0d388e5d53db18deb6f2646cd797fcf58cd9bb Author: Kristof Provost AuthorDate: 2025-07-07 06:17:07 +0000 Commit: Kristof Provost CommitDate: 2025-07-09 08:57:51 +0000 pfctl: Print the main ruleset/anchor as "/" not "" for consistency OK sashan Obtained from: OpenBSD, kn , baa66dbe09 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/pfctl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c index 254bd054ae4a..8d2b556d7085 100644 --- a/sbin/pfctl/pfctl.c +++ b/sbin/pfctl/pfctl.c @@ -3077,8 +3077,8 @@ pfctl_recurse(int dev, int opts, char *anchorname, printf("Removing:\n"); SLIST_FOREACH_SAFE(pfra, anchors, pfra_sle, pfra_save) { printf(" %s\n", - (*pfra->pfra_anchorname == '\0') ? "" : - pfra->pfra_anchorname); + (*pfra->pfra_anchorname == '\0') ? "/" : + pfra->pfra_anchorname); rv |= walkf(dev, opts, pfra); SLIST_REMOVE(anchors, pfra, pfr_anchoritem, pfra_sle); free(pfra->pfra_anchorname); From nobody Wed Jul 9 08:59:15 2025 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 4bcX382tlPz61NN5; Wed, 09 Jul 2025 08:59:16 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcX375Gj4z3cdt; Wed, 09 Jul 2025 08:59:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752051555; 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=WsM5k1/I+idpClNWiDONydOngFS9uIfATQ+rl0+kq9o=; b=MNkonE0gPEGhAB7f8/ZOIXQlcrjS72wp8OU557PsOVUYmDpBWtBuDFiaT6msnk38rCnH5c UTTtH4gikiALrktaBTWRGcp6Va2DbGjJ+N9FPTsVfo7/QK+N27C2om2hfgfkW8tTztz1nz vTdnFCo8nmKWG26RwUeNTeJzChjzBJh1MRxyOn/KPNNgciElJc4USIWt1C5V5r/kHhXYFZ fyxX+iGTEgwD+bfU8Bjz26GQLPn0d9M40nwWPy0A1sT/uqadm20ZxubY+VKY6pPYxK1Obl VIKlUwnBADRwYAbtnxdAnT/pDcJobu6PegL9mpPvF7P9IOcLQaMID9vsZ44anQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752051555; 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=WsM5k1/I+idpClNWiDONydOngFS9uIfATQ+rl0+kq9o=; b=lgY8t2JjVB3I2gb7XqkmJ4ozAEQah4TUH7sfzryyCf+TGjsRKeaLDXW2uvRExZ6/2vvraQ uj64QAPWoacvmuPbx5XMpC6cZ/eW1CkMrugtDYLDVYZQVxXGqnCKdHz/chIccPn9E2VqGY 4S0rnk2SftSchOaalDiAOJcmjf0kllOYVOwduT/UHXLjIpuQA6Aw8h40BnIchUUOZ2b3Ry +sd8fi3J267JC974w308vd+6uaD1yM+gzNtDfE+P8O8cVCEu3XYuONMA6NlsaKOloUASjd U7mqUI576AMWU+5PZCBN2NPwfLxEu/CiK5/9UfwrWLi7u8ZNtZreM/4rNcisfA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752051555; a=rsa-sha256; cv=none; b=XFiMlCG78A3XYoQyNiFkF/E0Sdl9cLfj8mGWq/+yaqAPK2AgJKEoJKhHgBnpmHjUDg9mbh +gGZwSSM1UCce3NNuRqmIT0YLXjAVwIxra00iE1UX+xf7KgJ5+l8LkaaYfwibIhKXO4dSn QdhPijxhB6OYCCGrpe0QgHtIbjxkroqGPul8JQOcm5PiMeBSZTwGck1FXpX6JHmC+BUxNu 6jypMgRZWJJAcfJi9vXYgdgg3y81sxjF7CTb9GeSFN8jJeoThmbFoM1el3wX3yppb666qf tsEjWUHiV9vUdt5o1A9G//86KNs+iqZsrZMi6gab5JTnaH6Yzh4PIw7SLMwEHQ== 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 4bcX374RLlz1D6; Wed, 09 Jul 2025 08:59:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5698xFoY045246; Wed, 9 Jul 2025 08:59:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5698xFh2045243; Wed, 9 Jul 2025 08:59:15 GMT (envelope-from git) Date: Wed, 9 Jul 2025 08:59:15 GMT Message-Id: <202507090859.5698xFh2045243@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 3b6bcad34080 - main - pfctl.8: Further document recursive flush behaviour 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3b6bcad3408000de9beca8d3c403f63ac216bd1e Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=3b6bcad3408000de9beca8d3c403f63ac216bd1e commit 3b6bcad3408000de9beca8d3c403f63ac216bd1e Author: Kristof Provost AuthorDate: 2025-07-07 06:18:32 +0000 Commit: Kristof Provost CommitDate: 2025-07-09 08:57:51 +0000 pfctl.8: Further document recursive flush behaviour OK sashan Obtained from: OpenBSD, kn , 5bd1c2906f Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/pfctl.8 | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/sbin/pfctl/pfctl.8 b/sbin/pfctl/pfctl.8 index 2566bca57a28..508dcc6ea8d4 100644 --- a/sbin/pfctl/pfctl.8 +++ b/sbin/pfctl/pfctl.8 @@ -24,7 +24,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd July 4, 2025 +.Dd July 7, 2025 .Dt PFCTL 8 .Os .Sh NAME @@ -238,6 +238,19 @@ for details. .It Fl F Cm all Flush all of the above. .El +.Pp +If +.Fl a +is specified as well and +.Ar anchor +is terminated with a +.Sq * +character, +.Cm rules , +.Cm Tables +and +.Cm all +flush the given anchor recursively. .It Fl f Ar file Load the rules contained in .Ar file . From nobody Wed Jul 9 12:13:02 2025 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 4bccLy48Ttz61b9r; Wed, 09 Jul 2025 12:13:14 +0000 (UTC) (envelope-from eduardo@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bccLy2kqmz414h; Wed, 09 Jul 2025 12:13:14 +0000 (UTC) (envelope-from eduardo@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752063194; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=WtqFAr96f7StE2XQ3b50Kj8kB6y3biorSpStczmZZis=; b=OTRf/Ml72qTR7C5EWgRy2lDcmSD+YJ/cKkeCZuNuF/DTip8ALsnC/6FPBzYuJu5de4UwY8 fH4oqJhN0Io/2H/Tu1oEddbbJ35mX/wcwUaQ5LoEGyJTmCrFga0rV5ol1vDsQ0UFxPHCJO mlTFJLG/s6WrzLmyl5Zu2kReMc5/9qgM39TTHq8e/+OQX7V2yeV55wfAJjC5z54sdRh9uU uWrV2Rj/AFseJxgz2Cl/I4Nj1WoOTaUifdj05ncRbDBRIQHJQaTzOPwM8ds7i/+fA2GVuI 4XpOeYf5pboosoNn78NdzRa28fv2WkoB1RtSlhuQ9hja83B8n6tENmlVgS6eUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752063194; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=WtqFAr96f7StE2XQ3b50Kj8kB6y3biorSpStczmZZis=; b=ovh+cqphKphKz6fnu7EVucAF2lAB9E/ThgarAnIYcYX8QMmyOJiQhL1YRUJUsRwnVRczHy 0MVIVqdWeVTNcWuFveN/RJonM54RMuPR4yjCI6spEUmkKPlcbKPcNj4EBVLMY9961E0kAc 76P4oof3HJjWvohjFnVukoH6amsyWB9/JC+Fz6CfSjFv7BST0iO/JNhSFYGS3+aTwBZdsT NmnENx+IXWzq0GHdioKKup3/ybJbYY6cvUzcVHf8CZjmas0/5M3EfUhsGcg5mFX5Bj4xhq MmViWwJKR4vujS4wKNJ7+EIhaZ16/rAiM+V6KdMT/zLRniIZ92+kIhYQpgxy0Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752063194; a=rsa-sha256; cv=none; b=bPmVgew8UqJVT8vL0t63+zdWdo/PMx2kznLoBFaGn5MPsLURHg6I67yT6Xy2rhgY6Ddm30 arhHyzhkSoOzHMcBXMe7SSQa24NMuwdxqKtcMTcG5QZwlXpMlNT2noLR2dlrVmsZlw14so rQLuSeKeOgcxe56XRu5HfjiQn3OWL7ztJLkFClYkk1ErGMJaasVOrXuxUrAY1snyKLyzvR tnNBHIclJGlz2tiYTlu7ahkbxdim07pGLC6IK2JLP3nAljitJoe4TvIIMIDcpsfIkKv9Ye bl8GHgqPLOCb1iwqre9bw57hZJjXH4UqXdC2OtBCsOMEAERWQYnuD2ZPkLynGQ== Received: from mail-qt1-f176.google.com (mail-qt1-f176.google.com [209.85.160.176]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) (Authenticated sender: eduardo) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bccLy238Xz1BLC; Wed, 09 Jul 2025 12:13:14 +0000 (UTC) (envelope-from eduardo@freebsd.org) Received: by mail-qt1-f176.google.com with SMTP id d75a77b69052e-4a43f17c42bso6555071cf.2; Wed, 09 Jul 2025 05:13:14 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCW6jbcmlDorF/aQKYebrlMUdu5ElaCYLHZ3z3QPnhZiy09MccgF5fkoNmOc9qwnijtejgf7ZBLFlkP/X3PI6t6GoTH8@freebsd.org, AJvYcCWYT1Lee6hyP4so5IEWny/ABr5NKlwMBZ/0kByKGUJSyOcRcT6xmJ0nY13kzysbojzp1PnFmJzQo0cs5/hXQIdC032UHWQ=@freebsd.org X-Gm-Message-State: AOJu0YyI692m3DqofOX82H0dLKvgLF6IT61lLzJWs/wQMQsLpHwMbg8O N7jyzxYdz8SbrX0844c1o4OaMGH6C+75ywcVA1ZV5ado2aeAjyKJ7eHSLp6dLw06yutN96TiNH5 fMRgDVBpX2R6k4uIaVimMiGL1bDZ+2Lg= X-Google-Smtp-Source: AGHT+IH7kDn4TEJfSiV55cqotr5Ph6nz2J463w/50hl4LWE+j8K7SxLj/EFMM4IQbU/NbWCalHDBgTc/1zQS3Uf1vIU= X-Received: by 2002:a05:622a:11c1:b0:4a5:aa2a:c78a with SMTP id d75a77b69052e-4a9dec57374mr10876911cf.4.1752063193773; Wed, 09 Jul 2025 05:13:13 -0700 (PDT) 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 References: <202507041513.564FDwxH011496@gitrepo.freebsd.org> In-Reply-To: <202507041513.564FDwxH011496@gitrepo.freebsd.org> From: Nuno Teixeira Date: Wed, 9 Jul 2025 13:13:02 +0100 X-Gmail-Original-Message-ID: X-Gm-Features: Ac12FXxoBKUIlWLp71regOHJSMCynsQdXwPiFIYjOkUJFXRKISlFpE40XlsNfcM Message-ID: Subject: Re: git: f9cf745a5084 - main - RELNOTES: Document the addition of inotify To: Mark Johnston Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="00000000000049fd0806397e00f6" --00000000000049fd0806397e00f6 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello, Not sure if related but I see devel/libdev failing on recent main (tested on aarch64): libtool: compile: cc -DHAVE_CONFIG_H -I. -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -MT event.lo -MD -MP -MF .deps/event.Tpo -c event.c -fPIC -DPIC -o .libs/event.o --- ev.lo --- ev.c:510:11: fatal error: 'sys/statfs.h' file not found 510 | # include | ^~~~~~~~~~~~~~ ev.c: (...) #if EV_USE_INOTIFY # include # include /* some very old inotify.h headers don't have IN_DONT_FOLLOW */ # ifndef IN_DONT_FOLLOW # undef EV_USE_INOTIFY # define EV_USE_INOTIFY 0 # endif #endif Thanks, Mark Johnston escreveu (sexta, 4/07/2025 =C3=A0(s) 16:1= 4): > The branch main has been updated by markj: > > URL: > https://cgit.FreeBSD.org/src/commit/?id=3Df9cf745a5084dc0a38733db8e774252= e4ed2f444 > > commit f9cf745a5084dc0a38733db8e774252e4ed2f444 > Author: Mark Johnston > AuthorDate: 2025-07-04 15:13:43 +0000 > Commit: Mark Johnston > CommitDate: 2025-07-04 15:13:43 +0000 > > RELNOTES: Document the addition of inotify > --- > RELNOTES | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/RELNOTES b/RELNOTES > index 4933c8392552..09696a37998b 100644 > --- a/RELNOTES > +++ b/RELNOTES > @@ -10,6 +10,9 @@ newline. Entries should be separated by a newline. > > Changes to this file should not be MFCed. > > +f1f230439fa4: > + FreeBSD now implements the inotify(2) family of system calls. > + > 50e733f19b37, 171f66b0c2ca: > These commits helped improve utilization of NFSv4.1/4.2 > delegations. The changes are only used when the NFSv4 > > --=20 Nuno Teixeira FreeBSD UNIX: Web: https://FreeBSD.org --00000000000049fd0806397e00f6 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello,

Not sure if related b= ut I see devel/libdev failing on recent main (tested on aarch64):

li= btool: compile: =C2=A0cc -DHAVE_CONFIG_H -I. -O2 -pipe -fstack-protector-st= rong -fno-strict-aliasing -MT event.lo -MD -MP -MF .deps/event.Tpo -c event= .c =C2=A0-fPIC -DPIC -o .libs/event.o
--- ev.lo ---
ev.c:510:11: fata= l error: 'sys/statfs.h' file not found
=C2=A0 510 | # include &l= t;sys/statfs.h>
=C2=A0 =C2=A0 =C2=A0 | =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 ^~~~~~~~~~~~~~

ev.c:
(...)
<= div>#if EV_USE_INOTIFY
# include <sys/statfs.h>
# include <s= ys/inotify.h>
/* some very old inotify.h headers don't have IN_DO= NT_FOLLOW */
# ifndef IN_DONT_FOLLOW
# =C2=A0undef EV_USE_INOTIFY
= # =C2=A0define EV_USE_INOTIFY 0
# endif
#endif

Than= ks,

Mark Johnston <markj@freebsd.org> escreveu (sexta, 4/07/2025 =C3=A0(s) 1= 6:14):
The branc= h main has been updated by markj:

URL: https://cgit.= FreeBSD.org/src/commit/?id=3Df9cf745a5084dc0a38733db8e774252e4ed2f444
commit f9cf745a5084dc0a38733db8e774252e4ed2f444
Author:=C2=A0 =C2=A0 =C2=A0Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2025-07-04 15:13:43 +0000
Commit:=C2=A0 =C2=A0 =C2=A0Mark Johnston <markj@FreeBSD.org>
CommitDate: 2025-07-04 15:13:43 +0000

=C2=A0 =C2=A0 RELNOTES: Document the addition of inotify
---
=C2=A0RELNOTES | 3 +++
=C2=A01 file changed, 3 insertions(+)

diff --git a/RELNOTES b/RELNOTES
index 4933c8392552..09696a37998b 100644
--- a/RELNOTES
+++ b/RELNOTES
@@ -10,6 +10,9 @@ newline.=C2=A0 Entries should be separated by a newline.<= br>
=C2=A0Changes to this file should not be MFCed.

+f1f230439fa4:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0FreeBSD now implements the inotify(2) family of= system calls.
+
=C2=A050e733f19b37, 171f66b0c2ca:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 These commits helped improve utilization of NFS= v4.1/4.2
=C2=A0 =C2=A0 =C2=A0 =C2=A0 delegations.=C2=A0 The changes are only used wh= en the NFSv4



--
Nuno Teixeira
=
FreeBSD UNIX:=C2=A0 <eduardo@FreeBSD.org>=C2=A0 =C2=A0Web:=C2=A0 https://Fr= eeBSD.org
--00000000000049fd0806397e00f6-- From nobody Wed Jul 9 12:28:40 2025 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 4bcchm6D0Wz61c9f; Wed, 09 Jul 2025 12:28:40 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcchm5c58z42PS; Wed, 09 Jul 2025 12:28:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752064120; 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=3w5U5tSyVvjiiWE14RsOzlDkC1eO71Rkvppgc+B8ZFI=; b=uK4+vSZllA9QLpYF8ONQTK5z4fSC4Ci+2HFxFom/KFODrjefNUczHP944AFJF2mv+256k4 VsLdDmb0aWE9jYqbkkNSPXB8ijNZ8ePuPrg75WV/mW1QBKVQ6zqkYObCPDHoMggGlEyzXU +8yiP/PdXMQhWojMNlNK4scrnh3zRMPpsIdHc+ggVkTxNk7Scmri2dRGwHB28Ahi6mWiiq e+gLjG+mFIkMxqKiV9rovW4diOx5GLr3SmVv3/GgLZ8yzsPDfXtAzCxVkOkP88Lzj+h80B 6vbu4YoEtRvEPJp9+FTrd2/ExzyvLenN52joZznBkPhTGOMhx66aVtN/pOCNyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752064120; 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=3w5U5tSyVvjiiWE14RsOzlDkC1eO71Rkvppgc+B8ZFI=; b=F4SMMe0SQsOrirXYrGiV78qeLHWgVrukUpg0NkiWHgdiTyZ6C1kfzcDuyo5/lKKa5x1woK +A2G8N/TnyfBmoHuFWZq+GqdXsy+19PchDjLWmqy+Duvepp7sIalryv2isGmbxIZjTjU71 8qj7SDh0RkASuVnQFmtWIkuSMBuj0C7dXaos7WwpLMlw48+hUcryC0KUATJ0Zl5jcMTntK Q9pj9FhaJLu86JyffejGiVfN/Kg6kKR+biNd49RNNjYLqJ7Av5cMGxx2QIvnloUIqulCH+ 666kFDleO6BS4AU3TOWOV8NxyOGya0rVTxQhdy50TLa399kFDX5jMu7NcYZ8+w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752064120; a=rsa-sha256; cv=none; b=NuhQlFsYste0y3LebsOixDS38S08duvk4duyQAznFnIw04RB5C2wZ/hXPj36au2XTSdCEa YI6ZLWCdkfgLOTq6EI3PaSKx48IYbacNhWKnGfa+6sIrtQkBQ93WKZkUT/MPTTBXt8AWQN 8YjrRw/VkfZ9AV/0CHDGiDF1AswglntyNO2w2TkToDmmPCkHA36rGSM5V5FEF/sPgmTrG0 yfAWaJM+SdylCMmG7kI5wDWzJWEgcKrojekfKChifHu18PjffJRx+6rKBnAS4TP1JeNE5M PBe7g0ULQIkwydKXvaTtcMcbzpyiYqQpaDu9L7EqtcLgYYDdttZ/SmoSt70DtQ== 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 4bcchm5CVgz6Zr; Wed, 09 Jul 2025 12:28:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 569CSefF041740; Wed, 9 Jul 2025 12:28:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 569CSeDb041737; Wed, 9 Jul 2025 12:28:40 GMT (envelope-from git) Date: Wed, 9 Jul 2025 12:28:40 GMT Message-Id: <202507091228.569CSeDb041737@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 7a96c75098af - stable/14 - pf: limit extra SCTP states 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7a96c75098afe071e49755f1beccaaf08f9ae13f Auto-Submitted: auto-generated The branch stable/14 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=7a96c75098afe071e49755f1beccaaf08f9ae13f commit 7a96c75098afe071e49755f1beccaaf08f9ae13f Author: Kristof Provost AuthorDate: 2025-06-21 09:13:22 +0000 Commit: Kristof Provost CommitDate: 2025-07-09 08:08:50 +0000 pf: limit extra SCTP states For SCTP we create states for all combinations of endpoints, to allow multihoming to work. Malicious users could abuse this to fill our state table more easily than they otherwise could, because we create states between all combinations of endpoints. Limit this to no more than 8 extra endpoints for each side of the connection. MFC after: 2 weeks Sponsored by: Orange Business Services (cherry picked from commit cd0169c9379c400ec75b77e87ca770e37f964276) --- sys/netpfil/pf/pf.c | 11 +++++++++++ tests/sys/netpfil/pf/sctp.py | 28 ++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 2ba2f2213fb7..f067c2b6bdf4 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -191,6 +191,8 @@ VNET_DEFINE(size_t, pf_allrulecount); VNET_DEFINE(struct pf_krule *, pf_rulemarker); #endif +#define PF_SCTP_MAX_ENDPOINTS 8 + struct pf_sctp_endpoint; RB_HEAD(pf_sctp_endpoints, pf_sctp_endpoint); struct pf_sctp_source { @@ -6374,6 +6376,7 @@ pf_sctp_multihome_add_addr(struct pf_pdesc *pd, struct pf_addr *a, uint32_t v_ta }; struct pf_sctp_source *i; struct pf_sctp_endpoint *ep; + int count; PF_SCTP_ENDPOINTS_LOCK(); @@ -6392,13 +6395,21 @@ pf_sctp_multihome_add_addr(struct pf_pdesc *pd, struct pf_addr *a, uint32_t v_ta } /* Avoid inserting duplicates. */ + count = 0; TAILQ_FOREACH(i, &ep->sources, entry) { + count++; if (pf_addr_cmp(&i->addr, a, pd->af) == 0) { PF_SCTP_ENDPOINTS_UNLOCK(); return; } } + /* Limit the number of addresses per endpoint. */ + if (count >= PF_SCTP_MAX_ENDPOINTS) { + PF_SCTP_ENDPOINTS_UNLOCK(); + return; + } + i = malloc(sizeof(*i), M_PFTEMP, M_NOWAIT); if (i == NULL) { PF_SCTP_ENDPOINTS_UNLOCK(); diff --git a/tests/sys/netpfil/pf/sctp.py b/tests/sys/netpfil/pf/sctp.py index 230dbae0d327..da42ce527195 100644 --- a/tests/sys/netpfil/pf/sctp.py +++ b/tests/sys/netpfil/pf/sctp.py @@ -426,6 +426,34 @@ class TestSCTP(VnetTestTemplate): assert re.search(r"all sctp 192.0.2.4:.*192.0.2.3:1234", states) assert re.search(r"all sctp 192.0.2.4:.*192.0.2.2:1234", states) + @pytest.mark.require_user("root") + def test_limit_addresses(self): + srv_vnet = self.vnet_map["vnet2"] + + ifname = self.vnet_map["vnet1"].iface_alias_map["if1"].name + for i in range(0, 16): + ToolsHelper.print_output("/sbin/ifconfig %s inet alias 192.0.2.%d/24" % (ifname, 4 + i)) + + ToolsHelper.print_output("/sbin/pfctl -e") + ToolsHelper.pf_rules([ + "block proto sctp", + "pass on lo", + "pass inet proto sctp to 192.0.2.0/24"]) + + # Set up a connection, which will try to create states for all addresses + # we have assigned + client = SCTPClient("192.0.2.3", 1234) + client.send(b"hello", 0) + rcvd = self.wait_object(srv_vnet.pipe) + print(rcvd) + assert rcvd['ppid'] == 0 + assert rcvd['data'] == "hello" + + # But the number should be limited to 9 (original + 8 extra) + states = ToolsHelper.get_output("/sbin/pfctl -ss | grep 192.0.2.2") + print(states) + assert(states.count('\n') <= 9) + @pytest.mark.require_user("root") def test_disallow_related(self): srv_vnet = self.vnet_map["vnet2"] From nobody Wed Jul 9 12:32:39 2025 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 4bccnT6YTpz61cHp; Wed, 09 Jul 2025 12:32:45 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qt1-x832.google.com (mail-qt1-x832.google.com [IPv6:2607:f8b0:4864:20::832]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bccnT3pcDz42fm; Wed, 09 Jul 2025 12:32:45 +0000 (UTC) (envelope-from markjdb@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-qt1-x832.google.com with SMTP id d75a77b69052e-4a9e7c12decso763021cf.2; Wed, 09 Jul 2025 05:32:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1752064363; x=1752669163; darn=freebsd.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=POhj4R+7+H/bGhTrnjWJ8nkpg2vwRRRfNIyvrMNknxg=; b=QMMADnFxV1LKgPfXyRu0k+WxGYDzP97Le+/TlMjVmKJ5EihLq59n/UwgOezEHpKuHc 1JG6GfU2rt1rnJTpWgJRcDM8WK2z9E+7DvElL+8GeY6x+oazNjydOaUTHvu+ExqyzBov +vRm6Pyz0CLgFXe5/GP58yfE8JIApzKQtJm4QOgph8RLubC/OlRNB/Y5ZjIm7ZMqDsIg iQVU1X8A0dCz6zitXyKdrjJeY5Ds7fuinb6s5sR0zUW1cZA3439CyUEfNQznr7yYouy0 ufImNElNEk+Xzrp2Y0lKF+ZSuP6bvgfNG9zDBjCf/TS1g5oa0xjikr+rkLuZmco1aFQH rKRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752064363; x=1752669163; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=POhj4R+7+H/bGhTrnjWJ8nkpg2vwRRRfNIyvrMNknxg=; b=BCs57BHYVRn6Vyr6AzQB5vXRkDTMDHoDbAgtybIt861QhHxYSi2UkJqbOc4gqDhekP 5MTlw0CfEWif9EyYL/PQruJUIpZQWG/PO+NRUXlnuJiQp74R96Gi8QKC0ofEseFMdQ2B J4qTHY9hKoUBknLAuJiz0SYtDus8PiwV5BwLupQNnAxGI0CqnNdTZQElEZWF0cpQkIbz YQUaXe7QOHIaKFlrpur7rz++dmwRdx90BV+mXoDNaamLuZCTcfj8mWJhBeNhXmWYUxeH YsjiyiM7bfOTbqbee0QFeuPkUY8Cq64TmaUwo7izquNT04iDp90iIfhs8LJ+NYHxQVG3 j4qQ== X-Forwarded-Encrypted: i=1; AJvYcCUDTgps1vzTUqX5CiVaB8t0GRJCjiTKRLZ+yU9SxLSpiIUg+grcrQgU0ab8Nmq/QTILxRWqi74jZfTJ0PdxCC631oRneVU=@freebsd.org, AJvYcCVkLzufksB/R/HmWTG8aDMRwDu3IMAY8VgnjVlg8ptrFW1RSLs5pDgbf7qEKAU3lbZaxDUN+ywyE8zA1bU4GNdXfwvW@freebsd.org X-Gm-Message-State: AOJu0YxhQprJ5y+n5dVb+AE7tIQZGW605MdOY31BG8QFrkCXbFAJQTic FpZEuZB+WGGTt1AMf9fOImqoqFyQcIC81O8CwrSPNhuV4gADM2/x09ptmig0LDAx X-Gm-Gg: ASbGncv/9HXNedc93qKngldAD921btdUCPVuKG5DVqZ9zy8uWohi12ARETBcV0DYuI9 KMujoLB3krdYPozu5NORF+UeW3EqIbmWOX9fhbzrQdejl7/+z/4iQibX/0FZy6lMbMjimOq0veu lwiBEyzuTSXgzA8aKz7Qs8igvh7pmhHcSj6HX9M+XDufno0DTF1O0igF4qr2Ckn/hLYUh++Ey12 3LcLzuHISrbrgytnXCyhXrV/Ql8xIcL/LkQh7NPtvqsXcUPnixqtoyWCcVEtmZDzrlutA0cUrMg eJ2IAD9Cwyg5pnAvDyD4CgyS1RkKKyzvJhfOz/xWDG5hGmTDPSw7DqKZ8e553suTeSOVPBwi0FZ a X-Google-Smtp-Source: AGHT+IGtbovLXn3ZkaOhKx+/TgawkSvbYhnFXOhu+PxFKuVqvD0b7XRWofAywWf8hoN8E3nWkRQ1MQ== X-Received: by 2002:a05:622a:118b:b0:4a6:f854:8104 with SMTP id d75a77b69052e-4a9deae57b2mr31574441cf.0.1752064362916; Wed, 09 Jul 2025 05:32:42 -0700 (PDT) Received: from nuc (192-0-220-237.cpe.teksavvy.com. [192.0.220.237]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-4a994b73653sm92212201cf.0.2025.07.09.05.32.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Jul 2025 05:32:42 -0700 (PDT) Date: Wed, 9 Jul 2025 08:32:39 -0400 From: Mark Johnston To: Nuno Teixeira Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: f9cf745a5084 - main - RELNOTES: Document the addition of inotify Message-ID: References: <202507041513.564FDwxH011496@gitrepo.freebsd.org> 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4bccnT3pcDz42fm X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] On Wed, Jul 09, 2025 at 01:13:02PM +0100, Nuno Teixeira wrote: > Hello, > > Not sure if related but I see devel/libdev failing on recent main (tested > on aarch64): > > libtool: compile: cc -DHAVE_CONFIG_H -I. -O2 -pipe > -fstack-protector-strong -fno-strict-aliasing -MT event.lo -MD -MP -MF > .deps/event.Tpo -c event.c -fPIC -DPIC -o .libs/event.o > --- ev.lo --- > ev.c:510:11: fatal error: 'sys/statfs.h' file not found > 510 | # include > | ^~~~~~~~~~~~~~ Are you able to test the patch below? diff --git a/devel/libev/files/patch-Makefile.in b/devel/libev/files/patch-Makefile.in index 5f6ab0fc3b55..509149e2548b 100644 --- a/devel/libev/files/patch-Makefile.in +++ b/devel/libev/files/patch-Makefile.in @@ -1,6 +1,6 @@ ---- Makefile.in.orig 2015-12-20 21:12:45 UTC +--- Makefile.in.orig 2020-03-18 12:27:30 UTC +++ Makefile.in -@@ -343,7 +343,7 @@ EXTRA_DIST = LICENSE Changes libev.m4 au +@@ -357,7 +357,7 @@ man_MANS = ev.3 ev.3 ev.pod Symbols.ev Symbols.event man_MANS = ev.3 diff --git a/devel/libev/files/patch-configure b/devel/libev/files/patch-configure index c92f6cf66003..6e5bf586cf34 100644 --- a/devel/libev/files/patch-configure +++ b/devel/libev/files/patch-configure @@ -1,6 +1,6 @@ ---- configure.orig 2015-12-20 21:12:45 UTC +--- configure.orig 2020-03-18 12:27:26 UTC +++ configure -@@ -3879,14 +3879,6 @@ else +@@ -3954,14 +3954,6 @@ fi fi diff --git a/devel/libev/files/patch-ev.c b/devel/libev/files/patch-ev.c index 28a00f3aaf8b..65b372e5415a 100644 --- a/devel/libev/files/patch-ev.c +++ b/devel/libev/files/patch-ev.c @@ -1,6 +1,15 @@ ---- ev.c.orig 2015-12-20 21:12:53 UTC +--- ev.c.orig 2020-03-18 12:27:32 UTC +++ ev.c -@@ -2736,7 +2736,7 @@ ev_recommended_backends (void) EV_THROW +@@ -507,7 +507,7 @@ + #endif + + #if EV_USE_INOTIFY +-# include ++# include + # include + /* some very old inotify.h headers don't have IN_DONT_FOLLOW */ + # ifndef IN_DONT_FOLLOW +@@ -3149,7 +3149,7 @@ ev_recommended_backends (void) EV_NOEXCEPT { unsigned int flags = ev_supported_backends (); From nobody Wed Jul 9 13:20:14 2025 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 4bcdrG3WZTz61f96; Wed, 09 Jul 2025 13:20:14 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcdrG1pdQz47Yy; Wed, 09 Jul 2025 13:20:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752067214; 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=9um1JZXJWYK3A8TKS4rvzS80kHWI60TcmxeE9LpvLs8=; b=U/f/UKuX/2swkF+tBnbH+UpS5LTnqD0w2Vof/mksFOq3IDqhRtFcthgtVfRcTO4AdRDJNh 6dWYUAPJlxD/hZWvqp2mecNVNFrIOYBEdJa19g9LK5C8rTx/10g8zCf5+2ZexDdUG1JBG2 4ORKjrCDUovijSda53lK7rHU/g4rSkt7ez9eQcvi5WQpefTIgkLzfzwoX9e8CFnVUhO+/q sWHGO789KvcN2vKFCS5ZBuMVcIu1uHwzpKXUcLN356t2XSHseQhvZ3mLvYIkcwB9mA/sgw g5Y0Zrai2amCDrza5VYwTCTWhv9lXUAzMyNRsAgZD6WI/5IUxR5MfJhIm7jxiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752067214; 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=9um1JZXJWYK3A8TKS4rvzS80kHWI60TcmxeE9LpvLs8=; b=C2S1q/kDEKqeur9x41o+7vUeg1yRcRkB7Ny6LnoWVgsfP+TKC33SO5bub0PDNLjKfQS14f Ub7Mw6sVay1fkLMZMEZGNHYxSPEVr+y9hFAPVrquQFfHxerBGcUm0CBuSMrFDnm02aXmDn Q+/hTrHJEGE/snIeigX4ql3V3llKOEuOsUzmPZeEx16jQEDpfhxs0HrZBIuA2yHFuGg6Gg 8LNG7ihYBqcoTXBvhGBu93EkavLcKsWXSmMTCWqAjxYWhPFO6q9sQApjnLJBvWjx1Vx1HZ Dc/TjcLxr9fGx6GMPSHeWVbnoYaCKd6mX9i2tVWo0CjyxU+roXPRzuozY/hWKA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752067214; a=rsa-sha256; cv=none; b=CKhDu1hPuoqD1P2jStN5yg5OZQMaL4jjNcJy3vZZUNKodkmV9wYY7F07MRtzcdZZ03YKk0 j7Os/SeA7vHpB9jBf6sgEfoYziBvF7sjieQGSFOntOhyl5hB7p66WZnuPpInrTC7UFQbvW zKNxud+xXoxBfQ0hqDd47hiI4RJaXWf5WfrWFnFKelCfIw2h7jn3EvQK6pjH3fnvToqB76 pnIFkvGU7oQBfVB/waawrEVzw35rnhVP/pI8WmRebVgw0EY5r3l3WnL2ID14ZluSdZrSyT V3kTC3YBOOTVzQGD4HmuRwHQPa4WVD1sM6inUbo/vLmbeUpBqS0u7O7pQvFaGw== 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 4bcdrG1QVLz7qw; Wed, 09 Jul 2025 13:20:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 569DKEq1042449; Wed, 9 Jul 2025 13:20:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 569DKE3B042443; Wed, 9 Jul 2025 13:20:14 GMT (envelope-from git) Date: Wed, 9 Jul 2025 13:20:14 GMT Message-Id: <202507091320.569DKE3B042443@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 21876224361a - main - fts: Fix option list indentation. 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 21876224361ad3c01e784d3a7fbe5ad808e00b4c Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=21876224361ad3c01e784d3a7fbe5ad808e00b4c commit 21876224361ad3c01e784d3a7fbe5ad808e00b4c Author: Dag-Erling Smørgrav AuthorDate: 2025-07-09 13:19:56 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-07-09 13:20:08 +0000 fts: Fix option list indentation. Fixes: da2025a0e894 Sponsored by: Klara, Inc. Reviewed by: bcr Differential Revision: https://reviews.freebsd.org/D51208 --- lib/libc/gen/fts.3 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libc/gen/fts.3 b/lib/libc/gen/fts.3 index 5860d1be1a1e..ee558b892c8c 100644 --- a/lib/libc/gen/fts.3 +++ b/lib/libc/gen/fts.3 @@ -394,7 +394,7 @@ must be specified. The options are selected by .Em or Ns 'ing the following values: -.Bl -tag -width "FTS_PHYSICAL" +.Bl -tag -width "FTS_COMFOLLOWDIR" .It Dv FTS_COMFOLLOW This option causes any symbolic link specified as a root path to be followed immediately whether or not From nobody Wed Jul 9 14:24:40 2025 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 4bcgGc3rByz61kHd; Wed, 09 Jul 2025 14:24:40 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcgGc3cmbz3FdK; Wed, 09 Jul 2025 14:24:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752071080; 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=JcAhctUfulqt8Jrs4FmPEgH4gRxlxL9JxXXI5iW/EYI=; b=XqVr4VREx+erfRAlhwWZlmu+gcabHobCFuV1wfVjb3P/bGfd+bm595iB4MXrsCJ6FqmWSN FM+VRZWFKDqR2/ZBb8BK74UKMg1whzz/Hl+r1ynd/9Ah0EOsDlGpGmpYMprge/rD65/sjy DuhYF7zxm1Ahb+UY6O9QbuVa+47rEM5M/eULa3sKTAsgyoj8rWBLBs8WKd8mXclVYKCJFS u+hz0YYWvrnrIbuosgk6K7JgXXNPZdo/xhIMQyOBGh/C2j8Z+I/veqRmJ2gy01dBWGeupN 2DjvAwzr0W6aY2NP1PcZCogjm038fEefimxPvWFVpFgnGY0n5cG0OGq9kzLU+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752071080; 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=JcAhctUfulqt8Jrs4FmPEgH4gRxlxL9JxXXI5iW/EYI=; b=o4vkCLSmYp6OuuO4YDqxI0cMa3xmZ0dTf8A9XTTrTUfk9CdD2SgrUY0uhnHh1EtTlWoSnN omm1M19mp9B7fApiZLMRnDr5x6PYHxtxc8UOlrzVYqqkSn32Rj392wLvhmdhx8Rrdy9rz+ s8Bdj1imB+IWES/nZXsG4Se0GANujASZpSNC1wlB1oMI2DYA5NGkzBPYREew3uCK3oQMkg kfil5mJZFsF1QLIEEyN7RuApDTU3VSkpiNfOJTDRn3ICqAJjizLgbLPKiHebartLRXf+k9 AQelkGXlwMjPoDoqR7OSRYdf14DioAj6s8b74Jca9Y1rjEPFEbprntm0I6Qhpw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752071080; a=rsa-sha256; cv=none; b=jacgqH2OUt9jFQT7SZLoSGveWLyBoHAWCYsaH8diT+WLDLfKWVaWWZMlIrFqbH45MKCzeq 48B7R432Zfc0GlE8nQBjL6MH6pHU04M4aguC5D+o6RAwZs8/38zrrzY/T7V8jy8x0DO9su fEDAq7xmII0YxYSR6YOggr32LZnWOS2afGqhLsV92MjCsy+yENWny4q6kpD5dTdMojLsCa jJUFk6IAmXA6JKRZznT+mj2RrgtuUErxVb0l5GE+7hFdnOIAoG9VBIGDRztVEA/ekpkXla jo2006Gj59h3wzf8FFY76K0j5dH0+E6+is/bmqN7LTgxPbNsqOdCOf+SVmKrSg== 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 4bcgGc39fcz9Ml; Wed, 09 Jul 2025 14:24:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 569EOeB8065605; Wed, 9 Jul 2025 14:24:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 569EOevV065602; Wed, 9 Jul 2025 14:24:40 GMT (envelope-from git) Date: Wed, 9 Jul 2025 14:24:40 GMT Message-Id: <202507091424.569EOevV065602@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: 5c59cec2d5e1 - main - nvmf: Auto-reconnect periodically after a disconnect 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 5c59cec2d5e141de54bbc737477a8e498685186a Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=5c59cec2d5e141de54bbc737477a8e498685186a commit 5c59cec2d5e141de54bbc737477a8e498685186a Author: John Baldwin AuthorDate: 2025-07-09 14:17:41 +0000 Commit: John Baldwin CommitDate: 2025-07-09 14:19:45 +0000 nvmf: Auto-reconnect periodically after a disconnect Use a timer in the nvmf(4) driver to periodically trigger a devctl "RECONNECT" notification. A trigger in the /etc/devd/nvmf.conf file invokes "nvmecontrol reconnect nvmeX" upon each notification. This differs from iSCSI which uses a dedicated daemon (iscsid(8)) to wait inside a custom ioctl for an iSCSI initiator event to occur, but I think this design might be simpler. Similar to nvme-cli, the interval between reconnection attempts is specified in seconds by the --reconnect-delay argument to the connect and reconnect commands. Note that nvme-cli uses -c for short letter of this command, but that was already taken so nvmecontrol uses -r. The default is 10 seconds to match Linux. In addition, a second timeout can be used to force a full detach of a disconnected the nvmeX device after the controller loss timeout expires. The timeout for this is specified in seconds by the --ctrl-loss-tmo/-l options (identical to nvme-cli). The default is 600 seconds. Either of these timers can be disabled by setting the timer to 0. In that case, the associated action (devctl notifications or full detach) will not occur after a disconnect. Note that this adds a dedicated taskqueue for nvmf tasks instead of using taskqueue_thread as the controller loss task could deadlock waiting for the completion of other tasks queued to taskqueue_thread. (Specifically, tearing down the CAM SIM can trigger destroy_dev_sched_cb() and waits for the callback to run, but the callback is scheduled to run in a task on taskqueue_thread. Possibly, destroy_dev_sched should be using a dedicated taskqueue.) Reviewed by: imp (earlier version) Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D50222 --- lib/libnvmf/libnvmf.h | 6 ++- lib/libnvmf/nvmf_host.c | 21 ++++++-- sbin/devd/Makefile | 5 ++ sbin/devd/devd.conf.5 | 4 +- sbin/devd/nvmf.conf | 7 +++ sbin/nvmecontrol/connect.c | 11 +++- sbin/nvmecontrol/nvmecontrol.8 | 31 ++++++++++- sbin/nvmecontrol/reconnect.c | 17 +++++- sys/dev/nvmf/host/nvmf.c | 119 +++++++++++++++++++++++++++++++++++++++-- sys/dev/nvmf/host/nvmf_var.h | 6 +++ sys/dev/nvmf/nvmf.h | 11 ++++ 11 files changed, 221 insertions(+), 17 deletions(-) diff --git a/lib/libnvmf/libnvmf.h b/lib/libnvmf/libnvmf.h index 9840e190a24f..7cdd7e433455 100644 --- a/lib/libnvmf/libnvmf.h +++ b/lib/libnvmf/libnvmf.h @@ -342,7 +342,8 @@ int nvmf_host_request_queues(struct nvmf_qpair *qp, u_int requested, */ int nvmf_handoff_host(const struct nvme_discovery_log_entry *dle, const char *hostnqn, struct nvmf_qpair *admin_qp, u_int num_queues, - struct nvmf_qpair **io_queues, const struct nvme_controller_data *cdata); + struct nvmf_qpair **io_queues, const struct nvme_controller_data *cdata, + uint32_t reconnect_delay, uint32_t controller_loss_timeout); /* * Disconnect an active host association previously handed off to the @@ -370,7 +371,8 @@ int nvmf_reconnect_params(int fd, nvlist_t **nvlp); */ int nvmf_reconnect_host(int fd, const struct nvme_discovery_log_entry *dle, const char *hostnqn, struct nvmf_qpair *admin_qp, u_int num_queues, - struct nvmf_qpair **io_queues, const struct nvme_controller_data *cdata); + struct nvmf_qpair **io_queues, const struct nvme_controller_data *cdata, + uint32_t reconnect_delay, uint32_t controller_loss_timeout); /* * Fetch connection status from an existing kernel host. diff --git a/lib/libnvmf/nvmf_host.c b/lib/libnvmf/nvmf_host.c index 89cdd5c6bb70..3266f8898296 100644 --- a/lib/libnvmf/nvmf_host.c +++ b/lib/libnvmf/nvmf_host.c @@ -792,7 +792,8 @@ static int prepare_queues_for_handoff(struct nvmf_ioc_nv *nv, const struct nvme_discovery_log_entry *dle, const char *hostnqn, struct nvmf_qpair *admin_qp, u_int num_queues, - struct nvmf_qpair **io_queues, const struct nvme_controller_data *cdata) + struct nvmf_qpair **io_queues, const struct nvme_controller_data *cdata, + uint32_t reconnect_delay, uint32_t controller_loss_timeout) { const struct nvmf_association *na = admin_qp->nq_association; nvlist_t *nvl, *nvl_qp, *nvl_rparams; @@ -820,6 +821,9 @@ prepare_queues_for_handoff(struct nvmf_ioc_nv *nv, nvlist_add_string(nvl_rparams, "hostnqn", hostnqn); nvlist_add_number(nvl_rparams, "num_io_queues", num_queues); nvlist_add_number(nvl_rparams, "kato", admin_qp->nq_kato); + nvlist_add_number(nvl_rparams, "reconnect_delay", reconnect_delay); + nvlist_add_number(nvl_rparams, "controller_loss_timeout", + controller_loss_timeout); nvlist_add_number(nvl_rparams, "io_qsize", io_queues[0]->nq_qsize); nvlist_add_bool(nvl_rparams, "sq_flow_control", na->na_params.sq_flow_control); @@ -842,6 +846,9 @@ prepare_queues_for_handoff(struct nvmf_ioc_nv *nv, nvl = nvlist_create(0); nvlist_add_number(nvl, "trtype", na->na_trtype); nvlist_add_number(nvl, "kato", admin_qp->nq_kato); + nvlist_add_number(nvl, "reconnect_delay", reconnect_delay); + nvlist_add_number(nvl, "controller_loss_timeout", + controller_loss_timeout); nvlist_move_nvlist(nvl, "rparams", nvl_rparams); /* First, the admin queue. */ @@ -872,7 +879,8 @@ prepare_queues_for_handoff(struct nvmf_ioc_nv *nv, int nvmf_handoff_host(const struct nvme_discovery_log_entry *dle, const char *hostnqn, struct nvmf_qpair *admin_qp, u_int num_queues, - struct nvmf_qpair **io_queues, const struct nvme_controller_data *cdata) + struct nvmf_qpair **io_queues, const struct nvme_controller_data *cdata, + uint32_t reconnect_delay, uint32_t controller_loss_timeout) { struct nvmf_ioc_nv nv; u_int i; @@ -885,7 +893,8 @@ nvmf_handoff_host(const struct nvme_discovery_log_entry *dle, } error = prepare_queues_for_handoff(&nv, dle, hostnqn, admin_qp, - num_queues, io_queues, cdata); + num_queues, io_queues, cdata, reconnect_delay, + controller_loss_timeout); if (error != 0) goto out; @@ -981,14 +990,16 @@ nvmf_reconnect_params(int fd, nvlist_t **nvlp) int nvmf_reconnect_host(int fd, const struct nvme_discovery_log_entry *dle, const char *hostnqn, struct nvmf_qpair *admin_qp, u_int num_queues, - struct nvmf_qpair **io_queues, const struct nvme_controller_data *cdata) + struct nvmf_qpair **io_queues, const struct nvme_controller_data *cdata, + uint32_t reconnect_delay, uint32_t controller_loss_timeout) { struct nvmf_ioc_nv nv; u_int i; int error; error = prepare_queues_for_handoff(&nv, dle, hostnqn, admin_qp, - num_queues, io_queues, cdata); + num_queues, io_queues, cdata, reconnect_delay, + controller_loss_timeout); if (error != 0) goto out; diff --git a/sbin/devd/Makefile b/sbin/devd/Makefile index 4ff0187a5a22..5d5721d16884 100644 --- a/sbin/devd/Makefile +++ b/sbin/devd/Makefile @@ -46,6 +46,11 @@ HYPERV+= hyperv.conf HYPERVPACKAGE= hyperv-tools .endif +CONFGROUPS+= NVME +NVMEDIR= ${DEVDDIR} +NVME+= nvmf.conf +NVMEPACKAGE= nvme-tools + .if ${MK_USB} != "no" DEVD+= uath.conf ulpt.conf .endif diff --git a/sbin/devd/devd.conf.5 b/sbin/devd/devd.conf.5 index 4dbd7338edb1..baf4b9d3a183 100644 --- a/sbin/devd/devd.conf.5 +++ b/sbin/devd/devd.conf.5 @@ -38,7 +38,7 @@ .\" ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS .\" SOFTWARE. .\" -.Dd July 8, 2025 +.Dd July 9, 2025 .Dt DEVD.CONF 5 .Os .Sh NAME @@ -517,6 +517,8 @@ and representing the start of a controller reset, the successful completion of a controller reset, or a timeout while waiting for the controller to reset, respectively. +.It Li nvme Ta Li controller Ta Li RECONNECT Ta +An NVMe over Fabrics host has disconnected and is requesting a reconnect. .El .Pp .Bl -column "SYSTEM" "SUBSYSTEM" "SHUTDOWN-THRESHOLD" -compact diff --git a/sbin/devd/nvmf.conf b/sbin/devd/nvmf.conf new file mode 100644 index 000000000000..eaf3ebe86cec --- /dev/null +++ b/sbin/devd/nvmf.conf @@ -0,0 +1,7 @@ +# Attempt to reconnect NVMeoF host devices when requested +notify 100 { + match "system" "nvme"; + match "subsystem" "controller"; + match "type" "RECONNECT"; + action "nvmecontrol reconnect $name"; +}; diff --git a/sbin/nvmecontrol/connect.c b/sbin/nvmecontrol/connect.c index c1d5d2cbaf5a..3d6d12bf2c48 100644 --- a/sbin/nvmecontrol/connect.c +++ b/sbin/nvmecontrol/connect.c @@ -31,6 +31,8 @@ static struct options { const char *subnqn; const char *hostnqn; uint32_t kato; + uint32_t reconnect_delay; + uint32_t controller_loss_timeout; uint16_t num_io_queues; uint16_t queue_size; bool data_digests; @@ -43,6 +45,8 @@ static struct options { .subnqn = NULL, .hostnqn = NULL, .kato = NVMF_KATO_DEFAULT / 1000, + .reconnect_delay = NVMF_DEFAULT_RECONNECT_DELAY, + .controller_loss_timeout = NVMF_DEFAULT_CONTROLLER_LOSS, .num_io_queues = 1, .queue_size = 0, .data_digests = false, @@ -107,7 +111,7 @@ connect_nvm_controller(enum nvmf_trtype trtype, int adrfam, const char *address, } error = nvmf_handoff_host(dle, hostnqn, admin, opt.num_io_queues, io, - &cdata); + &cdata, opt.reconnect_delay, opt.controller_loss_timeout); if (error != 0) { warnc(error, "Failed to handoff queues to kernel"); free(io); @@ -259,6 +263,11 @@ static const struct opts connect_opts[] = { "Number of entries in each I/O queue"), OPT("keep-alive-tmo", 'k', arg_uint32, opt, kato, "Keep Alive timeout (in seconds)"), + OPT("reconnect-delay", 'r', arg_uint32, opt, reconnect_delay, + "Delay between reconnect attempts after connection loss " + "(in seconds)"), + OPT("ctrl-loss-tmo", 'l', arg_uint32, opt, controller_loss_timeout, + "Controller loss timeout after connection loss (in seconds)"), OPT("hostnqn", 'q', arg_string, opt, hostnqn, "Host NQN"), OPT("flow_control", 'F', arg_none, opt, flow_control, diff --git a/sbin/nvmecontrol/nvmecontrol.8 b/sbin/nvmecontrol/nvmecontrol.8 index d886b60a2545..624a0c93719b 100644 --- a/sbin/nvmecontrol/nvmecontrol.8 +++ b/sbin/nvmecontrol/nvmecontrol.8 @@ -33,7 +33,7 @@ .\" .\" Author: Jim Harris .\" -.Dd April 29, 2025 +.Dd July 9, 2025 .Dt NVMECONTROL 8 .Os .Sh NAME @@ -216,6 +216,8 @@ .Op Fl c Ar cntl-id .Op Fl i Ar queues .Op Fl k Ar seconds +.Op Fl l Ar seconds +.Op Fl r Ar seconds .Op Fl t Ar transport .Op Fl q Ar HostNQN .Op Fl Q Ar entries @@ -226,6 +228,8 @@ .Op Fl FGg .Op Fl i Ar queues .Op Fl k Ar seconds +.Op Fl l Ar seconds +.Op Fl r Ar seconds .Op Fl t Ar transport .Op Fl q Ar HostNQN .Op Fl Q Ar entries @@ -241,6 +245,8 @@ .Op Fl FGg .Op Fl i Ar queues .Op Fl k Ar seconds +.Op Fl l Ar seconds +.Op Fl r Ar seconds .Op Fl t Ar transport .Op Fl q Ar HostNQN .Op Fl Q Ar entries @@ -786,6 +792,29 @@ The default is 1. .It Fl k Ar seconds Keep Alive timer duration in seconds. The default is 120. +.It Fl l Ar seconds +Controller Loss timer duration in seconds. +The default is 600. +.Pp +This timer starts when an association is lost with a remote I/O controller +and is cancelled when a new association is established. +If the timer expires, the controller device is deleted. +A setting of zero disables this timer. +.It Fl r Ar seconds +Reconnect timer duration in seconds. +The default is 10. +.Pp +When an association is lost with a remote I/O controller, +the controller device will request reconnection via periodic +.Xr devctl 4 +notifications until either a new association is established or the controller +device is deleted. +This timer sets the interval between each +.Xr devctl 4 +notification. +Note that the first notification is triggered immediately after an association +is lost. +A setting of zero disables this timer. .It Fl t Ar transport Transport to use. The default is diff --git a/sbin/nvmecontrol/reconnect.c b/sbin/nvmecontrol/reconnect.c index adf1edac662b..06af40624177 100644 --- a/sbin/nvmecontrol/reconnect.c +++ b/sbin/nvmecontrol/reconnect.c @@ -27,6 +27,8 @@ static struct options { const char *transport; const char *hostnqn; uint32_t kato; + uint32_t reconnect_delay; + uint32_t controller_loss_timeout; uint16_t num_io_queues; uint16_t queue_size; bool data_digests; @@ -37,6 +39,8 @@ static struct options { .transport = "tcp", .hostnqn = NULL, .kato = NVMF_KATO_DEFAULT / 1000, + .reconnect_delay = NVMF_DEFAULT_RECONNECT_DELAY, + .controller_loss_timeout = NVMF_DEFAULT_CONTROLLER_LOSS, .num_io_queues = 1, .queue_size = 0, .data_digests = false, @@ -59,6 +63,7 @@ static int reconnect_nvm_controller(int fd, const struct nvmf_association_params *aparams, enum nvmf_trtype trtype, int adrfam, const char *address, const char *port, uint16_t cntlid, const char *subnqn, const char *hostnqn, uint32_t kato, + uint32_t reconnect_delay, uint32_t controller_loss_timeout, u_int num_io_queues, u_int queue_size, const struct nvme_discovery_log_entry *dle) { @@ -88,7 +93,7 @@ reconnect_nvm_controller(int fd, const struct nvmf_association_params *aparams, } error = nvmf_reconnect_host(fd, dle, hostnqn, admin, num_io_queues, io, - &cdata); + &cdata, reconnect_delay, controller_loss_timeout); if (error != 0) { warnc(error, "Failed to handoff queues to kernel"); free(io); @@ -137,7 +142,8 @@ reconnect_by_address(int fd, const nvlist_t *rparams, const char *addr) error = reconnect_nvm_controller(fd, &aparams, trtype, AF_UNSPEC, address, port, le16toh(dle->cntlid), subnqn, hostnqn, - opt.kato * 1000, opt.num_io_queues, opt.queue_size, NULL); + opt.kato * 1000, opt.reconnect_delay, opt.controller_loss_timeout, + opt.num_io_queues, opt.queue_size, NULL); free(subnqn); free(tofree); return (error); @@ -196,6 +202,8 @@ reconnect_by_params(int fd, const nvlist_t *rparams) address, port, le16toh(dle->cntlid), dle->subnqn, nvlist_get_string(rparams, "hostnqn"), dnvlist_get_number(rparams, "kato", 0), + dnvlist_get_number(rparams, "reconnect_delay", 0), + dnvlist_get_number(rparams, "controller_loss_timeout", 0), nvlist_get_number(rparams, "num_io_queues"), nvlist_get_number(rparams, "io_qsize"), dle); free(subnqn); @@ -291,6 +299,11 @@ static const struct opts reconnect_opts[] = { "Number of entries in each I/O queue"), OPT("keep-alive-tmo", 'k', arg_uint32, opt, kato, "Keep Alive timeout (in seconds)"), + OPT("reconnect-delay", 'r', arg_uint32, opt, reconnect_delay, + "Delay between reconnect attempts after connection loss " + "(in seconds)"), + OPT("ctrl-loss-tmo", 'l', arg_uint32, opt, controller_loss_timeout, + "Controller loss timeout after connection loss (in seconds)"), OPT("hostnqn", 'q', arg_string, opt, hostnqn, "Host NQN"), OPT("flow_control", 'F', arg_none, opt, flow_control, diff --git a/sys/dev/nvmf/host/nvmf.c b/sys/dev/nvmf/host/nvmf.c index dbdd4568bdf1..1ac0d142443b 100644 --- a/sys/dev/nvmf/host/nvmf.c +++ b/sys/dev/nvmf/host/nvmf.c @@ -27,6 +27,7 @@ #include static struct cdevsw nvmf_cdevsw; +static struct taskqueue *nvmf_tq; bool nvmf_fail_disconnect = false; SYSCTL_BOOL(_kern_nvmf, OID_AUTO, fail_on_disconnection, CTLFLAG_RWTUN, @@ -34,7 +35,10 @@ SYSCTL_BOOL(_kern_nvmf, OID_AUTO, fail_on_disconnection, CTLFLAG_RWTUN, MALLOC_DEFINE(M_NVMF, "nvmf", "NVMe over Fabrics host"); +static void nvmf_controller_loss_task(void *arg, int pending); static void nvmf_disconnect_task(void *arg, int pending); +static void nvmf_request_reconnect(struct nvmf_softc *sc); +static void nvmf_request_reconnect_task(void *arg, int pending); static void nvmf_shutdown_pre_sync(void *arg, int howto); static void nvmf_shutdown_post_sync(void *arg, int howto); @@ -294,6 +298,9 @@ nvmf_establish_connection(struct nvmf_softc *sc, nvlist_t *nvl) admin = nvlist_get_nvlist(nvl, "admin"); io = nvlist_get_nvlist_array(nvl, "io", &num_io_queues); kato = dnvlist_get_number(nvl, "kato", 0); + sc->reconnect_delay = dnvlist_get_number(nvl, "reconnect_delay", 0); + sc->controller_loss_timeout = dnvlist_get_number(nvl, + "controller_loss_timeout", 0); /* Setup the admin queue. */ sc->admin = nvmf_init_qp(sc, trtype, admin, "admin queue", 0); @@ -504,6 +511,10 @@ nvmf_attach(device_t dev) callout_init(&sc->ka_tx_timer, 1); sx_init(&sc->connection_lock, "nvmf connection"); TASK_INIT(&sc->disconnect_task, 0, nvmf_disconnect_task, sc); + TIMEOUT_TASK_INIT(nvmf_tq, &sc->controller_loss_task, 0, + nvmf_controller_loss_task, sc); + TIMEOUT_TASK_INIT(nvmf_tq, &sc->request_reconnect_task, 0, + nvmf_request_reconnect_task, sc); oid = SYSCTL_ADD_NODE(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "ioq", @@ -603,7 +614,9 @@ out: nvmf_destroy_aer(sc); - taskqueue_drain(taskqueue_thread, &sc->disconnect_task); + taskqueue_drain_timeout(nvmf_tq, &sc->request_reconnect_task); + taskqueue_drain_timeout(nvmf_tq, &sc->controller_loss_task); + taskqueue_drain(nvmf_tq, &sc->disconnect_task); sx_destroy(&sc->connection_lock); nvlist_destroy(sc->rparams); free(sc->cdata, M_NVMF); @@ -613,7 +626,7 @@ out: void nvmf_disconnect(struct nvmf_softc *sc) { - taskqueue_enqueue(taskqueue_thread, &sc->disconnect_task); + taskqueue_enqueue(nvmf_tq, &sc->disconnect_task); } static void @@ -676,6 +689,74 @@ nvmf_disconnect_task(void *arg, int pending __unused) nvmf_destroy_qp(sc->admin); sc->admin = NULL; + if (sc->reconnect_delay != 0) + nvmf_request_reconnect(sc); + if (sc->controller_loss_timeout != 0) + taskqueue_enqueue_timeout(nvmf_tq, + &sc->controller_loss_task, sc->controller_loss_timeout * + hz); + + sx_xunlock(&sc->connection_lock); +} + +static void +nvmf_controller_loss_task(void *arg, int pending) +{ + struct nvmf_softc *sc = arg; + device_t dev; + int error; + + bus_topo_lock(); + sx_xlock(&sc->connection_lock); + if (sc->admin != NULL || sc->detaching) { + /* Reconnected or already detaching. */ + sx_xunlock(&sc->connection_lock); + bus_topo_unlock(); + return; + } + + sc->controller_timedout = true; + sx_xunlock(&sc->connection_lock); + + /* + * XXX: Doing this from here is a bit ugly. We don't have an + * extra reference on `dev` but bus_topo_lock should block any + * concurrent device_delete_child invocations. + */ + dev = sc->dev; + error = device_delete_child(root_bus, dev); + if (error != 0) + device_printf(dev, + "failed to detach after controller loss: %d\n", error); + bus_topo_unlock(); +} + +static void +nvmf_request_reconnect(struct nvmf_softc *sc) +{ + char buf[64]; + + sx_assert(&sc->connection_lock, SX_LOCKED); + + snprintf(buf, sizeof(buf), "name=\"%s\"", device_get_nameunit(sc->dev)); + devctl_notify("nvme", "controller", "RECONNECT", buf); + taskqueue_enqueue_timeout(nvmf_tq, &sc->request_reconnect_task, + sc->reconnect_delay * hz); +} + +static void +nvmf_request_reconnect_task(void *arg, int pending) +{ + struct nvmf_softc *sc = arg; + + sx_xlock(&sc->connection_lock); + if (sc->admin != NULL || sc->detaching || sc->controller_timedout) { + /* Reconnected or already detaching. */ + sx_xunlock(&sc->connection_lock); + return; + } + + nvmf_request_reconnect(sc); sx_xunlock(&sc->connection_lock); } @@ -699,7 +780,7 @@ nvmf_reconnect_host(struct nvmf_softc *sc, struct nvmf_ioc_nv *nv) } sx_xlock(&sc->connection_lock); - if (sc->admin != NULL || sc->detaching) { + if (sc->admin != NULL || sc->detaching || sc->controller_timedout) { error = EBUSY; goto out; } @@ -745,6 +826,9 @@ nvmf_reconnect_host(struct nvmf_softc *sc, struct nvmf_ioc_nv *nv) nvmf_reconnect_sim(sc); nvmf_rescan_all_ns(sc); + + taskqueue_cancel_timeout(nvmf_tq, &sc->request_reconnect_task, NULL); + taskqueue_cancel_timeout(nvmf_tq, &sc->controller_loss_task, NULL); out: sx_xunlock(&sc->connection_lock); nvlist_destroy(nvl); @@ -852,7 +936,21 @@ nvmf_detach(device_t dev) } free(sc->io, M_NVMF); - taskqueue_drain(taskqueue_thread, &sc->disconnect_task); + taskqueue_drain(nvmf_tq, &sc->disconnect_task); + if (taskqueue_cancel_timeout(nvmf_tq, &sc->request_reconnect_task, + NULL) != 0) + taskqueue_drain_timeout(nvmf_tq, &sc->request_reconnect_task); + + /* + * Don't cancel/drain the controller loss task if that task + * has fired and is triggering the detach. + */ + if (!sc->controller_timedout) { + if (taskqueue_cancel_timeout(nvmf_tq, &sc->controller_loss_task, + NULL) != 0) + taskqueue_drain_timeout(nvmf_tq, + &sc->controller_loss_task); + } if (sc->admin != NULL) nvmf_destroy_qp(sc->admin); @@ -1154,14 +1252,25 @@ static struct cdevsw nvmf_cdevsw = { static int nvmf_modevent(module_t mod, int what, void *arg) { + int error; + switch (what) { case MOD_LOAD: - return (nvmf_ctl_load()); + error = nvmf_ctl_load(); + if (error != 0) + return (error); + + nvmf_tq = taskqueue_create("nvmf", M_WAITOK | M_ZERO, + taskqueue_thread_enqueue, &nvmf_tq); + taskqueue_start_threads(&nvmf_tq, 1, PWAIT, "nvmf taskq"); + return (0); case MOD_QUIESCE: return (0); case MOD_UNLOAD: nvmf_ctl_unload(); destroy_dev_drain(&nvmf_cdevsw); + if (nvmf_tq != NULL) + taskqueue_free(nvmf_tq); return (0); default: return (EOPNOTSUPP); diff --git a/sys/dev/nvmf/host/nvmf_var.h b/sys/dev/nvmf/host/nvmf_var.h index e45a31f413a4..606245b3969c 100644 --- a/sys/dev/nvmf/host/nvmf_var.h +++ b/sys/dev/nvmf/host/nvmf_var.h @@ -75,9 +75,15 @@ struct nvmf_softc { struct callout ka_rx_timer; sbintime_t ka_rx_sbt; + struct timeout_task request_reconnect_task; + struct timeout_task controller_loss_task; + uint32_t reconnect_delay; + uint32_t controller_loss_timeout; + struct sx connection_lock; struct task disconnect_task; bool detaching; + bool controller_timedout; u_int num_aer; struct nvmf_aer *aer; diff --git a/sys/dev/nvmf/nvmf.h b/sys/dev/nvmf/nvmf.h index d4e7b1511e9d..9b2b4c1dea40 100644 --- a/sys/dev/nvmf/nvmf.h +++ b/sys/dev/nvmf/nvmf.h @@ -26,6 +26,13 @@ #define NVMF_NN (1024) +/* + * Default timeouts for Fabrics hosts. These match values used by + * Linux. + */ +#define NVMF_DEFAULT_RECONNECT_DELAY 10 +#define NVMF_DEFAULT_CONTROLLER_LOSS 600 + /* * (data, size) is the userspace buffer for a packed nvlist. * @@ -68,6 +75,8 @@ struct nvmf_ioc_nv { * * number trtype * number kato (optional) + * number reconnect_delay (optional) + * number controller_loss_timeout (optional) * qpair handoff nvlist admin * qpair handoff nvlist array io * binary cdata struct nvme_controller_data @@ -81,6 +90,8 @@ struct nvmf_ioc_nv { * string hostnqn * number num_io_queues * number kato (optional) + * number reconnect_delay (optional) + * number controller_loss_timeout (optional) * number io_qsize * bool sq_flow_control * From nobody Wed Jul 9 15:40:25 2025 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 4bchy222bHz60Zb6; Wed, 09 Jul 2025 15:40:26 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bchy16wLvz3ZVk; Wed, 09 Jul 2025 15:40:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752075626; 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=nbuYKtlyItImIcVxJbzIKJRTY42+R5M7kqXNtM/yJ1s=; b=ENTGpwIgXlBbJ76B11L9bNF9TmJEY9cO5MfzYOYGkS+5Kl+ryuLMb22c4kCTauW60SEGak G4JnogQ3yM6zBvqB//wAFWgG4MketfOEvLV9a/NTWPkR4Zj7PfWl5pcW4LMIuMhBVNCT8x Chtt0ZCeaDjBbHwTuFIaEzkGVHIwQ2P61EkueiFEcRfo7coS2IrKz7784AzOUJxwE0zGnf DQDub2EVLnQzZB/ShfMzpFsk2AAcSfaW9jz+LzQMUQgd+hlNc/M44QMLWNn4oNOr8mAQP7 whitWnqiS93PY8zxFqdVoulE8GjNqA/iqDQO83b3zrgMRqGLmKAhDAo1WLkeeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752075626; 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=nbuYKtlyItImIcVxJbzIKJRTY42+R5M7kqXNtM/yJ1s=; b=DVFmYfSCyi20y/OJ/wj+xU84eGsPJbSKgcV2Zvyf+gZPubDo8NyKhWtUl69zfd8fcfrdjs HYTdbgv4XF+fqwJW2blAgIrnM9hMeksaUra36LVEqYD4AUe0TMF6wNrIz6oJ8tsOHg0qCO ZyKYRId9jKtghtrYGNGuUziBZklvRNvXpdiFhopx+vuhFz8RB70CkxoLbOVyeOeVovMbhz HijhUNaHUyxAJpMTMWEyT9VXkDyF/IgXtp3vmeqxQ/L7JCmywT3jB2xXdHPwZvw59PQyNm w4fjmUUVisdti9z1IyGISsVgxiN3dAVR6DLSzXyRyZT3PZa6+2r4WG8AKxhQtw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752075626; a=rsa-sha256; cv=none; b=jri2p1E524QDXe3nO1sTHePituHOIXMksuu4E88WO4wxuEzlYasv4r/6Gd6iVCrlAlGyEH oWw4wOLUETfYO4sXBAcPd+Ah44mFtbvt4+6KN4oJQIbP5xO/84C5tZ7+Zbi/eDH9imcLaR YmCtVHu/7vzHSiXeJzVwDq4koWJFcIQrOAdfknCtMHMOxl9KsOH9dpj0+rF+EQnCWDvXFT r4K8AzYEQOXl9tz+6lEgnCTqJ3a3ZUITfanEFEZdTdSnm7KVZF2wNM/FXu79l0Al/ILwJD UDUY9fArV83UDpVRLr6vGJ8kLDrWTieOvLeMLT9A1GSeoAaAA/W/swl2Eky0Xg== 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 4bchy16J73zCfJ; Wed, 09 Jul 2025 15:40:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 569FePUv008433; Wed, 9 Jul 2025 15:40:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 569FeP1Y008430; Wed, 9 Jul 2025 15:40:25 GMT (envelope-from git) Date: Wed, 9 Jul 2025 15:40:25 GMT Message-Id: <202507091540.569FeP1Y008430@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 4af4fefedd1b - main - pf: ignore state update with invalid rtableid 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4af4fefedd1bf14b5a27387075edde98744b722e Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=4af4fefedd1bf14b5a27387075edde98744b722e commit 4af4fefedd1bf14b5a27387075edde98744b722e Author: Kristof Provost AuthorDate: 2025-07-08 11:21:20 +0000 Commit: Kristof Provost CommitDate: 2025-07-09 15:38:07 +0000 pf: ignore state update with invalid rtableid It's possible for a peer to send us a state update with an rtableid we don't support (i.e. >= net.fibs). Drop these updates rather than potentially crashing later by setting an invalid fib number. PR: 287981 MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/if_pfsync.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/netpfil/pf/if_pfsync.c b/sys/netpfil/pf/if_pfsync.c index fdedb9424117..64cc476fb3cb 100644 --- a/sys/netpfil/pf/if_pfsync.c +++ b/sys/netpfil/pf/if_pfsync.c @@ -763,6 +763,10 @@ pfsync_state_import(union pfsync_state_union *sp, int flags, int msg_version) __func__, msg_version); } + if (! (st->act.rtableid == -1 || + (st->act.rtableid >= 0 && st->act.rtableid < rt_numfibs))) + goto cleanup; + st->id = sp->pfs_1301.id; st->creatorid = sp->pfs_1301.creatorid; pf_state_peer_ntoh(&sp->pfs_1301.src, &st->src); From nobody Wed Jul 9 15:40:26 2025 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 4bchy33DFmz60ZxM; Wed, 09 Jul 2025 15:40:27 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bchy31dlXz3ZHt; Wed, 09 Jul 2025 15:40:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752075627; 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=i1JVXmoukUIxYFi1Bdo3kOSxZ+egSBY3uxPMhcEmLMo=; b=qCZia2qJi52RcCxPWHMbraKfIS8EteoQIY9abknJvB3ZuNM3mhmWxZ4W+rgErUNyDqV/xX u3QStUtqBGWTLDc0JTJ9UVpXo6U0B5wLB3W83oHBaaCR6aZ9svdVuOAvXMfAA4IdHSwfur Hhj8gh1t693jdGAtbjjPBaMgpxclyLKXJJtoKtc1j0I4InXE1RRr7uHU5g1zHIwD+Ar9So nSStGOCdbhGOeimebpmRf3LjlM6WagTA7DwHb3YPKl7TBWdHVkWgqkWNTss3Rlib/QzhCc dhrXGHjybPKTd0E2hDc+BAjCbV0/+ALcTxi9qzo3WA2EmbgPCllNmu3mHeBP6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752075627; 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=i1JVXmoukUIxYFi1Bdo3kOSxZ+egSBY3uxPMhcEmLMo=; b=sXz22MVGmNaCSZ/Km1pdAFrBIzh7JV/J+zBoHVSALzj1k7OxjcKb8r+oPyEcsAhOl7lxjH SFGX4nPJUjkGsjP0LFHC5SAXEQF5G+r1G7QUbg5S4ZdPx3qzqOYiV4gK3Jm3L+6s1aKi4r IrarNERC6pmdoUAPdh7yq8CAdrgKkzbbEmsQPFJIIQkricBXyPd1F/ou912OxOaCcyRTaV wfwntRUInhyDH0X3j01s+WzZ2zjR2Rlei80WjncXaNri2vgG8hfBryTKAcMgdAQWtRKoVd Qn+H5RPzR+FTkp3BERx6Cx/vsvjze7XCrL2nMfPXWQhyszJPbG2PMFn5CN+TCg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752075627; a=rsa-sha256; cv=none; b=pOKjsucdggmIrBSg/3+fF+gIpHmI5qUyxS7dVgJIdRYtO8EOGwxn4MC8eeRVkNB7FUJYxN rnPbmen3+DA1klnUloZWKWUNnahmM4l5SIwU20RlI754p3ARdXds0Rc4iO4twmprnvUHz5 K6GMaZd0gNSsss4kauN7pCEw5TvDpoNxmnOqCQVjYc0pRUEoIjtSyLIWEGNGWGeAjr7GOx cOP7PFlVQP2bO1GQx2e2AUeywfIhiKyq6Sqr+aB0X1yI8QoJud+cIBJzhFkPe2JaxVth+8 7F0iZ1450g+b9LQ/4H5Ce0xtmyM5ZjQimdxkpnWKYcfOoDaCEaTX6xvvufatjw== 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 4bchy26yftzCfK; Wed, 09 Jul 2025 15:40:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 569FeQAr008481; Wed, 9 Jul 2025 15:40:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 569FeQP5008478; Wed, 9 Jul 2025 15:40:26 GMT (envelope-from git) Date: Wed, 9 Jul 2025 15:40:26 GMT Message-Id: <202507091540.569FeQP5008478@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: f651e87be28d - main - pf tests: sync a state with an rtableid that doesn't exist 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f651e87be28dd6c3f466dc865b1a036089b892ff Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=f651e87be28dd6c3f466dc865b1a036089b892ff commit f651e87be28dd6c3f466dc865b1a036089b892ff Author: Kristof Provost AuthorDate: 2025-07-08 15:14:16 +0000 Commit: Kristof Provost CommitDate: 2025-07-09 15:38:08 +0000 pf tests: sync a state with an rtableid that doesn't exist Create a state with an rtableid (i.e. fib) that doesn't exist on the receiving side. This used to not be handled, and could provoke panics. Create such a situation to ensure we still don't panic. PR: 287981 MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") --- tests/sys/netpfil/pf/pfsync.sh | 85 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) diff --git a/tests/sys/netpfil/pf/pfsync.sh b/tests/sys/netpfil/pf/pfsync.sh index 7f545b43a066..3be4a3024393 100644 --- a/tests/sys/netpfil/pf/pfsync.sh +++ b/tests/sys/netpfil/pf/pfsync.sh @@ -835,6 +835,90 @@ basic_ipv6_cleanup() pfsynct_cleanup } +atf_test_case "rtable" "cleanup" +rtable_head() +{ + atf_set descr 'Test handling of invalid rtableid' + atf_set require.user root +} + +rtable_body() +{ + pfsynct_init + + epair_sync=$(vnet_mkepair) + epair_one=$(vnet_mkepair) + epair_two=$(vnet_mkepair) + + vnet_mkjail one ${epair_one}a ${epair_sync}a + vnet_mkjail two ${epair_two}a ${epair_sync}b + + # pfsync interface + jexec one ifconfig ${epair_sync}a 192.0.2.1/24 up + jexec one ifconfig ${epair_one}a 198.51.100.1/24 up + jexec one ifconfig pfsync0 \ + syncdev ${epair_sync}a \ + maxupd 1 \ + up + jexec two ifconfig ${epair_two}a 198.51.100.1/24 up + jexec two ifconfig ${epair_sync}b 192.0.2.2/24 up + jexec two ifconfig pfsync0 \ + syncdev ${epair_sync}b \ + maxupd 1 \ + up + + # Make life easy, give ${epair_two}a the same mac addrss as ${epair_one}a + mac=$(jexec one ifconfig ${epair_one}a | awk '/ether/ { print($2); }') + jexec two ifconfig ${epair_two}a ether ${mac} + + # Enable pf! + jexec one /sbin/sysctl net.fibs=8 + jexec one pfctl -e + pft_set_rules one \ + "set skip on ${epair_sync}a" \ + "pass rtable 3 keep state" + # No extra fibs in two + jexec two pfctl -e + pft_set_rules two \ + "set skip on ${epair_sync}b" \ + "pass keep state" + + ifconfig ${epair_one}b 198.51.100.254/24 up + ifconfig ${epair_two}b 198.51.100.253/24 up + + # Create a new state + env PYTHONPATH=${common_dir} \ + ${common_dir}/pft_ping.py \ + --sendif ${epair_one}b \ + --fromaddr 198.51.100.254 \ + --to 198.51.100.1 \ + --recvif ${epair_one}b + + # Now + jexec one pfctl -ss -vv + sleep 2 + + # Now try to use that state on jail two + env PYTHONPATH=${common_dir} \ + ${common_dir}/pft_ping.py \ + --sendif ${epair_two}b \ + --fromaddr 198.51.100.254 \ + --to 198.51.100.1 \ + --recvif ${epair_two}b + + echo one + jexec one pfctl -ss -vv + jexec one pfctl -sr -vv + echo two + jexec two pfctl -ss -vv + jexec two pfctl -sr -vv +} + +rtable_cleanup() +{ + pfsynct_cleanup +} + route_to_common_head() { pfsync_version=$1 @@ -1134,6 +1218,7 @@ atf_init_test_cases() atf_add_test_case "timeout" atf_add_test_case "basic_ipv6_unicast" atf_add_test_case "basic_ipv6" + atf_add_test_case "rtable" atf_add_test_case "route_to_1301" atf_add_test_case "route_to_1301_bad_ruleset" atf_add_test_case "route_to_1301_bad_rpool" From nobody Wed Jul 9 15:40:28 2025 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 4bchy50cnbz60ZxQ; Wed, 09 Jul 2025 15:40:29 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bchy41QTXz3ZFP; Wed, 09 Jul 2025 15:40:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752075628; 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=3hhDh+gP7qX2X1TGii36UaxNlunHKfy7r3vBfNkDpug=; b=nmd4KRZMuwqHMo/dFAerhPCDOJihNdhJuyJeFoJ9RV392EtiYtwJ0HKE4GAYvqk1brtgAj KkWbMxf/XgaZW36g6GRjzST8U6ihguFeyv0WNl1/2el5eEQzKur3KAjPFpqU0sxngXu8uH QDc6ABsJhHumyXKfWy2hopuMetRfhxUK3oKRnXxKh60uuvlUT9cXyDwjNdn19kY5gd6LtL AxxQKDmX/dX8QZXEw/LC2HZRls42o/JvQTwiK0VbezNBQOHNs2j1qoqPxwJmKxPWSPffKI 427YWqaocWmIluAXuu0q2j40IfJGu8tTfFDMnS84IG832rlCScEtM+Ktp7/aMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752075628; 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=3hhDh+gP7qX2X1TGii36UaxNlunHKfy7r3vBfNkDpug=; b=KnVwRRlGzheq7SWS/SxgGXATTcKp99+1z1xBT32K+MgJzemRHsRWgsHzkuBhJ+rkzK+Y29 4nqY3UBSicWmR8s7rI0VhLCitcaPIvAuTz95m3qcgeT/I1HAVAqLuH+eLw/EQcuCWwyHJZ uV9QvNsr4qKeVS3dVboyIJDo0QDo/83LYuGIMlcOYXF34DKBmmtWXcKmJXGgUUSl61hTiP j/sDhmF5mhfNTPrjYCuNX26Bjp4i3zuuVFHeUC1H6LIBpgUyRd8LuIXGsLD16KiTSJecoX 2Uu8f4zYBsXeECssT5Q7uR92IOlezlE+XfDL3O6VAHTj14VGKBeHKlz8WeE84Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752075628; a=rsa-sha256; cv=none; b=CsqfQwqXUJgdaeTNi1nOXRrIafl7D+eXkOX8p39OGg0ikb8VNk+VnlbNE39REEnpvXzN0p xXlJHC0uudua3rXHT5Aw214HPNr0yrLhvWasDebOYihcHT2enOwb0B1XWVN0qAaem+1lNX piZGhKSPsqLjAWlpiLae+Xw8VOAf+RN+kRMCdjEvAtkyOqms6VGJOIH7u/E2EEfTKGBIyc Ia8/mxWN+bCBXUfhCp1i2aZzVqCGg4RYMonAV3eQz2daV6IAJn4ex3WexZ1y6fQxf2MsVX T7n4aFDgoDOwi1p5M8VYO1jHp6d8TgjeA5q1Xs+SKqRAGGmVIgV90Tti39sT/A== 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 4bchy40mwCzCfL; Wed, 09 Jul 2025 15:40:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 569FeST0008518; Wed, 9 Jul 2025 15:40:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 569FeSGw008515; Wed, 9 Jul 2025 15:40:28 GMT (envelope-from git) Date: Wed, 9 Jul 2025 15:40:28 GMT Message-Id: <202507091540.569FeSGw008515@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: a4757fbd8cf7 - main - pfsync: log a bad version as a bad version, not a bad action 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a4757fbd8cf71502b9078b1d8e2a0df34794054f Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=a4757fbd8cf71502b9078b1d8e2a0df34794054f commit a4757fbd8cf71502b9078b1d8e2a0df34794054f Author: Kristof Provost AuthorDate: 2025-07-08 15:17:39 +0000 Commit: Kristof Provost CommitDate: 2025-07-09 15:38:08 +0000 pfsync: log a bad version as a bad version, not a bad action Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/if_pfsync.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netpfil/pf/if_pfsync.c b/sys/netpfil/pf/if_pfsync.c index 64cc476fb3cb..f21bdf15093c 100644 --- a/sys/netpfil/pf/if_pfsync.c +++ b/sys/netpfil/pf/if_pfsync.c @@ -1087,7 +1087,7 @@ pfsync_in_ins(struct mbuf *m, int offset, int count, int flags, int action) msg_version = PFSYNC_MSG_VERSION_1400; break; default: - V_pfsyncstats.pfsyncs_badact++; + V_pfsyncstats.pfsyncs_badver++; return (-1); } From nobody Wed Jul 9 15:40:31 2025 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 4bchy85cH8z60Ztk; Wed, 09 Jul 2025 15:40:32 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bchy73ttYz3ZYd; Wed, 09 Jul 2025 15:40:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752075631; 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=uuYnP1QygAP9gYsNpSLA/D0oWpgddNmTEKXMJpLnKS4=; b=q+7q5u6gjEfyask4YPyGtkTUDoT14Qu0kNccewbHbIZUmFsxSIvuhFS6LjSbrRwSRiQwKP A0tMhBtvyJbn3f23htbq6C/SBVoc1IjAwT+m8VloTfl3P2vMKap68TtCAlsQaHSGXhjth3 hkWUYEiAAi9GWh8oJmsPCcgSOJ+E720ygyPjfVu8NZHAnxiExprbG1K5Scigzm4KXUyRan t3oawLllybLloSqyr9sGKPmVgxnwjjZq/bfEa91BgtBkU5V3sEUeddkqj9LqNKTmWyhVuD gkdRAidojByCl+7QsJVv7/rPIu1gR/TDr/4k+2HFhNgn4RQnRCzu1u3AvHCQAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752075631; 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=uuYnP1QygAP9gYsNpSLA/D0oWpgddNmTEKXMJpLnKS4=; b=dMd9j/Hfo/E3Utbp4WSQRJuO5aZDn4vMECFsWO9QGGar2CC1Ic2kdNQHAo+LONrfHVWmUj u3l4pf3gTSlV6YEhIm1iwABhbDhy78iNkWdDbPggZAful8N19+uie9pMMf2fkv9YLVP1hH b+MF/Z/O32U+KBrCbvSNOm3rtDxn0c/dsfkqkQTi4HfxHx6UHgiVCUuGIuePxDkf3Hz0mL FnPdteR2DfaRd6zfE1oYmAq3c+AyjAEtDK9G76d/JIUXc05YHnk68yQz5gaV3Q/3KJWoD6 q368xSdIlwDQxOFoQtPZQ/LbD78EhFafZoiRrr7CKCJyEA4YuHLefiXwaQlK0A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752075631; a=rsa-sha256; cv=none; b=mLMlRzT88Vgnf5FhOp4iCWJQc0erJn8W4usoX4yIUzFrR7uZRew9buGrZmB27ySGzAAx13 8SzjbS88nq51nYeyte95kwILA7IU4vU2gVWk/8xojTDqAmsN9oOCSXQcGa+qSB1OevfUL1 0QGqTPh/+Nh+CA8dd3bsSfdHIH+BqoIcIgyPSK/C1sgw0sO70z19+JvX4lg7hVcdNB//0V IAk3XxfC8E3xtUIfeRwWRD9GPQWBMbyAHhlQSdIdmIwiyvNOacl9iV4g8fczxeBuUTC6hu ILR0KFbmqbWolIJLCQrNQxFw9DWDmpvSvVoP3OtzS4NRRzmUjx6PrSVQlwHzkg== 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 4bchy735wHzCks; Wed, 09 Jul 2025 15:40:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 569FeV3N008630; Wed, 9 Jul 2025 15:40:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 569FeVFT008626; Wed, 9 Jul 2025 15:40:31 GMT (envelope-from git) Date: Wed, 9 Jul 2025 15:40:31 GMT Message-Id: <202507091540.569FeVFT008626@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 939aacb60077 - main - pfctl tests: macro test requires pf to be loaded 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 939aacb600776ec11a524c81be85a39527d2d7c8 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=939aacb600776ec11a524c81be85a39527d2d7c8 commit 939aacb600776ec11a524c81be85a39527d2d7c8 Author: Kristof Provost AuthorDate: 2025-07-09 14:19:12 +0000 Commit: Kristof Provost CommitDate: 2025-07-09 15:38:08 +0000 pfctl tests: macro test requires pf to be loaded Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/tests/macro.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/sbin/pfctl/tests/macro.sh b/sbin/pfctl/tests/macro.sh index 9c48dbbc69f0..071c6cb4f426 100755 --- a/sbin/pfctl/tests/macro.sh +++ b/sbin/pfctl/tests/macro.sh @@ -3,6 +3,7 @@ atf_test_case "space" cleanup space_head() { atf_set descr "Test macros with spaces" + atf_set require.kmods "pf" } space_body() From nobody Wed Jul 9 15:40:30 2025 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 4bchy76dR0z60ZXN; Wed, 09 Jul 2025 15:40:31 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bchy64FfVz3ZWF; Wed, 09 Jul 2025 15:40:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752075630; 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=OgXjNIvM81MdEMIiI3cCkd9syHituudFA9R5ZS6ymwI=; b=Nr+S0n7K2bXV4h3GZeYkxokwR0n3F11j7KsUatPjzd2HPnl6s46xA8jcUV6SwifydrSsWm fdS3n+a07Xl6YNemHhf19olUShAYhITviJiUWRFjbj7zxa+jWUMxUtMPSq8YVmYYKCSfAp k/6j2aP4wqWMgr5KJiieOAMSnsOUyEU2iCdeuHhL8zAV0GL0UfijEAdmwPWNEJQToPyonQ hLp5fP5bYHDkA3DkvAqgYedojHHSn1XfjdDkkssP8XhSir129eVFUwW83/5w7vBSb27GC5 yx8zCuYHanSjV+kdMr962w863GB2+6xMH31QL4vUyxF0VSK69MGjq0gcKnnlaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752075630; 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=OgXjNIvM81MdEMIiI3cCkd9syHituudFA9R5ZS6ymwI=; b=KdUMwRtp3PrNnBbbGUXvNmFeM4G0DBo5tmxN6y8HIX+qlocm23aPRCmKv6nHQjE8STCKks r1/n8bfpPP3puH+Kua4Eqz+v8yzDGJKDCQgeSgHeIw1jyuWp0esfsDXr/GuFqg3O//+OP0 2fl1W9lwKbDBXLKfHQqG2NVRPOqrwvWQw8WDjCVFJMAr/88HxMK18O8ATSZvhggIpsZ4p2 Ta+IyGBjhYJnEblHBvI8MnOqTb/f59Nwaf1FdeGScbk0bdbP2LHRPpOUSzUV81fFvcFmys r2NqC2wb3jEX86VXrdZ9MxsVwHMvCL9R6jWWNS3mfa+i+iUgurJmT4quO1IlRA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752075630; a=rsa-sha256; cv=none; b=LdRGKDaCfzqYA3+HWC4wTd+CRW8mGjlCAVXyKc/gYgr5rh2GZ8nDlr5B1MGwxuPL3lYTCk xPGEC/h8Kjohp2+BESMPfGyx9j9+mj+v/1V4TQxPbVTObXSfODUY/nCF7WbGEHQ3wsA9xi ugZKyAbLzblwItq0/Jc2HaNSxdQRuQDo4WNVZaExpEqOBFBmtu7uQvDWEt9R4Q/MgSiJ5v CF0Bzvpcle6PDhbIxRwpb1zXrbjPEkqphwnWZUq0wFbAyQkyXNVDPW6Nd6ELUMwpK/TcA2 C+5lkhKCiifTYYk35KfWQMv/zDzdoiqBbh+DCofLNtPYXAOKZCw9r1bK8srsvQ== 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 4bchy62N0hzCfM; Wed, 09 Jul 2025 15:40:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 569FeU4g008590; Wed, 9 Jul 2025 15:40:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 569FeUg7008587; Wed, 9 Jul 2025 15:40:30 GMT (envelope-from git) Date: Wed, 9 Jul 2025 15:40:30 GMT Message-Id: <202507091540.569FeUg7008587@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 9c95fcb7cd20 - main - tests: Get the MAC from the epairs. 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9c95fcb7cd20bdb0e9445ec98a06d24ce0d5d2ac Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=9c95fcb7cd20bdb0e9445ec98a06d24ce0d5d2ac commit 9c95fcb7cd20bdb0e9445ec98a06d24ce0d5d2ac Author: Ronald Klop AuthorDate: 2025-07-09 08:00:19 +0000 Commit: Kristof Provost CommitDate: 2025-07-09 15:38:08 +0000 tests: Get the MAC from the epairs. This removes knowledge of the implementation of if_epair. Makes it easier to modify if_epair in future commits. Reviewed by: kp Differential Revision: https://reviews.freebsd.org/D51205 --- tests/atf_python/sys/net/vnet.py | 8 ++++++-- tests/sys/netpfil/pf/header.py | 23 +++++++++++------------ tests/sys/netpfil/pf/icmp.py | 10 +++++----- 3 files changed, 22 insertions(+), 19 deletions(-) diff --git a/tests/atf_python/sys/net/vnet.py b/tests/atf_python/sys/net/vnet.py index 68c8ce4e0cba..7afb5c721bf3 100644 --- a/tests/atf_python/sys/net/vnet.py +++ b/tests/atf_python/sys/net/vnet.py @@ -61,6 +61,7 @@ class VnetInterface(object): self.iftype = self.IFT_LOOP else: self.iftype = self.IFT_ETHER + self.ether = ToolsHelper.get_output("/sbin/ifconfig %s ether | awk '/ether/ { print $2; }'" % iface_name).rstrip() @property def ifindex(self): @@ -99,9 +100,12 @@ class VnetInterface(object): name = run_cmd("/sbin/ifconfig {} create".format(iface_name)).rstrip() if not name: raise Exception("Unable to create iface {}".format(iface_name)) - ret = [cls(alias_name, name)] + if1 = cls(alias_name, name) + ret = [if1] if name.startswith("epair"): - ret.append(cls(alias_name, name[:-1] + "b")) + if2 = cls(alias_name, name[:-1] + "b") + if1.epairb = if2 + ret.append(if2); return ret def setup_addr(self, _addr: str): diff --git a/tests/sys/netpfil/pf/header.py b/tests/sys/netpfil/pf/header.py index 6832cfe6d42b..a5e36bc85d14 100644 --- a/tests/sys/netpfil/pf/header.py +++ b/tests/sys/netpfil/pf/header.py @@ -53,10 +53,9 @@ class TestHeader(VnetTestTemplate): def test_too_many(self): "Verify that we drop packets with silly numbers of headers." - sendif = self.vnet.iface_alias_map["if1"].name + sendif = self.vnet.iface_alias_map["if1"] recvif = self.vnet.iface_alias_map["if2"].name - gw_mac = ToolsHelper.get_output("/sbin/ifconfig %s ether | awk '/ether/ { print $2; }'" % sendif) - gw_mac = re.sub("0a$", "0b", gw_mac) + gw_mac = sendif.epairb.ether ToolsHelper.print_output("/sbin/route add default 192.0.2.1") @@ -67,7 +66,7 @@ class TestHeader(VnetTestTemplate): pkt = sp.Ether(dst=gw_mac) \ / sp.IP(dst="198.51.100.3") \ / sp.ICMP(type='echo-request') - s = DelayedSend(pkt, sendif) + s = DelayedSend(pkt, sendif.name) reply = sp.sniff(iface=recvif, timeout=3) print(reply) @@ -89,7 +88,7 @@ class TestHeader(VnetTestTemplate): pkt = pkt / sp.AH(nh=51, payloadlen=1) pkt = pkt / sp.AH(nh=1, payloadlen=1) / sp.ICMP(type='echo-request') - s = DelayedSend(pkt, sendif) + s = DelayedSend(pkt, sendif.name) reply = sp.sniff(iface=recvif, timeout=3) print(reply) found = False @@ -109,7 +108,7 @@ class TestHeader(VnetTestTemplate): pkt = pkt / sp.AH(nh=51, payloadlen=1) pkt = pkt / sp.AH(nh=1, payloadlen=1) / sp.ICMP(type='echo-request') - s = DelayedSend(pkt, sendif) + s = DelayedSend(pkt, sendif.name) reply = sp.sniff(iface=recvif, timeout=3) print(reply) @@ -148,10 +147,10 @@ class TestHeader6(VnetTestTemplate): "Verify that we drop packets with silly numbers of headers." ToolsHelper.print_output("/sbin/ifconfig") - sendif = self.vnet.iface_alias_map["if1"].name + sendif = self.vnet.iface_alias_map["if1"] recvif = self.vnet.iface_alias_map["if2"].name - our_mac = ToolsHelper.get_output("/sbin/ifconfig %s ether | awk '/ether/ { print $2; }'" % sendif) - gw_mac = re.sub("0a$", "0b", our_mac) + our_mac = sendif.ether + gw_mac = sendif.epairb.ether ToolsHelper.print_output("/sbin/route -6 add default 2001:db8::1") @@ -162,7 +161,7 @@ class TestHeader6(VnetTestTemplate): pkt = sp.Ether(src=our_mac, dst=gw_mac) \ / sp.IPv6(src="2001:db8::2", dst="2001:db8:1::3") \ / sp.ICMPv6EchoRequest() - s = DelayedSend(pkt, sendif) + s = DelayedSend(pkt, sendif.name) reply = sp.sniff(iface=recvif, timeout=3) print(reply) @@ -182,7 +181,7 @@ class TestHeader6(VnetTestTemplate): for i in range(0, 18): pkt = pkt / sp.AH(nh=51, payloadlen=1) pkt = pkt / sp.AH(nh=58, payloadlen=1) / sp.ICMPv6EchoRequest() - s = DelayedSend(pkt, sendif) + s = DelayedSend(pkt, sendif.name) reply = sp.sniff(iface=recvif, timeout=3) print(reply) @@ -202,7 +201,7 @@ class TestHeader6(VnetTestTemplate): for i in range(0, 19): pkt = pkt / sp.AH(nh=51, payloadlen=1) pkt = pkt / sp.AH(nh=58, payloadlen=1) / sp.ICMPv6EchoRequest() - s = DelayedSend(pkt, sendif) + s = DelayedSend(pkt, sendif.name) reply = sp.sniff(iface=recvif, timeout=3) print(reply) diff --git a/tests/sys/netpfil/pf/icmp.py b/tests/sys/netpfil/pf/icmp.py index 83096886691e..59f2e8190b30 100644 --- a/tests/sys/netpfil/pf/icmp.py +++ b/tests/sys/netpfil/pf/icmp.py @@ -91,10 +91,10 @@ class TestICMP(VnetTestTemplate): def test_inner_match(self): vnet = self.vnet_map["vnet1"] dst_vnet = self.vnet_map["vnet3"] - sendif = vnet.iface_alias_map["if1"].name + sendif = vnet.iface_alias_map["if1"] - our_mac = ToolsHelper.get_output("/sbin/ifconfig %s ether | awk '/ether/ { print $2; }'" % sendif) - dst_mac = re.sub("0a$", "0b", our_mac) + our_mac = sendif.ether + dst_mac = sendif.epairb.ether # Import in the correct vnet, so at to not confuse Scapy import scapy.all as sp @@ -111,7 +111,7 @@ class TestICMP(VnetTestTemplate): / sp.IP(src="192.0.2.2", dst="198.51.100.2") \ / sp.ICMP(type='echo-request') \ / "PAYLOAD" - sp.sendp(pkt, sendif, verbose=False) + sp.sendp(pkt, sendif.name, verbose=False) # Now try to pass an ICMP error message piggy-backing on that state, but # use a different source address @@ -120,7 +120,7 @@ class TestICMP(VnetTestTemplate): / sp.ICMP(type='dest-unreach') \ / sp.IP(src="198.51.100.2", dst="192.0.2.2") \ / sp.ICMP(type='echo-reply') - sp.sendp(pkt, sendif, verbose=False) + sp.sendp(pkt, sendif.name, verbose=False) try: rcvd = self.wait_object(dst_vnet.pipe, timeout=1) From nobody Wed Jul 9 15:40:29 2025 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 4bchy71HyVz60Zf3; Wed, 09 Jul 2025 15:40:31 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bchy56kHGz3ZhC; Wed, 09 Jul 2025 15:40:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752075630; 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=fTg04CL1VKAYcgLh1OOI95NXh3Ys6ornKNIMqnpo1vM=; b=LO1901wp4h9YaSoYbNlMgAhmrcaeNXoy8ZuIjpGAvzAjDnZ+DJRUv2FaMyQ0nmiNI+tOiL FNMb4lZ1RCofjxy5nHT1dhdCWWbOfNxx3+pkJRBHNwI4sVNG2s7nneuqX7/lJVPOkztw+7 y2ZyKbcqCuMeGw/h7JvfRe/IWWO7x5TGtx8OQiJlE4O+bu5tII8tOPNfwMRdh+M0OibpM0 322fVvJUYruogZSIKpingewFvhwJxlGQb53H85rfUB6u4jwBvUnXDDrDmg1iwMy4JDAtnx PIUsimBpBGUCbd5lcQtqikzQqDxaeveIDSOzXPW67Glu88YXv0TOsFeOWLJ2rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752075630; 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=fTg04CL1VKAYcgLh1OOI95NXh3Ys6ornKNIMqnpo1vM=; b=jb0Jm7BAFwSXwSoylgvIljkkbhcZ/PZq+dO4Owg+YHZPTwS6+mbydUqH3Z65lfcJspxV1f MHZMLkbWGyhJKpZ0EM3EJkuAVBPqXY5xrKgv2QNu2y1NkZaudcfNoVZgIyY9EU5ZEkTuYh OGNyXDCiiV+6Odx6MvQSA0q+MdWsEjwjeN6ZZ0sZnoJcQRgJVibo0AptO3AwGyzo4L+ZMH VpM+qxRInNSMCJYLzZv+A/1PKSRwR912iJdmibxznQlMAjp/WEzHjqnDFc4cjjSHDQQWaT KeKBauZS7koepLukjTh2fdksb4tUiRoLH4r1n+obPEIrt19VSGUn0LHR0ApBTw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752075630; a=rsa-sha256; cv=none; b=eEvSOtDmWrZCvuamEqIO2VgwmAxCArzaTMO5ADh2ZoG6gedraUHGUZu6qqpwGBOzmtLKbz 7rRM9ERjpNB/D6K9dS9B/+hbKEzWLtcC4KYqMmm+tESF38frH9pJ6xpKMHTWOJLFPakNkB SB594kJWLnTXry41kEOJ8dJM2MRszJo4V9rnsrqz17zyoe5GyMgzpGCmm8XhaZTwPhx3xj QHaV/5J+3ZxmiU360chDE4xc8gpJ5G3hgsHxzybS7zJ7TMKrQICmEyr0OlELiapfxBKtqV /qG7M5jJ46J4BVNmZNc2kGFsQ5Hfw1OCX9OQQrz+xscPG1sZ0Oq6HRWafilZCA== 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 4bchy514qJzCkr; Wed, 09 Jul 2025 15:40:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 569FeTnI008554; Wed, 9 Jul 2025 15:40:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 569FeTYq008551; Wed, 9 Jul 2025 15:40:29 GMT (envelope-from git) Date: Wed, 9 Jul 2025 15:40:29 GMT Message-Id: <202507091540.569FeTYq008551@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 4f822ad2854e - main - pfsync: count failed state insertions 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4f822ad2854e4434407456757d9c0ba671f120b0 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=4f822ad2854e4434407456757d9c0ba671f120b0 commit 4f822ad2854e4434407456757d9c0ba671f120b0 Author: Kristof Provost AuthorDate: 2025-07-08 15:18:03 +0000 Commit: Kristof Provost CommitDate: 2025-07-09 15:38:08 +0000 pfsync: count failed state insertions If we fail to import a state, for whatever reason, count this as a bad action. We should not drop states without at least incrementing an error count. Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/if_pfsync.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sys/netpfil/pf/if_pfsync.c b/sys/netpfil/pf/if_pfsync.c index f21bdf15093c..2391edaf1a5a 100644 --- a/sys/netpfil/pf/if_pfsync.c +++ b/sys/netpfil/pf/if_pfsync.c @@ -1114,9 +1114,8 @@ pfsync_in_ins(struct mbuf *m, int offset, int count, int flags, int action) continue; } - if (pfsync_state_import(sp, flags, msg_version) == ENOMEM) - /* Drop out, but process the rest of the actions. */ - break; + if (pfsync_state_import(sp, flags, msg_version) != 0) + V_pfsyncstats.pfsyncs_badact++; } return (total_len); From nobody Wed Jul 9 15:40:32 2025 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 4bchy93cyKz60Ztr; Wed, 09 Jul 2025 15:40:33 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bchy85KZdz3ZfT; Wed, 09 Jul 2025 15:40:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752075632; 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=G6UeIaq0PuqGPoLiNnYNhrtrckgLAjFNwm6RrIhmExg=; b=NalxTuBWn6vS24sfZwBS/9brYOLqXFmTQL7Q10Dr7ZAQlX/J2XlcMwwdouiagvXg1QVR+9 j+FZj2gSCW8y0kbyHaRU/O6KIduzyDYIB8PsPHo8KlslisFY1LY84bcMLWuHDVAOtgr3Ef iBuspTbpwAZJJ5jqndB/5fqPtTUHt/MqE005FTKbHh/jgxlMcdOjvbCyLeo+QOJmhpt+0k Rvdcin/L8q+jLYfRk3OYviKAJsEygfZnFlH49yP+54D8kCXyq3Lqr9ZxsYK40Ig78Rq1At B4oVRUun+F2ZhIzeLgSiCIsaMjnuowow41h3W/umzBg8zys/6nJQl8smn8OlGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752075632; 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=G6UeIaq0PuqGPoLiNnYNhrtrckgLAjFNwm6RrIhmExg=; b=F2wwSepRNfI9h50rkN4kr0BY3YV/XIDmVj4pnMxlPBvloEENJ66lZ+4YCuQwhVQCLkuSte QN7Dl07IIi/3GIGSzHLY2MNRUjPB+cpnBXeSHZFslAzi+/BZzc5k8RZjvP8vC+viFHssal xHk/qy6CNR7r4nLpsG6YlfvBHCLjNfq1/ZiM/mrvtimjUfz0YTG8Y4ygOSuBPUCq5u8wdP 8jdFQj4xL6KdeT2hN/dEPApIaJcnGV8Um3gBgOWTl7c70jgnEKVg2YhA6YKcqBc6bLLl54 0ShrlmvHv8/5HYTJFygkkL55+ldgRvWaFgqiVNI7umSLMZsTOPWdN9bSfVE5Qw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752075632; a=rsa-sha256; cv=none; b=w7/5xQ4mOG5Ja8sW8bivfIBujD6/i2WdwW3qQ+TcWnQq87dymIz3Ue9XPJ9VqxerASKfa4 mxK2ll4483FlIvbZxwE+97QpIQBpLMNsqWXgAzD86Eb8ABxYexeFoTAML07nR+ZwgpML5F y9vSraIkX1+L9LTxJ/MLONtQ3INbcD+dVNT1YkVaBZTbDJwyLq6WySgPAWcVDPYc7RdcVX zaxdwWffCj1M9Qgus3NSFDhBLaDY3XgS1AU0EgVYmd0g1oNCw8w2vkVKFGxp4u4V3oZ1jJ t1jQHR3wmHh59ai1ntE5hYM2qeW5DTXcQsBZJV4LdKh2cPOVe1bzbP2kkam3jQ== 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 4bchy83SSqzCGn; Wed, 09 Jul 2025 15:40:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 569FeWfK008666; Wed, 9 Jul 2025 15:40:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 569FeWtQ008663; Wed, 9 Jul 2025 15:40:32 GMT (envelope-from git) Date: Wed, 9 Jul 2025 15:40:32 GMT Message-Id: <202507091540.569FeWtQ008663@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 68fe0d9cc03b - main - pfctl tests: use require.kmods instead of manual check for pf 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 68fe0d9cc03bd80f63a5317a633d2426ae286316 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=68fe0d9cc03bd80f63a5317a633d2426ae286316 commit 68fe0d9cc03bd80f63a5317a633d2426ae286316 Author: Siva Mahadevan AuthorDate: 2025-07-08 15:14:48 +0000 Commit: Kristof Provost CommitDate: 2025-07-09 15:38:09 +0000 pfctl tests: use require.kmods instead of manual check for pf Reviewed by: kp Signed-off-by: Siva Mahadevan Sponsored by: The FreeBSD Foundation Pull Request: https://github.com/freebsd/freebsd-src/pull/1762 --- sbin/pfctl/tests/pfctl_test.c | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/sbin/pfctl/tests/pfctl_test.c b/sbin/pfctl/tests/pfctl_test.c index dbdcaa4900ea..5f0aa7826bb4 100644 --- a/sbin/pfctl/tests/pfctl_test.c +++ b/sbin/pfctl/tests/pfctl_test.c @@ -65,24 +65,6 @@ * Copied from OpenBSD. */ -static bool -check_pf_module_available(void) -{ - int modid; - struct module_stat stat; - - if ((modid = modfind("pf")) < 0) { - warn("pf module not found"); - return false; - } - stat.version = sizeof(struct module_stat); - if (modstat(modid, &stat) < 0) { - warn("can't stat pf module id %d", modid); - return false; - } - return (true); -} - extern char **environ; static struct sbuf * @@ -185,9 +167,6 @@ run_pfctl_test(const char *input_path, const char *output_path, struct sbuf *expected_output; struct sbuf *real_output; - if (!check_pf_module_available()) - atf_tc_skip("pf(4) is not loaded"); - /* The test inputs need to be able to use relative includes. */ snprintf(input_files_path, sizeof(input_files_path), "%s/files", atf_tc_get_config_var(tc, "srcdir")); @@ -292,6 +271,7 @@ do_selfpf_test(const char *number, const atf_tc_t *tc) ATF_TC_HEAD(pf##number, tc) \ { \ atf_tc_set_md_var(tc, "descr", descr); \ + atf_tc_set_md_var(tc, "require.kmods", "pf"); \ } \ ATF_TC_BODY(pf##number, tc) \ { \ @@ -301,6 +281,7 @@ do_selfpf_test(const char *number, const atf_tc_t *tc) ATF_TC_HEAD(selfpf##number, tc) \ { \ atf_tc_set_md_var(tc, "descr", "Self " descr); \ + atf_tc_set_md_var(tc, "require.kmods", "pf"); \ } \ ATF_TC_BODY(selfpf##number, tc) \ { \ @@ -312,6 +293,7 @@ do_selfpf_test(const char *number, const atf_tc_t *tc) ATF_TC_HEAD(pf##number, tc) \ { \ atf_tc_set_md_var(tc, "descr", descr); \ + atf_tc_set_md_var(tc, "require.kmods", "pf"); \ } \ ATF_TC_BODY(pf##number, tc) \ { \ @@ -325,6 +307,7 @@ do_selfpf_test(const char *number, const atf_tc_t *tc) atf_tc_set_md_var(tc, "descr", descr); \ atf_tc_set_md_var(tc, "execenv", "jail"); \ atf_tc_set_md_var(tc, "execenv.jail.params", "vnet"); \ + atf_tc_set_md_var(tc, "require.kmods", "pf"); \ } \ ATF_TC_BODY(pf##number, tc) \ { \ From nobody Wed Jul 9 15:53:39 2025 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 4bcjFJ1tMmz60c3B; Wed, 09 Jul 2025 15:53:40 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcjFJ0ZT9z3jsr; Wed, 09 Jul 2025 15:53:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752076420; 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=EuhCDhivrlZOHkvPT49MQ4F7DR0Hc5SJk5errYq7uc8=; b=p0yR7UTgUq4ibkprKcbkzLHCH4ZiCL8XJvYaA1ulC58JRymJlTSrATWV8TQ0gJP/mc1Xh8 yjHsZolnC1BlWBDljeMIBjt/4wl5Xy0YAy3ErWqwx+QILsEwpv1ugnSvv7OXR61tjNaYGj KR3uYJcjwxNNTPJjY5DWZUqdHxu66AR366BtjMXT7AwEdiN1zoinA+FxBAFICyxCdiC4js hsv3a5SiBa3FwV481JwAQgxKGUkSqmciNuS+Evexn/0Ou0jaEF2Oawp8tLBschBjf23acJ n6RiBXkMhlUEJ+I63M1iV3S6/GN+gbABZWDFOLQIbLlnOxQi/E91HrWjnoyUQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752076420; 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=EuhCDhivrlZOHkvPT49MQ4F7DR0Hc5SJk5errYq7uc8=; b=M3GfJAc8ziF7q5JxfcsmrOifgL953bgrW4cO3g0VmjjWXIX07iTS97u2X22MZkrQ91EgbH 2uhSzM7zCO3qICFmEVlaYMxSNPWDMQ8e0usSMUM0loVfD6Ba+dObt6sQVgTr7qAT9lFqEy J1coPZNMVKdC0sp70kEdckVuF96t6lUYbxpN5D4c3Fc6qE6AZGl8M3SPLghTrNxabmJtY4 xgY6H9pZ2RO5+9IqqLHhAWtWKVGeyjrumXnryv2pNWtjuPv/5giKCdZfRVi55tbUBql4c9 EbyPG69CKBnqD+3MwWrwaQAqWpzMoQo9HlO3EjTeirZHsXN2BaR/rzvT4KBKEw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752076420; a=rsa-sha256; cv=none; b=fciRhH0IN1HNI0Cp3Dj6e0A/ebBW4fnNH8APK18kQJAFHwe/qu0YhSI2XDJReP70fVgCEX B95+Bmv7vyZuWDO+4Bi+UNjONditi0Tglt37eYDeXAleE6XqJgNVJ0qZlvRzVvxuJCwMvZ hQQQJKYiC+tYG4NaIZTYjZlPx3ETWV1pnmC5+d8vSxBMCIAgQ9TaraSwvb9NZo669MGUvi NwAx5F/7Runh716rNzTwYBwnDLJxB9h1DuMYSt/ZpspERfm3GJuF9GIOgYZnyYEJDwNI4m fBmGWrfd4VoaOisuUz/S3sDyBCmH6xtqaLAerkUdTo2caojQrqK6/9C2ndWO4w== 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 4bcjFJ02LFzCBd; Wed, 09 Jul 2025 15:53:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 569FrdI6036100; Wed, 9 Jul 2025 15:53:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 569FrdXR036099; Wed, 9 Jul 2025 15:53:39 GMT (envelope-from git) Date: Wed, 9 Jul 2025 15:53:39 GMT Message-Id: <202507091553.569FrdXR036099@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Philip Paeps Subject: git: d46df0eabbbb - Create tag release/13.5.0-p2 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: philip X-Git-Repository: src X-Git-Refname: refs/tags/release/13.5.0-p2 X-Git-Reftype: annotated tag X-Git-Commit: d46df0eabbbb80df640c25e37f1b32aa2071d333 Auto-Submitted: auto-generated The annotated tag release/13.5.0-p2 has been created by philip: URL: https://cgit.FreeBSD.org/src/tag/?h=release/13.5.0-p2 tag release/13.5.0-p2 Tagger: Philip Paeps TaggerDate: 2025-07-09 15:52:53 +0000 Tag FreeBSD 13.5-RELEASE-p2 commit 341d92aef027d903b37412363a111840afa290fc Author: Gordon Tetlow AuthorDate: 2025-07-02 06:01:59 +0000 Commit: Gordon Tetlow CommitDate: 2025-07-02 06:01:59 +0000 Add UPDATING entries and bump version. Approved by: so From nobody Wed Jul 9 15:54:37 2025 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 4bcjGP4l6Qz60c1J; Wed, 09 Jul 2025 15:54:37 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcjGP35klz3kKS; Wed, 09 Jul 2025 15:54:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752076477; 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=XbV1V06npTLyTfHBpQqaY9TQ0vtwPM/rReWfd4TSREM=; b=pZb6mYR5mVAePgJvUaL7pSeGkbZs6m45FAkLo53tv8Ep4ub/hQ0NkZ42lmDlLr66c/jX1b LjvUrDmxfMHxeqq8n/AM16s2b/LoJLFXOTnrOs7wKxuz+QHkVAnVh6nxxNBP4hZ/W90oRq 2j8NMyYU4nfZfm/kGoG5a0pcZlWGfOoDOIfmWNPnhs5DDfXjLuWS2hWg5PkYLKanaE+jKx nNA0p3/XzrudnwMNlkCNgZVXdjT2dw7HeskAXofQGfWpgWSYB3iG8CGFXA6+fEDTWfBBgG PZdtSANun+pXCg+VUMrWHxWDbGLIVBQA+U+A06gH9FuBfeqg8EA/MBR5tzumPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752076477; 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=XbV1V06npTLyTfHBpQqaY9TQ0vtwPM/rReWfd4TSREM=; b=npdhRznwYaUrmg+pcgGqLsV0nMlEvxMhycPkF5cFBiuff5Y5DefbVTmMkHrq2mFcBa3sHn bBG+8oDkpeEKbjcB03ThjB2LwfkwA7ua3jIxwDzUY9wUPgIjfPyNkWo1oUZJVeD2Sx/vW3 wOY+7QYP+xgLDIwqyqHxDz6C1nN7PzXzmHV4M5AR131Fc+BcQQ4Frar/ERXQTGUUrFYJON QZTvu4aLjh5aYzSee11kByAy4pN0+xOG30UVTehwKxAgKrcihcZKvB5tA+f4GXxjWtiyP1 8lr+25PMp38530FtW3mrh//ZTcENORFT45V+7ftktnd0dSZlAVVaNezynso3Cw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752076477; a=rsa-sha256; cv=none; b=pvUvZCo3+X220sBdqAM8NhwZPbpUk6cayLNdGnxTG0nofbeY9c6kIvdZkfSJqisaZYWDKi G1et+A80Vra+kxIo7C90nLepCirWLr4ry3TvpeH3injeyKr5NDfuHt86Yi2/XeQgVZbQg6 ujLQZKMzjcdRP18WhS4qMHEOlfdrkB7a/vag5shT9PYJtQ424DyuH1LigSnSkRNRcNCGI4 /ZGYh/6aZSmy/JcFf2rqXx1svk5ByR5f2FsWj2497xRGua1duJY1yaSCD1th+P9ydWBM8r tKuMC2KSGRPFMpOlxVy0PYlPdnrXpJ9eQKqPId1ZgM6Quin7+D5gKJ30TacIlQ== 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 4bcjGP2bc2zCF9; Wed, 09 Jul 2025 15:54:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 569FsbFV036453; Wed, 9 Jul 2025 15:54:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 569FsbDA036452; Wed, 9 Jul 2025 15:54:37 GMT (envelope-from git) Date: Wed, 9 Jul 2025 15:54:37 GMT Message-Id: <202507091554.569FsbDA036452@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Philip Paeps Subject: git: 3356c50fc938 - Create tag release/14.2.0-p4 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: philip X-Git-Repository: src X-Git-Refname: refs/tags/release/14.2.0-p4 X-Git-Reftype: annotated tag X-Git-Commit: 3356c50fc9386e075efcacb4c27848f6a647d438 Auto-Submitted: auto-generated The annotated tag release/14.2.0-p4 has been created by philip: URL: https://cgit.FreeBSD.org/src/tag/?h=release/14.2.0-p4 tag release/14.2.0-p4 Tagger: Philip Paeps TaggerDate: 2025-07-09 15:54:02 +0000 Tag FreeBSD 14.2-RELEASE-p4 commit d9352700f9357aa170c1e4dc144537998ec66025 Author: Gordon Tetlow AuthorDate: 2025-07-02 06:03:15 +0000 Commit: Gordon Tetlow CommitDate: 2025-07-02 06:03:15 +0000 Add UPDATING entries and bump version. Approved by: so From nobody Wed Jul 9 15:56:33 2025 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 4bcjJf287cz60cKn; Wed, 09 Jul 2025 15:56:34 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcjJd63yFz3ktj; Wed, 09 Jul 2025 15:56:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752076593; 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=/EWkEGwc4q+blp0PL2xYLg5/gzVc3AfYxcUf1uw5boI=; b=Xc2FGXvRLn9z+WaFcw1iN/DjRue6lolfx1jaiN4NEK0XyMxVBt0B/0WwUJCKTELBd65o4T +bMk4EljFe1GXhrZ87lJ+w92DSyQW3CM+tuAt4YHmm8+LLUc8bWOj2LLgtIeJda510zAjC OVSaA2fOoNgLTHaPfr/GhBnsqeYairEf2VWot2augLKtBOGSSn2R2YmbNizpRvr6Bx0cNR YWW5f3DeFdsR14v5TCT0wfv+z0jAsAtos8hz1SHZzTi3ZMRS77gblrVVpACdWZLwQ6Nmaj YBZf2a77ml4JlJcF5D/4xqeFhP58oLbJGOG/H50ZHDLS5w0E2vWIsYo/pdZTeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752076593; 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=/EWkEGwc4q+blp0PL2xYLg5/gzVc3AfYxcUf1uw5boI=; b=vHz31v5zu9K/t/xLZYDdkVicDZjiT6PrgF63dJ7i4hsuRyueTkGsxVYrjzMnb8CQ08frr+ hhigtnsPlPDsAH2KqeRzBYx5ubnJ1FBnz/6dPG5aA5zSzcc/81Nkr4E/NeHthyg7dDx7kr X2UEX5TwV3NYKfl4eX316lFF5mrjgjghmsHdtWsRQLSpnCIURaXoIIXWqfgcLs6WZttGy7 a5HAHsUi3bfbGkj73ilh/wXckffTEBbR1LipnKM+WsoBirmow8ampYPlErlaR99Vyxwm8n THwrxUKuIr1R/uhGzKwGtJCkjkiDJylWwfX1jvdKYtLnFMUrdmHWY7bPk88mqA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752076593; a=rsa-sha256; cv=none; b=vPA4j2FpDFgZWhtIGxEgiN311YWJHF4nElkgDlgqwpYOKR2JX6W4CyNMFgZsNAMOgLFMIJ EJUQ+3EWybAcJN18QPVIjkLjPRaWLlXTAeZElY9lv0tsr3FYBcjaELzzkcrpAixcP9s9wu ko6VC1DejO+oPqulR8U5xGP2Tcv2IXlI9QFb+inv9+UtC4RKXVQR+1Q5M7Oh6cq2UEFUdZ +l7RNONvyJf7pNkfNPE5p2IsuS9eFsVy6sW/62BM9CRwAgUv2Naaj0tHLR7Bqgq4sStYwi Qg5zL9cXf2/OP+W8tL5pPdr7FMlPZ8maBB0NYCV8ZcwaJWX7hnLqXFp9HMqdFw== 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 4bcjJd5TbpzCJ3; Wed, 09 Jul 2025 15:56:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 569FuXns037142; Wed, 9 Jul 2025 15:56:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 569FuX82037141; Wed, 9 Jul 2025 15:56:33 GMT (envelope-from git) Date: Wed, 9 Jul 2025 15:56:33 GMT Message-Id: <202507091556.569FuX82037141@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Philip Paeps Subject: git: 8b9b063ecceb - Create tag release/14.3.0-p1 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: philip X-Git-Repository: src X-Git-Refname: refs/tags/release/14.3.0-p1 X-Git-Reftype: annotated tag X-Git-Commit: 8b9b063ecceb96c9f9ae0b992f0fb5606ae365df Auto-Submitted: auto-generated The annotated tag release/14.3.0-p1 has been created by philip: URL: https://cgit.FreeBSD.org/src/tag/?h=release/14.3.0-p1 tag release/14.3.0-p1 Tagger: Philip Paeps TaggerDate: 2025-07-09 15:56:10 +0000 Tag FreeBSD 14.3-RELEASE-p1 commit 2ea99b8ed14208286ec3c8d6ccc997537c13d195 Author: Gordon Tetlow AuthorDate: 2025-07-02 06:04:23 +0000 Commit: Gordon Tetlow CommitDate: 2025-07-02 06:04:23 +0000 Add UPDATING entries and bump version. Approved by: so From nobody Wed Jul 9 16:00:06 2025 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 4bcjNk5FSCz60c9H; Wed, 09 Jul 2025 16:00:06 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcjNk33Ggz3n39; Wed, 09 Jul 2025 16:00:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752076806; 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=cqy+XS4n6RL7eDR8af6928wUYtRglh8vM+ZBV36a+Qo=; b=NG2fHHPfSakCOVz4BYWU/MgBVgogrwjrqw6oQkJA4Jh7ineMnvofV9tWFw3mfdZnpca3p0 cA5CGRABOX7USRsjs7Tp3xavOa52B+p6JCQGcHL1ag3pxk2ptRuQmGjnP4Fw9IKEerdKVx X+/Q45oBw6S8v76WJyZEt75K/6EXM4A2d2dju0SNdZUNmdb87yVLqcPwUTQ8aoXOt4DmPK c0F3FCKlvP3eTzNLbN2tz0iIqquTRCqUq4HtEfseRKzVMbTjZBcIToWiRwieUSvQrV+S/a b38jyl2qED05/cGvRwfBjBFhNNCxi653/nDiP+hwtTGM8GFwWXfMd8yp5rRisw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752076806; 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=cqy+XS4n6RL7eDR8af6928wUYtRglh8vM+ZBV36a+Qo=; b=r/tCdSM0eG88Siv6FH0dXKT4C1yt3Kse8RRxGIShxfrDGj5rFdLRv6UvpcTUd5C+tD1kdS 0xya/W5zCZ3hSKy6Qn/WAjqM4GfVrIQurHztHot67vmCjVAkFAAAuevg9MElyOipVttU51 vflHNnVuTI7GK/gEDSbO8feNqkWafRlgifKlZypjeXOptBL6+urb7rOiCqepuOKX3WldOX iC+Gw9TvZAHB3VUxyirB6doEyxN1tH+9fx71jVkTRrMWAvUHyZ7uptdUUdGsiW8eXNYbPF AmTVWePq0C89u/oaeqqB66xy/G0sBca6PCNDecQJA5GliY+2D4oo7Hice56Zkg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752076806; a=rsa-sha256; cv=none; b=BRmxHFuYeSfg5Fw65V+DZJGZHJFD0HPdIqLv9n2z+OpakgGV4pNX0mdlCQ1idU0K4iPZtg wGbUUhMZ7sMdCwClHuNZndGf6u8tHLDoMJXNczEJhMS5PWRq0xU1BbqGkHyGc8iYhCXUHZ GPVkL0bf+i1AR5WneafcxEKuXLtvXMScqqrjfmE2naY/MUW4KJDaU1n/oQUqQOz7h3+GSC dnCwQU6x47pwTenii1Tygq35+blbRGOYAOIo2P/JM5Pzfa0agoSXaIHe60UDAFo4mbMWA9 miH5dWV80Nl94DInhrsQrSShe9T4HzqQxZf5puFKHwn0L/mZD43xmYmo07R06Q== 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 4bcjNk225JzCgk; Wed, 09 Jul 2025 16:00:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 569G06tX042242; Wed, 9 Jul 2025 16:00:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 569G06jc042237; Wed, 9 Jul 2025 16:00:06 GMT (envelope-from git) Date: Wed, 9 Jul 2025 16:00:06 GMT Message-Id: <202507091600.569G06jc042237@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ruslan Bukin Subject: git: bc2e3360107a - main - hwt(4): Add initial man page. 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: br X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bc2e3360107af28fed7157d18605bd038f07e16c Auto-Submitted: auto-generated The branch main has been updated by br: URL: https://cgit.FreeBSD.org/src/commit/?id=bc2e3360107af28fed7157d18605bd038f07e16c commit bc2e3360107af28fed7157d18605bd038f07e16c Author: Ruslan Bukin AuthorDate: 2025-07-09 15:41:51 +0000 Commit: Ruslan Bukin CommitDate: 2025-07-09 15:57:07 +0000 hwt(4): Add initial man page. Reviewed by: ziaee Sponsored by: UKRI Differential Revision: https://reviews.freebsd.org/D51192 --- share/man/man4/Makefile | 12 ++++ share/man/man4/hwt.4 | 142 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 154 insertions(+) diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index 4f12e70f2ae4..7c8a8f3afc45 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -213,6 +213,7 @@ MAN= aac.4 \ ${_hv_vmbus.4} \ ${_hv_vss.4} \ hwpmc.4 \ + ${_hwt.4} \ ${_hwpstate_intel.4} \ i2ctinyusb.4 \ iavf.4 \ @@ -926,6 +927,17 @@ _vmm.4= vmm.4 .endif .endif +.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "aarch64" +_hwt.4= hwt.4 +.if ${MACHINE_CPUARCH} == "amd64" +MLINKS+=hwt.4 intel_pt.4 +.endif +.if ${MACHINE_CPUARCH} == "aarch64" +MLINKS+=hwt.4 coresight.4 +MLINKS+=hwt.4 spe.4 +.endif +.endif + .if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" || \ ${MACHINE_CPUARCH} == "aarch64" _gve.4= gve.4 diff --git a/share/man/man4/hwt.4 b/share/man/man4/hwt.4 new file mode 100644 index 000000000000..7bc8ed4b396d --- /dev/null +++ b/share/man/man4/hwt.4 @@ -0,0 +1,142 @@ +.\" +.\" Copyright (c) 2025 Ruslan Bukin +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.Dd July 7, 2025 +.Dt HWT 4 +.Os +.Sh NAME +.Nm hwt +.Nd Hardware Trace Framework +.Sh SYNOPSIS +.Cd "options HWT_HOOKS" +.Cd "device hwt" +.Pp +At least one of: +.Cd "device intel_pt" +.Pq amd64 +.Cd "device coresight" +.Pq arm64 +.Cd "device spe" +.Pq arm64 +.Pp +In +.Xr rc.conf 5 : +.Cd kld_list="hwt" +.Sh DESCRIPTION +The +.Nm +framework provides infrastructure for hardware-assisted tracing. +It collects detailed information about software execution and stores it as +events in highly compressed format into DRAM. +The events cover information about control flow changes of a program, whether +branches taken or not, exceptions taken, timing information, cycles elapsed and +more. +The information collected allows to reconstruct entire program flow of a given +application without noticeable performance impact. +.Sh HARDWARE +The framework supports several tracing technologies found on +.Cd arm64 +and +.Cd amd64 +systems: +.Pp +.Bl -bullet -compact +.It +ARM Coresight +.It +ARM Statistical Profiling Extension (SPE) +.It +Intel Processor Trace (PT) +.El +.Pp +The +.Nm +framework supports two modes of operation: +.Bl -tag -width "Thread mode" +.It Em CPU mode +Capture CPU activity in kernel mode. +.It Em Thread mode +Capture activity of each of a process's threads in user mode. +.El +.Sh MANAGEMENT +When loaded into kernel, the +.Nm +framework provides +.Pa /dev/hwt +character device. +The only +.Xr ioctl 2 +request it accepts is +.Dv HWT_IOC_ALLOC . +This request allocates kernel tracing context (CTX) based on requested mode of +operation, set of CPUs and/or pid. +.Pp +Upon successfull CTX allocation, the ioctl returns a CTX identification +number (ident). +.Pp +Each CTX is then managed using its own dedicated character device found at +.Pa "/dev/hwt_${ident}_${d}", +where ident is a unique identification number of tracing context, d is either +cpu_id (in HWT CPU mode) or process pid (in HWT Thread mode). +.Sh HOOKS +During tracing of a target process, HWT records runtime events such as threads +creation, exec and mmap system calls. +These events are logged as "records" within a particular CTX associated with +traced process. +.Pp +Additionally, HWT can suspend the target thread upon exec or mmap system calls +if requested by the user. +This pause allows user-space tools to retrieve the records and adjust tracing +settings before execution continues. +This feature is especially useful when address range filtering is enabled, +allowing tracing of specific functions within the target executable or a +dynamic library. +.Sh KERNEL OPTIONS +The following options in the kernel configuration file are mandatory and +related to +.Nm +operation: +.Pp +.Bl -tag -width ".Dv HWT_HOOKS" -compact +.It Dv HWT_HOOKS +Enable kernel hooks. +.El +.Sh IOCTL INTERFACE +Once a CTX is allocated, it's management character device accepts several IOC +requests: +.Bl -tag -width "HWT_IOC_RECORD_GET" +.It Dv HWT_IOC_START +Start tracing. +In HWT CPU mode the tracing does actually start with this +.Xr ioctl 2 +request. +In the Thread mode, the tracing "running" flag set, but tracing begins after +scheduler switches the target thread onto CPU and return to user mode. +.It Dv HWT_IOC_STOP +Stop tracing of the particular CTX. +.It Dv HWT_IOC_RECORD_GET +Copy all or part of records collected during hook invocation and associated +with this CTX to userspace. +.It Dv HWT_IOC_BUFPTR_GET +Get current pointer in buffer that is filled by tracing units in real-time. +.It Dv HWT_IOC_SET_CONFIG +Set achitecture-specific config (optional). +.It Dv HWT_IOC_WAKEUP +Wake up a thread that has been put to sleep by HWT framework hooks. +.It Dv HWT_IOC_SVC_BUF +For SPE-only, the kernel is waiting for userspace to notify that it's copied +out a buffer to avoid data loss/overwriting buffers. +.El +.Sh SEE ALSO +.Xr hwt 8 +.Sh HISTORY +The +.Nm +framework first appeared in +.Fx 15.0 . +.Sh AUTHORS +.An Ruslan Bukin Aq Mt br@FreeBSD.org +.An Bojan Novković Aq Mt bnovkov@freebsd.org +.An Zachary Leaf Aq Mt zachary.leaf@arm.com From nobody Wed Jul 9 17:09:54 2025 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 4bckxG5dTcz60hYD; Wed, 09 Jul 2025 17:09:54 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bckxG4xvmz4H3t; Wed, 09 Jul 2025 17:09:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752080994; 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=dB84tqXdgKpwFNZRiRVVWW5thylgmAi5EmhBnQPZnQI=; b=icjhlkctQDOdInwkGUOqXyR6hRDfe3Wtg93rQqjcbQ7KAWNpO4lTe5DlODbQH5udAAdsWV dRHsrmQOvzpnG8EW6sDUyp76gSZh8qalI2x+s/4o+RYiX3JRESEYAfFlY6fUmONzNpgzYY t7sW6KbV1KcuM2JDcgdbIjxjuif5cCOvfNxt6m2PqeschG6w57toYpTOt1AU06/U9Kt4xb 6WrQIIjVKf/CU4TeVId7UGmIzgwFjAnd5zgWRjnwayqNIpU/4zp/sBopVUB0ofaaM4cEJ/ NFl+BesnC8FMx5izKHmg0Fz9K4u9Ktj42UHi6iUuNNweVKaswOONbA/Cvt7HHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752080994; 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=dB84tqXdgKpwFNZRiRVVWW5thylgmAi5EmhBnQPZnQI=; b=GPtujN8+t547LC1XVNcioAwcG6jKoUgp7NnQ0w8tk4LFUfaxbUfhIVCt/jrhEQ/8Ifusae /OW44qfaUldYz3e8cItB3m9/FvvtNVYY4Gv8BhWv+khOj2qo2MToXLTcJ4ZGAsgqE9Rc94 SBSGR8l7vAEVJOuWHGrdO5exRc39TWoqF9ipMUjy8bp5JfB1yF+ICVJAZnpbu5SLoWLE2h uFfJeUCB6qcTC4KuSGnUYslUsWCXVpsEsBGB4QE8AKqlQyB2feM/AfR142RPcwFoHwETDh Li2zCrwljbfKaoODl71HFNoCVCFgW2wjR09kL5bI1d7gJ4gGVP6E9EC1kksgsg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752080994; a=rsa-sha256; cv=none; b=i/DJEXHRfmSv2A7LsCWnw1NGED2XskzBptRDYJ6VR42svE9NaJ2yQopsuUQV7s9NH0RiWH BRrOrSOXA43dQr4cuf/Y+wGZcoLb0/Lsjce3I8Jv1JKceyiOE10N2y5s6GoO+8CxZU3SIL Rivn2lUqxF5gr0i4AUbAX2e4vyqhXhQeDPxyWbBLfF0fb5qdPI5+aUcNVFNFSV/ztlJpgM 3Awsw4RAciStnSmPmcrBJc/YPN/ah7IN+idDmwFc0AzejfY45Xup0c8yiYFrIMwCdmDOzN 0w8257h3xObyPxzkuwshz4uc+g3zxgIh8w2MHTqwTDGexjWh1R7vwT2ayp0P7A== 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 4bckxG4L04zWHp; Wed, 09 Jul 2025 17:09:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 569H9sow072737; Wed, 9 Jul 2025 17:09:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 569H9sqA072735; Wed, 9 Jul 2025 17:09:54 GMT (envelope-from git) Date: Wed, 9 Jul 2025 17:09:54 GMT Message-Id: <202507091709.569H9sqA072735@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: c3efa16dc9bc - main - cp: Add GNU-compatible long options. 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c3efa16dc9bcdcbe128c6b3c4b000867bbaf7991 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=c3efa16dc9bcdcbe128c6b3c4b000867bbaf7991 commit c3efa16dc9bcdcbe128c6b3c4b000867bbaf7991 Author: Dag-Erling Smørgrav AuthorDate: 2025-07-09 17:05:54 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-07-09 17:07:13 +0000 cp: Add GNU-compatible long options. While here, fully switch boolean variables from int to bool, and clean up the manual page a little. Sponsored by: Klara, Inc. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D51213 --- bin/cp/cp.1 | 39 +++++++++++-------------- bin/cp/cp.c | 78 +++++++++++++++++++++++++++++++------------------ bin/cp/extern.h | 2 +- bin/cp/tests/cp_test.sh | 16 ++++++++++ bin/cp/utils.c | 4 +-- 5 files changed, 86 insertions(+), 53 deletions(-) diff --git a/bin/cp/cp.1 b/bin/cp/cp.1 index 2856391a029e..6edc8e403acd 100644 --- a/bin/cp/cp.1 +++ b/bin/cp/cp.1 @@ -29,7 +29,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd March 28, 2024 +.Dd July 9, 2025 .Dt CP 1 .Os .Sh NAME @@ -84,16 +84,16 @@ If the .Fl R option is specified, symbolic links on the command line are followed. (Symbolic links encountered in the tree traversal are not followed.) -.It Fl L +.It Fl L , Fl -dereference If the .Fl R option is specified, all symbolic links are followed. -.It Fl P +.It Fl P , Fl -no-dereference No symbolic links are followed. This is the default if the .Fl R option is specified. -.It Fl R +.It Fl R , Fl -recursive If .Ar source_file designates a directory, @@ -121,11 +121,11 @@ If you need to preserve hard links, consider using or .Xr pax 1 instead. -.It Fl a +.It Fl a , Fl -archive Archive mode. Same as .Fl RpP . -.It Fl f +.It Fl f , Fl -force For each existing destination pathname, remove it and create a new file, without prompting for confirmation regardless of its permissions. @@ -136,10 +136,8 @@ option overrides any previous or .Fl n options.) -.It Fl i -Cause -.Nm -to write a prompt to the standard error output before copying a file +.It Fl i , Fl -interactive +Write a prompt to the standard error output before copying a file that would overwrite an existing file. If the response from the standard input begins with the character .Sq Li y @@ -153,13 +151,13 @@ option overrides any previous or .Fl n options.) -.It Fl l +.It Fl l , Fl -link Create hard links to regular files in a hierarchy instead of copying. .It Fl N When used with .Fl p , suppress copying file flags. -.It Fl n +.It Fl n , Fl -no-clobber Do not overwrite an existing file. (The .Fl n @@ -169,9 +167,7 @@ or .Fl i options.) .It Fl p -Cause -.Nm -to preserve the following attributes of each source +Preserve the following attributes of each source file in the copy: modification time, access time, file flags, file mode, ACL, user ID, and group ID, as allowed by permissions. .Pp @@ -188,14 +184,13 @@ If the source file has both its set-user-ID and set-group-ID bits on, and either the user ID or group ID cannot be preserved, neither the set-user-ID nor set-group-ID bits are preserved in the copy's permissions. -.It Fl s +.It Fl s , Fl -symbolic-link Create symbolic links to regular files in a hierarchy instead of copying. -.It Fl v -Cause -.Nm -to be verbose, showing files as they are copied. -.It Fl x -File system mount points are not traversed. +.It Fl v , Fl -verbose +Be verbose, showing both the source and destination path of each file +as is copied. +.It Fl x , Fl -one-file-system +Do not traverse file system mount points. .El .Pp For each destination file that already exists, its contents are diff --git a/bin/cp/cp.c b/bin/cp/cp.c index 7e97715c3ef4..a1b62084a790 100644 --- a/bin/cp/cp.c +++ b/bin/cp/cp.c @@ -55,6 +55,7 @@ #include #include #include +#include #include #include #include @@ -69,8 +70,8 @@ static char dot[] = "."; #define END(buf) (buf + sizeof(buf)) PATH_T to = { .dir = -1, .end = to.path }; -int Nflag, fflag, iflag, lflag, nflag, pflag, sflag, vflag; -static int Hflag, Lflag, Pflag, Rflag, rflag; +bool Nflag, fflag, iflag, lflag, nflag, pflag, sflag, vflag; +static bool Hflag, Lflag, Pflag, Rflag, rflag; volatile sig_atomic_t info; enum op { FILE_TO_FILE, FILE_TO_DIR, DIR_TO_DNE }; @@ -78,6 +79,26 @@ enum op { FILE_TO_FILE, FILE_TO_DIR, DIR_TO_DNE }; static int copy(char *[], enum op, int, struct stat *); static void siginfo(int __unused); +enum { + SORT_OPT = CHAR_MAX, +}; + +static const struct option long_opts[] = +{ + { "archive", no_argument, NULL, 'a' }, + { "force", no_argument, NULL, 'f' }, + { "interactive", no_argument, NULL, 'i' }, + { "dereference", no_argument, NULL, 'L' }, + { "link", no_argument, NULL, 'l' }, + { "no-clobber", no_argument, NULL, 'n' }, + { "no-dereference", no_argument, NULL, 'P' }, + { "recursive", no_argument, NULL, 'R' }, + { "symbolic-link", no_argument, NULL, 's' }, + { "verbose", no_argument, NULL, 'v' }, + { "one-file-system", no_argument, NULL, 'x' }, + { 0 } +}; + int main(int argc, char *argv[]) { @@ -88,59 +109,60 @@ main(int argc, char *argv[]) bool have_trailing_slash = false; fts_options = FTS_NOCHDIR | FTS_PHYSICAL; - while ((ch = getopt(argc, argv, "HLPRafilNnprsvx")) != -1) + while ((ch = getopt_long(argc, argv, "+HLPRafilNnprsvx", long_opts, + NULL)) != -1) switch (ch) { case 'H': - Hflag = 1; - Lflag = Pflag = 0; + Hflag = true; + Lflag = Pflag = false; break; case 'L': - Lflag = 1; - Hflag = Pflag = 0; + Lflag = true; + Hflag = Pflag = false; break; case 'P': - Pflag = 1; - Hflag = Lflag = 0; + Pflag = true; + Hflag = Lflag = false; break; case 'R': - Rflag = 1; + Rflag = true; break; case 'a': - pflag = 1; - Rflag = 1; - Pflag = 1; - Hflag = Lflag = 0; + pflag = true; + Rflag = true; + Pflag = true; + Hflag = Lflag = false; break; case 'f': - fflag = 1; - iflag = nflag = 0; + fflag = true; + iflag = nflag = false; break; case 'i': - iflag = 1; - fflag = nflag = 0; + iflag = true; + fflag = nflag = false; break; case 'l': - lflag = 1; + lflag = true; break; case 'N': - Nflag = 1; + Nflag = true; break; case 'n': - nflag = 1; - fflag = iflag = 0; + nflag = true; + fflag = iflag = false; break; case 'p': - pflag = 1; + pflag = true; break; case 'r': - rflag = Lflag = 1; - Hflag = Pflag = 0; + rflag = Lflag = true; + Hflag = Pflag = false; break; case 's': - sflag = 1; + sflag = true; break; case 'v': - vflag = 1; + vflag = true; break; case 'x': fts_options |= FTS_XDEV; @@ -159,7 +181,7 @@ main(int argc, char *argv[]) if (lflag && sflag) errx(1, "the -l and -s options may not be specified together"); if (rflag) - Rflag = 1; + Rflag = true; if (Rflag) { if (Hflag) fts_options |= FTS_COMFOLLOW; diff --git a/bin/cp/extern.h b/bin/cp/extern.h index c0c524756980..683e6e5f289f 100644 --- a/bin/cp/extern.h +++ b/bin/cp/extern.h @@ -37,7 +37,7 @@ typedef struct { } PATH_T; extern PATH_T to; -extern int Nflag, fflag, iflag, lflag, nflag, pflag, sflag, vflag; +extern bool Nflag, fflag, iflag, lflag, nflag, pflag, sflag, vflag; extern volatile sig_atomic_t info; __BEGIN_DECLS diff --git a/bin/cp/tests/cp_test.sh b/bin/cp/tests/cp_test.sh index 1d2cd4292459..6adbc45c5009 100755 --- a/bin/cp/tests/cp_test.sh +++ b/bin/cp/tests/cp_test.sh @@ -688,6 +688,21 @@ unrfile_body() atf_check cmp src/c dst/c } +atf_test_case nopermute +nopermute_head() +{ + atf_set descr "Check that getopt_long does not permute options" +} +nopermute_body() +{ + mkdir src dst + atf_check \ + -s exit:1 \ + -e match:'cp: -p: No such file' \ + cp -R src -p dst + atf_check test -d dst/src +} + atf_init_test_cases() { atf_add_test_case basic @@ -729,4 +744,5 @@ atf_init_test_cases() atf_add_test_case dirloop atf_add_test_case unrdir atf_add_test_case unrfile + atf_add_test_case nopermute } diff --git a/bin/cp/utils.c b/bin/cp/utils.c index cfc0f0f12603..2036056ada68 100644 --- a/bin/cp/utils.c +++ b/bin/cp/utils.c @@ -105,7 +105,7 @@ copy_file(const FTSENT *entp, bool dne, bool beneath) ssize_t wcount; off_t wtotal; int ch, checkch, from_fd, rval, to_fd; - int use_copy_file_range = 1; + bool use_copy_file_range = true; fs = entp->fts_statp; from_fd = to_fd = -1; @@ -210,7 +210,7 @@ copy_file(const FTSENT *entp, bool dne, bool beneath) to_fd, NULL, SSIZE_MAX, 0); if (wcount < 0 && errno == EINVAL) { /* probably a non-seekable descriptor */ - use_copy_file_range = 0; + use_copy_file_range = false; } } if (!use_copy_file_range) { From nobody Wed Jul 9 17:09:55 2025 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 4bckxJ1713z60hPZ; Wed, 09 Jul 2025 17:09:56 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bckxH5TKSz4HH3; Wed, 09 Jul 2025 17:09:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752080995; 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=/lEYsV2Job5WQNm3Q9hGohjEAzWOBGeBx2XkWCBiBlQ=; b=gGdhs8yx/p41G3mijMLdQUxDGFstVUse3bD7mhuJ2ozYzVYmDhFBUpBUIDbNbpdq+2+Hzz HFAZQpgKh5oRu57Dl0eP09x6dERj9XZmqLzx2dBv2qfvY/msZPU90LkmD889LPcMXSLjZz NIwL6gHVkcUHz5gKWClkXStxyeNVn24N/88t/w2F4Le3s9QZ15EGL72g7nmYOK3X5wrwh3 i308qBsYj9gDS1CPs9CS+Jb6wC8YzbPV/DhYNyRv/s4EAk5WGwTzzoIyJHb2zzvPXJTZGF VsX8UbEe0qDx/qBCZWpChfVJ7h55PXgJa6d43hYTxmNt2T/NViD4KpvR4py5tA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752080995; 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=/lEYsV2Job5WQNm3Q9hGohjEAzWOBGeBx2XkWCBiBlQ=; b=R0fJwV9yEgh4sYy//ENBVHOCURtrmDQt54PrAQl1NcMu86TE5rXwT3CVRmCPZG5Mqm05Re 0zmOUsq3a3HvtDbYeyc/m7/r78GCgDMUWKNVKlUJDEka08qRjgVYN/iQNxxvgnIAEkefzc mbKYZvGSmWLcckc8QB9BfrOSSokhV1RSXAkfrYMmt17exBCtYPf12JkgStAy65ttMN+bL6 PXU5HWHyRoZAqHJjpBVGw2gXlzhNS6FpMp/SE6Map+EFrUBziMH31ygzJdk8qmyPFrV5GC 2awA+eDWPU8itQ6un7E/RSmxbTrOHyOkJG45GcN5fZKZnOI1IaghCYLM+E37Eg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752080995; a=rsa-sha256; cv=none; b=IT7jX6M8vKWElLv9EJATlV6/St6vT9zw6armpD89VXNUMelCFRpq2I/IkbKJCibN0siftk W0ACPvl0j71601OS6TfW97I6jiYf7bWbiXLVDPTjZlcgmfu/wWdkY/MZA4EvUcnhs4Rgwj 4KzSKaDQhnepTNED5BZbx+BUIw6wBMrRMqQomp6V1UWqOZBPdtEttVH2C4r7iNLIv+OGx+ iRbdjQyie/ZmKrf6WAKEadtZ6wJWwSCvTF1TH4/0dcHVfwrnHv9ym/jhk7Ej0hJDnkjQj5 lNseUc945UbHZ0UIxQcilRYIplkQ6nOgbg2GE1Q+SkKJKIdt3j1xL1YkiTwlWA== 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 4bckxH4w3vzWqj; Wed, 09 Jul 2025 17:09:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 569H9tLb072781; Wed, 9 Jul 2025 17:09:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 569H9tFk072778; Wed, 9 Jul 2025 17:09:55 GMT (envelope-from git) Date: Wed, 9 Jul 2025 17:09:55 GMT Message-Id: <202507091709.569H9tFk072778@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 2d6b33f801d5 - main - cp: Add an option to visit sources in order. 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2d6b33f801d5352b8e078db83f6c90f6fe8291bb Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=2d6b33f801d5352b8e078db83f6c90f6fe8291bb commit 2d6b33f801d5352b8e078db83f6c90f6fe8291bb Author: Dag-Erling Smørgrav AuthorDate: 2025-07-09 17:06:07 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-07-09 17:07:13 +0000 cp: Add an option to visit sources in order. This adds a --sort option which makes cp pass a comparison function to FTS, ensuring that sources are visited and traversed in a predictable order. This will help make certain test cases more reliable. Sponsored by: Klara, Inc. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D51214 --- bin/cp/cp.1 | 12 ++++++++++++ bin/cp/cp.c | 14 ++++++++++++-- bin/cp/tests/cp_test.sh | 4 ++-- 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/bin/cp/cp.1 b/bin/cp/cp.1 index 6edc8e403acd..5231fa72621c 100644 --- a/bin/cp/cp.1 +++ b/bin/cp/cp.1 @@ -184,6 +184,18 @@ If the source file has both its set-user-ID and set-group-ID bits on, and either the user ID or group ID cannot be preserved, neither the set-user-ID nor set-group-ID bits are preserved in the copy's permissions. +.It Fl -sort +Visit and traverse sources in (non-localized) lexicographical order. +Normally, +.Nm +visits the sources in the order they were listed on the command line, +and if recursing, traverses their contents in whichever order they +were returned in by the kernel, which may be the order in which they +were created, lexicographical order, or something else entirely. +With +.Fl -sort , +the sources are both visited and traversed in lexicographical order. +This is mostly useful for testing. .It Fl s , Fl -symbolic-link Create symbolic links to regular files in a hierarchy instead of copying. .It Fl v , Fl -verbose diff --git a/bin/cp/cp.c b/bin/cp/cp.c index a1b62084a790..38fe65399d06 100644 --- a/bin/cp/cp.c +++ b/bin/cp/cp.c @@ -71,7 +71,7 @@ static char dot[] = "."; #define END(buf) (buf + sizeof(buf)) PATH_T to = { .dir = -1, .end = to.path }; bool Nflag, fflag, iflag, lflag, nflag, pflag, sflag, vflag; -static bool Hflag, Lflag, Pflag, Rflag, rflag; +static bool Hflag, Lflag, Pflag, Rflag, rflag, Sflag; volatile sig_atomic_t info; enum op { FILE_TO_FILE, FILE_TO_DIR, DIR_TO_DNE }; @@ -96,6 +96,7 @@ static const struct option long_opts[] = { "symbolic-link", no_argument, NULL, 's' }, { "verbose", no_argument, NULL, 'v' }, { "one-file-system", no_argument, NULL, 'x' }, + { "sort", no_argument, NULL, SORT_OPT }, { 0 } }; @@ -167,6 +168,9 @@ main(int argc, char *argv[]) case 'x': fts_options |= FTS_XDEV; break; + case SORT_OPT: + Sflag = true; + break; default: usage(); } @@ -284,6 +288,12 @@ main(int argc, char *argv[]) &to_stat))); } +static int +ftscmp(const FTSENT * const *a, const FTSENT * const *b) +{ + return (strcmp((*a)->fts_name, (*b)->fts_name)); +} + static int copy(char *argv[], enum op type, int fts_options, struct stat *root_stat) { @@ -327,7 +337,7 @@ copy(char *argv[], enum op type, int fts_options, struct stat *root_stat) } level = FTS_ROOTLEVEL; - if ((ftsp = fts_open(argv, fts_options, NULL)) == NULL) + if ((ftsp = fts_open(argv, fts_options, Sflag ? ftscmp : NULL)) == NULL) err(1, "fts_open"); for (badcp = rval = 0; (curr = fts_read(ftsp)) != NULL; diff --git a/bin/cp/tests/cp_test.sh b/bin/cp/tests/cp_test.sh index 6adbc45c5009..3c3dd309b9e4 100755 --- a/bin/cp/tests/cp_test.sh +++ b/bin/cp/tests/cp_test.sh @@ -657,7 +657,7 @@ unrdir_body() atf_check \ -s exit:1 \ -e match:"^cp: src/b: Permission denied" \ - cp -R src dst + cp -R --sort src dst atf_check test -d dst/a atf_check cmp src/a/f dst/a/f atf_check test -d dst/b @@ -681,7 +681,7 @@ unrfile_body() atf_check \ -s exit:1 \ -e match:"^cp: src/b: Permission denied" \ - cp -R src dst + cp -R --sort src dst atf_check test -d dst atf_check cmp src/a dst/a atf_check test ! -e dst/b From nobody Wed Jul 9 17:11:17 2025 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 4bckys3DjBz60j79; Wed, 09 Jul 2025 17:11:17 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bckys2PkFz4J7y; Wed, 09 Jul 2025 17:11:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752081077; 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=sOoE3qCnazrTYoJsyfaOfdqzmz5mO39WIRaMK96O42c=; b=K5ubXxixUudPLS9OZj3DYKBGjtMdh84HBhhKf/La7I/8uC0p3bQH90b1jTU0LhPu9yOU2F UhwVF/cHAPE1sB8akScK/1ud3gjmaPPiTOy54hMwgcjlb1ps0zQYLMJr+yMTRvVLw2jAb1 Jaqub0Ti4WV/7CdBsiDT3eSMKknppxCZG6yavxXPfmh7LassdCUG8rMhy4e7wq82wl2sOc vNpyZ21/YTggGJdyvVhC+1FgRb+1XnZ3ErFNgt1ZQbk0oKxvpsD/CCqByooy/7WS5PPAp1 k0XcdLmq12ZVURYGe00Oo+W2xRWlEEPzXAWEIbIQhZl/M4gZUoNCfF2+22GzAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752081077; 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=sOoE3qCnazrTYoJsyfaOfdqzmz5mO39WIRaMK96O42c=; b=L2DBvff1HWZyzKrJACWigPvnoAM1+003OCWtGcNEPj6tc+GhrNv60Bct0bQq0125t8j0oZ b3n+FKQJCxGSGO2D/TXfEErwf+Pl7OkymqRnk/jzcQSv5gRiZPTPUECyDEU8RTBcEHlPgS AuoCqaKyLz9kGgS3fbX1NgOHrBOO9N5c0bVliCEYwaztPhEfcse4jW8aVQcI817cDQBspM xOXrXpZPPXhsM3WXfarH1hOWtVuQtfSJ30RguqtTljwqhUNymIXwuAUkLY2nbmt/zgGhd4 mUPkh0SubnjPcywwtGjGAoT6oxFCwJyk4v3BCCV45D/8okeiB0rKA9t2gXzdog== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752081077; a=rsa-sha256; cv=none; b=rn2Id9PHBamBijndBhajKMlyjyTCYi/GO7wAxe68yCm4OayKQJbQhNZO1wwO4X4UURYDIU iJQmsh+qbxe60ZHcDnNQGAsPnd4c6UhFA5O6kYMBShdIGBoSU/ZRo0X7OY/OSA+ZOO7OL2 JNeR0fgvNowVJq6edzv94eyJEU0ksrO1WrQ3TZii0VssIezpnt++J6utuWkuOctuOHQEgm bGdh3IElw4Q1fmXwnol9YY/2CVSkIf9NCI1ALPn3ukW8k7RebhN7z7xZWPnfw6Cc+mpRhd cBoJA7fac/GlGv5cX73OqhuXG90p+/HwGxWfnQosK5Z81WF8mIRGk3FJI3EwuQ== 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 4bckys1QMLzWnc; Wed, 09 Jul 2025 17:11:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 569HBHsv084711; Wed, 9 Jul 2025 17:11:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 569HBHet084705; Wed, 9 Jul 2025 17:11:17 GMT (envelope-from git) Date: Wed, 9 Jul 2025 17:11:17 GMT Message-Id: <202507091711.569HBHet084705@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 89990e28e6e1 - main - cp: Add descriptions to all test cases. 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 89990e28e6e1cae1b3d74d5a06159c1f9e12abc5 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=89990e28e6e1cae1b3d74d5a06159c1f9e12abc5 commit 89990e28e6e1cae1b3d74d5a06159c1f9e12abc5 Author: Dag-Erling Smørgrav AuthorDate: 2025-07-09 17:10:59 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-07-09 17:10:59 +0000 cp: Add descriptions to all test cases. While here, touch a few test cases up. Sponsored by: Klara, Inc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D51124 --- bin/cp/tests/cp_test.sh | 175 +++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 164 insertions(+), 11 deletions(-) diff --git a/bin/cp/tests/cp_test.sh b/bin/cp/tests/cp_test.sh index 3c3dd309b9e4..999993bfad67 100755 --- a/bin/cp/tests/cp_test.sh +++ b/bin/cp/tests/cp_test.sh @@ -34,6 +34,10 @@ check_size() } atf_test_case basic +basic_head() +{ + atf_set "descr" "Copy a file" +} basic_body() { echo "foo" > bar @@ -43,18 +47,26 @@ basic_body() } atf_test_case basic_symlink +basic_symlink_head() +{ + atf_set "descr" "Copy a symlink to a file" +} basic_symlink_body() { echo "foo" > bar ln -s bar baz atf_check cp baz foo - atf_check test '!' -L foo + atf_check test ! -L foo atf_check cmp foo bar } atf_test_case chrdev +chrdev_head() +{ + atf_set "descr" "Copy a character device" +} chrdev_body() { echo "foo" > bar @@ -69,6 +81,10 @@ chrdev_body() } atf_test_case hardlink +hardlink_head() +{ + atf_set "descr" "Create a hard link to a file" +} hardlink_body() { echo "foo" >foo @@ -78,6 +94,11 @@ hardlink_body() } atf_test_case hardlink_exists +hardlink_exists_head() +{ + atf_set "descr" "Attempt to create a hard link to a file, " \ + "but the destination already exists" +} hardlink_exists_body() { echo "foo" >foo @@ -88,6 +109,11 @@ hardlink_exists_body() } atf_test_case hardlink_exists_force +hardlink_exists_force_head() +{ + atf_set "descr" "Force creation of a hard link to a file " \ + "when the destination already exists" +} hardlink_exists_force_body() { echo "foo" >foo @@ -98,9 +124,12 @@ hardlink_exists_force_body() } atf_test_case matching_srctgt +matching_srctgt_head() +{ + atf_set "descr" "Avoid infinite loop when copying a directory to itself" +} matching_srctgt_body() { - # PR235438: `cp -R foo foo` would previously infinitely recurse and # eventually error out. mkdir foo @@ -110,13 +139,17 @@ matching_srctgt_body() atf_check cp -R foo foo atf_check -o inline:"qux\n" cat foo/foo/bar atf_check -o inline:"qux\n" cat foo/foo/zoo - atf_check -e not-empty -s not-exit:0 stat foo/foo/foo + atf_check test ! -e foo/foo/foo } atf_test_case matching_srctgt_contained +matching_srctgt_contained_head() +{ + atf_set "descr" "Avoid infinite loop when copying a directory " \ + "into an existing subdirectory of itself" +} matching_srctgt_contained_body() { - # Let's do the same thing, except we'll try to recursively copy foo into # one of its subdirectories. mkdir foo @@ -142,9 +175,13 @@ matching_srctgt_contained_body() } atf_test_case matching_srctgt_link +matching_srctgt_link_head() +{ + atf_set "descr" "Avoid infinite loop when recursively copying a " \ + "symlink to a directory into the directory it links to" +} matching_srctgt_link_body() { - mkdir foo echo "qux" > foo/bar cp foo/bar foo/zoo @@ -156,9 +193,13 @@ matching_srctgt_link_body() } atf_test_case matching_srctgt_nonexistent +matching_srctgt_nonexistent_head() +{ + atf_set "descr" "Avoid infinite loop when recursively copying a " \ + "directory into a new subdirectory of itself" +} matching_srctgt_nonexistent_body() { - # We'll copy foo to a nonexistent subdirectory; ideally, we would # skip just the directory and end up with a layout like; # @@ -180,6 +221,10 @@ matching_srctgt_nonexistent_body() } atf_test_case pflag_acls +pflag_acls_head() +{ + atf_set "descr" "Verify that -p preserves access control lists" +} pflag_acls_body() { mkdir dir @@ -216,6 +261,10 @@ pflag_acls_body() } atf_test_case pflag_flags +pflag_flags_head() +{ + atf_set "descr" "Verify that -p preserves file flags" +} pflag_flags_body() { mkdir dir @@ -263,6 +312,11 @@ recursive_link_setup() } atf_test_case recursive_link_dflt +recursive_link_dflt_head() +{ + atf_set "descr" "Copy a directory containing a subdirectory and a " \ + "symlink to that subdirectory" +} recursive_link_dflt_body() { recursive_link_setup @@ -270,9 +324,15 @@ recursive_link_dflt_body() # -P is the default, so this should work and preserve the link. atf_check cp -R foo foo-mirror atf_check test -L foo-mirror/foo/baz + atf_check test -d foo-mirror/foo/baz } atf_test_case recursive_link_Hflag +recursive_link_Hflag_head() +{ + atf_set "descr" "Copy a directory containing a subdirectory and a " \ + "symlink to that subdirectory" +} recursive_link_Hflag_body() { recursive_link_setup @@ -281,22 +341,32 @@ recursive_link_Hflag_body() # link. atf_check cp -RH foo foo-mirror atf_check test -L foo-mirror/foo/baz + atf_check test -d foo-mirror/foo/baz } atf_test_case recursive_link_Lflag +recursive_link_Lflag_head() +{ + atf_set "descr" "Copy a directory containing a subdirectory and a " \ + "symlink to that subdirectory" +} recursive_link_Lflag_body() { recursive_link_setup -L # -L will work, but foo/baz ends up expanded to a directory. - atf_check test -d foo-mirror/foo/baz -a \ - '(' ! -L foo-mirror/foo/baz ')' + atf_check test ! -L foo-mirror/foo/baz + atf_check test -d foo-mirror/foo/baz atf_check cp -RL foo foo-mirror - atf_check test -d foo-mirror/foo/baz -a \ - '(' ! -L foo-mirror/foo/baz ')' + atf_check test ! -L foo-mirror/foo/baz + atf_check test -d foo-mirror/foo/baz } atf_test_case samefile +samefile_head() +{ + atf_set "descr" "Copy a file to itself" +} samefile_body() { echo "foo" >foo @@ -324,6 +394,10 @@ files_are_equal() } atf_test_case sparse_leading_hole +sparse_leading_hole_head() +{ + atf_set "descr" "Copy a sparse file stat starts with a hole" +} sparse_leading_hole_body() { # A 16-megabyte hole followed by one megabyte of data @@ -337,6 +411,10 @@ sparse_leading_hole_body() } atf_test_case sparse_multiple_holes +sparse_multiple_hole_head() +{ + atf_set "descr" "Copy a sparse file with multiple holes" +} sparse_multiple_holes_body() { # Three one-megabyte blocks of data preceded, separated, and @@ -356,6 +434,10 @@ sparse_multiple_holes_body() } atf_test_case sparse_only_hole +sparse_only_hole_head() +{ + atf_set "descr" "Copy a sparse file consisting entirely of a hole" +} sparse_only_hole_body() { # A 16-megabyte hole @@ -368,6 +450,10 @@ sparse_only_hole_body() } atf_test_case sparse_to_dev +sparse_to_dev_head() +{ + atf_set "descr" "Copy a sparse file to a device" +} sparse_to_dev_body() { # Three one-megabyte blocks of data preceded, separated, and @@ -385,6 +471,10 @@ sparse_to_dev_body() } atf_test_case sparse_trailing_hole +sparse_trailing_hole_head() +{ + atf_set "descr" "Copy a sparse file that ends with a hole" +} sparse_trailing_hole_body() { # One megabyte of data followed by a 16-megabyte hole @@ -398,16 +488,24 @@ sparse_trailing_hole_body() } atf_test_case standalone_Pflag +standalone_Pflag_head() +{ + atf_set "descr" "Test -P without -R" +} standalone_Pflag_body() { echo "foo" > bar ln -s bar foo atf_check cp -P foo baz - atf_check -o inline:'Symbolic Link\n' stat -f %SHT baz + atf_check test -L baz } atf_test_case symlink +symlink_head() +{ + atf_set "descr" "Create a symbolic link to a file" +} symlink_body() { echo "foo" >foo @@ -417,6 +515,11 @@ symlink_body() } atf_test_case symlink_exists +symlink_exists_head() +{ + atf_set "descr" "Attempt to create a symbolic link to a file, " \ + "but the destination already exists" +} symlink_exists_body() { echo "foo" >foo @@ -426,6 +529,11 @@ symlink_exists_body() } atf_test_case symlink_exists_force +symlink_exists_force_head() +{ + atf_set "descr" "Force creation of a symbolic link to a file " \ + "when the destination already exists" +} symlink_exists_force_body() { echo "foo" >foo @@ -436,6 +544,10 @@ symlink_exists_force_body() } atf_test_case directory_to_symlink +directory_to_symlink_head() +{ + atf_set "descr" "Attempt to copy a directory to a symlink" +} directory_to_symlink_body() { mkdir -p foo @@ -449,6 +561,10 @@ directory_to_symlink_body() } atf_test_case overwrite_directory +overwrite_directory_head() +{ + atf_set "descr" "Attempt to overwrite a directory with a file" +} overwrite_directory_body() { mkdir -p foo/bar/baz @@ -465,6 +581,10 @@ overwrite_directory_body() } atf_test_case to_dir_dne +to_dir_dne_head() +{ + atf_set "descr" "Copy a directory to a nonexistent directory" +} to_dir_dne_body() { mkdir dir @@ -476,6 +596,10 @@ to_dir_dne_body() } atf_test_case to_nondir +to_dir_dne_head() +{ + atf_set "descr" "Copy one or more files to a non-directory" +} to_nondir_body() { echo "foo" >foo @@ -490,6 +614,10 @@ to_nondir_body() } atf_test_case to_deadlink +to_deadlink_head() +{ + atf_set "descr" "Copy a file to a dead symbolic link" +} to_deadlink_body() { echo "foo" >foo @@ -499,6 +627,10 @@ to_deadlink_body() } atf_test_case to_deadlink_append +to_deadlink_append_head() +{ + atf_set "descr" "Copy multiple files to a dead symbolic link" +} to_deadlink_append_body() { echo "foo" >foo @@ -517,6 +649,10 @@ to_deadlink_append_body() } atf_test_case to_dirlink +to_dirlink_head() +{ + atf_set "descr" "Copy things to a symbolic link to a directory" +} to_dirlink_body() { mkdir src dir @@ -542,6 +678,11 @@ to_dirlink_body() } atf_test_case to_deaddirlink +to_deaddirlink_head() +{ + atf_set "descr" "Copy things to a symbolic link to a nonexistent " \ + "directory" +} to_deaddirlink_body() { mkdir src @@ -572,6 +713,11 @@ to_deaddirlink_body() } atf_test_case to_link_outside +to_link_outside_head() +{ + atf_set "descr" "Recursively copy a directory containing a symbolic " \ + "link that points to somewhere outside the source directory" +} to_link_outside_body() { mkdir dir dst dst/dir @@ -584,6 +730,11 @@ to_link_outside_body() } atf_test_case dstmode +dstmode_head() +{ + atf_set "descr" "Verify that directories are created with the " \ + "correct permissions" +} dstmode_body() { mkdir -m 0755 dir @@ -646,6 +797,7 @@ atf_test_case unrdir unrdir_head() { atf_set "descr" "Test handling of unreadable directories" + atf_set "require.user" "unprivileged" } unrdir_body() { @@ -670,6 +822,7 @@ atf_test_case unrfile unrfile_head() { atf_set "descr" "Test handling of unreadable files" + atf_set "require.user" "unprivileged" } unrfile_body() { From nobody Wed Jul 9 17:38:16 2025 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 4bclZ119XRz60khl; Wed, 09 Jul 2025 17:38:17 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bclZ04cxTz3J40; Wed, 09 Jul 2025 17:38:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752082696; 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=ld7qTkCuG893bmxyBGvxSYug9yM0/L5EyhnGIj+hbVE=; b=dsKxZTrL0re9KQkUC6OOvRWNLcVeT0aKMcLUO8eYa01OPNbAycFhNeclk07UV/0tABUkcl eMioJNqs0w2Flj5Y7F7pLP/MQlle7jIXa7K6ms1+mrgKw43XwoE4xUUU+Do0YCEaTJzRIn V/nyr5dJrCO9uXmuzlcgeK01Cw7gsxImusJAb5/YNIDMjMuK8ZHyU8Gd1RmBn/WYwPhZS9 I3MDr202f4aRAK9E9DAnFI8hcnSnJy0Fe1MGHgFxoaxw6BDMw/kIkhidhqsYL9MrHSltDP uPst9cBHT2rG4qyezPnEU8+FuG/NUD04eynn8oNXO2O1K/MnrssN+sM8LnBZog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752082696; 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=ld7qTkCuG893bmxyBGvxSYug9yM0/L5EyhnGIj+hbVE=; b=Sia0YT8qLe7xsNbUB18S20uUXWvz2zXdIA6lh4vTjKPrp+EDm+A3F/h8cn8q0wTpKywTs4 Lf+a1iOFPmJh0r+rffFjtajBoM3RheUxLYCQrBSqhXg2ZJaS3Ucb/VvegiPDKFn8NA+zwX EA22Ds0dSWjjJ+Gg+LGg2y2qXI4l/7C5NFRCKL5kbbYbQl5RZaINCMPLLHr6gV1Q6RPq07 NtfWBCUpe4tTmlPBBoK52I8rUdbYb4TWxu/bk0fJrMKyDwR4Avobb39ok5Suu+LKS98ifq pYKfX2NEVUXLNpvp62s8TRIm90xxTe4uHvmH8uNDjM2k+vk7qfu6sBSZsrTPjQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752082696; a=rsa-sha256; cv=none; b=DatNG8EkfKLXYqmIGEVAOL/x4kPBE1zVyaAoXvS/AOlJqDX9qxne21SHT16w71A3+6iUzQ jSbLdIG+KCw5DJrSXOjBY/2ShOjc/xbvZ4PJb2qgwLe/MsC4vwlxPWD6w2tNsiCKnV3uHh JgBdx11oeo3FfGlmJ6RWifTgW/Rpfvr9UcsLJ+IT5pvMrEocUr81x+VGDoeoGD3ebh7pgZ Sc5kvKSAi9u7fqe3KcxfoWA9CP/9Ky7F3TvndxQRZzE0Tnyw/F8Y5f7VZwi1IwXXubrMsk vIYT8T1xmdbw+4y+2hI0mIgf+5IWjLuey20dJrGq96GFV8XIeZ3sQbNBbbT4vA== 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 4bclZ03vdRzY1n; Wed, 09 Jul 2025 17:38:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 569HcG4j028616; Wed, 9 Jul 2025 17:38:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 569HcGof028613; Wed, 9 Jul 2025 17:38:16 GMT (envelope-from git) Date: Wed, 9 Jul 2025 17:38:16 GMT Message-Id: <202507091738.569HcGof028613@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 44e9c9f8f391 - main - nfsvno_rename(): do not use -1 as special error indicator 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 44e9c9f8f3916200292e8191f3534dc7946c5c37 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=44e9c9f8f3916200292e8191f3534dc7946c5c37 commit 44e9c9f8f3916200292e8191f3534dc7946c5c37 Author: Konstantin Belousov AuthorDate: 2025-07-08 19:52:44 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-09 17:38:11 +0000 nfsvno_rename(): do not use -1 as special error indicator it clashes with ERESTART. Use EJUSTRETURN for the case, as it is often done in other places in the kernel. Reviewed by: markj, rmacklem Tested by: pho Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D51211 --- sys/fs/nfsserver/nfs_nfsdport.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c index a81f1492ef95..95dc44438acc 100644 --- a/sys/fs/nfsserver/nfs_nfsdport.c +++ b/sys/fs/nfsserver/nfs_nfsdport.c @@ -1652,10 +1652,11 @@ nfsvno_rename(struct nameidata *fromndp, struct nameidata *tondp, } if (fvp == tvp) { /* - * If source and destination are the same, there is nothing to - * do. Set error to -1 to indicate this. + * If source and destination are the same, there is + * nothing to do. Set error to EJUSTRETURN to indicate + * this. */ - error = -1; + error = EJUSTRETURN; goto out; } if (nd->nd_flag & ND_NFSV4) { @@ -1710,7 +1711,7 @@ out: vput(tvp); vrele(fromndp->ni_dvp); vrele(fvp); - if (error == -1) + if (error == EJUSTRETURN) error = 0; } From nobody Wed Jul 9 17:38:17 2025 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 4bclZ16932z60khm; Wed, 09 Jul 2025 17:38:17 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bclZ147SBz3J97; Wed, 09 Jul 2025 17:38:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752082697; 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=VXG/MtapaYAFJXfBJolAMGxbaUBcWb1CfTijACbOqqk=; b=v1Rv2JQ8JQMKGu4UwPh7eGg0aAixOyi2N74tzqQPvL+KNfxwXufc953TLuADeEEjdl75og UmUG0/aW3DdKUSwytQvLSmiVQ9sw862kylOW1sKmmUa7EWtI7s03iLZw8K6o4lUjKFiSin qijMIXVS17FtzX2bR0nBA7ujDLB8rTH3b7BYG8RKh4Lm63nt3ZFE2RcCiFAsObwV38DLO+ vJujJimowJyBT8EG3j7Q1N9kz0gGxlJDHlGqfTzXjt+4TYbBFfRUAGb6FOErRCMfRexSoN DuM4ygyayoI5AYVb5DewO09k5OLZsMIbiNuen6XzvdEb8IMFooZBYKDK2XJJkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752082697; 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=VXG/MtapaYAFJXfBJolAMGxbaUBcWb1CfTijACbOqqk=; b=b49Xjrn30pHsD2QJ3Ot8U0AHRDsSSP+YyARWMbkQFM+2SYg7ZV1wjEVcw4kIjr3i9WWKMo aH65WjrcU+JotB19mZGUBNUtPGRftsOh2xQxqZD5w3UD09tlir1Bwbw7jh05S7RYGLPg/+ Zv7fBvEN53l5WCcIdEPC5wnsclFqyz+Azq4rEXxEeG2ajoecI97QncSsPm8iO3J7wFjolO cbRNY2pFlDSBvbHvz1Pvy0nW9vfRq7S1wbg4YQHD8oBx2N/MtLbmU7hcOomtbO2ViqBll7 RwaaFo2t+JnphHlfTBEKHRufpX2d6eeK+40733ownDMUaXCubBR5j5s99zQiTg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752082697; a=rsa-sha256; cv=none; b=WykGYxBtyr6il9avExlg0eKEpQFpQlMz9sV7ahExxn1GifghXzWzkG5UjAiGyYsCTPDx+8 12XPbz3ur8SDeop4r6NYVhqXIZlcQIj3GOQVq/BXZPcPgjY6Lm2JePovaWewd/Us4Jmhio 7wriQiuLkJaGTKxfrjbBQMLCeJ9lgEHuuFVnrob4rJzTjniYqVMA/Mj9869TqMkirthP4m dwcz4NLZDhXdRz/OO1F8msV3f20E9uPM2KT7sygMCZV1OZCU9UFO7dyYJ90jNiz3ZDmOw5 W1g5hzVLVumZkov0KkCVMAd9Xr5y7730wj3rdEDy0THhXyOIXi5tptJVpWBVPQ== 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 4bclZ13l2qzXrl; Wed, 09 Jul 2025 17:38:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 569HcHCY028654; Wed, 9 Jul 2025 17:38:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 569HcHkL028651; Wed, 9 Jul 2025 17:38:17 GMT (envelope-from git) Date: Wed, 9 Jul 2025 17:38:17 GMT Message-Id: <202507091738.569HcHkL028651@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 6280d03bb5fd - main - nfsserver rename: lock mnt_renamelock as required 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6280d03bb5fda4ba4a33a6e6faff2de34b2eda61 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=6280d03bb5fda4ba4a33a6e6faff2de34b2eda61 commit 6280d03bb5fda4ba4a33a6e6faff2de34b2eda61 Author: Konstantin Belousov AuthorDate: 2025-07-08 19:53:55 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-09 17:38:11 +0000 nfsserver rename: lock mnt_renamelock as required Fixes: ef6ea91593ebff73e2fc201efd9f848b71c5a125 Reported by: des Reviewed by: markj, rmacklem Tested by: pho Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D51211 --- sys/fs/nfsserver/nfs_nfsdport.c | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c index 95dc44438acc..43ee0383669f 100644 --- a/sys/fs/nfsserver/nfs_nfsdport.c +++ b/sys/fs/nfsserver/nfs_nfsdport.c @@ -1698,10 +1698,26 @@ nfsvno_rename(struct nameidata *fromndp, struct nameidata *tondp, " dsdvp=%p\n", dsdvp[0]); } out: - if (!error) { + mp = NULL; + if (error == 0) { + error = VOP_GETWRITEMOUNT(tondp->ni_dvp, &mp); + if (error == 0) { + if (mp == NULL) { + error = ENOENT; + } else { + error = lockmgr(&mp->mnt_renamelock, + LK_EXCLUSIVE | LK_NOWAIT, NULL); + if (error != 0) + error = ERELOOKUP; + } + } + } + if (error == 0) { error = VOP_RENAME(fromndp->ni_dvp, fromndp->ni_vp, &fromndp->ni_cnd, tondp->ni_dvp, tondp->ni_vp, &tondp->ni_cnd); + lockmgr(&mp->mnt_renamelock, LK_RELEASE, 0); + vfs_rel(mp); } else { if (tdvp == tvp) vrele(tdvp); @@ -1711,8 +1727,13 @@ out: vput(tvp); vrele(fromndp->ni_dvp); vrele(fvp); - if (error == EJUSTRETURN) + if (error == EJUSTRETURN) { error = 0; + } else if (error == ERELOOKUP && mp != NULL) { + lockmgr(&mp->mnt_renamelock, LK_EXCLUSIVE, 0); + lockmgr(&mp->mnt_renamelock, LK_RELEASE, 0); + vfs_rel(mp); + } } /* From nobody Wed Jul 9 17:53:01 2025 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 4bclv21Zssz60lc6; Wed, 09 Jul 2025 17:53:02 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bclv15lTvz3RsT; Wed, 09 Jul 2025 17:53:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752083581; 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=Uo5fqztSN2NAa2rsJrIKUOEh38u03pNxUNcpbhs++34=; b=NJpy7W9mQt1IpZoZP3qBGN2NH5UYlexg/+/Z5J3YWv3cVpNWzu1B050ouaQjWSqA4mdJ0k /zfOisFr63l81Kqh7/RpIXDy/zOeYt6I5OtXc0xueC8YzPXcznfamMiYQwr6VlUBQqDyd5 oC/zNa41zq+VTOEIiZNGswPZDjpJtMrmEZGLmhn+7XGz/7M1xl5JqR4b7eiqBsQeEN3q8W uTV1X7pLSM2AloIpHlYWXbwBpG3+GUBlpiRykYiThyngCJMNrezcA3np/BuJZy9YU8WRAM WnAcktjXkXvF8p9A29dSpCW0fj0IvpwyXpm0ZOE8Kbp8yCV7xKf1d09m4plQ/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752083581; 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=Uo5fqztSN2NAa2rsJrIKUOEh38u03pNxUNcpbhs++34=; b=hp7/Z53okVtGLg7q4nbZLmSQinocTeZrcS5mjivWZGldJGm00DmUkTAEhaGfdoGgxFm9Se cArKElS5RhD0EqBXNKFQmcBKL0JY2ewTbUo5ya4IDIQUCW8G925xw7Gwa+JqdTFmKh3EcJ jteeO2KHgaFogdQf5zaTC4v3pf8gVPlWzZlsq5ZJBl+V421MxFFOQMI6meMFyHBKY+I8U2 0BQ2NTY13ws8y/BUZc0ngLcVQ5Q9RG1v/TzT4xRRwojYLm9t/MthoywHl01Rf7DRvqLtXX vOUtxEIMvGUyCaxmYLoLH36eROYkUBkkDcSrCZ8OlzBHuk2i5lCjXfSIXGwe+g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752083581; a=rsa-sha256; cv=none; b=ccX9kGTJu6XlF1S223oyBjgRp6wdPeNBRFof9/sN78Tey9QfthNjaOXzaj9+RMKql2+efd DIg1U5P7LYRMfXIoWK7psMMcmBaqHF9ufejHmZwI2RfU1Y7KoAMCQ+7JNW6NPfvAvBGMF6 VCYb5TOa4qeY1RhAQoTxKD483S5HuHERSVw9oBsf6L57WuoM9W42g48QBshdi8xudOCTIA AFUKIh1VdYUKmpo1VTT+UUrJyyMcowTAleXscIJ6vX48IzWzj3WCqlRxCPLtg01iPnEp+T 941t2vJvgo6c+s+l/ceaymLkNZTSJUsqGCm8hB/Iht+Tgsg6R76+FPtktbyB4w== 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 4bclv15LwHzYxd; Wed, 09 Jul 2025 17:53:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 569Hr172063690; Wed, 9 Jul 2025 17:53:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 569Hr1Yr063687; Wed, 9 Jul 2025 17:53:01 GMT (envelope-from git) Date: Wed, 9 Jul 2025 17:53:01 GMT Message-Id: <202507091753.569Hr1Yr063687@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Ziaee Subject: git: 91ad27bcfc49 - main - truncate.1: Polish title and examples 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 91ad27bcfc496393ba88f39ca13cdf1c59a7f487 Auto-Submitted: auto-generated The branch main has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=91ad27bcfc496393ba88f39ca13cdf1c59a7f487 commit 91ad27bcfc496393ba88f39ca13cdf1c59a7f487 Author: Alexander Ziaee AuthorDate: 2024-12-30 06:11:15 +0000 Commit: Alexander Ziaee CommitDate: 2025-07-09 17:52:01 +0000 truncate.1: Polish title and examples + describe better + switch examples to human readable sizes, with consistent spacing + `Downsize ... in 5 Megabytes` >> `Downsize ... by 5 Megabytes` + remove prompt from lone example with prompt for consistency + remove x permissions from kernel example + examples now fit on standard console without wrapping While here: + fold a line to eliminate linter warning + tag spdx + add -nosplit to AUTHORS to eliminate a rendering glitch MFC after: 3 days Discussed with: asomers, jhb, maxim Reviewed by: imp (previous version) Closes: https://github.com/freebsd/freebsd-src/pull/1568 --- usr.bin/truncate/truncate.1 | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/usr.bin/truncate/truncate.1 b/usr.bin/truncate/truncate.1 index f6b8b0cc37c9..aa70943b889f 100644 --- a/usr.bin/truncate/truncate.1 +++ b/usr.bin/truncate/truncate.1 @@ -1,4 +1,6 @@ .\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" .\" Copyright (c) 2000 Sheldon Hearn . .\" All rights reserved. .\" Copyright (c) 2021 The FreeBSD Foundation @@ -27,12 +29,12 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd March 6, 2025 +.Dd July 9, 2025 .Dt TRUNCATE 1 .Os .Sh NAME .Nm truncate -.Nd truncate, extend the length of files, or perform space management in files +.Nd resize files or manage file space .Sh SYNOPSIS .Nm .Op Fl c @@ -132,7 +134,8 @@ file system space deallocation may be performed in the operation region. The space management operation is performed at the given .Ar offset bytes in the file. -If this option is not specified, the operation is performed at the beginning of the file. +If this option is not specified, +the operation is performed at the beginning of the file. .It Fl l Ar length The length of the operation range in bytes. This option must always be specified if option @@ -195,9 +198,9 @@ truncate -c -s 10M test_file .Pp Same as above but create the file if it does not exist: .Bd -literal -offset indent -truncate -s 10M test_file -ls -l test_file --rw-r--r-- 1 root wheel 10485760 Jul 22 18:48 test_file +truncate -s +10M test_file +ls -lh test_file +-rw-r--r-- 1 root wheel 10M Jul 22 18:48 test_file .Ed .Pp Adjust the size of @@ -207,10 +210,10 @@ to the size of the kernel and create another file with the same size: .Bd -literal -offset indent truncate -r /boot/kernel/kernel test_file test_file2 -ls -l /boot/kernel/kernel test_file* --r-xr-xr-x 1 root wheel 31352552 May 15 14:18 /boot/kernel/kernel --rw-r--r-- 1 root wheel 31352552 Jul 22 19:15 test_file --rw-r--r-- 1 root wheel 31352552 Jul 22 19:15 test_file2 +ls -lh /boot/kernel/kernel test_file* +-r--r--r-- 1 root wheel 30M May 15 14:18 /boot/kernel/kernel +-rw-r--r-- 1 root wheel 30M Jul 22 19:15 test_file +-rw-r--r-- 1 root wheel 30M Jul 22 19:15 test_file2 .Ed .Pp Increase the size of the file @@ -228,9 +231,9 @@ Reduce the size of the file by 5 megabytes: .Bd -literal -offset indent truncate -s -5M test_file -ls -l test_file* --rw-r--r-- 1 root wheel 31352552 Jul 22 19:19 test_file --rw-r--r-- 1 root wheel 31352552 Jul 22 19:15 test_file2 +ls -lh test_file* +-rw-r--r-- 1 root wheel 25M Jul 22 19:17 test_file +-rw-r--r-- 1 root wheel 30M Jul 22 19:15 test_file2 .Ed .Sh SEE ALSO .Xr dd 1 , @@ -247,6 +250,7 @@ The utility first appeared in .Fx 4.2 . .Sh AUTHORS +.An -nosplit The .Nm utility was written by From nobody Wed Jul 9 19:17:37 2025 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 4bcnmf326Tz60rDV; Wed, 09 Jul 2025 19:17:38 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcnmf1xHfz46J7; Wed, 09 Jul 2025 19:17:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752088658; 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=yhwGBYba40XtcaY1Y8C8xjF4TA8T3EJZ2WNoF5Fj6uw=; b=H4bKTTb4A1wCTXoHhKCe8wdwzBeqldLtW/YUOsm3zNbXEZF0IyYyAqpls5SM8jGGDWV3YO fVPJ+Ga1i6JryIQzUWZ9RL4CyXBWS7KovpRCfIv65IDURftCoQzEZ78mR5DNGZQ9yo8sYX DzmGLERO8ok/oCmjRBmhxqSyhzil2AMPmcztsiYYyL1wmuQw9g9+Plpl+04gFdkLFAZf/K PIZAL+ekyFS1LjQKfaO/Sranm1Nr8spejvJxP2Eww53JygIB2KGLhYO0Ln0/PM1qnuoUps /Qe//oWG+09R/sZB2IMYVF0PXBnyoy5TMMzSvtfoI8e0wrqAccw42aKtWOQe3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752088658; 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=yhwGBYba40XtcaY1Y8C8xjF4TA8T3EJZ2WNoF5Fj6uw=; b=FjELnb21Bbgw24R00j5sze8c8TLJC4AcT9OHJXPs3qWvAeVc4bZ951KmSmcsDvuy+ZYuZR 7CrUZDnQ7kGTID4ehipKA4089HaVzAErRcM4VYDr7dz4nEiX2ZALF7gEw09+Uw7G4mZr5C vnejXQq1SoB5VBfthmMnf94jQqmWIU8CiDLE9D01JQdmLOUxNg65e4t5UiagA6p206Rm91 TRQJRJjCZwzeKUILtzaT0aR1dwsPWC4StfKgGtln+tDvjtyLUVCohttXyTxPOekiG8/skT pUu+pDatgP/3fVSXkt4qsCZb+W1REIxVEC+ccoyjSRewPhnDgMDmJQpIPk0npA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752088658; a=rsa-sha256; cv=none; b=tCkF994mZgOkFg/Wh4Ia/IlsUmo7I9gX9YnCecOAYjbw6TMiZ85/49cW25b3+vQB3M4LsQ lSKZRuxsGwfo+bukK8Nvtox+7di+bTrlVjlPUIWOfIPJobkGP++aWlPPW2xSgwj6Tr1ib9 KyR86F9f62ja8CekT5CW3cJnoajVA8wXMkpiFTQxaUg+gyhvC57aNlWEtx2p5f9CUJ7F57 ZtUzYZ1REEUzG7VDkC8/N+d0UfB0LZN6DDxhU8+S6vDOu8ZZUG2nMgg2qQFaLp7lsz3fTk 3hUasokNUQEQ4Cf0YD3LMsNntyHBI62IRM7sHehnBsSYXViuJv3ltUujypmtuw== 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 4bcnmd6zPDzbtC; Wed, 09 Jul 2025 19:17:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 569JHbml016663; Wed, 9 Jul 2025 19:17:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 569JHbhl016660; Wed, 9 Jul 2025 19:17:37 GMT (envelope-from git) Date: Wed, 9 Jul 2025 19:17:37 GMT Message-Id: <202507091917.569JHbhl016660@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: ccf937320a1a - main - libc: Finish removing fscandir{,_b}(). 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ccf937320a1a7383a2c33698007b7244f66dc022 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=ccf937320a1a7383a2c33698007b7244f66dc022 commit ccf937320a1a7383a2c33698007b7244f66dc022 Author: Dag-Erling Smørgrav AuthorDate: 2025-07-09 19:16:40 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-07-09 19:17:06 +0000 libc: Finish removing fscandir{,_b}(). These only existed for a few days before being renamed, so there's no reason to continue to carry compatibility shims for them. Fixes: deeebfdecab5 Sponsored by: Klara, Inc. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D50981 --- ObsoleteFiles.inc | 4 ---- lib/libc/gen/Symbol.map | 2 -- lib/libc/gen/scandir.c | 6 ------ 3 files changed, 12 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index faf7c421af80..d1095b57c342 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -60,10 +60,6 @@ MOVED_LIBS+=usr/lib/libtpool.so.2 # 20250626: replace yaml.lua with lyaml OLD_FILES+=usr/share/flua/yaml.lua -# 20250623: fscandir() renamed to fdscandir() -OLD_FILES+=usr/share/man/man3/fscandir.3.gz -OLD_FILES+=usr/share/man/man3/fscandir_b.3.gz - # 20250615: don't install man page for absent function OLD_FILES+=usr/share/man/man9/vm_map_simplify_entry.9.gz diff --git a/lib/libc/gen/Symbol.map b/lib/libc/gen/Symbol.map index 50dbf3425964..c2020ac3d8d2 100644 --- a/lib/libc/gen/Symbol.map +++ b/lib/libc/gen/Symbol.map @@ -458,8 +458,6 @@ FBSD_1.8 { aio_read2; aio_write2; execvpe; - fscandir; - fscandir_b; fdscandir; fdscandir_b; fts_open_b; diff --git a/lib/libc/gen/scandir.c b/lib/libc/gen/scandir.c index 8e62fe980868..fb589f4b36b6 100644 --- a/lib/libc/gen/scandir.c +++ b/lib/libc/gen/scandir.c @@ -252,9 +252,3 @@ scandir_thunk_cmp(const void *p1, const void *p2, void *thunk) return (dc((const struct dirent **)p1, (const struct dirent **)p2)); } #endif - -#ifdef I_AM_SCANDIR_B -__weak_reference(fdscandir_b, fscandir_b); -#else -__weak_reference(fdscandir, fscandir); -#endif From nobody Wed Jul 9 20:22:06 2025 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 4bcqCG1zBSz60w45; Wed, 09 Jul 2025 20:22:18 +0000 (UTC) (envelope-from eduardo@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcqCG0KhQz3l0x; Wed, 09 Jul 2025 20:22:18 +0000 (UTC) (envelope-from eduardo@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752092538; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=wEYYMud2/U9fKTDbicXMnDBU7ZPLHzUV4i1NFlKUB+g=; b=uY5ny9xL4/74xMKQQK3e01niX6aRX8IPSHKb0elgubv1puKssgntY4t+ssL7zxqJrhZNGe uGWm0sUEuoE3Qodc0a+m4Mln3CTZm73cw8T5KU/5ZYAzud5Q0OE4dUMXa/LjTjpubQvsv/ 8GW/D5/RVyvOpmCdf8AbqJW1JbwOzVm3P1S3Imd0IkZyPi4tIAiB/20RTpJx70Zr2aJ8FV +1BXRVPjb2MNthSukZORUfF3qSv5CM8enL7f+yD/KrsL6ReCLji2bBI41h+iDEuq6fvqnZ I7wHDwS3gMC0ZhMVvtdoiWkb2nodSOxkJweWTRdQFH3EpS4QeLMmNPkNmHL+TQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752092538; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=wEYYMud2/U9fKTDbicXMnDBU7ZPLHzUV4i1NFlKUB+g=; b=MNRUmdX2pKU1Jq/uRc5X3ijHhdiQf/O5Z+o17uN3xb1rU8EbQ2LOoQe2ub+cIzPpApl4Jf +Zn1daBfJhAvVpMF2f4enuxsvWFGcoEKs/bgiiYTvwdnakDlAugB21q6EhCmlXNB9SQzWH F0FhbyJEGU5fEa+CgkevdssKuimBFVqaCPlbhGY4uAR9PAKbQYv7NESRPnPxfW8QbNcbYS BVwImFKry8d9vwgqjO/6iQBJA6R3KqYVtooou1HoB0a4kkrry7QvANYrI3HRYheOept4TU qNT/vZ8pGrfWpwnfskcr2KIJXuzZT0nWCGGEpiscSNCYXsaWUNfNflzRVFdZKQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752092538; a=rsa-sha256; cv=none; b=K7H2tzlFkwWpBsdISbXPNGIyLq1H5qCS+T+QXKp+Z50Iu+TbCf4EQSc+ALeKBjepATizhV WMXUz4GNrKFyNMpD9lJF/xvMuFY1behlV+mSjBv4DQh4J8jCPom0q7jb9BIgrl9fnibwTV /zFpNVw1TrQ2hG8PIk+O3vvpQWhuH4Zk5OlezhhE5vFZYJFx4fXPPe3j2X9l+kVNOQJYd4 QJTRM01w65s/gwEDY6ugiausDd7udIMO3jq5s4y/cRI4JosjAji0hpvISjUSKOeXCe9xgc hdTQR5nm/sljA/clTTXjP+tVW8jCaN65tnEfb1ogYOeEj2s8W4kf0z4b9njo+w== Received: from mail-qt1-f169.google.com (mail-qt1-f169.google.com [209.85.160.169]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) (Authenticated sender: eduardo) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bcqCF6ySPz8lK; Wed, 09 Jul 2025 20:22:17 +0000 (UTC) (envelope-from eduardo@freebsd.org) Received: by mail-qt1-f169.google.com with SMTP id d75a77b69052e-4a9bcdd43a2so441991cf.1; Wed, 09 Jul 2025 13:22:17 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCUtEy6Wm36rc6h6gR6A954lSYmGRVwK3s9Q8xhYlBoIbCwK0HZMjIuwjUVnD9Eeqlth70BmU8MrzNnnCfQx6mVx9WxYyBQ=@freebsd.org, AJvYcCVDOTiiTsJ3nsGyfqbQ13RUWbYJAhcAzAlz7MlnhLw6xDn9LuIMPbyjiwNQJW8lv6pBWACLg2dLoILSwY7aWGGFnNjB@freebsd.org X-Gm-Message-State: AOJu0Yxl8y60hlqV7Wgx9TE+avPKCUf0fFcIjv/KvZhllc0OeLyqd4HN hZgCkgxuAzoXIumMB19bur48WU9kcl9L9AKu6HwUlUG/brxz4MCmF0KfkGfelgDV7bZilNFpByI +ZLSsSIP7EiDtkVcb51RWFEA6ifpYIvo= X-Google-Smtp-Source: AGHT+IErHCU/kF/7tSp6n7s6Huk/E5sNq52bZY0pt7nMqEUMZFS6a72NgfbL9Nn/ekm9UXY4778uGRjd6xxQqKhJ4r0= X-Received: by 2002:ac8:5fc3:0:b0:4a9:94ab:cc77 with SMTP id d75a77b69052e-4a9ded558d0mr18260341cf.14.1752092537414; Wed, 09 Jul 2025 13:22:17 -0700 (PDT) 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 References: <202507041513.564FDwxH011496@gitrepo.freebsd.org> In-Reply-To: From: Nuno Teixeira Date: Wed, 9 Jul 2025 21:22:06 +0100 X-Gmail-Original-Message-ID: X-Gm-Features: Ac12FXwazkVX-bW5WmD0s5txIjQMWMgo4dpepTbDLocs0rdHJYHNPUJ6A_ihXDY Message-ID: Subject: Re: git: f9cf745a5084 - main - RELNOTES: Document the addition of inotify To: Mark Johnston Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="0000000000004e6d67063984d501" --0000000000004e6d67063984d501 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello Mark! I confirm that it builds OK. i3 wm depends on it, so I will have a run test in the next days. Also I will update my main amd64 soon and test it in there too. Thanks, Mark Johnston escreveu (quarta, 9/07/2025 =C3=A0(s) 13:= 32): > On Wed, Jul 09, 2025 at 01:13:02PM +0100, Nuno Teixeira wrote: > > Hello, > > > > Not sure if related but I see devel/libdev failing on recent main (test= ed > > on aarch64): > > > > libtool: compile: cc -DHAVE_CONFIG_H -I. -O2 -pipe > > -fstack-protector-strong -fno-strict-aliasing -MT event.lo -MD -MP -MF > > .deps/event.Tpo -c event.c -fPIC -DPIC -o .libs/event.o > > --- ev.lo --- > > ev.c:510:11: fatal error: 'sys/statfs.h' file not found > > 510 | # include > > | ^~~~~~~~~~~~~~ > > Are you able to test the patch below? > > diff --git a/devel/libev/files/patch-Makefile.in > b/devel/libev/files/patch-Makefile.in > index 5f6ab0fc3b55..509149e2548b 100644 > --- a/devel/libev/files/patch-Makefile.in > +++ b/devel/libev/files/patch-Makefile.in > @@ -1,6 +1,6 @@ > ---- Makefile.in.orig 2015-12-20 21:12:45 UTC > +--- Makefile.in.orig 2020-03-18 12:27:30 UTC > +++ Makefile.in > -@@ -343,7 +343,7 @@ EXTRA_DIST =3D LICENSE Changes libev.m4 au > +@@ -357,7 +357,7 @@ man_MANS =3D ev.3 > ev.3 ev.pod Symbols.ev Symbols.event > > man_MANS =3D ev.3 > diff --git a/devel/libev/files/patch-configure > b/devel/libev/files/patch-configure > index c92f6cf66003..6e5bf586cf34 100644 > --- a/devel/libev/files/patch-configure > +++ b/devel/libev/files/patch-configure > @@ -1,6 +1,6 @@ > ---- configure.orig 2015-12-20 21:12:45 UTC > +--- configure.orig 2020-03-18 12:27:26 UTC > +++ configure > -@@ -3879,14 +3879,6 @@ else > +@@ -3954,14 +3954,6 @@ fi > fi > > > diff --git a/devel/libev/files/patch-ev.c b/devel/libev/files/patch-ev.c > index 28a00f3aaf8b..65b372e5415a 100644 > --- a/devel/libev/files/patch-ev.c > +++ b/devel/libev/files/patch-ev.c > @@ -1,6 +1,15 @@ > ---- ev.c.orig 2015-12-20 21:12:53 UTC > +--- ev.c.orig 2020-03-18 12:27:32 UTC > +++ ev.c > -@@ -2736,7 +2736,7 @@ ev_recommended_backends (void) EV_THROW > +@@ -507,7 +507,7 @@ > + #endif > + > + #if EV_USE_INOTIFY > +-# include > ++# include > + # include > + /* some very old inotify.h headers don't have IN_DONT_FOLLOW */ > + # ifndef IN_DONT_FOLLOW > +@@ -3149,7 +3149,7 @@ ev_recommended_backends (void) EV_NOEXCEPT > { > unsigned int flags =3D ev_supported_backends (); > > --=20 Nuno Teixeira FreeBSD UNIX: Web: https://FreeBSD.org --0000000000004e6d67063984d501 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello Mark!

I confirm tha= t it builds OK.
i3 wm depends on it, so I will have a run test in = the next days.

Also I will update my main amd64 soon and test = it in there too.

Thanks,

Mark Johnston &l= t;markj@freebsd.org> escreveu (= quarta, 9/07/2025 =C3=A0(s) 13:32):
On Wed, Jul 09, 2025 at 01:13:02PM +0100, Nuno Teixeira= wrote:
> Hello,
>
> Not sure if related but I see devel/libdev failing on recent main (tes= ted
> on aarch64):
>
> libtool: compile:=C2=A0 cc -DHAVE_CONFIG_H -I. -O2 -pipe
> -fstack-protector-strong -fno-strict-aliasing -MT event.lo -MD -MP -MF=
> .deps/event.Tpo -c event.c=C2=A0 -fPIC -DPIC -o .libs/event.o
> --- ev.lo ---
> ev.c:510:11: fatal error: 'sys/statfs.h' file not found
>=C2=A0 =C2=A0510 | # include <sys/statfs.h>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0|=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0^~= ~~~~~~~~~~~~

Are you able to test the patch below?

diff --git a/devel/libev/files/patch-Makefile.in b/devel/libev/files/patch-= Makefile.in
index 5f6ab0fc3b55..509149e2548b 100644
--- a/devel/libev/files/patch-Makefile.in
+++ b/devel/libev/files/patch-Makefile.in
@@ -1,6 +1,6 @@
---- Makefile.in.orig=C2=A0 =C2=A02015-12-20 21:12:45 UTC
+--- Makefile.in.orig=C2=A0 =C2=A02020-03-18 12:27:30 UTC
=C2=A0+++ Makefile.in
-@@ -343,7 +343,7 @@ EXTRA_DIST =3D LICENSE Changes libev.m4 au
+@@ -357,7 +357,7 @@ man_MANS =3D ev.3
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0ev.3 ev.pod Symbols.ev Symb= ols.event

=C2=A0 man_MANS =3D ev.3
diff --git a/devel/libev/files/patch-configure b/devel/libev/files/patch-co= nfigure
index c92f6cf66003..6e5bf586cf34 100644
--- a/devel/libev/files/patch-configure
+++ b/devel/libev/files/patch-configure
@@ -1,6 +1,6 @@
---- configure.orig=C2=A0 =C2=A0 =C2=A02015-12-20 21:12:45 UTC
+--- configure.orig=C2=A0 =C2=A0 =C2=A02020-03-18 12:27:26 UTC
=C2=A0+++ configure
-@@ -3879,14 +3879,6 @@ else
+@@ -3954,14 +3954,6 @@ fi
=C2=A0 fi


diff --git a/devel/libev/files/patch-ev.c b/devel/libev/files/patch-ev.c index 28a00f3aaf8b..65b372e5415a 100644
--- a/devel/libev/files/patch-ev.c
+++ b/devel/libev/files/patch-ev.c
@@ -1,6 +1,15 @@
---- ev.c.orig=C2=A0 2015-12-20 21:12:53 UTC
+--- ev.c.orig=C2=A0 2020-03-18 12:27:32 UTC
=C2=A0+++ ev.c
-@@ -2736,7 +2736,7 @@ ev_recommended_backends (void) EV_THROW
+@@ -507,7 +507,7 @@
+ #endif
+
+ #if EV_USE_INOTIFY
+-# include <sys/statfs.h>
++# include <sys/mount.h>
+ # include <sys/inotify.h>
+ /* some very old inotify.h headers don't have IN_DONT_FOLLOW */
+ # ifndef IN_DONT_FOLLOW
+@@ -3149,7 +3149,7 @@ ev_recommended_backends (void) EV_NOEXCEPT
=C2=A0 {
=C2=A0 =C2=A0 unsigned int flags =3D ev_supported_backends ();



--
Nuno Teixeira
=
FreeBSD UNIX:=C2=A0 <eduardo@FreeBSD.org>=C2=A0 =C2=A0Web:=C2=A0 https://Fr= eeBSD.org
--0000000000004e6d67063984d501-- From nobody Wed Jul 9 20:29:23 2025 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 4bcqMR3d6Nz60wRV; Wed, 09 Jul 2025 20:29:23 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcqMR22tKz3pvJ; Wed, 09 Jul 2025 20:29:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752092963; 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=4DtOFRAahcW0m/0GS7zDHUpEIOAK9ESmY9lT8dVKaTA=; b=xvSlA31VJXB9J5ADS+1w2N9ABnHhFOXp9VLBaHSuCQg9Do3UddFC0kQNEujxomo1OqVguo WR+oM/SmMOjgelsouwUsxrvD09qNZq5MTh8li7tKejoLMwGmVuIuEOG1lGoMKqPc+ZAI0e oPmq7cfbTvQfBioNguEjVw4G59FpOIWYBGmrU1CBrfVIqfEj0LxgC29sqNNEqRTpc7jHbk N1vwqpL0G+cTW49AbcoeXmdeZzUidlVINLLDz1wyE+7C1jHaYWI54GX4uql1WU6CawB2/J SzqKdTBdwDHd78bSE5CVJKf3PkyF+DhQqoHzOPukzC93JBHO2Sxy7SZISX6CwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752092963; 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=4DtOFRAahcW0m/0GS7zDHUpEIOAK9ESmY9lT8dVKaTA=; b=h2bZP0bqcSu59N8JTeeU8CDA4R4UMZJ3wfVm1HLPecVD19w7Q74rCMzbvR9z+VhH/H/IBh Hol6g0jHPCvT0BpjIf5jSBxoaQGC/qGhMbj/MYBrSs+IRT3oFcJoyaX/clyU68Iy/fZTb1 tR7MFNNZX4Ta6FqRwysDZllpFhc0End+KqaNDJzLnlBynHfu+h0uJuhOU8MwStpYJxTozP wzRr1gYA6LGt3aOvl1hCKQUJR14LgFNRq/MtFRFjvyB2X4BJjx8gEiY9VmZ8285ZqllBmw FGWvDXX2Aejg2SozuLoQlMigAaaBYRBFC5FtnXBrmCXSlIKbuWEdmStfHy8nOg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752092963; a=rsa-sha256; cv=none; b=pxSVSy0dUPcicTB20syNzpzQmsiYD+nOXYXc2naqGtQkX5k71pr8PI0cNNja5d04hhz8dW ECXDQC2zFhXlaIFGUxYD7SB1r/AGRNj5QpKjZrKA6k9vOYc0dvjYDSwvVF5rUPpuCPhHC8 4Yl019u9Z3X2zXadURBuzAjs2fP2gryaBgk4eypCCcskohISkjXNzWUucqjWC7Ky5rkZ8c VDTeRZtlk+fdEUn0vN68HacNI2z383D2vY6P+sfLIScNpy/WyOEypsz0IOexPybmBHT5wg gbnRunHdF0oQpKiQojscZ4NPpZ9CUcfMRwLpd7km+wnTxQn19vGSphMPKnh4fQ== 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 4bcqMR1DdNzdFG; Wed, 09 Jul 2025 20:29:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 569KTNFM047999; Wed, 9 Jul 2025 20:29:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 569KTNfe047996; Wed, 9 Jul 2025 20:29:23 GMT (envelope-from git) Date: Wed, 9 Jul 2025 20:29:23 GMT Message-Id: <202507092029.569KTNfe047996@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 9bf14f2a475e - main - kyua: Try harder to delete directories. 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9bf14f2a475e221c48488984dc5a02a4608bb877 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=9bf14f2a475e221c48488984dc5a02a4608bb877 commit 9bf14f2a475e221c48488984dc5a02a4608bb877 Author: Dag-Erling Smørgrav AuthorDate: 2025-07-09 20:28:47 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-07-09 20:28:47 +0000 kyua: Try harder to delete directories. When recursing into a directory to delete it, start by chmod'ing it to 0700. This fixes an issue where kyua is able to run, but not debug, a test case that creates unwriteable directories, because when debugging it tries (and fails) to delete the directory after the test completes. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: igoro Differential Revision: https://reviews.freebsd.org/D51229 --- contrib/kyua/utils/fs/operations.cpp | 2 ++ contrib/kyua/utils/fs/operations_test.cpp | 14 ++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/contrib/kyua/utils/fs/operations.cpp b/contrib/kyua/utils/fs/operations.cpp index 7a96d0b2058a..185d164b88d7 100644 --- a/contrib/kyua/utils/fs/operations.cpp +++ b/contrib/kyua/utils/fs/operations.cpp @@ -692,6 +692,7 @@ fs::rm_r(const fs::path& directory) { const fs::directory dir(directory); + ::chmod(directory.c_str(), 0700); for (fs::directory::const_iterator iter = dir.begin(); iter != dir.end(); ++iter) { if (iter->name == "." || iter->name == "..") @@ -701,6 +702,7 @@ fs::rm_r(const fs::path& directory) if (fs::is_directory(entry)) { LD(F("Descending into %s") % entry); + ::chmod(entry.c_str(), 0700); fs::rm_r(entry); } else { LD(F("Removing file %s") % entry); diff --git a/contrib/kyua/utils/fs/operations_test.cpp b/contrib/kyua/utils/fs/operations_test.cpp index f1349351166e..6f0fa52811c9 100644 --- a/contrib/kyua/utils/fs/operations_test.cpp +++ b/contrib/kyua/utils/fs/operations_test.cpp @@ -664,6 +664,19 @@ ATF_TEST_CASE_BODY(rm_r__files_and_directories) } +ATF_TEST_CASE_WITHOUT_HEAD(rm_r__bad_perms); +ATF_TEST_CASE_BODY(rm_r__bad_perms) +{ + fs::mkdir(fs::path("root"), 0755); + fs::mkdir(fs::path("root/dir"), 0755); + atf::utils::create_file("root/dir/file", ""); + ::chmod(fs::path("root/dir").c_str(), 0000); + ATF_REQUIRE(lookup(".", "root", S_IFDIR)); + fs::rm_r(fs::path("root")); + ATF_REQUIRE(!lookup(".", "root", S_IFDIR)); +} + + ATF_TEST_CASE_WITHOUT_HEAD(rmdir__ok) ATF_TEST_CASE_BODY(rmdir__ok) { @@ -811,6 +824,7 @@ ATF_INIT_TEST_CASES(tcs) ATF_ADD_TEST_CASE(tcs, rm_r__empty); ATF_ADD_TEST_CASE(tcs, rm_r__files_and_directories); + ATF_ADD_TEST_CASE(tcs, rm_r__bad_perms); ATF_ADD_TEST_CASE(tcs, rmdir__ok); ATF_ADD_TEST_CASE(tcs, rmdir__fail); From nobody Wed Jul 9 20:35:43 2025 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 4bcqVl4qwVz60whB; Wed, 09 Jul 2025 20:35:43 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcqVl4GNXz3tfD; Wed, 09 Jul 2025 20:35:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752093343; 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=Wk/94xi4nfXQryMqG3HpgpsmYMORTgaVTNIJt+SNTl8=; b=AlFaIFJ9PZW0MTMKMkIt8jOUXMAdUmlwH97dbFPDXteaHZ8lTe9PnJo/KduDaYsxX/RROt XdhNvV+6juh8y3KX7m3Hf4mDGcSX9a2cgmJ42saj9b0qKQ9jjPqZqUzSdF5DiudAvCH8AO Jz1lSct5JrXVMujLO8OsD0U3TjnKIqZEhO6vSN8znmXN1+Fz3Tw0BvZoMfu3biR3NgGe4t HN6j8jX1kLxnvtv799n8IppwmaVki8wrYsCktor3k0qWIlKOq9r3VCvhRMWyh6GPdrtNm1 WNtt6CF+uhqx/eovZ1VsfF+t74u7I+zW/hVvDbwNexDv966ve1O0fBtqDx2ILg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752093343; 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=Wk/94xi4nfXQryMqG3HpgpsmYMORTgaVTNIJt+SNTl8=; b=vbTQrOviZilQkBNCFLwH3XOTeiI4sSZvkbXSx6A+TjAWYdVvRIN5W2RAhHdijQvy0DCbg9 /CI6kPTonhVwUhQO1KpEcbBMOpq5sogXSCsXKfzfsszi8P+TXwk0K+3iZapyrenZPzbHRW pLn9oDZ7S+F5l16yDqoXG5T/daqXsb+MassevB62t2uT8UplvVgNvnua6e/2xjRazlBQoZ 3/pTkUrK8AdTGH2CgisgD4GdO9RoBIrDtQMGwtd1czSAOIoBoWs2uTUhXRpewgu2LDWuig zXD3hqyj2cC6Gekl7M7e22UQKLv+EJN/zG9wS6fuN+Ikzjruntu06ctMIwINtg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752093343; a=rsa-sha256; cv=none; b=sRYR/osZKImE+L5tJm8DY0X+X/cSN3lRWRBRg2VEvZTsVAKFkygPHEYDpi4UyehZ7vvRSp HKVdKfrk21hSBH8oA1JrhkMju56m+AK713wtxjWakuxZ8OdnbKi6LyU+HjwAEqQc9rki2H YJFK2UQ0PwKBGiul6gVkOB0EgnafAIOVDIv9s7qiJsLNqxkmfHjkhWl8Kz+8cvMZtjnv0i Mw+TSR0L9kVAvb/0uB1ID5Qo1lrYqL+uJfMyZgscCjY2Hwpy4wQG4otiftBnvuH7jrF+ZR mu0W+fIhz2m/M88D2QdzvN/gitaVVc9DUICahA1H2YVKtJ1NjEvRebj4X6KcPg== 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 4bcqVl3sG1zf0R; Wed, 09 Jul 2025 20:35:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 569KZhRu065674; Wed, 9 Jul 2025 20:35:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 569KZhYb065671; Wed, 9 Jul 2025 20:35:43 GMT (envelope-from git) Date: Wed, 9 Jul 2025 20:35:43 GMT Message-Id: <202507092035.569KZhYb065671@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: dd81cc2bc5f2 - main - getdirentries: Return ENOTDIR if not a directory. 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dd81cc2bc5f25fb2c58bb59bf585deeeae196345 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=dd81cc2bc5f25fb2c58bb59bf585deeeae196345 commit dd81cc2bc5f25fb2c58bb59bf585deeeae196345 Author: Dag-Erling Smørgrav AuthorDate: 2025-07-09 20:34:18 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-07-09 20:34:18 +0000 getdirentries: Return ENOTDIR if not a directory. This is both more logical and more useful than EINVAL. While here, also check for VBAD and return EBADF in that case. This can happen if the underlying filesystem got forcibly unmounted after the directory was opened. Previously, this would also have returned EINVAL, which wasn't right but wasn't wrong either; however, ENOTDIR would not be appropriate. MFC after: never Sponsored by: Klara, Inc. Reviewed by: kevans, kib Differential Revision: https://reviews.freebsd.org/D51209 --- lib/libc/gen/opendir2.c | 5 +- lib/libsys/getdirentries.2 | 10 ++- sys/kern/vfs_syscalls.c | 17 +++- tests/sys/kern/Makefile | 1 + tests/sys/kern/getdirentries_test.c | 172 ++++++++++++++++++++++++++++++++++++ 5 files changed, 193 insertions(+), 12 deletions(-) diff --git a/lib/libc/gen/opendir2.c b/lib/libc/gen/opendir2.c index 928145b468c1..7f207ed73441 100644 --- a/lib/libc/gen/opendir2.c +++ b/lib/libc/gen/opendir2.c @@ -315,11 +315,8 @@ __opendir_common(int fd, int flags, bool use_current_pos) */ dirp->dd_size = _getdirentries(dirp->dd_fd, dirp->dd_buf, dirp->dd_len, &dirp->dd_seek); - if (dirp->dd_size < 0) { - if (errno == EINVAL) - errno = ENOTDIR; + if (dirp->dd_size < 0) goto fail; - } dirp->dd_flags |= __DTF_SKIPREAD; } else { dirp->dd_size = 0; diff --git a/lib/libsys/getdirentries.2 b/lib/libsys/getdirentries.2 index 0e5840ce25cd..202ae133f548 100644 --- a/lib/libsys/getdirentries.2 +++ b/lib/libsys/getdirentries.2 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd September 5, 2023 +.Dd July 8, 2025 .Dt GETDIRENTRIES 2 .Os .Sh NAME @@ -178,9 +178,7 @@ or non-NULL .Fa basep point outside the allocated address space. .It Bq Er EINVAL -The file referenced by -.Fa fd -is not a directory, or +The value of .Fa nbytes is too small for returning a directory entry or block of entries, or the current position pointer is invalid. @@ -192,6 +190,10 @@ error occurred while reading from or writing to the file system. Corrupted data was detected while reading from the file system. .It Bq Er ENOENT Directory unlinked but still open. +.It Bq Er ENOTDIR +The file referenced by +.Fa fd +is not a directory. .El .Sh SEE ALSO .Xr lseek 2 , diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index d880733cbfe7..c71e0d9ee569 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -4314,10 +4314,6 @@ kern_getdirentries(struct thread *td, int fd, char *buf, size_t count, vp = fp->f_vnode; foffset = foffset_lock(fp, 0); unionread: - if (vp->v_type != VDIR) { - error = EINVAL; - goto fail; - } if (__predict_false((vp->v_vflag & VV_UNLINKED) != 0)) { error = ENOENT; goto fail; @@ -4330,6 +4326,19 @@ unionread: auio.uio_segflg = bufseg; auio.uio_td = td; vn_lock(vp, LK_SHARED | LK_RETRY); + /* + * We want to return ENOTDIR for anything that is not VDIR, but + * not for VBAD, and we can't check for VBAD while the vnode is + * unlocked. + */ + if (vp->v_type != VDIR) { + if (vp->v_type == VBAD) + error = EBADF; + else + error = ENOTDIR; + VOP_UNLOCK(vp); + goto fail; + } AUDIT_ARG_VNODE1(vp); loff = auio.uio_offset = foffset; #ifdef MAC diff --git a/tests/sys/kern/Makefile b/tests/sys/kern/Makefile index 26c0013696c7..f2c24ad9dec9 100644 --- a/tests/sys/kern/Makefile +++ b/tests/sys/kern/Makefile @@ -18,6 +18,7 @@ ATF_TESTS_C+= kern_descrip_test # One test modifies the maxfiles limit, which can cause spurious test failures. TEST_METADATA.kern_descrip_test+= is_exclusive="true" ATF_TESTS_C+= fdgrowtable_test +ATF_TESTS_C+= getdirentries_test ATF_TESTS_C+= jail_lookup_root ATF_TESTS_C+= inotify_test ATF_TESTS_C+= kill_zombie diff --git a/tests/sys/kern/getdirentries_test.c b/tests/sys/kern/getdirentries_test.c new file mode 100644 index 000000000000..e66872ffe5b6 --- /dev/null +++ b/tests/sys/kern/getdirentries_test.c @@ -0,0 +1,172 @@ +/*- + * Copyright (c) 2025 Klara, Inc. + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#include +#include + +#include +#include +#include +#include + +#include + +ATF_TC(getdirentries_ok); +ATF_TC_HEAD(getdirentries_ok, tc) +{ + atf_tc_set_md_var(tc, "descr", "Successfully read a directory."); +} +ATF_TC_BODY(getdirentries_ok, tc) +{ + char dbuf[4096]; + struct dirent *d; + off_t base; + ssize_t ret; + int dd, n; + + ATF_REQUIRE_EQ(0, mkdir("dir", 0755)); + ATF_REQUIRE((dd = open("dir", O_DIRECTORY | O_RDONLY)) >= 0); + ATF_REQUIRE((ret = getdirentries(dd, dbuf, sizeof(dbuf), &base)) > 0); + ATF_REQUIRE_EQ(0, getdirentries(dd, dbuf, sizeof(dbuf), &base)); + ATF_REQUIRE_EQ(base, lseek(dd, 0, SEEK_CUR)); + ATF_CHECK_EQ(0, close(dd)); + for (n = 0, d = (struct dirent *)dbuf; + d < (struct dirent *)(dbuf + ret); + d = (struct dirent *)((char *)d + d->d_reclen), n++) + /* nothing */ ; + ATF_CHECK_EQ((struct dirent *)(dbuf + ret), d); + ATF_CHECK_EQ(2, n); +} + +ATF_TC(getdirentries_ebadf); +ATF_TC_HEAD(getdirentries_ebadf, tc) +{ + atf_tc_set_md_var(tc, "descr", "Attempt to read a directory " + "from an invalid descriptor."); +} +ATF_TC_BODY(getdirentries_ebadf, tc) +{ + char dbuf[4096]; + off_t base; + int fd; + + ATF_REQUIRE((fd = open("file", O_CREAT | O_WRONLY, 0644)) >= 0); + ATF_REQUIRE_EQ(-1, getdirentries(fd, dbuf, sizeof(dbuf), &base)); + ATF_CHECK_EQ(EBADF, errno); + ATF_REQUIRE_EQ(0, close(fd)); + ATF_REQUIRE_EQ(-1, getdirentries(fd, dbuf, sizeof(dbuf), &base)); + ATF_CHECK_EQ(EBADF, errno); +} + +ATF_TC(getdirentries_efault); +ATF_TC_HEAD(getdirentries_efault, tc) +{ + atf_tc_set_md_var(tc, "descr", "Attempt to read a directory " + "to an invalid buffer."); +} +ATF_TC_BODY(getdirentries_efault, tc) +{ + char dbuf[4096]; + off_t base, *basep; + int dd; + + ATF_REQUIRE_EQ(0, mkdir("dir", 0755)); + ATF_REQUIRE((dd = open("dir", O_DIRECTORY | O_RDONLY)) >= 0); + ATF_REQUIRE_EQ(-1, getdirentries(dd, NULL, sizeof(dbuf), &base)); + ATF_CHECK_EQ(EFAULT, errno); + basep = NULL; + basep++; + ATF_REQUIRE_EQ(-1, getdirentries(dd, dbuf, sizeof(dbuf), basep)); + ATF_CHECK_EQ(EFAULT, errno); + ATF_CHECK_EQ(0, close(dd)); +} + +ATF_TC(getdirentries_einval); +ATF_TC_HEAD(getdirentries_einval, tc) +{ + atf_tc_set_md_var(tc, "descr", "Attempt to read a directory " + "with various invalid parameters."); +} +ATF_TC_BODY(getdirentries_einval, tc) +{ + struct statfs fsb; + char dbuf[4096]; + off_t base; + ssize_t ret; + int dd; + + ATF_REQUIRE_EQ(0, mkdir("dir", 0755)); + ATF_REQUIRE((dd = open("dir", O_DIRECTORY | O_RDONLY)) >= 0); + ATF_REQUIRE_EQ(0, fstatfs(dd, &fsb)); + /* nbytes too small */ + ATF_REQUIRE_EQ(-1, getdirentries(dd, dbuf, 8, &base)); + ATF_CHECK_EQ(EINVAL, errno); + /* nbytes too big */ + ATF_REQUIRE_EQ(-1, getdirentries(dd, dbuf, SIZE_MAX, &base)); + ATF_CHECK_EQ(EINVAL, errno); + /* invalid position */ + ATF_REQUIRE((ret = getdirentries(dd, dbuf, sizeof(dbuf), &base)) > 0); + ATF_REQUIRE_EQ(0, getdirentries(dd, dbuf, sizeof(dbuf), &base)); + ATF_REQUIRE(base > 0); + ATF_REQUIRE_EQ(base + 3, lseek(dd, 3, SEEK_CUR)); + /* known to fail on ufs (FFS2) and zfs, and work on tmpfs */ + if (strcmp(fsb.f_fstypename, "ufs") == 0 || + strcmp(fsb.f_fstypename, "zfs") == 0) { + atf_tc_expect_fail("incorrectly returns 0 instead of EINVAL " + "on %s", fsb.f_fstypename); + } + ATF_REQUIRE_EQ(-1, getdirentries(dd, dbuf, sizeof(dbuf), &base)); + ATF_CHECK_EQ(EINVAL, errno); + ATF_CHECK_EQ(0, close(dd)); +} + +ATF_TC(getdirentries_enoent); +ATF_TC_HEAD(getdirentries_enoent, tc) +{ + atf_tc_set_md_var(tc, "descr", "Attempt to read a directory " + "after it is deleted."); +} +ATF_TC_BODY(getdirentries_enoent, tc) +{ + char dbuf[4096]; + off_t base; + int dd; + + ATF_REQUIRE_EQ(0, mkdir("dir", 0755)); + ATF_REQUIRE((dd = open("dir", O_DIRECTORY | O_RDONLY)) >= 0); + ATF_REQUIRE_EQ(0, rmdir("dir")); + ATF_REQUIRE_EQ(-1, getdirentries(dd, dbuf, sizeof(dbuf), &base)); + ATF_CHECK_EQ(ENOENT, errno); +} + +ATF_TC(getdirentries_enotdir); +ATF_TC_HEAD(getdirentries_enotdir, tc) +{ + atf_tc_set_md_var(tc, "descr", "Attempt to read a directory " + "from a descriptor not associated with a directory."); +} +ATF_TC_BODY(getdirentries_enotdir, tc) +{ + char dbuf[4096]; + off_t base; + int fd; + + ATF_REQUIRE((fd = open("file", O_CREAT | O_RDWR, 0644)) >= 0); + ATF_REQUIRE_EQ(-1, getdirentries(fd, dbuf, sizeof(dbuf), &base)); + ATF_CHECK_EQ(ENOTDIR, errno); + ATF_CHECK_EQ(0, close(fd)); +} + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, getdirentries_ok); + ATF_TP_ADD_TC(tp, getdirentries_ebadf); + ATF_TP_ADD_TC(tp, getdirentries_efault); + ATF_TP_ADD_TC(tp, getdirentries_einval); + ATF_TP_ADD_TC(tp, getdirentries_enoent); + ATF_TP_ADD_TC(tp, getdirentries_enotdir); + return (atf_no_error()); +} From nobody Wed Jul 9 20:35:44 2025 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 4bcqVm73cTz60wlF; Wed, 09 Jul 2025 20:35:44 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcqVm4r7Bz3thT; Wed, 09 Jul 2025 20:35:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752093344; 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=c24DL/4EadjO99XYoUF73DHHIGYYnpE7XvykC07IYnI=; b=h7fNTm0GAv5mWY7/9hLDJk6jxg6W7ouAkwqj6klg//Hgxo6d2ivo4QYjWrcFU3kfQOSNz8 VzSRc+p3B8gpA009pBGFdaSmq4w+nl6tLk4rHy5nkNs8cMIT4iuxV/6j5J1cOZDKKBGKxW m4Set3ICowcqQrL2lQzyEkzsTCAMlQtrtU6A8NV4j7RZxS6TKE5TbjWx9BfqUVE+QsiH3q TZIPSmtU3+VM4YG1WHyPrISjaVuVkNyZUEqBRTh29uJNDcjgIyclbfExwuilnLgb0VjeHz TEPe7SNok98eFObPkCJL4LqJHBGxrKG6z6EhNLL1F3mNBv8Bks0JxoQiFafrdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752093344; 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=c24DL/4EadjO99XYoUF73DHHIGYYnpE7XvykC07IYnI=; b=nsfR7io0hvg5grzxKBZgZhOEh0bi+y4+d+JE7lSP64ClNe5GEiDG8vF9gz6YsWw0QbLc8S rVO+TkbenekLYN2hTlogu+NL7x3F/Cug9GMBJbqdU7u8RBDmJi73nJ97lwS+NXHu5EfTq3 JSx3frc8JktVwZHlwy6PCZXmr/sBcFyB/qqGwgX/pH+VgNiifOzGaj8RFm40/+N1WZDQoQ n1D1AE7DH4rwllng2M61xrXm3q+hxmer+Cw9YDysdNK/OLoxcHKWy/BxxgsDmPYy8J7ug1 h7N6RIOVmF9yUVUzZYY7fi7fzHvt1vIZqDlZXc7IGHspuZr2XuPTuMzgnhnC8w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752093344; a=rsa-sha256; cv=none; b=r9UbVjgz9ylSc7Y/X+rTZ77/dIoFW5KxJf+iGXZLjEaXUA1YuVmc0YOOL4Q9dLqeFih0Q/ w7aEeBRQsfFSOjwIpiDo0xwSkwReeoT/H0z8MaqrOxwhA1d+01RBkLHbbrDzWwxSwbRuJW TGIsaJ4RWG7pr4wGA69pPVGfbC5zT2oBvMGF11ikEF/bQGLhgXcQvacFInQH6/MgaklknO w94vEmeT8qQMp7OTblXNmqqh/OwaapV5QO1VNBeN6y7m9zZhVBLss5i2NvN1qkPj+R+338 +ZA+OQsUAq1/C9MQ8oe4ULfCU+eLIr42at93TizDPS4O91dx63+j9nOAZouniA== 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 4bcqVm4S8wzdWX; Wed, 09 Jul 2025 20:35:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 569KZiSZ065718; Wed, 9 Jul 2025 20:35:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 569KZiLY065715; Wed, 9 Jul 2025 20:35:44 GMT (envelope-from git) Date: Wed, 9 Jul 2025 20:35:44 GMT Message-Id: <202507092035.569KZiLY065715@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 42e613018da5 - main - opendir, readdir, telldir: Use the correct types. 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 42e613018da50ee6877d24815c7626d79629e707 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=42e613018da50ee6877d24815c7626d79629e707 commit 42e613018da50ee6877d24815c7626d79629e707 Author: Dag-Erling Smørgrav AuthorDate: 2025-07-09 20:34:22 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-07-09 20:34:22 +0000 opendir, readdir, telldir: Use the correct types. Use either size_t or off_t (as appropriate) instead of long. Sponsored by: Klara, Inc. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D51210 --- lib/libc/gen/gen-private.h | 4 ++-- lib/libc/gen/opendir2.c | 6 ++++-- lib/libc/gen/readdir.c | 4 ++-- lib/libc/gen/telldir.c | 4 ++-- lib/libc/gen/telldir.h | 6 +++--- 5 files changed, 13 insertions(+), 11 deletions(-) diff --git a/lib/libc/gen/gen-private.h b/lib/libc/gen/gen-private.h index 3792a61ff942..b6749b3435cd 100644 --- a/lib/libc/gen/gen-private.h +++ b/lib/libc/gen/gen-private.h @@ -43,8 +43,8 @@ struct pthread_mutex; */ struct _dirdesc { int dd_fd; /* file descriptor associated with directory */ - long dd_loc; /* offset in current buffer */ - long dd_size; /* amount of data returned by getdirentries */ + size_t dd_loc; /* offset in current buffer */ + size_t dd_size; /* amount of data returned by getdirentries */ char *dd_buf; /* data buffer */ int dd_len; /* size of data buffer */ off_t dd_seek; /* magic cookie returned by getdirentries */ diff --git a/lib/libc/gen/opendir2.c b/lib/libc/gen/opendir2.c index 7f207ed73441..c5c2e662efd8 100644 --- a/lib/libc/gen/opendir2.c +++ b/lib/libc/gen/opendir2.c @@ -264,6 +264,7 @@ DIR * __opendir_common(int fd, int flags, bool use_current_pos) { DIR *dirp; + ssize_t ret; int incr; int saved_errno; bool unionstack; @@ -313,10 +314,11 @@ __opendir_common(int fd, int flags, bool use_current_pos) * to prime dd_seek. This also checks if the * fd passed to fdopendir() is a directory. */ - dirp->dd_size = _getdirentries(dirp->dd_fd, + ret = _getdirentries(dirp->dd_fd, dirp->dd_buf, dirp->dd_len, &dirp->dd_seek); - if (dirp->dd_size < 0) + if (ret < 0) goto fail; + dirp->dd_size = (size_t)ret; dirp->dd_flags |= __DTF_SKIPREAD; } else { dirp->dd_size = 0; diff --git a/lib/libc/gen/readdir.c b/lib/libc/gen/readdir.c index 2a2fa999b7ce..32603c0b4677 100644 --- a/lib/libc/gen/readdir.c +++ b/lib/libc/gen/readdir.c @@ -48,8 +48,8 @@ struct dirent * _readdir_unlocked(DIR *dirp, int flags) { struct dirent *dp; - long initial_seek; - long initial_loc = 0; + off_t initial_seek; + size_t initial_loc = 0; for (;;) { if (dirp->dd_loc >= dirp->dd_size) { diff --git a/lib/libc/gen/telldir.c b/lib/libc/gen/telldir.c index b751fafd975f..1731cc4d7a2c 100644 --- a/lib/libc/gen/telldir.c +++ b/lib/libc/gen/telldir.c @@ -118,7 +118,7 @@ _seekdir(DIR *dirp, long loc) struct dirent *dp; union ddloc_packed ddloc; off_t loc_seek; - long loc_loc; + size_t loc_loc; ddloc.l = loc; @@ -171,7 +171,7 @@ _seekdir(DIR *dirp, long loc) * fetching a new block to fix any such telldir locations. */ void -_fixtelldir(DIR *dirp, long oldseek, long oldloc) +_fixtelldir(DIR *dirp, off_t oldseek, size_t oldloc) { struct ddloc_mem *lp; diff --git a/lib/libc/gen/telldir.h b/lib/libc/gen/telldir.h index 6d113491e819..02fd52af9060 100644 --- a/lib/libc/gen/telldir.h +++ b/lib/libc/gen/telldir.h @@ -46,9 +46,9 @@ */ struct ddloc_mem { LIST_ENTRY(ddloc_mem) loc_lqe; /* entry in list */ - long loc_index; /* key associated with structure */ + size_t loc_index; /* key associated with structure */ off_t loc_seek; /* magic cookie returned by getdirentries */ - long loc_loc; /* offset of entry in buffer */ + size_t loc_loc; /* offset of entry in buffer */ }; #ifdef __LP64__ @@ -102,7 +102,7 @@ bool _filldir(DIR *, bool); struct dirent *_readdir_unlocked(DIR *, int); void _reclaim_telldir(DIR *); void _seekdir(DIR *, long); -void _fixtelldir(DIR *dirp, long oldseek, long oldloc); +void _fixtelldir(DIR *dirp, off_t oldseek, size_t oldloc); DIR *__opendir_common(int, int, bool); #define RDU_SKIP 0x0001 From nobody Wed Jul 9 20:42:25 2025 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 4bcqfT253Wz60xGg; Wed, 09 Jul 2025 20:42:25 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcqfT1Pw6z40WF; Wed, 09 Jul 2025 20:42:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752093745; 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=/AqNPOrC0i0wdKCDyYrvq/NbQnDHaKXEipOm+eiooY8=; b=ukd5GFx60oA+RvP+EUCFBcrMXiyx4uEEO4LkhJRGK2YG+tkh5xNLviAhZOdxXykEjLInzN 8YnPDs5teQWIdFfq+DGY/B6MpdlwSB5VUbPLx21UUjP6MKatxMN3U+7a9KqtwykpYnhIRx XfccECJ+Oa/HN7uU2I2krzGcswz9DgQDGGoXHu+Xo3FXpuf5fWJNtJPDhPHPDvjQ4u1aJo vWtCTJJTi3JRiyHtdzvpmyjh2E9kwmllY6wc3McDaHt+Oka2xE1qup5VyraOfkE4VqMW0+ D7VTUtYyCpo8PA+xCYzwxs+l8GTkALqO0/tT6z2e3Rm2PpIJOZDU9P6rt3/PbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752093745; 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=/AqNPOrC0i0wdKCDyYrvq/NbQnDHaKXEipOm+eiooY8=; b=b84pw0g+ls0AS6qNFvM5XNbZVYGxuVPaluSYvmFdu9mJPz5lJE9jPXEX33ZdPme1NF5EtD xS3iNGcblecZFGv3XO4ZBwrApWQ8YLnqKytTgkijb5Lg03LSPlOLqpaDfHktdi+q9IYiND JIN0a/XO1DP0J0DaRetZiSsWLy1tR3mSnjXECO/c8QvmBRQ+bC73dquZnfG05zYbVtEW5N KIYozz56YcLEbNfBTjXJEQW0kFVp/PwPSbza+6ZhQiv3qBqVLPEMLEdSCZkr/YcWVCA9oF M2o+ljUNHoxJYyAONdKPK7gXY+ppJc0cG2lxxzzVQQLoxr8ItNmJxeI2hdDB8A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752093745; a=rsa-sha256; cv=none; b=iI/v9fPu7n7vfV4iYyBmqVdZuoFigjc2LIyDEWCrF/v9ImN+rYd4/hWe01K9iyDhLZj4kM slAdcT9P3z46lr7x2zLUM7+S+vttAqSeRBueyoLIV3b04EfF/AiAlKLFFvAZvOzLgS4qb/ Pt+KusUKiBqfBPnkvqPtwrxEmjCqVpwIIksdKPcnU+oEniUdNnwPFcFTZsmU1iSIwhRDpq TnaedkfgsiMo6mnGhe73o+tSiZS9Ww4IgHGV8EWzlCKqE2VnBkTHYcsVJGu7wd61ojUcCj XbLvsOYeenFdkhHpuII1ff4RmvtFVEinUiVc9ISkXkRESdO5R495sLRvm01+XQ== 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 4bcqfT0pfBzfDp; Wed, 09 Jul 2025 20:42:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 569KgPCq083188; Wed, 9 Jul 2025 20:42:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 569KgPZH083185; Wed, 9 Jul 2025 20:42:25 GMT (envelope-from git) Date: Wed, 9 Jul 2025 20:42:25 GMT Message-Id: <202507092042.569KgPZH083185@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 4982db387fc8 - main - pfctl: Fix 32-bit build. 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4982db387fc85a13f1da39462fe1b83bec0c1248 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=4982db387fc85a13f1da39462fe1b83bec0c1248 commit 4982db387fc85a13f1da39462fe1b83bec0c1248 Author: Dag-Erling Smørgrav AuthorDate: 2025-07-09 20:42:10 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-07-09 20:42:10 +0000 pfctl: Fix 32-bit build. Fixes: 19973701098c8 Reviewed by: kp Differential Revision: https://reviews.freebsd.org/D51230 --- sbin/pfctl/pfctl_parser.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sbin/pfctl/pfctl_parser.c b/sbin/pfctl/pfctl_parser.c index 29d51214e2e5..bd2c10c8080f 100644 --- a/sbin/pfctl/pfctl_parser.c +++ b/sbin/pfctl/pfctl_parser.c @@ -368,8 +368,8 @@ print_ugid(u_int8_t op, id_t i1, id_t i2, const char *t) { char a1[11], a2[11]; - snprintf(a1, sizeof(a1), "%lu", i1); - snprintf(a2, sizeof(a2), "%lu", i2); + snprintf(a1, sizeof(a1), "%ju", (uintmax_t)i1); + snprintf(a2, sizeof(a2), "%ju", (uintmax_t)i2); printf(" %s", t); if (i1 == -1 && (op == PF_OP_EQ || op == PF_OP_NE)) print_op(op, "unknown", a2); From nobody Wed Jul 9 22:58:51 2025 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 4bctgw2Jwcz6163D; Wed, 09 Jul 2025 22:58:52 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bctgv3Hz5z4PYZ; Wed, 09 Jul 2025 22:58:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752101931; 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=f7FXttJSlaDqu7KI7kcnBDSG6VKcTgrnT6/vrXqrFhY=; b=BZKSVKK+gRIiQgg72a+7kfT5EzEPSnXUC5HySXlcncupSU6ThRr54f93AsgNKIOpMpxOpN ngqPxsloDJO1GDPKrIkksepu1wjZf7M9YI5eZTRXY55fL72q4wm3X9jdRpKnYQgoLrO+6k Xmprd2OBciwu8CMbeqQy0CSgrRU3UwGX161OV3zj3n5qSqYtV2w+bR/856PPLGuQxpFys0 QTZg1LPUXXtcwFL1JDqpuOyqh4Z4BCV+6/MEzaLx/aeNGn12n/WLJ9shXEPALLB5t8WMZ3 L9Kp1WmzVyUQKEUPQmHhsfhDyaeR+vrbg+q226J3ptWm7Z0ACa+ViWArGJ9oaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752101931; 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=f7FXttJSlaDqu7KI7kcnBDSG6VKcTgrnT6/vrXqrFhY=; b=ecmm617w8Fw/JgPUSuUnpeusKskfYREeiGJbV4gn8yE1YAGRozXX2WwW9bhxRVOaV617pt 5rTmOUwPziX41Py/VxzfgX4cDP6vWGFfAt4R6iAst91T9/eZLU8CGqtbwHTJ1kitr0A8js lLq9xrFv/hUVXDX7XchMsXHAYG5BAaKQKjOp7VdKIOoMUcC4nS5luhsTaQT/whjV+aV0CC V7aM3XzUSBUy6U+bvMyDTpWJFYJJchrOJJDnp2+OON5t6UPIeL1Y2abRBLBIiCedfR04mb oSQzELl8qUAyq1LN11c1jmoq1gXJsc+1S6Ve/m+FEaXUlzdJ4cm80sfppOAeyg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752101931; a=rsa-sha256; cv=none; b=AMsXVQthiSiwi6nxUW5H8Wve8kvnPNK9qSb9/JeTDcNWtTGU2SdWGHxvm3P0x7I5qvkJML vRljlICNhQEoxdYQPrC3nSdctRaynqVIjZr6GFL1W0UQ7T8J6xJ5/nG94xHoA3hv4HkgBR eDWoU8iMCAPV8iHapOlFyPIP0J9Mmh8p9wbf2pOZZCK4P2Xd3Am0BchqKSmkh+paShPga7 rO1eH4dC9upe4ivRbhbKKm9QjCc+Xt9tPK97CAzcnoEaXV4KevXEV4UXKkLvcEt25RKrv2 NWRsMdgJqYbiD7JOXAqB9XwBg+kxmL0H/nVjn6gFP46ObmaxGqvsbTHSqlnymw== 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 4bctgv2VWhzjLB; Wed, 09 Jul 2025 22:58:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 569MwpAj031082; Wed, 9 Jul 2025 22:58:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 569Mwp51031079; Wed, 9 Jul 2025 22:58:51 GMT (envelope-from git) Date: Wed, 9 Jul 2025 22:58:51 GMT Message-Id: <202507092258.569Mwp51031079@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: c130914d2923 - main - named_attribute.7: Document the named attribute mechanism 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c130914d2923db4a31e83abd054a6a455d3226b3 Auto-Submitted: auto-generated The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=c130914d2923db4a31e83abd054a6a455d3226b3 commit c130914d2923db4a31e83abd054a6a455d3226b3 Author: Rick Macklem AuthorDate: 2025-07-09 22:55:52 +0000 Commit: Rick Macklem CommitDate: 2025-07-09 22:55:52 +0000 named_attribute.7: Document the named attribute mechanism The named attribute interface is an alternate way to manipulate extended attributes, based on the interface provided by Solaris. This man page documents this interface. Reviewed by: kib, ziaee (manpages), pauamma_gundo.com Differential Revision: https://reviews.freebsd.org/D49851 Fixes: 2ec2ba7e232d ("vfs: Add VFS/syscall support for Solaris style extended attributes") --- share/man/man7/Makefile | 1 + share/man/man7/named_attribute.7 | 275 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 276 insertions(+) diff --git a/share/man/man7/Makefile b/share/man/man7/Makefile index 021bf9251bda..7daa0ffed8ea 100644 --- a/share/man/man7/Makefile +++ b/share/man/man7/Makefile @@ -17,6 +17,7 @@ MAN= arch.7 \ intro.7 \ maclabel.7 \ mitigations.7 \ + named_attribute.7 \ operator.7 \ orders.7 \ ports.7 \ diff --git a/share/man/man7/named_attribute.7 b/share/man/man7/named_attribute.7 new file mode 100644 index 000000000000..0c15d8ee91b8 --- /dev/null +++ b/share/man/man7/named_attribute.7 @@ -0,0 +1,275 @@ +.\" +.\" Copyright (c) 2025 Rick Macklem +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.Dd July 3, 2025 +.Dt NAMED_ATTRIBUTE 7 +.Os +.Sh NAME +.Nm named_attribute +.Nd Solaris-like extended attribute system interface +.Sh DESCRIPTION +Description of the system interface for named attributes +(the NFS Version 4 terminology). +.Ss Introduction +This document describes an alternate system interface for extended +attributes as compared to +.Xr extattr 2 . +It is based on the interface provided by Solaris and NFS Version 4. +.Pp +This interface associates a directory, known as a named attribute directory, +to a file system object. +This directory is read in the same manner as a normal directory via the +.Xr getdents 2 +or +.Xr getdirentries 2 +system calls. +The +.Pa .\& +and +.Pa ..\& +entries refer to the directory itself and to the associated file object, +respectively. +The other entries in this directory +are the names of the extended attributes for the associated file object +and are referred to as named attributes. +These named attributes are regular files used to store the attribute's +value. +.Pp +A named attribute directory does not live in the file system's name space. +It is accessed via an +.Xr open 2 +or +.Xr openat 2 +system call done on a file to query the named attributes for the file, +with the +.Dv O_NAMEDATTR +flag specified and a +.Fa path +argument of +.Pa .\& . +This file descriptor can be used as the +.Fa fd +argument for a variety of system calls, such as: +.Xr fchdir 2 , +.Xr unlinkat 2 +and +.Xr renameat 2 . +.Xr renameat 2 +is only permitted to rename a named attribute within the same named +attribute directory. +.Pp +When a file descriptor for a file object in the file system's namespace +is used as the +.Fa fd +argument of an +.Xr openat 2 +along with the +.Fa flag +.Dv O_NAMEDATTR +and a +.Fa path +argument that is the name of a named attribute (not +.Pa .\& +or +.Pa ..\& +), a file descriptor for the named attribute is returned. +If the +.Fa flag +.Dv O_CREAT +is specified, the named attribute will be created if it does not exist. +The +.Fa path +argument must be a single component name, with no embedded +.Dq / +in it. +I/O on these named attribute file descriptors may be performed by +standard I/O system calls +such as: +.Xr read 2 , +.Xr write 2 , +.Xr lseek 2 +and +.Xr ftruncate 2 . +.Pp +The +.Dv _PC_NAMEDATTR_ENABLED +.Fa name +argument to +.Xr pathconf 2 +will return 1 if the file system supports named attributes. +The +.Dv _PC_HAS_NAMEDATTR +.Fa name +argument to +.Xr pathconf 2 +will return 1 if there are one or more named attributes for the file. +If an application does a +.Xr openat 2 +of +.Dq .\& +to open a named attribute directory when no named attribute directory exists, +an empty named attribute directory will be created. +Testing +.Dv _PC_HAS_NAMEDATTR +can be done to avoid creating these named attribute directories unnecessarily. +.Pp +The named attribute interface is a different mechanism/system call interface for +manipulating extended attributes compared with +.Xr extattr 2 . +Although the named attribute machanism might require different internal +implementation +of extended attributes within a file system, both ZFS and NFSv4 provide +both mechanisms, which can be used interchangably to manipulate +extended attributes, but with a couple of limitations. +.Bl -bullet +.It +The +.Xr extattr 2 +interface requires that an extended attribute's value be set or acquired +via a single system call using a single buffer. +This limits the size of the attribute's value. +.It +The named attribute interface does not support system namespace +extended attributes and, +as such, system namespace extended attributes must be manipulated via +.Xr extattr 2 . +.El +.Pp +The named attribute mechanism/system call interface provides certain +advantages over +.Xr extattr 2 . +Since the attribute's value is updated via +.Xr read 2 +and +.Xr write 2 +system calls, the attribute's data may be as large as any regular file +and may be partially updated. +(Note that this interface does not provide the atomicity guarantee that +.Xr extattr 2 +does.) +The permission to access a named attribute directory is determined from +the access control information for the associated file object. +However, access control information can be set on each individual attribute +in a manner similar to a regular file. +This provides +.Dq per attribute +granular control over attribute permissions via +.Xr fchown 2 . +.Pp +At this time, the only local file system which supports this interface +is ZFS and only if the +.Dv xattr +property is set to +.Dq dir . +(Note that, even when +.Dq zfs get xattr +shows +.Dq on +the command +.Dq zfs set xattr=dir +must be done, followed by a remount to make the setting take effect.) +A NFSv4 mount will also support this interface, but only if the NFSv4 +server file system supports named attributes (the openattr operation). +The +.Fx +NFSv4 server supports named attributes only +for ZFS exported file systems where the +.Dq xattr +property is set to +.Dq dir +for the file system. +.Sh EXAMPLES +.Bd -literal +#include +#include +#include +#include + +\&... + +/* For a file called "myfile". Failure checks removed for brevity. */ +int file_fd, nameddir_fd, namedattr_fd; +ssize_t siz; +char buf[DIRBLKSIZ], *cp; +struct dirent *dp; +long named_enabled, has_named_attrs; + +\&... +/* Check to see if named attributes are supported. */ +named_enabled = pathconf("myfile", _PC_NAMEDATTR_ENABLED); +if (named_enabled <= 0) + err(1, "Named attributes not enabled"); +/* Test to see if named attribute(s) exist for the file. */ +has_named_attrs = pathconf("myfile", _PC_HAS_NAMEDATTR); +if (has_named_attrs == 1) + printf("myfile has named attribute(s)\\n"); +else + printf("myfile does not have any named attributes\\n"); +/* Open a named attribute directory. */ +file_fd = open("myfile", O_RDONLY, 0); +nameddir_fd = openat(file_fd, ".", O_NAMEDATTR, 0); +\&... +/* and read it, assuming it all fits in DIRBLKSIZ for simplicity. */ +siz = getdents(fd, buf, sizeof(buf)); +cp = buf; +while (cp < &buf[siz]) { + dp = (struct dirent *)cp; + printf("name=%s\\n", dp->d_name); + cp += dp->d_reclen; +} +\&... +/* Open/create a named attribute called "foo". */ +namedattr_fd = openat(file_fd, "foo", O_CREAT | O_RDWR | + O_TRUNC | O_NAMEDATTR, 0600); +\&... +/* Write foo's attribute value. */ +write(namedattr_fd, "xxxyyy", 6); +\&... +/* Read foo's attribute value. */ +lseek(namedattr_fd, 0, SEEK_SET); +siz = read(namedattr_fd, buf, sizeof(buf)); +\&... +/* And close "foo". */ +close(namedattr_fd); +\&... +/* Rename "foo" to "oldfoo". */ +renameat(nameddir_fd, "foo", nameddir_fd, "oldfoo"); +/* and delete "oldfoo". */ +unlinkat(nameddir_fd, "oldfoo", AT_RESOLVE_BENEATH); +.Ed +.Pp +The +.Xr runat 1 +command may be used to perform shell commands on named attributes. +For example: +.Bd -literal +$ runat myfile cp /etc/hosts attrhosts # creates attrhosts +$ runat myfile cat attrhosts # displays contents of attrhosts +$ runat myfile ls -l # lists the attributes for myfile +.Ed +.Pp +If using the +.Xr bash 1 +shell, the command +.Dq cd -@ foo +enters the named attribute directory for the file object +.Dq foo . +.Sh SEE ALSO +.Xr bash 1 , +.Xr runat 1 , +.Xr chdir 2 , +.Xr extattr 2 , +.Xr lseek 2 , +.Xr open 2 , +.Xr pathconf 2 , +.Xr read 2 , +.Xr rename 2 , +.Xr truncate 2 , +.Xr unlinkat 2 , +.Xr write 2 , +.Xr zfsprops 7 +.Sh HISTORY +This interface first appeared in +.Fx 15.0 . From nobody Wed Jul 9 23:21:47 2025 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 4bcvBM61T0z617T0; Wed, 09 Jul 2025 23:21:47 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bcvBM59BNz3SVy; Wed, 09 Jul 2025 23:21:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752103307; 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=Sd+L8NQYqbGI28hTxXtyIq/2KNeu/9UY9Nvah47OaAs=; b=gGs2qs1c5ZNL/F779yhkgQefo9ra6KFhcEsZ4trDaKKUXtjjIKBluM0lFs5WaUzGCgSVwr 95/aXEJHfltR4e7lnjnwUD5ePKgxcTeV00ot05m73aEdq34UsNlU9kwbtCDEhSGTWo0eax hLguaxZ0Q15c8PyavyMvkgm0G/MDDiQwAJSMd/uFHk7rZgM3m1siqGGmgCjxT9fGrf0Bft +tRR1pFvEvKOru5ucVquwi3aU2rRPzCKUdCJLkxU9X0AywE7jxPttyYW/GLtKYT1XGIWkI X2xiL9PNy6S/Q5T9qAJMzV1WOhQOlG1ZGauXW6lBFPjHVRy/XUh02DwaRwNdrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752103307; 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=Sd+L8NQYqbGI28hTxXtyIq/2KNeu/9UY9Nvah47OaAs=; b=M9BJMqDjSC6FhVe8OmUjxm6V3IcldL4lG+Z35SANQi6hBZlPTuR0UpQZCs9uPG/O7ONWK9 glrJuLlzbfHmOaOtLTWJOhD5M4sgJjFZvwxz2W0BVYxEb/fKYrpGlKuq5bdbUtoPsRhAt1 ojnN6/1fMwPGvD2l+LMuuPy5cvP12miQbcq79AHWbdCzeyLWRVohIyidXD24L6GA3ev2PM 2G+mRj4KMvSxdf7CgD3/Nr9D2hyxW4p7XPmYLdH4CUkCsGEL6+pGWAd1UHYN492ucf5xfS SNjGz2QI9Q2lHSYMkp22s5IwQed4OXad8xkXZPw6dDO6tI7LU3/prsBmf/KDEg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752103307; a=rsa-sha256; cv=none; b=FgpU7RAPXfYw4VkOq3wPilMNVQVCGtVUCM335G1UCfgT2azXN6sSBPzjBG5GcC/iKncopx GOnua+oIk5iweDVjL/7ESEb9HzPxZ22yyfHQEpuFZ5qYqRBG5meHX5d7ZQcyF5ElQTJMce ezA7hn3OgseC4pENT75uAq8wkilTfNYb3Vo2s+JbHFV5J3iM5eFoMkyIebO6d65PpMg4jg fT8bTaxN15ka1tx7HJe0SpiuyVeI+NtxwOSyXNx4oTgc6v+kNe+SPc07VGx0i+86SjL8iA WfuKzrOBFq38aOvNLQe4ni15fV9t94onsbhYwYXG6HwEyeJRL9fGBqM/4+E7fw== 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 4bcvBM4Zn7zk7G; Wed, 09 Jul 2025 23:21:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 569NLlWi085627; Wed, 9 Jul 2025 23:21:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 569NLltF085610; Wed, 9 Jul 2025 23:21:47 GMT (envelope-from git) Date: Wed, 9 Jul 2025 23:21:47 GMT Message-Id: <202507092321.569NLltF085610@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Maxim Konovalov Subject: git: 78935fa40eee - main - named_attribute.7: typo fix 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: maxim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 78935fa40eee14aab1c6de676a1017bcabdf5fa1 Auto-Submitted: auto-generated The branch main has been updated by maxim: URL: https://cgit.FreeBSD.org/src/commit/?id=78935fa40eee14aab1c6de676a1017bcabdf5fa1 commit 78935fa40eee14aab1c6de676a1017bcabdf5fa1 Author: Maxim Konovalov AuthorDate: 2025-07-09 23:21:03 +0000 Commit: Maxim Konovalov CommitDate: 2025-07-09 23:21:03 +0000 named_attribute.7: typo fix --- share/man/man7/named_attribute.7 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man7/named_attribute.7 b/share/man/man7/named_attribute.7 index 0c15d8ee91b8..7cd778620357 100644 --- a/share/man/man7/named_attribute.7 +++ b/share/man/man7/named_attribute.7 @@ -121,7 +121,7 @@ manipulating extended attributes compared with Although the named attribute machanism might require different internal implementation of extended attributes within a file system, both ZFS and NFSv4 provide -both mechanisms, which can be used interchangably to manipulate +both mechanisms, which can be used interchangeably to manipulate extended attributes, but with a couple of limitations. .Bl -bullet .It From nobody Thu Jul 10 08:17:43 2025 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 4bd74l74bKz61j32; Thu, 10 Jul 2025 08:17:43 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bd74l5NsGz3rwf; Thu, 10 Jul 2025 08:17:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752135463; 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=FMUmGhNOLHdkipVKt8mGrnNmL7mnzDFYfkZoO2wqDCA=; b=sGi2wIAEib8nKvbVsZJ3UtOXhSLcTunImlcnOi0kot6X84OJBbqcNpKrxwVey8De9Rdo9t 27wD8dBMONx6I9cf83EU4qNxhUQL620jVhV7Xz2bzaDAsbRzJjizMyEGID1s05PMS6fqBa SAxjl8jkIsa2TXNcQFb6qrrRzfl6jNfU49M08+6qEHXoDalqUUr1etd7xblhZzqXGIhn2H esXyJgUMKsuFnSi3tg6nIl0Yg/zkbW8FcnzSDtu2wCCpacbWDD8wqD5UtEN7NCbcbw/wjs MBoFa9KoE6q+ZpJQCKOonISd8CJYA+0FvdDhOa4wJGHwDWqqCx0oRlFBX2aFaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752135463; 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=FMUmGhNOLHdkipVKt8mGrnNmL7mnzDFYfkZoO2wqDCA=; b=MeGEJtJi/cprHFH/QUYTKAjeB2a0IwcQp3aZ4Na+gdRjmwRQLgKAMVEoi1s4fC0ELqkDUl FXV952KYxHwKonr86XUmJsPswc3JMWKOkpT0A1NUpEnFTZCNZxH4G3EFsUhJzrsn5Qlp/N QcMFwhJ800HBDpPsp4pJHJm12d9eeirZwiYy0PMVCt2KUYL6EiKl2ETcZvt6ZLz33H2vWr 1Qsq4YOAlIOZQkNL9iOpkbAl38qEdjq6iQe70+3Fkn18YWO4zemDESvw6QRZTGj7Bp5FEE cUWmmWKJ8jvmkBezuttG5MRKhwcOh8KNAJeRujhz9waYPPyE1uunCRxxLBysfA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752135463; a=rsa-sha256; cv=none; b=HVnwEHqmEilw0H0IwYw2+3uRH6KndAZYuGDHtofBpPeMMWx3Oomf1/MAjmFleNf4TR9QyR 6VoH3ykLasAujr2HBfn+IZHqeuyD8vMOyleGtWN/jC3s096Q5vO4WLjHqhO1D0euH05kuE z+lmp0zdBj8SehJ/fe+/gxx/3bhsXKwEuPMP50uvNnEv19Vm1x05qLQDSYpyQubjnV1JgG aqlflj0febyv9tmRN3VEvnjugazBUraMEjue7MI8TxsWPborB1ayU0jFWZIo4HJszKzzUK N2ATdBy/5exq6D6CyOCQT0V3icfkF6bAkxlllePam0HjubLDTAJbiuxmIFMZaA== 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 4bd74l4rQjzyj7; Thu, 10 Jul 2025 08:17:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56A8HhEo083909; Thu, 10 Jul 2025 08:17:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56A8HhkK083906; Thu, 10 Jul 2025 08:17:43 GMT (envelope-from git) Date: Thu, 10 Jul 2025 08:17:43 GMT Message-Id: <202507100817.56A8HhkK083906@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Doug Moore Subject: git: 8adb3acb63ee - main - pctrie: leave iter at root after ge_lookup failure 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dougm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8adb3acb63ee8e7c20c3da497a9640c481bc7612 Auto-Submitted: auto-generated The branch main has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=8adb3acb63ee8e7c20c3da497a9640c481bc7612 commit 8adb3acb63ee8e7c20c3da497a9640c481bc7612 Author: Doug Moore AuthorDate: 2025-07-10 08:14:07 +0000 Commit: Doug Moore CommitDate: 2025-07-10 08:14:07 +0000 pctrie: leave iter at root after ge_lookup failure If pctrie_lookup_iter_ge fails to return a node, the iterator is left with NULL as the current node. Instead, make the pctrie_root the current node when the pctrie has an internalnode. Do the same thing for lookup_iter_le. If an iterator is reused after a ge/le lookup fails, this will skip the step in _pctrie_lookup_node where a NULL is replaced by the node at the top of the trie. Reviewed by: alc Differential Revision: https://reviews.freebsd.org/D51232 --- sys/kern/subr_pctrie.c | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/sys/kern/subr_pctrie.c b/sys/kern/subr_pctrie.c index 3a3548bad52b..bb86c779b936 100644 --- a/sys/kern/subr_pctrie.c +++ b/sys/kern/subr_pctrie.c @@ -691,21 +691,23 @@ _pctrie_lookup_ge(struct pctrie *ptree, struct pctrie_node *node, */ if (node == PCTRIE_NULL || *pctrie_toval(node) < index) { /* Climb the path to find a node with a descendant > index. */ - for (node = parent; node != NULL; node = pctrie_parent(node)) { - slot = pctrie_slot(node, index) + 1; - if ((node->pn_popmap >> slot) != 0) + node = NULL; + while (parent != NULL) { + slot = pctrie_slot(parent, index) + 1; + if ((parent->pn_popmap >> slot) != 0) break; + node = parent; + parent = pctrie_parent(node); } - if (node == NULL) { + if (parent == NULL) { if (parent_out != NULL) - *parent_out = NULL; + *parent_out = node; return (NULL); } /* Step to the least child with a descendant > index. */ - slot += ffs(node->pn_popmap >> slot) - 1; - parent = node; - node = pctrie_node_load(&node->pn_child[slot], NULL, + slot += ffs(parent->pn_popmap >> slot) - 1; + node = pctrie_node_load(&parent->pn_child[slot], NULL, PCTRIE_LOCKED); } /* Descend to the least leaf of the subtrie. */ @@ -785,21 +787,23 @@ _pctrie_lookup_le(struct pctrie *ptree, struct pctrie_node *node, */ if (node == PCTRIE_NULL || *pctrie_toval(node) > index) { /* Climb the path to find a node with a descendant < index. */ - for (node = parent; node != NULL; node = pctrie_parent(node)) { - slot = pctrie_slot(node, index); - if ((node->pn_popmap & ((1 << slot) - 1)) != 0) + node = NULL; + while (parent != NULL) { + slot = pctrie_slot(parent, index); + if ((parent->pn_popmap & ((1 << slot) - 1)) != 0) break; + node = parent; + parent = pctrie_parent(node); } - if (node == NULL) { + if (parent == NULL) { if (parent_out != NULL) - *parent_out = NULL; + *parent_out = node; return (NULL); } /* Step to the greatest child with a descendant < index. */ - slot = ilog2(node->pn_popmap & ((1 << slot) - 1)); - parent = node; - node = pctrie_node_load(&node->pn_child[slot], NULL, + slot = ilog2(parent->pn_popmap & ((1 << slot) - 1)); + node = pctrie_node_load(&parent->pn_child[slot], NULL, PCTRIE_LOCKED); } /* Descend to the greatest leaf of the subtrie. */ From nobody Thu Jul 10 12:27:36 2025 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 4bdDd62t0Lz610Qr; Thu, 10 Jul 2025 12:27:38 +0000 (UTC) (envelope-from des@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdDd622ZHz3Qj2; Thu, 10 Jul 2025 12:27:38 +0000 (UTC) (envelope-from des@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752150458; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yMRVUrLADzAa168uFTk5QuYr+zdTM2bolCIvpYYN5ys=; b=GCxI2g7h/LxHKKWcnaXoh9Mb4NQ0xdB0kIUldE4xCrpWZOLzSpZrUCq4v/QhsmwyBEiULS bw0jt5g2gzRcy3fbmi08y8S1LNfwhk+7sGB6DW8bGbOV+VaNduo9dKI+kep2xnrtwf2ZA1 XgyXFxQxvlbZQte0HHpe/A9FdEBqz7qobrVZRDufVFM73GsULnbTaLLQzj0fPIRB3+vGhr iRv8zO74LSX6PQJhz/qOXhlDNC/yXdHCmXwkzp9t5Xtz8xCTmlvRyYhR8GF5IOXgh2ztE8 3gkVmQhiWVC3DkaBhVhRVej1aer3WV9Tp7rOj71Xbffh7G718BWwF3wU5zGYkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752150458; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yMRVUrLADzAa168uFTk5QuYr+zdTM2bolCIvpYYN5ys=; b=b+3PeVPuPmqhMdHY3W1cya6nZe0+fwHKgsffezR55h9V+12QddjS4pEz7v9FcjZlXN+fhv Ljn7pkeF4ZCzgrotpTmZ8EWN5NRPJAdxG7LnUgTOprYAvfDEJ50vrPG4/T1egtgYi0ck2v 2Qrhs44rUkCIq0MJOBWG8kbiFp4SCpF6SX4vxjNgKCcuh+kUX/B7W1ww4138rig/fXBjea xO2M+NbRqcqu/vTGzPgP9biXl7nvFmp1ZYT6iC7yc/Kw1f/4Np4TXSih03jfJNQmklh8qb GO1/mJbMXoM7GV5xvKfOM9BbrI97UiuUeI0wxImec1Fi2gEAEe50XPU7U/GZfA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752150458; a=rsa-sha256; cv=none; b=BYrYxDPlVGh+js08SOzvrgy8AnrI6UYSYoUgVM5xMHaB2ZHjqm3mLQu2AE3hQ3gnxEqMMf L88UPxSKt2yncBifRGapFfcR8oEORqnYvspr9gsmxgyFgJbbtJxfTZj6w9PqBBDd6ALgLj xWf+3z73O5P+IaelqyKSO2aQew9PIRzXP5WahZd+clqk9/wH062+nph+3oGsZQoZa+X2b3 KSg8hDnYV+xhQI1z3skkWVfAEBSvIAaRO7ADJiOE5E0b5RT5ONcBr5otD8t6b4PwvpcMTF jLtTnTDKFy77M4Fgxlh0zdU3IBRs4EANZb0tl6Sedj96/5BiBwHI+x6Zw4BYRA== Received: from ltc.des.dev (unknown [IPv6:2a01:e0a:c54:bed0:922e:16ff:fef1:acef]) (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) (Authenticated sender: des) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bdDd614Zrzltj; Thu, 10 Jul 2025 12:27:38 +0000 (UTC) (envelope-from des@freebsd.org) Received: by ltc.des.dev (Postfix, from userid 1001) id DE295704AA; Thu, 10 Jul 2025 14:27:36 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Rick Macklem Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: c5d72d29fe0e - main - nfsv4: Add support for the NFSv4 hidden and system attributes In-Reply-To: <202507062254.566MsbnL090918@gitrepo.freebsd.org> (Rick Macklem's message of "Sun, 6 Jul 2025 22:54:37 GMT") References: <202507062254.566MsbnL090918@gitrepo.freebsd.org> User-Agent: Gnus/5.13 (Gnus v5.13) Date: Thu, 10 Jul 2025 14:27:36 +0200 Message-ID: <867c0gcjt3.fsf@ltc.des.dev> 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Rick Macklem writes: > diff --git a/sys/fs/nfsclient/nfs_clvnops.c b/sys/fs/nfsclient/nfs_clvnop= s.c > index 0049d7edca33..fbfcdafaa06b 100644 > --- a/sys/fs/nfsclient/nfs_clvnops.c > +++ b/sys/fs/nfsclient/nfs_clvnops.c > [...] > @@ -1092,7 +1100,8 @@ nfs_setattr(struct vop_setattr_args *ap) > vap->va_gid !=3D (gid_t)VNOVAL || vap->va_atime.tv_sec !=3D VNOVAL = || > vap->va_mtime.tv_sec !=3D VNOVAL || > vap->va_birthtime.tv_sec !=3D VNOVAL || > - vap->va_mode !=3D (mode_t)VNOVAL) && > + vap->va_mode !=3D (mode_t)VNOVAL || > + vap->va_flags !=3D (u_long)VNOVAL) && > (vp->v_mount->mnt_flag & MNT_RDONLY)) > return (EROFS); > if (vap->va_size !=3D VNOVAL) { vap->va_flags was already checked (in the line just before the first line of context), albeit without a cast. Coverity erroneously claims that this causes the entire expression to always be true, because it thinks VNOVAL and (u_long)VNOVAL are two different values. That's not the case, but you probably still want this: diff --git a/sys/fs/nfsclient/nfs_clvnops.c b/sys/fs/nfsclient/nfs_clvnops.c index fbfcdafaa06b..fa451887e73e 100644 --- a/sys/fs/nfsclient/nfs_clvnops.c +++ b/sys/fs/nfsclient/nfs_clvnops.c @@ -1096,12 +1096,11 @@ nfs_setattr(struct vop_setattr_args *ap) /* * Disallow write attempts if the filesystem is mounted read-only. */ - if ((vap->va_flags !=3D VNOVAL || vap->va_uid !=3D (uid_t)VNOVAL || + if ((vap->va_flags !=3D (u_long)VNOVAL || vap->va_uid !=3D (uid_t)VNOVAL = || vap->va_gid !=3D (gid_t)VNOVAL || vap->va_atime.tv_sec !=3D VNOVAL || vap->va_mtime.tv_sec !=3D VNOVAL || vap->va_birthtime.tv_sec !=3D VNOVAL || - vap->va_mode !=3D (mode_t)VNOVAL || - vap->va_flags !=3D (u_long)VNOVAL) && + vap->va_mode !=3D (mode_t)VNOVAL) && (vp->v_mount->mnt_flag & MNT_RDONLY)) return (EROFS); if (vap->va_size !=3D VNOVAL) { DES --=20 Dag-Erling Sm=C3=B8rgrav - des@FreeBSD.org From nobody Thu Jul 10 12:53:31 2025 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 4bdFC01QJ2z611XC; Thu, 10 Jul 2025 12:53:32 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdFC003bQz3YnL; Thu, 10 Jul 2025 12:53:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752152012; 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=UzUG6imTCmBao230YGx4kJWgLaipQBiz4+EOaQ7YOsk=; b=Rkqp8H9E8f2BCo+zCH3oOT8Lkjq0iF9n/zS6bABb28KdXI/U5Riu1K2a6eXVMtDC7DDaWe 2RFvGw6C9tREbZMe6oHAM17kVKkSDFTHajfoIWJGvxfMahEibAuXGMLI15lVHRM/RiIuMl 5rT+GFLGa+ByE0bDRLvxZ4OagiyC8PqM1Bd5tjXjykpBwMpS/nhjbeHntMS2MQQ899JFb/ Uk2vYtz9/yI/4zIblHwQrTbgEo+btE2mOkBnCKw71nvy4r1etBY4YAZGP+bsgiCfFMA5fY JJS/8wWgRlTN78FvT5fDVCRPb0KCkR2UeBIwnSX2F19mDWoQQMIjwt4Dt0Sz+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752152012; 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=UzUG6imTCmBao230YGx4kJWgLaipQBiz4+EOaQ7YOsk=; b=YQMgk6kU1dvNhKR8XSZG389uQPms6a6F95uRB7k6jdqYQSj/dEqGSc5L38EM8qbjDQLdp+ DDVvUrJQ18Yw71MZVXN9YhmC82o3R3SjemxvjOfHTGJorURPRcoEx6krzAx7ptvljesCFJ hht/kbJy8vwzFVnNN1esOzUEYoOPI2wxy388QXiCxdYAS887SVTq4KaKyRj2PwLSfIe1Mf kaS6pukY1zjB3eKU0UB4vkIw2yZvWWnF0+OvJIJsj8GAnm56/ICIIZ63rfp5nT7KJELolR sgiFJXE+2zx7aP1bZjIA/AzXVaIXPi957JdN71702+QkqRP1PikdKv78ZN8Xtg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752152012; a=rsa-sha256; cv=none; b=QGmMxw+CuZbkJHFmFrB2eCwC8c9/Kcbkv/p7TEHqU3HbbT7kr9ZloI7oKNPPCSEhE3Pxt+ Kve6ifrI5063wrF0yGws9A8AIwCvFkIpfYiJyEiOCCJplGq9ovNIE+CPBInWY8msEtg5eg 8908QpCniNj0zrQcST4UXrV/8j0tE+Gmo0duqsPXGldpuGlpCWK54Ci6cIcGahgXgpQPbb OxU5/hkK1uvYsO04XQRb+C0b5qvFJBcBYjYEfuqzQQsfn7MFSFKApZ2RCMLPNx6qtXnwar tCdNNAQi5Y+zNTLPMOHcLHqUQ8gi6KFoDDui/pIxfA0P2tsiUIcu2n2AgX+v7Q== 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 4bdFBz6j8Rz17fx; Thu, 10 Jul 2025 12:53:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56ACrVZ3007470; Thu, 10 Jul 2025 12:53:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56ACrVrQ007467; Thu, 10 Jul 2025 12:53:31 GMT (envelope-from git) Date: Thu, 10 Jul 2025 12:53:31 GMT Message-Id: <202507101253.56ACrVrQ007467@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Ziaee Subject: git: 42df4faf7004 - main - builtin.1: streamlined rewrite + document keybinds 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 42df4faf7004aabb4f06acd71f860f12977db3ad Auto-Submitted: auto-generated The branch main has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=42df4faf7004aabb4f06acd71f860f12977db3ad commit 42df4faf7004aabb4f06acd71f860f12977db3ad Author: Alexander Ziaee AuthorDate: 2024-10-17 22:43:14 +0000 Commit: Alexander Ziaee CommitDate: 2025-07-10 12:45:10 +0000 builtin.1: streamlined rewrite + document keybinds + clean title: one line with keywords, builtin's mlinked + additional search terms: FreeBSD, index + synopsis: builtins are documented in your shell's manual + clear/scoped introduction: increase straightforwardness + table alignment fixed, now renders nicely on MANWIDTH=59 + keybindings: fundamentals now documented, more please? + improved structure and flow, and a spdx tag + remove info(1) from SEE ALSO MFC after: 3 days Discussed with: imp,jlduran Reviewed by: imp Closes: https://github.com/freebsd/freebsd-src/pull/1481 --- share/man/man1/Makefile | 1 + share/man/man1/builtin.1 | 269 ++++++++++++++++------------------------------- 2 files changed, 93 insertions(+), 177 deletions(-) diff --git a/share/man/man1/Makefile b/share/man/man1/Makefile index e5ab6597ead2..5b1d3ac1091d 100644 --- a/share/man/man1/Makefile +++ b/share/man/man1/Makefile @@ -55,6 +55,7 @@ MLINKS= builtin.1 alias.1 \ builtin.1 if.1 \ builtin.1 jobid.1 \ builtin.1 jobs.1 \ + builtin.1 keybinds.1 \ builtin.1 limit.1 \ builtin.1 log.1 \ builtin.1 logout.1 \ diff --git a/share/man/man1/builtin.1 b/share/man/man1/builtin.1 index d546548ab4e5..ee89006caea5 100644 --- a/share/man/man1/builtin.1 +++ b/share/man/man1/builtin.1 @@ -1,4 +1,6 @@ .\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" .\" Copyright (c) 1999 Sheldon Hearn .\" .\" All rights reserved. @@ -24,175 +26,33 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd December 21, 2010 +.Dd March 29, 2025 .Dt BUILTIN 1 .Os .Sh NAME .Nm builtin , -.Nm \&! , -.Nm % , -.Nm \&. , -.Nm \&: , -.Nm @ , -.Nm \&[ , -.Nm { , -.Nm } , -.Nm alias , -.Nm alloc , -.Nm bg , -.Nm bind , -.Nm bindkey , -.Nm break , -.Nm breaksw , -.Nm builtins , -.Nm case , -.Nm cd , -.Nm chdir , -.Nm command , -.Nm complete , -.Nm continue , -.Nm default , -.Nm dirs , -.Nm do , -.Nm done , -.Nm echo , -.Nm echotc , -.Nm elif , -.Nm else , -.Nm end , -.Nm endif , -.Nm endsw , -.Nm esac , -.Nm eval , -.Nm exec , -.Nm exit , -.Nm export , -.Nm false , -.Nm fc , -.Nm fg , -.Nm filetest , -.Nm fi , -.Nm for , -.Nm foreach , -.Nm getopts , -.Nm glob , -.Nm goto , -.Nm hash , -.Nm hashstat , -.Nm history , -.Nm hup , -.Nm if , -.Nm jobid , -.Nm jobs , -.Nm kill , -.Nm limit , -.Nm local , -.Nm log , -.Nm login , -.Nm logout , -.Nm ls-F , -.Nm nice , -.Nm nohup , -.Nm notify , -.Nm onintr , -.Nm popd , -.Nm printenv , -.Nm printf , -.Nm pushd , -.Nm pwd , -.Nm read , -.Nm readonly , -.Nm rehash , -.Nm repeat , -.Nm return , -.Nm sched , -.Nm set , -.Nm setenv , -.Nm settc , -.Nm setty , -.Nm setvar , -.Nm shift , -.Nm source , -.Nm stop , -.Nm suspend , -.Nm switch , -.Nm telltc , -.Nm test , -.Nm then , -.Nm time , -.Nm times , -.Nm trap , -.Nm true , -.Nm type , -.Nm ulimit , -.Nm umask , -.Nm unalias , -.Nm uncomplete , -.Nm unhash , -.Nm unlimit , -.Nm unset , -.Nm unsetenv , -.Nm until , -.Nm wait , -.Nm where , -.Nm which , -.Nm while -.Nd shell built-in commands +.Nm keybinds +.Nd index of FreeBSD shell built-in commands .Sh SYNOPSIS -See the built-in command description in the appropriate shell manual page. +See the manual for your shell for operation details. .Sh DESCRIPTION -Shell builtin commands are commands that can be executed within the -running shell's process. -Note that, in the case of -.Xr csh 1 -builtin commands, the command is executed in a subshell if it occurs as -any component of a pipeline except the last. -.Pp -If a command specified to the shell contains a slash -.Ql / , -the shell will not execute a builtin command, even if the last component -of the specified command matches the name of a builtin command. -Thus, while specifying -.Dq Li echo -causes a builtin command to be executed under shells that support the -.Nm echo -builtin command, -specifying -.Dq Li /bin/echo -or -.Dq Li ./echo -does not. -.Pp -While some builtin commands may exist in more than one shell, their -operation may be different under each shell which supports them. -Below is a table which lists shell builtin commands, the standard shells -that support them and whether they exist as standalone utilities. -.Pp -Only builtin commands for the +This page provides an index of +.Nm +commands, keywords, and keyboard bindings provided by .Xr csh 1 and -.Xr sh 1 -shells are listed here. -Consult a shell's manual page for -details on the operation its builtin commands. -Beware that the -.Xr sh 1 -manual page, at least, calls some of these commands -.Dq built-in commands -and some of them -.Dq reserved words . -Users of other shells may need to consult an -.Xr info 1 -page or other sources of documentation. -.Pp -Commands marked -.Dq Li No** -under -.Em External -do exist externally, -but are implemented as scripts using a builtin command of the same name. -.Bl -column ".Ic uncomplete" ".Em External" ".Xr csh 1" ".Xr sh 1" -offset indent -.It Em Command Ta Em External Ta Xr csh 1 Ta Xr sh 1 +.Xr sh 1 , +the command line interpreters which comprise the +.Bx +user environment. +.Ss Commands +Below is a table which lists +.Nm +commands and keywords, +whether they exist as standalone utilities, +and the standard shells that provide them. +.Bl -column "uncomplete" "Standalone" "csh(1)" "sh(1)" -offset indent +.It Em Command Ta Em Standalone Ta Xr csh 1 Ta Xr sh 1 .It Ic \&! Ta \&No Ta \&No Ta Yes .It Ic % Ta \&No Ta Yes Ta \&No .It Ic \&. Ta \&No Ta \&No Ta Yes @@ -201,9 +61,9 @@ but are implemented as scripts using a builtin command of the same name. .It Ic \&[ Ta Yes Ta \&No Ta Yes .It Ic { Ta \&No Ta \&No Ta Yes .It Ic } Ta \&No Ta \&No Ta Yes -.It Ic alias Ta No** Ta Yes Ta Yes +.It Ic alias Ta No* Ta Yes Ta Yes .It Ic alloc Ta \&No Ta Yes Ta \&No -.It Ic bg Ta No** Ta Yes Ta Yes +.It Ic bg Ta No* Ta Yes Ta Yes .It Ic bind Ta \&No Ta \&No Ta Yes .It Ic bindkey Ta \&No Ta Yes Ta \&No .It Ic break Ta \&No Ta Yes Ta Yes @@ -211,9 +71,9 @@ but are implemented as scripts using a builtin command of the same name. .It Ic builtin Ta \&No Ta \&No Ta Yes .It Ic builtins Ta \&No Ta Yes Ta \&No .It Ic case Ta \&No Ta Yes Ta Yes -.It Ic cd Ta No** Ta Yes Ta Yes +.It Ic cd Ta No* Ta Yes Ta Yes .It Ic chdir Ta \&No Ta Yes Ta Yes -.It Ic command Ta No** Ta \&No Ta Yes +.It Ic command Ta No* Ta \&No Ta Yes .It Ic complete Ta \&No Ta Yes Ta \&No .It Ic continue Ta \&No Ta Yes Ta Yes .It Ic default Ta \&No Ta Yes Ta \&No @@ -233,22 +93,22 @@ but are implemented as scripts using a builtin command of the same name. .It Ic exit Ta \&No Ta Yes Ta Yes .It Ic export Ta \&No Ta \&No Ta Yes .It Ic false Ta Yes Ta \&No Ta Yes -.It Ic fc Ta No** Ta \&No Ta Yes -.It Ic fg Ta No** Ta Yes Ta Yes +.It Ic fc Ta No* Ta \&No Ta Yes +.It Ic fg Ta No* Ta Yes Ta Yes .It Ic filetest Ta \&No Ta Yes Ta \&No .It Ic fi Ta \&No Ta \&No Ta Yes .It Ic for Ta \&No Ta \&No Ta Yes .It Ic foreach Ta \&No Ta Yes Ta \&No -.It Ic getopts Ta No** Ta \&No Ta Yes +.It Ic getopts Ta No* Ta \&No Ta Yes .It Ic glob Ta \&No Ta Yes Ta \&No .It Ic goto Ta \&No Ta Yes Ta \&No -.It Ic hash Ta No** Ta \&No Ta Yes +.It Ic hash Ta No* Ta \&No Ta Yes .It Ic hashstat Ta \&No Ta Yes Ta \&No .It Ic history Ta \&No Ta Yes Ta \&No .It Ic hup Ta \&No Ta Yes Ta \&No .It Ic if Ta \&No Ta Yes Ta Yes .It Ic jobid Ta \&No Ta \&No Ta Yes -.It Ic jobs Ta No** Ta Yes Ta Yes +.It Ic jobs Ta No* Ta Yes Ta Yes .It Ic kill Ta Yes Ta Yes Ta Yes .It Ic limit Ta \&No Ta Yes Ta \&No .It Ic local Ta \&No Ta \&No Ta Yes @@ -265,7 +125,7 @@ but are implemented as scripts using a builtin command of the same name. .It Ic printf Ta Yes Ta \&No Ta Yes .It Ic pushd Ta \&No Ta Yes Ta \&No .It Ic pwd Ta Yes Ta \&No Ta Yes -.It Ic read Ta No** Ta \&No Ta Yes +.It Ic read Ta No* Ta \&No Ta Yes .It Ic readonly Ta \&No Ta \&No Ta Yes .It Ic rehash Ta \&No Ta Yes Ta \&No .It Ic repeat Ta \&No Ta Yes Ta \&No @@ -288,26 +148,68 @@ but are implemented as scripts using a builtin command of the same name. .It Ic times Ta \&No Ta \&No Ta Yes .It Ic trap Ta \&No Ta \&No Ta Yes .It Ic true Ta Yes Ta \&No Ta Yes -.It Ic type Ta No** Ta \&No Ta Yes -.It Ic ulimit Ta No** Ta \&No Ta Yes -.It Ic umask Ta No** Ta Yes Ta Yes -.It Ic unalias Ta No** Ta Yes Ta Yes +.It Ic type Ta No* Ta \&No Ta Yes +.It Ic ulimit Ta No* Ta \&No Ta Yes +.It Ic umask Ta No* Ta Yes Ta Yes +.It Ic unalias Ta No* Ta Yes Ta Yes .It Ic uncomplete Ta \&No Ta Yes Ta \&No .It Ic unhash Ta \&No Ta Yes Ta \&No .It Ic unlimit Ta \&No Ta Yes Ta \&No .It Ic unset Ta \&No Ta Yes Ta Yes .It Ic unsetenv Ta \&No Ta Yes Ta \&No .It Ic until Ta \&No Ta \&No Ta Yes -.It Ic wait Ta No** Ta Yes Ta Yes +.It Ic wait Ta No* Ta Yes Ta Yes .It Ic where Ta \&No Ta Yes Ta \&No .It Ic which Ta Yes Ta Yes Ta \&No .It Ic while Ta \&No Ta Yes Ta Yes .El +.Pp +\&No*: Commands marked +.Ql No* +exist externally, but are implemented as scripts using a +.Nm +command of the same name. +.Ss Keybinds +The command line environment also provides the following +default keyboard bindings: +.Bl -column "Process Info (SIGINFO)" "^M | ^J" "^M | ^J" -offset indent +.It Em Signal Ta Xr csh 1 Ta Xr sh 1 +.It Ic Backspace Ta ^H Ta ^H +.It Ic Carriage Return Ta ^M | ^J Ta ^M | ^J +.It Ic Tab Ta ^I Ta ^I +.It Ic Beginning of Line Ta ^A Ta ^A +.It Ic End of Line Ta ^E Ta ^E +.It Ic Cursor Forward Ta ^F Ta ^F +.It Ic Cursor Backward Ta ^B Ta ^B +.It Ic Clear Screen Ta ^L Ta ^L +.It Ic Cut Line Ta ^U Ta ^U +.It Ic Cut Word Backwards Ta ^W Ta ^W +.It Ic Cut Rest of Line Ta ^K Ta ^K +.It Ic Paste Last Cut Ta ^Y Ta ^Y +.It Ic Typo Ta ^T Ta ^T +.It End of File Po Ic EOF Pc Ta ^D Ta ^D +.It Interupt Po Ic SIGINT Pc Ta ^C Ta ^C +.It Process info Po Ic SIGINFO Pc Ta ^T Ta ^T +.It Ic Search History Ta \&No Ta ^R +.It Ic Exit Search History Ta \&No Ta ^G +.It Ic Previous Command Ta ^P Ta ^P +.It Ic Next Command Ta ^N Ta ^N +.It Ic Print Next Character Ta ^V Ta ^V +.It Ic Pause Job Ta ^S Ta ^S +.It Ic Resume Job Ta ^Q Ta ^Q +.It Suspend Job Ic (SIGTSTP) Ta ^Z Ta ^Z +.It Ic Scrollback Mode Ta ScrLk* Ta ScrLk* +.El +.Pp +\&*: Bindings marked +.Ql * +are provided by +.Xr vt 4 , +the console driver. .Sh SEE ALSO .Xr csh 1 , .Xr echo 1 , .Xr false 1 , -.Xr info 1 , .Xr kill 1 , .Xr login 1 , .Xr nice 1 , @@ -326,5 +228,18 @@ The manual page first appeared in .Fx 3.4 . .Sh AUTHORS +.An -nosplit This manual page was written by +.An Alexander Ziaee Aq Mt ziaee@FreeBSD.org +from an earlier version by .An Sheldon Hearn Aq Mt sheldonh@FreeBSD.org . +.Sh CAVEATS +While +.Nm +commands may exist in more than one shell or standalone, +each may be implemented differently. +.Pp +Standalone utilities and their manuals must be called by their path +from a shell with a +.Nm +command of the same name. From nobody Thu Jul 10 14:09:10 2025 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 4bdGtZ6cZVz6162y; Thu, 10 Jul 2025 14:09:26 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdGtZ4NgFz4593; Thu, 10 Jul 2025 14:09:26 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ed1-x52c.google.com with SMTP id 4fb4d7f45d1cf-607434e1821so1376982a12.0; Thu, 10 Jul 2025 07:09:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1752156564; x=1752761364; darn=freebsd.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=njZ8ywaZvpoFK3DmoCYhgoTbMlPMXSU4CbxiX+7ipLw=; b=gEwPh127FAyR5DZO64yHWw6RNYE0gFeznhAneGFhLBm3ih3ojfqgS2H18GKpfLYWuT +HKNpJDhh9eoSFxxZvZUDg6cm7eSZiXRpzdx2ENrsfU1GrVvhKhrNfp815v0uqF0FWAu YiLLsQT281uKTP32lTSp+sh6avEff4BdhxB7TPVcayPz1ms3eNiijKze8qWLJbhM/HBU kxyqxVDUpKay9k9zwdsVTiNRj8evkSTrzwETLgkaacUdGtK5T38GqMzRrh4nxbAoKJB5 BYvct8ri7lkvZQN3u7x+nEijmNWcVjkZS75GLB95DO00vea912vrChFAr3ZftG+Ade1o c/0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752156564; x=1752761364; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=njZ8ywaZvpoFK3DmoCYhgoTbMlPMXSU4CbxiX+7ipLw=; b=E/3TycZjO/qWLTLcO+c0EbHVitJQ0Y40R/B2He6RNK4J9V4aizSkdAAAuF6sy2e0k6 QTnn1WwD8P/3YssDRLU2PTEM6Z9NWm/op499R7cTfEojmtF70YhizmwFLRyYUbD+tfuZ ajp3mA5HZB32++EylQ+MMnvpnvGCEBcX8JTg/R17ICxSP8geezjfzmgx3uoT9jCgnaQZ U0t+bOB66o03Q7TiEOUvm2MKswSz8ko3saaxIhMzgracZSLJG0VvAIoXXIxyp7QVcWA8 ETBDy5xriISv6WbDfQ+jbSH+Pz4WjNwSkT924aIHc49ijZzno7VT/4k38Dzva8wbxIMS OLZg== X-Forwarded-Encrypted: i=1; AJvYcCUU4BJfCKudH1SzwgQ0wn/NmTPML2HxUIkSTM+unF5kn2uEuYtSAr54KKYCTAqJ3WTGveck7y0EZXSJNm+WGd3niM0o@freebsd.org, AJvYcCW+sKx8BgClqXZCxOFYR9F/6EbY7/+vVW0dJOmXneIP8Kkf7wSHvukT96kxWpMsQfX/cSbNEEM0EHn5VGsBFCI=@freebsd.org, AJvYcCX/87WE0PpeuDxdP1872p+hH2d3+b0K/snVNsK3D3ldHFmECphoWHM2gntIBDMZhCNXcvwvcOEXPuNdDToIaphWMPcrTjo=@freebsd.org X-Gm-Message-State: AOJu0YzopyPkTMwSSJEfUITmbN75wE5FyW/zswwvlHSsBWUwURpbUrjo PCIbn/xaJyNu3oTrJpENH30oKH6AxSqLdS+qN88RJnK3vq9xl/W8JD/5V4kWkiMUvlO5PoDl+17 BZEnirw2I72yR6KvYP5CnphQLRUfDAIDy X-Gm-Gg: ASbGncsP0PJ/Lzs92IWwv/GZFyk067ugwta+pLuVUvZeD/rN38vgP5V1cZIBqxIsXbR Dw/zfsrph2JJUaF1qc5qKxMyLKQ59x8ukK3oOQcjBgQ6KgF67kd8jurgJNlpsD0GX92JN9gUfYO rtgwi/IrG55Yr7bg2wJbvKVEmcnvhY+U71FAHue54xAA0nPITfmhmuXpSjNry4yBePQps+NZErO 4E= X-Google-Smtp-Source: AGHT+IGdZn0ZuRY7dS7GP5hR4wNEVrz8YnnXvQIWrjHjeoTHsJtsNuronceoBU3sD464cfwh6en/N54EdIWwpg4wlBs= X-Received: by 2002:a05:6402:31e7:b0:607:f61f:cc1d with SMTP id 4fb4d7f45d1cf-611c0d4baafmr3038759a12.11.1752156563589; Thu, 10 Jul 2025 07:09:23 -0700 (PDT) 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 References: <202507062254.566MsbnL090918@gitrepo.freebsd.org> <867c0gcjt3.fsf@ltc.des.dev> In-Reply-To: <867c0gcjt3.fsf@ltc.des.dev> From: Rick Macklem Date: Thu, 10 Jul 2025 07:09:10 -0700 X-Gm-Features: Ac12FXw7QodpahZPufg93CnJj7ZMn_g-uroSK2cf7NAl7BP_rJPVFGrN6sQZRGQ Message-ID: Subject: Re: git: c5d72d29fe0e - main - nfsv4: Add support for the NFSv4 hidden and system attributes To: =?UTF-8?Q?Dag=2DErling_Sm=C3=B8rgrav?= Cc: Rick Macklem , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4bdGtZ4NgFz4593 X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] Yep. You can commit it or I can? (You can put reviewed by me if you choose to commit it.) Thanks, rick On Thu, Jul 10, 2025 at 5:27=E2=80=AFAM Dag-Erling Sm=C3=B8rgrav wrote: > > CAUTION: This email originated from outside of the University of Guelph. = Do not click links or open attachments unless you recognize the sender and = know the content is safe. If in doubt, forward suspicious emails to IThelp@= uoguelph.ca. > > Rick Macklem writes: > > diff --git a/sys/fs/nfsclient/nfs_clvnops.c b/sys/fs/nfsclient/nfs_clvn= ops.c > > index 0049d7edca33..fbfcdafaa06b 100644 > > --- a/sys/fs/nfsclient/nfs_clvnops.c > > +++ b/sys/fs/nfsclient/nfs_clvnops.c > > [...] > > @@ -1092,7 +1100,8 @@ nfs_setattr(struct vop_setattr_args *ap) > > vap->va_gid !=3D (gid_t)VNOVAL || vap->va_atime.tv_sec !=3D V= NOVAL || > > vap->va_mtime.tv_sec !=3D VNOVAL || > > vap->va_birthtime.tv_sec !=3D VNOVAL || > > - vap->va_mode !=3D (mode_t)VNOVAL) && > > + vap->va_mode !=3D (mode_t)VNOVAL || > > + vap->va_flags !=3D (u_long)VNOVAL) && > > (vp->v_mount->mnt_flag & MNT_RDONLY)) > > return (EROFS); > > if (vap->va_size !=3D VNOVAL) { > > vap->va_flags was already checked (in the line just before the first > line of context), albeit without a cast. Coverity erroneously claims > that this causes the entire expression to always be true, because it > thinks VNOVAL and (u_long)VNOVAL are two different values. That's not > the case, but you probably still want this: > > diff --git a/sys/fs/nfsclient/nfs_clvnops.c b/sys/fs/nfsclient/nfs_clvnop= s.c > index fbfcdafaa06b..fa451887e73e 100644 > --- a/sys/fs/nfsclient/nfs_clvnops.c > +++ b/sys/fs/nfsclient/nfs_clvnops.c > @@ -1096,12 +1096,11 @@ nfs_setattr(struct vop_setattr_args *ap) > /* > * Disallow write attempts if the filesystem is mounted read-only= . > */ > - if ((vap->va_flags !=3D VNOVAL || vap->va_uid !=3D (uid_t)VNOVAL = || > + if ((vap->va_flags !=3D (u_long)VNOVAL || vap->va_uid !=3D (uid_t= )VNOVAL || > vap->va_gid !=3D (gid_t)VNOVAL || vap->va_atime.tv_sec !=3D V= NOVAL || > vap->va_mtime.tv_sec !=3D VNOVAL || > vap->va_birthtime.tv_sec !=3D VNOVAL || > - vap->va_mode !=3D (mode_t)VNOVAL || > - vap->va_flags !=3D (u_long)VNOVAL) && > + vap->va_mode !=3D (mode_t)VNOVAL) && > (vp->v_mount->mnt_flag & MNT_RDONLY)) > return (EROFS); > if (vap->va_size !=3D VNOVAL) { > > DES > -- > Dag-Erling Sm=C3=B8rgrav - des@FreeBSD.org From nobody Thu Jul 10 14:35:38 2025 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 4bdHSp6PPQz617L3; Thu, 10 Jul 2025 14:35:38 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdHSp5Q6kz4HPq; Thu, 10 Jul 2025 14:35:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752158138; 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=aB6rXve+wJ1UZ/JO42GFw8zD0QnvzTmKM4C+Z/NIVsA=; b=ZbyN5jsfvTdONUf2wHomynA+s0yZcm3o/piu6Y4vmxQiZnl5mE9k5Q05ZtY+fVK+u8ThrE HsQNKibps0R7twmOXFXj0qeWgPnB1lD2RyJ+Ef2tuZGNDCraIoGEOmkh4MNG+k2MYHz6jw XldnszDxTRdSqi/RSK8o64wp0zqxjGTuZcnYCG/jVu6knR2RqKhIYD+jc1m4fQaXE0jKby ND1tBBhl14HJ2JJqtWM+wQ4EWrnqgp5ozE+9DroYqyTgiMDVo91RHwnN5QjDYvaewplSJf 860X1i4bhLYUZqH7l/bsEkWxc0HPTJIgdgroCb36XAVSNrN1uvADVzLRPHeBVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752158138; 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=aB6rXve+wJ1UZ/JO42GFw8zD0QnvzTmKM4C+Z/NIVsA=; b=HafdOqatWJeMDspjw3Gt8yD0rD97ggo28slfm//trN2seHBL0aMbehJMAJdUs2Kasr1g5p vsudgfY+S4H6BLNXaR3Jf4WxLDXmkTp6Lyg9891nXkNhLafMDZkwbRisnIxB7N17viep+k lqrjJfGB3BrdF5Uom9vyJkADUFtP4CT2Vw9ibayWk8HSlz1QGWD4EqCv64ATH6B+ZJ8u0U cmw17qm9V21cxUsS5B9TfjOXpDMOfX/8N1qBFxIEMabknDD3AGvq7+M7IPbdewTMoDoiqa fepoTeM+QuRblrFG4TOhptSTdmWpxSCNQ/8jzsSsotz+ZIlLt3OnrC0sxeZuug== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752158138; a=rsa-sha256; cv=none; b=chhQ1sdxr1j00SZVwrQA7fkKE5Z8kkVmtCHPrs7denXy1XeVEWcyhmHoiMkYn4dLYXPvtn /J4sn5fsSC5zhgDEm42EES7hm6jmCKkgsYPUrMHOQO5COGMje70LgAnw5bE/Rr/bp3P8Z5 jIUNCi9pZL7gkVUf58evzR9nE0Xxk+S8FNB63aVqKq09mb7fTM3HhbUAV3qqWtf4R2EFIH yqB5zx8pw1nzRW5aO8VpMHE2LUUJxVMtO7k4OGiRc8BNjOynPlO/SpJJ9uxkfzagbscAyL Z5iRUWpWoB4bVDpbmXoIui4q1QkVZns5WBatWh0dMXlPa9scImj8WyfPUK4eHw== 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 4bdHSp4w69z19Xs; Thu, 10 Jul 2025 14:35:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56AEZc5H096458; Thu, 10 Jul 2025 14:35:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56AEZckU096455; Thu, 10 Jul 2025 14:35:38 GMT (envelope-from git) Date: Thu, 10 Jul 2025 14:35:38 GMT Message-Id: <202507101435.56AEZckU096455@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 63389aea24f1 - main - inotify: do not call into namei() with a locked vnode 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 63389aea24f15fe823c775960d77017f1a35f54b Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=63389aea24f15fe823c775960d77017f1a35f54b commit 63389aea24f15fe823c775960d77017f1a35f54b Author: Konstantin Belousov AuthorDate: 2025-07-10 07:15:13 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-10 14:34:45 +0000 inotify: do not call into namei() with a locked vnode PR: 288127 Reviewed by: markj Fixes: f1f230439fa48581f40a57f095627f667a9713c3 Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D51233 --- sys/kern/vfs_inotify.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/kern/vfs_inotify.c b/sys/kern/vfs_inotify.c index 41e73bb41a49..2b42228465a4 100644 --- a/sys/kern/vfs_inotify.c +++ b/sys/kern/vfs_inotify.c @@ -760,9 +760,11 @@ vn_inotify_add_watch(struct vnode *vp, struct inotify_softc *sc, uint32_t mask, * directory if it's specified as a vnode. */ vrefact(vp); + VOP_UNLOCK(vp); NDINIT_ATVP(&nd, LOOKUP, NOFOLLOW, UIO_SYSSPACE, dp->d_name, vp); error = namei(&nd); + vn_lock(vp, LK_SHARED | LK_RETRY); if (error != 0) break; vn_irflag_set_cond(nd.ni_vp, VIRF_INOTIFY_PARENT); From nobody Thu Jul 10 14:42:46 2025 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 4bdHd253PSz6187R; Thu, 10 Jul 2025 14:42:46 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdHd228RCz4Mb4; Thu, 10 Jul 2025 14:42:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752158566; 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=uTtocf1geyfZmx3n4GSMDlX8PrJf+tI8SggfrzX/az0=; b=mR2KgBgY/xlZQmNaTeV0e4X0H/4ise+RHFp67Z8ovdIn4YM0FdlPfotFhxKFVU5fUcZRHj xJnksG7neGEwujLWnE4K2qOG0KRsQc/ISTL5IBWTZG7T4w8ktfk/zeEfmuszqcmS6iPznX NQNjVN98Jnup18xkH69XwS6O+LsPq3n3wFl1jJzRXHuPGpzvOwpxI0teWAytjXiReHcOzN z+T+Waxizm3TLXt8Bc9NXiT67gcHwxzZkABo5v2Zu5Wix8BDBvVsN1tmsHMY+uGZFdpAcr UIQ7NUT3YFfm1mlKvC4c6MVoA7mkYx0tjrqxElNb5uyAdfpkywI0dDZmaYqtlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752158566; 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=uTtocf1geyfZmx3n4GSMDlX8PrJf+tI8SggfrzX/az0=; b=DRfpU22LSjrOfzfIhhW5Gc25y0qcCEgL2PZycA2x6OO78j7DVsEdqsbMB6/61Je1b4nhIW l7Ml5YhpAmiIC2ybI+aIw9JP4nh6xoDDEXjfSGmr5vgAAokExjiVIixH4U+IfMmuRO7UEF 8JxQGxvwp2YLxTptzfM6h3x+0ZCjCgAhe24eGT3rC/1TOyHn1yHr45wyg1WG+dA2ZdcmGs RwSppzJhwcceeK03UN3eIO8yfrelkC3z91wZMCi6mVgDzpddfUKhYoUj6LnrS2FeyF45P5 CXD/WA+S08p/lridv0b94MyPxLCPB5svOlojLf31BJ0lY1fPIZaVX1Ow/PUMWQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752158566; a=rsa-sha256; cv=none; b=xv/Pc0OQBTPlEd4yB6F6wKM7taCcphhqc+G/cYuNlKNcBgtzfy/Xk1mhvoUTYXwG9fgovQ mbtLF9SRrWyp5OvzZRlaBVG49ivbX6YSBO2HgXMShVIJ2ag79rTGwCZe50Rain+2LAj3E6 hqHblKCVnRhq0qXy191eZQaEyBWBOWs4H7OO9rZfrabClzAHDgK/+NtEjhtEEgeowPKXrj YbmQAx2fnAdNZeVymAGsat0oD3B8UkCDhxLl9vcB3IP2VmS2YfNheJcztHIXdZSS/+dsRI 6Ars9wqpdqfCvGKGqEBrI1WkeV+sO5f2+hecA7uHADzOJOKKtriw4c5xNsOZRQ== 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 4bdHd21VM1z1BD9; Thu, 10 Jul 2025 14:42:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56AEgkCt015006; Thu, 10 Jul 2025 14:42:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56AEgkkG015003; Thu, 10 Jul 2025 14:42:46 GMT (envelope-from git) Date: Thu, 10 Jul 2025 14:42:46 GMT Message-Id: <202507101442.56AEgkkG015003@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 1b7d0c2ee947 - main - in_pcb: add in_pcbrele_rlock() 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1b7d0c2ee94748814a6c7943806ab8160e65a6f5 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=1b7d0c2ee94748814a6c7943806ab8160e65a6f5 commit 1b7d0c2ee94748814a6c7943806ab8160e65a6f5 Author: Konstantin Belousov AuthorDate: 2025-07-03 10:36:58 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-10 14:42:27 +0000 in_pcb: add in_pcbrele_rlock() The helper that derefs and rlocks the provided inp. Returns false if inp is still usable. Reviewed by: glebius, markj Sponsored by: Nvidia networking Differential revision: https://reviews.freebsd.org/D51143 --- sys/netinet/in_pcb.c | 17 +++++++++++++++++ sys/netinet/in_pcb.h | 1 + 2 files changed, 18 insertions(+) diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index bccd4b84561a..dbe48242381d 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -1744,6 +1744,23 @@ in_pcbrele(struct inpcb *inp, const inp_lookup_t lock) in_pcbrele_rlocked(inp) : in_pcbrele_wlocked(inp)); } +/* + * Dereference and rlock inp, for which the caller must own the + * reference. Returns true if inp no longer usable, false otherwise. + */ +bool +in_pcbrele_rlock(struct inpcb *inp) +{ + INP_RLOCK(inp); + if (in_pcbrele_rlocked(inp)) + return (true); + if ((inp->inp_flags & INP_FREED) != 0) { + INP_RUNLOCK(inp); + return (true); + } + return (false); +} + /* * Unconditionally schedule an inpcb to be freed by decrementing its * reference count, which should occur only after the inpcb has been detached diff --git a/sys/netinet/in_pcb.h b/sys/netinet/in_pcb.h index 57cf15ca37fc..9e0618e87601 100644 --- a/sys/netinet/in_pcb.h +++ b/sys/netinet/in_pcb.h @@ -681,6 +681,7 @@ void in_pcbref(struct inpcb *); bool in_pcbrele(struct inpcb *, inp_lookup_t); bool in_pcbrele_rlocked(struct inpcb *); bool in_pcbrele_wlocked(struct inpcb *); +bool in_pcbrele_rlock(struct inpcb *inp); typedef bool inp_match_t(const struct inpcb *, void *); struct inpcb_iterator { From nobody Thu Jul 10 14:42:47 2025 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 4bdHd35Y9Sz617hQ; Thu, 10 Jul 2025 14:42:47 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdHd32wDRz4MpY; Thu, 10 Jul 2025 14:42:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752158567; 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=RA3kj8EgtLM9yToQ7zSkE80U/i5zBhonZKQs3HD65qA=; b=K2bUQ6k4W24xlcw2asGNlLgntJAuKmR/WejtKzuK347K9ehKH0q/nGE4qpfYOyMuIoME5T 1XfZtqjKsUilFNhzlWCR0+agfI+tig1sP0iz7malQQMYhfNXrogI2HeRbmx/a6Va0QHZwy eqzE7YTDdHfcg88kZh2/OeOlc0m1THWb3FriSOqJnan5U7mPRnaSc7v4HjwwswrGMCRzOl s2+8R7PDX8AMynu27qy/MASPChljdLu99UoupaTToEZUB8yLH0yfaCCvjK23usgUpJF6yG /NrB/6wCFnyO2SCa6bfQg7XoerZcyMO84RJ0cSBvDhPFPMBvMbxbLofnBiKisw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752158567; 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=RA3kj8EgtLM9yToQ7zSkE80U/i5zBhonZKQs3HD65qA=; b=ytOu1chTFo+8WdEaEBWi1pCheon49gO/K+mzJRaJuelrexUCwnIy8FFxwci9y9XH0Pd3Jk Brm6Jn5BBrAl8S9PVS1rfEa/fDm8LKuG5YuutiG8JEFy4GpNKSOi5xWhh2MnkfnhS+BpEk qDDgsIU6hbtAPgBCDIEHdw3V1loviSdwhpm+bX+3g5RHv9gjuWpYNI69gM2HimqCnzMs47 7qRu06wTGBbnUGCR/0SwoIGTmxMxILclMN6sELnEQx9kGF11w8PSTFe3QErW/C9Qg4UEOr mEEyqDRtAdKrx2Z/vweQBZTCS+6fra/AFf2A39r+k/JLVzMO78DESBbUr9FJrQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752158567; a=rsa-sha256; cv=none; b=PsrhYKsd9dMVy2YbpeZdYgFK3LP3w7qR5P6Xn450WgTwy2E6i6FrEX7Pw5Bu+AuYIAmKoX EDwp0HAtRGDCytUUeDlE51dPze/cJJOT2+TBysVaoWCY4uNHh3+hzJBEzWq7Vy9v8VL8ot 56boVek3a8Rv36jyr3k+iYnj2Ux5oNYT5GQoyim5yGGMzQlqDx/mIFXMA7mAgr90F1YEDy VjUKtK0xkbW8OfcPuZinminENbfkdqZxhO9usEB26ypl5DZC4jSmzmNde2RVO0bsFLku1X fe3+qDCLpHCmSyvq+mZD/MRLyj4UCPnc917+EXkLPJmulKsXrYN9WtIHbLBzQA== 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 4bdHd32W0hz19lP; Thu, 10 Jul 2025 14:42:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56AEglbZ015039; Thu, 10 Jul 2025 14:42:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56AEgljV015036; Thu, 10 Jul 2025 14:42:47 GMT (envelope-from git) Date: Thu, 10 Jul 2025 14:42:47 GMT Message-Id: <202507101442.56AEgljV015036@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: b435452e6b23 - main - sysctl net.inet.tcp.ktlslist: allow snd_tag_status_str() to sleep 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b435452e6b2314e45131b6a3afaa1f4d674a7e17 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b435452e6b2314e45131b6a3afaa1f4d674a7e17 commit b435452e6b2314e45131b6a3afaa1f4d674a7e17 Author: Konstantin Belousov AuthorDate: 2025-07-03 10:37:35 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-10 14:42:27 +0000 sysctl net.inet.tcp.ktlslist: allow snd_tag_status_str() to sleep For this, unlock inp around the calls, taking the reference on it. If the inp appears to be freed or unlinked after the relock, return EDEADLK. Reviewed by: glebius, markj Sponsored by: Nvidia networking Differential revision: https://reviews.freebsd.org/D51143 --- sys/netinet/tcp_subr.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index cd42a67294a6..f8811649fe19 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -2720,8 +2720,12 @@ tcp_ktlslist_locked(SYSCTL_HANDLER_ARGS, bool export_keys) ksr->snd_tag->sw->snd_tag_status_str != NULL) { sz = SND_TAG_STATUS_MAXLEN; + in_pcbref(inp); + INP_RUNLOCK(inp); ksr->snd_tag->sw->snd_tag_status_str( ksr->snd_tag, NULL, &sz); + if (in_pcbrele_rlock(inp)) + return (EDEADLK); len += sz; } } @@ -2739,8 +2743,12 @@ tcp_ktlslist_locked(SYSCTL_HANDLER_ARGS, bool export_keys) kss->snd_tag->sw->snd_tag_status_str != NULL) { sz = SND_TAG_STATUS_MAXLEN; + in_pcbref(inp); + INP_RUNLOCK(inp); kss->snd_tag->sw->snd_tag_status_str( kss->snd_tag, NULL, &sz); + if (in_pcbrele_rlock(inp)) + return (EDEADLK); len += sz; } } @@ -2811,8 +2819,12 @@ tcp_ktlslist_locked(SYSCTL_HANDLER_ARGS, bool export_keys) if (ksr->snd_tag != NULL && ksr->snd_tag->sw->snd_tag_status_str != NULL) { sz = SND_TAG_STATUS_MAXLEN; + in_pcbref(inp); + INP_RUNLOCK(inp); ksr->snd_tag->sw->snd_tag_status_str( ksr->snd_tag, buf + len, &sz); + if (in_pcbrele_rlock(inp)) + return (EDEADLK); len += sz; } } @@ -2828,8 +2840,12 @@ tcp_ktlslist_locked(SYSCTL_HANDLER_ARGS, bool export_keys) if (kss->snd_tag != NULL && kss->snd_tag->sw->snd_tag_status_str != NULL) { sz = SND_TAG_STATUS_MAXLEN; + in_pcbref(inp); + INP_RUNLOCK(inp); kss->snd_tag->sw->snd_tag_status_str( kss->snd_tag, buf + len, &sz); + if (in_pcbrele_rlock(inp)) + return (EDEADLK); len += sz; } } @@ -2853,6 +2869,10 @@ tcp_ktlslist_locked(SYSCTL_HANDLER_ARGS, bool export_keys) zfree(buf, M_TEMP); return (error); + +again_reset: + req->oldidx = 0; + goto again; } static int From nobody Thu Jul 10 14:42:48 2025 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 4bdHd50wCTz617hR; Thu, 10 Jul 2025 14:42:49 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdHd431VYz4Mjt; Thu, 10 Jul 2025 14:42:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752158568; 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=RjCSPTyagvwzP6Za8MmiS+FjnWYkqKDw+qsZoIw6wEY=; b=dgCW0JZ87D1Azs/UXIHPQyIB3ql8lN8MVSfaBycvmqGABHHthoiNxFe9caxr+taZ3YVsRL t81X3/O2Ot+jNNAJ/v/zEz6GchU3ZL9fNF+InOH5pxO3eXFgdZZA45GR+GGa31ELUBKLJe wpWVYE3/YKcrJUHkxUAL/vXqx5/asLh6P4sWQ/w2RB8Ix8tCsmy6hEWM/EBSbrIplHtdgb HpsRaFGTi1xyKrdECtCjylJ85ztKt9Szg9hsag8wJq71KaoSOwIs3jcqO2/mKb2K5RoAY+ WZTbgp1YPDfkBwfLrUgyefXlkAQ1wH5H6IaTzT1JyTCgLzp6gZldNF7PT5gxbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752158568; 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=RjCSPTyagvwzP6Za8MmiS+FjnWYkqKDw+qsZoIw6wEY=; b=f2s1KMJP33WqtLIhJURndX1hcrhoZrzc3OQSuhz9eWk5i23glhK/GfzSRF2RGbMDNhJxak slBCravn/KeXOJNoZA1Nmytuh1T9RbuEQHN7lDIDxCCpCkYZcM3l7UW3UgCWBPvjSDl08Y oQZb1j9lX21kvmDmT61Lie2MfFu9ejQTAKBegjQqMydlZondD0SKUEE5/1Mu70EQWmn/Yy yFQDKSuLkSRntMpXBSs8k1blogeu3QnZtPI5vp5F8935qFS7wFjSYsSgsfxThiKzUuicPp lO45Y5gyqBo3sashhApWGb2F/aqtzBoGZU4WkAV5gD/M2JBUF6clC9TUttT/jw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752158568; a=rsa-sha256; cv=none; b=VPvmMWXkU9CHsJb1L/9MVNyzeS/YGnT9vUW7iGaRq+uSRCnare8xPozAR/kyO3M3oOh/Pg vRLwauThnkNXQJwohavCib9DxMPPgGQfNN8zo7Rk9yMwyRnNMatIKy/Aw+Lzuh+fs8zLPA gXqTaKTbrsr2f5p4AfPb/IZHYWszjS74QPExZzqP2ShuPRPYiVm1Fgra0c70e6T1gpFKvm aJ6tBY4IS0s9IQciKTFvl8EwOu3Zdg8g2IQSpjY1DbH8F1MRaU9+kupbwrMb+FRS1fwouh hiWRaXMpEh+8MG/itzvNK73AcSXIyiEgoB8V0PI+O2e6OawF/iBcAqnJPDWxoQ== 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 4bdHd42dDBz19xJ; Thu, 10 Jul 2025 14:42:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56AEgmZE015079; Thu, 10 Jul 2025 14:42:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56AEgmHP015076; Thu, 10 Jul 2025 14:42:48 GMT (envelope-from git) Date: Thu, 10 Jul 2025 14:42:48 GMT Message-Id: <202507101442.56AEgmHP015076@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 18905fc31b31 - main - sysctl net.inet.tcp.ktcplist: try to handle EDEADLK 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 18905fc31b31fd72a1a1918b26ebbf6c4f0fb5aa Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=18905fc31b31fd72a1a1918b26ebbf6c4f0fb5aa commit 18905fc31b31fd72a1a1918b26ebbf6c4f0fb5aa Author: Konstantin Belousov AuthorDate: 2025-07-03 17:59:30 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-10 14:42:27 +0000 sysctl net.inet.tcp.ktcplist: try to handle EDEADLK If EDEADLK is returned from the locked handler, restart it. Do it limited number of times. Catch signals between tries. Reviewed by: glebius, markj Sponsored by: Nvidia networking Differential revision: https://reviews.freebsd.org/D51143 --- sys/netinet/tcp_subr.c | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index f8811649fe19..45048fb3848d 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -2869,21 +2869,28 @@ tcp_ktlslist_locked(SYSCTL_HANDLER_ARGS, bool export_keys) zfree(buf, M_TEMP); return (error); - -again_reset: - req->oldidx = 0; - goto again; } static int tcp_ktlslist1(SYSCTL_HANDLER_ARGS, bool export_keys) { - int res; - - sx_xlock(&ktlslist_lock); - res = tcp_ktlslist_locked(oidp, arg1, arg2, req, export_keys); - sx_xunlock(&ktlslist_lock); - return (res); + int repeats, error; + + for (repeats = 0; repeats < 100; repeats++) { + if (sx_xlock_sig(&ktlslist_lock)) + return (EINTR); + error = tcp_ktlslist_locked(oidp, arg1, arg2, req, + export_keys); + sx_xunlock(&ktlslist_lock); + if (error != EDEADLK) + break; + if (sig_intr() != 0) { + error = EINTR; + break; + } + req->oldidx = 0; + } + return (error); } static int From nobody Thu Jul 10 14:42:49 2025 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 4bdHd63Nvvz617q5; Thu, 10 Jul 2025 14:42:50 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdHd53w4lz4MbG; Thu, 10 Jul 2025 14:42:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752158569; 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=rsb/NSuxVEcER7+N4lAPR0xcJ5mEobZxVQeAqJt5yGg=; b=giurE8tsEXE3/e/J7shOHoImL53EaPZlmrPVEgCsYVM4b49U5rJj9KIkiJCesahQXGTyvb EmEKnIZdKsMHdqk570UBi3LVtOzAxKPyUuBVIfL4Gtb0kHKvSywJKDTJT4LxsTNlewFPUj jskJM3lFd/R0VePLF/Z7231Ex5QJ8Wfj67rXKpKoqt594wvN/1N0icEdBAIcydeXpwuClg 39gqspeREksCI5fdbhirY2sYuqXBJbsZD7B9UwwjnsGky3SqiTKpTL1LGIE6SQkXas9pZb JENBpYjLJVo3jWHgauhz81RjsWWDO9K6kHSoWgQBwmPzKmLpodeHHUQGFLYhVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752158569; 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=rsb/NSuxVEcER7+N4lAPR0xcJ5mEobZxVQeAqJt5yGg=; b=rvbLnm7UmObrKG+VmbWgJiymipyRoJySHi2t77ndQTVNfvT3OJf3e/KGsTSc+ycqo2b7NL JNyYrJTBAaeG6fYtXlvGDEMDuwYJ40kVfEM6uQ0QLz3npjr9pNwMGuJZC5+vhzr07dCJ7c Go4DEuHrfRCNiufxAycHm0g0uEpYOMLHM3kqH2W+9pgWk1BRWL+e88oVB5QkGQ9B1h4yLb Aebkw8APTzNE/yfOBSMriPwfjdnHljG5s9kCa8VNo3sxIMBSt1FXQVvCG4pDJ+VgjEQeF+ yUS4K279gfPmBeoFp8pfeihb7Q+JQHI8Tycpq40qil7+d9qJ/qLnLxbMVS2UAQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752158569; a=rsa-sha256; cv=none; b=ssMLd8QOd6TJnGfvRZyFEQDBOfizFyZngqBXWmcH0+hNWcYJMa977QGFCXbGwhKCbuT+gt tbd5fj6VvSOrz+m3t9f7gXW6VzBWhPeLwoE5fyzKQ5e61sIjQ4WgAt7vVE35TMeDBYcMgU PDE2BAG2DDcoTPZwJSuxAwWutNqXbllQj0IS/6Woa25VzlYuoIbx6R5A/nkWCdvmFw1HPd 9zBdsJUOLQIUMjYyhXl8s+Fl/MU6LR/xrm93EZHA+YigCYVkxZauSPUaVgR0czDTRrZ2xN k3/uhVRYSGZpQAqWY8Zlvx8GOyX+ilWjyOJGKoBXYb1vckQaBsJzmEERC5qKyQ== 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 4bdHd53Vqgz19xK; Thu, 10 Jul 2025 14:42:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56AEgnEn015112; Thu, 10 Jul 2025 14:42:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56AEgnRL015109; Thu, 10 Jul 2025 14:42:49 GMT (envelope-from git) Date: Thu, 10 Jul 2025 14:42:49 GMT Message-Id: <202507101442.56AEgnRL015109@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: d7c807aa884d - main - sysctl net.inet.tcp.ktcplist: properly fill driver status length field 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d7c807aa884d178e9bd17afe7adaccb22b3b0dc3 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=d7c807aa884d178e9bd17afe7adaccb22b3b0dc3 commit d7c807aa884d178e9bd17afe7adaccb22b3b0dc3 Author: Konstantin Belousov AuthorDate: 2025-07-09 01:41:16 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-10 14:42:27 +0000 sysctl net.inet.tcp.ktcplist: properly fill driver status length field Also ignore errors from drivers. If driver snd_tag status method returned an error, silently ignore the returned string, and not advance the position of the filled buffer. Sponsored by: Nvidia networking --- sys/netinet/tcp_subr.c | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 45048fb3848d..db415f6bdf03 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -2722,11 +2722,13 @@ tcp_ktlslist_locked(SYSCTL_HANDLER_ARGS, bool export_keys) sz = SND_TAG_STATUS_MAXLEN; in_pcbref(inp); INP_RUNLOCK(inp); - ksr->snd_tag->sw->snd_tag_status_str( + error = ksr->snd_tag->sw-> + snd_tag_status_str( ksr->snd_tag, NULL, &sz); if (in_pcbrele_rlock(inp)) return (EDEADLK); - len += sz; + if (error == 0) + len += sz; } } kss = so->so_snd.sb_tls_info; @@ -2745,11 +2747,13 @@ tcp_ktlslist_locked(SYSCTL_HANDLER_ARGS, bool export_keys) sz = SND_TAG_STATUS_MAXLEN; in_pcbref(inp); INP_RUNLOCK(inp); - kss->snd_tag->sw->snd_tag_status_str( + error = kss->snd_tag->sw-> + snd_tag_status_str( kss->snd_tag, NULL, &sz); if (in_pcbrele_rlock(inp)) return (EDEADLK); - len += sz; + if (error == 0) + len += sz; } } if (p) { @@ -2821,11 +2825,14 @@ tcp_ktlslist_locked(SYSCTL_HANDLER_ARGS, bool export_keys) sz = SND_TAG_STATUS_MAXLEN; in_pcbref(inp); INP_RUNLOCK(inp); - ksr->snd_tag->sw->snd_tag_status_str( + error = ksr->snd_tag->sw->snd_tag_status_str( ksr->snd_tag, buf + len, &sz); if (in_pcbrele_rlock(inp)) return (EDEADLK); - len += sz; + if (error == 0) { + xktls->rcv.drv_st_len = sz; + len += sz; + } } } if (kss != NULL && kss->gen == xig.xig_gen) { @@ -2842,11 +2849,14 @@ tcp_ktlslist_locked(SYSCTL_HANDLER_ARGS, bool export_keys) sz = SND_TAG_STATUS_MAXLEN; in_pcbref(inp); INP_RUNLOCK(inp); - kss->snd_tag->sw->snd_tag_status_str( + error = kss->snd_tag->sw->snd_tag_status_str( kss->snd_tag, buf + len, &sz); if (in_pcbrele_rlock(inp)) return (EDEADLK); - len += sz; + if (error == 0) { + xktls->snd.drv_st_len = sz; + len += sz; + } } } len = roundup2(len, __alignof(*xktls)); From nobody Thu Jul 10 14:42:50 2025 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 4bdHd66V8Zz617xP; Thu, 10 Jul 2025 14:42:50 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdHd64yGBz4Mpf; Thu, 10 Jul 2025 14:42:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752158570; 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=G74d6DI6jPykZXdmMHn7PzSxGmCRmlVYgJ+al5avdMU=; b=xdnfs9vPQa2sUOJxyohghrErXn1bKcrF3uEUrP+utSAUk793CKAwSRUBQchWOkdQZGNiKQ ztxhYITxaF5Ua5F1ls2EkPeISvkAEdz3tzU69Z3qHvtKwnnXun2zbjPx0T8HFbRBJ83Vpw D/9q9O6svQrl+9l8UYIVIwstKMKGYHNk4SZziT+XfHHXNGbyMSyV1uP5Po3WQvwTRyENsM zvmaa41UY3ldcOAvfDSKGjXQBUhwSOKHbQG9FbTmVtA7STBqp5bBXDFR1VGiDD6dPd5x7m ARN6F594uARN8cEmRL0du2ftuyq0E1C6iY5xgQenz1PXsdVOUzp0m4LxmfbzhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752158570; 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=G74d6DI6jPykZXdmMHn7PzSxGmCRmlVYgJ+al5avdMU=; b=FxEezq7RY1Sh5fUOuna+NdwjpMXQRHgGdVMWjtSn5hhkHFTCL0RMgotuiVMvJGvanTCFi/ wsu3RW6FZHDjYUn7VuwWrAzt6uwDF4sHo3J6flPMRVM2YsaChLSdHnflxK6zd3vjQdGhXA t/THdDFbyEdfOAFg6FMyT1NOmWSoaJJFVFmmWpAzSEaUlOElZJy6AQxerCrmMh4q0v1duB kR4aXMhG/4dsvkp0XP4yGWEFowuWo3mix5DVzg9QGaRIKLF/TqXr+HqEZ/2qZdUYiFplX5 k8FBZojHMJYnwu/mAA3iX8jsh5nwh/GM4PWnBbVJCKIcsz2zIH4HWqiHV5IKkQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752158570; a=rsa-sha256; cv=none; b=lPd8/wZp2xUhgCAeumGI6y1vKP1l4oL/A1N0s6TTbrD+Exe4lGVclO2yV3vIqPf+TJek7C 8kiwZU3SUWSZDiMNGPYtKDG641UU17cD37Od9c44lkRRFvRVV+5iJ7qSWAms8mQwqOeihV uYq2WNrmjtYzJ1WsMqKs+3q2ZLj2X45r88zcZRI9c595XqUbYvHF9jyGmXC/VNMVCexOF5 YB8WQV2t1gvLUJ7wUUKCH/Y6IIkJ88Qc5zPZQeE1OPo02I76z4/5Fh9psLP1d4jiuVNPY1 ej+6kzilE2FMSU4aXZmcDBnMLeq5HVgF7IrmwC3rX4p9YlUr/GL6+zPlHmsfVg== 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 4bdHd64VdQz19xL; Thu, 10 Jul 2025 14:42:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56AEgoJr015146; Thu, 10 Jul 2025 14:42:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56AEgoC8015143; Thu, 10 Jul 2025 14:42:50 GMT (envelope-from git) Date: Thu, 10 Jul 2025 14:42:50 GMT Message-Id: <202507101442.56AEgoC8015143@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: cdd812921605 - main - mlx5_en: wait_for_completion_timeout() takes jiffies 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cdd812921605cf20269ac24faf69750656ec62af Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=cdd812921605cf20269ac24faf69750656ec62af commit cdd812921605cf20269ac24faf69750656ec62af Author: Konstantin Belousov AuthorDate: 2025-07-09 02:35:01 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-10 14:42:27 +0000 mlx5_en: wait_for_completion_timeout() takes jiffies Sponsored by: Nvidia networking --- sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls_rx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls_rx.c b/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls_rx.c index 8b8f2e570245..5f95a03441f9 100644 --- a/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls_rx.c +++ b/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls_rx.c @@ -250,7 +250,8 @@ mlx5e_tls_rx_send_progress_parameters_sync(struct mlx5e_iq *iq, mtx_unlock(&iq->lock); while (1) { - if (wait_for_completion_timeout(&ptag->progress_complete, hz) != 0) + if (wait_for_completion_timeout(&ptag->progress_complete, + msecs_to_jiffies(1000)) != 0) break; priv = container_of(iq, struct mlx5e_channel, iq)->priv; if (priv->mdev->state == MLX5_DEVICE_STATE_INTERNAL_ERROR || From nobody Thu Jul 10 14:42:51 2025 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 4bdHd80xQgz617qC; Thu, 10 Jul 2025 14:42:52 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdHd75rbvz4Mdg; Thu, 10 Jul 2025 14:42:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752158571; 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=Nl4IP9kebxkxw8NlOIrRU4CUU2XDt+5oahbNAX8X1Y0=; b=hmXQWepajpANulmvmzJPadKRZ4PaYLiUsn4cFJCfB1xK/ZmHeWpB/KyIi52IwrDrVwbCJ+ sA2Nn2KnwkbN6Esju0W4R5HN4fZxvrwCqB3dBiDDUfNlUMKLVZn02VWFpsd0ulDkiBJ2Gq qTefR/D84B7Ph3ykPuiWVF1TdWddKLMOa3/2lQju+lVt4twwNjM2I2dSSao95GSBCH6P8v bUiA/ufJHAEDwyMo0v7Ba7OcKXNTnc5Bo6s2G8+CQ1KztqjdqFSQXN/ii2gkJKACir/HIV Co9jdXDuFXoFEuh26E6+EPThws5yq7xDNs1yOWLaw5go3/uFiXHsGug8q5N7zQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752158571; 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=Nl4IP9kebxkxw8NlOIrRU4CUU2XDt+5oahbNAX8X1Y0=; b=ZoOsaW/iFIF65HFjYMvKHBp91ANYR0mMyzQ82SjDFcDGwPn5NVBm/SWbEBRjRwcDRxjX4o Gd/hxfm417kUol02fX/4PlStDR2mb2rWylbYFfR8BNeMVYqBLPCpPJI7CeF1bGcIYUBJ47 daCYlK+lsHMtsHHonXg2+K/zm76JDQ/mSWrwNBzDbfLw2E4K/uEZovfN+nvNtM5Nc7Kd1m uIFSY6gryIRKmkbVfXAOW6ZlJtV8l4PBb8jcsheQSRx2UDp6PjiFOaq2A2nFmeonjRo2c5 1ghOHfkIXMv2Sejpvu5RRlWuoj7I8b+xJ/l5Byl6Tbt+8Gywu4ZrlwOG3rHoXg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752158571; a=rsa-sha256; cv=none; b=erBnx7Oqa1UB0GVyRlxAvLyG7MCniZuL3gbdHM6cJJe4Dyf55KF7nJ8oxxX6hOqrKRewmP 1WTOgnmh/7xXlmnRrNmMxwxYvBSOGWKqPgdqyy+VvbmJP9DJuNsoBBXljbqY6xQvSvKhph 59lLPsXiyHExeetoei3o8OrkWDuG0mDOmVGSk7X+gK3wB80qsMA+i8rizesspkLgFh2s97 ofE63xevnfrDrrFdLBWC646EQxQjtn3GkJ7IOB7dkNSaOwSIY3e273fkJo3TlX1x0U1Yt4 5QWjnIy9eBZaCbehVMX6M16BRU9eKbOvv/1fWb9iMr0WzPcIVS+NApQjgH3bPQ== 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 4bdHd75JZwz1B2q; Thu, 10 Jul 2025 14:42:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56AEgpA5015180; Thu, 10 Jul 2025 14:42:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56AEgpqq015178; Thu, 10 Jul 2025 14:42:51 GMT (envelope-from git) Date: Thu, 10 Jul 2025 14:42:51 GMT Message-Id: <202507101442.56AEgpqq015178@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: b6b3743fa27d - main - mlx5en: add driver tls status string method for rx sessions 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b6b3743fa27dc1d5dc239ea312bec0858b0791fd Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b6b3743fa27dc1d5dc239ea312bec0858b0791fd commit b6b3743fa27dc1d5dc239ea312bec0858b0791fd Author: Ariel Ehrenberg AuthorDate: 2025-07-08 22:22:56 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-10 14:42:27 +0000 mlx5en: add driver tls status string method for rx sessions Upon collecting tls information, kernel calls driver to get driver/hw tls state. Driver calls hw to get its tracking and authentication states, and dump them into the driver state buffer. This requires a sleep to wait for the hw response. Reviewed by: kib Sponsored by: NVidia networking --- sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls_rx.c | 94 +++++++++++++++++++++++++++++++- 1 file changed, 91 insertions(+), 3 deletions(-) diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls_rx.c b/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls_rx.c index 5f95a03441f9..4de451f1b039 100644 --- a/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls_rx.c +++ b/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls_rx.c @@ -42,13 +42,30 @@ static if_snd_tag_free_t mlx5e_tls_rx_snd_tag_free; static if_snd_tag_modify_t mlx5e_tls_rx_snd_tag_modify; +static if_snd_tag_status_str_t mlx5e_tls_rx_snd_tag_status_str; static const struct if_snd_tag_sw mlx5e_tls_rx_snd_tag_sw = { .snd_tag_modify = mlx5e_tls_rx_snd_tag_modify, .snd_tag_free = mlx5e_tls_rx_snd_tag_free, + .snd_tag_status_str = mlx5e_tls_rx_snd_tag_status_str, .type = IF_SND_TAG_TYPE_TLS_RX }; +static const char *mlx5e_tls_rx_progress_params_auth_state_str[] = { + [MLX5E_TLS_RX_PROGRESS_PARAMS_AUTH_STATE_NO_OFFLOAD] = "no_offload", + [MLX5E_TLS_RX_PROGRESS_PARAMS_AUTH_STATE_OFFLOAD] = "offload", + [MLX5E_TLS_RX_PROGRESS_PARAMS_AUTH_STATE_AUTHENTICATION] = + "authentication", +}; + +static const char *mlx5e_tls_rx_progress_params_record_tracker_state_str[] = { + [MLX5E_TLS_RX_PROGRESS_PARAMS_RECORD_TRACKER_STATE_START] = "start", + [MLX5E_TLS_RX_PROGRESS_PARAMS_RECORD_TRACKER_STATE_TRACKING] = + "tracking", + [MLX5E_TLS_RX_PROGRESS_PARAMS_RECORD_TRACKER_STATE_SEARCHING] = + "searching", +}; + MALLOC_DEFINE(M_MLX5E_TLS_RX, "MLX5E_TLS_RX", "MLX5 ethernet HW TLS RX"); /* software TLS RX context */ @@ -332,7 +349,8 @@ done: * Zero is returned upon success, else some error happened. */ static int -mlx5e_tls_rx_receive_progress_parameters(struct mlx5e_iq *iq, struct mlx5e_tls_rx_tag *ptag) +mlx5e_tls_rx_receive_progress_parameters(struct mlx5e_iq *iq, + struct mlx5e_tls_rx_tag *ptag, mlx5e_iq_callback_t *cb) { struct mlx5e_get_tls_progress_params_wqe *wqe; const u32 ds_cnt = DIV_ROUND_UP(sizeof(*wqe), MLX5_SEND_WQE_DS); @@ -368,7 +386,7 @@ mlx5e_tls_rx_receive_progress_parameters(struct mlx5e_iq *iq, struct mlx5e_tls_r memcpy(iq->doorbell.d32, &wqe->ctrl, sizeof(iq->doorbell.d32)); iq->data[pi].num_wqebbs = DIV_ROUND_UP(ds_cnt, MLX5_SEND_WQEBB_NUM_DS); - iq->data[pi].callback = &mlx5e_tls_rx_receive_progress_parameters_cb; + iq->data[pi].callback = cb; iq->data[pi].arg = ptag; m_snd_tag_ref(&ptag->tag); @@ -820,6 +838,7 @@ mlx5e_tls_rx_snd_tag_alloc(if_t ifp, } ptag->flow_rule = flow_rule; + init_completion(&ptag->progress_complete); return (0); @@ -969,7 +988,8 @@ mlx5e_tls_rx_snd_tag_modify(struct m_snd_tag *pmt, union if_snd_tag_modify_param params->tls_rx.tls_rec_length, params->tls_rx.tls_seq_number) && ptag->tcp_resync_pending == 0) { - err = mlx5e_tls_rx_receive_progress_parameters(iq, ptag); + err = mlx5e_tls_rx_receive_progress_parameters(iq, ptag, + &mlx5e_tls_rx_receive_progress_parameters_cb); if (err != 0) { MLX5E_TLS_RX_STAT_INC(ptag, rx_resync_err, 1); } else { @@ -1002,6 +1022,74 @@ mlx5e_tls_rx_snd_tag_free(struct m_snd_tag *pmt) queue_work(priv->tls_rx.wq, &ptag->work); } +static void +mlx5e_tls_rx_str_status_cb(void *arg) +{ + struct mlx5e_tls_rx_tag *ptag; + + ptag = (struct mlx5e_tls_rx_tag *)arg; + complete_all(&ptag->progress_complete); + m_snd_tag_rele(&ptag->tag); +} + +static int +mlx5e_tls_rx_snd_tag_status_str(struct m_snd_tag *pmt, char *buf, size_t *sz) +{ + int err, out_size; + struct mlx5e_iq *iq; + void *buffer; + uint32_t tracker_state_val; + uint32_t auth_state_val; + struct mlx5e_priv *priv; + struct mlx5e_tls_rx_tag *ptag = + container_of(pmt, struct mlx5e_tls_rx_tag, tag); + + if (buf == NULL) + return (0); + + MLX5E_TLS_RX_TAG_LOCK(ptag); + priv = container_of(ptag->tls_rx, struct mlx5e_priv, tls_rx); + iq = mlx5e_tls_rx_get_iq(priv, ptag->flowid, ptag->flowtype); + reinit_completion(&ptag->progress_complete); + err = mlx5e_tls_rx_receive_progress_parameters(iq, ptag, + &mlx5e_tls_rx_str_status_cb); + MLX5E_TLS_RX_TAG_UNLOCK(ptag); + if (err != 0) + return (err); + + for (;;) { + if (wait_for_completion_timeout(&ptag->progress_complete, + msecs_to_jiffies(1000)) != 0) + break; + if (priv->mdev->state == MLX5_DEVICE_STATE_INTERNAL_ERROR || + pci_channel_offline(priv->mdev->pdev) != 0) + return (ENXIO); + } + buffer = mlx5e_tls_rx_get_progress_buffer(ptag); + tracker_state_val = MLX5_GET(tls_progress_params, buffer, + record_tracker_state); + auth_state_val = MLX5_GET(tls_progress_params, buffer, auth_state); + + /* Validate tracker state value is in range */ + if (tracker_state_val > + MLX5E_TLS_RX_PROGRESS_PARAMS_RECORD_TRACKER_STATE_SEARCHING) + return (EINVAL); + + /* Validate auth state value is in range */ + if (auth_state_val > + MLX5E_TLS_RX_PROGRESS_PARAMS_AUTH_STATE_AUTHENTICATION) + return (EINVAL); + + out_size = snprintf(buf, *sz, "tracker_state: %s, auth_state: %s", + mlx5e_tls_rx_progress_params_record_tracker_state_str[ + tracker_state_val], + mlx5e_tls_rx_progress_params_auth_state_str[auth_state_val]); + + if (out_size <= *sz) + *sz = out_size; + return (0); +} + #else int From nobody Thu Jul 10 14:54:45 2025 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 4bdHts51mkz618W9; Thu, 10 Jul 2025 14:54:45 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdHts4R6xz3Cj3; Thu, 10 Jul 2025 14:54:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752159285; 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=vXUkQsCGAg1vy9WKv9GCWQk7ul6NNd6eWms1YBMbB5I=; b=geWWKJQyr5DB4ir3fOwVcimMTlKK83BqirjzyInHudeYowg0o98/q1YAW0FkDNk/G893hf dRs7mNQILFylOlZ2ggvt/B2c0G6sFYiMTKl6pJrFF4SA+Un17cW7NlLaxSWWnSpykXla3U PAzWPfDTZDhu8ohCkn6fvAuNYz8U5qJg73cTAmb4kIDqFiXd731hQHhN/vP1UjaLrLXwqY 37DQwU1Oob/XfGkkZHhkxG4OTgofWqEYbkF9Sg1AAlOVzzCukuJ3sG5iEnTGhXHztY96kj WWFJgcmDoFQj0NeQYJFKTbxkMkSNip7QfjVwq/u8IMd2XgzP3tuDW02Ae5uW8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752159285; 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=vXUkQsCGAg1vy9WKv9GCWQk7ul6NNd6eWms1YBMbB5I=; b=l/4yjHJiTGMR5AlmFZwjYtJr6fRjpS5nyXa9pBhFtwzehDseep5ub5iK6uH0GPWro6lID8 kT/g5xlFJ6nHQRNORh4LSWvTCebe51EcU70LzpD7ROY72F6iTH0ev+BxaQPuXQ10P7DUF+ YgnEbAhA7xvxn4CzTxv+CK7mvRJ1Zp2vZsQ3yEQBLethVExEYp6VQLeVJSlGWXW3f9G1ws mtGSO5LSkzjp+N8t4yx5514yxbs62J3L/5eQNgO+k8aZFKmX0Ll4ZJC7Drix3h+NreIvwz 5wNES3nYiSOhkUrUERWhk9mFH8U9UbcI1lBxpRQqkkoefqlE3g307hCJaMPEqA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752159285; a=rsa-sha256; cv=none; b=AqG7FkroziZoPozdyflmx/lAf3faBzxg1W0qJbZ5lJEmGFpJxsvkIBhsDC8VHV2yBrL8NU mdE5tnTdL8QrCL7mdRoJC63GCoEAnc3+j5m6lZN8spmuU4DyfNfg0ffLbaXopQqqkOAwOP b6uctTi6ANVE6+x+k2GasWZ6y7vA9L3WbYDwOXIyiYZR7gaxj+tCyaancM4a0akCo54Col REWGTZIY3hA5dT75cfOvCHLsredXF6I9W6b+DWG5i0aNnPZCdZptf6KaXI8G9ZIOm1u9y/ tr4B4Icu4J5skSXXK0omw1N2Op01QxSeU7OE9bOckgCsqFYykkICfr3qNBhsrw== 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 4bdHts3xTFz1BDV; Thu, 10 Jul 2025 14:54:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56AEsjDg034731; Thu, 10 Jul 2025 14:54:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56AEsjLT034728; Thu, 10 Jul 2025 14:54:45 GMT (envelope-from git) Date: Thu, 10 Jul 2025 14:54:45 GMT Message-Id: <202507101454.56AEsjLT034728@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 83e351780f63 - main - nfsv4: No need to check va_flags twice. 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 83e351780f634657b74405b8059a1683d01baf4a Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=83e351780f634657b74405b8059a1683d01baf4a commit 83e351780f634657b74405b8059a1683d01baf4a Author: Dag-Erling Smørgrav AuthorDate: 2025-07-10 14:53:13 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-07-10 14:54:41 +0000 nfsv4: No need to check va_flags twice. Fixes: c5d72d29fe0e Reviewed by: rmacklem --- sys/fs/nfsclient/nfs_clvnops.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sys/fs/nfsclient/nfs_clvnops.c b/sys/fs/nfsclient/nfs_clvnops.c index fbfcdafaa06b..fa451887e73e 100644 --- a/sys/fs/nfsclient/nfs_clvnops.c +++ b/sys/fs/nfsclient/nfs_clvnops.c @@ -1096,12 +1096,11 @@ nfs_setattr(struct vop_setattr_args *ap) /* * Disallow write attempts if the filesystem is mounted read-only. */ - if ((vap->va_flags != VNOVAL || vap->va_uid != (uid_t)VNOVAL || + if ((vap->va_flags != (u_long)VNOVAL || vap->va_uid != (uid_t)VNOVAL || vap->va_gid != (gid_t)VNOVAL || vap->va_atime.tv_sec != VNOVAL || vap->va_mtime.tv_sec != VNOVAL || vap->va_birthtime.tv_sec != VNOVAL || - vap->va_mode != (mode_t)VNOVAL || - vap->va_flags != (u_long)VNOVAL) && + vap->va_mode != (mode_t)VNOVAL) && (vp->v_mount->mnt_flag & MNT_RDONLY)) return (EROFS); if (vap->va_size != VNOVAL) { From nobody Thu Jul 10 17:03:53 2025 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 4bdLlt0bK3z61HZn; Thu, 10 Jul 2025 17:03:54 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdLls6p9Yz3ss5; Thu, 10 Jul 2025 17:03:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752167034; 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=g81bXJ1UcII7vpfbZ0QoRtwZT0mcl68lmhFr4NBPeIc=; b=YiDSK9kYX3wIyx1b0Pis2NUZ7FQHo7ApxxYsp/5kfTlXIIm3lsOWdZcYopDUbcNXeJlR14 8HsMylqVU2eNqaVXinCNMXD8uOW/OLFU2er5XFDv3YBYM1DDpcGQfaCcWuXQsoC3EKq05q aRZ/moYOWC3PGqjQSZ7EfAGc/vxeShvPtqb+FGwEVYvYA9fOZ31C/fkmVfyTwJnju7+hOC jFfUjeHFg1godrYs2Om/MRmUBmo9fc/b/VFI/bOAwqCZJt9TXusTSO0Wvim4NfLQQu1EXl itbePNVzoHmgcLbzMiDbt+syKrkXdcUN8MHLxIxy6RJtrcRjP2OwaSxjQItXPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752167034; 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=g81bXJ1UcII7vpfbZ0QoRtwZT0mcl68lmhFr4NBPeIc=; b=E6oMXyeXDtf2+aCEhRE+kQmBvcRxn9smD0ECpIUx6VGQKhZlqWKTg5esNdXgrWpFb3FfWs rUvw1vkyA4MwK4ynYh3JWo8enIvEKOKrl7fE+oJuozfKHqE51VC+3Wz+XYtRLdeEyP1epl hIuA7qkm+BVprMaznzG8/Bysb+QYn2WRed0iisrvRdNUOlItabIKE10/hRirqvO64EHkth qXP4HUQzTaWBxxjRa8+oPHRYh7RaOT7lNcioBd6dWlT+ioCaOnRkblTGBOK3M9IddarOQY zBOM2wJ4Nog66Qn2HsJqI+WpGwltBLUa0c81ZpXjWDyru8RZLraGxWrEVTeDyA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752167034; a=rsa-sha256; cv=none; b=bE4nS8OK03gLfpJYPK+cGTe5U9EH1WxcI0YIFEexTUcZooYiS0NeP2aT/n7vqGpetRmCzH UNKTaKvxkCEAh5TJDtETWHNJkSoKp8wFU7+bjil6tsl/NSBsnYAgfwqPF3MUinsV2atzlj KXptab2KO1o8mRIrE7WQOAlvqO4lfri1tIeQdr1xCXVMut+H/49bWFojFC6w35kqtLpl8H rzKTPAPPHD9ri2iieQ1ZFMynnWC4eTXMGKLxXUcMez403lY0L1jGxFzDOmk51kipw+Jq8s a3YyYCpN4K5XPNAzgv3DoPdOI/ORtjmzJlMbI7FjeQ88gkn/ruVJEOhjl8tVgQ== 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 4bdLls6Msmz1FWq; Thu, 10 Jul 2025 17:03:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56AH3rql078917; Thu, 10 Jul 2025 17:03:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56AH3rQk078914; Thu, 10 Jul 2025 17:03:53 GMT (envelope-from git) Date: Thu, 10 Jul 2025 17:03:53 GMT Message-Id: <202507101703.56AH3rQk078914@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: cad5cfe7507e - main - cam: Use less stack space 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cad5cfe7507e1b63f8898183da057aa1f0240e39 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=cad5cfe7507e1b63f8898183da057aa1f0240e39 commit cad5cfe7507e1b63f8898183da057aa1f0240e39 Author: Warner Losh AuthorDate: 2025-07-10 15:56:13 +0000 Commit: Warner Losh CommitDate: 2025-07-10 16:17:00 +0000 cam: Use less stack space Use less stack space by using the specific type of ccb to do the callback. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D51215 --- sys/cam/cam_periph.c | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/sys/cam/cam_periph.c b/sys/cam/cam_periph.c index 833df6cfb99b..2cf1ef5f53ef 100644 --- a/sys/cam/cam_periph.c +++ b/sys/cam/cam_periph.c @@ -767,27 +767,31 @@ camperiphfree(struct cam_periph *periph) CAM_DEBUG(periph->path, CAM_DEBUG_INFO, ("Periph destroyed\n")); if (periph->flags & CAM_PERIPH_NEW_DEV_FOUND) { - union ccb ccb; - void *arg; - - memset(&ccb, 0, sizeof(ccb)); switch (periph->deferred_ac) { - case AC_FOUND_DEVICE: - ccb.ccb_h.func_code = XPT_GDEV_TYPE; - xpt_setup_ccb(&ccb.ccb_h, periph->path, CAM_PRIORITY_NORMAL); - xpt_action(&ccb); - arg = &ccb; + case AC_FOUND_DEVICE: { + struct ccb_getdev cgd; + + memset(&cgd, 0, sizeof(cgd)); + cgd.ccb_h.func_code = XPT_GDEV_TYPE; + xpt_setup_ccb(&cgd.ccb_h, periph->path, CAM_PRIORITY_NORMAL); + xpt_action((union ccb *)&cgd); + periph->deferred_callback(NULL, periph->deferred_ac, + periph->path, &cgd); break; - case AC_PATH_REGISTERED: - xpt_path_inq(&ccb.cpi, periph->path); - arg = &ccb; + } + case AC_PATH_REGISTERED: { + struct ccb_pathinq cpi; + + xpt_path_inq(&cpi, periph->path); + periph->deferred_callback(NULL, periph->deferred_ac, + periph->path, &cpi); break; + } default: - arg = NULL; + periph->deferred_callback(NULL, periph->deferred_ac, + periph->path, NULL); break; } - periph->deferred_callback(NULL, periph->deferred_ac, - periph->path, arg); } xpt_free_path(periph->path); free(periph, M_CAMPERIPH); From nobody Thu Jul 10 17:03:54 2025 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 4bdLlv3B1mz61Hnf; Thu, 10 Jul 2025 17:03:55 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdLlv0wjGz3smn; Thu, 10 Jul 2025 17:03:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752167035; 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=FLofmSqM8xj1QPsBTcLvw7KWWILzKApxIymH33H50fw=; b=PWMZaTj82sszV90sgNfOU/9OG+wzsMVHJLx6Z0vPjKl6KlE60XbeDC5SH6GBtchncN6nGe bxJIaDt4yp+Id138ajfER5x3Y1choHglwrjnLFzW9oHlIX3vAZoKV0agZ5/tkOMDDQrPFA oQkQYqgGNnwefcofVqyk7Kj045gBjTcERk2hhUD7eOzIadFi/MMfFp+qVQGNZQGpT3cY4+ KNTk2vGgIZIY4DbeD6H5qCvWftcucev/jxPSpkou3qa/xG8kIRaXfVmcrlSDvTrJQD9zJy Fn6v/lMvMujp3aPrDV48D/BqdnOGVsXEptDE3Z+2WDDkGL2/2Hdj6xws/6Iu5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752167035; 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=FLofmSqM8xj1QPsBTcLvw7KWWILzKApxIymH33H50fw=; b=KBlxhmsJMMyZZPUkwewbGGHW1gDMq/BtjSzHoL/WFhyQmF/zNAqrBObxlHKDc8OLrvWoMX aDkPufiGB8GegZo0kQ3SPzeHsMA/xBTw52dFF/mh0MDrrrAcpv39Sso0WZQ4rhdldJfhiA /hjB/ym6X1gOI3tbFiHayME5rNPRjQPAVIXuyKlO0YFF56SEjECas61Du1w1HFi0ET+uTx LVo8CfngwAzTG8wsmoumEK/SpEsAavCx/5+PrVy5/ztXxLSXbmOhtlvgr4t2aMp2iehNyD 2AhNgTl7otgbGd9vAnSp6221PhZ6FZm2+4W1t7kOdxRfxVJvvwwFxiPW5e8jqg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752167035; a=rsa-sha256; cv=none; b=yB0khSbSyU1KJIBkq2gK3MH/r+sxuwheu3q67MRKNekMh0sxkvtrnO8eqxuRi379c0Qy5c 3MgSWNl4+++ATOqpnoXrMzqxuqbKNEVIYrqSevZV2B1s40vr5lY0ZieAEtld0LR3y+3rjf idvvn0r1W2cfhRcRc5AMuoGgHHmvjHCLg3180P+at1lpQ9+qQOOjjaCk0A8dQ98OrkupUg NlZDXXZnimvMPYWg8JVriq/YNwsuolK57ljqg4+X68/ZsGONPK3+j3Rc4Q45W3BdRGvNOA XuUL3an6QLkAIrnZaFPEZu8AHVjdVtlk9/45+zO4iEbY2pt/mDJtDt1EWLjPGw== 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 4bdLlv0K3Fz1FvD; Thu, 10 Jul 2025 17:03:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56AH3sTL078953; Thu, 10 Jul 2025 17:03:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56AH3sMV078950; Thu, 10 Jul 2025 17:03:54 GMT (envelope-from git) Date: Thu, 10 Jul 2025 17:03:54 GMT Message-Id: <202507101703.56AH3sMV078950@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 5a656ef632de - main - cam: Add xpt_gdev_type() and use it instead of many copies of same 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5a656ef632de2f363f37484b0128aa60b688bf32 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=5a656ef632de2f363f37484b0128aa60b688bf32 commit 5a656ef632de2f363f37484b0128aa60b688bf32 Author: Warner Losh AuthorDate: 2025-07-10 15:56:20 +0000 Commit: Warner Losh CommitDate: 2025-07-10 16:17:00 +0000 cam: Add xpt_gdev_type() and use it instead of many copies of same Add a convenience wrapper to XPT_GDEV_TYPE in the same way we have one for XPT_PATH_INQ. The changes from PRIORITY_NORMAL to PRIORITY_NONE are intentional because this isn't a queued CCB. Please note: we have several places still that construct a XPT_GDEV_TYPE message by overwriting a CCB that happens to be laying around. I've not used this method, by and large, in those places since I didn't want to risk upsetting allocation flags that might be present (since we use a specail allocator for some CCB types in *_da.c). Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D51216 --- sys/cam/ata/ata_da.c | 5 +---- sys/cam/cam_periph.c | 16 +++------------- sys/cam/cam_xpt.c | 5 +---- sys/cam/cam_xpt.h | 18 ++++++++++++++++-- sys/cam/mmc/mmc_da.c | 5 +---- sys/cam/scsi/scsi_all.c | 12 ++---------- sys/cam/scsi/scsi_cd.c | 8 +------- sys/cam/scsi/scsi_ch.c | 6 +----- sys/cam/scsi/scsi_da.c | 6 +----- sys/cam/scsi/scsi_enc_ses.c | 5 +---- sys/cam/scsi/scsi_sa.c | 7 +------ 11 files changed, 29 insertions(+), 64 deletions(-) diff --git a/sys/cam/ata/ata_da.c b/sys/cam/ata/ata_da.c index ae7cf14c8f8e..1facab47473c 100644 --- a/sys/cam/ata/ata_da.c +++ b/sys/cam/ata/ata_da.c @@ -1359,10 +1359,7 @@ adaasync(void *callback_arg, uint32_t code, case AC_GETDEV_CHANGED: { softc = (struct ada_softc *)periph->softc; - memset(&cgd, 0, sizeof(cgd)); - xpt_setup_ccb(&cgd.ccb_h, periph->path, CAM_PRIORITY_NORMAL); - cgd.ccb_h.func_code = XPT_GDEV_TYPE; - xpt_action((union ccb *)&cgd); + xpt_gdev_type(&cgd, periph->path); /* * Update our information based on the new Identify data. diff --git a/sys/cam/cam_periph.c b/sys/cam/cam_periph.c index 2cf1ef5f53ef..730656684e2a 100644 --- a/sys/cam/cam_periph.c +++ b/sys/cam/cam_periph.c @@ -771,10 +771,7 @@ camperiphfree(struct cam_periph *periph) case AC_FOUND_DEVICE: { struct ccb_getdev cgd; - memset(&cgd, 0, sizeof(cgd)); - cgd.ccb_h.func_code = XPT_GDEV_TYPE; - xpt_setup_ccb(&cgd.ccb_h, periph->path, CAM_PRIORITY_NORMAL); - xpt_action((union ccb *)&cgd); + xpt_gdev_type(&cgd, periph->path); periph->deferred_callback(NULL, periph->deferred_ac, periph->path, &cgd); break; @@ -1686,10 +1683,7 @@ camperiphscsisenseerror(union ccb *ccb, union ccb **orig, /* * Grab the inquiry data for this device. */ - memset(&cgd, 0, sizeof(cgd)); - xpt_setup_ccb(&cgd.ccb_h, ccb->ccb_h.path, CAM_PRIORITY_NORMAL); - cgd.ccb_h.func_code = XPT_GDEV_TYPE; - xpt_action((union ccb *)&cgd); + xpt_gdev_type(&cgd, ccb->ccb_h.path); err_action = scsi_error_action(&ccb->csio, &cgd.inq_data, sense_flags); @@ -2137,11 +2131,7 @@ cam_periph_devctl_notify(union ccb *ccb) sbuf_cat(&sb, "serial=\""); if ((cgd = (struct ccb_getdev *)xpt_alloc_ccb_nowait()) != NULL) { - xpt_setup_ccb(&cgd->ccb_h, ccb->ccb_h.path, - CAM_PRIORITY_NORMAL); - cgd->ccb_h.func_code = XPT_GDEV_TYPE; - xpt_action((union ccb *)cgd); - + xpt_gdev_type(cgd, ccb->ccb_h.path); if (cgd->ccb_h.status == CAM_REQ_CMP) sbuf_bcat(&sb, cgd->serial_num, cgd->serial_num_len); xpt_free_ccb((union ccb *)cgd); diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c index 38bc82c69aad..2ec736e7f4ac 100644 --- a/sys/cam/cam_xpt.c +++ b/sys/cam/cam_xpt.c @@ -2471,15 +2471,12 @@ xptsetasyncfunc(struct cam_ed *device, void *arg) if ((device->flags & CAM_DEV_UNCONFIGURED) != 0) return (1); - memset(&cgd, 0, sizeof(cgd)); xpt_compile_path(&path, NULL, device->target->bus->path_id, device->target->target_id, device->lun_id); - xpt_setup_ccb(&cgd.ccb_h, &path, CAM_PRIORITY_NORMAL); - cgd.ccb_h.func_code = XPT_GDEV_TYPE; - xpt_action((union ccb *)&cgd); + xpt_gdev_type(&cgd, &path); csa->callback(csa->callback_arg, AC_FOUND_DEVICE, &path, &cgd); diff --git a/sys/cam/cam_xpt.h b/sys/cam/cam_xpt.h index 57225a0ae92d..3815f42cba40 100644 --- a/sys/cam/cam_xpt.h +++ b/sys/cam/cam_xpt.h @@ -145,8 +145,8 @@ uint32_t xpt_poll_setup(union ccb *start_ccb); void xpt_sim_poll(struct cam_sim *sim); /* - * Perform a path inquiry at the request priority. bzero may be redundant for - * allocated CCBs, but for the on-stack CCBs it's required. + * Perform a path inquiry. bzero may be redundant for allocated CCBs, but for + * the on-stack CCBs it's required. */ static inline void xpt_path_inq(struct ccb_pathinq *cpi, struct cam_path *path) @@ -158,6 +158,20 @@ xpt_path_inq(struct ccb_pathinq *cpi, struct cam_path *path) xpt_action((union ccb *)cpi); } +/* + * Perform get device type. bzero may be redundant for allocated CCBs, but for + * the on-stack CCBs it's required. + */ +static inline void +xpt_gdev_type(struct ccb_getdev *cgd, struct cam_path *path) +{ + + bzero(cgd, sizeof(*cgd)); + xpt_setup_ccb(&cgd->ccb_h, path, CAM_PRIORITY_NONE); + cgd->ccb_h.func_code = XPT_GDEV_TYPE; + xpt_action((union ccb *)cgd); +} + #endif /* _KERNEL */ #endif /* _CAM_CAM_XPT_H */ diff --git a/sys/cam/mmc/mmc_da.c b/sys/cam/mmc/mmc_da.c index f7c478076144..7f8bf3516804 100644 --- a/sys/cam/mmc/mmc_da.c +++ b/sys/cam/mmc/mmc_da.c @@ -692,10 +692,7 @@ sddaasync(void *callback_arg, uint32_t code, case AC_GETDEV_CHANGED: { CAM_DEBUG(path, CAM_DEBUG_TRACE, ("=> AC_GETDEV_CHANGED\n")); - memset(&cgd, 0, sizeof(cgd)); - xpt_setup_ccb(&cgd.ccb_h, periph->path, CAM_PRIORITY_NORMAL); - cgd.ccb_h.func_code = XPT_GDEV_TYPE; - xpt_action((union ccb *)&cgd); + xpt_gdev_type(&cgd, periph->path); cam_periph_async(periph, code, path, arg); break; } diff --git a/sys/cam/scsi/scsi_all.c b/sys/cam/scsi/scsi_all.c index 13a376ebb6e3..b518f84454ad 100644 --- a/sys/cam/scsi/scsi_all.c +++ b/sys/cam/scsi/scsi_all.c @@ -3708,11 +3708,7 @@ scsi_command_string(struct cam_device *device, struct ccb_scsiio *csio, /* * Get the device information. */ - xpt_setup_ccb(&cgd->ccb_h, - csio->ccb_h.path, - CAM_PRIORITY_NORMAL); - cgd->ccb_h.func_code = XPT_GDEV_TYPE; - xpt_action((union ccb *)cgd); + xpt_gdev_type(cgd, csio->ccb_h.path); /* * If the device is unconfigured, just pretend that it is a hard @@ -5144,11 +5140,7 @@ scsi_sense_sbuf(struct cam_device *device, struct ccb_scsiio *csio, /* * Get the device information. */ - xpt_setup_ccb(&cgd->ccb_h, - csio->ccb_h.path, - CAM_PRIORITY_NORMAL); - cgd->ccb_h.func_code = XPT_GDEV_TYPE; - xpt_action((union ccb *)cgd); + xpt_gdev_type(cgd, csio->ccb_h.path); /* * If the device is unconfigured, just pretend that it is a hard diff --git a/sys/cam/scsi/scsi_cd.c b/sys/cam/scsi/scsi_cd.c index 00a417f65052..e622a96ec77e 100644 --- a/sys/cam/scsi/scsi_cd.c +++ b/sys/cam/scsi/scsi_cd.c @@ -1240,13 +1240,7 @@ cddone(struct cam_periph *periph, union ccb *done_ccb) /*getcount_only*/0); status = done_ccb->ccb_h.status; - - bzero(&cgd, sizeof(cgd)); - xpt_setup_ccb(&cgd.ccb_h, - done_ccb->ccb_h.path, - CAM_PRIORITY_NORMAL); - cgd.ccb_h.func_code = XPT_GDEV_TYPE; - xpt_action((union ccb *)&cgd); + xpt_gdev_type(&cgd, done_ccb->ccb_h.path); if (scsi_extract_sense_ccb(done_ccb, &error_code, &sense_key, &asc, &ascq)) diff --git a/sys/cam/scsi/scsi_ch.c b/sys/cam/scsi/scsi_ch.c index 89a817c1b488..3da22ba61392 100644 --- a/sys/cam/scsi/scsi_ch.c +++ b/sys/cam/scsi/scsi_ch.c @@ -1705,11 +1705,7 @@ chscsiversion(struct cam_periph *periph) /* * Get the device information. */ - xpt_setup_ccb(&cgd->ccb_h, - periph->path, - CAM_PRIORITY_NORMAL); - cgd->ccb_h.func_code = XPT_GDEV_TYPE; - xpt_action((union ccb *)cgd); + xpt_gdev_type(cgd, periph->path); if (cgd->ccb_h.status != CAM_REQ_CMP) { xpt_free_ccb((union ccb *)cgd); diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c index 0a2389cd9b5d..9eda664ee7b0 100644 --- a/sys/cam/scsi/scsi_da.c +++ b/sys/cam/scsi/scsi_da.c @@ -5035,11 +5035,7 @@ dadone_proberc(struct cam_periph *periph, union ccb *done_ccb) /*timeout*/0, /*getcount_only*/0); - memset(&cgd, 0, sizeof(cgd)); - xpt_setup_ccb(&cgd.ccb_h, done_ccb->ccb_h.path, - CAM_PRIORITY_NORMAL); - cgd.ccb_h.func_code = XPT_GDEV_TYPE; - xpt_action((union ccb *)&cgd); + xpt_gdev_type(&cgd, done_ccb->ccb_h.path); if (scsi_extract_sense_ccb(done_ccb, &error_code, &sense_key, &asc, &ascq)) diff --git a/sys/cam/scsi/scsi_enc_ses.c b/sys/cam/scsi/scsi_enc_ses.c index c429e820a1fd..435874a9874a 100644 --- a/sys/cam/scsi/scsi_enc_ses.c +++ b/sys/cam/scsi/scsi_enc_ses.c @@ -979,10 +979,7 @@ ses_paths_iter(enc_softc_t *enc, enc_element_t *elm, != CAM_REQ_CMP) return; - memset(&cgd, 0, sizeof(cgd)); - xpt_setup_ccb(&cgd.ccb_h, path, CAM_PRIORITY_NORMAL); - cgd.ccb_h.func_code = XPT_GDEV_TYPE; - xpt_action((union ccb *)&cgd); + xpt_gdev_type(&cgd, path); if (cam_ccb_success((union ccb *)&cgd)) callback(enc, elm, path, callback_arg); diff --git a/sys/cam/scsi/scsi_sa.c b/sys/cam/scsi/scsi_sa.c index cfd48c98f30e..88147393192f 100644 --- a/sys/cam/scsi/scsi_sa.c +++ b/sys/cam/scsi/scsi_sa.c @@ -4731,12 +4731,7 @@ saextget(struct cdev *dev, struct cam_periph *periph, struct sbuf *sb, SASBADDVARSTR(sb, indent, periph->periph_name, %s, periph_name, strlen(periph->periph_name) + 1); SASBADDUINT(sb, indent, periph->unit_number, %u, unit_number); - memset(&cgd, 0, sizeof(cgd)); - xpt_setup_ccb(&cgd.ccb_h, - periph->path, - CAM_PRIORITY_NORMAL); - cgd.ccb_h.func_code = XPT_GDEV_TYPE; - xpt_action((union ccb *)&cgd); + xpt_gdev_type(&cgd, periph->path); if ((cgd.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { g->status = MT_EXT_GET_ERROR; snprintf(g->error_str, sizeof(g->error_str), From nobody Thu Jul 10 17:03:56 2025 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 4bdLlw4MvFz61HhL; Thu, 10 Jul 2025 17:03:56 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdLlw1hsSz3sbT; Thu, 10 Jul 2025 17:03:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752167036; 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=D9AvvtslT+j+c8PRCPCJ8XlXqQqGknbzX9yFF6bPrBQ=; b=pjdyG9nsB0v9YBfDX8E5GCDTALwwb8X/06CK6jTdpF/vGYeWayiMYWiqdsdzTYiGZq4HaI 0HoZOY3rP+yeWixjWaadiGINEskI/7c+/vreXCWRaenA0yVChWBWmqVH1RZ/sYKI7rTQcr 9XJDhaqRbKQqnot/WyeIPP6PP8O0+qHDt315GhENrO+LkZzLGQEBRiKngHrb+kjAapl8gw GTFN81d6db6KI2itXtWIy58Ma8bDkpQBThBDuG6IVUCcuPt88Pxe/ga3lXlxuxDrB2x1JI PGteNa6Q6VW+Jtt7tlHqy8RGs8PWs33XUUebbYT2Vny6OcaO+0M458r6Qkoggg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752167036; 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=D9AvvtslT+j+c8PRCPCJ8XlXqQqGknbzX9yFF6bPrBQ=; b=XqlP4+4UpWiFvz2y5Uh8y82zJyAJIpsBjeutSE6uXbaPBCsiOrsaydUzLYiQJ6pN8EZ/wH 4/p121VEkMtj9/bx4A5eHg24zOCYQCK+GzKQo6ubB8wJmNiz8K5KBiypeav9J9hcqi6Svh nv9KQJXWa62H5LbUr1YY6YF/EQfcDdJ+UYEqWg9y4B6zf8O34jVpdYRkz/m4N/Mky5Nk89 +yoAlJdv+sa4gFNHnEARaIxKm3Ho+oZfhRNgpSdAX83t+0l0KTQJaEvcaTxd9AadYJtXXe Be0San6XKAtZhCXmchJ+0mfGP28w4ewQoQttD8KvOEZr+RbP7QYEthHwq7LXnQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752167036; a=rsa-sha256; cv=none; b=uCsQC8vgMuXhhl2ERsdnswNR+sc2m6EMgmCxgLlTjnB1pVBw+1NHjX6mmPeoohSdEdq2/a S9BRWSp20x3V5hBv/CTdsOtNpsh8E4Z2+/v/TFVT0OTUOMsAwyVgJD4kxrRtxK/E+LjE7n 3PLhorGYtw/sI7vpq+gdwuEj7n4fUozDXwofmogK23RjydTiOUPBqJ+Y92TtCYQREn+5EC ZjHv4ozA4ZShmwMUGlp372Dmmo89XObge1XNWOIhNLmFNANmfUyw3AP55nNzaHqJt4/o2c /DkNv91cMiEQRi3UB3gH/ZMisXDkBSCMeS78UHNdrwMeRnofCCMRRNTvBJ34Gw== 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 4bdLlw1FfPz1G2x; Thu, 10 Jul 2025 17:03:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56AH3uE0078988; Thu, 10 Jul 2025 17:03:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56AH3uEj078985; Thu, 10 Jul 2025 17:03:56 GMT (envelope-from git) Date: Thu, 10 Jul 2025 17:03:56 GMT Message-Id: <202507101703.56AH3uEj078985@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: d78d04b17cb2 - main - cam: Fail the disk if READ CAPACITY returns 4/2 asc/ascq 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d78d04b17cb2498186e8fd2681f224a760e75b28 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=d78d04b17cb2498186e8fd2681f224a760e75b28 commit d78d04b17cb2498186e8fd2681f224a760e75b28 Author: Warner Losh AuthorDate: 2025-07-10 15:56:26 +0000 Commit: Warner Losh CommitDate: 2025-07-10 16:17:01 +0000 cam: Fail the disk if READ CAPACITY returns 4/2 asc/ascq HGST disks that are sick are returning 44/0 for START UNIT (which we ignore) and then 4/2 on READ CAPACITY. START UNIT should be enough for READ CAPACITY to succeed or UNIT ATTENTION. However, we get NOT_READ + 4/2 back. I've seen this on several models of HGST drives. Invalidate the peripheral when we detect this condition. This is likely the least bad thing we can do: It removes access to daX, but leaves passY so logs may be extracted (if awkwardly). Removing daX access removes the disk device that causes problems to geom outlined below. Although the timeout is 5s for READ_CAPACITY, we wait the full 30s for READ_CAPACITY_16. This causes us to stall booting as we start to taste as soon as we release the final hold... but the tasting means g_wait_idle() takes now takes over 5 minutes to clear since we do this for all the opens. Even using a timeout of 3s instead of 30s leads to boot times of almost 5 minutes in these cases, so there are other, downstream operations that are taking a while, so it's not just a matter of adjusting the timeout. Failing the periph early solves the bulk of this problem (the tasting related delays). What the HBA does is HBA specific and some have firmwares that are also confused by this when they enumerate or discover the drive, leading to long (but still shorter than 5 minute) delays. This patch won't solve that aspect of startup delays with sick disks. Perhaps we should fail the periph when START UNIT fails with the same codes we check in the read capacity path. I'm reluctant to do such a global change since it's in cam_periph, and there seems no good way to flag that we want this behavior. It's also a bit magical when it runs (some drive report 44/0 always, and some just report it on START UNIT, and these HGST drive fall into the latter category). Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D51218 --- sys/cam/scsi/scsi_da.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c index 9eda664ee7b0..d02750aaacaf 100644 --- a/sys/cam/scsi/scsi_da.c +++ b/sys/cam/scsi/scsi_da.c @@ -5073,6 +5073,18 @@ dadone_proberc(struct cam_periph *periph, union ccb *done_ccb) * behind a SATL translation that's fallen into a * terminally fatal state. * + * 4/2 happens on some HGST drives that are quite + * ill. We've already sent the start unit command (for + * which we ignore a 44/0 asc/ascq, which I'm hesitant + * to change since it's so basic and there's other error + * conditions to the START UNIT we should ignore). So to + * require initialization at this point when it should + * be fine implies to me, at least, that we should + * invalidate. Since we do read capacity in geom tasting + * a lot, and since this timeout is long, this leads to + * up to a 10 minute delay in booting. + * + * 4/2: LOGICAL UNIT NOT READY, INITIALIZING COMMAND REQUIRED * 25/0: LOGICAL UNIT NOT SUPPORTED * 44/0: INTERNAL TARGET FAILURE * 44/1: PERSISTENT RESERVATION INFORMATION LOST @@ -5080,6 +5092,7 @@ dadone_proberc(struct cam_periph *periph, union ccb *done_ccb) */ if ((have_sense) && (asc != 0x25) && (asc != 0x44) + && (asc != 0x04 && ascq != 0x02) && (error_code == SSD_CURRENT_ERROR || error_code == SSD_DESC_CURRENT_ERROR)) { const char *sense_key_desc; From nobody Thu Jul 10 17:54:29 2025 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 4bdMtG1mDdz61LGc; Thu, 10 Jul 2025 17:54: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdMtG133qz3JnY; Thu, 10 Jul 2025 17:54:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752170070; 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=mmcgYoSJKVuxEKhRCsvY6JMTJwYd2DgRjqKn+ED0ewc=; b=mCKDH52yPNlML28Yztt1agfgZAYr2UimMCvoHbg7Phsk0OYJ3gPTtSY8FcMUAC8ix/JL1s SFR+fJWKL9Pb1EDP3vOwdIbPcygZav1eq/Sw3pMG5qHkgYLpfLyjVS0/9yCqwB/Gg29cF2 KckvuKGBvWgPFPzZ3pB6KFpmKDd9oN56XBu6Z1eNJrYMF+IABPxK9pyzSrNxi5cRU9Ofrt P5c48/RwK4/YVcdldg1BS8A2PpG8xAguhijxrrWfCqZb2netPo1qeI77OTorzgbQNqTKAR WrJzcRBGuHP9vmTOu71Qd7zAr0QIEOiZUknim6IVPSc5M4gYNNRKg7vqoPW99A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752170070; 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=mmcgYoSJKVuxEKhRCsvY6JMTJwYd2DgRjqKn+ED0ewc=; b=iwgwklag3IuEvUW0zwL0tf8PRMKRxcKpPIkej4mh6WvWM6+dJIu5C/sxVarqNNemdphvVo CRIo/Ke0xBuYgoRSfVGaAQSweYnkTXBnYoFlt3H1T44gNSXt5GpmC1qWNfPlHtNrMg2M2u 6UjgIXoZl3hXRYDavixptXUtPPp/k1aV+skwd+czRTrTvSbuCZfrg990nrqX+XiqBsYpai 1r0t4w5BkamlQC3cHm/9BBNBiDDHaxNjwzytYH9p3fI4iCBrT20qCUmscxnfebnx49kbiH D5R+VkKVYn/Z+5dXbHbb6DdgJD37xWHf67o4G0TrbtGNs7AVA055fCHKtOcThA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752170070; a=rsa-sha256; cv=none; b=YgGBi2gKz4WIU0jHzqv9ozNouSDGA1Ffl4svJe2iiThOg+zOlNXG53axYGTDKqLXIQBaf1 ntwgXS5BBViLjHfxRDTVGqa1y5FSe0DTEDobRNzJfiClShA0GzNVBgaYlYYDL/sxlH8H1f Xvr9/4OdJTPGQuXRhdIhXSI8Q2OHT0dohtMZbaxsEop1Uvhi+yHHWfG+imVok3zyy50vi2 yO1LdE/wFnXo5U7PmADdlvsRMn7OPm89vgjXIydJ56xpFyEoNDF1nbGx5ehVScwyl6Ssbv Kcw1//Bz7IqLOZ6UyoFuU01MvetO/7Y0fAh4xtn1+U2EAxZ/HrDt0dwSQ1G7zQ== 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 4bdMtG06VPz1GKj; Thu, 10 Jul 2025 17:54:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56AHsTq8072041; Thu, 10 Jul 2025 17:54:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56AHsTqf072038; Thu, 10 Jul 2025 17:54:29 GMT (envelope-from git) Date: Thu, 10 Jul 2025 17:54:29 GMT Message-Id: <202507101754.56AHsTqf072038@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: df268d4b03a1 - main - lockf: add a -p mode to write the child's pid 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: df268d4b03a16869502d6842d40aeb66329db982 Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=df268d4b03a16869502d6842d40aeb66329db982 commit df268d4b03a16869502d6842d40aeb66329db982 Author: Kyle Evans AuthorDate: 2025-06-24 15:41:53 +0000 Commit: Kyle Evans CommitDate: 2025-07-10 17:54:19 +0000 lockf: add a -p mode to write the child's pid If we're going to hold the lock, it can be useful to scribble down the pid that we spawned off to quickly associate the lock back to the process that's keeping it open. Reviewed by: allanjude (previous version), des Differential Revision: https://reviews.freebsd.org/D51014 --- usr.bin/lockf/lockf.1 | 14 ++++++++++++-- usr.bin/lockf/lockf.c | 15 ++++++++++++--- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/usr.bin/lockf/lockf.1 b/usr.bin/lockf/lockf.1 index d73033101632..5832903246f1 100644 --- a/usr.bin/lockf/lockf.1 +++ b/usr.bin/lockf/lockf.1 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd November 25, 2023 +.Dd June 24, 2025 .Dt LOCKF 1 .Os .Sh NAME @@ -30,7 +30,7 @@ .Nd execute a command while holding a file lock .Sh SYNOPSIS .Nm -.Op Fl knsw +.Op Fl knpsw .Op Fl t Ar seconds .Ar file .Ar command @@ -126,6 +126,16 @@ is not specified, will create .Ar file if necessary. +.It Fl p +Write the pid of the +.Ar command +to +.Ar file . +This option will cause +.Nm +to open +.Ar file +for writing rather than reading. .It Fl t Ar seconds Specifies a timeout for waiting for the lock. By default, diff --git a/usr.bin/lockf/lockf.c b/usr.bin/lockf/lockf.c index 7f88753d1743..93164e30762c 100644 --- a/usr.bin/lockf/lockf.c +++ b/usr.bin/lockf/lockf.c @@ -91,15 +91,15 @@ fdlock_implied(const char *name, long *ofd) int main(int argc, char **argv) { - int ch, flags, silent, status; + int ch, flags, silent, status, writepid; long long waitsec; pid_t child; union lock_subject subj; - silent = keep = 0; + silent = keep = writepid = 0; flags = O_CREAT | O_RDONLY; waitsec = -1; /* Infinite. */ - while ((ch = getopt(argc, argv, "knst:w")) != -1) { + while ((ch = getopt(argc, argv, "knpst:w")) != -1) { switch (ch) { case 'k': keep = 1; @@ -120,6 +120,10 @@ main(int argc, char **argv) "invalid timeout \"%s\"", optarg); } break; + case 'p': + writepid = 1; + flags |= O_TRUNC; + /* FALLTHROUGH */ case 'w': flags = (flags & ~O_RDONLY) | O_WRONLY; break; @@ -249,6 +253,11 @@ main(int argc, char **argv) fclose(stdin); fclose(stdout); fclose(stderr); + + /* Write out the pid before we sleep on it. */ + if (writepid) + (void)dprintf(lockfd, "%d\n", child); + if (waitpid(child, &status, 0) == -1) exit(EX_OSERR); return (WIFEXITED(status) ? WEXITSTATUS(status) : EX_SOFTWARE); From nobody Thu Jul 10 17:54:31 2025 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 4bdMtH2mpLz61LgT; Thu, 10 Jul 2025 17:54:31 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdMtH1h1Kz3Jnf; Thu, 10 Jul 2025 17:54:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752170071; 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=B75agXJrAyri/9H7FbNtgc90oGSdFuMoa3677MbEcFY=; b=hSS2E+cJaTpSX2tRWfd+jMlUtDsfEXFPHq6pc5iOyqZvYelOvxE3BjQrkGzNJxqrtNEvy/ tzVb6zJR265sWrRxvDmPtuwLhuW43aHbMUEkQoSjXBRd6kQdqBlR/4B2Z6RgO9fGybHHCJ GcEpSGtJ5xbiXISX9HLh77TpSr7IkO2IZg1A9KolzSoSxkFgJmR6m1rFnFa9JLa54DXqkE CTNgSfTjuG6icN3t/CkCnReHIIU93t0+F+wF7axK6aZChNqXyWEzdiyRL0mq60ybskrV2L v8QASZl0EuC0LadbdReTdU413t2cxWu5lO/aE8gsr14Vgqf1kd8oBLtEoqB80Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752170071; 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=B75agXJrAyri/9H7FbNtgc90oGSdFuMoa3677MbEcFY=; b=HtqH2rQJPgLgWvZWfOr7bBKmwlUnkNlzEBUs10hFR3Ztseb8JYj7gXZ+wTq2yC0AR9CiFv xzJTVvl1skxlssls87zPySLFg29QqWjmpr0LqeoHh9Apri2SUP781ezk6gJxtTlzlvKg6h f5r2zFF93aTv7yFH20RSQIVgIuV2NYs7U8ZmpGvwfmVHasIbKYSGqpzqLLTM14jFaXWiBa 1UClg7qkownqwEdgXW48Bn9rYlkxzPwNMES9GOLvruGd9wvx7ApDeWRU8CPIJ0zVCGRxTH Yn9qb/BTERH+frrByGhLBq1Txf8RN2XcCnSWAyMkIRgL99yUc8424KIsfOuueQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752170071; a=rsa-sha256; cv=none; b=Pdgkah7JqbGHelP+n6br+V5vhmG4V1VnhmYF+bock7C61Y8lAS/9RJgMNbo813yCGzy9M5 zf15GFdyMUTK3RPD8yGs/ThYa3Q/wCaidvBMJOp6U1Ic042EltXWzKHED/mMf1T32TjOSp AGZB49Ul6z0Cu4bGYQhffF3IMV7SRvRzKn6r5GVuGKwAOKtTMtO6SGYeNCl2EEP4ZRSalP SU+WMWYrZR4U2XjP9MeNyYd6V1/DAVFMC6YfcFp++ErUZ/dFkJVi2cpsi9iX6TM+ujJEI3 hBYmfWumG6hvGwiG5Uk4V8DhflGMWJxRvC+zJ8c3Z0Zxm8p1lYfyqZR6wJP1cw== 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 4bdMtH1BNbz1Gvg; Thu, 10 Jul 2025 17:54:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56AHsVJ1072074; Thu, 10 Jul 2025 17:54:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56AHsVK4072071; Thu, 10 Jul 2025 17:54:31 GMT (envelope-from git) Date: Thu, 10 Jul 2025 17:54:31 GMT Message-Id: <202507101754.56AHsVK4072071@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 7e8afac0cb2d - main - lockf: switch to a SIGCHLD model for reaping child 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7e8afac0cb2d53595c06717fd4a50d6ec97a3f9d Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=7e8afac0cb2d53595c06717fd4a50d6ec97a3f9d commit 7e8afac0cb2d53595c06717fd4a50d6ec97a3f9d Author: Kyle Evans AuthorDate: 2025-06-24 22:18:27 +0000 Commit: Kyle Evans CommitDate: 2025-07-10 17:54:19 +0000 lockf: switch to a SIGCHLD model for reaping child A future change will add a -T flag to forward SIGTERM along to the child before we cleanup and terminate ourselves. Using a SIGCHLD handler to do that with SIGTERM blocked only while the child is actively being collected will enable us to safely do so without having to worry that our pid is potentially invalid. Add a test that concisely checks that the child's error is properly bubbled up to the caller. Reviewed by: des, kib Differential Revision: https://reviews.freebsd.org/D51024 --- usr.bin/lockf/lockf.c | 69 ++++++++++++++++++++++++++++++++++++--- usr.bin/lockf/tests/lockf_test.sh | 8 +++++ 2 files changed, 72 insertions(+), 5 deletions(-) diff --git a/usr.bin/lockf/lockf.c b/usr.bin/lockf/lockf.c index 93164e30762c..19424418ed68 100644 --- a/usr.bin/lockf/lockf.c +++ b/usr.bin/lockf/lockf.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -50,14 +51,19 @@ union lock_subject { static int acquire_lock(union lock_subject *subj, int flags, int silent); static void cleanup(void); static void killed(int sig); +static void sigchld(int sig); static void timeout(int sig); static void usage(void) __dead2; static void wait_for_lock(const char *name); static const char *lockname; +_Static_assert(sizeof(sig_atomic_t) >= sizeof(pid_t), + "PIDs cannot be managed safely from a signal handler on this platform."); +static sig_atomic_t child = -1; static int lockfd = -1; static int keep; static int fdlock; +static int status; static volatile sig_atomic_t timed_out; /* @@ -91,10 +97,14 @@ fdlock_implied(const char *name, long *ofd) int main(int argc, char **argv) { - int ch, flags, silent, status, writepid; + struct sigaction sa_chld = { + .sa_handler = sigchld, + .sa_flags = SA_NOCLDSTOP, + }, sa_prev; + sigset_t mask, omask; long long waitsec; - pid_t child; union lock_subject subj; + int ch, flags, silent, writepid; silent = keep = writepid = 0; flags = O_CREAT | O_RDONLY; @@ -238,9 +248,30 @@ main(int argc, char **argv) if (atexit(cleanup) == -1) err(EX_OSERR, "atexit failed"); + + /* + * Block SIGTERM while SIGCHLD is being processed, so that we can safely + * waitpid(2) for the child without a concurrent termination observing + * an invalid pid (i.e., waited-on). If our setup between here and the + * sigsuspend loop gets any more complicated, we should rewrite it to + * just use a pipe to signal the child onto execvp(). + * + * We're blocking SIGCHLD and SIGTERM here so that we don't do any + * cleanup before we're ready to (after the pid is written out). + */ + sigemptyset(&mask); + sigaddset(&mask, SIGCHLD); + sigaddset(&mask, SIGTERM); + (void)sigprocmask(SIG_BLOCK, &mask, &omask); + + memcpy(&sa_chld.sa_mask, &omask, sizeof(omask)); + sigaddset(&sa_chld.sa_mask, SIGTERM); + (void)sigaction(SIGCHLD, &sa_chld, &sa_prev); + if ((child = fork()) == -1) err(EX_OSERR, "cannot fork"); if (child == 0) { /* The child process. */ + (void)sigprocmask(SIG_SETMASK, &omask, NULL); close(lockfd); execvp(argv[0], argv); warn("%s", argv[0]); @@ -250,16 +281,24 @@ main(int argc, char **argv) signal(SIGINT, SIG_IGN); signal(SIGQUIT, SIG_IGN); signal(SIGTERM, killed); + fclose(stdin); fclose(stdout); fclose(stderr); /* Write out the pid before we sleep on it. */ if (writepid) - (void)dprintf(lockfd, "%d\n", child); + (void)dprintf(lockfd, "%d\n", (int)child); + + /* Just in case they were blocked on entry. */ + sigdelset(&omask, SIGCHLD); + sigdelset(&omask, SIGTERM); + while (child >= 0) { + (void)sigsuspend(&omask); + /* child */ + atomic_signal_fence(memory_order_acquire); + } - if (waitpid(child, &status, 0) == -1) - exit(EX_OSERR); return (WIFEXITED(status) ? WEXITSTATUS(status) : EX_SOFTWARE); } @@ -323,6 +362,26 @@ killed(int sig) _Exit(EX_OSERR); } +/* + * Signal handler for SIGCHLD. Simply waits for the child and ensures that we + * don't end up in a sticky situation if we receive a SIGTERM around the same + * time. + */ +static void +sigchld(int sig __unused) +{ + int ostatus; + + while (waitpid(child, &ostatus, 0) != child) { + if (errno != EINTR) + _exit(EX_OSERR); + } + + status = ostatus; + child = -1; + atomic_signal_fence(memory_order_release); +} + /* * Signal handler for SIGALRM. */ diff --git a/usr.bin/lockf/tests/lockf_test.sh b/usr.bin/lockf/tests/lockf_test.sh index d73c7590653d..0cdf7dae6f57 100644 --- a/usr.bin/lockf/tests/lockf_test.sh +++ b/usr.bin/lockf/tests/lockf_test.sh @@ -62,6 +62,13 @@ basic_body() atf_check test ! -e "testlock" } +atf_test_case bubble_error +bubble_error_body() +{ + # Ensure that lockf bubbles up the error as expected. + atf_check -s exit:9 lockf testlock sh -c 'exit 9' +} + atf_test_case fdlock fdlock_body() { @@ -233,6 +240,7 @@ atf_init_test_cases() { atf_add_test_case badargs atf_add_test_case basic + atf_add_test_case bubble_error atf_add_test_case fdlock atf_add_test_case keep atf_add_test_case needfile From nobody Thu Jul 10 17:54:32 2025 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 4bdMtK0td1z61L7l; Thu, 10 Jul 2025 17:54:33 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdMtJ2TMRz3JcB; Thu, 10 Jul 2025 17:54:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752170072; 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=i1OuLSm1Ekz7ue7G2QW84qHU3rhDtIgvH0yDtIfru9w=; b=cMbDR0SAELJCpODRdnZj/cZK3qOy6PgzlBGRYM2CkOYB19XJHK6+jWFdJpeLsCwMciFEOz SNYl/xurU9sYBt7KgP5EMBZsmr21CYMdrA8We0e4E8+8xcpTqHaIYZPu3wEH7Tw036q3TC DvXGzuAgbYKhV/ELmxqvn3CkpqdvZHq+NmI/xjm1K+SXo3ZHbtknJM3J2EQP8Yqk6NgayT /XKnRdbHH9hLELCi2++TnEQWh2xXOVn60qRWnZYk7KV5XBjJVo50n8p2O9677+xwB8PcKJ 6Wf7kOJtzEIGmk+TuRgmpVt7OVtVdoThYvb5Z8UK1/hbiRJNUJXMNtnW7LPcEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752170072; 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=i1OuLSm1Ekz7ue7G2QW84qHU3rhDtIgvH0yDtIfru9w=; b=I+5cbv1sSP+88wcoWR1rPgQCHhc1F33jfZtda+1xIhQh7nockTHpH96uzujC2xeI9jOHxl f37PiN5egzPpeSs8blTAMnH5GeAE7zeBNM7YL9J+/8r9Kdi71NQLirzOTxQDl5zOMA4OUF r4WTKjwtq0vFvRT0/GSOst0Wt6672t2rnzCw4NIJYmV+up5RbBLps8NwKo361BAz6xR5rq 96Bq8XLp0jntcpkuKZJQUfQEwTtuSgGUvlep2ib4vWb+Eg6ltfdTPW+k0/Ew0xUsRqgV2o wdGi3ipBPzxNPPbyLi8iUbIldBGES1P3cIHwTlsTfe2QvM4+ULgOjICHnBlauQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752170072; a=rsa-sha256; cv=none; b=lHjL5Mei5A76cQSlgEpBviin28e6kM/9rxJjtnupTgOuq8MSgBpl+QXnGFNkdDUl1aDqhB m9MMXVpfHnlYAmhD0PjLNEoXK2q1la5rQqpTyGWX/8aN2lw3ICylFEQ480vZ0VJfL/8lRW wWjuH+YyD0/eJU9Lt0oYh9rxuX3n8IqkWKiNUudzqkr1Kf9grgcDdIq/AY2WzWtOX7l8JP y1H2jLbIySPIdS1S4EMPuhaiNhDflWxKkGosIgleyr1lh8SVfc1sS0/0KiGqk7Ez5KHtv+ 9fZ0cjA/2JsBrVQg/GD4QHY3a8pB6aa8zRtRtKvSjFXELKqdZ7vObm9fysIj3A== 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 4bdMtJ21rhz1GHK; Thu, 10 Jul 2025 17:54:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56AHsWIE072108; Thu, 10 Jul 2025 17:54:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56AHsWPR072105; Thu, 10 Jul 2025 17:54:32 GMT (envelope-from git) Date: Thu, 10 Jul 2025 17:54:32 GMT Message-Id: <202507101754.56AHsWPR072105@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 679f619495f6 - main - lockf: add a -T option to terminate the child upon early abort 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 679f619495f67eafc9fdb97d11381b14f2b49ccf Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=679f619495f67eafc9fdb97d11381b14f2b49ccf commit 679f619495f67eafc9fdb97d11381b14f2b49ccf Author: Kyle Evans AuthorDate: 2025-06-24 23:03:14 +0000 Commit: Kyle Evans CommitDate: 2025-07-10 17:54:20 +0000 lockf: add a -T option to terminate the child upon early abort This is useful to avoid having the command running twice in the face of the admin terminating the process. Notably, if the -p option is not in use (or can't be used, e.g., because we can't open the file for writing) then this provides a nice alternative where one simply needs to send a SIGTERM to the lockf(1) process associated with the lock file to clean it all up. Reviewed by: des Differential Revision: https://reviews.freebsd.org/D51025 --- usr.bin/lockf/lockf.1 | 18 +++++++++++++++++- usr.bin/lockf/lockf.c | 9 ++++++++- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/usr.bin/lockf/lockf.1 b/usr.bin/lockf/lockf.1 index 5832903246f1..40b4497bc80c 100644 --- a/usr.bin/lockf/lockf.1 +++ b/usr.bin/lockf/lockf.1 @@ -30,7 +30,7 @@ .Nd execute a command while holding a file lock .Sh SYNOPSIS .Nm -.Op Fl knpsw +.Op Fl knpsTw .Op Fl t Ar seconds .Ar file .Ar command @@ -136,6 +136,22 @@ This option will cause to open .Ar file for writing rather than reading. +.It Fl T +Upon receipt of a +.Dv SIGTERM , +forward a +.Dv SIGTERM +along to the +.Ar command +before cleaning up the +.Ar file +and exiting. +By default, +.Nm +effectively orphans the +.Ar command +after cleaning up the +.Ar file . .It Fl t Ar seconds Specifies a timeout for waiting for the lock. By default, diff --git a/usr.bin/lockf/lockf.c b/usr.bin/lockf/lockf.c index 19424418ed68..b0e16285998a 100644 --- a/usr.bin/lockf/lockf.c +++ b/usr.bin/lockf/lockf.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -64,6 +65,7 @@ static int lockfd = -1; static int keep; static int fdlock; static int status; +static bool termchild; static volatile sig_atomic_t timed_out; /* @@ -109,7 +111,7 @@ main(int argc, char **argv) silent = keep = writepid = 0; flags = O_CREAT | O_RDONLY; waitsec = -1; /* Infinite. */ - while ((ch = getopt(argc, argv, "knpst:w")) != -1) { + while ((ch = getopt(argc, argv, "knpsTt:w")) != -1) { switch (ch) { case 'k': keep = 1; @@ -120,6 +122,9 @@ main(int argc, char **argv) case 's': silent = 1; break; + case 'T': + termchild = true; + break; case 't': { const char *errstr; @@ -356,6 +361,8 @@ static void killed(int sig) { + if (termchild && child >= 0) + kill(child, sig); cleanup(); signal(sig, SIG_DFL); if (kill(getpid(), sig) == -1) From nobody Thu Jul 10 17:54:33 2025 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 4bdMtK6CKXz61LZr; Thu, 10 Jul 2025 17:54:33 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdMtK3LQNz3Jp3; Thu, 10 Jul 2025 17:54:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752170073; 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=RHHVb6UyXOvk88J5+yo0jZ1TmfGbT0Q+B2h6xV/WYto=; b=ajs1MgD22vHdMwrjnHzy3eVdT/WUDM/SfCoJwheJ1orS9Ldmv2Kz9t1crUNtC4Z0/RIVC0 ARmQp1J8CgyYtrf9u5bkZ5qgvGFmnFcy1sOtGj/4gIUZ9nlOIoNDho4tPevYedIE/uAWob z1uuUhR8b9EBlZ8trkvhldPA5IxXzi0jAT6qgd9AVm2tDx8CyDNEp08X+CLZiSK8j9PQZw f9GZRAsPQ0dZy5njmgPSjbv4H9zQ6m7yFZSzK+cKBKPsN+j+T0NgqtKpN1g8GyCiOOOMNb jHxf84GvrpdDJJueDRuuE5TdceP8LCLDNyRA4xbgrtrAbgfZnbV/c0kwsoc+5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752170073; 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=RHHVb6UyXOvk88J5+yo0jZ1TmfGbT0Q+B2h6xV/WYto=; b=Urtt6bYShRbsNZv9ThApqkt2ULhmsG7XZ9vsGj3opKoMWMwHr8mGYK/hdcvA9syDmNU+3k tS9i7d2FT7LPBtdXNbt8tGBC0qjgoQv4KlrRQ5W4pTnkKsOiqmvp7IY7QFvRWW1ylPIBAV dioJyJ4MUQT1oGIlIm7Au+2hTOKv1Pe/QbKxG9/6smmZ43OUR7zUVqvkKetSHHGXJTJ5pU zRHzJF4soUEOIg0/tOpcDkVawWWL6LtsFT5cip4cGvsfnaVbIw2uCaa5Aix65Zn8WDDi24 Ox6l/Z9U351GDP7HwZs9bTFq72d2fim3g9UmaNNvflzvLDuO5kLqCI9Wfip3Dg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752170073; a=rsa-sha256; cv=none; b=h7LAGem9QoAGffz4vP3BoIwP3toGup+NoammMF+TNAPGLoCqJRK8k4g6tEz7zAM8/aam5B kehI+LFXOwBzp52WRe7Md73mvyg36Sxi7HSh0QQMkS5kVCxdMEM6lbY0QBeUdjZWHSNliz YgLSm1wB/aIG4Hk26GJ4MeY01QPi41OV/yzu+vruwB0VaF7cfRn34gmuSeCt4T9bWuzEAo K2KL3T46hfqwad9t0vRah7rIh+OhBR95eDEL0fmaJcfRXudSw2D3WgngOPDv+ToVx3pOFe ab/+TECfPaTHzvPacDUY92EysHc0iIpmqHGZGWRmX2Gi0ZxXOoN1j8bhVZVxIw== 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 4bdMtK2xzsz1H7x; Thu, 10 Jul 2025 17:54:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56AHsXF3072142; Thu, 10 Jul 2025 17:54:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56AHsXt4072139; Thu, 10 Jul 2025 17:54:33 GMT (envelope-from git) Date: Thu, 10 Jul 2025 17:54:33 GMT Message-Id: <202507101754.56AHsXt4072139@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: c82203e65d08 - main - lockf: tests: add tests for the -p and -T features 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c82203e65d08036d25ed117f2617ef4ad07d6f97 Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=c82203e65d08036d25ed117f2617ef4ad07d6f97 commit c82203e65d08036d25ed117f2617ef4ad07d6f97 Author: Kyle Evans AuthorDate: 2025-06-24 23:04:11 +0000 Commit: Kyle Evans CommitDate: 2025-07-10 17:54:20 +0000 lockf: tests: add tests for the -p and -T features Reviewed by: des Differential Revision: https://reviews.freebsd.org/D51026 --- usr.bin/lockf/tests/lockf_test.sh | 95 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) diff --git a/usr.bin/lockf/tests/lockf_test.sh b/usr.bin/lockf/tests/lockf_test.sh index 0cdf7dae6f57..823b5673a176 100644 --- a/usr.bin/lockf/tests/lockf_test.sh +++ b/usr.bin/lockf/tests/lockf_test.sh @@ -31,6 +31,24 @@ : ${EX_CANTCREAT:=73} : ${EX_TEMPFAIL:=75} +waitlock() +{ + local cur lockfile tmo + + lockfile="$1" + + cur=0 + tmo=20 + + while [ "$cur" -lt "$tmo" -a ! -f "$lockfile" ]; do + sleep 0.1 + cur=$((cur + 1)) + done + + atf_check_not_equal "$cur" "$tmo" +} + + atf_test_case badargs badargs_body() { @@ -196,6 +214,52 @@ needfile_body() atf_check test "$tpass" -lt 10 } +atf_test_case termchild +termchild_body() +{ + lockf -kp testlock sleep 30 & + lpid=$! + + waitlock testlock + + atf_check -o file:testlock pgrep -F testlock + + start=$(date +"%s") + atf_check kill -TERM "$lpid" + wait "$lpid" + end=$(date +"%s") + elapsed=$((end - start)) + + if [ "$elapsed" -gt 5 ]; then + atf_fail "lockf seems to have dodged the SIGTERM ($elapsed passed)" + fi + + # We didn't start lockf with -T this time, so the process should not + # have been terminated. + atf_check -o file:testlock pgrep -F testlock + + lockf -kpT testlock sleep 30 & + lpid=$! + + waitlock testlock + + atf_check -o file:testlock pgrep -F testlock + + start=$(date +"%s") + atf_check kill -TERM "$lpid" + wait "$lpid" + end=$(date +"%s") + elapsed=$((end - start)) + + if [ "$elapsed" -gt 5 ]; then + atf_fail "lockf -T seems to have dodged the SIGTERM ($elapsed passed)" + fi + + # This time, it should have terminated (notably much earlier than our + # 30 second timeout). + atf_check -o empty -e not-empty -s not-exit:0 pgrep -F testlock +} + atf_test_case timeout timeout_body() { @@ -219,6 +283,34 @@ timeout_body() wait "$lpid" || true } +atf_test_case writepid +writepid_body() +{ + lockf -p "testlock" sleep 10 & + lpid=$! + + waitlock "testlock" + + atf_check test -s testlock + atf_check -o file:testlock pgrep -F testlock + atf_check -o file:testlock pgrep -F testlock -fx "sleep 10" + atf_check pkill -TERM -F testlock + + wait + + atf_check test ! -f testlock +} + +atf_test_case writepid_keep +writepid_keep_body() +{ + # Check that we'll clobber any existing contents (a pid, usually) + # once we acquire the lock. + jot -b A -s "" 64 > testlock + atf_check lockf -kp testlock sleep 0 + atf_check -o not-match:"A" cat testlock +} + atf_test_case wrlock wrlock_head() { @@ -244,6 +336,9 @@ atf_init_test_cases() atf_add_test_case fdlock atf_add_test_case keep atf_add_test_case needfile + atf_add_test_case termchild atf_add_test_case timeout + atf_add_test_case writepid + atf_add_test_case writepid_keep atf_add_test_case wrlock } From nobody Thu Jul 10 17:54:34 2025 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 4bdMtL6M6fz61LQ0; Thu, 10 Jul 2025 17:54:34 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdMtL3ytrz3K4N; Thu, 10 Jul 2025 17:54:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752170074; 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=vUPm/NPjZIf8ykT/9ue4cGcSgHt8qSZJUNQzkFEFWlM=; b=HojFXQC+p04cIgaLCyeF6OhU2OOEXkYIwv4+Gj3dsoMON5dmvpgoCZ8qAe/gMlBmUXTqaD vDDm5VaTz24pVtAtafiqHEAp4vtNbR+D0lvzz5QZuiPMtqA5nqu4TME3aHCWMUe2wixT8+ nG+VKCFVAz4A8dVWN3okf+ouBvrhJvOyG9k4zRNdkx1rYRCEry48bRBhoEvWhrWvEBgJAo neKcKPbhgZr0Yx0ygCpJ28wF0mGdfzN/rZJ5/aWoVvjleSupGzJ49au50+yGz1PqLoTwOb kUVRAtpripMtHn0E4E24zZt6WYnei5irNU79/o9FdwdZ0vDRIhhPLP9lr5BGKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752170074; 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=vUPm/NPjZIf8ykT/9ue4cGcSgHt8qSZJUNQzkFEFWlM=; b=v3qtY6agbvzGry5iScEL/4mEhy5fdzlJ6IsuTKfO1WIbLEdOvzLqlRkicQnStMKdQD1cuz x3MfRW1oa+VMjAX669H+G9JlzP639bcA1D26Qy/H3fcPNznjbm7EPyS9yEkcUF1PaWESm/ a5Tkw4EEI5SC/uVF3LJ4tSN6ILUpxMRMiTdTQ70lEMqf6jIJWHF0P1d+vYofdLbCojk9+e /qil0TnaTces3cw8uXxh3PIBTkx3IXzPgju2BfDXkjpKioZnUVGyiekzH9Yd/adgcbVS8M To1Xwh3pc5ujNErzvQSzEDBNmoHPTOy9tMVOa8g9BEBeYAG6ratWd/IdqgquUw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752170074; a=rsa-sha256; cv=none; b=U1Md6OYF0rJ/YXPLa5uCKLNEwLHEoJd3JYIuv37p8SuMCJTtl0Y+M5LlsL6M8Heai2jPNS IWmoEyBnMlbLsFqpi2idHzuYu3Dz6IZit4yG9KNfnfqj+qZjwGhMrZYoqyRJ07xACFpoTy iThC/9eTPLzCszYZb9fiT0y7xOyWUo+r++BCRpwNLUz2a2pAq3CxIRRZdo7tcV93kztYbW Xpx//hA5PCWzuYU4TzljPUvixPT//knZZa51vHK0TmK7EDA/Ri/spjZvvWMU8OtcLy/kAN F60YPZP34u7I8nuAGLakR7B2D1aNpwFMpTEjFAPpcr6cUljueupOCPq9UP0IEQ== 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 4bdMtL3ZWwz1H7y; Thu, 10 Jul 2025 17:54:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56AHsYnU072182; Thu, 10 Jul 2025 17:54:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56AHsYSk072179; Thu, 10 Jul 2025 17:54:34 GMT (envelope-from git) Date: Thu, 10 Jul 2025 17:54:34 GMT Message-Id: <202507101754.56AHsYSk072179@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 4c8b54f765c7 - main - lockf: minor cosmetic cleanups, no functional change 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4c8b54f765c7676b4899b72de928bdb6d056dfb2 Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=4c8b54f765c7676b4899b72de928bdb6d056dfb2 commit 4c8b54f765c7676b4899b72de928bdb6d056dfb2 Author: Kyle Evans AuthorDate: 2025-06-24 23:08:46 +0000 Commit: Kyle Evans CommitDate: 2025-07-10 17:54:20 +0000 lockf: minor cosmetic cleanups, no functional change Switch various flags from int -> bool. kill(getpid(), foo) and raise(foo) are equivalent in this context, so switch to the latter as a minor preference for readability. Use proper signal fences instead of volatile for our SIGALRM handler. Reviewed by: kib (earlier version), des Differential Revision: https://reviews.freebsd.org/D51027 --- usr.bin/lockf/lockf.c | 42 ++++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/usr.bin/lockf/lockf.c b/usr.bin/lockf/lockf.c index b0e16285998a..16bae36a21e0 100644 --- a/usr.bin/lockf/lockf.c +++ b/usr.bin/lockf/lockf.c @@ -62,35 +62,35 @@ _Static_assert(sizeof(sig_atomic_t) >= sizeof(pid_t), "PIDs cannot be managed safely from a signal handler on this platform."); static sig_atomic_t child = -1; static int lockfd = -1; -static int keep; -static int fdlock; +static bool keep; +static bool fdlock; static int status; static bool termchild; -static volatile sig_atomic_t timed_out; +static sig_atomic_t timed_out; /* * Check if fdlock is implied by the given `lockname`. We'll write the fd that * is represented by it out to ofd, and the caller is expected to do any * necessary validation on it. */ -static int +static bool fdlock_implied(const char *name, long *ofd) { char *endp; long fd; if (strncmp(name, FDLOCK_PREFIX, sizeof(FDLOCK_PREFIX) - 1) != 0) - return (0); + return (false); /* Skip past the prefix. */ name += sizeof(FDLOCK_PREFIX) - 1; errno = 0; fd = strtol(name, &endp, 10); if (errno != 0 || *endp != '\0') - return (0); + return (false); *ofd = fd; - return (1); + return (true); } /* @@ -105,38 +105,36 @@ main(int argc, char **argv) }, sa_prev; sigset_t mask, omask; long long waitsec; + const char *errstr; union lock_subject subj; - int ch, flags, silent, writepid; + int ch, flags; + bool silent, writepid; - silent = keep = writepid = 0; + silent = writepid = false; flags = O_CREAT | O_RDONLY; waitsec = -1; /* Infinite. */ while ((ch = getopt(argc, argv, "knpsTt:w")) != -1) { switch (ch) { case 'k': - keep = 1; + keep = true; break; case 'n': flags &= ~O_CREAT; break; case 's': - silent = 1; + silent = true; break; case 'T': termchild = true; break; case 't': - { - const char *errstr; - waitsec = strtonum(optarg, 0, UINT_MAX, &errstr); if (errstr != NULL) errx(EX_USAGE, "invalid timeout \"%s\"", optarg); - } break; case 'p': - writepid = 1; + writepid = true; flags |= O_TRUNC; /* FALLTHROUGH */ case 'w': @@ -162,7 +160,7 @@ main(int argc, char **argv) * If there aren't any arguments left, then we must be in fdlock mode. */ if (argc == 0 && *lockname != '/') { - fdlock = 1; + fdlock = true; subj.subj_fd = -1; } else { fdlock = fdlock_implied(lockname, &subj.subj_fd); @@ -227,13 +225,16 @@ main(int argc, char **argv) */ lockfd = acquire_lock(&subj, flags | O_NONBLOCK, silent); while (lockfd == -1 && !timed_out && waitsec != 0) { - if (keep || fdlock) + if (keep || fdlock) { lockfd = acquire_lock(&subj, flags, silent); - else { + } else { wait_for_lock(lockname); lockfd = acquire_lock(&subj, flags | O_NONBLOCK, silent); } + + /* timed_out */ + atomic_signal_fence(memory_order_acquire); } if (waitsec > 0) alarm(0); @@ -365,7 +366,7 @@ killed(int sig) kill(child, sig); cleanup(); signal(sig, SIG_DFL); - if (kill(getpid(), sig) == -1) + if (raise(sig) == -1) _Exit(EX_OSERR); } @@ -397,6 +398,7 @@ timeout(int sig __unused) { timed_out = 1; + atomic_signal_fence(memory_order_release); } static void From nobody Thu Jul 10 17:57:14 2025 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 4bdMxQ6Y6vz61LwM; Thu, 10 Jul 2025 17:57:14 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdMxQ5YW7z3N3n; Thu, 10 Jul 2025 17:57:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752170234; 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=OoWpkxxosaCiOEsrJ6TMDKuD1s/uLQSCZjWlRVJTQgc=; b=qAu+0aNg+LvYytW5R+xn6zS+FBK9VcmBrJaucEr2mBnrVAMlM/c5ZfbKR3SKePo9UN4oRp X/AoTAL7XiPaDOo82uvDBarBhnEDIxKmvpaar301Cw4o8OWms6/Jc29LZ1SR0l5Awt+RyK XRvNHHzdeemSX6r4PVcBCIS5fcAqfzFJxvWTLWIhYir8Im5xrpiFLFelqCcOK0SrtCrW7i OE2885VYf9ZnsS2UrydCwfu/maGoxahwjyk1wDTEH0+BLxFjf3snrcw2yP7fhnv3qACbyW nRfUojApM8dhebbHqAeh2gtaPXt2HpQGJ+5RXxXDIzcKU9LPmHCX16wzSKqjTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752170234; 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=OoWpkxxosaCiOEsrJ6TMDKuD1s/uLQSCZjWlRVJTQgc=; b=BmulFO6C2wD57Zy45+HGb6S6ys86mhDDpJaAaACoVeVkXsUCNo3dybrRGZj0929El1UyLF QoHC4KkEraRyt6HVMlLEF0m1tj/00s8Z6y69ACtLm/5nhq49iuZhdu+HRXi2Dbayqb4Fn2 caW2tiCgslMjGJlKojUC4ZFpH+2A1o+yok/BVTH59wAwoD8QF5/MmdSRuHrGvY3IGfF7l3 a47Gl0L4aI+qLUFgg6stHl+I7SHl/RcjTruT2cihWYSjekxKKNJ+bfny28wIW0YaxTvzf+ BVvPokbPGnwmPsxsb5YZpd1Nvi3xzJdN/3CBDAvt9N0TsbQY28WIQkhmvgSAyg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752170234; a=rsa-sha256; cv=none; b=tnLC9bCfJMjyBeKP8IhPWGe4rkRQishqyGeQIVfucNi5SxYwH3HE0EZnhadE4LtifxkVEj JdIEZGySZHg+Gn8HDvM8ve7dOAD8VlgkTT2veeCEe1zrg4CKFfvMnwTrFuzKRdHuQaUrai ijDpPzezFX9kkE4iykomOv/6c97ZuC52xB22tko5wDAHrjG2clQpp1hJ0KZ1e8P1sLtsrG Er6/gQL7VFtSDeJPsLgAUpvyYdgvp4kJqqGWfpUTaJpXRX+PK3dqjYgZdjtz9/V/UVlkLZ d30X9ULvK09O9mnr4akYkxXFYg0z4UUk33rh8sjWJF52cxJQKQkvcCNsZOA7XA== 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 4bdMxQ51Wxz1Gvh; Thu, 10 Jul 2025 17:57:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56AHvEwn073107; Thu, 10 Jul 2025 17:57:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56AHvEK6073104; Thu, 10 Jul 2025 17:57:14 GMT (envelope-from git) Date: Thu, 10 Jul 2025 17:57:14 GMT Message-Id: <202507101757.56AHvEK6073104@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 3fde39073c72 - main - shar: remove from the tree well in advance of the 15.0 release 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3fde39073c722ba5b1d3aa330ec4dc5e0ecd8495 Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=3fde39073c722ba5b1d3aa330ec4dc5e0ecd8495 commit 3fde39073c722ba5b1d3aa330ec4dc5e0ecd8495 Author: Kyle Evans AuthorDate: 2025-01-02 02:20:09 +0000 Commit: Kyle Evans CommitDate: 2025-07-10 17:57:03 +0000 shar: remove from the tree well in advance of the 15.0 release We have had deprecation notice in the manpage for nearly six months, and it is also present both in 13.5 and 14.3. tar(1) can supply this functionality for those that truly need it, and cy@ has also created a sysutils/freebsd-shar port for this version of a frontend to live on in ports -- this port has been available since December 18, 2024. Reviewed by: allanjude, cy, emaste, jrm Differential Revision: https://reviews.freebsd.org/D50925 --- ObsoleteFiles.inc | 3 + UPDATING | 5 ++ usr.bin/Makefile | 1 - usr.bin/shar/Makefile | 4 - usr.bin/shar/Makefile.depend | 10 --- usr.bin/shar/shar.1 | 121 ------------------------------- usr.bin/shar/shar.sh | 78 -------------------- usr.sbin/crunch/examples/really-big.conf | 2 +- 8 files changed, 9 insertions(+), 215 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index d1095b57c342..4031478f1db4 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -51,6 +51,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20250710: shar(1) removed +OLD_FILES+=usr/bin/shar + # 20250708: For 34 days 15.0-CURRENT installed libkadm5clnt symlink without .so OLD_FILES+=usr/lib/libkadm5clnt diff --git a/UPDATING b/UPDATING index 8205086dbab5..2b8320c1204d 100644 --- a/UPDATING +++ b/UPDATING @@ -27,6 +27,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 15.x IS SLOW: world, or to merely disable the most expensive debugging functionality at runtime, run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20250710: + The shar(1) utility has been removed from base. The + sysutils/freebsd-shar port was created to maintain this version of + shar(1) past its removal from base. + 20250704: LinuxKPI device.h and acpi changes effecting drivers and drm-kmod. Bump __FreeBSD_version 1500050 to be able to detect these changes. diff --git a/usr.bin/Makefile b/usr.bin/Makefile index b69d25480479..512f75b5d093 100644 --- a/usr.bin/Makefile +++ b/usr.bin/Makefile @@ -133,7 +133,6 @@ SUBDIR= alias \ sdiff \ sed \ seq \ - shar \ showmount \ sockstat \ soelim \ diff --git a/usr.bin/shar/Makefile b/usr.bin/shar/Makefile deleted file mode 100644 index fc940c06d463..000000000000 --- a/usr.bin/shar/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -SCRIPTS=shar.sh -MAN= shar.1 - -.include diff --git a/usr.bin/shar/Makefile.depend b/usr.bin/shar/Makefile.depend deleted file mode 100644 index 11aba52f82cf..000000000000 --- a/usr.bin/shar/Makefile.depend +++ /dev/null @@ -1,10 +0,0 @@ -# Autogenerated - do NOT edit! - -DIRDEPS = \ - - -.include - -.if ${DEP_RELDIR} == ${_DEP_RELDIR} -# local dependencies - needed for -jN in clean tree -.endif diff --git a/usr.bin/shar/shar.1 b/usr.bin/shar/shar.1 deleted file mode 100644 index 6beb1e84ceab..000000000000 --- a/usr.bin/shar/shar.1 +++ /dev/null @@ -1,121 +0,0 @@ -.\" Copyright (c) 1990, 1993 -.\" The Regents of the University of California. All rights reserved. -.\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\" notice, this list of conditions and the following disclaimer in the -.\" documentation and/or other materials provided with the distribution. -.\" 3. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -.\" SUCH DAMAGE. -.\" -.Dd January 1, 2025 -.Dt SHAR 1 -.Os -.Sh NAME -.Nm shar -.Nd create a shell archive of files -.Sh DEPRECATION NOTICE -.Nm -is obsolete and may not be present in -.Fx 15 -and later. -Because shell archives are simultaneously data and code and are typically -interpreted by -.Xr sh 1 , -they can easily be trojan-horsed and pose a significant security risk to users. -The -.Xr tar 1 -utility can still produce shar encodings of files if needed. -The -.Pa sysutils/freebsd-shar -port has been created to maintain this version of -.Nm -past its deprecation in base. -.Sh SYNOPSIS -.Nm -.Ar -.Sh DESCRIPTION -The -.Nm -command writes a -.Xr sh 1 -shell script to the standard output which will recreate the file -hierarchy specified by the command line operands. -Directories will be recreated and must be specified before the -files they contain (the -.Xr find 1 -utility does this correctly). -.Pp -The -.Nm -command is normally used for distributing files by -.Xr ftp 1 -or -.Xr mail 1 . -.Sh EXAMPLES -To create a shell archive of the program -.Xr ls 1 -and mail it to Rick: -.Bd -literal -offset indent -cd ls -shar `find . -print` \&| mail -s "ls source" rick -.Ed -.Pp -To recreate the program directory: -.Bd -literal -offset indent -mkdir ls -cd ls -\&... - -\&... -sh archive -.Ed -.Sh SEE ALSO -.Xr compress 1 , -.Xr mail 1 , -.Xr tar 1 , -.Xr uuencode 1 -.Sh HISTORY -The -.Nm -command appeared in -.Bx 4.4 . -.Sh BUGS -The -.Nm -command makes no provisions for special types of files or files containing -magic characters. -The -.Nm -command cannot handle files without a newline ('\\n') -as the last character. -.Pp -It is easy to insert trojan horses into -.Nm -files. -It is strongly recommended that all shell archive files be examined -before running them through -.Xr sh 1 . -Archives produced using this implementation of -.Nm -may be easily examined with the command: -.Bd -literal -offset indent -egrep -av '^[X#]' shar.file -.Ed diff --git a/usr.bin/shar/shar.sh b/usr.bin/shar/shar.sh deleted file mode 100644 index 52c31b419fc4..000000000000 --- a/usr.bin/shar/shar.sh +++ /dev/null @@ -1,78 +0,0 @@ -#!/bin/sh - -# -# SPDX-License-Identifier: BSD-3-Clause -# -# Copyright (c) 1990, 1993 -# The Regents of the University of California. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. Neither the name of the University nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -# SUCH DAMAGE. - -if [ $# -eq 0 ]; then - echo 'usage: shar file ...' 1>&2 - exit 64 # EX_USAGE -fi - -for i -do - if [ ! \( -d $i -o -r $i \) ]; then - echo "$i inaccessible or not exist" 1>&2 - exit 66 # EX_NOINPUT - fi -done - -cat << EOF -# This is a shell archive. Save it in a file, remove anything before -# this line, and then unpack it by entering "sh file". Note, it may -# create directories; files and directories will be owned by you and -# have default permissions. -# -# This archive contains: -# -EOF - -for i -do - echo "# $i" -done - -echo "#" - -for i -do - if [ -d "$i" ]; then - echo "echo c - '$i'" - echo "mkdir -p '$i' > /dev/null 2>&1" - else - md5sum=`echo -n "$i" | md5` - echo "echo x - '$i'" - echo "sed 's/^X//' >'$i' << '$md5sum'" - sed 's/^/X/' "$i" || exit 1 - echo "$md5sum" - fi -done -echo exit -echo "" - -exit 0 diff --git a/usr.sbin/crunch/examples/really-big.conf b/usr.sbin/crunch/examples/really-big.conf index 12c08b73936f..9c227a7b8d29 100644 --- a/usr.sbin/crunch/examples/really-big.conf +++ b/usr.sbin/crunch/examples/really-big.conf @@ -52,7 +52,7 @@ progs tty ul uname unexpand unifdef uniq units unvis users uudecode uuencode progs vacation vgrind vi vis vmstat w wall wc what whatis whereis who progs whois window write xargs xinstall xstr yacc yes ypcat ypmatch ypwhich -# shell scripts: lorder mkdep shar which +# shell scripts: lorder mkdep which # problems: rdist uses libcompat.a(regex.o), which conflicts with # libedit(readline.o) over regerror(). From nobody Thu Jul 10 18:15:47 2025 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 4bdNLr2Rryz61MpK; Thu, 10 Jul 2025 18:15:48 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdNLq6wjBz3W24; Thu, 10 Jul 2025 18:15:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752171348; 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=IXIfPP1cZB0M+Q3X7bemR4TpLN/DS0y9xY++T5o49MM=; b=LGGP5bNyWYBms0XnWcQppAdU76aP0O/sPYnB0yECM62rHHF77VwluQGMROeJMfuBoHA2vl N5X7HugWpop4Gmw+YMae3MxJiDGfO9L7zjQqw9v8hb+vAdYqEUZhHsE/OcwT12Gd7hXBrr KEuYsyqjbTQAfN+ETNeWd+b6LDsi560G05RO1uUGqu+TdWrNliMFPwlfLIHXfb5zJ8lU8b zBftQ13pms/K5opDARCeVKhrLPgnl38S40SH8IE7Gjm2/5/4CiNIzEPqesmrQwJjEGIBXJ Cj+GKdj6XPnWFn3s2rIfNjBHqnUaHt019H9xFU+0R954HsNGRqaEJvjwH2zsEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752171348; 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=IXIfPP1cZB0M+Q3X7bemR4TpLN/DS0y9xY++T5o49MM=; b=Atx+HW/lY1cpAk6NHXW6NCeE3vUSdDbSBw5tvRiWqf6w8NWFfZyNG1SS+ie1CTVOMYc54c KLW0Gfa15qQENK6RCMZXJAFZspdrtQmgR1k1nYxFHn+3zsKdD/BRiP5helPPDm3hg24yh1 vf7EKslwPPyMAbNmEEMgubpFQsBNos+ZJr8scUIDsK+umOzgWBXVwJ8EZHJp1wxyCQ69cc XWCHBvxY6skJR2p9tDavMFV/RFjqjpre6jsMBbctcXFrH/fyRpqox/gchxNFrr6S0uIV69 D9FPwsxpdbsQEHDIogmwBkeFQVR68D/fFUtSvGWqegx+ROKWlW87bo24Lw9s0g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752171348; a=rsa-sha256; cv=none; b=GIGRO1XoiOF7hLwGmZTxerf3XATtMz7akSEMYtuhRogOdCVGx3o4Gn0YTJExjqjv99NX/P Oww0NfiNZP/K7eX3NXQ/ChW1jMp9Lv/tJQ6v/FuJpESqnvhTc7ohASDlzfBLDtfIsDgP29 bx7yRUg2TQf3pImO8gOv05BmPKMQkKbkjAgAw03bBxYNUbp0y8VD4syEaEZdFPXmhbXlVA gmq8RJswgyZXJGmbopZXjgXP5HmowOVxIPnEB5tsF3VlbfZicS0Gfo6wEs/F4dJBvMoBPB Z0oDyne6tDT/73w81MzADKrqPQ4lzAU5Yx+D77YD1J+WttMXcbkYU8v++iWOHw== 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 4bdNLq5MHCz1HWs; Thu, 10 Jul 2025 18:15:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56AIFleG010439; Thu, 10 Jul 2025 18:15:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56AIFlTP010436; Thu, 10 Jul 2025 18:15:47 GMT (envelope-from git) Date: Thu, 10 Jul 2025 18:15:47 GMT Message-Id: <202507101815.56AIFlTP010436@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Simon J. Gerraty" Subject: git: d1f0ee548c73 - main - Allow net_cleanup for loader.efi 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: sjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d1f0ee548c73fa4d6e097539b9be01dae683b99b Auto-Submitted: auto-generated The branch main has been updated by sjg: URL: https://cgit.FreeBSD.org/src/commit/?id=d1f0ee548c73fa4d6e097539b9be01dae683b99b commit d1f0ee548c73fa4d6e097539b9be01dae683b99b Author: Simon J. Gerraty AuthorDate: 2025-07-10 18:14:38 +0000 Commit: Simon J. Gerraty CommitDate: 2025-07-10 18:14:38 +0000 Allow net_cleanup for loader.efi While netbooting with loader.efi on at least one arm64 platform which uses u-boot emulating UEFI, the kernel gets corrupted, we suspected the u-boot ethernet driver was still running. Use netdev.dv_cleanup for efinet_dev to address this. This in turn requires calling dev_cleanup() before bi_load() to avoid a loader crash since bi_load() calls ExitBootServices. Reviewed by: imp Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D51186 --- stand/efi/libefi/efinet.c | 2 ++ stand/efi/loader/arch/amd64/elf64_freebsd.c | 8 ++++++-- stand/efi/loader/arch/arm/exec.c | 11 ++++++----- stand/efi/loader/arch/arm64/exec.c | 8 ++++++-- stand/efi/loader/arch/i386/elf64_freebsd.c | 9 +++++++-- stand/efi/loader/arch/riscv/exec.c | 12 ++++++------ 6 files changed, 33 insertions(+), 17 deletions(-) diff --git a/stand/efi/libefi/efinet.c b/stand/efi/libefi/efinet.c index 186d816cd323..e872110ef08f 100644 --- a/stand/efi/libefi/efinet.c +++ b/stand/efi/libefi/efinet.c @@ -256,6 +256,7 @@ efi_env_net_params(struct iodesc *desc) rootip.s_addr = rootaddr; #ifdef EFINET_DEBUG + printf("%s: proto=%d\n", __func__, netproto); printf("%s: ip=%s\n", __func__, inet_ntoa(myip)); printf("%s: mask=%s\n", __func__, intoa(netmask)); printf("%s: gateway=%s\n", __func__, inet_ntoa(gateip)); @@ -427,6 +428,7 @@ efinet_dev_init(void) dif->dif_private = handles2[i]; } + efinet_dev.dv_cleanup = netdev.dv_cleanup; efinet_dev.dv_open = netdev.dv_open; efinet_dev.dv_close = netdev.dv_close; efinet_dev.dv_strategy = netdev.dv_strategy; diff --git a/stand/efi/loader/arch/amd64/elf64_freebsd.c b/stand/efi/loader/arch/amd64/elf64_freebsd.c index c4265aca035e..35bd4d6c1419 100644 --- a/stand/efi/loader/arch/amd64/elf64_freebsd.c +++ b/stand/efi/loader/arch/amd64/elf64_freebsd.c @@ -209,6 +209,12 @@ elf64_exec(struct preloaded_file *fp) trampoline, PT4); printf("Start @ 0x%lx ...\n", ehdr->e_entry); + /* + * we have to cleanup here because net_cleanup() doesn't work after + * we call ExitBootServices + */ + dev_cleanup(); + efi_time_fini(); err = bi_load(fp->f_args, &modulep, &kernend, true); if (err != 0) { @@ -218,8 +224,6 @@ elf64_exec(struct preloaded_file *fp) return (err); } - dev_cleanup(); - trampoline(trampstack, copy_staging == COPY_STAGING_ENABLE ? efi_copy_finish : efi_copy_finish_nop, kernend, modulep, PT4, ehdr->e_entry); diff --git a/stand/efi/loader/arch/arm/exec.c b/stand/efi/loader/arch/arm/exec.c index c2a79523c02a..3963b6c0104b 100644 --- a/stand/efi/loader/arch/arm/exec.c +++ b/stand/efi/loader/arch/arm/exec.c @@ -74,16 +74,17 @@ __elfN(arm_exec)(struct preloaded_file *fp) printf("Kernel entry at %p...\n", entry); printf("Kernel args: %s\n", fp->f_args); + /* + * we have to cleanup here because net_cleanup() doesn't work after + * we call ExitBootServices + */ + dev_cleanup(); + if ((error = bi_load(fp->f_args, &modulep, &kernend, true)) != 0) { efi_time_init(); return (error); } - /* At this point we've called ExitBootServices, so we can't call - * printf or any other function that uses Boot Services */ - - dev_cleanup(); - (*entry)((void *)modulep); panic("exec returned"); } diff --git a/stand/efi/loader/arch/arm64/exec.c b/stand/efi/loader/arch/arm64/exec.c index 91a0503a976f..89e2ad7521a8 100644 --- a/stand/efi/loader/arch/arm64/exec.c +++ b/stand/efi/loader/arch/arm64/exec.c @@ -69,6 +69,12 @@ elf64_exec(struct preloaded_file *fp) ehdr = (Elf_Ehdr *)&(md->md_data); entry = efi_translate(ehdr->e_entry); + /* + * we have to cleanup here because net_cleanup() doesn't work after + * we call ExitBootServices + */ + dev_cleanup(); + efi_time_fini(); err = bi_load(fp->f_args, &modulep, &kernendp, true); if (err != 0) { @@ -76,8 +82,6 @@ elf64_exec(struct preloaded_file *fp) return (err); } - dev_cleanup(); - /* Clean D-cache under kernel area and invalidate whole I-cache */ clean_addr = (vm_offset_t)efi_translate(fp->f_addr); clean_size = (vm_offset_t)efi_translate(kernendp) - clean_addr; diff --git a/stand/efi/loader/arch/i386/elf64_freebsd.c b/stand/efi/loader/arch/i386/elf64_freebsd.c index b02cda2269bc..22cdd685ea9b 100644 --- a/stand/efi/loader/arch/i386/elf64_freebsd.c +++ b/stand/efi/loader/arch/i386/elf64_freebsd.c @@ -252,6 +252,13 @@ elf64_exec(struct preloaded_file *fp) ehdr->e_entry ); + + /* + * we have to cleanup here because net_cleanup() doesn't work after + * we call ExitBootServices + */ + dev_cleanup(); + efi_time_fini(); err = bi_load(fp->f_args, &modulep, &kernend, true); if (err != 0) { @@ -259,8 +266,6 @@ elf64_exec(struct preloaded_file *fp) return (err); } - dev_cleanup(); - trampoline(trampstack, type == AllocateMaxAddress ? efi_copy_finish : efi_copy_finish_nop, kernend, modulep, PT4, gdtr, ehdr->e_entry); diff --git a/stand/efi/loader/arch/riscv/exec.c b/stand/efi/loader/arch/riscv/exec.c index 9da61229ef68..a53fbd9442b0 100644 --- a/stand/efi/loader/arch/riscv/exec.c +++ b/stand/efi/loader/arch/riscv/exec.c @@ -86,17 +86,17 @@ __elfN(exec)(struct preloaded_file *fp) printf("Kernel entry at %p...\n", entry); printf("Kernel args: %s\n", fp->f_args); + /* + * we have to cleanup here because net_cleanup() doesn't work after + * we call ExitBootServices + */ + dev_cleanup(); + if ((error = bi_load(fp->f_args, &modulep, &kernend, true)) != 0) { efi_time_init(); return (error); } - /* - * At this point we've called ExitBootServices, so we can't call - * printf or any other function that uses Boot Services - */ - dev_cleanup(); - (*entry)((void *)modulep); panic("exec returned"); } From nobody Thu Jul 10 19:06:06 2025 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 4bdPSt2FNHz61R4L; Thu, 10 Jul 2025 19:06:06 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdPSt1fdmz3vhw; Thu, 10 Jul 2025 19:06:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752174366; 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=TwzV7Vrmg47gi1bYRsvZkTx6ydkEuUDnK7S8kFwjFUk=; b=KVt0GuWenwFrdgGs+huO2bbrt1U//AZKT29upFkyoHvdwzfYjDBCwCrtjpRI7G1eD1R50K wW4MnWmLm3/k5aPObev+XXg/9bAT6bM9L6cmaDG6Lly0DFfre52xNES90uoVIDLpNUt1x2 LyGGvYHv5OQQ9QzxzdEzq7OfdEUsFJym8WwDNZtPNeHODaoKExzGd2qbY1oLF1Mgtjj+Xi +DPHtH5cWHbxxFjjtCnd6jie2ucBydRPNY7spsFEGNHcSxoQMHbj/z5s8Fhk0plz1mEYm9 ummyHH6pI3rYiECauuUzi6LysDMKMPZP4NCh5/vTONlQECbT0VDv+cvRb6rDVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752174366; 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=TwzV7Vrmg47gi1bYRsvZkTx6ydkEuUDnK7S8kFwjFUk=; b=kD73O1eAhTsLqBOINQt3AZg8jGsx6yVuw+QJJqlHAJnbgrEuYGw3zQAAYSSkG/SmV3iHVE g2AgxbO0Rj4s3QvfVfeDKBx1I3xbQAQi5zMA+RBesNLARb+Qt78S3SOV7ZUS4N6qTpcbrR 3vbr5YaYub9k8zgij7YCbrYlUmAFBojM3w7KJeZMuLmx1wJoda9Z0J4Gry8bprr9sRC+0e 1ZpTtzKTWKex/AUO9e8bWNd7lqhDSHX4oXeZ4SbBY8IeZIfkcWw/+dIs2xK3GoblBehV0v Y/cBE+yHVp7jH3phe7/iqZhJIbzhMxOrCJVsELa3BGATRKDDSWO0l6CNYjhKcg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752174366; a=rsa-sha256; cv=none; b=x9qK6VeGWyNxoT8npKYRrapNZIL7rbO7M3HJ2lqBjLQz0DXz1IGOWgGMSfsuAPohurQmgA W+PnuDq8XKAaEF6eQ20AdSxYd75BEKusrYf4f8Zrg9HmkLk2zEjIN/iNwo5AAJnXNEhCxP 1XsBfoydGSudd46wem6msjs5cvGm6mcyONAUQrw0999voRlOS4gCSOODEbcAsVvEsm3HLM GVHHamtCxGoFoJ8Tlb2+pUWAvtbFHmNybLO+MSU8gQRZLqVcp6etmjORAD8UgvusdLhiZf VPq1I+8DRfzaEWgCFx9AnSj4sHKt4lyUfZ9vQSI/0ZCfda6zzz25kSJ/lGQKIg== 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 4bdPSt13scz1Hxc; Thu, 10 Jul 2025 19:06:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56AJ66ip004636; Thu, 10 Jul 2025 19:06:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56AJ66FN004631; Thu, 10 Jul 2025 19:06:06 GMT (envelope-from git) Date: Thu, 10 Jul 2025 19:06:06 GMT Message-Id: <202507101906.56AJ66FN004631@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: 4d2752925a4f - main - rtld-elf: Extract part of allocate_tls_offset into allocate_tls_offset_common 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4d2752925a4f75547a67f093dfe249da54196803 Auto-Submitted: auto-generated The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=4d2752925a4f75547a67f093dfe249da54196803 commit 4d2752925a4f75547a67f093dfe249da54196803 Author: Jessica Clarke AuthorDate: 2025-07-10 19:00:28 +0000 Commit: Jessica Clarke CommitDate: 2025-07-10 19:00:28 +0000 rtld-elf: Extract part of allocate_tls_offset into allocate_tls_offset_common This will be used to allocate additional space for a TAILQ_ENTRY by rtld at a known offset from the TCB, as if it were TLS data. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D51068 --- libexec/rtld-elf/rtld.c | 54 ++++++++++++++++++++++++++++++------------------- 1 file changed, 33 insertions(+), 21 deletions(-) diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 1459b38f3720..7172fbf1d794 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -5698,32 +5698,22 @@ allocate_module_tls(struct tcb *tcb, int index) return (p); } -bool -allocate_tls_offset(Obj_Entry *obj) +static bool +allocate_tls_offset_common(size_t *offp, size_t tlssize, size_t tlsalign, + size_t tlspoffset __unused) { size_t off; - if (obj->tls_dynamic) - return (false); - - if (obj->tls_static) - return (true); - - if (obj->tlssize == 0) { - obj->tls_static = true; - return (true); - } - if (tls_last_offset == 0) - off = calculate_first_tls_offset(obj->tlssize, obj->tlsalign, - obj->tlspoffset); + off = calculate_first_tls_offset(tlssize, tlsalign, + tlspoffset); else off = calculate_tls_offset(tls_last_offset, tls_last_size, - obj->tlssize, obj->tlsalign, obj->tlspoffset); + tlssize, tlsalign, tlspoffset); - obj->tlsoffset = off; + *offp = off; #ifdef TLS_VARIANT_I - off += obj->tlssize; + off += tlssize; #endif /* @@ -5735,12 +5725,34 @@ allocate_tls_offset(Obj_Entry *obj) if (tls_static_space != 0) { if (off > tls_static_space) return (false); - } else if (obj->tlsalign > tls_static_max_align) { - tls_static_max_align = obj->tlsalign; + } else if (tlsalign > tls_static_max_align) { + tls_static_max_align = tlsalign; } tls_last_offset = off; - tls_last_size = obj->tlssize; + tls_last_size = tlssize; + + return (true); +} + +bool +allocate_tls_offset(Obj_Entry *obj) +{ + if (obj->tls_dynamic) + return (false); + + if (obj->tls_static) + return (true); + + if (obj->tlssize == 0) { + obj->tls_static = true; + return (true); + } + + if (!allocate_tls_offset_common(&obj->tlsoffset, obj->tlssize, + obj->tlsalign, obj->tlspoffset)) + return (false); + obj->tls_static = true; return (true); From nobody Thu Jul 10 19:06:07 2025 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 4bdPSv39P2z61R4M; Thu, 10 Jul 2025 19:06:07 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdPSv21Wlz3vt8; Thu, 10 Jul 2025 19:06:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752174367; 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=gdIcyLwO809TWPnzVI4lBq+cMCS0GkdSzyWFdTSZW6M=; b=bUTkaiWBgUNCaX12/He07QuWNVRaMCNPS6468ECaAcZAnSd6Ps9yCrOyLTQt8+HRTlIhHz YzZGrFErokaFEg53h9IXOoB+I4sL6rv8G288omD+sntEM9lpPP7Uf0ZA8uPVqQqcO82sUz 0QpTHqcVaFSFC0nJbhyWFlAQX5FX/VerJZjQbOhUulUUqgfjIMvrQhiqWwKXivzvYHax3H RVl9vYGQkR1UQu6xRZIy4dRJfcx0uNh34WoHi34OXi5wDNYuAvYmGJ480pJ/55vn75Eji8 E7EliR+QULhpYPbrh/lzyWEz76/3TI6DGMO6Hds06NfDwRwLuWYV8+BEXQj6tQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752174367; 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=gdIcyLwO809TWPnzVI4lBq+cMCS0GkdSzyWFdTSZW6M=; b=JkWNrzuWFiVkJlc3s4hKvtJ1TkYfmpUENrFW7xxJPC47WesKKY/QNhvp2DvCTnTjd9EOcY 8vqwbWs3u/ZOaVKYyyddhQ8Ix4+VUHDKS5q5+r/i6Ln6b3KIFu3C0DQS/1mAo7B8gFMLng Ap4cFNzxQq9soBAjXE/B0XGXavWoCajYOBGARWXM4DgAvK9I/+tSSqKNghx6N37wVnYY1F 7zXqKvvMSQOjn2xunSePx7jFVVCGcnvwDcFS+vOE267AjU2y7+Rw8su4smI5nWNqfZXs2w Kqv0f84dR3LbvtMMMO92JAi+tSiMLK13caLAatyeztVHZqixfQuwsXYHEt5tlQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752174367; a=rsa-sha256; cv=none; b=EQuvyMpk4tKwQziDlbwMvIOkk9HcPKjuaw3Gd9vF6CjBrJ6nvQCPhwcH1nTDJMW8WU+vgN bGyx4R6BGStNr4trq0PEf6JtmzY3puhivP+sbBtb+H4wucKNrCHJ8CP2rbzSnuzJ2jIO9M mHoCQbWD3WEgYZdhWigYaIZRLC1Or3oPwuDzkjMSu9Ywx8Qd9WfSN6CgqCl+Izd+pGYpGM FfvPgJjCZUEPQq2GUKZPaAxGhgvpW+KwaHFWhQzWyE0nQpDr6oE0gmfFwLEdBI6OiRp4Jd uEPWm9DpVTw9dnOlSejSh+ASlxnchfjv5nStWvbXeAovD+c1kviPiPYrNcz7Tg== 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 4bdPSv1P3dz1JRm; Thu, 10 Jul 2025 19:06:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56AJ675i004675; Thu, 10 Jul 2025 19:06:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56AJ670u004672; Thu, 10 Jul 2025 19:06:07 GMT (envelope-from git) Date: Thu, 10 Jul 2025 19:06:07 GMT Message-Id: <202507101906.56AJ670u004672@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: a1d971ad3f82 - main - rtld-elf: Track allocated TCBs internally and use for distribute_static_tls 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a1d971ad3f8216c9b6b651e97dbe3d8177b11825 Auto-Submitted: auto-generated The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=a1d971ad3f8216c9b6b651e97dbe3d8177b11825 commit a1d971ad3f8216c9b6b651e97dbe3d8177b11825 Author: Jessica Clarke AuthorDate: 2025-07-10 19:00:28 +0000 Commit: Jessica Clarke CommitDate: 2025-07-10 19:00:28 +0000 rtld-elf: Track allocated TCBs internally and use for distribute_static_tls Currently rtld delegates to libc or libthr to initialise the TCBs for all existing threads when dlopen is called for a library that is using static TLS. This creates an odd split where rtld manages all of TLS for dynamically-linked executables except for this specific case, and is unnecessarily complex, including having to reason about the locking due to dropping the bind lock so libthr can take the thread list lock without deadlocking if any of the code run whilst that lock is held ends up calling back into rtld (such as for lazy PLT resolution). The only real reason we call out into libc / libthr is that we don't have a list of threads in rtld and that's how we find the currently used TCBs to initialise (and at the same time do the copy in the callee rather than adding overhead with some kind of callback that provides the TCB to rtld. If we instead keep a list of allocated TCBs in rtld itself then we no longer need to do this, and can just copy the data in rtld. How these TCBs are mapped to threads is irrelevant, rtld can just treat all TCBs equally and ensure that each TCB's static TLS data block remains in sync with the current set of loaded modules, just as how _rtld_allocate_tls creates a fresh TCB and associated data without any embedded threading model assumptions. As an implementation detail, to avoid a separate allocation for the list entry and having to find that allocation from the TCB to remove and free it on deallocation, we allocate a fake TLS offset for it and embed the list entry there in each TLS block. This will also make it easier to add a new TLS ABI downstream in CheriBSD, especially in the presence of library compartmentalisation. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D50920 --- libexec/rtld-elf/rtld.c | 103 ++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 87 insertions(+), 16 deletions(-) diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 7172fbf1d794..17196f55c271 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -82,9 +82,15 @@ struct dlerror_save { char *msg; }; +struct tcb_list_entry { + TAILQ_ENTRY(tcb_list_entry) next; +}; + /* * Function declarations. */ +static bool allocate_tls_offset_common(size_t *offp, size_t tlssize, + size_t tlsalign, size_t tlspoffset); static const char *basename(const char *); static void digest_dynamic1(Obj_Entry *, int, const Elf_Dyn **, const Elf_Dyn **, const Elf_Dyn **); @@ -92,7 +98,7 @@ static bool digest_dynamic2(Obj_Entry *, const Elf_Dyn *, const Elf_Dyn *, const Elf_Dyn *); static bool digest_dynamic(Obj_Entry *, int); static Obj_Entry *digest_phdr(const Elf_Phdr *, int, caddr_t, const char *); -static void distribute_static_tls(Objlist *, RtldLockState *); +static void distribute_static_tls(Objlist *); static Obj_Entry *dlcheck(void *); static int dlclose_locked(void *, RtldLockState *); static Obj_Entry *dlopen_object(const char *name, int fd, Obj_Entry *refobj, @@ -303,6 +309,10 @@ static size_t tls_static_max_align; Elf_Addr tls_dtv_generation = 1; /* Used to detect when dtv size changes */ int tls_max_index = 1; /* Largest module index allocated */ +static TAILQ_HEAD(, tcb_list_entry) tcb_list = + TAILQ_HEAD_INITIALIZER(tcb_list); +static size_t tcb_list_entry_offset; + static bool ld_library_path_rpath = false; bool ld_fast_sigblock = false; @@ -929,6 +939,19 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp) allocate_tls_offset(entry->obj); } + if (!allocate_tls_offset_common(&tcb_list_entry_offset, + sizeof(struct tcb_list_entry), _Alignof(struct tcb_list_entry), + 0)) { + /* + * This should be impossible as the static block size is not + * yet fixed, but catch and diagnose it failing if that ever + * changes or somehow turns out to be false. + */ + _rtld_error("Could not allocate offset for tcb_list_entry"); + rtld_die(); + } + dbg("tcb_list_entry_offset %zu", tcb_list_entry_offset); + if (relocate_objects(obj_main, ld_bind_now != NULL && *ld_bind_now != '\0', &obj_rtld, SYMLOOK_EARLY, NULL) == -1) @@ -3973,7 +3996,7 @@ dlopen_object(const char *name, int fd, Obj_Entry *refobj, int lo_flags, if ((lo_flags & RTLD_LO_EARLY) == 0) { map_stacks_exec(lockstate); if (obj != NULL) - distribute_static_tls(&initlist, lockstate); + distribute_static_tls(&initlist); } if (initlist_objects_ifunc(&initlist, (mode & RTLD_MODEMASK) == @@ -5400,6 +5423,44 @@ tls_get_addr_common(struct tcb *tcb, int index, size_t offset) return (tls_get_addr_slow(tcb, index, offset, false)); } +static struct tcb * +tcb_from_tcb_list_entry(struct tcb_list_entry *tcbelm) +{ +#ifdef TLS_VARIANT_I + return ((struct tcb *)((char *)tcbelm - tcb_list_entry_offset)); +#else + return ((struct tcb *)((char *)tcbelm + tcb_list_entry_offset)); +#endif +} + +static struct tcb_list_entry * +tcb_list_entry_from_tcb(struct tcb *tcb) +{ +#ifdef TLS_VARIANT_I + return ((struct tcb_list_entry *)((char *)tcb + tcb_list_entry_offset)); +#else + return ((struct tcb_list_entry *)((char *)tcb - tcb_list_entry_offset)); +#endif +} + +static void +tcb_list_insert(struct tcb *tcb) +{ + struct tcb_list_entry *tcbelm; + + tcbelm = tcb_list_entry_from_tcb(tcb); + TAILQ_INSERT_TAIL(&tcb_list, tcbelm, next); +} + +static void +tcb_list_remove(struct tcb *tcb) +{ + struct tcb_list_entry *tcbelm; + + tcbelm = tcb_list_entry_from_tcb(tcb); + TAILQ_REMOVE(&tcb_list, tcbelm, next); +} + #ifdef TLS_VARIANT_I /* @@ -5513,6 +5574,7 @@ allocate_tls(Obj_Entry *objs, void *oldtcb, size_t tcbsize, size_t tcbalign) } } + tcb_list_insert(tcb); return (tcb); } @@ -5524,6 +5586,8 @@ free_tls(void *tcb, size_t tcbsize, size_t tcbalign __unused) size_t post_size; size_t i, tls_init_align __unused; + tcb_list_remove(tcb); + assert(tcbsize >= TLS_TCB_SIZE); tls_init_align = MAX(obj_main->tlsalign, 1); @@ -5624,6 +5688,7 @@ allocate_tls(Obj_Entry *objs, void *oldtcb, size_t tcbsize, size_t tcbalign) } } + tcb_list_insert(tcb); return (tcb); } @@ -5635,6 +5700,8 @@ free_tls(void *tcb, size_t tcbsize __unused, size_t tcbalign) size_t i; uintptr_t tlsstart, tlsend; + tcb_list_remove(tcb); + /* * Figure out the size of the initial TLS block so that we can * find stuff which ___tls_get_addr() allocated dynamically. @@ -6136,25 +6203,29 @@ map_stacks_exec(RtldLockState *lockstate) } static void -distribute_static_tls(Objlist *list, RtldLockState *lockstate) +distribute_static_tls(Objlist *list) { - Objlist_Entry *elm; + struct tcb_list_entry *tcbelm; + Objlist_Entry *objelm; + struct tcb *tcb; Obj_Entry *obj; - void (*distrib)(size_t, void *, size_t, size_t); + char *tlsbase; - distrib = (void (*)(size_t, void *, size_t, size_t))( - uintptr_t)get_program_var_addr("__pthread_distribute_static_tls", - lockstate); - if (distrib == NULL) - return; - STAILQ_FOREACH(elm, list, link) { - obj = elm->obj; + STAILQ_FOREACH(objelm, list, link) { + obj = objelm->obj; if (obj->marker || !obj->tls_static || obj->static_tls_copied) continue; - lock_release(rtld_bind_lock, lockstate); - distrib(obj->tlsoffset, obj->tlsinit, obj->tlsinitsize, - obj->tlssize); - wlock_acquire(rtld_bind_lock, lockstate); + TAILQ_FOREACH(tcbelm, &tcb_list, next) { + tcb = tcb_from_tcb_list_entry(tcbelm); +#ifdef TLS_VARIANT_I + tlsbase = (char *)tcb + obj->tlsoffset; +#else + tlsbase = (char *)tcb - obj->tlsoffset; +#endif + memcpy(tlsbase, obj->tlsinit, obj->tlsinitsize); + memset(tlsbase + obj->tlsinitsize, 0, + obj->tlssize - obj->tlsinitsize); + } obj->static_tls_copied = true; } } From nobody Thu Jul 10 19:06:08 2025 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 4bdPSw4mlRz61R9W; Thu, 10 Jul 2025 19:06:08 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdPSw3JkMz3vtB; Thu, 10 Jul 2025 19:06:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752174368; 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=oaMCxRPBMfNxkSrdgIPC+Gylzr9NPmHyt+B5HZZgJuk=; b=CFIN6MrDYUypqzEi2eTN/AXSLqTjj9xrBjnp1NBGEA3OTGnVfqf/kMbWa02DwUbdrBqVyN zgFKSVt9Dfb/4AJtbHUfKVJ4m7RsgTV/HNhjYkW2/UATuR9RpPBjoEbGc/0goYuBZeRNvl 2zvNvill6b2Ju6A5JAdIlvq64NycmQ7Oozu5XYYCq3Wl15AKr0gOPab2PlG8faPYqMZGQq DDtbj1RE5EVEQIWnYTU8wFml3sf+g4znHT+QvDi8DUxUgotFp4qmnapv8bb2vg9HZieKL5 tJlgHxqU0qSKIx576v6/t9rM8k4q4hjHdz+JF5KxiNf2KM1YFKQOau2BeKSM3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752174368; 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=oaMCxRPBMfNxkSrdgIPC+Gylzr9NPmHyt+B5HZZgJuk=; b=hyMbaHEbBwPyBJxsjFtaemMrC88nWvMpMupmtZcL/RIxbwyzoe4B6LoP44n1slFdmFE9YM oFIi+lPKbdnMC5H/EgVOZfIyeL0X+hOJ4MeGjj600cuawUm9rxwc/AheTgM+WO/IDaxfkt MNV6RzhRVgZLtVwmNrEwg0jhBsiTBgHl+SfLSp4XRg0oDO6M9y1kV1mSnyvtNY8cFlNTNU ZyWuYIw/hsy4oceW5oTyi7O51GDqlAGmJAlU8R8PROANDZqRkk9EGDtN5Nh1Kbj73gn92y j9gy3Ab8CvYOSTyS6xpg0IL/6lokRNQufOryqUBuWDuNRGGwe0t3Ug8pC9kbaQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752174368; a=rsa-sha256; cv=none; b=NXPWVM8CmjPHj4fxShrz9uq4EV+GioZl5foARs/35VdWWVKLCFVnDuvxEchPMcslN9JBxl dIH3i7DSsnjLdN6PVPUXhkwmb5PRBIscttdUsF3YT6TwEX+PbGLNDja1JpKxZMj7O+JjJb v0xVQrNjA0ECkmGoJUxDVadJp/RtoRIRIBSg6QKEfabPOeQm9eRc9uQW2+7JxKymIhWLp0 SLl1tSO8n4GSdqPt3OAJeyboSGXzrAPZOIBxC0mT1Cs2kkb/wXwpfjIgcUWCmp3hJVKgCZ kI9D5/lKua4YPOrhAR/e9yl0s3sTVD9NMRnL/RWGWkhR3oHlo9dpImTWASKNAA== 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 4bdPSw2kqCz1Hxd; Thu, 10 Jul 2025 19:06:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56AJ68wV004716; Thu, 10 Jul 2025 19:06:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56AJ686f004713; Thu, 10 Jul 2025 19:06:08 GMT (envelope-from git) Date: Thu, 10 Jul 2025 19:06:08 GMT Message-Id: <202507101906.56AJ686f004713@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: 2c444fdb0c75 - main - libc,libthr: Remove __pthread_distribute_static_tls 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2c444fdb0c75fbc73a0ac78d0ecbaef4e1e8baf8 Auto-Submitted: auto-generated The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=2c444fdb0c75fbc73a0ac78d0ecbaef4e1e8baf8 commit 2c444fdb0c75fbc73a0ac78d0ecbaef4e1e8baf8 Author: Jessica Clarke AuthorDate: 2025-07-10 19:00:28 +0000 Commit: Jessica Clarke CommitDate: 2025-07-10 19:00:28 +0000 libc,libthr: Remove __pthread_distribute_static_tls This private API is no longer used by rtld-elf so can be removed. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D50921 --- lib/libc/gen/Symbol.map | 1 - lib/libc/gen/elf_utils.c | 26 ------------------------ lib/libc/gen/libc_interposing_table.c | 1 - lib/libc/include/libc_private.h | 4 +--- lib/libthr/pthread.map | 1 - lib/libthr/thread/thr_list.c | 38 ----------------------------------- lib/libthr/thread/thr_private.h | 2 -- 7 files changed, 1 insertion(+), 72 deletions(-) diff --git a/lib/libc/gen/Symbol.map b/lib/libc/gen/Symbol.map index c2020ac3d8d2..26f638568efc 100644 --- a/lib/libc/gen/Symbol.map +++ b/lib/libc/gen/Symbol.map @@ -596,7 +596,6 @@ FBSDprivate_1.0 { __libc_tcdrain; - __pthread_distribute_static_tls; __pthread_map_stacks_exec; __fillcontextx; __fillcontextx2; diff --git a/lib/libc/gen/elf_utils.c b/lib/libc/gen/elf_utils.c index 330aa8f17f7e..3714a0dc42b5 100644 --- a/lib/libc/gen/elf_utils.c +++ b/lib/libc/gen/elf_utils.c @@ -41,7 +41,6 @@ #include "libc_private.h" void __pthread_map_stacks_exec(void); -void __pthread_distribute_static_tls(size_t, void *, size_t, size_t); int __elf_phdr_match_addr(struct dl_phdr_info *phdr_info, void *addr) @@ -105,28 +104,3 @@ __pthread_map_stacks_exec(void) ((void (*)(void))__libc_interposing[INTERPOS_map_stacks_exec])(); } - -void -__libc_distribute_static_tls(size_t offset, void *src, size_t len, - size_t total_len) -{ - char *tlsbase; - -#ifdef TLS_VARIANT_I - tlsbase = (char *)_tcb_get() + offset; -#else - tlsbase = (char *)_tcb_get() - offset; -#endif - memcpy(tlsbase, src, len); - memset(tlsbase + len, 0, total_len - len); -} - -#pragma weak __pthread_distribute_static_tls -void -__pthread_distribute_static_tls(size_t offset, void *src, size_t len, - size_t total_len) -{ - - ((void (*)(size_t, void *, size_t, size_t))__libc_interposing[ - INTERPOS_distribute_static_tls])(offset, src, len, total_len); -} diff --git a/lib/libc/gen/libc_interposing_table.c b/lib/libc/gen/libc_interposing_table.c index 8eae6c7f5d95..025a67ac3eac 100644 --- a/lib/libc/gen/libc_interposing_table.c +++ b/lib/libc/gen/libc_interposing_table.c @@ -42,7 +42,6 @@ interpos_func_t __libc_interposing[INTERPOS_MAX] = { SLOT(spinlock, __libc_spinlock_stub), SLOT(spinunlock, __libc_spinunlock_stub), SLOT(map_stacks_exec, __libc_map_stacks_exec), - SLOT(distribute_static_tls, __libc_distribute_static_tls), SLOT(uexterr_gettext, __libc_uexterr_gettext), }; #undef SLOT diff --git a/lib/libc/include/libc_private.h b/lib/libc/include/libc_private.h index 1bc22f3931a5..db4cbc32be35 100644 --- a/lib/libc/include/libc_private.h +++ b/lib/libc/include/libc_private.h @@ -249,7 +249,7 @@ enum { INTERPOS_map_stacks_exec, INTERPOS_fdatasync, INTERPOS_clock_nanosleep, - INTERPOS_distribute_static_tls, + INTERPOS__reserved0, /* was distribute_static_tls */ INTERPOS_pdfork, INTERPOS_uexterr_gettext, INTERPOS_MAX @@ -361,8 +361,6 @@ struct dl_phdr_info; int __elf_phdr_match_addr(struct dl_phdr_info *, void *); void __init_elf_aux_vector(void); void __libc_map_stacks_exec(void); -void __libc_distribute_static_tls(__size_t, void *, __size_t, __size_t); -__uintptr_t __libc_static_tls_base(__size_t); void _pthread_cancel_enter(int); void _pthread_cancel_leave(int); diff --git a/lib/libthr/pthread.map b/lib/libthr/pthread.map index 1c8dde03367b..3a5353a32dc3 100644 --- a/lib/libthr/pthread.map +++ b/lib/libthr/pthread.map @@ -136,7 +136,6 @@ FBSDprivate_1.0 { __pthread_mutex_lock; __pthread_mutex_timedlock; __pthread_mutex_trylock; - __pthread_distribute_static_tls; _pthread_atfork; _pthread_barrier_destroy; _pthread_barrier_init; diff --git a/lib/libthr/thread/thr_list.c b/lib/libthr/thread/thr_list.c index 820766f6f5e0..cbf16179f619 100644 --- a/lib/libthr/thread/thr_list.c +++ b/lib/libthr/thread/thr_list.c @@ -363,41 +363,3 @@ _thr_find_thread(struct pthread *curthread, struct pthread *thread, THREAD_LIST_UNLOCK(curthread); return (ret); } - -static void -thr_distribute_static_tls(char *tlsbase, void *src, size_t len, - size_t total_len) -{ - - memcpy(tlsbase, src, len); - memset(tlsbase + len, 0, total_len - len); -} - -void -__pthread_distribute_static_tls(size_t offset, void *src, size_t len, - size_t total_len) -{ - struct pthread *curthread, *thrd; - char *tlsbase; - - if (!_thr_is_inited()) { -#ifdef TLS_VARIANT_I - tlsbase = (char *)_tcb_get() + offset; -#else - tlsbase = (char *)_tcb_get() - offset; -#endif - thr_distribute_static_tls(tlsbase, src, len, total_len); - return; - } - curthread = _get_curthread(); - THREAD_LIST_RDLOCK(curthread); - TAILQ_FOREACH(thrd, &_thread_list, tle) { -#ifdef TLS_VARIANT_I - tlsbase = (char *)thrd->tcb + offset; -#else - tlsbase = (char *)thrd->tcb - offset; -#endif - thr_distribute_static_tls(tlsbase, src, len, total_len); - } - THREAD_LIST_UNLOCK(curthread); -} diff --git a/lib/libthr/thread/thr_private.h b/lib/libthr/thread/thr_private.h index bca890829057..d7b889930365 100644 --- a/lib/libthr/thread/thr_private.h +++ b/lib/libthr/thread/thr_private.h @@ -986,8 +986,6 @@ void __pthread_cxa_finalize(struct dl_phdr_info *phdr_info); void _thr_tsd_unload(struct dl_phdr_info *phdr_info) __hidden; void _thr_sigact_unload(struct dl_phdr_info *phdr_info) __hidden; void _thr_stack_fix_protection(struct pthread *thrd); -void __pthread_distribute_static_tls(size_t offset, void *src, size_t len, - size_t total_len); int *__error_threaded(void) __hidden; void __thr_interpose_libc(void) __hidden; From nobody Thu Jul 10 19:33:41 2025 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 4bdQ4j5xY5z61SSQ; Thu, 10 Jul 2025 19:33:41 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdQ4j4qx6z3F17; Thu, 10 Jul 2025 19:33:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752176021; 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=Y0zVOs9hKnmS4o7DxwQfW8DNQdgAkyVi1gqqRYyHd3Q=; b=pYSH/gLo9OqrjSZtiOaLOgydIUXJ85w1+s5lfrbN1LhyH2+nqzhREAL+5v95RP8Dnnln/3 1rgbpMRhZUK7d2Erbn8NgUCM8S38E5CSVPyIlsPE2B31WcPLoDIE3ADxfC/3uIb2/LfDFE 4ZOgD94BeSVtWLd9GJ/CIu+BKWJgi2rtONeSd36j5gaQc01JNc0trjOHKtbaCCap9nbahN zHMpMRBiYO8540wazhAOB2r7/oOgJ/84mNcqnaxycvg/lItWKeG3xfNlT7Acu3axgEZJJ3 uyuqSMOM+mT/e7wkhK1X3lPnFc3IsilkiQxDazo7OQ2HDb2+NkNOBC4XOHl/rQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752176021; 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=Y0zVOs9hKnmS4o7DxwQfW8DNQdgAkyVi1gqqRYyHd3Q=; b=oGO8xejzdUQR0oqwNTPRqINTJVCyQtFStwsjx06rs/9ycmkeRLPG2MXLK4M2HmXBbZOZni YSpbzuKEE9zlJp9DUej0LRzLDqXQ0z8vKfBNoePUkWPpRImAULn41rmQah7oXjNG/qzHi4 G/xmVYy/RFC2RXbrieQfkTHAvrBT4a4vChA3vCzdaZ/KkSzAn7CcaNIo1Er5fP68ZuUMpV bwZxhSbvJCBvWkBcgSQVNdwY7nOUbKRvNb+tKl/1G6pl6LKkZ0u59Kw317pERZR5fsuWOk rHsJLQ36Ex7/yaq5HdJTtJw+3JToV6u65UtJ5x1ZXN7luvCxqbHNEyyBtfuV+w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752176021; a=rsa-sha256; cv=none; b=mdlRLi27e+zifTHJwLV+PzUTj4tVvL6RdGQDp6MOeoFNtJh1tWfjZJfvvdtBe+gAu6KSun MRhIepUIoO4wb+NUDXHf4UMQyBFOFbqCtxuVxGqPs+yv8cpRvhqkvhvX+3uUgXtSZJtxDc wozgi+7Ep2WeAMcryIJNtXLCIgHJ25pplTb+QBMQWUveiXe4bpXQkU5SjqeLn2oAnBnpJZ j0CoE2mTQPTIOZBHGBQu+E1BJtoQiAHlfJtlHetkrjoK3JG9QnXtEn2DES2ZfMXJ8SzFjw cDAcsYFNXkimKzePvf0DnFDcjVcjBoPGesKEyVkG879xOLXrGnOxUIrJZvNy7A== 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 4bdQ4j4QrYz1Kgw; Thu, 10 Jul 2025 19:33:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56AJXfwA059093; Thu, 10 Jul 2025 19:33:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56AJXfOn059090; Thu, 10 Jul 2025 19:33:41 GMT (envelope-from git) Date: Thu, 10 Jul 2025 19:33:41 GMT Message-Id: <202507101933.56AJXfOn059090@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: cb75bb51261b - main - vmbus: Avoid gratuitous ifdef and use more generic implementation instead 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cb75bb51261b13a49636befdee1c4a76f2e9013e Auto-Submitted: auto-generated The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=cb75bb51261b13a49636befdee1c4a76f2e9013e commit cb75bb51261b13a49636befdee1c4a76f2e9013e Author: Jessica Clarke AuthorDate: 2025-07-10 19:33:33 +0000 Commit: Jessica Clarke CommitDate: 2025-07-10 19:33:33 +0000 vmbus: Avoid gratuitous ifdef and use more generic implementation instead Checking for __LP64__ is non-portable as it assumes that ILP32 and LP64 are the only two ABIs that exist, but CheriBSD supports an additional ABI where long is still 64-bit but pointers are 128-bit capabilities, and thus __LP64__ is not defined. We could change this to check the value of __SIZEOF_LONG__, since the code here only cares about that aspect of the ABI, however in this instance, the only real reason an ifdef is used at all is to be able to get log2(sizeof(u_long)), but if we instead multiply and divide rather than shift, and let the compiler optimise that to a shift, we can just use sizeof(u_long) instead. Note also that VMBUS_EVTFLAGS_MAX could always just have been defined as VMBUS_EVTFLAGS_SIZE / sizeof(u_long). Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D50630 --- sys/dev/hyperv/vmbus/vmbus_chan.c | 6 +++--- sys/dev/hyperv/vmbus/vmbus_reg.h | 10 ++-------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/sys/dev/hyperv/vmbus/vmbus_chan.c b/sys/dev/hyperv/vmbus/vmbus_chan.c index 189a3e66a039..7ea60a499c72 100644 --- a/sys/dev/hyperv/vmbus/vmbus_chan.c +++ b/sys/dev/hyperv/vmbus/vmbus_chan.c @@ -1555,7 +1555,7 @@ vmbus_event_flags_proc(struct vmbus_softc *sc, volatile u_long *event_flags, continue; flags = atomic_swap_long(&event_flags[f], 0); - chid_base = f << VMBUS_EVTFLAG_SHIFT; + chid_base = f * VMBUS_EVTFLAG_LEN; while ((chid_ofs = ffsl(flags)) != 0) { struct vmbus_channel *chan; @@ -1599,7 +1599,7 @@ vmbus_event_proc_compat(struct vmbus_softc *sc, int cpu) eventf = VMBUS_PCPU_GET(sc, event_flags, cpu) + VMBUS_SINT_MESSAGE; if (atomic_testandclear_long(&eventf->evt_flags[0], 0)) { vmbus_event_flags_proc(sc, sc->vmbus_rx_evtflags, - VMBUS_CHAN_MAX_COMPAT >> VMBUS_EVTFLAG_SHIFT); + VMBUS_CHAN_MAX_COMPAT / VMBUS_EVTFLAG_LEN); } } @@ -1903,7 +1903,7 @@ vmbus_chan_msgproc_choffer(struct vmbus_softc *sc, * Setup event flag. */ chan->ch_evtflag = - &sc->vmbus_tx_evtflags[chan->ch_id >> VMBUS_EVTFLAG_SHIFT]; + &sc->vmbus_tx_evtflags[chan->ch_id / VMBUS_EVTFLAG_LEN]; chan->ch_evtflag_mask = 1UL << (chan->ch_id & VMBUS_EVTFLAG_MASK); /* diff --git a/sys/dev/hyperv/vmbus/vmbus_reg.h b/sys/dev/hyperv/vmbus/vmbus_reg.h index 4aa729475b5d..76cdca0ebeb2 100644 --- a/sys/dev/hyperv/vmbus/vmbus_reg.h +++ b/sys/dev/hyperv/vmbus/vmbus_reg.h @@ -60,16 +60,10 @@ CTASSERT(sizeof(struct vmbus_message) == VMBUS_MSG_SIZE); * Hyper-V SynIC event flags */ -#ifdef __LP64__ -#define VMBUS_EVTFLAGS_MAX 32 -#define VMBUS_EVTFLAG_SHIFT 6 -#else -#define VMBUS_EVTFLAGS_MAX 64 -#define VMBUS_EVTFLAG_SHIFT 5 -#endif -#define VMBUS_EVTFLAG_LEN (1 << VMBUS_EVTFLAG_SHIFT) +#define VMBUS_EVTFLAG_LEN (sizeof(u_long) * 8) #define VMBUS_EVTFLAG_MASK (VMBUS_EVTFLAG_LEN - 1) #define VMBUS_EVTFLAGS_SIZE 256 +#define VMBUS_EVTFLAGS_MAX (VMBUS_EVTFLAGS_SIZE / sizeof(u_long)) struct vmbus_evtflags { u_long evt_flags[VMBUS_EVTFLAGS_MAX]; From nobody Thu Jul 10 19:37:03 2025 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 4bdQ8c31M4z61SFJ; Thu, 10 Jul 2025 19:37:04 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdQ8c2NbGz3G9B; Thu, 10 Jul 2025 19:37:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752176224; 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=J0QpeH3DIK+ewexUD891hVHMDnThfaSx6Pz1KPAqP2Q=; b=mFW8IxUR53M88yrOFHtql8ilyKIHct5j/VhjkQt1mJBogw27c8L6SvO4marGNvFLkL5XBk OlpPEwrENzB5oyVakDPj7ct0DJP3Y5FFTgaSRzDaget+SqNkSR+rBVTO2kDrGEeX2zIWXK qPABr4pTd3rCAABmwCo1q4gN0kM4VH+dD1qkgwxW57n/+8/J31//pHmNOPvXmh9SPJAQB1 6H9jMJCdLPpHcltwR5c/G8XE/8H4/iKKQD6cu8Ea8YWvmq9PyqkNhcVosysk69Du7hIsFz prATSwGQq2cFGkjAqfvdDlKF/q9nhXEWQUb2P6jkFJTtE+FKbTHMnd/vny7E/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752176224; 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=J0QpeH3DIK+ewexUD891hVHMDnThfaSx6Pz1KPAqP2Q=; b=Ax3q2lSREo6hSN+ehojONUtzzmqhpVd62FM45J3XtxBDRcc4eti2j9Ho1ieDmSXZucIaZ5 SfxrWDrz2nDPhMLklVWUh4lKCwbccxv/UiItBjzwW/kQIw8uQg6rcEKvicSh779jxpjqlw 8J3MHLgip8kE71TiBnNAJpvEhOfTO+hucbbWNYcKV+CbyobkWfsndQoXHYIMVrefjYXzZg zooMA54Dfvd6DgfclJMNcx/9mS/3vz6InTcUPisNMjmgV3EaQLQ1KqOHm6MAfC85q26h9c VOM7AE81E5D4lwcPU5v1TjEiaiCEQqXBut8buWifKtmjyRUZgW7B7HDB3y0mkg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752176224; a=rsa-sha256; cv=none; b=MVvjRwdoRxaPGDBTPp2547rpXFV5Rtozo/RMGzOYjkLS7VIiAFP9kMC+DRjfpFHTiDh8QR HY0DMHSdFIGy6Kz2NIELX5MTMSAr5u0Y9vhQg1aEWX5u4MBzqQbluolsOZaZUovNHHy+e2 8yz7HieC3NYG9OcXwSg4XGT0HN9JtPsEiWAPFqGavg77mpXfWZH/mC+TDdymDDUegLWyNM faX8bk/mNmLfxJuK7WTZUAUjJPjp8z6aCqlxzb+LNbnJ++1HaNmBRnW4DtfK41pZ3eyuI3 qrTv+I+1ZJT48Woe0U7ooF9J+Gyi5y7BZczFkFEFLDdTB79j5M9vnQpORDH7JA== 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 4bdQ8c1Dyyz1KkD; Thu, 10 Jul 2025 19:37:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56AJb3Nb060061; Thu, 10 Jul 2025 19:37:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56AJb3YD060058; Thu, 10 Jul 2025 19:37:03 GMT (envelope-from git) Date: Thu, 10 Jul 2025 19:37:03 GMT Message-Id: <202507101937.56AJb3YD060058@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: 8f0a6a9aadb1 - main - share: Delete bitrotted make_*_driver.sh scripts 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8f0a6a9aadb1fe4ce87345c6d2fbb2d2b6f6cedf Auto-Submitted: auto-generated The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=8f0a6a9aadb1fe4ce87345c6d2fbb2d2b6f6cedf commit 8f0a6a9aadb1fe4ce87345c6d2fbb2d2b6f6cedf Author: Jessica Clarke AuthorDate: 2025-07-10 19:36:08 +0000 Commit: Jessica Clarke CommitDate: 2025-07-10 19:36:08 +0000 share: Delete bitrotted make_*_driver.sh scripts These scripts have not seen the necessary changes to keep them up to date with current KPIs and coding practices. They use I/O ports directly rather than any bus abstractions, use i386 (which is on the way out for kernel configs) as the architecture of choice for generated kernel configs, use ISA KPIs, use INTR_TYPE_FAST (renamed in 2000 to INTR_FAST and removed in 2011), and likely have other issues too that render them more harm than good for the uninitiated developer looking for a driver template. If anyone wants to invest time in modernising them they can do so and bring them back, but for now delete them. Reviewed by: cperciva, imp, emaste MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D50468 --- ObsoleteFiles.inc | 6 + share/examples/Makefile | 7 - share/examples/drivers/README | 42 --- share/examples/drivers/make_pseudo_driver.sh | 435 --------------------------- tools/build/mk/OptionalObsoleteFiles.inc | 4 - 5 files changed, 6 insertions(+), 488 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 4031478f1db4..a5e41d9ac6d6 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -51,6 +51,12 @@ # xargs -n1 | sort | uniq -d; # done +# 20250710: share: Delete bitrotted make_*_driver.sh scripts +OLD_FILES+=usr/share/examples/drivers/README +OLD_FILES+=usr/share/examples/drivers/make_device_driver.sh +OLD_FILES+=usr/share/examples/drivers/make_pseudo_driver.sh +OLD_DIRS+=usr/share/examples/drivers + # 20250710: shar(1) removed OLD_FILES+=usr/bin/shar diff --git a/share/examples/Makefile b/share/examples/Makefile index f0c050a36306..0a65b8c40d39 100644 --- a/share/examples/Makefile +++ b/share/examples/Makefile @@ -10,7 +10,6 @@ LDIRS= BSD_daemon \ FreeBSD_version \ bootforth \ csh \ - drivers \ etc \ find_interface \ flua \ @@ -74,12 +73,6 @@ SE_DIRS+= csh SE_CSHPACKAGE= csh SE_CSH= dot.cshrc -SE_DIRS+= drivers -SE_DRIVERS= \ - README \ - make_device_driver.sh \ - make_pseudo_driver.sh - SE_DIRS+= etc SE_ETC= \ README.examples \ diff --git a/share/examples/drivers/README b/share/examples/drivers/README deleted file mode 100644 index 8628029a62f8..000000000000 --- a/share/examples/drivers/README +++ /dev/null @@ -1,42 +0,0 @@ - -Author: Julian Elischer - -The files in this directory are shell scripts. - -They will, when run, create an example skeleton driver -for you. You can use this driver as a starting point for -writing drivers for your own devices. They have all the hooks needed -for initialization, probing, attaching, as well as DEVFS -node creation. They also create sample ioctl commands and a sample -ioctl definition .h file in /sys/sys. In other words they are fully -functional in a 'skeleton' sort of a way. They support multiple devices -so that you may have several of your 'foobar' devices probed and attached -at once. - -I expect that these scripts will improve with time. - -At present these scripts also link the newly created driver into -the kernel sources in /sys. Possibly a better way would be -to make them interactive. (and ask what kernel tree to use as well as -a name for the driver.). - -There are presently two scripts. -One for making a real device driver for ISA devices, and -one for making a device driver for pseudo devices (e.g. /dev/null). -Hopefully they will be joined by similar scripts for creating -skeletons for PCI devices as well. - -Give them a single argument: the name of the driver. -They will use this given name in many places within the driver, -both in lower and upper case form. (conforming to normal usage). - -The skeleton driver should already link with the kernel -and in fact the shell script will compile a kernel with the new -drive linked in.. The new kernel should still be -runnable and the new driver should be -fully callable (once you get your device to probe). -You should simply edit the driver and continue to use -'make' (as done in the script) until your driver does what you want. - -The driver will end up in /sys/i386/isa for the device driver script, -and in /sys/dev for the pseudo driver script. diff --git a/share/examples/drivers/make_pseudo_driver.sh b/share/examples/drivers/make_pseudo_driver.sh deleted file mode 100644 index 5d6d09aa9648..000000000000 --- a/share/examples/drivers/make_pseudo_driver.sh +++ /dev/null @@ -1,435 +0,0 @@ -#!/bin/sh -# This writes a skeleton driver and puts it into the kernel tree for you -# -# arg1 is lowercase "foo" -# arg2 path to the kernel sources, "/sys" if omitted -# -# Trust me, RUN THIS SCRIPT :) -# -# -#-------cut here------------------ - -if [ "${1}X" = "X" ] -then - echo "Hey , how about some help here.. give me a device name!" - exit 1 -fi -if [ "X${2}" = "X" ]; then - TOP=`cd /sys; pwd -P` - echo "Using ${TOP} as the path to the kernel sources!" -else - TOP=${2} -fi - -for i in "" "conf" "i386" "i386/conf" "dev" "sys" "modules" -do - if [ -d ${TOP}/${i} ] - then - continue - fi - echo "${TOP}/${i}: no such directory." - echo "Please, correct the error and try again." - exit 1 -done - -UPPER=`echo ${1} |tr "[:lower:]" "[:upper:]"` - -if [ -d ${TOP}/modules/${1} ]; then - echo "There appears to already be a module called ${1}" - echo -n "Should it be overwritten? [Y]" - read VAL - if [ "-z" "$VAL" ]; then - VAL=YES - fi - case ${VAL} in - [yY]*) - echo "Cleaning up from prior runs" - rm -rf ${TOP}/dev/${1} - rm -rf ${TOP}/modules/${1} - rm ${TOP}/conf/files.${UPPER} - rm ${TOP}/i386/conf/${UPPER} - rm ${TOP}/sys/${1}io.h - ;; - *) - exit 1 - ;; - esac -fi - -echo "The following files will be created:" -echo ${TOP}/modules/${1} -echo ${TOP}/conf/files.${UPPER} -echo ${TOP}/i386/conf/${UPPER} -echo ${TOP}/dev/${1} -echo ${TOP}/dev/${1}/${1}.c -echo ${TOP}/sys/${1}io.h -echo ${TOP}/modules/${1} -echo ${TOP}/modules/${1}/Makefile - -mkdir ${TOP}/modules/${1} - -cat >${TOP}/conf/files.${UPPER} <${TOP}/i386/conf/${UPPER} <${TOP}/dev/${1}/${1}.c < -#include -#include /* SYSINIT stuff */ -#include /* SYSINIT stuff */ -#include /* cdevsw stuff */ -#include /* malloc region definitions */ -#include -#include /* ${1} IOCTL definitions */ - -#include /* DELAY() */ - -#define N${UPPER} 3 /* defines number of instances */ - -/* XXX These should be defined in terms of bus-space ops. */ -#define ${UPPER}_INB(port) inb(port) -#define ${UPPER}_OUTB(port, val) (port, (val)) - -/* Function prototypes (these should all be static) */ -static d_open_t ${1}open; -static d_close_t ${1}close; -static d_read_t ${1}read; -static d_write_t ${1}write; -static d_ioctl_t ${1}ioctl; -static d_mmap_t ${1}mmap; -static d_poll_t ${1}poll; - -#define CDEV_MAJOR 20 -static struct cdevsw ${1}_cdevsw = { - .d_version = D_VERSION, - .d_open = ${1}open, - .d_close = ${1}close, - .d_read = ${1}read, - .d_write = ${1}write, - .d_ioctl = ${1}ioctl, - .d_poll = ${1}poll, - .d_mmap = ${1}mmap, - .d_name = "${1}", -}; - -/* - * device specific Misc defines - */ -#define BUFFERSIZE 1024 -#define UNIT(dev) dev2unit(dev) /* assume one minor number per unit */ - -/* - * One of these per allocated device - */ -struct ${1}_softc { - u_long iobase; - char buffer[BUFFERSIZE]; - struct cdev *dev; -}; - -typedef struct ${1}_softc *sc_p; - -static sc_p sca[N${UPPER}]; - -/* - * Macro to check that the unit number is valid - * Often this isn't needed as once the open() is performed, - * the unit number is pretty much safe.. The exception would be if we - * implemented devices that could "go away". in which case all these routines - * would be wise to check the number, DIAGNOSTIC or not. - */ -#define CHECKUNIT(RETVAL) \ -do { /* the do-while is a safe way to do this grouping */ \ - if (unit > N${UPPER}) { \ - printf("%s: bad unit %d\n", __func__, unit); \ - return (RETVAL); \ - } \ - if (scp == NULL) { \ - printf("%s: unit %d not attached\n", __func__, unit); \ - return (RETVAL); \ - } \ -} while (0) - -#ifdef DIAGNOSTIC -#define CHECKUNIT_DIAG(RETVAL) CHECKUNIT(RETVAL) -#else /* DIAGNOSTIC */ -#define CHECKUNIT_DIAG(RETVAL) -#endif /* DIAGNOSTIC */ - -static int -${1}ioctl (struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td) -{ - int unit = UNIT(dev); - sc_p scp = sca[unit]; - - CHECKUNIT_DIAG(ENXIO); - - switch (cmd) { - case DHIOCRESET: - /* whatever resets it */ - (void)scp; /* Delete this line after using scp. */ -#if 0 - ${UPPER}_OUTB(scp->iobase, 0xff); -#endif - break; - default: - return ENXIO; - } - return (0); -} - -/* - * You also need read, write, open, close routines. - * This should get you started - */ -static int -${1}open(struct cdev *dev, int oflags, int devtype, struct thread *td) -{ - int unit = UNIT(dev); - sc_p scp = sca[unit]; - - CHECKUNIT(ENXIO); - - (void)scp; /* Delete this line after using scp. */ - /* - * Do processing - */ - return (0); -} - -static int -${1}close(struct cdev *dev, int fflag, int devtype, struct thread *td) -{ - int unit = UNIT(dev); - sc_p scp = sca[unit]; - - CHECKUNIT_DIAG(ENXIO); - - (void)scp; /* Delete this line after using scp. */ - /* - * Do processing - */ - return (0); -} - -static int -${1}read(struct cdev *dev, struct uio *uio, int ioflag) -{ - int unit = UNIT(dev); - sc_p scp = sca[unit]; - int toread; - - - CHECKUNIT_DIAG(ENXIO); - - /* - * Do processing - * read from buffer - */ - toread = (min(uio->uio_resid, sizeof(scp->buffer))); - return(uiomove(scp->buffer, toread, uio)); -} - -static int -${1}write(struct cdev *dev, struct uio *uio, int ioflag) -{ - int unit = UNIT(dev); - sc_p scp = sca[unit]; - int towrite; - - CHECKUNIT_DIAG(ENXIO); - - /* - * Do processing - * write to buffer - */ - towrite = (min(uio->uio_resid, sizeof(scp->buffer))); - return(uiomove(scp->buffer, towrite, uio)); -} - -static int -${1}mmap(struct cdev *dev, vm_offset_t offset, vm_paddr_t *paddr, int nprot) -{ - int unit = UNIT(dev); - sc_p scp = sca[unit]; - - CHECKUNIT_DIAG(-1); - - (void)scp; /* Delete this line after using scp. */ - /* - * Do processing - */ -#if 0 /* if we had a frame buffer or whatever.. do this */ - if (offset > FRAMEBUFFERSIZE - PAGE_SIZE) { - return (-1); - } - return i386_btop((FRAMEBASE + offset)); -#else - return (-1); -#endif -} - -static int -${1}poll(struct cdev *dev, int which, struct thread *td) -{ - int unit = UNIT(dev); - sc_p scp = sca[unit]; - - CHECKUNIT_DIAG(ENXIO); - - (void)scp; /* Delete this line after using scp. */ - /* - * Do processing - */ - return (0); /* this is the wrong value I'm sure */ -} - -/* - * Now for some driver initialisation. - * Occurs ONCE during boot (very early). - */ -static void -${1}_drvinit(void *unused) -{ - int unit; - sc_p scp; - - for (unit = 0; unit < N${UPPER}; unit++) { - /* - * Allocate storage for this instance . - */ - scp = malloc(sizeof(*scp), M_DEVBUF, M_NOWAIT | M_ZERO); - if( scp == NULL) { - printf("${1}%d failed to allocate strorage\n", unit); - return; - } - sca[unit] = scp; - scp->dev = make_dev(&${1}_cdevsw, unit, - UID_ROOT, GID_KMEM, 0640, "${1}%d", unit); - } -} - -SYSINIT(${1}dev, SI_SUB_DRIVERS, SI_ORDER_MIDDLE+CDEV_MAJOR, - ${1}_drvinit, NULL); -DONE - -cat >${TOP}/sys/${1}io.h < -#endif -#include - -/* - * define an ioctl here - */ -#define DHIOCRESET _IO('D', 0) /* reset the ${1} device */ -#endif -DONE - -if [ ! -d ${TOP}/modules/${1} ]; then - mkdir -p ${TOP}/modules/${1} -fi - -cat >${TOP}/modules/${1}/Makefile < -DONE - -echo -n "Do you want to build the '${1}' module? [Y]" -read VAL -if [ "-z" "$VAL" ]; then - VAL=YES -fi -case ${VAL} in -[yY]*) - (cd ${TOP}/modules/${1}; make depend; make ) - ;; -*) -# exit - ;; -esac - -echo "" -echo -n "Do you want to build the '${UPPER}' kernel? [Y]" -read VAL -if [ "-z" "$VAL" ]; then - VAL=YES -fi -case ${VAL} in -[yY]*) - ( - cd ${TOP}/i386/conf; \ - config ${UPPER}; \ - cd ${TOP}/i386/compile/${UPPER}; \ - make depend; \ - make; \ - ) - ;; -*) -# exit - ;; -esac - -#--------------end of script--------------- -# -#edit to your taste.. -# -# diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc index e0689b2d811f..1e63e4616909 100644 --- a/tools/build/mk/OptionalObsoleteFiles.inc +++ b/tools/build/mk/OptionalObsoleteFiles.inc @@ -1683,9 +1683,6 @@ OLD_FILES+=usr/share/examples/diskless/README.BOOTP OLD_FILES+=usr/share/examples/diskless/README.TEMPLATING OLD_FILES+=usr/share/examples/diskless/clone_root OLD_FILES+=usr/share/examples/dma/mailer.conf -OLD_FILES+=usr/share/examples/drivers/README -OLD_FILES+=usr/share/examples/drivers/make_device_driver.sh -OLD_FILES+=usr/share/examples/drivers/make_pseudo_driver.sh OLD_FILES+=usr/share/examples/dwatch/profile_template OLD_FILES+=usr/share/examples/etc/README.examples OLD_FILES+=usr/share/examples/etc/bsd-style-copyright @@ -1912,7 +1909,6 @@ OLD_DIRS+=usr/share/examples/bsdconfig OLD_DIRS+=usr/share/examples/csh OLD_DIRS+=usr/share/examples/diskless OLD_DIRS+=usr/share/examples/dma -OLD_DIRS+=usr/share/examples/drivers OLD_DIRS+=usr/share/examples/dwatch OLD_DIRS+=usr/share/examples/etc OLD_DIRS+=usr/share/examples/etc/defaults From nobody Thu Jul 10 20:06:43 2025 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 4bdQpq5NNZz61VPv; Thu, 10 Jul 2025 20:06:43 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdQpq4p8Mz3WTQ; Thu, 10 Jul 2025 20:06:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752178003; 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=UsIo9Jb3dVofY/XFb4kVjKG7fqAG1OuEsREQWz5ceYE=; b=Iwo/GS4IiACUibdI9mJy3uCIrSIo92AQ+VGGihCPUwaoMkVvLhF6w9f8W0ejZ8WxWk97jY uy6no9lL7AqIYwDKthyxE3x0nb4WQdOd7aQxo6HCTKMOxD3hGvST7AlkjKGoMwy6BP19ig HkDIy+W9YidYpasZc8IJWB1cg3Tp3OTtwoIUW4vyN+D1LuP4hr3lHnvZWIiSC6DqiGI+nM ooKpQO1g/2jLsMNA+s3rIhsdbNzPA65/YTwT0QaP6hVzJK7Z0bB1OdbnNoIirvEsTGBsSW t1YnSLN+6H5h1EkyhHiqRLWqg3cBZbZW+FuOJV/L3c3LLhjpWDEAkPdB76YYlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752178003; 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=UsIo9Jb3dVofY/XFb4kVjKG7fqAG1OuEsREQWz5ceYE=; b=BG0lM369eL2b8IXLi8KI7DZ3DpAVZJSUaVT108XAqfEGIb8qe4kMGnlu2sxTkE+Do4s9Mq Hs+/hwo1AQB/UykgXRygkP84BclUz1GKX1e5Axwxm8RkZE6DwEJ9fr6wNpdQ6P60GzVC+l NzT2lYaFBOdSsUYlzhyKiEryvUXnoG3E0xkjXpHeQKJL4z/f/NpWIEq8MNxXjWWJ8ufSi7 46c/fm8qRSU+iYsX/3vknQ1RAfltYwwjqx/vNabxX5+7xwWfytsfrF1b5KlaU7dFUn+bmd FS+B78cKUoqzHVgqrQX2EmiB+TYHlE+pJV1b0a6TJonmLh7JMIyaHP9SdxYlRA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752178003; a=rsa-sha256; cv=none; b=L0LTIq/ChB6wN0gTG2pHGynWjg051rGn4FX40rdOc068NFuaA17z9z4qF8wrljexy8aHJw 7m2xXhdUlRJUTFAWz3aliegO4tz8K68NJk+lknvVIUwJ+cX+AA3PgMKEwfrKlg84xFE7T7 KXiUMABAG/Q1uM142KbLtlE8tSzyTFAh8qqrSohE4vF4eZ7Hgv6sQZwVAWQ+d6bkgUGwyj AuBBJ5je+VmWGnlI1meDW1zLYT2/UkCiV8PU1mKlcZep9qx3wXBNPj3EUv/fwQt5N895XG KHq7FeG0PVn0KuEUax+3y+KMwlDlH1GduW7jEjh27nEUSITiDQpmnTrjGbAxDQ== 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 4bdQpq41Bkz1KjD; Thu, 10 Jul 2025 20:06:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56AK6hdL016598; Thu, 10 Jul 2025 20:06:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56AK6hK1016595; Thu, 10 Jul 2025 20:06:43 GMT (envelope-from git) Date: Thu, 10 Jul 2025 20:06:43 GMT Message-Id: <202507102006.56AK6hK1016595@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: cf1b83414f1e - stable/14 - random: Replace a comment with a static assertion 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: cf1b83414f1e6bbbcbc22470781e67fc7fe430c9 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=cf1b83414f1e6bbbcbc22470781e67fc7fe430c9 commit cf1b83414f1e6bbbcbc22470781e67fc7fe430c9 Author: Mark Johnston AuthorDate: 2025-07-03 17:21:18 +0000 Commit: Mark Johnston CommitDate: 2025-07-10 13:51:39 +0000 random: Replace a comment with a static assertion No functional change intended. Reviewed by: cem MFC after: 1 week Sponsored by: Stormshield Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D51110 (cherry picked from commit 6ccf1801f225a5e3e71d5b707646731542a994c7) --- sys/dev/random/random_harvestq.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/random/random_harvestq.c b/sys/dev/random/random_harvestq.c index 50aa28dc9851..92af14446e9c 100644 --- a/sys/dev/random/random_harvestq.c +++ b/sys/dev/random/random_harvestq.c @@ -213,9 +213,10 @@ random_kthread(void) kproc_exit(0); /* NOTREACHED */ } -/* This happens well after SI_SUB_RANDOM */ SYSINIT(random_device_h_proc, SI_SUB_KICK_SCHEDULER, SI_ORDER_ANY, kproc_start, &random_proc_kp); +_Static_assert(SI_SUB_KICK_SCHEDULER > SI_SUB_RANDOM, + "random kthread starting before subsystem initialization"); static void rs_epoch_init(void *dummy __unused) From nobody Thu Jul 10 20:06:44 2025 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 4bdQpr6yd7z61Tv1; Thu, 10 Jul 2025 20:06:44 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdQpr621Yz3Wbp; Thu, 10 Jul 2025 20:06:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752178004; 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=iGOH43g1OvKTWEd86G9iX40FgXaTMsm3feLJU1a6lns=; b=VsolSk8Z++2GoLDd/CQiUaX9cShe6j0Q2GL6MJXzSDCtfmmTRTM2nSi7T2RTz6TQOG6cbS M9C1p79SewEw3a2eXuf78LJVF2BmqWxdG+LlJcEogU1W7q5CN11oXZdtqehbCXcMk3jg68 Kx6feCvV3ctGZFPyIkPaBAszKROApirZFH8Tf7P5EIsoiY35jnwO77cjBrgRRNp3+hO/kU h3FJV3hcb7HhqssmrA0VU5dzCrr93TjNZrqdwpb9X3FciB4ZYbYDl7j4m2qHkgQ+LdTUaf p2iKUr/25q4OlZipYPqhBHYMifJmvw79tf8//hFgRQiUbYe1iL1KtPZjcxhGNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752178004; 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=iGOH43g1OvKTWEd86G9iX40FgXaTMsm3feLJU1a6lns=; b=YwOGg5L28MYDy2bwfH+6uNiRwrJvsQWqRgltQ9hq9xW3wbXSnDbGBkRenGsqmUOdH4S3p1 OAoau0vivSgdcbd6qn3pu/6TEoD8MBylgNnrdfk6VHsFln9GpsTjQ+PR/g3EHSjyMgqAqP eyJ+NWwH8raKedEStthhTW93vzdDvYwhOPnaoFbKkwWgJ3SJfNVQ6rZta/2Vy8Rwpt97Op Xvn9kzbJ/ZEuVCDS9iCHJdorhrmgSebrVmrA1K8Aan8xcAx5WnJ9YHw6HUKZyxsJgCcD/P Rrierb8lP7zrs4HwEqknUPAvaMKjTqwwtr3xDd069P3UlX0ua88cPV7nrUoMSg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752178004; a=rsa-sha256; cv=none; b=CeQ4cywkS+j9kDMnVV6Z3PAX+nYq44823BJ/wHLpe/E7JXH76YreSOTzCb5aDRz1bEJKK2 AGMXJhWTcLjFxT7tC1G3xZj1J5Mcz+fIDvmBSFx8WW78KhDRgAxgxPyjE0WpwPefb9ghEb cxonQTQuWru76UFhRjSqxMSmrsgsMl94QHYqXWCDftxGu4pduiaV29/zZGZ+5nLHbfvDh7 5YNuwGXk5HmY6VosYhFEm8yMaLpf5W2zzTcU0kvv7ufu5Z6AxjqHLf4pmY8oYUgQ/hg16S 8ozoTuTTurMDQ1BlR1a9lUliMRy6qAG1ABna0pR0/Nvex78eL1fUpYc6S2UvCQ== 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 4bdQpr4TS7z1LHm; Thu, 10 Jul 2025 20:06:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56AK6i06016631; Thu, 10 Jul 2025 20:06:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56AK6iSH016628; Thu, 10 Jul 2025 20:06:44 GMT (envelope-from git) Date: Thu, 10 Jul 2025 20:06:44 GMT Message-Id: <202507102006.56AK6iSH016628@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: 11d1a5c57900 - stable/14 - random: Move entropy harvest queue lock macros to random_harvestq.c 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 11d1a5c57900b9cc77c6b56516c7be3fda4ecc0e Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=11d1a5c57900b9cc77c6b56516c7be3fda4ecc0e commit 11d1a5c57900b9cc77c6b56516c7be3fda4ecc0e Author: Mark Johnston AuthorDate: 2025-07-03 17:21:37 +0000 Commit: Mark Johnston CommitDate: 2025-07-10 13:51:41 +0000 random: Move entropy harvest queue lock macros to random_harvestq.c They can't be used externally, so it makes no sense to have them in a header. No functional change intended. Reviewed by: cem MFC after: 1 week Sponsored by: Stormshield Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D51111 (cherry picked from commit 4b8b872a9c55c040eb83f917fc8fd2bf908b96a9) --- sys/dev/random/random_harvestq.c | 5 +++++ sys/dev/random/random_harvestq.h | 4 ---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/sys/dev/random/random_harvestq.c b/sys/dev/random/random_harvestq.c index 92af14446e9c..b5e733dcb8e3 100644 --- a/sys/dev/random/random_harvestq.c +++ b/sys/dev/random/random_harvestq.c @@ -162,6 +162,11 @@ static struct harvest_context { } hc_entropy_fast_accumulator; } harvest_context; +#define RANDOM_HARVEST_INIT_LOCK() mtx_init(&harvest_context.hc_mtx, \ + "entropy harvest mutex", NULL, MTX_SPIN) +#define RANDOM_HARVEST_LOCK() mtx_lock_spin(&harvest_context.hc_mtx) +#define RANDOM_HARVEST_UNLOCK() mtx_unlock_spin(&harvest_context.hc_mtx) + static struct kproc_desc random_proc_kp = { "rand_harvestq", random_kthread, diff --git a/sys/dev/random/random_harvestq.h b/sys/dev/random/random_harvestq.h index 69a9dfabd44a..edeb4ff7a17f 100644 --- a/sys/dev/random/random_harvestq.h +++ b/sys/dev/random/random_harvestq.h @@ -40,8 +40,4 @@ struct harvest_event { uint8_t he_source; /* origin of the entropy */ }; -#define RANDOM_HARVEST_INIT_LOCK(x) mtx_init(&harvest_context.hc_mtx, "entropy harvest mutex", NULL, MTX_SPIN) -#define RANDOM_HARVEST_LOCK(x) mtx_lock_spin(&harvest_context.hc_mtx) -#define RANDOM_HARVEST_UNLOCK(x) mtx_unlock_spin(&harvest_context.hc_mtx) - #endif /* SYS_DEV_RANDOM_RANDOM_HARVESTQ_H_INCLUDED */ From nobody Thu Jul 10 20:06:45 2025 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 4bdQpt08Vlz61Tv5; Thu, 10 Jul 2025 20:06:46 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdQps5l17z3Whj; Thu, 10 Jul 2025 20:06:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752178005; 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=A4jMd/vLGVXcC3bGno5e0dwOO+TQ+4o2gXV209go5fA=; b=e9MEebvdoDfhzZydp2dkrYfxIcbOnTUPhvjdPXlOV8q47UWqGCjnRrlXzQ+3yLZ4rSpV8W FNnoekUkke/MyXIlRmZkr860s6W+DNnrIlEgOfXhV95I6ZZyFMD1yFkjBSw2psgmnN9XTH r5yegzLO6k81/f+aYjbZpdavrWHFQs5UPDgctWbuieqgKGIF72Kew56jecr73Bfxs6CDUb pBihdX8945UbH+AXu7GXKaYmCFg7cNTZ+YU07NbTRv7lU2el+xPVdW1bynDxeRP+eXC+ZA mi7RKGo/e0TaRgKRghllLnRdbiLqdbVO/3z/sHoMnRzIk87jUDq1YILopPgwDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752178005; 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=A4jMd/vLGVXcC3bGno5e0dwOO+TQ+4o2gXV209go5fA=; b=wkrch+7P2LN2OLDs27YR5KBrt7F8JYKpDsOGdM26LdX4riuGIb/SSJ5U6+10b7Yl+PuE9j lUmI5yczg8EdXB7ZE2Z4+fA29Z3i67q2eR1U4pplB24gQKQ5MVSM6WQu9UO4zcdVzgAS5s TmR49O2A50GeHMAnjX0ct0JUIDCNRg81PDtSdsk8ZWv0k+Kz26Arb6lwKceezsSBM7Tb0p ibHvTb6/1VMT0yAT80bJFMhiqWZcm5IWsSTPXlWS+G0fBFQoI8dXlLPbdRtDIt21iovvAs h563jKmhgSrlG0qR5dlLtkU4oup3vgK5t3urRMX8I0XT50wxR/m9bvuYYyg3mA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752178005; a=rsa-sha256; cv=none; b=XcQuNFcUy3CqT8ad0ULuBhEeU6l1V7I+SF1xpHK/3K3o7VXN7lfkTza1/fmW3G7nzs0L+3 s3e9rqg/GZ28nQ1yTVExn+xabtLlRWIfbWUNKXsQGx4MsdXcCCJ972PTtoolaecU0WN1DF 3dmmIcL+sc7HqiTEDgB8hK/rK7fWqwESgowfehMFJZGTnUwV4HNOsheNax+bKHTENv0AXq 6/dk5Sr3NJ2C6Xb9JEkAIvRnslmfNdi7m1sVKhbE275dJscibOIRjyM95xbbuqpAlPqwpR KtoFWdiPCRRpSp3gv/Qc/QITcgMrb8m2DvQJGMRd1pSuvsl8nYMrYvjxNim5vQ== 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 4bdQps586Vz1LT0; Thu, 10 Jul 2025 20:06:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56AK6jn4016664; Thu, 10 Jul 2025 20:06:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56AK6j5V016661; Thu, 10 Jul 2025 20:06:45 GMT (envelope-from git) Date: Thu, 10 Jul 2025 20:06:45 GMT Message-Id: <202507102006.56AK6j5V016661@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: 475a36762f9d - stable/14 - random: Define a macro for getting the CPU cycle count 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 475a36762f9df862b8cce310fccaed3b36ae3cc6 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=475a36762f9df862b8cce310fccaed3b36ae3cc6 commit 475a36762f9df862b8cce310fccaed3b36ae3cc6 Author: Mark Johnston AuthorDate: 2025-07-03 17:27:47 +0000 Commit: Mark Johnston CommitDate: 2025-07-10 13:51:42 +0000 random: Define a macro for getting the CPU cycle count Entropy queue entries always include the low 32 bits of a CPU cycle count reading. Introduce a macro for this instead of hard-coding get_cyclecount() calls everywhere; this is handy for testing purposes since this way, random(4)'s use of the cycle counter (e.g., the number of bits we use) can be changed in one place. No functional change intended. Reviewed by: cem, delphij MFC after: 1 week Sponsored by: Stormshield Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D51113 (cherry picked from commit e2a96b83404fcee0a079a3c3adbb448b86a38d1e) --- sys/dev/random/random_harvestq.c | 9 +++++---- sys/dev/random/random_harvestq.h | 9 +++++++++ sys/dev/random/randomdev.c | 6 +++--- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/sys/dev/random/random_harvestq.c b/sys/dev/random/random_harvestq.c index b5e733dcb8e3..a8eaa932e0b2 100644 --- a/sys/dev/random/random_harvestq.c +++ b/sys/dev/random/random_harvestq.c @@ -459,7 +459,7 @@ random_early_prime(char *entropy, size_t len) return (0); for (i = 0; i < len; i += sizeof(event.he_entropy)) { - event.he_somecounter = (uint32_t)get_cyclecount(); + event.he_somecounter = random_get_cyclecount(); event.he_size = sizeof(event.he_entropy); event.he_source = RANDOM_CACHED; event.he_destination = @@ -566,7 +566,7 @@ random_harvest_queue_(const void *entropy, u_int size, enum random_entropy_sourc if (ring_in != harvest_context.hc_entropy_ring.out) { /* The ring is not full */ event = harvest_context.hc_entropy_ring.ring + ring_in; - event->he_somecounter = (uint32_t)get_cyclecount(); + event->he_somecounter = random_get_cyclecount(); event->he_source = origin; event->he_destination = harvest_context.hc_destination[origin]++; if (size <= sizeof(event->he_entropy)) { @@ -595,7 +595,8 @@ random_harvest_fast_(const void *entropy, u_int size) u_int pos; pos = harvest_context.hc_entropy_fast_accumulator.pos; - harvest_context.hc_entropy_fast_accumulator.buf[pos] ^= jenkins_hash(entropy, size, (uint32_t)get_cyclecount()); + harvest_context.hc_entropy_fast_accumulator.buf[pos] ^= + jenkins_hash(entropy, size, random_get_cyclecount()); harvest_context.hc_entropy_fast_accumulator.pos = (pos + 1)%RANDOM_ACCUM_MAX; } @@ -612,7 +613,7 @@ random_harvest_direct_(const void *entropy, u_int size, enum random_entropy_sour KASSERT(origin >= RANDOM_START && origin < ENTROPYSOURCE, ("%s: origin %d invalid\n", __func__, origin)); size = MIN(size, sizeof(event.he_entropy)); - event.he_somecounter = (uint32_t)get_cyclecount(); + event.he_somecounter = random_get_cyclecount(); event.he_size = size; event.he_source = origin; event.he_destination = harvest_context.hc_destination[origin]++; diff --git a/sys/dev/random/random_harvestq.h b/sys/dev/random/random_harvestq.h index edeb4ff7a17f..7804bf52aa4f 100644 --- a/sys/dev/random/random_harvestq.h +++ b/sys/dev/random/random_harvestq.h @@ -27,6 +27,9 @@ #ifndef SYS_DEV_RANDOM_RANDOM_HARVESTQ_H_INCLUDED #define SYS_DEV_RANDOM_RANDOM_HARVESTQ_H_INCLUDED +#include +#include + #define HARVESTSIZE 2 /* Max length in words of each harvested entropy unit */ /* These are used to queue harvested packets of entropy. The entropy @@ -40,4 +43,10 @@ struct harvest_event { uint8_t he_source; /* origin of the entropy */ }; +static inline uint32_t +random_get_cyclecount(void) +{ + return ((uint32_t)get_cyclecount()); +} + #endif /* SYS_DEV_RANDOM_RANDOM_HARVESTQ_H_INCLUDED */ diff --git a/sys/dev/random/randomdev.c b/sys/dev/random/randomdev.c index 16f0b2c64f1f..69f7fe58f8a3 100644 --- a/sys/dev/random/randomdev.c +++ b/sys/dev/random/randomdev.c @@ -304,14 +304,14 @@ randomdev_accumulate(uint8_t *buf, u_int count) /* Extra timing here is helpful to scrape scheduler jitter entropy */ randomdev_hash_init(&hash); - timestamp = (uint32_t)get_cyclecount(); + timestamp = random_get_cyclecount(); randomdev_hash_iterate(&hash, ×tamp, sizeof(timestamp)); randomdev_hash_iterate(&hash, buf, count); - timestamp = (uint32_t)get_cyclecount(); + timestamp = random_get_cyclecount(); randomdev_hash_iterate(&hash, ×tamp, sizeof(timestamp)); randomdev_hash_finish(&hash, entropy_data); for (i = 0; i < RANDOM_KEYSIZE_WORDS; i += sizeof(event.he_entropy)/sizeof(event.he_entropy[0])) { - event.he_somecounter = (uint32_t)get_cyclecount(); + event.he_somecounter = random_get_cyclecount(); event.he_size = sizeof(event.he_entropy); event.he_source = RANDOM_CACHED; event.he_destination = destination++; /* Harmless cheating */ From nobody Thu Jul 10 20:06:46 2025 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 4bdQpv3vwMz61Tv6; Thu, 10 Jul 2025 20:06:47 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdQpv04Y2z3Wn2; Thu, 10 Jul 2025 20:06:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752178007; 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=fdhrtNJcelq+PJ2EUjE9DpZyn/bMZP6vdp39VFReG0E=; b=V8oK/xmKtwSY7VoaTg2f9JX3PhTjtvA3Y77uJLoT5NJtNx7kbljOk/6kqxH1yDDtgtb25W ay0YMYCvWCOg1VcmhHUjetKPhwKK6mvXxXD8nvvKu42SxjBz1V3KNeSmtv/VVDK5y7PCC5 A+D/XMe27qe2qD0M+mfCyk5+mujKA3ORkEf7HmZecDNwdYZJQRTDRaUIBO+hif028hUMNx MUK2IJKx0qoWvFSgyX+3MCaFBHmSJ59fwDhiBo8loAOPmGggJ0/5StuO+GGGz92vtgc5ug DktoQroD4Rutqhsf2aSEZlusvJHNA/p9CYK4EjPn/O7XSgdaVeI2i6P9EynOJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752178007; 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=fdhrtNJcelq+PJ2EUjE9DpZyn/bMZP6vdp39VFReG0E=; b=yzalAfgdXKGqkjyGFj45JC458yOnHQ2MRP23wSOiNUZfOi5ebDzgriOkr1GTSMbWfgsjRL tXVmHeKI6GrhwGLmSgd7zZb67v0cHTlwhQqN64K/1Bm4ptjnvuQj7iyCM0PcqOXcL2f6XL pfYMDa5qR6YZ/KWgelBhO375bfGZiox+5N/PqThfo92bubRCCLeVQ0IGRwrQUukoSjx02h ecbZxAXBKS7evH4Txhhrjab9CaT6L1BQ91evmKp+QB2VOevqbI06P2mCY+/3RplfERIcHz jlsk+Zv324ulyV3Z75JBeJXcVsVj93PHXpDIpAAlR0LAwEVq4N/xw/F1wy0J9Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752178007; a=rsa-sha256; cv=none; b=vUkrolvb5ndJbgoSXbLI1oqTrJBAgMUK8RI1Rhdm8tl8quGiK4pWVjwY+Q2qZWtFLn+LPW yMD+LXgPe8LQrK3+0ykrjLq8uoGFmpKH3fZhxziOPVGYpDjvpGQR4mD4ESNYSmWPaEtp9V QgwZ2VfW+gSoYG1BT2dKMmJgIuoojKD6vDEmbd59pIXFSUfI0lVkW8vfZeAJ2q0urWiu/d s5mAWXMcAheC9pdDXC2/eCoogEn0YIZufyuCLnUuUSMHG5y0UJdDZU00SZSZAT8WLiscOu 8pAv72YZV6wqQEpVYqdLUPo4emEXeQb+SWH1JPr7he0aaperRFHmof3I995z0g== 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 4bdQpt6PMQz1LF5; Thu, 10 Jul 2025 20:06:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56AK6kaW016701; Thu, 10 Jul 2025 20:06:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56AK6kQG016698; Thu, 10 Jul 2025 20:06:46 GMT (envelope-from git) Date: Thu, 10 Jul 2025 20:06:46 GMT Message-Id: <202507102006.56AK6kQG016698@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: 791ac36668d5 - stable/14 - random: Remove ARGSUSED annotations from random_harvestq.c 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 791ac36668d518b3fff35c21176a31cab66c4e9b Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=791ac36668d518b3fff35c21176a31cab66c4e9b commit 791ac36668d518b3fff35c21176a31cab66c4e9b Author: Mark Johnston AuthorDate: 2025-07-03 17:28:10 +0000 Commit: Mark Johnston CommitDate: 2025-07-10 13:51:44 +0000 random: Remove ARGSUSED annotations from random_harvestq.c Such annotations are obsolete, the compiler tells us when parameters are unused. No functional change intended. Reviewed by: cem MFC after: 1 week Sponsored by: Stormshield Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D51114 (cherry picked from commit 5e213d8a7462968e10370506a4905eab0dd48e65) --- sys/dev/random/random_harvestq.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/sys/dev/random/random_harvestq.c b/sys/dev/random/random_harvestq.c index a8eaa932e0b2..4cf40edb0ab4 100644 --- a/sys/dev/random/random_harvestq.c +++ b/sys/dev/random/random_harvestq.c @@ -312,7 +312,6 @@ random_sources_feed(void) explicit_bzero(entropy, sizeof(entropy)); } -/* ARGSUSED */ static int random_check_uint_harvestmask(SYSCTL_HANDLER_ARGS) { @@ -343,7 +342,6 @@ SYSCTL_PROC(_kern_random_harvest, OID_AUTO, mask, random_check_uint_harvestmask, "IU", "Entropy harvesting mask"); -/* ARGSUSED */ static int random_print_harvestmask(SYSCTL_HANDLER_ARGS) { @@ -396,7 +394,6 @@ static const char *random_source_descr[ENTROPYSOURCE] = { /* "ENTROPYSOURCE" */ }; -/* ARGSUSED */ static int random_print_harvestmask_symbolic(SYSCTL_HANDLER_ARGS) { @@ -429,7 +426,6 @@ SYSCTL_PROC(_kern_random_harvest, OID_AUTO, mask_symbolic, random_print_harvestmask_symbolic, "A", "Entropy harvesting mask (symbolic)"); -/* ARGSUSED */ static void random_harvestq_init(void *unused __unused) { @@ -499,7 +495,6 @@ random_prime_loader_file(const char *type) * known to the kernel, and inserting it directly into the hashing * module, currently Fortuna. */ -/* ARGSUSED */ static void random_harvestq_prime(void *unused __unused) { @@ -528,7 +523,6 @@ random_harvestq_prime(void *unused __unused) } SYSINIT(random_device_prime, SI_SUB_RANDOM, SI_ORDER_MIDDLE, random_harvestq_prime, NULL); -/* ARGSUSED */ static void random_harvestq_deinit(void *unused __unused) { From nobody Thu Jul 10 20:56:21 2025 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 4bdRw62VLJz61Xvr; Thu, 10 Jul 2025 20:56:22 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdRw60tsPz40HF; Thu, 10 Jul 2025 20:56:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752180982; 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=AoeBq4Kp7Tut4aeHiPpfs8I5KfnV39bBu4LuG09HNs0=; b=I1TdJjy09Uu+2e71mOSGBX4QztXkNTIoMyXeZfwm8dPKPKoL+yvWBEgLAwKutvIE9viisP reGJvi+QTAstyHl0J9sMUomte56kXTEmMOfdTJnz1ofNyGdbzK5tt5VJ6LdMIv3hMFh5Ff PPfOypHgsISrTr0gxt8eg6vRNqe9w7EycHc6xsQjXH2Os7FTAcdaGADVlq8M4FEBMEmF7m rV2XnRvJedLB1byGDmT7qv/7gHzTtFgNa9sq3yr46by95mZjZRgCw6RJAwkrW0IizX1KM1 G7p2WcgcRjPAzGDOMeBrqYKh0KKqcmKCryg+ir0VrtUrbFxCKYr4dHQcDdKNZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752180982; 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=AoeBq4Kp7Tut4aeHiPpfs8I5KfnV39bBu4LuG09HNs0=; b=Yqrbo2K6H4tD1/DP2YYlGC9LZp1t2GVB4iJBEAVFTPQb0Jb7J6GwQKXwokRYrYyci+TMcc j4RBE43BjhXEPR3LiagosxK5POX9cy33zl5/4t1YEH9dAJZp5tslKfPUZZ5efb31C0f38K UMDgzyqrhBz79mrgJ1R516vZUU84pg35OgD654+2afG4EPtzeTrE1ecZ0kbta5EskF63dO GBNsliDt/LZufuvXKJlZ83FjKnOxXJ1N5XTkMnb0xbHGmLryUXOcYtyKbOe1CvFyqJyNmD h5jrQF7RNdfQPyS3myZT6grppqGOUnq2xx3uhk55bkhIGbEbpimdUNuDb+PHnw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752180982; a=rsa-sha256; cv=none; b=ah5lEwnBGW3ZRLgVlKdPKOk41q21aMM3687XrnNuRGN31qB8ZFv+c2cUFoLLvP1rVCthid S2G409uLhKKGuqNZbyBFFS0g5J9aYmbDwHPT4o4VKJCRrMy5hNrvpYA58bCMDMlom7b0pt 4035fjvpbe3YoSy9WtHBgZjLqCggrarZSIwZmlRosuUsJgBbhbxpG/IhS6BIVG9amyWI9u tIU6pVZE3mKR3pJctH9JOdmYnYlIA3hAf9LdwMeuNmRFV1LWNhc3ArJw58Qu1ayRDrC7cb d8OHmsflAbk3HqFtP8BWa6QIXintYr9Gsh3k/JzlikAa/eRmaLnQkL2ZrEdK9A== 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 4bdRw60NNtz1MRn; Thu, 10 Jul 2025 20:56:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56AKuLf1009677; Thu, 10 Jul 2025 20:56:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56AKuLsD009674; Thu, 10 Jul 2025 20:56:21 GMT (envelope-from git) Date: Thu, 10 Jul 2025 20:56:21 GMT Message-Id: <202507102056.56AKuLsD009674@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: e8019a159185 - main - cross-build: provide exterr.h and sys/exterrvar.h for non-FreeBSD hosts 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e8019a15918596d8c5e9d15378edf223caffda58 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e8019a15918596d8c5e9d15378edf223caffda58 commit e8019a15918596d8c5e9d15378edf223caffda58 Author: Konstantin Belousov AuthorDate: 2025-07-08 22:34:28 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-10 20:55:41 +0000 cross-build: provide exterr.h and sys/exterrvar.h for non-FreeBSD hosts with enough glue to make libc/gen/err.c compilable. Reported by: jhb Reviewed by: jhb, jrtc27 Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D51217 --- tools/build/cross-build/include/common/exterr.h | 14 ++++++++++++++ tools/build/cross-build/include/common/sys/exterrvar.h | 6 ++++++ 2 files changed, 20 insertions(+) diff --git a/tools/build/cross-build/include/common/exterr.h b/tools/build/cross-build/include/common/exterr.h new file mode 100644 index 000000000000..62482841c7b2 --- /dev/null +++ b/tools/build/cross-build/include/common/exterr.h @@ -0,0 +1,14 @@ +#ifndef _EXTERR_H_ +#define _EXTERR_H_ + +#include + +static inline int +uexterr_gettext(char *buf, size_t bufsz) +{ + if (bufsz > 0) + buf[0] = '\0'; + return (0); +} + +#endif diff --git a/tools/build/cross-build/include/common/sys/exterrvar.h b/tools/build/cross-build/include/common/sys/exterrvar.h new file mode 100644 index 000000000000..0ba821aadef2 --- /dev/null +++ b/tools/build/cross-build/include/common/sys/exterrvar.h @@ -0,0 +1,6 @@ +#ifndef _SYS_EXTERRVAR_H_ +#define _SYS_EXTERRVAR_H_ + +#define UEXTERROR_MAXLEN 256 + +#endif From nobody Thu Jul 10 21:04:13 2025 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 4bdS5B089zz61YVb; Thu, 10 Jul 2025 21:04:14 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdS596TkKz44TW; Thu, 10 Jul 2025 21:04:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752181453; 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=fnQAuTmxd3QZu0SVwOq6NJ16DDkxqmmSAD3YLF/C1GM=; b=vaHfUVXT5frkskbwwEnzAtxhrzRtPz76lhLEZZYmILCk5/jPw0lkuguhnMzQ7fThskX61a 0wuG9vXD3G50M13i9K2L09loeYELb2+QnX5w/anGcoo/ijC2VSFc9VTy5M9L/gV77+wkND p7l16+QP1VW+aTX3kqV7eZSNhIPmcHR6I5uq7p37sqRYgN0WQaQaUzOax/VCxq0YSIQmAj 6FERXIlC3zzjn4g5BlXZ9PKIUnPr9g//fJinHkTEjiGQAeJxEhRkcM/PqVzRg4ENWk8HjP ++9rLm9N0XCciBTZ1ufJxICjxHUrx3IZaV/k31JVE62UMa+83EpYD3WFJp/Duw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752181453; 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=fnQAuTmxd3QZu0SVwOq6NJ16DDkxqmmSAD3YLF/C1GM=; b=lr5xwSUF5QTJwZQxhDkmPoZgh5Dl8X7MxI8XT25Rrv8SqOgcXdF+By/71L7yxcZ9R4gZ/l WY/F/rsJI7Jy8LcBpJcz2otQGLQAkMV5XpiunYI9hFDjMb3igiFtHrBUoFR2p7Ak6cnydN aDbOb16Vl43okpqyMCTusD8V5vmBMUHvMZQIrT3c39x9M1PI1PPqvtb7W1Dwvehs6gHFsR eCpgMOIDZPOGB68DKMYAr/QjRTmvrrMLPxVR1gLb7x49kvsXkx9FYjANR1M1rLS0zIk0Hx zBpwsOgstrP7yy1iig1kOwUmXhpEEmsypCeBxytloWVyFYJJ7D3HIYme6fwykQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752181453; a=rsa-sha256; cv=none; b=Va9+7zj6uCGEstPmKsuK8XycjzfmWmkkuadHKBcCoxlr2mZrG27+zgd81Oq1Cc753lqahy sEdmD9HdWIGtAZwc6nw0j7yyl7mWPsXoVxd+ZuAmt2zdwatoY1NpfS5UCJd3BAWYgz/wfc efUgHVvgoILxAue4Vh4ATLbz2OBdrJB3ozpW69fUV5rEZ4FlMOyn/fJrHlqg390r5mqw+9 Kqf9X+uXJVfVJYj8K4yXf28hwO1tyceaVf/gxMP0DVr6ew+/8L+bZu4nDDPeHFCiK4lTYy AADWY17gBdNB9ljDndguP97CcJzxVKzkf/IPI3rDlFwdBus903O4ktgfNZkpgw== 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 4bdS596111z1MGw; Thu, 10 Jul 2025 21:04:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56AL4DPr028593; Thu, 10 Jul 2025 21:04:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56AL4DB5028590; Thu, 10 Jul 2025 21:04:13 GMT (envelope-from git) Date: Thu, 10 Jul 2025 21:04:13 GMT Message-Id: <202507102104.56AL4DB5028590@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: 103763fab4f7 - stable/14 - vm_pageout_scan_inactive: take a lock break 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 103763fab4f7349df53f7367816f1f4ca2881005 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=103763fab4f7349df53f7367816f1f4ca2881005 commit 103763fab4f7349df53f7367816f1f4ca2881005 Author: Ryan Libby AuthorDate: 2024-05-24 15:52:58 +0000 Commit: Mark Johnston CommitDate: 2025-07-10 21:00:34 +0000 vm_pageout_scan_inactive: take a lock break In vm_pageout_scan_inactive, release the object lock when we go to refill the scan batch queue so that someone else has a chance to acquire it. This improves access latency to the object when the pagedaemon is processing many consecutive pages from a single object, and also in any case avoids a hiccup during refill for the last touched object. Reviewed by: alc, markj (previous version) Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D45288 (cherry picked from commit a216e311a70cc87a5646f4306e36c60a51706699) --- sys/vm/vm_pageout.c | 16 +++++++++++++++- sys/vm/vm_pagequeue.h | 6 ++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c index c2c5281b87af..83f655eb852e 100644 --- a/sys/vm/vm_pageout.c +++ b/sys/vm/vm_pageout.c @@ -1468,7 +1468,21 @@ vm_pageout_scan_inactive(struct vm_domain *vmd, int page_shortage) pq = &vmd->vmd_pagequeues[PQ_INACTIVE]; vm_pagequeue_lock(pq); vm_pageout_init_scan(&ss, pq, marker, NULL, pq->pq_cnt); - while (page_shortage > 0 && (m = vm_pageout_next(&ss, true)) != NULL) { + while (page_shortage > 0) { + /* + * If we need to refill the scan batch queue, release any + * optimistically held object lock. This gives someone else a + * chance to grab the lock, and also avoids holding it while we + * do unrelated work. + */ + if (object != NULL && vm_batchqueue_empty(&ss.bq)) { + VM_OBJECT_WUNLOCK(object); + object = NULL; + } + + m = vm_pageout_next(&ss, true); + if (m == NULL) + break; KASSERT((m->flags & PG_MARKER) == 0, ("marker page %p was dequeued", m)); diff --git a/sys/vm/vm_pagequeue.h b/sys/vm/vm_pagequeue.h index 70122fef9fff..43cb67a252b5 100644 --- a/sys/vm/vm_pagequeue.h +++ b/sys/vm/vm_pagequeue.h @@ -357,6 +357,12 @@ vm_batchqueue_init(struct vm_batchqueue *bq) bq->bq_cnt = 0; } +static inline bool +vm_batchqueue_empty(const struct vm_batchqueue *bq) +{ + return (bq->bq_cnt == 0); +} + static inline int vm_batchqueue_insert(struct vm_batchqueue *bq, vm_page_t m) { From nobody Thu Jul 10 21:31:51 2025 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 4bdSj43cWrz61ZpD; Thu, 10 Jul 2025 21:31:52 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdSj414cFz3Ks8; Thu, 10 Jul 2025 21:31:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752183112; 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=7Xc6RTjL1v62VVJHeS70gILQVY+7u3cRka71GmYdeHM=; b=en5l5wBecyfTjkVNonT6Wlyy1HprT/N4rl7h1JXtd/V2t3zpja7yc6Coxt/yYvCW4HVSvK zmYETh3xZ5k6WYEjIrvK08WwrFKxlIVYxPiN7yx/T9xxU+mK4wf+TQVHbsDrNllQMaeIGW i6mbK9Np55lY9yAJW3utGxttf6cZv+YToobd/AapT3MJ/CPS0pKRJh9VjZiozTzI7Ca0Ew upWQZ7kTFvrl6ytoRWS+9XW5GWUe9JDLygwdAhH/ZT6VyYztBggDLGT0McWzzsdjc/H8by JXYctfzk7K+udskKX8h4TIHwE+h/yukq+MFcWSI0Ttr+WV6zxRFOq1wesXuG6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752183112; 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=7Xc6RTjL1v62VVJHeS70gILQVY+7u3cRka71GmYdeHM=; b=EOQxlbW9fdAaRZEzwqg9d66+GyGIBIytV+4qjMCYGWhexO/QgxuCwsq1bNzazpf/+wsxJ6 Sb72kmkkecsj3K9c340zOn4uzwvAn0xR08EMvJt53wqDLqzLkjUSUgOGClWf39vzWv6imR XQiwvo6D/jcP2gqWP1+Y06ldBLtZpyffVWqi57dMFtDVNCNZN5T6JuELvquPqM8BeXzD07 dDamnX9zwYTS6eZYK1CMalSegDpyA9A8jBCiwW0SwmJhN5p18XxgTGKTcEM2QazuEwCSVc HclU3thk/6JgCOXq87b4IF7+vRl/aad0zcjNvg6jtvn7ZkxzhvR+EUiR5wMFGQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752183112; a=rsa-sha256; cv=none; b=UmL6V8y1keOyou7qqBVgvGGNb4Y2gcIkb5J7p+T7aZr/JFK+Yrpel6eQBcmuW0VsqrtNFR e4iqTUJF4yuZiFW6S5UB+OCduzzWKBoE8BDrnc/LQFQovV6UNk0UdFLtcH35cyCir/LZuq XkRYAhJwOXvjvVT8TpQ/LuTudQn9kxOpoxCUOqQdQGypb6bTNJKryzfHCCVwDt8ezWy79l kN/sAvQZaoCBE6qkukWbBTQBILRDAtjRDxvwCRulZkzs0BxVWN8ZwARbV2wfdUVWiguMjr hSpJSMsmE8mBRohh2+oOPFg3JvvxI4PWlMbPTYC+05nL9ob2cBNoD/d7Nq1Xjg== 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 4bdSj40frjz1NPb; Thu, 10 Jul 2025 21:31:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56ALVpuC082102; Thu, 10 Jul 2025 21:31:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56ALVpFl082099; Thu, 10 Jul 2025 21:31:51 GMT (envelope-from git) Date: Thu, 10 Jul 2025 21:31:51 GMT Message-Id: <202507102131.56ALVpFl082099@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 09d28419c646 - main - cross-build: fix after the recent sqlite3 import 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 09d28419c646650a77721e168ef43bc1bac96b67 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=09d28419c646650a77721e168ef43bc1bac96b67 commit 09d28419c646650a77721e168ef43bc1bac96b67 Author: Konstantin Belousov AuthorDate: 2025-07-10 21:02:37 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-10 21:31:23 +0000 cross-build: fix after the recent sqlite3 import Stop adding contrib/sqlite3 into the include path for usr.bin/kyua, take headers from the install sysroot env. sqilte3 now has the VERSION file, which clashes with c++ include . Submitted by: jrtc27 (see https://reviews.freebsd.org/D51217) Tested by: kib Fixes: 17f0f75308f2 ("sqlite3: Vendor import of sqlite3 3.50.2") --- usr.bin/kyua/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/kyua/Makefile b/usr.bin/kyua/Makefile index d3a7b9b61f64..a4f95f1106d9 100644 --- a/usr.bin/kyua/Makefile +++ b/usr.bin/kyua/Makefile @@ -32,7 +32,7 @@ MAN= kyua-about.1 \ CFLAGS+= -I${KYUA_SRCDIR} -I${.CURDIR} CFLAGS+= -I${SRCTOP}/contrib/lutok/include -CFLAGS+= -I${SRCTOP}/contrib/sqlite3 +CFLAGS+= -I${SYSROOT:U${DESTDIR}}/${INCLUDEDIR}/private/sqlite3 CFLAGS+= -DHAVE_CONFIG_H # We compile the kyua libraries as part of the main executable as this saves From nobody Thu Jul 10 22:54:25 2025 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 4bdVXL1pR7z61fSx; Thu, 10 Jul 2025 22:54:26 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdVXK5BS5z4ML2; Thu, 10 Jul 2025 22:54:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752188065; 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=QaNK79eaTQpJNbrG2o0M6GeaZ9hbf17EXNGJ0wgcO2U=; b=UjTW3vrsSHjXgJe/38ydEcY4ZdLOnK5m29uvnu6aVa79YfYgFShu56LtSOqqbxzeRIJUDj lertHTuKjQQjRY1Y/GRFy2EgU8q02rzRIGrTexmjmetPJsBpATEpd+CNB0I6kIV4OtX+AS hYcY2tj1FVKKa2CLbELhEF6/gaknm3yg9YUYijF45tIFXGMsOWjjolhGVsTC/7udMF5IH9 oQvPnNSnomekYQdH0CZSbxr7Mx6OoC66Z71sLO4RFGkDxQBm6CtGuPd7J61Tfso8p2cpRz M9n0FKD4dZyYOMDBiVAb2jFnVXf9DZRn7PvV9Stjkwfe0S4I62TeReQDYShFFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752188065; 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=QaNK79eaTQpJNbrG2o0M6GeaZ9hbf17EXNGJ0wgcO2U=; b=l/eBCrk6Z9tfvH5hF4vl++FMrOavJ55kJEhA4ag+J/47xaDoduXYrAeTo3UNBrp+CPF0tX u7blCqQ+6RE6Bpb0cldr65iaR3PF+gYrkzlbzsZJcnytdLJ/06J1ULVknGiMVTaT0qHM2s Z4oPjaGs0/vkh/tUPu9GiI5lKHSH/K1XZ5m3dsC2H2j+TLi7ZprrC6j0Bycfhz0sYEdtEX mflPqb0e7PJX39t2tkQfX1+u2zrdQkglaSu5aF5D6EKa5fZFGsT8mk5tvmTK5sC4Ix7SD7 nqEAmPlY7QTpvoLoxoQpNp4N8zyazKUH3YLmE4xxk6NNCqr/OdfgQlroONDwRg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752188065; a=rsa-sha256; cv=none; b=EIwEqC/Pqr+nSJTtlhYMQoDJrExRbkwtJ7m+bNntrhqF+CDvkO2NACfpAH9GtFGWeA/JU3 zzA6/+4QuNnm2cRYyWlfJ+PcjJ5VAHSiXbGOteq2QDVpSEEgkqCbR6YqJEFPqQyMMdtQMh TSWhz19VswcrIPtEZ5VRMhQ3sjPDM4hnUALP4s9/IUJYoHOJIJMXDQeqIWqqlU0mpoeopU 3rxo1KnOsQ4/sPFDNfq/YthiCIe6KbKysHrepixJ6GTcFNZX5mhzg8nx2irZ40tWqG+Rao PKn91K8vJ3LukhqZsu8aA/6k9OE2gEpOGwaA/IzYidKVS9oMsM6wHCoZndsKjQ== 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 4bdVXK3d9Zz1QkZ; Thu, 10 Jul 2025 22:54:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56AMsPIf033677; Thu, 10 Jul 2025 22:54:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56AMsPHd033674; Thu, 10 Jul 2025 22:54:25 GMT (envelope-from git) Date: Thu, 10 Jul 2025 22:54:25 GMT Message-Id: <202507102254.56AMsPHd033674@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Ziaee Subject: git: d7baf5f70802 - main - bectl.8: Describe better 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d7baf5f70802a9045f5792a7063b2614bf17356a Auto-Submitted: auto-generated The branch main has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=d7baf5f70802a9045f5792a7063b2614bf17356a commit d7baf5f70802a9045f5792a7063b2614bf17356a Author: Alexander Ziaee AuthorDate: 2025-06-13 19:37:23 +0000 Commit: Alexander Ziaee CommitDate: 2025-07-10 22:35:36 +0000 bectl.8: Describe better + Concise document description for consistency and apropos results + Improve introductory paragraph, mentioning boot loader support + Explain -r in "Supported Subcommands and Flags" + Clarify the purpose of the check subcommand + Add two basic examples, creating and mounting + Fold some long lines, correct a stray capitalization. MFC after: 3 days Co-authored-by: kevans --- sbin/bectl/bectl.8 | 121 ++++++++++++++++++++++++++++------------------------- 1 file changed, 65 insertions(+), 56 deletions(-) diff --git a/sbin/bectl/bectl.8 b/sbin/bectl/bectl.8 index cc88c7019d13..0e08b3383e9a 100644 --- a/sbin/bectl/bectl.8 +++ b/sbin/bectl/bectl.8 @@ -3,12 +3,12 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.Dd April 9, 2024 +.Dd June 13, 2025 .Dt BECTL 8 .Os .Sh NAME .Nm bectl -.Nd Utility to manage boot environments on ZFS +.Nd manage ZFS boot environments .Sh SYNOPSIS .Nm .Op Fl h @@ -80,34 +80,31 @@ .Sh DESCRIPTION The .Nm -command is used to setup and interact with ZFS boot environments, which are -bootable clones of datasets. -.Pp -A boot environment allows the system to be upgraded, while preserving the -pre-upgrade system environment. -.Pp -.Nm -itself accepts an -.Fl r -flag specified before the command to indicate the -.Ar beroot -that should be used as the boot environment root, or the dataset whose children -are all boot environments. -Normally this information is derived from the bootfs property of the pool that -is mounted at -.Pa / , -but it is useful when the system has not been booted into a ZFS root or a -different pool should be operated on. -For instance, booting into the recovery media and manually importing a pool from -one of the system's resident disks will require the -.Fl r -flag to work. +utility manages bootable ZFS clones called boot environments. +Boot envionments allow system changes to be tested safely, +as they are selectable directly from the boot +.Xr loader 8 . +This utility can +.Cm create , +.Cm list , +.Cm mount , +or +.Cm jail +boot environments. +Once the changes have been tested, the boot environment can be +.Cm unmount Ns ed , +.Cm activate Ns d , +.Cm rename Ns d , +and +.Cm destroy Ns ed . .Ss Supported Subcommands and Flags -.Bl -tag -width activate -.It Xo -.Fl h -.Xc +.Bl -tag -width indent +.It Fl h Print usage information and exit. +.It Fl r Ar beroot Sy Ar subcommand +Specify a parent dataset for the boot environment to use for +.Ar subcommand +for operation on manually imported pools or unusual layouts. .It Xo .Cm activate .Op Fl t | Fl T @@ -122,19 +119,19 @@ flag is given, this takes effect only for the next boot. Flag .Fl T removes temporary boot once configuration. -Without temporary configuration, the next boot will use zfs dataset specified -in boot pool +Without temporary configuration, +the next boot will use zfs dataset specified in boot pool .Ar bootfs property. .It Xo .Cm check .Xc -Performs a silent sanity check on the current system. +Perform a check to see if the current system can use boot environments. If boot environments are supported and used, .Nm will exit with a status code of 0. -Any other status code is not currently defined and may, in the future, grow -special meaning for different degrees of sanity check failures. +Any other status code is not currently defined and may, in the future, +grow special meaning for different degrees of sanity check failures. .It Xo .Cm create .Op Fl r @@ -162,8 +159,8 @@ environment. .Pp If .Nm -is creating from another boot environment, a snapshot of that boot environment -will be created to clone from. +is creating from another boot environment, +a snapshot of that boot environment will be created to clone from. .It Xo .Cm create .Op Fl r @@ -174,8 +171,10 @@ Create a snapshot of the boot environment named .Pp If the .Fl r -flag is given, a recursive snapshot of the boot environment will be created. -A snapshot is created for each descendant dataset of the boot environment. +flag is given, +a recursive snapshot of the boot environment will be created. +A snapshot is created for each descendant dataset +of the boot environment. See .Sx Boot Environment Structures for a discussion on different layouts. @@ -241,8 +240,8 @@ If .Ar utility is specified, it will be executed instead of .Pa /bin/sh . -The jail will be destroyed and the boot environment unmounted when the command -finishes executing, unless the +The jail will be destroyed and the boot environment unmounted +when the command finishes executing, unless the .Fl U argument is specified. .Pp @@ -269,11 +268,11 @@ The following default parameters are provided: .It Va allow.mount Ta Cm true .It Va allow.mount.devfs Ta Cm true .It Va enforce_statfs Ta Cm 1 -.It Va name Ta Set to jail ID. +.It Va name Ta set to jail ID .It Va host.hostname Ta Va bootenv -.It Va path Ta Set to a path in Pa /tmp +.It Va path Ta set to a path in Pa /tmp generated by -.Xr libbe 3 . +.Xr libbe 3 .El .Pp All default parameters may be overwritten. @@ -298,8 +297,8 @@ or combination of .It Fl a Display all datasets. .It Fl D -Display the full space usage for each boot environment, assuming all -other boot environments were destroyed. +Display the full space usage for each boot environment, +assuming all other boot environments were destroyed. .It Fl H Used for scripting. Do not print headers and separate fields by a single tab instead of @@ -351,8 +350,8 @@ will make a directory such as .Pa be_mount.c6Sf in .Pa /tmp . -Randomness in the last four characters of the directory name will prevent -mount point conflicts. +Randomness in the last four characters of the directory name +will prevent mount point conflicts. Unmount of an environment, followed by mount of the same environment without giving a .Ar mountpoint , @@ -362,7 +361,7 @@ Rename the given .Ar origBeName to the given .Ar newBeName . -The boot environment will not be unmounted in order for this rename to occur. +The boot environment will not be unmounted for this rename to occur. .It Cm ujail Brq Ar jailId | jailName | beName .It Cm unjail Brq Ar jailId | jailName | beName Destroy the jail created from the given boot environment. @@ -390,8 +389,8 @@ boot environment layout, as created by the Auto ZFS option to .Xr bsdinstall 8 , is a .Dq shallow -boot environment structure, where boot environment datasets do not have any -directly subordinate datasets. +boot environment structure, where boot environment datasets +do not have any directly subordinate datasets. Instead, they're organized off in .Pa zroot/ROOT , and they rely on datasets elsewhere in the pool having @@ -419,7 +418,8 @@ set to .Dv off , thus files in .Pa /usr -typically fall into the boot environment because this dataset is not mounted. +typically fall into the boot environment +because this dataset is not mounted. .Pa zroot/usr/src is mounted, thus files in .Pa /usr/src @@ -445,8 +445,8 @@ Note that the subordinate datasets now have .Dv canmount set to .Dv noauto . -These are more obviously a part of the boot environment, as indicated by their -positioning in the layout. +These are more obviously a part of the boot environment, +as indicated by their positioning in the layout. These subordinate datasets will be mounted by the .Dv zfsbe .Xr rc 8 @@ -468,16 +468,25 @@ A future version of may default to handling both styles and deprecate the various .Fl r flags. -.\" .Sh EXAMPLES -.\" .Bl -bullet -.\" .It +.Sh EXAMPLES +Create a boot environment, named with today's date, +containing snapshots of the root dataset and of all child datasets: +.Pp +.Dl bectl create -r `date +%Y%m%d` +.Pp +Mount a previous boot environment, +.Ar yesterdaysbe , +to +.Pa /mnt : +.Pp +.Dl bectl mount yesterdaysbe /mnt .\" To fill in with jail upgrade example when behavior is firm. -.\" .El .Sh SEE ALSO .Xr libbe 3 , .Xr zfsprops 7 , .Xr beinstall.sh 8 , .Xr jail 8 , +.Xr loader 8 , .Xr zfs 8 , .Xr zpool 8 .Sh HISTORY From nobody Thu Jul 10 22:58:52 2025 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 4bdVdT3Bk8z61gGS; Thu, 10 Jul 2025 22:58:53 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdVdT116bz4PZv; Thu, 10 Jul 2025 22:58:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752188333; 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=2Q+o7FvckPxRF+3X3+QyEy9gZk+UQEAdwt5pobM5Sp0=; b=q2qeHauoEpD3v8aKXnwa7NVai9j+ujg3i3u8m5cQQkSh+CCaqlFs5rLS4sl5Ev+mFZTf5N q5CNqI5nGKNIdrLmnF49Ch6HIonwfrjKDGob1fcFg7jxlDbZcWGhIu1sqvyRzi3CtPTez0 Ullr21Czw43dLNbj3TTwkuQgMLI2P20+3yYjkAiovDCXPqlXqRGJX1pa0lT9nea6QNaKex 8Ktvt13TXWoluIYFB1Nz4EIHFks00FBNxE+oaPHSJ2sYwQpv+YYS2YrS+K5s8xyqRSbBMj 3q1dRxbXSooIsHYQWJVr8h7Mc8PSR1kqyFyMewiYB54jUkD1/wZi+AxTWttaLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752188333; 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=2Q+o7FvckPxRF+3X3+QyEy9gZk+UQEAdwt5pobM5Sp0=; b=qvJrujsgThYSwwYaBcx3o7mMfGiJmToC0twrgCGQbXzssICfAJcM2lKUUlUi9bJiPe+1Jn k2sAN3M4sTr6/ii8722wAQ4l3O8c1b/4tFuuvrYMu968em0FZHP1tVutR9o0P/EDup514R 3FeL/1/2K9LAYo7aBPqwvnF7ORNz+RtdHogbq+e86TNHfraIRyDslhFpQ7w+GfhA4BnSt8 596u65UK0Z3KQPuBDivPR6yGoK9qhV38lY3XqYFDP1BE1eiQf40xOjeFT4mlSf9Ggw5tqp W4A7JlWI29yQYoUkCDEAq2suzhRYItJ3MwIvYPGEyuviNvWH18bKVt8AzbNd+w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752188333; a=rsa-sha256; cv=none; b=edQ8y0dMpPfh1/jC5BAXyUAYpV79CjJ2+uVgJ9IjSBLO3jJjyzRX5EJ8fKYBAsHceaqFTy 7ZKd97lc0f6iwZ9ul1NmcUaaL/tP1k0PKl2NLeKY9YzuT1lv3dRGWjbc60xHJ7ppByhXH0 g9pIO6272rkiClajjXXhDc58vgQL3CkT0srn2p35vBHcerWooAmbiyo3E3YVJAViywxn/v P0CaZT+n/5eim6fsbBtdaWQ1QnGVkdVw2xDke1XPZl0u32PBAw7ZCRiEsto5quSidsT/Tv BI88ppv+W7p5gN8UCCGu8P1FHMv6dPSv4npRJYjZyrKO7PANcEV0790Kw9ygJQ== 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 4bdVdT02xbz1Qm3; Thu, 10 Jul 2025 22:58:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56AMwqr4035207; Thu, 10 Jul 2025 22:58:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56AMwqdq035204; Thu, 10 Jul 2025 22:58:52 GMT (envelope-from git) Date: Thu, 10 Jul 2025 22:58:52 GMT Message-Id: <202507102258.56AMwqdq035204@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: d26f481bcdfe - main - sys: Delete stale comments in sys/elf_common.h 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d26f481bcdfec9354614ccc0f7f694bd7bcc5a6c Auto-Submitted: auto-generated The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=d26f481bcdfec9354614ccc0f7f694bd7bcc5a6c commit d26f481bcdfec9354614ccc0f7f694bd7bcc5a6c Author: Jessica Clarke AuthorDate: 2025-07-10 22:58:06 +0000 Commit: Jessica Clarke CommitDate: 2025-07-10 22:58:06 +0000 sys: Delete stale comments in sys/elf_common.h Originally the relocations for RISC-V were partitioned into dynamic and static (with those that are both being classed as dynamic), but they were packed next to each other, and so as new relocations were added they were allocated sequentially, at the end of the static block, even if really dynamic, R_RISCV_IRELATIVE being the first such case (and only one we currently have a definition for). Delete the misleading comments. Fixes: 4b88ccbc79cc ("Sync relocation definitions") MFC after: 1 week --- sys/sys/elf_common.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/sys/sys/elf_common.h b/sys/sys/elf_common.h index 87460aae2dd4..61e1afdfe5c4 100644 --- a/sys/sys/elf_common.h +++ b/sys/sys/elf_common.h @@ -1352,7 +1352,6 @@ typedef struct { * RISC-V relocation types. */ -/* Relocation types used by the dynamic linker. */ #define R_RISCV_NONE 0 #define R_RISCV_32 1 #define R_RISCV_64 2 @@ -1365,8 +1364,6 @@ typedef struct { #define R_RISCV_TLS_DTPREL64 9 #define R_RISCV_TLS_TPREL32 10 #define R_RISCV_TLS_TPREL64 11 - -/* Relocation types not used by the dynamic linker. */ #define R_RISCV_BRANCH 16 #define R_RISCV_JAL 17 #define R_RISCV_CALL 18 From nobody Thu Jul 10 22:58:53 2025 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 4bdVdV44TFz61g5r; Thu, 10 Jul 2025 22:58:54 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdVdV16V1z4PMc; Thu, 10 Jul 2025 22:58:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752188334; 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=SCLLi97gUIvs8Z+GUHoFftSYo9G26QZvKOcn7Anf2Xs=; b=mA3B7tE6XWFVbunbO7rxaitXnm8Rr0Ihln0NUeDE15WonF270AY9YL6SxkToCa3lwCSSII QjMo4IpEYi0aa0EhG1+l4L/UTOcuQPSLkV1NUqa1h4mQBI2zSFsYcmriycbfcWXc6aLcCv fEkzeYPPwvYQQaVxFAhSiuTubycNZS1UrIZZqtbuhZqAzc7FPz3jmHCas0iPLXTFOmPmOh fjbFtfBfwPA+6/aydY7aJSJYpeTeiwurM0594O0Ba0QQKqccYkDucHVk753mBHnWsoA87g lvEtVnyX2Fvr2LJP/3fMN8pH8mrVnmHhQXIy3fdQ9LBWJm5/SEfzuDjNMhfUQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752188334; 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=SCLLi97gUIvs8Z+GUHoFftSYo9G26QZvKOcn7Anf2Xs=; b=vjh2yT56vzMYGSPNnR9rVS2++/hzw20CIeRZOOWRnPlZkivWusFLn5apNDItxr23quLYXa T48TwsRf76Fu9+DwH5lxzvf26FE0KlCBV93478k114K59OfqmQJUsA6JbcdMcPuUHncQ31 HBsegPxHFD4rQeDbBwQtTInE7pCv1VL1xFTBubfBahTgHx189f5uyrRVRxrFNl8fa5eSFd jJ+bg8vnfeOeSaTNE3guAu4H/4WXL1Cj2V5rJbmUbpvkiq7AUnWUbxc1KFM7XbhK8nX/c1 o7TK1k6SZYOwcN18t0gxLLYoIQ+BLAXQ6RctiKBeMIiZmFrDkuoaV7o6mHw5BA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752188334; a=rsa-sha256; cv=none; b=h2Fxxxh7SLRIUgQ/VWNtuf/aWDjT13AovvJyuRV/4BWdGicGBGuo25DCI0/ycbJVM/AAIl AugxXwIg9wgu4q0Nnw+ZVcTy4sAcPHF5lbC/w8x+8JEEary/DwmLYV+88tt2KYDJI7VbH3 kS3hM+WALpOgwZ0XMU4ya51jWc5IznNd3RDD6eC7whMsGqwzq4rBkUYIP6i/AuUAi2rRLx c8XMB+ltvCMEqAHFFmXuh1Hzy3lu51KQhWotvAUttp4qJpC/mDKzZfWBnOpxNwcgz+Q7gp dMCa8WGat9pqq0hCdgztCmRbcdLFrNkJUF8qnuMX9ki0QHp7P043bicg2IQM0Q== 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 4bdVdV0gghz1Qm4; Thu, 10 Jul 2025 22:58:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56AMwrcj035242; Thu, 10 Jul 2025 22:58:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56AMwrCX035239; Thu, 10 Jul 2025 22:58:53 GMT (envelope-from git) Date: Thu, 10 Jul 2025 22:58:53 GMT Message-Id: <202507102258.56AMwrCX035239@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: 65bd6c7acd1f - main - sys: Sync RISC-V relocations 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 65bd6c7acd1fba38ce0b234d5d777a2ebad7e807 Auto-Submitted: auto-generated The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=65bd6c7acd1fba38ce0b234d5d777a2ebad7e807 commit 65bd6c7acd1fba38ce0b234d5d777a2ebad7e807 Author: Jessica Clarke AuthorDate: 2025-07-10 22:58:06 +0000 Commit: Jessica Clarke CommitDate: 2025-07-10 22:58:06 +0000 sys: Sync RISC-V relocations MFC after: 1 week --- sys/sys/elf_common.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/sys/sys/elf_common.h b/sys/sys/elf_common.h index 61e1afdfe5c4..048550512c85 100644 --- a/sys/sys/elf_common.h +++ b/sys/sys/elf_common.h @@ -1364,6 +1364,7 @@ typedef struct { #define R_RISCV_TLS_DTPREL64 9 #define R_RISCV_TLS_TPREL32 10 #define R_RISCV_TLS_TPREL64 11 +#define R_RISCV_TLSDESC 12 #define R_RISCV_BRANCH 16 #define R_RISCV_JAL 17 #define R_RISCV_CALL 18 @@ -1389,10 +1390,10 @@ typedef struct { #define R_RISCV_SUB16 38 #define R_RISCV_SUB32 39 #define R_RISCV_SUB64 40 +#define R_RISCV_GOT32_PCREL 41 #define R_RISCV_ALIGN 43 #define R_RISCV_RVC_BRANCH 44 #define R_RISCV_RVC_JUMP 45 -#define R_RISCV_RVC_LUI 46 #define R_RISCV_RELAX 51 #define R_RISCV_SUB6 52 #define R_RISCV_SET6 53 @@ -1401,6 +1402,14 @@ typedef struct { #define R_RISCV_SET32 56 #define R_RISCV_32_PCREL 57 #define R_RISCV_IRELATIVE 58 +#define R_RISCV_PLT32 59 +#define R_RISCV_SET_ULEB128 60 +#define R_RISCV_SUB_ULEB128 61 +#define R_RISCV_TLSDESC_HI20 62 +#define R_RISCV_TLSDESC_LOAD_LO12 63 +#define R_RISCV_TLSDESC_ADD_LO12 64 +#define R_RISCV_TLSDESC_CALL 65 +#define R_RISCV_VENDOR 191 /* * Loongson LoongArch relocation types. From nobody Thu Jul 10 22:58:55 2025 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 4bdVdW50nZz61gGY; Thu, 10 Jul 2025 22:58:55 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdVdW2yk3z4PVf; Thu, 10 Jul 2025 22:58:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752188335; 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=60pJx8zZJRJqwv7mkNqwavTa3CxZ+hsD0Kp2nPSoLhA=; b=KsPu4vwKYHSD/TNWXHZUuT1+wNzlVzN1QGmnZimU12cuH9XJm640ioTxFG1UlHTSMEgKDr JGfcQs3IYMWFOmtz49X+u61Tkkg01mZwPEOHMaf3NOH0uedzavaWU2xMo1VkH193Wwwo9o KH448gyDc40evdnr7U+NphOyeyeMGQKNrwjpoqXYTEQeKUGjrW9+oMXus4rkTG1j+e6QlZ nuh+T9TKeguSwdkzor7UcHjf/goeMH2VtjZNGlbLPaGhYIIROikm2HQIkVhnFSTmijVkzb YuemfyoC0Tt5gYb5M5YIG0f+GHhY0H5Qd8PVHvcDils3BtfwY6oDHd8s/Nbcpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752188335; 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=60pJx8zZJRJqwv7mkNqwavTa3CxZ+hsD0Kp2nPSoLhA=; b=BmY4LOwRYI/jEYy1evxfjw1FAiFZR5L4brO6mtUfjnQQ7gZY5uZ3d7QKGY2o9UGyYxGz1H HbpXtRF9U3TqbSbLbuQZeQAGiqFIuCwjaNLEY9KEfRRRRBgKMtu3VWQYrY1udG7cl/KUm6 BjoMLbdaQ5Oc1iIrXRmss+ieYFhgg3rSw+cinnM6lttAdd5bobUjbuGVQUf3MBbmd8HEVx 7Ez2wucCaKmaCCJWt/1M5BTPDJScb5NOJABD2/4umkI7ebLHVhjhpLJWzh7iQGc582Y95J AWNC6TapPB3IJr/DjUA2Ln7cnRnwCuspx8JFZ4VT7kL4hTLYnPzd2YcCfAr/lw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752188335; a=rsa-sha256; cv=none; b=gQYGWuUu/eacfBli9JXA+OsBzYgp30LiMFMfQ4rWmJqJ+p6Ccyjaemv6YxFd9qnhfYQO1H sK0jI5OGduBClhytvL7KhutOZpfVUX+wE7uaZU92294HfGuXsoF9P6AcpW2tWz4qvmttzy bYlFVI/lWUiSqMYEVXlUMtqMMRSAx+Dqi87pElpVipS+X2HgxJ30+zWRRAloNwfNLSVx2M sD6Azp4RuWT+Eu9lJ+BxBS3RnLmaCtIaF+ab+GwMb8kles9SCAnVpFn+GiB2GZhIymrurI qX737EHgZH/Sqnmk+FxYb3QqBDBi847OQxGD2KSyCn4jX9WPB5KlsS9IGk98xQ== 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 4bdVdW1f0Vz1Qm5; Thu, 10 Jul 2025 22:58:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56AMwtjO035276; Thu, 10 Jul 2025 22:58:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56AMwtLo035273; Thu, 10 Jul 2025 22:58:55 GMT (envelope-from git) Date: Thu, 10 Jul 2025 22:58:55 GMT Message-Id: <202507102258.56AMwtLo035273@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: e049e2c37309 - main - sys: Fix style(9) for all LoongArch defines in sys/elf_common.h 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e049e2c37309af210c606756089b331fbfdda7b9 Auto-Submitted: auto-generated The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=e049e2c37309af210c606756089b331fbfdda7b9 commit e049e2c37309af210c606756089b331fbfdda7b9 Author: Jessica Clarke AuthorDate: 2025-07-10 22:58:07 +0000 Commit: Jessica Clarke CommitDate: 2025-07-10 22:58:07 +0000 sys: Fix style(9) for all LoongArch defines in sys/elf_common.h Every one of them was using spaces rather than tabs after the macro name. Fixes: 2bb61497ca76 ("elf_common.h: Add definitions for LoongArch ELF files") --- sys/sys/elf_common.h | 246 +++++++++++++++++++++++++-------------------------- 1 file changed, 123 insertions(+), 123 deletions(-) diff --git a/sys/sys/elf_common.h b/sys/sys/elf_common.h index 048550512c85..22495728a764 100644 --- a/sys/sys/elf_common.h +++ b/sys/sys/elf_common.h @@ -306,7 +306,7 @@ typedef struct { and MPRC of Peking University */ #define EM_AARCH64 183 /* AArch64 (64-bit ARM) */ #define EM_RISCV 243 /* RISC-V */ -#define EM_LOONGARCH 258 /* Loongson LoongArch */ +#define EM_LOONGARCH 258 /* Loongson LoongArch */ /* Non-standard or deprecated. */ #define EM_486 6 /* Intel i486. */ @@ -392,15 +392,15 @@ typedef struct { */ /* LoongArch Base ABI Modifiers */ -#define EF_LOONGARCH_ABI_SOFT_FLOAT 0x00000001 -#define EF_LOONGARCH_ABI_SINGLE_FLOAT 0x00000002 -#define EF_LOONGARCH_ABI_DOUBLE_FLOAT 0x00000003 -#define EF_LOONGARCH_ABI_MODIFIER_MASK 0x00000007 +#define EF_LOONGARCH_ABI_SOFT_FLOAT 0x00000001 +#define EF_LOONGARCH_ABI_SINGLE_FLOAT 0x00000002 +#define EF_LOONGARCH_ABI_DOUBLE_FLOAT 0x00000003 +#define EF_LOONGARCH_ABI_MODIFIER_MASK 0x00000007 /* LoongArch Object file ABI versions */ -#define EF_LOONGARCH_OBJABI_V0 0x00000000 -#define EF_LOONGARCH_OBJABI_V1 0x00000040 -#define EF_LOONGARCH_OBJABI_MASK 0x000000C0 +#define EF_LOONGARCH_OBJABI_V0 0x00000000 +#define EF_LOONGARCH_OBJABI_V1 0x00000040 +#define EF_LOONGARCH_OBJABI_MASK 0x000000C0 #define EF_SPARC_EXT_MASK 0x00ffff00 #define EF_SPARC_32PLUS 0x00000100 @@ -1419,101 +1419,101 @@ typedef struct { */ /* Relocation types used by the dynamic linker */ -#define R_LARCH_NONE 0 -#define R_LARCH_32 1 -#define R_LARCH_64 2 -#define R_LARCH_RELATIVE 3 -#define R_LARCH_COPY 4 -#define R_LARCH_JUMP_SLOT 5 -#define R_LARCH_TLS_DTPMOD32 6 -#define R_LARCH_TLS_DTPMOD64 7 -#define R_LARCH_TLS_DTPREL32 8 -#define R_LARCH_TLS_DTPREL64 9 -#define R_LARCH_TLS_TPREL32 10 -#define R_LARCH_TLS_TPREL64 11 -#define R_LARCH_IRELATIVE 12 -#define R_LARCH_MARK_LA 20 -#define R_LARCH_MARK_PCREL 21 -#define R_LARCH_SOP_PUSH_PCREL 22 -#define R_LARCH_SOP_PUSH_ABSOLUTE 23 -#define R_LARCH_SOP_PUSH_DUP 24 -#define R_LARCH_SOP_PUSH_GPREL 25 -#define R_LARCH_SOP_PUSH_TLS_TPREL 26 -#define R_LARCH_SOP_PUSH_TLS_GOT 27 -#define R_LARCH_SOP_PUSH_TLS_GD 28 -#define R_LARCH_SOP_PUSH_PLT_PCREL 29 -#define R_LARCH_SOP_ASSERT 30 -#define R_LARCH_SOP_NOT 31 -#define R_LARCH_SOP_SUB 32 -#define R_LARCH_SOP_SL 33 -#define R_LARCH_SOP_SR 34 -#define R_LARCH_SOP_ADD 35 -#define R_LARCH_SOP_AND 36 -#define R_LARCH_SOP_IF_ELSE 37 -#define R_LARCH_SOP_POP_32_S_10_5 38 -#define R_LARCH_SOP_POP_32_U_10_12 39 -#define R_LARCH_SOP_POP_32_S_10_12 40 -#define R_LARCH_SOP_POP_32_S_10_16 41 -#define R_LARCH_SOP_POP_32_S_10_16_S2 42 -#define R_LARCH_SOP_POP_32_S_5_20 43 -#define R_LARCH_SOP_POP_32_S_0_5_10_16_S2 44 -#define R_LARCH_SOP_POP_32_S_0_10_10_16_S2 45 -#define R_LARCH_SOP_POP_32_U 46 -#define R_LARCH_ADD8 47 -#define R_LARCH_ADD16 48 -#define R_LARCH_ADD24 49 -#define R_LARCH_ADD32 50 -#define R_LARCH_ADD64 51 -#define R_LARCH_SUB8 52 -#define R_LARCH_SUB16 53 -#define R_LARCH_SUB24 54 -#define R_LARCH_SUB32 55 -#define R_LARCH_SUB64 56 -#define R_LARCH_GNU_VTINHERIT 57 -#define R_LARCH_GNU_VTENTRY 58 +#define R_LARCH_NONE 0 +#define R_LARCH_32 1 +#define R_LARCH_64 2 +#define R_LARCH_RELATIVE 3 +#define R_LARCH_COPY 4 +#define R_LARCH_JUMP_SLOT 5 +#define R_LARCH_TLS_DTPMOD32 6 +#define R_LARCH_TLS_DTPMOD64 7 +#define R_LARCH_TLS_DTPREL32 8 +#define R_LARCH_TLS_DTPREL64 9 +#define R_LARCH_TLS_TPREL32 10 +#define R_LARCH_TLS_TPREL64 11 +#define R_LARCH_IRELATIVE 12 +#define R_LARCH_MARK_LA 20 +#define R_LARCH_MARK_PCREL 21 +#define R_LARCH_SOP_PUSH_PCREL 22 +#define R_LARCH_SOP_PUSH_ABSOLUTE 23 +#define R_LARCH_SOP_PUSH_DUP 24 +#define R_LARCH_SOP_PUSH_GPREL 25 +#define R_LARCH_SOP_PUSH_TLS_TPREL 26 +#define R_LARCH_SOP_PUSH_TLS_GOT 27 +#define R_LARCH_SOP_PUSH_TLS_GD 28 +#define R_LARCH_SOP_PUSH_PLT_PCREL 29 +#define R_LARCH_SOP_ASSERT 30 +#define R_LARCH_SOP_NOT 31 +#define R_LARCH_SOP_SUB 32 +#define R_LARCH_SOP_SL 33 +#define R_LARCH_SOP_SR 34 +#define R_LARCH_SOP_ADD 35 +#define R_LARCH_SOP_AND 36 +#define R_LARCH_SOP_IF_ELSE 37 +#define R_LARCH_SOP_POP_32_S_10_5 38 +#define R_LARCH_SOP_POP_32_U_10_12 39 +#define R_LARCH_SOP_POP_32_S_10_12 40 +#define R_LARCH_SOP_POP_32_S_10_16 41 +#define R_LARCH_SOP_POP_32_S_10_16_S2 42 +#define R_LARCH_SOP_POP_32_S_5_20 43 +#define R_LARCH_SOP_POP_32_S_0_5_10_16_S2 44 +#define R_LARCH_SOP_POP_32_S_0_10_10_16_S2 45 +#define R_LARCH_SOP_POP_32_U 46 +#define R_LARCH_ADD8 47 +#define R_LARCH_ADD16 48 +#define R_LARCH_ADD24 49 +#define R_LARCH_ADD32 50 +#define R_LARCH_ADD64 51 +#define R_LARCH_SUB8 52 +#define R_LARCH_SUB16 53 +#define R_LARCH_SUB24 54 +#define R_LARCH_SUB32 55 +#define R_LARCH_SUB64 56 +#define R_LARCH_GNU_VTINHERIT 57 +#define R_LARCH_GNU_VTENTRY 58 /* * Relocs whose processing do not require a stack machine. * * Spec addition: https://github.com/loongson/LoongArch-Documentation/pull/57 */ -#define R_LARCH_B16 64 -#define R_LARCH_B21 65 -#define R_LARCH_B26 66 -#define R_LARCH_ABS_HI20 67 -#define R_LARCH_ABS_LO12 68 -#define R_LARCH_ABS64_LO20 69 -#define R_LARCH_ABS64_HI12 70 -#define R_LARCH_PCALA_HI20 71 -#define R_LARCH_PCALA_LO12 72 -#define R_LARCH_PCALA64_LO20 73 -#define R_LARCH_PCALA64_HI12 74 -#define R_LARCH_GOT_PC_HI20 75 -#define R_LARCH_GOT_PC_LO12 76 -#define R_LARCH_GOT64_PC_LO20 77 -#define R_LARCH_GOT64_PC_HI12 78 -#define R_LARCH_GOT_HI20 79 -#define R_LARCH_GOT_LO12 80 -#define R_LARCH_GOT64_LO20 81 -#define R_LARCH_GOT64_HI12 82 -#define R_LARCH_TLS_LE_HI20 83 -#define R_LARCH_TLS_LE_LO12 84 -#define R_LARCH_TLS_LE64_LO20 85 -#define R_LARCH_TLS_LE64_HI12 86 -#define R_LARCH_TLS_IE_PC_HI20 87 -#define R_LARCH_TLS_IE_PC_LO12 88 -#define R_LARCH_TLS_IE64_PC_LO20 89 -#define R_LARCH_TLS_IE64_PC_HI12 90 -#define R_LARCH_TLS_IE_HI20 91 -#define R_LARCH_TLS_IE_LO12 92 -#define R_LARCH_TLS_IE64_LO20 93 -#define R_LARCH_TLS_IE64_HI12 94 -#define R_LARCH_TLS_LD_PC_HI20 95 -#define R_LARCH_TLS_LD_HI20 96 -#define R_LARCH_TLS_GD_PC_HI20 97 -#define R_LARCH_TLS_GD_HI20 98 -#define R_LARCH_32_PCREL 99 -#define R_LARCH_RELAX 100 +#define R_LARCH_B16 64 +#define R_LARCH_B21 65 +#define R_LARCH_B26 66 +#define R_LARCH_ABS_HI20 67 +#define R_LARCH_ABS_LO12 68 +#define R_LARCH_ABS64_LO20 69 +#define R_LARCH_ABS64_HI12 70 +#define R_LARCH_PCALA_HI20 71 +#define R_LARCH_PCALA_LO12 72 +#define R_LARCH_PCALA64_LO20 73 +#define R_LARCH_PCALA64_HI12 74 +#define R_LARCH_GOT_PC_HI20 75 +#define R_LARCH_GOT_PC_LO12 76 +#define R_LARCH_GOT64_PC_LO20 77 +#define R_LARCH_GOT64_PC_HI12 78 +#define R_LARCH_GOT_HI20 79 +#define R_LARCH_GOT_LO12 80 +#define R_LARCH_GOT64_LO20 81 +#define R_LARCH_GOT64_HI12 82 +#define R_LARCH_TLS_LE_HI20 83 +#define R_LARCH_TLS_LE_LO12 84 +#define R_LARCH_TLS_LE64_LO20 85 +#define R_LARCH_TLS_LE64_HI12 86 +#define R_LARCH_TLS_IE_PC_HI20 87 +#define R_LARCH_TLS_IE_PC_LO12 88 +#define R_LARCH_TLS_IE64_PC_LO20 89 +#define R_LARCH_TLS_IE64_PC_HI12 90 +#define R_LARCH_TLS_IE_HI20 91 +#define R_LARCH_TLS_IE_LO12 92 +#define R_LARCH_TLS_IE64_LO20 93 +#define R_LARCH_TLS_IE64_HI12 94 +#define R_LARCH_TLS_LD_PC_HI20 95 +#define R_LARCH_TLS_LD_HI20 96 +#define R_LARCH_TLS_GD_PC_HI20 97 +#define R_LARCH_TLS_GD_HI20 98 +#define R_LARCH_32_PCREL 99 +#define R_LARCH_RELAX 100 /* * Relocs added in ELF for the LoongArch™ Architecture v20230519, part of the @@ -1526,13 +1526,13 @@ typedef struct { * in psABI v2.20 because they were proved not necessary to be exposed outside * of the linker. */ -#define R_LARCH_ALIGN 102 -#define R_LARCH_PCREL20_S2 103 -#define R_LARCH_ADD6 105 -#define R_LARCH_SUB6 106 -#define R_LARCH_ADD_ULEB128 107 -#define R_LARCH_SUB_ULEB128 108 -#define R_LARCH_64_PCREL 109 +#define R_LARCH_ALIGN 102 +#define R_LARCH_PCREL20_S2 103 +#define R_LARCH_ADD6 105 +#define R_LARCH_SUB6 106 +#define R_LARCH_ADD_ULEB128 107 +#define R_LARCH_SUB_ULEB128 108 +#define R_LARCH_64_PCREL 109 /* * Relocs added in ELF for the LoongArch™ Architecture v20231102, part of the @@ -1540,7 +1540,7 @@ typedef struct { * * Spec addition: https://github.com/loongson/la-abi-specs/pull/4 */ -#define R_LARCH_CALL36 110 +#define R_LARCH_CALL36 110 /* * Relocs added in ELF for the LoongArch™ Architecture v20231219, part of the @@ -1548,24 +1548,24 @@ typedef struct { * * Spec addition: https://github.com/loongson/la-abi-specs/pull/5 */ -#define R_LARCH_TLS_DESC32 13 -#define R_LARCH_TLS_DESC64 14 -#define R_LARCH_TLS_DESC_PC_HI20 111 -#define R_LARCH_TLS_DESC_PC_LO12 112 -#define R_LARCH_TLS_DESC64_PC_LO20 113 -#define R_LARCH_TLS_DESC64_PC_HI12 114 -#define R_LARCH_TLS_DESC_HI20 115 -#define R_LARCH_TLS_DESC_LO12 116 -#define R_LARCH_TLS_DESC64_LO20 117 -#define R_LARCH_TLS_DESC64_HI12 118 -#define R_LARCH_TLS_DESC_LD 119 -#define R_LARCH_TLS_DESC_CALL 120 -#define R_LARCH_TLS_LE_HI20_R 121 -#define R_LARCH_TLS_LE_ADD_R 122 -#define R_LARCH_TLS_LE_LO12_R 123 -#define R_LARCH_TLS_LD_PCREL20_S2 124 -#define R_LARCH_TLS_GD_PCREL20_S2 125 -#define R_LARCH_TLS_DESC_PCREL20_S2 126 +#define R_LARCH_TLS_DESC32 13 +#define R_LARCH_TLS_DESC64 14 +#define R_LARCH_TLS_DESC_PC_HI20 111 +#define R_LARCH_TLS_DESC_PC_LO12 112 +#define R_LARCH_TLS_DESC64_PC_LO20 113 +#define R_LARCH_TLS_DESC64_PC_HI12 114 +#define R_LARCH_TLS_DESC_HI20 115 +#define R_LARCH_TLS_DESC_LO12 116 +#define R_LARCH_TLS_DESC64_LO20 117 +#define R_LARCH_TLS_DESC64_HI12 118 +#define R_LARCH_TLS_DESC_LD 119 +#define R_LARCH_TLS_DESC_CALL 120 +#define R_LARCH_TLS_LE_HI20_R 121 +#define R_LARCH_TLS_LE_ADD_R 122 +#define R_LARCH_TLS_LE_LO12_R 123 +#define R_LARCH_TLS_LD_PCREL20_S2 124 +#define R_LARCH_TLS_GD_PCREL20_S2 125 +#define R_LARCH_TLS_DESC_PCREL20_S2 126 #define R_SPARC_NONE 0 #define R_SPARC_8 1 From nobody Thu Jul 10 22:58:56 2025 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 4bdVdX5yXcz61gGc; Thu, 10 Jul 2025 22:58:56 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdVdX2kLVz4PdM; Thu, 10 Jul 2025 22:58:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752188336; 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=/SopBKbJDL1bhy/oU28JhEb+p3JBS69g7yVvDRybjo4=; b=UluqqkJjAPlWG8J6PLnwFieZaJ1RVTP0hsN5dzUwH94WgARW5BUNe9wZW01KbX9bEHXyz1 gqTDUfIqWuVh/XMTNRuIk0tuX8Gw6b9f2Axo5vNvqj4hyBwqby8spFnasJvJvStgcJUVuT xgJ/Os76Ui5N7/XVcflXBRqbWwyc4mIvhWNTF3UvcUC6ZbH5UWxmdZFqYoP8cXwWGYxbzz +6DNEH/gKMC6y0oQysa6HPlIuPr7Tjhv6Xkwb8gxoDCGI0VuRJ7EAEfK5ZCq2CzsCzSgEl +kGXMbmDtcYIoS1VUN53zKhZolTfsx3XbFWXU6M4TDp0JYUCtCR3WMwkbtXD+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752188336; 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=/SopBKbJDL1bhy/oU28JhEb+p3JBS69g7yVvDRybjo4=; b=lm1jN3eplUBqQL+pgkzKGC6m3JNL+NDZUM+cucIH3KRu+NbKN3v9B5gU3dqKTDM5NuJ6gJ GibTsXBqE6NijNwX0VEwYLJ7oRTiG/KBQsh/7OLraRFIQDt8jTMp8RvEA3+df37Yku/omw 1S6HfGWMjIxREF+Q/x2gMGJvqK5hG6fFq98ABGBFqoUIwjE0UvHvEx+vUB0SHAnoyqfvnU 5RAyjdXvfFnEVqGM2EBlqXm1lJV0qAklEXbnfGPrfA08pvaffxQ32hshJ0u9PQzKrKJMNy 0ACp2w968B2bHHvd9FI7R2pBaiLva2weJtIsyvVKuB2hMq0ngvaSpIyd74JfXA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752188336; a=rsa-sha256; cv=none; b=aFsvSHQcQlRfoaOJhvocShZSLhlaG5bF3nU59Soy18pDxJU9nGvlFPZkI7YTKwQvgXrM4K 0X8h2wH15A8DYHoEoc3ZeVTmzMDwkrGjhyOqFGjpWra0ybd4CdcNmVmwsKfRfkO0mIOOfM H1ndGOLVa0xmIygYWGVjwIzewZ+WIg2ck+vSzkZIpohykB9ctLV3bk6ZXXMldvMWoT+BeG dZWHJHAw93qTHUlD7j2e6qyABMuB+Qb4RZIimaz2mIuhtxB3rkBpNVkvVEX1b9Q2SXBbV2 5oAGKHgU88OlOYGJRxGlEFLEXTLhBXEqzb0Hvai1ak+NIbWwLP2md2Nb9k4dZg== 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 4bdVdX2Fsxz1QYS; Thu, 10 Jul 2025 22:58:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56AMwuXS035315; Thu, 10 Jul 2025 22:58:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56AMwuMM035312; Thu, 10 Jul 2025 22:58:56 GMT (envelope-from git) Date: Thu, 10 Jul 2025 22:58:56 GMT Message-Id: <202507102258.56AMwuMM035312@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: 22ae840b9f0f - main - sys: Various whitespace style(9) fixes for sys/elf_common.h 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 22ae840b9f0ff290cb08edacf975a99d264d3a0d Auto-Submitted: auto-generated The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=22ae840b9f0ff290cb08edacf975a99d264d3a0d commit 22ae840b9f0ff290cb08edacf975a99d264d3a0d Author: Jessica Clarke AuthorDate: 2025-07-10 22:58:07 +0000 Commit: Jessica Clarke CommitDate: 2025-07-10 22:58:07 +0000 sys: Various whitespace style(9) fixes for sys/elf_common.h MFC after: 1 week --- sys/sys/elf_common.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/sys/sys/elf_common.h b/sys/sys/elf_common.h index 22495728a764..efda38279848 100644 --- a/sys/sys/elf_common.h +++ b/sys/sys/elf_common.h @@ -470,12 +470,12 @@ typedef struct { #define SHT_HIOS 0x6fffffff /* Last of OS specific semantics */ #define SHT_LOPROC 0x70000000 /* reserved range for processor */ #define SHT_X86_64_UNWIND 0x70000001 /* unwind information */ -#define SHT_AMD64_UNWIND SHT_X86_64_UNWIND +#define SHT_AMD64_UNWIND SHT_X86_64_UNWIND #define SHT_ARM_EXIDX 0x70000001 /* Exception index table. */ -#define SHT_ARM_PREEMPTMAP 0x70000002 /* BPABI DLL dynamic linking +#define SHT_ARM_PREEMPTMAP 0x70000002 /* BPABI DLL dynamic linking pre-emption map. */ -#define SHT_ARM_ATTRIBUTES 0x70000003 /* Object file compatibility +#define SHT_ARM_ATTRIBUTES 0x70000003 /* Object file compatibility attributes. */ #define SHT_ARM_DEBUGOVERLAY 0x70000004 /* See DBGOVL for details. */ #define SHT_ARM_OVERLAYSECTION 0x70000005 /* See DBGOVL for details. */ @@ -791,7 +791,7 @@ typedef struct { #define DF_1_NODELETE 0x00000008 /* Set the RTLD_NODELETE for object */ #define DF_1_LOADFLTR 0x00000010 /* Immediate loading of filtees */ #define DF_1_INITFIRST 0x00000020 /* Initialize DSO first at runtime */ -#define DF_1_NOOPEN 0x00000040 /* Do not allow loading on dlopen() */ +#define DF_1_NOOPEN 0x00000040 /* Do not allow loading on dlopen() */ #define DF_1_ORIGIN 0x00000080 /* Process $ORIGIN */ #define DF_1_INTERPOSE 0x00000400 /* Interpose all objects but main */ #define DF_1_NODEFLIB 0x00000800 /* Do not search default paths */ @@ -908,7 +908,7 @@ typedef struct { #define STV_ELIMINATE 0x6 /* Architecture specific data - st_other */ -#define STO_AARCH64_VARIANT_PCS 0x80 +#define STO_AARCH64_VARIANT_PCS 0x80 /* Special symbol table indexes. */ #define STN_UNDEF 0 /* Undefined symbol index. */ @@ -1084,11 +1084,11 @@ typedef struct { #define R_AARCH64_COPY 1024 /* Copy data from shared object */ #define R_AARCH64_GLOB_DAT 1025 /* Set GOT entry to data address */ #define R_AARCH64_JUMP_SLOT 1026 /* Set GOT entry to code address */ -#define R_AARCH64_RELATIVE 1027 /* Add load address of shared object */ +#define R_AARCH64_RELATIVE 1027 /* Add load address of shared object */ #define R_AARCH64_TLS_DTPREL64 1028 #define R_AARCH64_TLS_DTPMOD64 1029 -#define R_AARCH64_TLS_TPREL64 1030 -#define R_AARCH64_TLSDESC 1031 /* Identify the TLS descriptor */ +#define R_AARCH64_TLS_TPREL64 1030 +#define R_AARCH64_TLSDESC 1031 /* Identify the TLS descriptor */ #define R_AARCH64_IRELATIVE 1032 #define R_ARM_NONE 0 /* No relocation. */ @@ -1231,8 +1231,8 @@ typedef struct { #define R_MIPS_GOT_HI16 22 /* GOT HI 16 bit */ #define R_MIPS_GOT_LO16 23 /* GOT LO 16 bit */ #define R_MIPS_SUB 24 -#define R_MIPS_CALLHI16 30 /* upper 16 bit GOT entry for function */ -#define R_MIPS_CALLLO16 31 /* lower 16 bit GOT entry for function */ +#define R_MIPS_CALLHI16 30 /* upper 16 bit GOT entry for function */ +#define R_MIPS_CALLLO16 31 /* lower 16 bit GOT entry for function */ #define R_MIPS_JALR 37 #define R_MIPS_TLS_GD 42 #define R_MIPS_COPY 126 From nobody Thu Jul 10 23:05:05 2025 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 4bdVmf0Pgpz61glQ; Thu, 10 Jul 2025 23:05:06 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdVmd5yJQz3DqW; Thu, 10 Jul 2025 23:05:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752188705; 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=ujA/P+npM3NZYojdDeJ9p10CaKSVn5BqI8gjsWFTOUA=; b=Pu9vVIPNdjdnel+A20TBKd7rMcPaxs2pB32WgBJ/Qkfx5wNrzO6la3hQrNZubIcqD+oVSG 9jXN0qqCQHepH3qkWw/iUK0OC4o7X8LVGU96fG5NEawouOZ6ePLSsmI4wWfumW4pRSWHwz I4DQhKK+p/6fZSsMhudZ9hnEG1abF5CQwEryHbJFDY7m+YZH+sfO9xEb2HBdStnjxfNnBx S5Pme598cZl8a1MRYqkvhAgqXGS7KN2VNMZGp30YN+nAHNWcc48FTUySxWbryfLRML2a/n FrMHblGUVZEORj8aTl7JUXBdgV6QZ2LPlIInXmE8MKaIoT/Mh/u0Gc4YQnVwfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752188705; 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=ujA/P+npM3NZYojdDeJ9p10CaKSVn5BqI8gjsWFTOUA=; b=vWcya/7zjsj86dWHYpffn5PZgHthSpjSV0es3kbOMK5xiK774ef7P4F3g7fn0zgFMXcFwt uYfcorAaTyqudEXOUPUrgy3weFXU7p8E8ta6UI41q6MHMjTk01kt5OY2u6CIhzDJsQh8RV 5AK7IB8bCXKdtxeE9zYal0Wdkk4C0oOUp38avEz1WywdHaAbhgz8X+pafO18ZmHHJe/eGv n1KD4QwqwLOyvL7qUggEz2DZ8oj93QWRG+Ry2HTTPRojIHViEIm2ivm1jf6Rfi1sDf2Af3 9+PQ/rts54WjEwaMPq9yRq9k2F/WlBEeNNGsD+StNQ9wBLkFmlgH68v8HMjsgA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752188705; a=rsa-sha256; cv=none; b=hVbpETgQHfLIJKU5aky/T1CxlXR7pFJUcGqvpvxRQ6aZxfTf8uMlfZgHupclWknbHlFiM/ MQIMdJyNKw4D3hLXd/5FA3iPB6RJSQA44EieoCco1yyUwL0xQT3kd5Dq1+T68oudB9j72L CamAugAcKCUFKk7B4ZSIAjkFmnFTAYjufoZOM29LrNU0aAHPb28rZpbHcAl+Sgun47CdTC hdij5RFT9pUCePUiPoBPt8ocH1kxNqw+X2/vNdEkLVha7q+CSUhkFYhne6zq5ySksp9++g SlsVEJDeDbWeAm4GzZzTa9Q2SAm992jQYH8L94PrF3YeB1G6jxCSlpj8smGEMw== 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 4bdVmd3xxKz1R3S; Thu, 10 Jul 2025 23:05:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56AN55Ja054473; Thu, 10 Jul 2025 23:05:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56AN55qn054470; Thu, 10 Jul 2025 23:05:05 GMT (envelope-from git) Date: Thu, 10 Jul 2025 23:05:05 GMT Message-Id: <202507102305.56AN55qn054470@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 74b5dc9f3fcd - main - cam/xpt: style(9) no longer recommends blank lines 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 74b5dc9f3fcd9eff142c0212dd738c676effdd4b Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=74b5dc9f3fcd9eff142c0212dd738c676effdd4b commit 74b5dc9f3fcd9eff142c0212dd738c676effdd4b Author: Warner Losh AuthorDate: 2025-07-10 23:03:41 +0000 Commit: Warner Losh CommitDate: 2025-07-10 23:03:41 +0000 cam/xpt: style(9) no longer recommends blank lines The new xpt_gdev_type() function shouldn't have had a blank line. It was copied from xpt_path_inq(). Remove it from both. Noticed by: jhb Sponsored by: Netflix --- sys/cam/cam_xpt.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/cam/cam_xpt.h b/sys/cam/cam_xpt.h index 3815f42cba40..efa6c823245a 100644 --- a/sys/cam/cam_xpt.h +++ b/sys/cam/cam_xpt.h @@ -151,7 +151,6 @@ void xpt_sim_poll(struct cam_sim *sim); static inline void xpt_path_inq(struct ccb_pathinq *cpi, struct cam_path *path) { - bzero(cpi, sizeof(*cpi)); xpt_setup_ccb(&cpi->ccb_h, path, CAM_PRIORITY_NONE); cpi->ccb_h.func_code = XPT_PATH_INQ; @@ -165,7 +164,6 @@ xpt_path_inq(struct ccb_pathinq *cpi, struct cam_path *path) static inline void xpt_gdev_type(struct ccb_getdev *cgd, struct cam_path *path) { - bzero(cgd, sizeof(*cgd)); xpt_setup_ccb(&cgd->ccb_h, path, CAM_PRIORITY_NONE); cgd->ccb_h.func_code = XPT_GDEV_TYPE; From nobody Fri Jul 11 00:25:35 2025 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 4bdXYW4HLhz61ly2 for ; Fri, 11 Jul 2025 00:25:35 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdXYW3MbHz40dx; Fri, 11 Jul 2025 00:25:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752193535; 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=4PpPdoeMbPF5gpn04oOVgfBYfDj3xRFOyK23oNSrvFI=; b=X6xGv1RibrcOs992UAm8/YevAsxlLDRirHTjRcBQIsbSCKizh4Y0uqVMGQI8ivLGZTidbx u32BL/j1KxwJckHqoqFVzjoOYWHu+QVocAdd+spvWlh64U8KXnExCvTR4aJG9J2qY1yOFd 1qrwy2OwIA6VpPbHgrTUCNxpGsfH7p3n10ZRlq7AKKOLsBwIuqCZbEBaZGqYnqfk223x+w wt+5wlinTPFtDfWz0zkSmbD240sXtU6LUsH9HHpgV5luZAoMztOBEXeTTN4eLf1quLhAOF 3VnZPEVGm4b0au6s9YpVMEN/Td/LSA86nkjkSSXYZiF4Np0RtVKO1drwvNg0dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752193535; 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=4PpPdoeMbPF5gpn04oOVgfBYfDj3xRFOyK23oNSrvFI=; b=hFVLqg1ey9IsJreJ+3Eo3rRQkvYoMSk7SzBW3ORJQ+BSzDIxDX2IFQAEerfmWLhFOCsn+D l7Gpzztja8aauG30diUtbnB9FYBNuY+txvgVPLk5TS2CUopxyRpVUXqWOK9WwrE7BaoeLU xHjPBt3udUAXgJAINn4w3J6dPqWAPGDfb6NBtzeTxwtkqu1q6FtYhLkokLbVzCWjcdOxG2 dOb9D89CdzZO1s9+kqsfuxnTzx0R3pxGTjJB/qKF9fKAmXsDUDzahTBowH0/oP8f1o6n11 ox0/BciqyCvnFP9RWhFW1KbqA1e/QIU2wGlbAKJYuzzLuuvnLmaa3rbO55BmPA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752193535; a=rsa-sha256; cv=none; b=c6s9LrVmlLmiF6B14pXk2rECbvyD457oTd9ukv7c/yZINRlPQhPZ1iH89XR+ikgaM/q759 Jtd4+wMxfNAv4BKkwbLGLHkFoG5ZdYOHGYx8WND7xnzEbq96gCocB0CDuyKvSetSHYPcKV A2QPrVk/cr2Pn2XW8Wd/uDcpv2EDy7e4xwPc6PWhUdOjZbA9kzKugtLtbWHIa5J3y/DV8L eRatf7pr1OX+O7qeWe2JDoDlyzPsb53WK6NfYhXP3DBQurKcV2WOO47K0HhtBVpk3VLbrf EYxwaXZ7KBndcN7rsXHLxpTdf0Vs5AGz19hl0Vyx9XvI9PCkgWc4cUdJG6ng3Q== 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 4bdXYW2c4yzQf; Fri, 11 Jul 2025 00:25:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56B0PZP2003005; Fri, 11 Jul 2025 00:25:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56B0PZH3003004; Fri, 11 Jul 2025 00:25:35 GMT (envelope-from git) Date: Fri, 11 Jul 2025 00:25:35 GMT Message-Id: <202507110025.56B0PZH3003004@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Enji Cooper Subject: git: 1c34280346af..ecf8229ffeb1 - vendor/openssl-3.0 - vendor branch updated 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ngie X-Git-Repository: src X-Git-Refname: refs/heads/vendor/openssl-3.0 X-Git-Reftype: branch X-Git-Commit: ecf8229ffeb17a05c78fab6b973b0cccb84e25c5 X-Git-Oldrev: 1c34280346af8284acdc0eae39496811d37df25d X-Git-Newrev: ecf8229ffeb17a05c78fab6b973b0cccb84e25c5 Auto-Submitted: auto-generated The branch vendor/openssl-3.0 has been updated by ngie: URL: https://cgit.FreeBSD.org/src/log/?id=1c34280346af..ecf8229ffeb1 ecf8229ffeb1 vendor/openssl: import OpenSSL 3.0.17 From nobody Fri Jul 11 01:07:15 2025 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 4bdYTb2M3Wz61nbL; Fri, 11 Jul 2025 01:07:15 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdYTb1Mszz3R9T; Fri, 11 Jul 2025 01:07:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752196035; 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=jFhoFRnS+1PqiDzSJ7hqzqFi+ioPolDlndraPHkrNWk=; b=V8kAb/vIJQZ5PvJoMl8ub/z/pV9xmfjMF0uKQ6l4C+mu9D1KST/UZij6os33OlmuHf7d9C NTcMB92sTTQeAhfuDyFfjFGbBIs3CJ/DKTqI90gxdngRQlR3FxDD0g51Tz20RYQ0A6XGNi 3AxEQ1/Qc4PvaxifnkZPpZkZiSTPBPLtRJRBgacTfIMZFLjJb1lPRirQ0/P5QM2YqmXtuU N6Y9+k1VCgxtRXmPuCeu6AZPYeq/vhuk0A1QH2C7hvnMgA3ZFsCUfQTVpbW1uupFx/5DE9 9Fkb22OFhE/O4uNrBlHzrTV24K3WvpjLwY1jgJ5Pu02fifmZBDJTiTRyTYX+pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752196035; 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=jFhoFRnS+1PqiDzSJ7hqzqFi+ioPolDlndraPHkrNWk=; b=URs6fAuZgg1J49gA2NlfqgkfhmVt8ouCEU5xUnsJyoSGqSlo5wnEvVVqB+8cDlFKYQdFry A7f+zLHb0RjgDtDGfPjvV4qRAftMKa2r149rvz4CgsDT8jTqm9+h4udsl9orb2VjS/CH+P 8tYp1z1jCOvBFM5ur5Wpkm/7ag0dC8x4k5rLNUifalisUFuW8WMctjdlMLxYhJS7JwsgDQ Fdfwy7rtwJysml0/I2J0gc9UuAFZGUVgT2hVUF9fxi2DyIlALJnSuSVzxOvIyNM2oaNubR kThwIZDSw13HZqLS7n42eJ0JR0cASEwghA4g4/4Ot2HfBizwVmEEFkn3MGn4EA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752196035; a=rsa-sha256; cv=none; b=Ifm1GTOkpr4mBmUwYicYVqjjIL8YR36N8SLFdG/WwDdd4O6WMCSk4D3HF8xdDbulYDCGvb V4p2tJHp4xGHPrF42sSOIY0/fIcoB2oOjZlIZ+Ii8ucZmqYvb5P45njgAm1zXYJlvDP1kd boxIEIupjBR/s5pnc2yxZqkWjGmCQzOH720rfZcqzQQePLEBErShfl68nBfGbJ2Vfbs0WX 0IVpFBj2SL3e1CxdKMKferjNEGvDGMQP78F5KVLHiAglEzmeD37MPwx7ErTcCnCjWocwy+ /pDiA0Ci83jRuEzgm6RDBOpR+ehHmzzd+yJmSafIt1aTGKFf79oqCdl8FdfPHA== 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 4bdYTb0rmNzx4; Fri, 11 Jul 2025 01:07:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56B17FKo078590; Fri, 11 Jul 2025 01:07:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56B17FwG078587; Fri, 11 Jul 2025 01:07:15 GMT (envelope-from git) Date: Fri, 11 Jul 2025 01:07:15 GMT Message-Id: <202507110107.56B17FwG078587@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: 02d06043ba88 - main - rtld-elf: Delete unused RELOC_ALIGNED_P copies 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 02d06043ba88f931f9debd5aa519fc303ca70d11 Auto-Submitted: auto-generated The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=02d06043ba88f931f9debd5aa519fc303ca70d11 commit 02d06043ba88f931f9debd5aa519fc303ca70d11 Author: Jessica Clarke AuthorDate: 2025-07-11 01:07:04 +0000 Commit: Jessica Clarke CommitDate: 2025-07-11 01:07:04 +0000 rtld-elf: Delete unused RELOC_ALIGNED_P copies This was copied from arm to aarch64 to riscv, but only arm uses it. MFC after: 1 week --- libexec/rtld-elf/aarch64/reloc.c | 7 ------- libexec/rtld-elf/riscv/reloc.c | 7 ------- 2 files changed, 14 deletions(-) diff --git a/libexec/rtld-elf/aarch64/reloc.c b/libexec/rtld-elf/aarch64/reloc.c index 2b64b48585db..62d664f8fb80 100644 --- a/libexec/rtld-elf/aarch64/reloc.c +++ b/libexec/rtld-elf/aarch64/reloc.c @@ -36,13 +36,6 @@ #include "rtld.h" #include "rtld_printf.h" -/* - * It is possible for the compiler to emit relocations for unaligned data. - * We handle this situation with these inlines. - */ -#define RELOC_ALIGNED_P(x) \ - (((uintptr_t)(x) & (sizeof(void *) - 1)) == 0) - /* * This is not the correct prototype, but we only need it for * a function pointer to a simple asm function. diff --git a/libexec/rtld-elf/riscv/reloc.c b/libexec/rtld-elf/riscv/reloc.c index 390e8c458c28..25c0befb774e 100644 --- a/libexec/rtld-elf/riscv/reloc.c +++ b/libexec/rtld-elf/riscv/reloc.c @@ -40,13 +40,6 @@ #include "rtld.h" #include "rtld_printf.h" -/* - * It is possible for the compiler to emit relocations for unaligned data. - * We handle this situation with these inlines. - */ -#define RELOC_ALIGNED_P(x) \ - (((uintptr_t)(x) & (sizeof(void *) - 1)) == 0) - uint64_t set_gp(Obj_Entry *obj) { From nobody Fri Jul 11 03:05:49 2025 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 4bdc6P6xXlz61vTg; Fri, 11 Jul 2025 03:05:49 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdc6P4DkJz3d35; Fri, 11 Jul 2025 03:05:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752203149; 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=jfMT3UoE8/l1mMoZjVpx5vtn/tOoj2JM+UbH6Xtk6TI=; b=l0nl5r2m9Lr2ZJjNIvi1wbj6FZQBuhGCCzgMbKZpdrOo+2s/wO8FPV3zkoLdveIqJa0llW 8SjQUBb7RVXi003XDnKZXAMw+e3H6GZheeNQ6M6aVuA++HF7n9LUpWKcrQqdjhxq7zp0RI CWT+nu2Epf/jv4g48tpMFHXvt3Hh/gUKrWURdudiroT3kEg3veF8zmqAZq8ykHw8peZuBB RCtAFNkG/SGKlA63ViPUA+qDIsknQ7xZTsSWZAOTDBuBZJljnXce/W1Rm4pb1uusd5TfvU 5lYmXd5KF3PR7ZQZ9ftomrMXTrAHYJ9lhl4De3RPV2cvEaGdk+XJEKok0UhYbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752203149; 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=jfMT3UoE8/l1mMoZjVpx5vtn/tOoj2JM+UbH6Xtk6TI=; b=yxqqH13HXEmg9Tzxi5L67d+c1cFyS3UlqYOj0TszN6DY71N5FqHlfxU2UvsE7i/skJC6pL 2GpXP5a88KBLlYKKd3kwW1QgdJUY7VbbBa642vR2NN1bnkk0E6Dj6AC3dWVoXozPaa25vY vmEHRvNbHkYWLPieRMt3APORRZ8wIgVFDZFkl2dIozx6rneGpxgg+Pqe8XbNxSRlv+n/qd U6JNll9HmH0tPOuEIsC5vNDpyQYdinvPAN4/K2xeBoh5o+XGix/o1KZs6nQQ5tGO+o3fNZ Snszf1QfV74jIMFQJP0YMLPVycRJMFRMFn2yllERH6VJcfEzC9aEBF75RHg9jQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752203149; a=rsa-sha256; cv=none; b=XkzRvR5DXnA/pQm4dwjLYvRdoHXgMXrwSi7ZPe1A3luAG0sajMp4wt3y6PyLr7R8eZXG/D K1Z+IOzOZfv1QY0gbzHqdvFwPbafhLiqvnELKzuUI1b0V3CqekKmasGgKW3JSZeP9D49ve t9b/79+KMRw2YF0x9N4WZUnpaKBnbOIqslrIro+0GJqHiB9Fkntf2mYXGul01renRShMQo HN86TapoXwaRof+Y4Ey7oOb/cwacpuL3bVGiagjewmEoTUIKyVRDyJFylV6h2sl6+mTPXU CvkBRiqxR/0w3TUaF4tqQlu3xNKm6Xsqd4leOmI+Ccg6QUTwYgM57k36mH5rEA== 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 4bdc6P3cwnz4QY; Fri, 11 Jul 2025 03:05:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56B35nvT003868; Fri, 11 Jul 2025 03:05:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56B35ns4003865; Fri, 11 Jul 2025 03:05:49 GMT (envelope-from git) Date: Fri, 11 Jul 2025 03:05:49 GMT Message-Id: <202507110305.56B35ns4003865@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: f1eceb963caf - main - libsa/zfs: add error printf() in zfs_spa_init() 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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: f1eceb963cafb2095ce02eea77298370fa2f6fd3 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=f1eceb963cafb2095ce02eea77298370fa2f6fd3 commit f1eceb963cafb2095ce02eea77298370fa2f6fd3 Author: Gleb Smirnoff AuthorDate: 2025-07-11 03:04:50 +0000 Commit: Gleb Smirnoff CommitDate: 2025-07-11 03:04:50 +0000 libsa/zfs: add error printf() in zfs_spa_init() All other error exits from this function print something. --- stand/libsa/zfs/zfsimpl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/stand/libsa/zfs/zfsimpl.c b/stand/libsa/zfs/zfsimpl.c index 41ef5a46f30e..a3ce003782f8 100644 --- a/stand/libsa/zfs/zfsimpl.c +++ b/stand/libsa/zfs/zfsimpl.c @@ -3541,8 +3541,10 @@ zfs_spa_init(spa_t *spa) return (EIO); } rc = load_nvlist(spa, config_object, &nvlist); - if (rc != 0) + if (rc != 0) { + printf("ZFS: failed to load pool %s nvlist\n", spa->spa_name); return (rc); + } rc = zap_lookup(spa, &dir, DMU_POOL_ZPOOL_CHECKPOINT, sizeof(uint64_t), sizeof(checkpoint) / sizeof(uint64_t), From nobody Fri Jul 11 03:12:43 2025 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 4bdcGN2MLyz61vYF; Fri, 11 Jul 2025 03:12:44 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdcGN0rTsz3jXs; Fri, 11 Jul 2025 03:12:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752203564; 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=un0KhpsgbvLRTVq0YIb0iLR6ddLV1keXatgxA8jxtns=; b=dzQ7grwtf9YanEVzjxTjPZ/v90Z98cX0A3eSR5PW72E/nVn9V0WO8S5J4LkWm0AoDcwxhT muBq+MeGWeSNdgwv2RR1xTtVeHHqNpAPaOuAIs0XJnUzzdiFSxqZrugyMky6QyIKvLqaKV RrfjZ5lHtFowYjhpkguO1HzP0R2/LpLb+UIdCStU7uUkgGGST91+wGPNN20Eg9zQiqfuXJ cKyPHmxcWnIM18qTy6O0vAR29fXZE227ZyoMfNYd/tNt6zpKjBb+vztWoEHYyD9iSsFt38 ZcLaFTwCDBt9Ghj7SFyUR1GNIW8t3wtVs0Y4JQv/OIkyuo+IU1DmSvG8uNUhWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752203564; 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=un0KhpsgbvLRTVq0YIb0iLR6ddLV1keXatgxA8jxtns=; b=EAbhYtAqSlKevXWs9mCDFpnQMJNVwsIoNLBWgJb8Qw45jpGj1dTPpaCPyXFWTXj0nCMWeO BOFagfIRx7JgkMYGQgqFTw3en1zvn5m0zmKmxL1TXeNjew4SKdk24gGqYEX/GDlhwCDqXG nOMwBZBKUX8JuHbEaP0i4luXJoZz6tT0gk3hSXgwiyqrHbgVFB2u9UNF6+3pFu7Jp5gXUe ecKUUgaxaohKa0gy6ogsZdkD5etRIyUIkpZQDbKWzAHIrGHfO1tWiaSn7E+q0ffjcweDlb xGEvzHlSh+m34eWL7odQmovh0E7jLwifJxNAqYwIhz73PuVAgFWYskh9/UvTTA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752203564; a=rsa-sha256; cv=none; b=WDrXib9kiX3BuuWeE6k7tO4EGXWDk77fyWBwmGU8SR1phwWNDp28gUy3VZcWWDuq8EVg5j 6vTRf+VLU3E3VI/rkC9LQY+/ZCslmhKwVdlVzAZwDu6JPx08D+gasNS6iYair13HTXHs4c TfKAQOXd1R04CwommFZjZ0BFHwoPta2akHguKrBM6XsiHCNelpSP24afGC7cNq3u82tC84 comfEBIzBY8K2NN91OK9by3o/7akk966w9L3vSAYthYm52vr3bUWcvZ2wvjxwkuT2fmG/F DcF++rn1etj4xRI7slQCdHFHNWIZJTMjpx+YfebUdJGkh1GiHx7iHEZDI4S75w== 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 4bdcGN0Qygz4lX; Fri, 11 Jul 2025 03:12:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56B3ChLl022013; Fri, 11 Jul 2025 03:12:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56B3Ch2e022010; Fri, 11 Jul 2025 03:12:43 GMT (envelope-from git) Date: Fri, 11 Jul 2025 03:12:43 GMT Message-Id: <202507110312.56B3Ch2e022010@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Lexi Winter Subject: git: 1821af77efef - stable/14 - clang: install clang-scan-deps 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ivy X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1821af77efefd25ecdade590074f21fa976d086f Auto-Submitted: auto-generated The branch stable/14 has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=1821af77efefd25ecdade590074f21fa976d086f commit 1821af77efefd25ecdade590074f21fa976d086f Author: Lexi Winter AuthorDate: 2025-07-06 20:42:58 +0000 Commit: Lexi Winter CommitDate: 2025-07-11 03:11:48 +0000 clang: install clang-scan-deps clang-scan-deps is used to generate dependency information from C++20 modules according to proposed standard ISO/IEC WG21 P1689R5[0]. It is required by common build tools (e.g., CMake) to build C++ sources that use modules. Since this is a core build tool, install it by default, not gated behind MK_CLANG_EXTRAS. [0] https://www.open-std.org/JTC1/SC22/WG21/docs/papers/2022/p1689r5.html MFC after: 3 days Reviewed by: kevans, dim Approved by: kevans (mentor) Requested by: jbo Differential Revision: https://reviews.freebsd.org/D51044 (cherry picked from commit d3c06bed2c16b434dd49958dee5de8c55ad00b85) --- lib/clang/libclang/Makefile | 6 +++++ usr.bin/clang/Makefile | 4 ++++ usr.bin/clang/clang-scan-deps/Makefile | 26 ++++++++++++++++++++++ .../clang-scan-deps/clang-scan-deps-driver.cpp | 18 +++++++++++++++ 4 files changed, 54 insertions(+) diff --git a/lib/clang/libclang/Makefile b/lib/clang/libclang/Makefile index 5e20b37c1183..9b9e0cbadcd7 100644 --- a/lib/clang/libclang/Makefile +++ b/lib/clang/libclang/Makefile @@ -842,6 +842,11 @@ SRCS_MIN+= Tooling/ArgumentsAdjusters.cpp SRCS_MIN+= Tooling/CommonOptionsParser.cpp SRCS_MIN+= Tooling/CompilationDatabase.cpp SRCS_MIN+= Tooling/Core/Replacement.cpp +SRCS_MIN+= Tooling/DependencyScanning/DependencyScanningFilesystem.cpp +SRCS_MIN+= Tooling/DependencyScanning/DependencyScanningService.cpp +SRCS_MIN+= Tooling/DependencyScanning/DependencyScanningTool.cpp +SRCS_MIN+= Tooling/DependencyScanning/DependencyScanningWorker.cpp +SRCS_MIN+= Tooling/DependencyScanning/ModuleDepCollector.cpp SRCS_MIN+= Tooling/ExpandResponseFilesCompilationDatabase.cpp SRCS_MIN+= Tooling/FileMatchTrie.cpp SRCS_MIN+= Tooling/GuessTargetAndModeCompilationDatabase.cpp @@ -849,6 +854,7 @@ SRCS_MIN+= Tooling/Inclusions/HeaderIncludes.cpp SRCS_MIN+= Tooling/Inclusions/IncludeStyle.cpp SRCS_MIN+= Tooling/InterpolatingCompilationDatabase.cpp SRCS_MIN+= Tooling/JSONCompilationDatabase.cpp +SRCS_MIN+= Tooling/LocateToolCompilationDatabase.cpp SRCS_MIN+= Tooling/Refactoring.cpp SRCS_MIN+= Tooling/RefactoringCallbacks.cpp SRCS_MIN+= Tooling/Tooling.cpp diff --git a/usr.bin/clang/Makefile b/usr.bin/clang/Makefile index 30ec1ab65e0f..d883048b7ed9 100644 --- a/usr.bin/clang/Makefile +++ b/usr.bin/clang/Makefile @@ -6,6 +6,10 @@ SUBDIR+= clang .endif .if !defined(TOOLS_PREFIX) +.if ${MK_CLANG} != "no" +SUBDIR+= clang-scan-deps +.endif + # LLVM binutils are needed to support features such as LTO, so we build them # by default if clang is enabled. If MK_LLVM_BINUTILS is set, we also use them # as the default binutils (ar,nm,addr2line, etc.). diff --git a/usr.bin/clang/clang-scan-deps/Makefile b/usr.bin/clang/clang-scan-deps/Makefile new file mode 100644 index 000000000000..16fecdb88867 --- /dev/null +++ b/usr.bin/clang/clang-scan-deps/Makefile @@ -0,0 +1,26 @@ +.include + +PROG_CXX= clang-scan-deps +MAN= + +SRCDIR= clang/tools/clang-scan-deps +SRCS+= ClangScanDeps.cpp \ + clang-scan-deps-driver.cpp + +.include "${SRCTOP}/lib/clang/clang.pre.mk" + +CFLAGS+= -I${.OBJDIR} +TDFILE= Opts.td +INCFILE= ${TDFILE:.td=.inc} +GENOPT= -gen-opt-parser-defs + +${INCFILE}: ${TDFILE} + ${LLVM_TBLGEN} ${GENOPT} -I ${LLVM_SRCS}/include -d ${.TARGET:C/$/.d/} \ + -o ${.TARGET} ${.ALLSRC} +TGHDRS+= ${INCFILE} + +DEPENDFILES+= ${TGHDRS:C/$/.d/} +DPSRCS+= ${TGHDRS} +CLEANFILES+= ${TGHDRS} ${TGHDRS:C/$/.d/} + +.include "../clang.prog.mk" diff --git a/usr.bin/clang/clang-scan-deps/clang-scan-deps-driver.cpp b/usr.bin/clang/clang-scan-deps/clang-scan-deps-driver.cpp new file mode 100644 index 000000000000..f941cc434ff6 --- /dev/null +++ b/usr.bin/clang/clang-scan-deps/clang-scan-deps-driver.cpp @@ -0,0 +1,18 @@ +//===-- driver-template.cpp -----------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#include "llvm/Support/LLVMDriver.h" +#include "llvm/ADT/ArrayRef.h" +#include "llvm/Support/InitLLVM.h" + +int clang_scan_deps_main(int argc, char **, const llvm::ToolContext &); + +int main(int argc, char **argv) { + llvm::InitLLVM X(argc, argv); + return clang_scan_deps_main(argc, argv, {argv[0], nullptr, false}); +} From nobody Fri Jul 11 03:13:15 2025 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 4bdcGz5nshz61vPn; Fri, 11 Jul 2025 03:13:15 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdcGz4Hd8z3jrf; Fri, 11 Jul 2025 03:13:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752203595; 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=IYIB1jkmXZvzUOz1SIjlM5Or0z/BO+gPYXim6vvkzOI=; b=j6XPbSmor+zH1UhR6022u9JDSmcxZiISJo/9M0SVvBzegG30Dy/gHKkoyb3yr/zPidu0Zm ZsA1tS/ZT2i8qdvEmk9oGeY/5s2aUponcBxP3o+nWuTBG7EDW9BMSnFGosSY9RbytmrBix 4OHAI291Hauw8lhLQvg4AKs74Z0axawkNfJxEnfZGsCUJRaSIsErC8OB3c0/vqqiRjAmUI YWWVwWBkslWLjfoMUtk/vZ9Kxs6GE9gLBJdJh6B/hTnn7PYd0WJKIClC/QMFepWXxuFsdD nagSb0VsQBLBNa9Pl9xi2JPqlXNFVeVaWE0XuwLZhbEQQ1dDsx7dJNULLiHD0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752203595; 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=IYIB1jkmXZvzUOz1SIjlM5Or0z/BO+gPYXim6vvkzOI=; b=Xd5CZTrCWBCOTCSfy3nMI7Grs7wKr3DYrQcoYHd3mekkJ21NY32dcgjvazLcDYX+1MWxCs MleF4YduznyxIRPtckKKcbdLBQDQI4WznsIcTZrsbV+Y9E4zSjd1WhKNO2mCUpEeLhNSyN WZHkXEc4SLhVWyenA05PHE+rgqttOcr1ACcJZeob8IyLz6AJSKerjfaGTSOJWj8gRAVMSO T6cnLKDq3gD+rPEApWAcr2hFA54CHUBTRrQPwd6a5OIwS32onmmTvnwd+HqmCpHNuoX2Tt hAOag6JRkWCQ73D/u2kIgDn57zL1HpiPGa9V96mj6BtXPROFGVcSwubVY7L7Dg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752203595; a=rsa-sha256; cv=none; b=pCB5NAzaJ9Qm7EtAUgtmjdDrghuc8tds/7Ft3qWeXScxJviHQSZKT/gUeAy2zcHozVihtO qfQGVZdV+J633jMEgDF4QNVnLS06DI27J+sOPwLSx9EB3SkdkY1ixkdnGsHCejOaMsgCHx qas39meITbOHO5AAEop2u7yYw9wZHwgodl3ZmX/ytbYBLpyQqEauX2PXN6av0xy9mJEdF3 +uS0gDIVHanxa9csRs/S3DGjPZjSdpbXZnIanChrYTaOSv+3c2zVaX4QP4khxVqq1n2cZ9 xav+dyvtAL9M06niccRsWvypiwuZ6tMDubP9D/UkDSreq0DyS4uf7ZTl8Sd7uA== 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 4bdcGz3gzCz4R6; Fri, 11 Jul 2025 03:13:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56B3DFBH022267; Fri, 11 Jul 2025 03:13:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56B3DF1p022264; Fri, 11 Jul 2025 03:13:15 GMT (envelope-from git) Date: Fri, 11 Jul 2025 03:13:15 GMT Message-Id: <202507110313.56B3DF1p022264@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Lexi Winter Subject: git: 778f5aaa890f - stable/13 - clang: install clang-scan-deps 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ivy X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 778f5aaa890fdc16b8d6d708af1b94d9af467f76 Auto-Submitted: auto-generated The branch stable/13 has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=778f5aaa890fdc16b8d6d708af1b94d9af467f76 commit 778f5aaa890fdc16b8d6d708af1b94d9af467f76 Author: Lexi Winter AuthorDate: 2025-07-06 20:42:58 +0000 Commit: Lexi Winter CommitDate: 2025-07-09 16:55:51 +0000 clang: install clang-scan-deps clang-scan-deps is used to generate dependency information from C++20 modules according to proposed standard ISO/IEC WG21 P1689R5[0]. It is required by common build tools (e.g., CMake) to build C++ sources that use modules. Since this is a core build tool, install it by default, not gated behind MK_CLANG_EXTRAS. [0] https://www.open-std.org/JTC1/SC22/WG21/docs/papers/2022/p1689r5.html MFC after: 3 days Reviewed by: kevans, dim Approved by: kevans (mentor) Requested by: jbo Differential Revision: https://reviews.freebsd.org/D51044 (cherry picked from commit d3c06bed2c16b434dd49958dee5de8c55ad00b85) --- lib/clang/libclang/Makefile | 6 +++++ usr.bin/clang/Makefile | 4 ++++ usr.bin/clang/clang-scan-deps/Makefile | 26 ++++++++++++++++++++++ .../clang-scan-deps/clang-scan-deps-driver.cpp | 18 +++++++++++++++ 4 files changed, 54 insertions(+) diff --git a/lib/clang/libclang/Makefile b/lib/clang/libclang/Makefile index 5e20b37c1183..9b9e0cbadcd7 100644 --- a/lib/clang/libclang/Makefile +++ b/lib/clang/libclang/Makefile @@ -842,6 +842,11 @@ SRCS_MIN+= Tooling/ArgumentsAdjusters.cpp SRCS_MIN+= Tooling/CommonOptionsParser.cpp SRCS_MIN+= Tooling/CompilationDatabase.cpp SRCS_MIN+= Tooling/Core/Replacement.cpp +SRCS_MIN+= Tooling/DependencyScanning/DependencyScanningFilesystem.cpp +SRCS_MIN+= Tooling/DependencyScanning/DependencyScanningService.cpp +SRCS_MIN+= Tooling/DependencyScanning/DependencyScanningTool.cpp +SRCS_MIN+= Tooling/DependencyScanning/DependencyScanningWorker.cpp +SRCS_MIN+= Tooling/DependencyScanning/ModuleDepCollector.cpp SRCS_MIN+= Tooling/ExpandResponseFilesCompilationDatabase.cpp SRCS_MIN+= Tooling/FileMatchTrie.cpp SRCS_MIN+= Tooling/GuessTargetAndModeCompilationDatabase.cpp @@ -849,6 +854,7 @@ SRCS_MIN+= Tooling/Inclusions/HeaderIncludes.cpp SRCS_MIN+= Tooling/Inclusions/IncludeStyle.cpp SRCS_MIN+= Tooling/InterpolatingCompilationDatabase.cpp SRCS_MIN+= Tooling/JSONCompilationDatabase.cpp +SRCS_MIN+= Tooling/LocateToolCompilationDatabase.cpp SRCS_MIN+= Tooling/Refactoring.cpp SRCS_MIN+= Tooling/RefactoringCallbacks.cpp SRCS_MIN+= Tooling/Tooling.cpp diff --git a/usr.bin/clang/Makefile b/usr.bin/clang/Makefile index 30ec1ab65e0f..d883048b7ed9 100644 --- a/usr.bin/clang/Makefile +++ b/usr.bin/clang/Makefile @@ -6,6 +6,10 @@ SUBDIR+= clang .endif .if !defined(TOOLS_PREFIX) +.if ${MK_CLANG} != "no" +SUBDIR+= clang-scan-deps +.endif + # LLVM binutils are needed to support features such as LTO, so we build them # by default if clang is enabled. If MK_LLVM_BINUTILS is set, we also use them # as the default binutils (ar,nm,addr2line, etc.). diff --git a/usr.bin/clang/clang-scan-deps/Makefile b/usr.bin/clang/clang-scan-deps/Makefile new file mode 100644 index 000000000000..16fecdb88867 --- /dev/null +++ b/usr.bin/clang/clang-scan-deps/Makefile @@ -0,0 +1,26 @@ +.include + +PROG_CXX= clang-scan-deps +MAN= + +SRCDIR= clang/tools/clang-scan-deps +SRCS+= ClangScanDeps.cpp \ + clang-scan-deps-driver.cpp + +.include "${SRCTOP}/lib/clang/clang.pre.mk" + +CFLAGS+= -I${.OBJDIR} +TDFILE= Opts.td +INCFILE= ${TDFILE:.td=.inc} +GENOPT= -gen-opt-parser-defs + +${INCFILE}: ${TDFILE} + ${LLVM_TBLGEN} ${GENOPT} -I ${LLVM_SRCS}/include -d ${.TARGET:C/$/.d/} \ + -o ${.TARGET} ${.ALLSRC} +TGHDRS+= ${INCFILE} + +DEPENDFILES+= ${TGHDRS:C/$/.d/} +DPSRCS+= ${TGHDRS} +CLEANFILES+= ${TGHDRS} ${TGHDRS:C/$/.d/} + +.include "../clang.prog.mk" diff --git a/usr.bin/clang/clang-scan-deps/clang-scan-deps-driver.cpp b/usr.bin/clang/clang-scan-deps/clang-scan-deps-driver.cpp new file mode 100644 index 000000000000..f941cc434ff6 --- /dev/null +++ b/usr.bin/clang/clang-scan-deps/clang-scan-deps-driver.cpp @@ -0,0 +1,18 @@ +//===-- driver-template.cpp -----------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#include "llvm/Support/LLVMDriver.h" +#include "llvm/ADT/ArrayRef.h" +#include "llvm/Support/InitLLVM.h" + +int clang_scan_deps_main(int argc, char **, const llvm::ToolContext &); + +int main(int argc, char **argv) { + llvm::InitLLVM X(argc, argv); + return clang_scan_deps_main(argc, argv, {argv[0], nullptr, false}); +} From nobody Fri Jul 11 03:20:35 2025 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 4bdcRS0lN0z61vwZ; Fri, 11 Jul 2025 03:20:36 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdcRR6HJKz3nmb; Fri, 11 Jul 2025 03:20:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752204035; 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=WJwz2v51IIdW5ertgS5lwuaCiZvBpFxpzA9liMh68Zg=; b=c1IeVxpSDfyyXjV9qLbetXfkDjXIENWyUUisYit/Dpusf2K603H9MZYOU99bMvRcLTiitQ qgdFKcmL+DWYyj6lqlVI5acsLfvt0C8eWLGDwYUqLaCzOAUj+fS8lib7En4TsX+vQedYnx WtwPqdhtYP+sq5W4oMMGqoYaLWPyKstOz9Cu5QzDzGa4tzDrkNErhD6617mDhmGBWOBg2r sOZciWT3CLMUstmYpcgJw2MqjtLEi1uoRAMYAdLNAwlB+UfchEjyxfJGg+4iHFI28RLru2 5ctGiVs+7sm7+b7VXx0eGXcmW5g2VMAS787oGBSysqLVi5m/5uui6dJbi/Qeug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752204035; 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=WJwz2v51IIdW5ertgS5lwuaCiZvBpFxpzA9liMh68Zg=; b=uJD/NdaO81PNleBOTR4X3VIVDrL6BsJmv1X1FQHbxw9dkxqiGQNDCckZhOgyE/H4F17/4j V5kQGc74sVY8KDIhirfOIGnSBJKPJIGgKSAG7dHF+GxRISXzDVRrkyRvUXCMzzU7yxs+Vh HvKejkh/GgbQplPU3dBosC7h5USaglNTkb0Y/IGYpE1yq2TNZAO2UwPR1g2GekWBuVvar5 JHaOcSQsb1XTLtloP/qUUmlGWTlmOfTyU6kgrGVN6QCCL/62h8QRuxAiy6rNcLKl+xbAvr E/4RIpHxETVdzbogne0MfBgtYwt8zukBBPVQGf67KPWjWv3YYK/O1N5MqjAfQQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752204035; a=rsa-sha256; cv=none; b=GudXhpaPn5qjT0THpKk48N3ejpSCG5gIzpqLqCdEuCMUu2Ge7fUPeUyxVrgupekeF97ELe 4G9Pz0S3uOxrNWaqr/mpbJ45nPvXZaMaybrEPiIcb3n2c7s2ou5dUUvkfU60moHU1MjfGR 49oVsYj1YP3H2xmo4Ismla8ltXJ3D2jDDmtuEGZf2UbtyWaXZxGk26zMFAwQAFfhCXROIf 3Q5YRcqLBKov9NCpaWsPvhHz5JKs5x5MSMIXcAfnZ4wi2NsLUJRNcJjJG565PuXpVnhhxu 7SY6jbLJx5TNXd9gkVIXzE3dcbmQ091+xrdHk+FrDZcRz5W1WPzs/U+9E65//w== 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 4bdcRR5sCpz4lj; Fri, 11 Jul 2025 03:20:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56B3KZgE033214; Fri, 11 Jul 2025 03:20:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56B3KZLq033211; Fri, 11 Jul 2025 03:20:35 GMT (envelope-from git) Date: Fri, 11 Jul 2025 03:20:35 GMT Message-Id: <202507110320.56B3KZLq033211@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: 03f3dc3189e5 - main - libsa/zfs: don't hardcode root vdev name, use the real pool name 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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: 03f3dc3189e5abe4d4a56269c107119cc4a07388 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=03f3dc3189e5abe4d4a56269c107119cc4a07388 commit 03f3dc3189e5abe4d4a56269c107119cc4a07388 Author: Gleb Smirnoff AuthorDate: 2025-07-11 03:07:39 +0000 Commit: Gleb Smirnoff CommitDate: 2025-07-11 03:07:39 +0000 libsa/zfs: don't hardcode root vdev name, use the real pool name --- stand/libsa/zfs/zfsimpl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stand/libsa/zfs/zfsimpl.c b/stand/libsa/zfs/zfsimpl.c index a3ce003782f8..058907b1d822 100644 --- a/stand/libsa/zfs/zfsimpl.c +++ b/stand/libsa/zfs/zfsimpl.c @@ -1379,7 +1379,7 @@ spa_create(uint64_t guid, const char *name) free(spa); return (NULL); } - spa->spa_root_vdev->v_name = strdup("root"); + spa->spa_root_vdev->v_name = spa->spa_name; STAILQ_INSERT_TAIL(&zfs_pools, spa, spa_link); return (spa); From nobody Fri Jul 11 03:20:36 2025 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 4bdcRT3Zn8z61w2J; Fri, 11 Jul 2025 03:20:37 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdcRT08wfz3ndL; Fri, 11 Jul 2025 03:20:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752204037; 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=l1BssYPPDdsIBYFMsBfiicmPgjWdWKw4cRr1rVwv32U=; b=YMZG+ItSU6B3o5Wre1DnoCutDsw3OnT8c25hGy+h9cZauugEPisdJaU93PKDi47xqgHJeG ugZiATFH5gW2RG090NqeB24OzUm2RdtisovvQTgDp1lc4zIwHcGQ8vNQQzhjKOzEun52Pn sgaBdcSv49n98w/wUBMcxKa6J3W78YooMiaFKiUp7/DMzFnxDjZpeyfG3wm0AeLQls3bNr 1lgKP8O6FVeojBgEhr47C122sEpe45GkgeMzFONefqKIz2FqpPns5vroqkgLYlIPbwnNBk LlFTIgAIf+nvKnoUZH49WeVyOY5ILNZAUqA9kx1L1Qy+ZjyVqfksOAXJH46yqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752204037; 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=l1BssYPPDdsIBYFMsBfiicmPgjWdWKw4cRr1rVwv32U=; b=VMGmeFXvEVnGreDbJAWhXHBJENlImtBwmxPHs60S71Kj46NxU13xMbxMYqbvIS4745VcOL ggClCU8TQJAO2vEbebrz72u7wqvsrs+XV1krf2HqjVS5N2o0ALuVrfa2yLushp4JL+qBpj ESxXmUf5FGpQMRILRh1b7dVAj7gCtPppit/XaH+maMHbqAidYwhuX06SGC8B7RXrxSEV05 7Us8CYwIgPQdJigAA6YumE+1JKbLdyGqYXWDKvyUjmupsCLq0b65ZXdTQ3OS0lEvPapx1T LKh+mwgkRhuz1zyFGmsAcl5+aRnGQCthU3pVuYWlAYegk+0ZTYXft3JZiZI86A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752204037; a=rsa-sha256; cv=none; b=IQGkHRj7TNYYXTxl6g3yvI+rhDGnvMTucS83yaiozFeM1+zJNbok9YV9LA2WJ/wzmSINay YcL3xp+uaCkflgrQToOPT5FSGNxHNGrGJVd4X4xd1UBUEuTNLpgmobtlvSpuIFTYE2xXXu VWJNDXnVtumJKkSn9N1WuhBg+/BEqIczUXIi6zO+FaRO8tHp2GSK6XT/nQFVeInC92HS9S mSxmiSw2rwyi2GReS/N5f1RQamaZ7PDZlVAxTBPglFSAsobWhlD4nlxRCZVVx078KoeOO+ j/5oY7k9OwmM1F5SrKiyljTQ/+hn6E7uku0iZNYaqzElaGwDAKFGUjJW+4O5mQ== 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 4bdcRS6p4Xz4kn; Fri, 11 Jul 2025 03:20:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56B3KaYB033248; Fri, 11 Jul 2025 03:20:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56B3KalL033246; Fri, 11 Jul 2025 03:20:36 GMT (envelope-from git) Date: Fri, 11 Jul 2025 03:20:36 GMT Message-Id: <202507110320.56B3KalL033246@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: 8949cdd9af53 - main - libsa/zfs: don't read and store ZPOOL_CONFIG_VDEV_CHILDREN in vdev_probe() 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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: 8949cdd9af536d3fc4313c057dcb383f474c3f84 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=8949cdd9af536d3fc4313c057dcb383f474c3f84 commit 8949cdd9af536d3fc4313c057dcb383f474c3f84 Author: Gleb Smirnoff AuthorDate: 2025-07-11 03:18:36 +0000 Commit: Gleb Smirnoff CommitDate: 2025-07-11 03:18:36 +0000 libsa/zfs: don't read and store ZPOOL_CONFIG_VDEV_CHILDREN in vdev_probe() This is just the value from the current label and it is not used in the function. Later zfs_spa_init() will call vdev_init_from_nvlist() and it will obtain the value. --- stand/libsa/zfs/zfsimpl.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/stand/libsa/zfs/zfsimpl.c b/stand/libsa/zfs/zfsimpl.c index 058907b1d822..a31fa24f358e 100644 --- a/stand/libsa/zfs/zfsimpl.c +++ b/stand/libsa/zfs/zfsimpl.c @@ -2006,7 +2006,7 @@ vdev_probe(vdev_phys_read_t *_read, vdev_phys_write_t *_write, void *priv, vdev_t *vdev; nvlist_t *nvl; uint64_t val; - uint64_t guid, vdev_children; + uint64_t guid; uint64_t pool_txg, pool_guid; const char *pool_name; int rc, namelen; @@ -2083,8 +2083,6 @@ vdev_probe(vdev_phys_read_t *_read, vdev_phys_write_t *_write, void *priv, if (spa == NULL) { char *name; - nvlist_find(nvl, ZPOOL_CONFIG_VDEV_CHILDREN, - DATA_TYPE_UINT64, NULL, &vdev_children, NULL); name = malloc(namelen + 1); if (name == NULL) { nvlist_destroy(nvl); @@ -2098,7 +2096,6 @@ vdev_probe(vdev_phys_read_t *_read, vdev_phys_write_t *_write, void *priv, nvlist_destroy(nvl); return (ENOMEM); } - spa->spa_root_vdev->v_nchildren = vdev_children; } if (pool_txg > spa->spa_txg) spa->spa_txg = pool_txg; From nobody Fri Jul 11 03:27:24 2025 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 4bdcbK6pVGz61wVS; Fri, 11 Jul 2025 03:27:25 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdcbJ717Tz3tBg; Fri, 11 Jul 2025 03:27:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752204445; 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=qsE1Yisg78o39mkvv9mU0sbngNGfKtWTAgLKI9olUKw=; b=Tyevm1xUR1FBfOS6W/+TAblEGYfnjMHVN/y8eIunaBb/d6Of45zZIRdhX0oLZiyHnBjGUH weZmApbItGy9t4yB2x+qDTvl7ljrSnIApY5lQyOsi3BrqVxtEYcHseDHwYRr7DY6FFKf0n 4dThD4PyFHsJinFIQ0bKsowBEeEjDTrcyIYRUq3FLab2+y3RiCF11nTnskOMSJc2DHwoWs ykZVT6/mnH5jyfoysOyFxWHAHckJSP58SaRbWHoPCIvIA/0/Gn3rG17TsQPurZqsNsyz4U OFg870cd52LRY9om8EEnnf4kUIRT5zCmm9IHcMpcSjymILvDkp0wiL8vQb9UzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752204445; 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=qsE1Yisg78o39mkvv9mU0sbngNGfKtWTAgLKI9olUKw=; b=IaTzczmvWLcCz/iZtfhLtZo7pZV9qFxcG/AqUK89QRWqdd10Q/+eW01S6c0vFUB/75PvqC EqHqoNGXCcbMe8u+/WUFfnQdRKIuswxSn35vQIAd6eTbIhRO3v3nGex+rvt0ATZ4ZHiMDG toQBixStJCUzSu+TRv89kLcsOMldzz13xVbEQFyXZETDIhxpPBYMTHPlBZ6mmP89JQmnj8 dPfgegSPosmnqLzytqRBmcb0NZmvlwUXcU11MT40rKjIRuntjrSHAI+Qw+qGZL+DaUDwIc 2P+ZTPSMfrs9cU7PK9xXsous9OjCXkpZNkJskTvrXRJM/l2e54UBn/nFib8mrA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752204445; a=rsa-sha256; cv=none; b=VlEU8wj909hAP4W9/mfP28y7nzUfjeH6APUokWdZou7udC4z0AKLL2lf1Wiih6s+kubIXh kgtE1KVfzKY6RbrbZCZe3xR/RwSz6NKZxS0Fl14UREkV+jbksHhFGY4RNced6Ses/iPr9r cjjrGoA+q+qv9pAk2W+C/4l+DdZiS79dsPdlTfjEgDzA05yACc6qMymeq8cVGr64/8auY0 Pkq4poa0ph3gOVpMihVKESx5s5r2qAnKBrbEP2J7OmYBbF5jyqwbVq6EQPTw8D5wnn9GOD B1D3EzAJaSglpE2DNpvv6UKW//rcQthM0Ej4bxcyZ+EeYSevOX6P3KWzImfVOg== 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 4bdcbJ6C1wz4lM; Fri, 11 Jul 2025 03:27:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56B3ROOR042018; Fri, 11 Jul 2025 03:27:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56B3ROPg042016; Fri, 11 Jul 2025 03:27:24 GMT (envelope-from git) Date: Fri, 11 Jul 2025 03:27:24 GMT Message-Id: <202507110327.56B3ROPg042016@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: 8e8fd66ca06f - main - libsa/zfs: fail earlier in vdev_probe() if can't find ZPOOL_CONFIG_GUID 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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: 8e8fd66ca06ff73f3b4bdf3f7735d727a881cf60 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=8e8fd66ca06ff73f3b4bdf3f7735d727a881cf60 commit 8e8fd66ca06ff73f3b4bdf3f7735d727a881cf60 Author: Gleb Smirnoff AuthorDate: 2025-07-11 03:26:01 +0000 Commit: Gleb Smirnoff CommitDate: 2025-07-11 03:26:01 +0000 libsa/zfs: fail earlier in vdev_probe() if can't find ZPOOL_CONFIG_GUID Don't store any configuration in memory from such weird label. --- stand/libsa/zfs/zfsimpl.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/stand/libsa/zfs/zfsimpl.c b/stand/libsa/zfs/zfsimpl.c index a31fa24f358e..c7dc72561eff 100644 --- a/stand/libsa/zfs/zfsimpl.c +++ b/stand/libsa/zfs/zfsimpl.c @@ -2067,7 +2067,9 @@ vdev_probe(vdev_phys_read_t *_read, vdev_phys_write_t *_write, void *priv, nvlist_find(nvl, ZPOOL_CONFIG_POOL_GUID, DATA_TYPE_UINT64, NULL, &pool_guid, NULL) != 0 || nvlist_find(nvl, ZPOOL_CONFIG_POOL_NAME, DATA_TYPE_STRING, - NULL, &pool_name, &namelen) != 0) { + NULL, &pool_name, &namelen) != 0 || + nvlist_find(nvl, ZPOOL_CONFIG_GUID, DATA_TYPE_UINT64, + NULL, &guid, NULL) != 0) { /* * Cache and spare devices end up here - just ignore * them. @@ -2106,11 +2108,6 @@ vdev_probe(vdev_phys_read_t *_read, vdev_phys_write_t *_write, void *priv, * be some kind of alias (overlapping slices, dangerously dedicated * disks etc). */ - if (nvlist_find(nvl, ZPOOL_CONFIG_GUID, DATA_TYPE_UINT64, - NULL, &guid, NULL) != 0) { - nvlist_destroy(nvl); - return (EIO); - } vdev = vdev_find(guid); /* Has this vdev already been inited? */ if (vdev && vdev->v_phys_read) { From nobody Fri Jul 11 04:16:22 2025 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 4bddgq2QB3z61yVN; Fri, 11 Jul 2025 04:16:23 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bddgq0sQdz4PVt; Fri, 11 Jul 2025 04:16:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752207383; 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=t3P5zYrBfeSKrOA+6k82qpEimDqh4MNKQ9CjMo203dA=; b=e4zda7fZkdXiQI0pKnbHEg3Vqwwy3W+Z/XeVlVwHNEeQNcjR4TeLefjlyRZjHrRqT21YDD E6svAq++svAPicL7iQ6GdR8P7t0ZW9RuW2YnfyP2JuHJp5e0bWRz8LGR+LQbfHl2symBs6 HwCVRPvCGpIfbghZ+EyyNumGZeFJsuvyZfW32dTKhlrpSsXbMRckZKgFk1AECZC6cUaURO 3wXsmGnG22iG1xuhn6AY4WDemc7psygU4rYyEFajUliyUx57F9slYkuY9SwnifhfLN/x4U Q9ZMCHfZIfWnzr8ewBnSMCLKg3Rtc6XBw9YO05PBmO7FAFykJ6krSPgXedHPgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752207383; 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=t3P5zYrBfeSKrOA+6k82qpEimDqh4MNKQ9CjMo203dA=; b=Y1Fg3YraKPMGuMud0KPmjGOZHxxPxyVhbjnUJppwlqyI7sVWNqJ8CZxPJPpEZPqZpY/2Fl yjI+DH1/1d/vmSrlsqWKUzC9V+501BIiWx7cdfa/GoxA6l/URst6fkhGEiupvhe4XrgZ5O fyzLfummHuF188vGJYFceJy7HWJ6FfWzNpTZLZaHEMbo0G73BErPyXdWRQVHfkNODGHOOH kqKbB2qOJwMDWdqMG8/SeXo4RmjE7oYjNb8/h1tTxoMYaBKWPs7sd5t4ZY+Xu5ufpQH5iW Tchf6ULSJ+fW7TWaU5drdVp8FVBIedy+qYd3vy6VV9MXqub31vEI61UloPxmZA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752207383; a=rsa-sha256; cv=none; b=R+rtysBaXgMPLxVqgvuvjxN7bLQE2IwFK+1066a9T+XbXXCVuLhslG3y4V9kMZRVD8mzlu ozN6N8i1pModFco5C0RAIdDMtjaXNquXlTXbp6ccz/XuSvbi4u5x2v6nTSnZqrywAWxMf4 akgrEYrg0awR6D7unUzIx8EvEIIPVWH2WLFsl4Lq3ZINNI5+9xrvsrcNJmDAy9//TuxK+m aOq9QwGKvLLCrR0GPmNiMqbzac3qVjkggDkot7P81XMdMj3uwqPRWQfz4SMrryb2XCW4zO A35zGlB/k7wqouiDI8Mhp86O1Se5DehwYQfqJ66l8Hsd0vWJFXbAAOh7osLucQ== 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 4bddgq0T40z6LK; Fri, 11 Jul 2025 04:16:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56B4GMlp035783; Fri, 11 Jul 2025 04:16:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56B4GM84035780; Fri, 11 Jul 2025 04:16:22 GMT (envelope-from git) Date: Fri, 11 Jul 2025 04:16:22 GMT Message-Id: <202507110416.56B4GM84035780@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: ShengYi Hung Subject: git: 99d5cf25d7b8 - main - libusb: implement libusb_setlocale to support different locale of error message 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: aokblast X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 99d5cf25d7b87796f9979df8f2b4021df51c090c Auto-Submitted: auto-generated The branch main has been updated by aokblast: URL: https://cgit.FreeBSD.org/src/commit/?id=99d5cf25d7b87796f9979df8f2b4021df51c090c commit 99d5cf25d7b87796f9979df8f2b4021df51c090c Author: ShengYi Hung AuthorDate: 2025-06-12 18:47:22 +0000 Commit: ShengYi Hung CommitDate: 2025-07-11 04:15:30 +0000 libusb: implement libusb_setlocale to support different locale of error message Upstream libusb identifies languages using only the first two characters of the language code. We adopt the same approach to maintain API compatibility. Currently, only English and Mandarin are supported, as other languages are not yet implemented. Reviewed by: kevans Approved by: markj (mentor) MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D50820 --- lib/libusb/libusb.3 | 15 +++++- lib/libusb/libusb.h | 3 ++ lib/libusb/libusb10.c | 126 +++++++++++++++++++++++++++++++++++++------------- lib/libusb/libusb10.h | 6 +++ 4 files changed, 117 insertions(+), 33 deletions(-) diff --git a/lib/libusb/libusb.3 b/lib/libusb/libusb.3 index a9a99f307a86..74b85d4aa17e 100644 --- a/lib/libusb/libusb.3 +++ b/lib/libusb/libusb.3 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd June 12, 2025 +.Dd June 13, 2025 .Dt LIBUSB 3 .Os .Sh NAME @@ -106,6 +106,19 @@ Get the ASCII representation of the error given by the argument. This function does not return NULL. .Pp +.Ft int +.Fn libusb_setlocale "const char *locale" +Set locale for the error message when using +.Fn libusb_strerror +to +.Ft locale . +Note other +.Nm +implementations only support the first two bytes, that means +.Ql en-US +is equivalent to +.Ql en-CA . +.Pp .Ft const char * .Fn libusb_error_name "int code" Get the ASCII representation of the error enum given by the diff --git a/lib/libusb/libusb.h b/lib/libusb/libusb.h index 17d341d1b91c..6fb1c19fad13 100644 --- a/lib/libusb/libusb.h +++ b/lib/libusb/libusb.h @@ -210,6 +210,8 @@ enum libusb_error { LIBUSB_ERROR_OTHER = -99, }; +#define LIBUSB_ERROR_COUNT 14 + enum libusb_speed { LIBUSB_SPEED_UNKNOWN = 0, LIBUSB_SPEED_LOW = 1, @@ -475,6 +477,7 @@ int libusb_init(libusb_context ** context); int libusb_init_context(libusb_context **, const struct libusb_init_option [], int num_options); void libusb_exit(struct libusb_context *ctx); int libusb_has_capability(uint32_t capability); +int libusb_setlocale(const char *locale); /* Device handling and enumeration */ diff --git a/lib/libusb/libusb10.c b/lib/libusb/libusb10.c index 173f51aa88b3..6f1ca877fc28 100644 --- a/lib/libusb/libusb10.c +++ b/lib/libusb/libusb10.c @@ -4,6 +4,7 @@ * Copyright (c) 2009 Sylvestre Gallon. All rights reserved. * Copyright (c) 2009-2023 Hans Petter Selasky * Copyright (c) 2024 Aymeric Wibo + * Copyright (c) 2025 ShengYi Hung * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -31,6 +32,7 @@ #include LIBUSB_GLOBAL_INCLUDE_FILE #else #include +#include #include #include #include @@ -84,6 +86,52 @@ static const struct libusb_version libusb_version = { .describe = "https://www.freebsd.org" }; +static const struct libusb_language_context libusb_language_ctx[] = { + { + .lang_name = "en", + .err_strs = { + [-LIBUSB_SUCCESS] = "Success", + [-LIBUSB_ERROR_IO] = "I/O error", + [-LIBUSB_ERROR_INVALID_PARAM] = "Invalid parameter", + [-LIBUSB_ERROR_ACCESS] = "Permissions error", + [-LIBUSB_ERROR_NO_DEVICE] = "No device", + [-LIBUSB_ERROR_NOT_FOUND] = "Not found", + [-LIBUSB_ERROR_BUSY] = "Device busy", + [-LIBUSB_ERROR_TIMEOUT] = "Timeout", + [-LIBUSB_ERROR_OVERFLOW] = "Overflow", + [-LIBUSB_ERROR_PIPE] = "Pipe error", + [-LIBUSB_ERROR_INTERRUPTED] = "Interrupted", + [-LIBUSB_ERROR_NO_MEM] = "Out of memory", + [-LIBUSB_ERROR_NOT_SUPPORTED] ="Not supported", + [LIBUSB_ERROR_COUNT - 1] = "Other error", + [LIBUSB_ERROR_COUNT] = "Unknown error", + } + }, + { + .lang_name = "zh", + .err_strs = { + [-LIBUSB_SUCCESS] = "成功", + [-LIBUSB_ERROR_IO] = "I/O 錯誤", + [-LIBUSB_ERROR_INVALID_PARAM] = "不合法的參數", + [-LIBUSB_ERROR_ACCESS] = "權限錯誤", + [-LIBUSB_ERROR_NO_DEVICE] = "裝置不存在", + [-LIBUSB_ERROR_NOT_FOUND] = "不存在", + [-LIBUSB_ERROR_BUSY] = "裝置忙碌中", + [-LIBUSB_ERROR_TIMEOUT] = "逾時", + [-LIBUSB_ERROR_OVERFLOW] = "溢位", + [-LIBUSB_ERROR_PIPE] = "管道錯誤", + [-LIBUSB_ERROR_INTERRUPTED] = "被中斷", + [-LIBUSB_ERROR_NO_MEM] = "記憶體不足", + [-LIBUSB_ERROR_NOT_SUPPORTED] ="不支援", + [LIBUSB_ERROR_COUNT - 1] = "其他錯誤", + [LIBUSB_ERROR_COUNT] = "未知錯誤", + } + }, +}; + +static const struct libusb_language_context *default_language_context = + &libusb_language_ctx[0]; + const struct libusb_version * libusb_get_version(void) { @@ -1728,38 +1776,26 @@ libusb_le16_to_cpu(uint16_t x) const char * libusb_strerror(int code) { - switch (code) { - case LIBUSB_SUCCESS: - return ("Success"); - case LIBUSB_ERROR_IO: - return ("I/O error"); - case LIBUSB_ERROR_INVALID_PARAM: - return ("Invalid parameter"); - case LIBUSB_ERROR_ACCESS: - return ("Permissions error"); - case LIBUSB_ERROR_NO_DEVICE: - return ("No device"); - case LIBUSB_ERROR_NOT_FOUND: - return ("Not found"); - case LIBUSB_ERROR_BUSY: - return ("Device busy"); - case LIBUSB_ERROR_TIMEOUT: - return ("Timeout"); - case LIBUSB_ERROR_OVERFLOW: - return ("Overflow"); - case LIBUSB_ERROR_PIPE: - return ("Pipe error"); - case LIBUSB_ERROR_INTERRUPTED: - return ("Interrupted"); - case LIBUSB_ERROR_NO_MEM: - return ("Out of memory"); - case LIBUSB_ERROR_NOT_SUPPORTED: - return ("Not supported"); - case LIBUSB_ERROR_OTHER: - return ("Other error"); - default: - return ("Unknown error"); - } + int entry = -code; + + if (code == LIBUSB_ERROR_OTHER) + entry = LIBUSB_ERROR_COUNT - 1; + /* + * The libusb upstream considers all code out of range a + * LIBUSB_ERROR_OTHER. In FreeBSD, it is a special unknown error. We + * preserve the FreeBSD implementation as I think it make sense. + */ + if (entry < 0 || entry >= LIBUSB_ERROR_COUNT) + entry = LIBUSB_ERROR_COUNT; + + /* + * Fall back to English one as the translation may be unimplemented + * when adding new error code. + */ + if (default_language_context->err_strs[entry] == NULL) + return (libusb_language_ctx[0].err_strs[entry]); + + return (default_language_context->err_strs[entry]); } const char * @@ -1842,3 +1878,29 @@ libusb_log_va_args(struct libusb_context *ctx, enum libusb_log_level level, va_end(args); } + +/* + * Upstream code actually recognizes the first two characters to identify a + * language. We do so to provide API compatibility with setlocale. + */ +int +libusb_setlocale(const char *locale) +{ + size_t idx; + const char *lang; + + if (locale == NULL || strlen(locale) < 2 || + (locale[2] != '\0' && strchr("-_.", locale[2]) == NULL)) + return (LIBUSB_ERROR_INVALID_PARAM); + + for (idx = 0; idx < nitems(libusb_language_ctx); ++idx) { + lang = libusb_language_ctx[idx].lang_name; + if (tolower(locale[0]) == lang[0] && + tolower(locale[1]) == lang[1]) { + default_language_context = &libusb_language_ctx[idx]; + return (LIBUSB_SUCCESS); + } + } + + return (LIBUSB_ERROR_INVALID_PARAM); +} diff --git a/lib/libusb/libusb10.h b/lib/libusb/libusb10.h index 9ad08edf075b..eced364ef857 100644 --- a/lib/libusb/libusb10.h +++ b/lib/libusb/libusb10.h @@ -139,6 +139,12 @@ struct libusb_device { struct libusb20_device *os_priv; }; +struct libusb_language_context { + const char *lang_name; + /* All error Plus 1 UNKNOWN */ + const char *err_strs[LIBUSB_ERROR_COUNT + 1]; +}; + extern struct libusb_context *usbi_default_context; void libusb10_add_pollfd(libusb_context *ctx, struct libusb_super_pollfd *pollfd, struct libusb20_device *pdev, int fd, short events); From nobody Fri Jul 11 12:12:44 2025 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 4bdrFT1Sk3z61Fwf; Fri, 11 Jul 2025 12:12:45 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdrFT0jc2z3x1K; Fri, 11 Jul 2025 12:12:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752235965; 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=m9Jb+PfqH9mBma+0HBNnChdp0zzLtdowDlA/B0lWdiU=; b=LBJWYs5etcOPE8xB1q9QiP22Zp4xVNwsS29jwBPFTNu7uV6Ce3Fc7HinLws//tJT8Aza/2 2ZSQMoASQDyx1KFt9IMud62gJKj6qxVPRZlY+sLDA92YVMEYjGntLZkDlD4elmnktIIr0y ddN0Ru6lTH6Ar8EOr8Hk2qYXcFpFaM2e8wjqRdV+JfVtandjuPpl+jCPkm/wF5XloAu/6C SPQkQz8XF7FPCrkHmk3+EEpi1eeGP/WAVZ9HZEAt4crcCf+cHqpsqZtQCuHYETBASGc7jL /sZ11Ohz2mAslKkFb9uCJiNzJeUc0DKtLgf0UP9gKcey8SXp7bG6PvIbA1GDTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752235965; 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=m9Jb+PfqH9mBma+0HBNnChdp0zzLtdowDlA/B0lWdiU=; b=E42X40P/GKooxPffEyEXNy2+vgn7szuYQHUS9BopgCjLO0oUa1GdgRwyO4UhUavNP25dUj nrFDVegsOE4H+H1tKgx4T/Z6r2bwwPme5xvZj3OA3ohppVuq6GUmcs66nXvw4ZjBSa60fi G+1bwYejaRUPJpGnK54GC7oGzRPaQmqjSIoOh8eDOtJ4EASVNCuFowCeTVphkDtPS9fQ0B PXE3RA5/VE933UYpKR26x6JqDIoSwmCGJB2Vo7gNS2vGSh6Djo+qWFiKnWWPEi9Sz0Sjf1 S3h0t+UCWjhw+ZU5PC3J99PjcJjjBlT9lVfPkXJ/JxprR7J1VmhEOQ77bb9ypg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752235965; a=rsa-sha256; cv=none; b=KdKqGm4+1loeKf/ofVG8BUImz/wR+1j6VJtwv/vapwJSdJeF8NOpTh4tPVu2JX8SwioNL7 t0DQjmMr1raSWnRaqJNetuTH0dVJB2luuu1oys2+55eFZaJKL8CHx2NDoJc68YTBb1/+m7 tlgbOoQYEB6xneMBUqs9PEyDrdL3rHN5DRoyT7y91M7dGyp/Ef4Una4S7B9Cckid/c9nto Fc8PzjJX350Y4I79KragqO9R7HYoIqTT+bspBFYpm3HkuXwEAdvbPJIFHZq/9RTVQnjx91 Z2b1GTAInjo2cjFhffkFXsZh4kdAfVHCBC3OKeUNfjnwfEkHVOqQPFLJPvIH9g== 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 4bdrFT0HNLzdM8; Fri, 11 Jul 2025 12:12:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56BCCiaP032359; Fri, 11 Jul 2025 12:12:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56BCCiUg032356; Fri, 11 Jul 2025 12:12:44 GMT (envelope-from git) Date: Fri, 11 Jul 2025 12:12:44 GMT Message-Id: <202507111212.56BCCiUg032356@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ahmad Khalifa Subject: git: 3d5ef2982555 - main - acpi_gpiobus: don't print error message if _AEI object doesn't exist 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vexeduxr X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3d5ef29825557bddc08b1171126026b051043194 Auto-Submitted: auto-generated The branch main has been updated by vexeduxr: URL: https://cgit.FreeBSD.org/src/commit/?id=3d5ef29825557bddc08b1171126026b051043194 commit 3d5ef29825557bddc08b1171126026b051043194 Author: Ahmad Khalifa AuthorDate: 2025-07-11 12:08:54 +0000 Commit: Ahmad Khalifa CommitDate: 2025-07-11 12:10:00 +0000 acpi_gpiobus: don't print error message if _AEI object doesn't exist GPIO controllers aren't required to have an _AEI object. Reviewed by: wulf Approved by: imp (mentor) Differential Revision: https://reviews.freebsd.org/D51236 --- sys/dev/gpio/acpi_gpiobus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/gpio/acpi_gpiobus.c b/sys/dev/gpio/acpi_gpiobus.c index f9468e0deda0..94f4e5771266 100644 --- a/sys/dev/gpio/acpi_gpiobus.c +++ b/sys/dev/gpio/acpi_gpiobus.c @@ -357,7 +357,7 @@ acpi_gpiobus_attach(device_t dev) status = AcpiWalkResources(handle, "_AEI", acpi_gpiobus_enumerate_aei, &ctx); - if (ACPI_FAILURE(status)) + if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) device_printf(dev, "Failed to enumerate AEI resources\n"); return (0); From nobody Fri Jul 11 14:58:07 2025 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 4bdvwH4hkCz61RDp; Fri, 11 Jul 2025 14:58:07 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdvwH42Syz3rLp; Fri, 11 Jul 2025 14:58:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752245887; 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=+rfdcPONd7EnVl7+vKGUDJSN065+C2XdCzD0+nca6iA=; b=cD+OVlRbusKk7mSeVebmdMM3VS2Dfzm0jvAupDRjmrK4n171OZcpF/7ydIM25spBfpaL0T W33uQrDmLCOqVDtAJdk/H2VipdDPRtkRK2dktXmK6ej4Pv2GJssBKiR82pJBw8TIezeOeY Z/74jlEb2egiWWOto0VvYbRelwMOEsNBsAUTnvajxC4BmCZS13COU+eQX14nE7FKzersAK uQgUKWtG4OQc5YoqeH/RuJkGykF1elwkPS5Q6YPCod6EkHzihaqZRgKIhmg6nTJnnCD3Vy vcF8QU2nRRd1IKQy20hvXKJ///ilV7IlMwbsYjJp/BdHDjsYFrvq15PDY6UOQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752245887; 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=+rfdcPONd7EnVl7+vKGUDJSN065+C2XdCzD0+nca6iA=; b=eIZk+J2ByXS4gfVSvt8KZCch/K5qVh6uXDlYIJBjFfBcCDoYi+qIYmJ83mbS724EW2H6Gr VD44GR4yz+QSR/CBdONuwX3c2ODJTMB1XgtqesHqXRJ5jDFvPx59Un7Gk3cmAJFpiICY6K Id6Dbr7H0AmZEwfs2rcJKctgnYyV/8mk7+x61rS66wbayy1CmzB3DvWEhgoekPwdDk9STq xsgOyRMe30fkqpfQcr6tGdHH7RtEr+bbC1ItsF4VZStdzTHV+Xtxmc0wJLSncByBm0LX20 MUfGi5+wBknxw2siFMhY7ybNVz39TbO/c2bbAPfVF3MIC7q9j0U97S7XXTOHmA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752245887; a=rsa-sha256; cv=none; b=fjQHzPki/qW6kVRyayM4ieN5Dq6VEQt4/GLH7a/3CYXbOoXOygrBhTzve3NXwq3vFQOHTm iF8RL60SaQvtWe2ZIRmSiPa8Bxgl9H8at5rgDJC7uqqeSNd2/E5lf7CpJ42m04Xz7IuNAn lBvDasaF0AQVJ4B7KaKW+g8jPF+VMSuQIsmGJW4lewQs6KNiGxs056hPnBG7E++kLD/30p gFJdZEEM4MlfbCjOsWSRnIf3WzGySTA37ZIH1TQ/Ar8aRFSZV69+NnlHDxjAILNOnZMJ0b ltO9RXQJ1yukB0jPaLTgwEfqcYHsuSt6Alara4DwtuB/g4lLnIR0gxP4tJ8Wug== 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 4bdvwH3KyfzjD2; Fri, 11 Jul 2025 14:58:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56BEw7gV031870; Fri, 11 Jul 2025 14:58:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56BEw7gx031867; Fri, 11 Jul 2025 14:58:07 GMT (envelope-from git) Date: Fri, 11 Jul 2025 14:58:07 GMT Message-Id: <202507111458.56BEw7gx031867@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ruslan Bukin Subject: git: 55a25c753100 - main - hwt(4): fix spelling. 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: br X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 55a25c753100fe7085f6fd7832f0c219ee001a2e Auto-Submitted: auto-generated The branch main has been updated by br: URL: https://cgit.FreeBSD.org/src/commit/?id=55a25c753100fe7085f6fd7832f0c219ee001a2e commit 55a25c753100fe7085f6fd7832f0c219ee001a2e Author: Ruslan Bukin AuthorDate: 2025-07-11 14:52:06 +0000 Commit: Ruslan Bukin CommitDate: 2025-07-11 14:52:06 +0000 hwt(4): fix spelling. Pointed out by: maxim Sponsored by: UKRI --- share/man/man4/hwt.4 | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/share/man/man4/hwt.4 b/share/man/man4/hwt.4 index 7bc8ed4b396d..df02a4672f36 100644 --- a/share/man/man4/hwt.4 +++ b/share/man/man4/hwt.4 @@ -73,7 +73,7 @@ request it accepts is This request allocates kernel tracing context (CTX) based on requested mode of operation, set of CPUs and/or pid. .Pp -Upon successfull CTX allocation, the ioctl returns a CTX identification +Upon successful CTX allocation, the ioctl returns a CTX identification number (ident). .Pp Each CTX is then managed using its own dedicated character device found at @@ -104,7 +104,8 @@ operation: Enable kernel hooks. .El .Sh IOCTL INTERFACE -Once a CTX is allocated, it's management character device accepts several IOC +Once a CTX is allocated, its management character device accepts several +.Xr ioctl 2 requests: .Bl -tag -width "HWT_IOC_RECORD_GET" .It Dv HWT_IOC_START @@ -122,11 +123,11 @@ with this CTX to userspace. .It Dv HWT_IOC_BUFPTR_GET Get current pointer in buffer that is filled by tracing units in real-time. .It Dv HWT_IOC_SET_CONFIG -Set achitecture-specific config (optional). +Set architecture-specific config (optional). .It Dv HWT_IOC_WAKEUP Wake up a thread that has been put to sleep by HWT framework hooks. .It Dv HWT_IOC_SVC_BUF -For SPE-only, the kernel is waiting for userspace to notify that it's copied +For SPE-only, the kernel is waiting for userspace to notify that it has copied out a buffer to avoid data loss/overwriting buffers. .El .Sh SEE ALSO From nobody Fri Jul 11 15:16:14 2025 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 4bdwKC12zTz61S7w; Fri, 11 Jul 2025 15:16:15 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdwKC0PZyz3x0h; Fri, 11 Jul 2025 15:16:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752246975; 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=nRMh/qiBA0KBWiUDMWfk0FW4k4X71CeYovkNwGhSZVE=; b=i2v30zs40q0LrBUS4aHGvNJiVDhwopI5ZKXalncshF0AuNZb4m/GQLt3pRhdUgmikuH4zs rVQv59yGZLFg3SFVZvB1OvahrSbFvz5rj/tZPiPLQg2auQVOup2bl164TFygPLylzBKqXO GlAuc2QamT6PzmMzC5OPlnvZxk+qJMDh4z986v6kbU3KvXyjdG0gCGmzsykPZ/jEjFCVY8 SfEIcIoapXsb2r5KR4bvlFtZWgILbQSQHj6Yf080zaO4VxmEEzfp3ICtFF+HhZkEfn5Bon qT1A400da040hraFjLY1acMQAgHWsAdzS2qArbxmeEz4+o6tB4xVEc3rX+3Vzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752246975; 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=nRMh/qiBA0KBWiUDMWfk0FW4k4X71CeYovkNwGhSZVE=; b=Hqb7wfLvVSPtSYAA+DizqWAq3InWx+rsds82boIGmMufg/GIV/a62Mxrd/Wod/u3pOIYDu fxnkOVS+mI7ipDfOtD++wIBPLEwXVP/0WwpSE8EvQL1+JO0Gatoha56jh5I6ll5nfk4b++ P2wtNWLU0AxYiP9G3GJ6BEIc1d008kAnmn/pjetw4Rjb6lkYm/xqpaKt56Vay6M4zwmeWD 5Yy/QA0hBSWw/TuKv1NK7qbDSkbbtSowrxJqbst1JwbP7RhHRkzVTSmKHadSlapQ0r9out VIV7wp5eqinyNli7Mgv2TSQXDwZuTEm2KjomtyVeuoAcTX5zJm36tdreCZov4A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752246975; a=rsa-sha256; cv=none; b=Jn9jQKTRQK5acyhsDjxLy/K5w66DANyuEQZhM9krr9+b6tyMmkVZPs+h8xoMvzmLpK2O6i duCWUBHzLYx1dhfaP2vsXfTUAjoYSW2B+rNU7NWvtkNVr4V9ctUUe3L5cTILolbk8hW8Ag U4TaydtPuIAQc+HktubZ3Lu7mHNM5UdV2iHksK02BcJte4H+0yxXCqSdRpF8+QSUEx2RyY aQfglld2TNpbPzHKzVGlg4j/zAHPAUf5CpHwmUiNkXijMQkSKFzMTGXh2NhKSkxqT8q3Z8 lFrn/aQ61hyLy2BpMJ3CY7fP9kTR7MHkDj+scRumeAVTKWbI2ftL5dtUEzIrMA== 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 4bdwKB73Qtzjn6; Fri, 11 Jul 2025 15:16:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56BFGEj2068999; Fri, 11 Jul 2025 15:16:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56BFGEcc068996; Fri, 11 Jul 2025 15:16:14 GMT (envelope-from git) Date: Fri, 11 Jul 2025 15:16:14 GMT Message-Id: <202507111516.56BFGEcc068996@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brad Davis Subject: git: 5652050565f7 - main - gstat.8: Add an example of how to filter the results 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brd X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5652050565f7595651b33f7e1480b4d717a8a055 Auto-Submitted: auto-generated The branch main has been updated by brd: URL: https://cgit.FreeBSD.org/src/commit/?id=5652050565f7595651b33f7e1480b4d717a8a055 commit 5652050565f7595651b33f7e1480b4d717a8a055 Author: Brad Davis AuthorDate: 2025-07-11 15:10:56 +0000 Commit: Brad Davis CommitDate: 2025-07-11 15:10:56 +0000 gstat.8: Add an example of how to filter the results Reviewed by: bcr --- usr.sbin/gstat/gstat.8 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/usr.sbin/gstat/gstat.8 b/usr.sbin/gstat/gstat.8 index 02dbbbc54a3d..2975a93c7fef 100644 --- a/usr.sbin/gstat/gstat.8 +++ b/usr.sbin/gstat/gstat.8 @@ -122,6 +122,9 @@ Quit .El .Sh EXIT STATUS .Ex -std +.Sh EXAMPLES +To filter the output to only physical disks named ada0 through ada4: +.Dl # gstat -f ada0[0-4]$ .Sh SEE ALSO .Xr systat 1 , .Xr geom 4 , From nobody Fri Jul 11 15:46:33 2025 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 4bdx0C1yYtz61V57; Fri, 11 Jul 2025 15:46:35 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdx0C1CgSz46kW; Fri, 11 Jul 2025 15:46:35 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752248795; 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: in-reply-to:in-reply-to:references:references; bh=deKf8oDjcb48Z1eZAG0AoOOKowfI2Y3wFaR6Ohf8sWw=; b=NcqH8hgbRblGKL+m9yl8nPRM8RygeWqeFTAwOrXUyrLk1lk0a6zckPNPBvjx9KnLfZ22dy 7XfcNxVCdtKQO8f+rHV4+ps7Iw29NVoC55Be7WrCi5SX0lpGCHYhA8ngiebdbeYRFy0Uzh mRLUkCDG7JX1QpdqoRJP8vRVeTXxiOAkVLzU+Uq7AcgUvt/6DIWP0xUv+Kj5lBbtJZcjaP co++i/4UfVLUn7HH5VDaXReQClPxvBEN6EuTf/FwSQGkiAis5YU4MNr2cGSlRyFaWBm4pI 2TtazO9oJst6k6WaQAmQeI3WYHmKg1SzIyhftWtm1luMp2JZbdoyenFJGUPXOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752248795; 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: in-reply-to:in-reply-to:references:references; bh=deKf8oDjcb48Z1eZAG0AoOOKowfI2Y3wFaR6Ohf8sWw=; b=jrxLpwM3eHsyulWVXH32DTCIOk4tDvsPmeZr9Cek+fN0AzD+UrMmgD+HGIYlJ7UsCuhTOO s/AJa0c3g91K5D1+fmNocsfLlBBW6nLJAfUFB2tjWi47RQlCJ6qYTYB4dJo2xPkLhwLo6V g6o1j4fMIkcZK+CUP7qaYOeuaZpNDWB9eDfMLE56DQCCPFwXo1vJVsW5zsgH+UBoCqIHKA DEI9b85BZNlu5Gog63EIP1Ip9zzvp27fdrTxnn8/iOq0YxQgIoXgO2VtsvVE3SnU2AsM8w /WPvK5B0DBgXnO8mbKVOrQpotAeaCRUZ4X05KvEC9yVbVy0/739d04VIklwu5Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752248795; a=rsa-sha256; cv=none; b=d2iFMdTU8JQBCyn/4mxgExX7HZWP9Jr7BPELphqdTot2OocJRbTxxXiXE2QwEW2YAz+ALA NgX7+0zfe5sHyWjLd3gYXKCw+FJfuMcVkBDdq1I3yNaBrZhufM/7rtAe/OEUa+rc8kQHtE o4cn1CKNSWsutZJoG8euKJrM9kpaTO+WHzQAafUDBcLURz3Rw60TrqSmqdZ135emlOX3Nu oWckFw5FeEG9o0Hx1TT73g8apyaL9wW4qKHb3+tVsvZjMg8IiIFL44SU6Y2fQ7zB4ZZNA/ FNmcpEEWg03GiErHmsr4g5E7Zsi3aIHqsdMul64cYig25PQIRnpaE7Sm4pusJw== Received: from [IPV6:2601:5c0:4200:b830:55b6:3b49:2cd9:9d38] (unknown [IPv6:2601:5c0:4200:b830:55b6:3b49:2cd9:9d38]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bdx0B4XMDz7Lv; Fri, 11 Jul 2025 15:46:34 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: Date: Fri, 11 Jul 2025 11:46:33 -0400 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: ba0d9b43e940 - main - kern_descrip.c: provide helpers to translate between fd flags namespace Content-Language: en-US To: Konstantin Belousov , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202507082149.568LnGOU086303@gitrepo.freebsd.org> From: John Baldwin In-Reply-To: <202507082149.568LnGOU086303@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 7/8/25 17:49, Konstantin Belousov wrote: > The branch main has been updated by kib: > > URL: https://cgit.FreeBSD.org/src/commit/?id=ba0d9b43e940077f4025e7e4e85d16c8d525db79 > > commit ba0d9b43e940077f4025e7e4e85d16c8d525db79 > Author: Konstantin Belousov > AuthorDate: 2025-07-08 16:30:29 +0000 > Commit: Konstantin Belousov > CommitDate: 2025-07-08 21:48:59 +0000 > > kern_descrip.c: provide helpers to translate between fd flags namespace > > Reviewed by: markj > Sponsored by: The FreeBSD Foundation > Differential revision: https://reviews.freebsd.org/D51206 > --- > sys/kern/kern_descrip.c | 110 +++++++++++++++++++++++++++++++++++++++--------- > 1 file changed, 90 insertions(+), 20 deletions(-) > > diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c > index 406236fc2723..2e1da2fdee29 100644 > --- a/sys/kern/kern_descrip.c > +++ b/sys/kern/kern_descrip.c > @@ -480,6 +480,90 @@ kern_fcntl_freebsd(struct thread *td, int fd, int cmd, intptr_t arg) > return (error); > } > > +struct flags_trans_elem { > + u_int f; > + u_int t; > +}; > + > +static u_int > +flags_trans(const struct flags_trans_elem *ftes, int nitems, u_int from_flags) > +{ > + u_int res; > + int i; > + > + res = 0; > + for (i = 0; i < nitems; i++) { > + if ((from_flags & ftes[i].f) != 0) > + res |= ftes[i].t; > + } > + return (res); > +} > + > +static uint8_t > +fd_to_fde_flags(int fd_flags) > +{ > + static const struct flags_trans_elem fd_to_fde_flags_s[] = { > + { .f = FD_CLOEXEC, .t = UF_EXCLOSE }, > + { .f = FD_CLOFORK, .t = UF_FOCLOSE }, > + { .f = FD_RESOLVE_BENEATH, .t = UF_RESOLVE_BENEATH }, > + }; > + > + return (flags_trans(fd_to_fde_flags_s, nitems(fd_to_fde_flags_s), > + fd_flags)); > +} > + > +static int > +fde_to_fd_flags(uint8_t fde_flags) > +{ > + static const struct flags_trans_elem fde_to_fd_flags_s[] = { > + { .f = UF_EXCLOSE, .t = FD_CLOEXEC }, > + { .f = UF_FOCLOSE, .t = FD_CLOFORK }, > + { .f = UF_RESOLVE_BENEATH, .t = FD_RESOLVE_BENEATH }, > + }; > + > + return (flags_trans(fde_to_fd_flags_s, nitems(fde_to_fd_flags_s), > + fde_flags)); > +} > + > +static uint8_t > +fddup_to_fde_flags(int fddup_flags) > +{ > + static const struct flags_trans_elem fddup_to_fde_flags_s[] = { > + { .f = FDDUP_FLAG_CLOEXEC, .t = UF_EXCLOSE }, > + { .f = FDDUP_FLAG_CLOFORK, .t = UF_FOCLOSE }, > + }; > + > + return (flags_trans(fddup_to_fde_flags_s, nitems(fddup_to_fde_flags_s), > + fddup_flags)); > +} > + > +static uint8_t > +close_range_to_fde_flags(int close_range_flags) > +{ > + static const struct flags_trans_elem close_range_to_fde_flags_s[] = { > + { .f = CLOSE_RANGE_CLOEXEC, .t = UF_EXCLOSE }, > + { .f = CLOSE_RANGE_CLOFORK, .t = UF_FOCLOSE }, > + }; > + > + return (flags_trans(close_range_to_fde_flags_s, > + nitems(close_range_to_fde_flags_s), close_range_flags)); > +} > + > +static uint8_t > +open_to_fde_flags(int open_flags, bool sticky_orb) > +{ > + static const struct flags_trans_elem open_to_fde_flags_s[] = { > + { .f = O_CLOEXEC, .t = UF_EXCLOSE }, > + { .f = O_CLOFORK, .t = UF_FOCLOSE }, > + { .f = O_RESOLVE_BENEATH, .t = UF_RESOLVE_BENEATH }, > + }; > + _Static_assert(open_to_fde_flags_s[nitems(open_to_fde_flags_s) - 1].f == > + O_RESOLVE_BENEATH, "O_RESOLVE_BENEATH must be last, for sticky_orb"); This broke the GCC builds it seems. GCC doesn't think that it can compute this expression at compile time. From https://ci.freebsd.org/job/FreeBSD-main-amd64-gcc14_build/1022/console: 10:32:02 /workspace/src/sys/kern/kern_descrip.c: In function 'open_to_fde_flags': 10:32:02 /workspace/src/sys/kern/kern_descrip.c:560:79: error: expression in static = 10:32:02 assertion is not constant 10:32:02 560 | _Static_assert(open_to_fde_flags_s[nitems(open_to_fde_flags= 10:32:02 _s) - 1].f =3D=3D -- John Baldwin From nobody Fri Jul 11 19:00:18 2025 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 4bf1J62gd1z61h8h; Fri, 11 Jul 2025 19:00:38 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (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 mx1.freebsd.org (Postfix) with ESMTPS id 4bf1J55RgJz3Lq6; Fri, 11 Jul 2025 19:00:37 +0000 (UTC) (envelope-from kostikbel@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: from tom.home (kib@localhost [127.0.0.1] (may be forged)) by kib.kiev.ua (8.18.1/8.18.1) with ESMTP id 56BJ0JoC085729; Fri, 11 Jul 2025 22:00:22 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 56BJ0JoC085729 Received: (from kostik@localhost) by tom.home (8.18.1/8.18.1/Submit) id 56BJ0I0v085728; Fri, 11 Jul 2025 22:00:18 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 11 Jul 2025 22:00:18 +0300 From: Konstantin Belousov To: John Baldwin Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: ba0d9b43e940 - main - kern_descrip.c: provide helpers to translate between fd flags namespace Message-ID: References: <202507082149.568LnGOU086303@gitrepo.freebsd.org> 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on tom.home X-Rspamd-Queue-Id: 4bf1J55RgJz3Lq6 X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] On Fri, Jul 11, 2025 at 11:46:33AM -0400, John Baldwin wrote: > On 7/8/25 17:49, Konstantin Belousov wrote: > > The branch main has been updated by kib: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=ba0d9b43e940077f4025e7e4e85d16c8d525db79 > > > > commit ba0d9b43e940077f4025e7e4e85d16c8d525db79 > > Author: Konstantin Belousov > > AuthorDate: 2025-07-08 16:30:29 +0000 > > Commit: Konstantin Belousov > > CommitDate: 2025-07-08 21:48:59 +0000 > > > > kern_descrip.c: provide helpers to translate between fd flags namespace > > Reviewed by: markj > > Sponsored by: The FreeBSD Foundation > > Differential revision: https://reviews.freebsd.org/D51206 > > --- > > sys/kern/kern_descrip.c | 110 +++++++++++++++++++++++++++++++++++++++--------- > > 1 file changed, 90 insertions(+), 20 deletions(-) > > > > diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c > > index 406236fc2723..2e1da2fdee29 100644 > > --- a/sys/kern/kern_descrip.c > > +++ b/sys/kern/kern_descrip.c > > @@ -480,6 +480,90 @@ kern_fcntl_freebsd(struct thread *td, int fd, int cmd, intptr_t arg) > > return (error); > > } > > +struct flags_trans_elem { > > + u_int f; > > + u_int t; > > +}; > > + > > +static u_int > > +flags_trans(const struct flags_trans_elem *ftes, int nitems, u_int from_flags) > > +{ > > + u_int res; > > + int i; > > + > > + res = 0; > > + for (i = 0; i < nitems; i++) { > > + if ((from_flags & ftes[i].f) != 0) > > + res |= ftes[i].t; > > + } > > + return (res); > > +} > > + > > +static uint8_t > > +fd_to_fde_flags(int fd_flags) > > +{ > > + static const struct flags_trans_elem fd_to_fde_flags_s[] = { > > + { .f = FD_CLOEXEC, .t = UF_EXCLOSE }, > > + { .f = FD_CLOFORK, .t = UF_FOCLOSE }, > > + { .f = FD_RESOLVE_BENEATH, .t = UF_RESOLVE_BENEATH }, > > + }; > > + > > + return (flags_trans(fd_to_fde_flags_s, nitems(fd_to_fde_flags_s), > > + fd_flags)); > > +} > > + > > +static int > > +fde_to_fd_flags(uint8_t fde_flags) > > +{ > > + static const struct flags_trans_elem fde_to_fd_flags_s[] = { > > + { .f = UF_EXCLOSE, .t = FD_CLOEXEC }, > > + { .f = UF_FOCLOSE, .t = FD_CLOFORK }, > > + { .f = UF_RESOLVE_BENEATH, .t = FD_RESOLVE_BENEATH }, > > + }; > > + > > + return (flags_trans(fde_to_fd_flags_s, nitems(fde_to_fd_flags_s), > > + fde_flags)); > > +} > > + > > +static uint8_t > > +fddup_to_fde_flags(int fddup_flags) > > +{ > > + static const struct flags_trans_elem fddup_to_fde_flags_s[] = { > > + { .f = FDDUP_FLAG_CLOEXEC, .t = UF_EXCLOSE }, > > + { .f = FDDUP_FLAG_CLOFORK, .t = UF_FOCLOSE }, > > + }; > > + > > + return (flags_trans(fddup_to_fde_flags_s, nitems(fddup_to_fde_flags_s), > > + fddup_flags)); > > +} > > + > > +static uint8_t > > +close_range_to_fde_flags(int close_range_flags) > > +{ > > + static const struct flags_trans_elem close_range_to_fde_flags_s[] = { > > + { .f = CLOSE_RANGE_CLOEXEC, .t = UF_EXCLOSE }, > > + { .f = CLOSE_RANGE_CLOFORK, .t = UF_FOCLOSE }, > > + }; > > + > > + return (flags_trans(close_range_to_fde_flags_s, > > + nitems(close_range_to_fde_flags_s), close_range_flags)); > > +} > > + > > +static uint8_t > > +open_to_fde_flags(int open_flags, bool sticky_orb) > > +{ > > + static const struct flags_trans_elem open_to_fde_flags_s[] = { > > + { .f = O_CLOEXEC, .t = UF_EXCLOSE }, > > + { .f = O_CLOFORK, .t = UF_FOCLOSE }, > > + { .f = O_RESOLVE_BENEATH, .t = UF_RESOLVE_BENEATH }, > > + }; > > + _Static_assert(open_to_fde_flags_s[nitems(open_to_fde_flags_s) - 1].f == > > + O_RESOLVE_BENEATH, "O_RESOLVE_BENEATH must be last, for sticky_orb"); > > This broke the GCC builds it seems. GCC doesn't think that it can compute this > expression at compile time. > > From https://ci.freebsd.org/job/FreeBSD-main-amd64-gcc14_build/1022/console: > > 10:32:02 /workspace/src/sys/kern/kern_descrip.c: In function 'open_to_fde_flags': > 10:32:02 /workspace/src/sys/kern/kern_descrip.c:560:79: error: expression in static = > 10:32:02 assertion is not constant > 10:32:02 560 | _Static_assert(open_to_fde_flags_s[nitems(open_to_fde_flags= > 10:32:02 _s) - 1].f =3D=3D > I am unable to propose anything better than the patch below. We have enough #ifdef __clang__ in non-contrib sources already, so this should be not a huge crime? % rg -g '!contrib/*' __clang__ | wc -l 171 commit 96e6b15b0a1407af45ebe1ad38ee53627d09d16b Author: Konstantin Belousov Date: Fri Jul 11 21:57:32 2025 +0300 kern_descrip.c: only allow complex expression in Static_assert() for clang gcc cannot compute the assert expression. Reported by: jhb diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index 93bdd41d1515..c4f5e586b0ed 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -557,8 +557,10 @@ open_to_fde_flags(int open_flags, bool sticky_orb) { .f = O_CLOFORK, .t = UF_FOCLOSE }, { .f = O_RESOLVE_BENEATH, .t = UF_RESOLVE_BENEATH }, }; +#ifdef __clang__ _Static_assert(open_to_fde_flags_s[nitems(open_to_fde_flags_s) - 1].f == O_RESOLVE_BENEATH, "O_RESOLVE_BENEATH must be last, for sticky_orb"); +#endif return (flags_trans(open_to_fde_flags_s, nitems(open_to_fde_flags_s) - (sticky_orb ? 0 : 1), open_flags)); From nobody Fri Jul 11 20:43:51 2025 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 4bf3bC6dgJz60p0T; Fri, 11 Jul 2025 20:43:51 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bf3bC5rmRz3J95; Fri, 11 Jul 2025 20:43:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752266631; 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=tXVVKRi4nyclW9Tn3jlQHVr8R8iTOL4s2s7IhzC7Jx0=; b=RMTMFKUdBqzTeuzkFqHWMEgAHyhE2pJpNOEQz4ciMqOXOHDq72UkCwOvcqvzRWU3VYl7fG d8s1YjUOQsIo+96F2SuO7KV79wgRoOdba/e5YYz/2lQaIhU68KArSLTwmbRMi4nlt6Z9K2 HCC5bGdGESBCh/SilK+fjjzr8qqtbMl2GsOMMCDLzO3nr+0rbP17NMAQ9SIruZI8qzMj+n W4Si9BQvOa6rcuvX4LiNZRclQxSi5iGOER2G353osf2Pm8XsVwsTTxWossEsfn5LW6tYuL mku4JAM3Ni6zlYHpNhuJpaa/ov8Dehg1Mn6PVMXtFxShzNmGNLGUZyRwnO1fdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752266631; 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=tXVVKRi4nyclW9Tn3jlQHVr8R8iTOL4s2s7IhzC7Jx0=; b=i5jaw1VYH/kytKK40EE+ZLA+ZrSsVTIpxPnnOl9NuxzLoULf+iOlTN0Hx9cjcppt39GMR3 5vEvgQFg5M4ikBJUlfL6hIQ3MqH7WWZfX2blTK3nfXYHxYKQy9mkSCmYcX52r/+cODV6MB nE7yOku3bTtdTN2yM6Ky6/c8l97wwhpgBKulOPLAnRv4hblMBe1hvv8FRLKg9eNOlZHUCB pyxosmANE3+/znHPcHuqeustHzU7aP08UvLdM9HqoOy+AmCe7HBjR/9juVT/WDRc79dmWd BotHzdIhoAVSJ/n7uVJNarE2CSXGQsmVTfbExMJWfvRCFNuK/vtkaqM8atIsCQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752266631; a=rsa-sha256; cv=none; b=XmD3NXFO5X0UV6OPVlF5cQR8G5gt8BAdeoO3Gc30rn9U1v6gjeYxl1zD5C7Ls6bC9/YPQw QaDwd0Ve9E39H0hqhXwK0MyCyGCdcIsaOCpAofaNnbCYv1Qpmzk4uvOd/oXyDUq9kU+3Y/ xedX7lhhU1XAiceqMx784yNiTVGfIejtRQHzPj4R0wl0RBZttrnQyxesftVGSpdvnNkbXk QZTf4gMjlJDNcaUAWL3alV9noosEZG6frYLuG8Khf5uMNoI3q9eMYNbujYHLoR/tqphB9D aNQBOOjUWvqOiTU0ntdUJmsAaz0YmXSFzrMNCdbhC77tLaFKo+WwaKEqWBlvUQ== 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 4bf3bC5HNLztJ8; Fri, 11 Jul 2025 20:43:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56BKhpW2086933; Fri, 11 Jul 2025 20:43:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56BKhpGc086930; Fri, 11 Jul 2025 20:43:51 GMT (envelope-from git) Date: Fri, 11 Jul 2025 20:43:51 GMT Message-Id: <202507112043.56BKhpGc086930@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 920b2183919e - main - readdir: Fix error check. 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 920b2183919e430cf85c4aa1fa337bfded12aee5 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=920b2183919e430cf85c4aa1fa337bfded12aee5 commit 920b2183919e430cf85c4aa1fa337bfded12aee5 Author: Dag-Erling Smørgrav AuthorDate: 2025-07-11 20:43:20 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-07-11 20:43:32 +0000 readdir: Fix error check. Now that dd_size is unsigned, we need to check if the return value from getdirentries() was negative before assigning it to dd_size. While here, simplify the scandir_error test case slightly, and verify that calling readdir() again after EOF still returns NULL. Fixes: 42e613018da5 Sponsored by: Klara, Inc. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D51266 --- lib/libc/gen/readdir.c | 7 +++++-- lib/libc/tests/gen/opendir_test.c | 1 + lib/libc/tests/gen/scandir_test.c | 12 +++++------- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/lib/libc/gen/readdir.c b/lib/libc/gen/readdir.c index 32603c0b4677..b70102954df1 100644 --- a/lib/libc/gen/readdir.c +++ b/lib/libc/gen/readdir.c @@ -50,6 +50,7 @@ _readdir_unlocked(DIR *dirp, int flags) struct dirent *dp; off_t initial_seek; size_t initial_loc = 0; + ssize_t ret; for (;;) { if (dirp->dd_loc >= dirp->dd_size) { @@ -61,11 +62,13 @@ _readdir_unlocked(DIR *dirp, int flags) } if (dirp->dd_loc == 0 && !(dirp->dd_flags & (__DTF_READALL | __DTF_SKIPREAD))) { + dirp->dd_size = 0; initial_seek = dirp->dd_seek; - dirp->dd_size = _getdirentries(dirp->dd_fd, + ret = _getdirentries(dirp->dd_fd, dirp->dd_buf, dirp->dd_len, &dirp->dd_seek); - if (dirp->dd_size <= 0) + if (ret <= 0) return (NULL); + dirp->dd_size = (size_t)ret; _fixtelldir(dirp, initial_seek, initial_loc); } dirp->dd_flags &= ~__DTF_SKIPREAD; diff --git a/lib/libc/tests/gen/opendir_test.c b/lib/libc/tests/gen/opendir_test.c index 89be2becc607..b7481255654f 100644 --- a/lib/libc/tests/gen/opendir_test.c +++ b/lib/libc/tests/gen/opendir_test.c @@ -46,6 +46,7 @@ opendir_check(const struct atf_tc *tc, DIR *dirp) ATF_CHECK_STREQ("subdir", ent->d_name); ATF_CHECK_EQ(DT_DIR, ent->d_type); ATF_CHECK(readdir(dirp) == NULL); + ATF_CHECK(readdir(dirp) == NULL); } ATF_TC(opendir_ok); diff --git a/lib/libc/tests/gen/scandir_test.c b/lib/libc/tests/gen/scandir_test.c index f7b52b5e3616..afd25bf7c0b2 100644 --- a/lib/libc/tests/gen/scandir_test.c +++ b/lib/libc/tests/gen/scandir_test.c @@ -157,7 +157,7 @@ ATF_TC_BODY(scandir_error, tc) { char path[16]; struct dirent **namelist = NULL; - int fd, i, ret; + int fd, i; ATF_REQUIRE_EQ(0, mkdir("dir", 0755)); for (i = 0; i < 1024; i++) { @@ -170,9 +170,8 @@ ATF_TC_BODY(scandir_error, tc) scandir_error_count = 0; scandir_error_fd = fd; scandir_error_select_return = 0; - ret = fdscandir(fd, &namelist, scandir_error_select, NULL); - ATF_CHECK_EQ(-1, ret); - ATF_CHECK_ERRNO(EBADF, ret < 0); + ATF_CHECK_ERRNO(EBADF, + fdscandir(fd, &namelist, scandir_error_select, NULL) < 0); ATF_CHECK_EQ(NULL, namelist); /* second pass, select everything */ @@ -180,9 +179,8 @@ ATF_TC_BODY(scandir_error, tc) scandir_error_count = 0; scandir_error_fd = fd; scandir_error_select_return = 1; - ret = fdscandir(fd, &namelist, scandir_error_select, NULL); - ATF_CHECK_EQ(-1, ret); - ATF_CHECK_ERRNO(EBADF, ret < 0); + ATF_CHECK_ERRNO(EBADF, + fdscandir(fd, &namelist, scandir_error_select, NULL) < 0); ATF_CHECK_EQ(NULL, namelist); } From nobody Fri Jul 11 22:26:32 2025 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 4bf5sj1G0nz60vrV for ; Fri, 11 Jul 2025 22:26:33 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bf5sh6dfmz4Ggc; Fri, 11 Jul 2025 22:26:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752272793; 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=06/j+B/4e+vg62poknfgDWmFtbZM0AjKkvXNNo7vmZg=; b=aanCdxC5TB4JKes3g0o66hsj+CuAXXKdDJtWHoJncs+8UykRhwE4n5CLsHrUs3n7Fb9T/x t6oeynXFPQeX7M2PUvMJjti/Yr/+F0E4ZbYJY22pX4Gken5dhEVrttJ+d9WgGUsdmfMaJM lXXDEvJwHLQiV7cgniLOloaKrxHHWWHGqT6tIibUPzue5+04YteH71ECa7B9CqXTFPiu4i xbsLkcQnnJOrlf2PAt8831oI/ijt7jOlSX235xCIuJzhS9olv9xOmNCuaGt+sWa5aNEdne /WZo6wA+f6/GyXWdL00teqoijfaZG7USskeO4yg9dhEqN7bEKOOyboBLfojz2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752272793; 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=06/j+B/4e+vg62poknfgDWmFtbZM0AjKkvXNNo7vmZg=; b=P5oosu2BwBSNbUbrHN0EoMKxCYJHO3pqKbjgKJ0rlY5u46Yp3HyX2T5ufBSScE9zRm6LsU SHmoG/mttso2I1F7Aia/VEqmZyLClVuipSQUyMGBPSC1NyNkaEsVY3GstYz7Mu/u17ILbP M6GDjcbCKmtuqhAiHYFmorlGSH7KmL8bp90uuknJyrg/T0mwHPCHniodJkjsP5vDWKHjcg bVyHbgwuGQRkVCaec2C+5kWNN4WribUlmnG11xKV1kvUT9p3gBOkvHBzkcsyNpyEjBjMJk yX7esrwy2K0DOdtgn4Ti93ifxfOT/0trEujKqspxN7+7UjDyahh6bjZQAAIMsA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752272793; a=rsa-sha256; cv=none; b=Jhwy+IP/xIFVz1Q/UpI8MKUrvps2G3o9Cl9aW4KMKPIqtjBGZ9mDJAkotud0wf+YcQJjrw POk0AsVgwiXh2sxaPHLlVvXcZgorEiTlFyD1DUfzKCXJGUfsi1fkUfpDO/yPiBGPxc2F4G RmW3J2z3TZ7rW5pUkFGk65gSKSRxy0McALocMZ3ObXc4FHe2sTFpGju7msMb+zP5iJLzUO YN9vu4rE11pSqWPVYEMyAVKm3QUA9PlglufL9Ly0efP8mt6S+3OE5Ku9mYld7Dom7wcToz cozWre18P/QTIqh5kBoBN9mcOTwpxhfbn6GM6vpGTgQHNycleWG0I2PLaCgajg== 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 4bf5sh695tzwhy; Fri, 11 Jul 2025 22:26:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56BMQWgn076865; Fri, 11 Jul 2025 22:26:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56BMQWtk076864; Fri, 11 Jul 2025 22:26:32 GMT (envelope-from git) Date: Fri, 11 Jul 2025 22:26:32 GMT Message-Id: <202507112226.56BMQWtk076864@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Enji Cooper Subject: git: e5f336beb676 - Create tag vendor/openssl/3.0.17 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ngie X-Git-Repository: src X-Git-Refname: refs/tags/vendor/openssl/3.0.17 X-Git-Reftype: annotated tag X-Git-Commit: e5f336beb67671532add0dfbb9771b4d86f196d5 Auto-Submitted: auto-generated The annotated tag vendor/openssl/3.0.17 has been created by ngie: URL: https://cgit.FreeBSD.org/src/tag/?h=vendor/openssl/3.0.17 tag vendor/openssl/3.0.17 Tagger: Enji Cooper TaggerDate: 2025-07-11 22:26:20 +0000 vendor/openssl: import OpenSSL 3.0.17 commit ecf8229ffeb17a05c78fab6b973b0cccb84e25c5 Author: Enji Cooper AuthorDate: 2025-07-11 00:18:38 +0000 Commit: Enji Cooper CommitDate: 2025-07-11 00:18:38 +0000 vendor/openssl: import OpenSSL 3.0.17 Per the upstream release notes, this is a ["bugfix release"](https://github.com/openssl/openssl/blob/openssl-3.0/CHANGES.md#openssl-30). It does not contain any security-critical bugfixes, unlike the most recent prior releases of OpenSSL 3.0. This release is not an immediate candidate for inclusion in 14.3-* releases. That being said, content from this release will potentially be rolled into upcoming releases by virtue of this being an iterative 3.0.x release. The changes may be benign, but some care might be required in the event that some of the bugfixes affect shipping code which requires behavior that may have been changed in this release. Obtained from: https://github.com/openssl/openssl/releases/download/openssl-3.0.17/openssl-3.0.17.tar.gz From nobody Fri Jul 11 23:55:45 2025 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 4bf7rf1p36z611mY; Fri, 11 Jul 2025 23:55:46 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bf7rf0xPjz3shm; Fri, 11 Jul 2025 23:55:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752278146; 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=r3dZWFGx50liWaEjz4EGdjXPLN8Ew9It7UGeN20oV+A=; b=I1et8Y0tLqSOjNoiht35AudbfyzvBE6fFHGgI2FxdFuzvC/Nc+kOYcbUm9dhUPmx1GStw2 LLiaDL7tt48FnUjXlpfL1LEpcIFVYJM5PbYDnfDcl+/Qih/w46obNQ5teChpCZJUpRvGoj I0T9O+348vV2ovggS+zfYq3CK5J4+Fq99YM9qn0f2puh1mcxs++ABeQPYKXDxoyixtYfcI MogSC/IaRx089JJn1lKxd9VeM9ducP/uiv+AIq5DIDJvcujw/0O7+oMqFM7U/Yqq8DqWhc p//ej8fMUuxOh1CVVb1AgRF4xozYRF42mG2ib87HPrxD2CMj17hd8fKAJH54UA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752278146; 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=r3dZWFGx50liWaEjz4EGdjXPLN8Ew9It7UGeN20oV+A=; b=mxZDJnpCbL64QFfdqgciqidGqLbP99X0INitnis+vGhXh4QTZkat8oUUPdwd2u/DccpTRi x3BtSu9BypQc26xKZrRYMMV+cX/l5NWLhWC+lJnqtb9ebQtAuOjbs8Kgbuyl7G7cEDUM8u JFPtHHkW39rV0QkTDCiIWGxlWR3GBmcb9QxfYnOCGysFn6GAz9t9LDYz45Hol8xi56KQEZ YtBYKFJseTEu3dY/z1LTAgAN71QFIxOzXcaNDMYWUmecsZu6DqKECsFurQbgPaHfq/Uou/ 6RWneUWEE+ks0ZiFRF/0RxZQd5vIp6HqHGvnNxmJGz8+iRu5SRVJrsUZ2YrIhw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752278146; a=rsa-sha256; cv=none; b=rayDYGLqR865LfoT+ghJcVe/Vzud3z355K0Ux1krNoLC+T12mMOfgUcNYpb57qceoAmGrA u6Np8kvXeyr7111JhtBrfS4aTNlEvWt7TQGEQEWJ0vRBxrqtO5Y0pSaNfSFDgC7p2k5IlY GYhi8KOk7Z/bC7P+m0q2vYCyeEjzEGbeKcGVfwI817MSYaMm4yapvlTBI+FQDrDI6+E8SN +ezYt9jlFYNZ60/2lyhF5JXJzvyIKiC2BbhNKP/WUAVxUBG5Qkad4Sw6G6WTYHxlb7piBz eMCh0ZvhKTaCCAbpiCFrEpEOTs415gTEi9sSIcAtKn5RuJSTEoL+4A2eLijDuw== 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 4bf7rf02nwzyhN; Fri, 11 Jul 2025 23:55:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56BNtjkd044769; Fri, 11 Jul 2025 23:55:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56BNtjLF044766; Fri, 11 Jul 2025 23:55:45 GMT (envelope-from git) Date: Fri, 11 Jul 2025 23:55:45 GMT Message-Id: <202507112355.56BNtjLF044766@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Koichiro Iwao Subject: git: cca6a72d7f71 - main - ifconfig.8: remove accept_rev_ethip_ver and send_rev_ethip_ver 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: meta X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cca6a72d7f7131685a082c123aff17208aa1693f Auto-Submitted: auto-generated The branch main has been updated by meta: URL: https://cgit.FreeBSD.org/src/commit/?id=cca6a72d7f7131685a082c123aff17208aa1693f commit cca6a72d7f7131685a082c123aff17208aa1693f Author: Koichiro Iwao AuthorDate: 2025-07-11 12:06:34 +0000 Commit: Koichiro Iwao CommitDate: 2025-07-11 23:54:40 +0000 ifconfig.8: remove accept_rev_ethip_ver and send_rev_ethip_ver It is removed long ago [1] and unavailable on FreeBSD 11 and later, but the corresponding entries in the man page were not removed accordingly. [1] https://cgit.freebsd.org/src/commit/?id=b1c250ff3ff6af36e95f5cf910973133c3445704 MFH after: 3 days Reviewed by: mhorne Approved by: mhorne Differential Revision: https://reviews.freebsd.org/D51261 --- sbin/ifconfig/ifconfig.8 | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/sbin/ifconfig/ifconfig.8 b/sbin/ifconfig/ifconfig.8 index 3fb8b5f02b76..6c61af48abec 100644 --- a/sbin/ifconfig/ifconfig.8 +++ b/sbin/ifconfig/ifconfig.8 @@ -28,7 +28,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd July 5, 2025 +.Dd July 11, 2025 .Dt IFCONFIG 8 .Os .Sh NAME @@ -2878,16 +2878,6 @@ interfaces previously configured with Another name for the .Fl tunnel parameter. -.It Cm accept_rev_ethip_ver -Set a flag to accept both correct EtherIP packets and ones -with reversed version field. -Enabled by default. -This is for backward compatibility with -.Fx 6.1 , -6.2, 6.3, 7.0, and 7.1. -.It Cm -accept_rev_ethip_ver -Clear a flag -.Cm accept_rev_ethip_ver . .It Cm ignore_source Set a flag to accept encapsulated packets destined to this host independently from source address. @@ -2896,16 +2886,6 @@ from the load balancers. .It Cm -ignore_source Clear a flag .Cm ignore_source . -.It Cm send_rev_ethip_ver -Set a flag to send EtherIP packets with reversed version -field intentionally. -Disabled by default. -This is for backward compatibility with -.Fx 6.1 , -6.2, 6.3, 7.0, and 7.1. -.It Cm -send_rev_ethip_ver -Clear a flag -.Cm send_rev_ethip_ver . .El .Ss GRE Tunnel Parameters The following parameters apply to GRE tunnel interfaces, From nobody Sat Jul 12 01:44:18 2025 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 4bfBFv1TLvz617qh; Sat, 12 Jul 2025 01:44:19 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bfBFt5kxlz3Fwv; Sat, 12 Jul 2025 01:44:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752284658; 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=BE7K0fXIJZo2dxhER4D2QLrxVjP+Hqud/eOduSda3rg=; b=cuf1XsurA9VNRRs3Wn/+T8LTiur4bQy4UfQZANoRyoQYdzrjgK/XUDL22BtX9JyUjm/+Gs WzK2f/mDB/HJlpxv/IIr2Qg7aPytSz6LSmCWlkFafFCH/WhtGAEawniUt+cDlEr8yHqUFM 7rDU3EP8aI0ckKTdB5G5PpsX7Xw9Adh6UZJ3F4GAGf10Ft6WYoH5OE6YZpLUpAlZcwZpbM FRIMdaSdQgf/ZkMBgJEBZGnBThwzNsPYY14oc5qh1psztOrCli+OA2MB5Ml/YyZgFzePYc AjYzx6bClutjxO7+IDFuNKV7wHrfXVF4HAhSOC4UcH2CpflXtOjwN3+yJBY8aQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752284658; 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=BE7K0fXIJZo2dxhER4D2QLrxVjP+Hqud/eOduSda3rg=; b=cGf3T+Gg2+FU36fBoLjtnui0EX83aBzXYcCbjgWNPKKk5dhSRbvBku+r154W9ppcsfCraC Xcw03oDwfDCiDijaz26Na44askQNpQwdmW5d0eKUiVoJiugJ3yenm5xT+VLyWLmukrGqIk lW1gA4hyW5bP+kAc2JXnyMO1aDY3OrAcstM0zBXH5s7DvfKswQeV3L6SoYhURh3pVzOtzy SutTiIkloMBdpeBvMo+5x3crqSUkOtj35WeZZvzWeL0GCI2ng8e+jGUKAepTA3rw1dQ6Te TTH2EAx1qV0Xj/4liLqSVyH0rTmBQtr9Yn+2Y1FDksZIiK7NlNXEDw8G8LUvow== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752284658; a=rsa-sha256; cv=none; b=DS231XEhxRhiPuaPmvSoBx6i3NhWhMaT0H6r0iBL5w3giAIyFaANZggW40djDFSspi7M2I IczlDZwiXM8RM91UnA4VQvJg5Nrl/1NMfIuF+mSflfFBKlusy+aa7kuCJXia0kJegN64wK 5tWkdgxlle5I7Ghk+HSCeplvZOLwfg7GvEpEDwUYQ2CFDYaAtdYKrQa6Vyytal2KoxpD/q cJzDVEyk77lsPNZT2Kj2s5ypvZs6fpbMRvsipyDDZ8woY067ovK0dd9B3UjJ7/r+2X3E3F NZ/LQmlPRLPl05wbbSY47SOe8FOC3AS/10jNgq0SII52GZaySMP3CAkj8XNK0g== 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 4bfBFt4xzvz127C; Sat, 12 Jul 2025 01:44:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56C1iIjR050465; Sat, 12 Jul 2025 01:44:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56C1iIEf050462; Sat, 12 Jul 2025 01:44:18 GMT (envelope-from git) Date: Sat, 12 Jul 2025 01:44:18 GMT Message-Id: <202507120144.56C1iIEf050462@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 4c82dff1082b - stable/14 - dev/mem: use sx instead of rw lock 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4c82dff1082bc1f8e7d6ae69a3ecd2cc97c2e758 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=4c82dff1082bc1f8e7d6ae69a3ecd2cc97c2e758 commit 4c82dff1082bc1f8e7d6ae69a3ecd2cc97c2e758 Author: Konstantin Belousov AuthorDate: 2025-06-22 16:35:23 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-12 01:41:32 +0000 dev/mem: use sx instead of rw lock (cherry picked from commit ca554a7dea3f90f39fc2b7d25813d0be944e12e2) --- sys/dev/mem/memutil.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/sys/dev/mem/memutil.c b/sys/dev/mem/memutil.c index 8f296520c348..20ce337df0ab 100644 --- a/sys/dev/mem/memutil.c +++ b/sys/dev/mem/memutil.c @@ -26,16 +26,14 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include -#include +#include #include #include #include #include -#include -#include +#include -static struct rwlock mr_lock; +static struct sx mr_lock; /* * Implementation-neutral, kernel-callable functions for manipulating @@ -47,7 +45,7 @@ mem_range_init(void) if (mem_range_softc.mr_op == NULL) return; - rw_init(&mr_lock, "memrange"); + sx_init(&mr_lock, "memrange"); mem_range_softc.mr_op->init(&mem_range_softc); } @@ -57,7 +55,7 @@ mem_range_destroy(void) if (mem_range_softc.mr_op == NULL) return; - rw_destroy(&mr_lock); + sx_destroy(&mr_lock); } int @@ -68,12 +66,12 @@ mem_range_attr_get(struct mem_range_desc *mrd, int *arg) if (mem_range_softc.mr_op == NULL) return (EOPNOTSUPP); nd = *arg; - rw_rlock(&mr_lock); + sx_slock(&mr_lock); if (nd == 0) *arg = mem_range_softc.mr_ndesc; else bcopy(mem_range_softc.mr_desc, mrd, nd * sizeof(*mrd)); - rw_runlock(&mr_lock); + sx_sunlock(&mr_lock); return (0); } @@ -84,8 +82,8 @@ mem_range_attr_set(struct mem_range_desc *mrd, int *arg) if (mem_range_softc.mr_op == NULL) return (EOPNOTSUPP); - rw_wlock(&mr_lock); + sx_xlock(&mr_lock); ret = mem_range_softc.mr_op->set(&mem_range_softc, mrd, arg); - rw_wunlock(&mr_lock); + sx_xunlock(&mr_lock); return (ret); } From nobody Sat Jul 12 01:44:19 2025 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 4bfBFw2NM1z617kM; Sat, 12 Jul 2025 01:44:20 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bfBFv65whz3G6r; Sat, 12 Jul 2025 01:44:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752284659; 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=zqR/dZwEtJK+grVhFW73GkA7Yck5Tc0+L7qRGwdV2X8=; b=Sfyu57w2Pg0OKNh4G7lXTlplUbRcuou6Ds0S4hWPVlTVFMeoDDBdFm7+3eS+A+pmxJwXmu xulVTinQCJLM056z2qmcJxdaBRb7+pa6+ReioMPFoZxrrYS31612f2djJeM1PbZOIStFz0 nKk0MT3yDip7jagZMxYpu6h8DJApfPqFeXeh8FJoNCxbBhmFh3uhuBim7gdiN20oJrM77X u/hoE52q2eg3ZNwy+x/AF2hngzCwoOP/xWtS34fXurtRPuDgCFRumuUXu8wKgerf37wUzc lVwQv47q4qQq0XfT3t8Clxc5sV4XywWdqALgNgcFnXmos1ZmGvs8RQpX5j6tZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752284659; 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=zqR/dZwEtJK+grVhFW73GkA7Yck5Tc0+L7qRGwdV2X8=; b=NHl9WDbVvjQE5W99cRouAu8Q10T4vP32qQ2NJd7Sw/fKIWSXt4TR89J7DHTAAoBZQvDC2l VePUAx3AXCdU4xmzwfkHgazdZMK9OqUSfyaOnMHEw9P9lCRKOJj25SD2IYLWf6QKdqItGB MAeF/1b0jUVM8bq1ukDtFdAbU1Dqdnqk1lbN0JLYFSI0ogvHQowuLKSdQvbVbuDKPTP+wQ TpImsD4PtcdpWG8W02zcAr45RJA8WtMVF31AKGNK2ewWgcG0vMWkBbKs6XdgKItMZqm1PC MnoMfcVRWGmiRAfg3Zz3fWPVsg39QTcC7enlOr4IkiIcBIN+4yXawnvSiZZyIw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752284659; a=rsa-sha256; cv=none; b=btNBBxz/qCge6niLcQowJvU1U1F5dSpG0QvlI/aFOMEVAi/imDq6UixSGT7eABdy6oYgE3 f07b8fJ3VoPHZ8elerApWkVGjhLBrqpnCnBXqP5GhrBfmDnE5bWVC49CXxqtuGZjttAZCQ TUtvsfo6tqEaVElt8TLt+LNcPWb3EL0edfuHWln08Cg4ZD6O2zS0va+wfhrHgec/dPHtf4 7mrSH2J4HHVCCVQezfDoBLi5zJ43dFMv1y3GnrE5Ng8qYJ5gFHRZlA4an3QJ/IT10kkJ7m 5Ex1QhopXs+wPiElw6a3BKiqKOhliSAbTGkpoJUx9h+O5JI46mHqvmghGgQZpQ== 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 4bfBFv5Xgqz129w; Sat, 12 Jul 2025 01:44:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56C1iJMD050500; Sat, 12 Jul 2025 01:44:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56C1iJ5H050497; Sat, 12 Jul 2025 01:44:19 GMT (envelope-from git) Date: Sat, 12 Jul 2025 01:44:19 GMT Message-Id: <202507120144.56C1iJ5H050497@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: e02ab0b92fe2 - stable/14 - amd64 pmap: preallocate pt page for pmap_demote_pdpe() in pmap_demote_DMAP() 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e02ab0b92fe253fba7052f5cd14a0a42a4bea76a Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e02ab0b92fe253fba7052f5cd14a0a42a4bea76a commit e02ab0b92fe253fba7052f5cd14a0a42a4bea76a Author: Konstantin Belousov AuthorDate: 2025-06-22 03:38:12 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-12 01:41:32 +0000 amd64 pmap: preallocate pt page for pmap_demote_pdpe() in pmap_demote_DMAP() (cherry picked from commit 6eb141a2c4731130bfac670708a8b90f7cdff742) --- sys/amd64/amd64/pmap.c | 53 ++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 38 insertions(+), 15 deletions(-) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 84cab304af6d..6259ad33c6a1 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -1303,8 +1303,8 @@ static int pmap_change_props_locked(vm_offset_t va, vm_size_t size, static boolean_t pmap_demote_pde(pmap_t pmap, pd_entry_t *pde, vm_offset_t va); static boolean_t pmap_demote_pde_locked(pmap_t pmap, pd_entry_t *pde, vm_offset_t va, struct rwlock **lockp); -static boolean_t pmap_demote_pdpe(pmap_t pmap, pdp_entry_t *pdpe, - vm_offset_t va); +static bool pmap_demote_pdpe(pmap_t pmap, pdp_entry_t *pdpe, + vm_offset_t va, vm_page_t m); static int pmap_enter_2mpage(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot, struct rwlock **lockp); static int pmap_enter_pde(pmap_t pmap, vm_offset_t va, pd_entry_t newpde, @@ -9529,8 +9529,8 @@ pmap_unmapdev(void *p, vm_size_t size) /* * Tries to demote a 1GB page mapping. */ -static boolean_t -pmap_demote_pdpe(pmap_t pmap, pdp_entry_t *pdpe, vm_offset_t va) +static bool +pmap_demote_pdpe(pmap_t pmap, pdp_entry_t *pdpe, vm_offset_t va, vm_page_t m) { pdp_entry_t newpdpe, oldpdpe; pd_entry_t *firstpde, newpde, *pde; @@ -9547,12 +9547,19 @@ pmap_demote_pdpe(pmap_t pmap, pdp_entry_t *pdpe, vm_offset_t va) oldpdpe = *pdpe; KASSERT((oldpdpe & (PG_PS | PG_V)) == (PG_PS | PG_V), ("pmap_demote_pdpe: oldpdpe is missing PG_PS and/or PG_V")); - pdpg = pmap_alloc_pt_page(pmap, va >> PDPSHIFT, - VM_ALLOC_WIRED | VM_ALLOC_INTERRUPT); - if (pdpg == NULL) { - CTR2(KTR_PMAP, "pmap_demote_pdpe: failure for va %#lx" - " in pmap %p", va, pmap); - return (FALSE); + if (m == NULL) { + pdpg = pmap_alloc_pt_page(pmap, va >> PDPSHIFT, + VM_ALLOC_WIRED); + if (pdpg == NULL) { + CTR2(KTR_PMAP, + "pmap_demote_pdpe: failure for va %#lx in pmap %p", + va, pmap); + return (false); + } + } else { + pdpg = m; + pdpg->pindex = va >> PDPSHIFT; + pmap_pt_page_count_adj(pmap, 1); } pdpgpa = VM_PAGE_TO_PHYS(pdpg); firstpde = (pd_entry_t *)PHYS_TO_DMAP(pdpgpa); @@ -9762,7 +9769,7 @@ pmap_change_props_locked(vm_offset_t va, vm_size_t size, vm_prot_t prot, tmpva += NBPDP; continue; } - if (!pmap_demote_pdpe(kernel_pmap, pdpe, tmpva)) + if (!pmap_demote_pdpe(kernel_pmap, pdpe, tmpva, NULL)) return (ENOMEM); } pde = pmap_pdpe_to_pde(pdpe, tmpva); @@ -9931,25 +9938,37 @@ pmap_demote_DMAP(vm_paddr_t base, vm_size_t len, boolean_t invalidate) { pdp_entry_t *pdpe; pd_entry_t *pde; + vm_page_t m; vm_offset_t va; - boolean_t changed; + bool changed; if (len == 0) return; KASSERT(powerof2(len), ("pmap_demote_DMAP: len is not a power of 2")); KASSERT((base & (len - 1)) == 0, ("pmap_demote_DMAP: base is not a multiple of len")); + WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, "pmap_demote_DMAP"); + if (len < NBPDP && base < dmaplimit) { va = PHYS_TO_DMAP(base); - changed = FALSE; + changed = false; + + /* + * Assume that it is fine to sleep there. + * The only existing caller of pmap_demote_DMAP() is the + * x86_mr_split_dmap() function. + */ + m = vm_page_alloc_noobj(VM_ALLOC_WIRED | VM_ALLOC_WAITOK); + PMAP_LOCK(kernel_pmap); pdpe = pmap_pdpe(kernel_pmap, va); if ((*pdpe & X86_PG_V) == 0) panic("pmap_demote_DMAP: invalid PDPE"); if ((*pdpe & PG_PS) != 0) { - if (!pmap_demote_pdpe(kernel_pmap, pdpe, va)) + if (!pmap_demote_pdpe(kernel_pmap, pdpe, va, m)) panic("pmap_demote_DMAP: PDPE failed"); - changed = TRUE; + changed = true; + m = NULL; } if (len < NBPDR) { pde = pmap_pdpe_to_pde(pdpe, va); @@ -9964,6 +9983,10 @@ pmap_demote_DMAP(vm_paddr_t base, vm_size_t len, boolean_t invalidate) if (changed && invalidate) pmap_invalidate_page(kernel_pmap, va); PMAP_UNLOCK(kernel_pmap); + if (m != NULL) { + vm_page_unwire_noq(m); + vm_page_free(m); + } } } From nobody Sat Jul 12 01:44:20 2025 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 4bfBFx1w6Zz617hc; Sat, 12 Jul 2025 01:44:21 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bfBFw6dnGz3G20; Sat, 12 Jul 2025 01:44:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752284661; 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=onrfvQJLWpIbFFxkeHR4DxzV8PtRUcD9xfOWOA+l1yM=; b=yAS+5HGDEsV3xwKfsJ7GkIMpMhNh54ICb+zTMqCjEMCr9mJnmqehrNsYMcs8/xOgEGOB5W 3bSOgSS/RfQp/WLuoihPqvaWW368oZQQ3s/HNt2hdGHNwk1nL2GQ712xxOmbQlEUDQD3XQ rQGrKNWUBTsEs5hMRVHoKRj8ik5cVLOhy5JAr9PVPs2AZ4430fbXVbITfTQIzYhG5+izHN uMDoZT4WsX5dWKZy+G2wHLbUmcjXfsV0Q8Z3+IXYmZqAVARPMm3M8ziyPCZgTiYTUAFgzi NaDCe/zVGYNsdc/ItixTKWLOb6DPRjf//aznSsqIJIc9ACzwt2yBxY0EyIviNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752284661; 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=onrfvQJLWpIbFFxkeHR4DxzV8PtRUcD9xfOWOA+l1yM=; b=v319P2AN7/sEdcIDNn+VOLL6M4Jkvsat0spIhbJe3ozEcGzWs/04OT/zsAyyOSQl+dDFwl T02FAfkhSVsMylBrEYhKwBWZ/6apMCg6uuolSXqBKVfJrDmo+3VNY2lUbvg/r3s5kZNuUn raYb/g1h8J9XEDViGQcAX14/8NzvNvJ1csJHOPlxc/05HDc1STDfpjxDukRuhc/2wVEizP 8lIp9JzLdYtj7JNNXYnpfCNTVrkjMNofk2Hxo5jx6nTMXQ98xCq/YI6BAmXVn7NVGzDF5e rJuNT/LeWKuV6dGbNct8UuM0DZcswKZGSuCr2niSeJcCvIHDSCV3HmT4bPojaw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752284661; a=rsa-sha256; cv=none; b=OKi1I1E8NeyRkmk0Ntug+GlP9HHM6mIkAGTFHgUOtEiGhPVxgY2hrkBIIUUrrjkIFYv6ZC MwKy0zzEHmzcdz69R8mChVMUtD7f5ZCa8YROjAeu3C/dY5KxWtW6SLc+dxJA3CPufOoppg i7vcKCRo4VjA+oqRIFDtdUqU6g3tJsvhWiBccsb7njDomPxqHgL2pgTwAJdW0Vq2mtO2RE FSK67VcOu56qU2Z8Xp02QL2cIJP2uAp53nPyV2GC+oL2lpenCEy001u1VpLbGu1dsMhTlZ oP/kcpYTPCbc3bsFbM53SFQwk/STwSc9I+diKFN2WxGiuCjzDX9pfY4xst96jA== 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 4bfBFw68W5z11yc; Sat, 12 Jul 2025 01:44:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56C1iK4a050538; Sat, 12 Jul 2025 01:44:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56C1iKqG050535; Sat, 12 Jul 2025 01:44:20 GMT (envelope-from git) Date: Sat, 12 Jul 2025 01:44:20 GMT Message-Id: <202507120144.56C1iKqG050535@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 7b2ec2a56215 - stable/14 - amd64 pmap: update comment in pmap_demote_DMAP() explaining the len List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7b2ec2a562154c84f79140f1b174f649bfa0752f Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=7b2ec2a562154c84f79140f1b174f649bfa0752f commit 7b2ec2a562154c84f79140f1b174f649bfa0752f Author: Konstantin Belousov AuthorDate: 2025-06-22 16:49:45 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-12 01:41:33 +0000 amd64 pmap: update comment in pmap_demote_DMAP() explaining the len NBPDP. Since the demotion does not + * change any attributes of the mapping, a TLB invalidation is not + * mandatory. The caller may, however, request a TLB invalidation. */ void pmap_demote_DMAP(vm_paddr_t base, vm_size_t len, boolean_t invalidate) From nobody Sat Jul 12 01:44:21 2025 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 4bfBFy4P17z617kN; Sat, 12 Jul 2025 01:44:22 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bfBFy1mWjz3G95; Sat, 12 Jul 2025 01:44:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752284662; 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=cKDxC0JtH0QqFvryF04FXBIC12ze/kfTfW8AERDpS8g=; b=tjvLLOoCKPFCJiOuyiJuwo2SD8v2WXxYImNxnq3YoFLtJ0EIx2rztrYiyiiKJDvVA5w7tq 5WjNI33Ps//ea9TuODXa2ATpr/5185mIlBViD3oNuV0JUmBbD4NOpLyjwpwabdgAsAyg+a 5AK0qnXquxNq2RAoGo5jXWWvNDGCpfIK746IsuA2yXx+WdoKpWnu3PWqo8p45ncyTHnYa4 ldFNE2ofe03hKOB+Y/wlbi5RQfODErzWaL8zehqPNrrZo3Ji8PVjZoN9NcMZjD28MGJkyY welp9mR8Zz2XoGQTfz/0g7vXucQtvHP0MTAgrCFN0UKW74p9/iVkkqs4w+YLtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752284662; 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=cKDxC0JtH0QqFvryF04FXBIC12ze/kfTfW8AERDpS8g=; b=vjkX3SxA9jsI3iUzXVvT2pTtaS5/S0znmg1wlSgKAZiAurymXFGwLjikxbw3mHV3L0YSq2 yz5tf/gIS/tA1ABEQcKUqh+SIoj63t5YEPPw+stojn+E8PDwgR3mutPTMdy1cltZzKLJn4 lFu/Hh7eezAVk39oOJ3GIr/Wvg3Fw3uOnu5YQhANszq9gQtdPjpdPrN38s1Qd/jOlrD8J6 zUcQ3+wnATgBPV8eu9mOrox06GRrgYTW5d/LlApggB3ZbHllq8drU21sQ1NwTaL5XEPAlr Za1SRAlH5s87cnxFO5xnXiY/S/JWCpWLYSIHu2taxuwfdJTB+UhTX7+95tIwZQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752284662; a=rsa-sha256; cv=none; b=SmmhkZ7ZZaVtpZXOoebZHlNlhWkOmqibEm7PMpdeXbjNpZMbYodZTHIBV+TsvIYNF6tOz/ CGGmGv6//yJtEXmmIki+3UJ6NrgloWb8uSGbqMjhU/ARG2N3A5jYAACU+wLgP5gSNn+nX2 shZwkxfCjncBKmSvsad7l+wia/t57tDsO5tZIKzPVU8J5c3cCF3f7F4d/xqZ99H3C3TzaR 1tp96b6PMEsOt2vmVRyh/iQliovpsXNi10wlAOuSoQOI0pnO1YBCIzMIVbDjypKNO43gRy GWtDyg0laM5N3dmeAqipeFnPsrsxFecQ6H9rmeCFJvQ72doST6Xj90FDkkNcgw== 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 4bfBFy0MMrz12Cv; Sat, 12 Jul 2025 01:44:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56C1iLbf050571; Sat, 12 Jul 2025 01:44:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56C1iLnF050568; Sat, 12 Jul 2025 01:44:21 GMT (envelope-from git) Date: Sat, 12 Jul 2025 01:44:21 GMT Message-Id: <202507120144.56C1iLnF050568@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: dcb7a2befdeb - stable/14 - amd64 pmap: do not panic on inability to insert ptp into trie 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: dcb7a2befdeb26a3a7ed9e4f66ae649fc8266581 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=dcb7a2befdeb26a3a7ed9e4f66ae649fc8266581 commit dcb7a2befdeb26a3a7ed9e4f66ae649fc8266581 Author: Konstantin Belousov AuthorDate: 2025-06-24 22:58:32 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-12 01:41:34 +0000 amd64 pmap: do not panic on inability to insert ptp into trie (cherry picked from commit 476d2d8f290f60cbbe6b546272a3485ef0316356) --- sys/amd64/amd64/pmap.c | 54 ++++++++++++++++++++++++++++++++++---------------- 1 file changed, 37 insertions(+), 17 deletions(-) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 77a836df46ad..34c7c1c94737 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -1336,7 +1336,7 @@ static pdp_entry_t *pmap_pti_pdpe(vm_offset_t va); static pd_entry_t *pmap_pti_pde(vm_offset_t va); static void pmap_pti_wire_pte(void *pte); static int pmap_remove_pde(pmap_t pmap, pd_entry_t *pdq, vm_offset_t sva, - struct spglist *free, struct rwlock **lockp); + bool remove_pt, struct spglist *free, struct rwlock **lockp); static int pmap_remove_pte(pmap_t pmap, pt_entry_t *ptq, vm_offset_t sva, pd_entry_t ptepde, struct spglist *free, struct rwlock **lockp); static vm_page_t pmap_remove_pt_page(pmap_t pmap, vm_offset_t va); @@ -5996,7 +5996,7 @@ pmap_demote_pde_abort(pmap_t pmap, vm_offset_t va, pd_entry_t *pde, SLIST_INIT(&free); sva = trunc_2mpage(va); - pmap_remove_pde(pmap, pde, sva, &free, lockp); + pmap_remove_pde(pmap, pde, sva, true, &free, lockp); if ((oldpde & pmap_global_bit(pmap)) == 0) pmap_invalidate_pde_page(pmap, sva, oldpde); vm_page_free_pages_toq(&free, true); @@ -6150,7 +6150,8 @@ pmap_demote_pde_locked(pmap_t pmap, pd_entry_t *pde, vm_offset_t va, * pmap_remove_kernel_pde: Remove a kernel superpage mapping. */ static void -pmap_remove_kernel_pde(pmap_t pmap, pd_entry_t *pde, vm_offset_t va) +pmap_remove_kernel_pde(pmap_t pmap, pd_entry_t *pde, vm_offset_t va, + bool remove_pt) { pd_entry_t newpde; vm_paddr_t mptepa; @@ -6158,7 +6159,10 @@ pmap_remove_kernel_pde(pmap_t pmap, pd_entry_t *pde, vm_offset_t va) KASSERT(pmap == kernel_pmap, ("pmap %p is not kernel_pmap", pmap)); PMAP_LOCK_ASSERT(pmap, MA_OWNED); - mpte = pmap_remove_pt_page(pmap, va); + if (remove_pt) + mpte = pmap_remove_pt_page(pmap, va); + else + mpte = vm_radix_lookup(&pmap->pm_root, pmap_pde_pindex(va)); if (mpte == NULL) panic("pmap_remove_kernel_pde: Missing pt page."); @@ -6190,7 +6194,7 @@ pmap_remove_kernel_pde(pmap_t pmap, pd_entry_t *pde, vm_offset_t va) * pmap_remove_pde: do the things to unmap a superpage in a process */ static int -pmap_remove_pde(pmap_t pmap, pd_entry_t *pdq, vm_offset_t sva, +pmap_remove_pde(pmap_t pmap, pd_entry_t *pdq, vm_offset_t sva, bool remove_pt, struct spglist *free, struct rwlock **lockp) { struct md_page *pvh; @@ -6231,7 +6235,7 @@ pmap_remove_pde(pmap_t pmap, pd_entry_t *pdq, vm_offset_t sva, } } if (pmap == kernel_pmap) { - pmap_remove_kernel_pde(pmap, pdq, sva); + pmap_remove_kernel_pde(pmap, pdq, sva, remove_pt); } else { mpte = pmap_remove_pt_page(pmap, sva); if (mpte != NULL) { @@ -6473,7 +6477,8 @@ pmap_remove1(pmap_t pmap, vm_offset_t sva, vm_offset_t eva, bool map_delete) */ if ((ptpaddr & PG_G) == 0) anyvalid = 1; - pmap_remove_pde(pmap, pde, sva, &free, &lock); + pmap_remove_pde(pmap, pde, sva, true, &free, + &lock); continue; } else if (!pmap_demote_pde_locked(pmap, pde, sva, &lock)) { @@ -7542,13 +7547,36 @@ pmap_enter_pde(pmap_t pmap, vm_offset_t va, pd_entry_t newpde, u_int flags, /* * The reference to the PD page that was acquired by * pmap_alloc_pde() ensures that it won't be freed. - * However, if the PDE resulted from a promotion, then + * However, if the PDE resulted from a promotion, and + * the mapping is not from kernel_pmap, then * a reserved PT page could be freed. */ - (void)pmap_remove_pde(pmap, pde, va, &free, lockp); + (void)pmap_remove_pde(pmap, pde, va, + pmap != kernel_pmap, &free, lockp); if ((oldpde & PG_G) == 0) pmap_invalidate_pde_page(pmap, va, oldpde); } else { + if (va >= VM_MAXUSER_ADDRESS) { + /* + * Try to save the ptp in the trie + * before any changes to mappings are + * made. Abort on failure. + */ + mt = PHYS_TO_VM_PAGE(*pde & PG_FRAME); + if (pmap_insert_pt_page(pmap, mt, false, false)) { + if (pdpg != NULL) + pdpg->ref_count--; + CTR1(KTR_PMAP, + "pmap_enter_pde: cannot ins kern ptp va %#lx", + va); + return (KERN_RESOURCE_SHORTAGE); + } + /* + * Both pmap_remove_pde() and + * pmap_remove_ptes() will zero-fill + * the kernel page table page. + */ + } pmap_delayed_invl_start(); if (pmap_remove_ptes(pmap, va, va + NBPDR, pde, &free, lockp)) @@ -7562,14 +7590,6 @@ pmap_enter_pde(pmap_t pmap, vm_offset_t va, pd_entry_t newpde, u_int flags, } else { KASSERT(SLIST_EMPTY(&free), ("pmap_enter_pde: freed kernel page table page")); - - /* - * Both pmap_remove_pde() and pmap_remove_ptes() will - * leave the kernel page table page zero filled. - */ - mt = PHYS_TO_VM_PAGE(*pde & PG_FRAME); - if (pmap_insert_pt_page(pmap, mt, false, false)) - panic("pmap_enter_pde: trie insert failed"); } } From nobody Sat Jul 12 01:44:23 2025 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 4bfBFz33phz617qk; Sat, 12 Jul 2025 01:44:23 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bfBFz1lkNz3G9B; Sat, 12 Jul 2025 01:44:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752284663; 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=ac0U/ggDN+Xer4qOJ14Q3t626aesOFImxP/8fFzm6gI=; b=sghNFJyYPPKKfXCyi6LK4VaZICNsXWh3eSC4vf148d3bpakZaNEWAtlx5TxAR3KmWRkOCU wMEtBWRkDgNEh+Urnp3yqNLhFRzBVOWsHYa8vKJcK5HEzxSDG+kFkkdRWV4Mg+N6TpqDKC uX7XeXJmb68S343tV2uLlLZCN6o0w9KMZVjmvmcUxq6N2a/j9kcgZmqLyC2HX23JOuKfAq EGI99JYcqGKKaCakS6FvPf7bEIKn/Jfl/IoBUcfU+29tMloFwEDByTsmsSvbvtSlchvjAk bIZwdX3FFfYEhUjoqbAD/IKTvvb2aCLpwPrvH8nAYLfWfau2sqkHQO+jJG8lTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752284663; 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=ac0U/ggDN+Xer4qOJ14Q3t626aesOFImxP/8fFzm6gI=; b=C7NhFK2lgbQ6CZf1OH9EZ1j4n8wvHAVJt0/2MPEVSJyEz3tENtT4NUhXjUl6eP6FQ/5YsQ ug63Wj1+1c2sNDZfxc+ttJhiZCApEi4wUXWJpxtydaH/m8diG6ZoFOXg7ALW/a+vnKTlzV elLeeOPby1Og7Kj+m8FlSgbP8/cx2YoLU+/uV0JkG6OVDkCiICRIwvCzCoGnDVVMO1tMLA cKKJzRqXuAXWK6W0RCjedXu4TW0hm1ISQYT1Zllmd1AmzH4cnHiTKcaAwekHyEBDrCe2SL YYVnQeYeLPzYeJbyEUu21fS6Ki2nBjbHooV9C6jb7nd5VPdquENyG4ra5Xly+A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752284663; a=rsa-sha256; cv=none; b=ps28V7GNbFuvuR0zkr9JXAGyiHi+1OVJYzaLVl7EUXLCw0kx9sUx5QoxJVaFLFAVQ7fNIt VAPEQKK74iZpW38VMeZfjEbSy7tZfL9Mb2GH81msBK+6wly7VKeqRykiphIihXwSirvSkh YwGVShHYBkzwa8fcCc3idPKGTzvyQ8sqclasDhFVJE2TzUto/RnEh5aVR6DUsunO1VB4qO rn0IfiQkuOyeMBdLSUpW5iRZ4OBptTA/NavtdxorPjSznS0FCkkcfTHPjuj6rBMbP3D4Ld Yxpr3ndzuv5JlxLbM+ynch3sbLPSo0eK8oBPIkYwQA1FW8y8vcFMP8ziKQsT4g== 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 4bfBFz1KVVz12Cw; Sat, 12 Jul 2025 01:44:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56C1iNJW050604; Sat, 12 Jul 2025 01:44:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56C1iNZF050601; Sat, 12 Jul 2025 01:44:23 GMT (envelope-from git) Date: Sat, 12 Jul 2025 01:44:23 GMT Message-Id: <202507120144.56C1iNZF050601@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 48172ad390f7 - stable/14 - aio: make aio_init_aioinfo() and aio_aqueue() static 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 48172ad390f7be9a0c6b6c141cdc266304157ca8 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=48172ad390f7be9a0c6b6c141cdc266304157ca8 commit 48172ad390f7be9a0c6b6c141cdc266304157ca8 Author: Konstantin Belousov AuthorDate: 2025-07-04 18:32:01 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-12 01:41:34 +0000 aio: make aio_init_aioinfo() and aio_aqueue() static (cherry picked from commit c44439942cdb56cad8c7630444ff84447ca3866a) --- sys/kern/vfs_aio.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/kern/vfs_aio.c b/sys/kern/vfs_aio.c index 291ac46babef..91137fa1e0dd 100644 --- a/sys/kern/vfs_aio.c +++ b/sys/kern/vfs_aio.c @@ -309,7 +309,7 @@ static TAILQ_HEAD(,kaiocb) aio_jobs; /* (c) Async job list */ static struct unrhdr *aiod_unr; static void aio_biocleanup(struct bio *bp); -void aio_init_aioinfo(struct proc *p); +static void aio_init_aioinfo(struct proc *p); static int aio_onceonly(void); static int aio_free_entry(struct kaiocb *job); static void aio_process_rw(struct kaiocb *job); @@ -317,7 +317,7 @@ static void aio_process_sync(struct kaiocb *job); static void aio_process_mlock(struct kaiocb *job); static void aio_schedule_fsync(void *context, int pending); static int aio_newproc(int *); -int aio_aqueue(struct thread *td, struct aiocb *ujob, +static int aio_aqueue(struct thread *td, struct aiocb *ujob, struct aioliojob *lio, int type, struct aiocb_ops *ops); static int aio_queue_file(struct file *fp, struct kaiocb *job); static void aio_biowakeup(struct bio *bp); @@ -431,7 +431,7 @@ aio_onceonly(void) * Init the per-process aioinfo structure. The aioinfo limits are set * per-process for user limit (resource) management. */ -void +static void aio_init_aioinfo(struct proc *p) { struct kaioinfo *ki; @@ -1494,7 +1494,7 @@ static struct aiocb_ops aiocb_ops_osigevent = { * Queue a new AIO request. Choosing either the threaded or direct bio VCHR * technique is done in this code. */ -int +static int aio_aqueue(struct thread *td, struct aiocb *ujob, struct aioliojob *lj, int type, struct aiocb_ops *ops) { From nobody Sat Jul 12 01:44:24 2025 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 4bfBG10Hxbz617kP; Sat, 12 Jul 2025 01:44:25 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bfBG030Qkz3G02; Sat, 12 Jul 2025 01:44:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752284664; 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=XswG37Kak6GMo8N6bX5i8mO1apvgNI4/mEgpe/EW98k=; b=AMHJVXMKRf0MFLcAB9TBSy4rHClVouiyU0tp2uC1fZlkYYYerkvbfRDhgpwz82Z8bPzKXB P4RfDx/4u19PsU67DnvlE/JbFhQBPYKE2KKK4sLP23bw7Kx3tNudBLVnXxBYyrg2ivKNe2 UjD+ydOX5EHNwy1QynqjetqQyXqqQU5EkfI74MwDI5u5z78bXn6bQXxXPNsRlGBf8vKyNo VFnXiJNizMTsGfijxhJDzFVPx6evZyuP9Fvn1ENrdPIjNtMOLE6Vt3KSLbPz2NspPBQS3/ 4E88K+a1Z6y5oKe8Ceua2+sJjHsoX+s/H23EifhVMVM5qCYtaIkLNci2EcR9HA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752284664; 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=XswG37Kak6GMo8N6bX5i8mO1apvgNI4/mEgpe/EW98k=; b=luPvwuGWJET3DZVvVIEyT4EaJcBPWKAaDfzxPJNJLjwQxewlgyJ4hRnrfMaQt+b7flHFCU pxSgB4WVsbzv/wtVf9Eri75b6z5hZOg2oFyFodWzmXNa+xY3f5A8lxAl245xbA0iXwNyUQ +/mCy8A8Pa5qNh87JzFzkTZ9yrwcAgLhUeHff+Ese4f7vQW8ToVirYxuT8uf8TE4xZdZpf zDN5jhVsLVljE+heZtShiQPrrLjN9YN0usxQSPVBcHGjUsPrleccw2oVpE6SyzU4cQK6xi sI71B6Q2gDECY3Xc3TioyYBiF7jyZqYr7KQSV3idMaOVkU0gq7TLjChg9qRePA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752284664; a=rsa-sha256; cv=none; b=ujkBBzJXSRWz80j9iWuH/H/1R21O645WiB31LVmvjusZsl4WFpSSyXvOXQaGG6lHo0zRD+ 9CBrl4nO92KfJgWZAFmwsRaDF3wfe7FkXHIHRQ6gjCUWvPZBpnjWCqYSf1iezJUEbIqTw+ bjxUSZ59FpadRlthY4jMbcyP0/lWKMDy12yWYpLc9QrKMOQVrUS929rTl2Mzz8Z0xFsKlO GJTM95y/HCvFYgK5kgOSDW6Ehl3iZhBy5NWC4jtTU0OpofSUm8hpLQa9rv758HldKuRKgC HucBbwGUDSXR4D9ea2LnjyJQk8+QiSxW3Tnx7a2H4TzfyswBvaG6jDCgO+TLjQ== 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 4bfBG02FsPz12Cx; Sat, 12 Jul 2025 01:44:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56C1iOeY050637; Sat, 12 Jul 2025 01:44:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56C1iOtK050634; Sat, 12 Jul 2025 01:44:24 GMT (envelope-from git) Date: Sat, 12 Jul 2025 01:44:24 GMT Message-Id: <202507120144.56C1iOtK050634@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: bd5f7669c0fd - stable/14 - aio: handle errors from fork 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: bd5f7669c0fd14eec352552cb569915c5421e7c0 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=bd5f7669c0fd14eec352552cb569915c5421e7c0 commit bd5f7669c0fd14eec352552cb569915c5421e7c0 Author: Konstantin Belousov AuthorDate: 2025-07-04 18:30:31 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-12 01:41:34 +0000 aio: handle errors from fork (cherry picked from commit 4685fa8e4bef169e6a1ceaf07f149232326de805) --- sys/kern/vfs_aio.c | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/sys/kern/vfs_aio.c b/sys/kern/vfs_aio.c index 91137fa1e0dd..ff1e522f7cf2 100644 --- a/sys/kern/vfs_aio.c +++ b/sys/kern/vfs_aio.c @@ -309,7 +309,7 @@ static TAILQ_HEAD(,kaiocb) aio_jobs; /* (c) Async job list */ static struct unrhdr *aiod_unr; static void aio_biocleanup(struct bio *bp); -static void aio_init_aioinfo(struct proc *p); +static int aio_init_aioinfo(struct proc *p); static int aio_onceonly(void); static int aio_free_entry(struct kaiocb *job); static void aio_process_rw(struct kaiocb *job); @@ -431,10 +431,11 @@ aio_onceonly(void) * Init the per-process aioinfo structure. The aioinfo limits are set * per-process for user limit (resource) management. */ -static void +static int aio_init_aioinfo(struct proc *p) { struct kaioinfo *ki; + int error; ki = uma_zalloc(kaio_zone, M_WAITOK); mtx_init(&ki->kaio_mtx, "aiomtx", NULL, MTX_DEF | MTX_NEW); @@ -460,8 +461,13 @@ aio_init_aioinfo(struct proc *p) uma_zfree(kaio_zone, ki); } - while (num_aio_procs < MIN(target_aio_procs, max_aio_procs)) - aio_newproc(NULL); + error = 0; + while (num_aio_procs < MIN(target_aio_procs, max_aio_procs)) { + error = aio_newproc(NULL); + if (error != 0) + break; + } + return (error); } static int @@ -1509,8 +1515,11 @@ aio_aqueue(struct thread *td, struct aiocb *ujob, struct aioliojob *lj, int jid; u_short evflags; - if (p->p_aioinfo == NULL) - aio_init_aioinfo(p); + if (p->p_aioinfo == NULL) { + error = aio_init_aioinfo(p); + if (error != 0) + goto err1; + } ki = p->p_aioinfo; @@ -2241,8 +2250,11 @@ kern_lio_listio(struct thread *td, int mode, struct aiocb * const *uacb_list, if (nent < 0 || nent > max_aio_queue_per_proc) return (EINVAL); - if (p->p_aioinfo == NULL) - aio_init_aioinfo(p); + if (p->p_aioinfo == NULL) { + error = aio_init_aioinfo(p); + if (error != 0) + return (error); + } ki = p->p_aioinfo; @@ -2531,8 +2543,11 @@ kern_aio_waitcomplete(struct thread *td, struct aiocb **ujobp, timo = tvtohz(&atv); } - if (p->p_aioinfo == NULL) - aio_init_aioinfo(p); + if (p->p_aioinfo == NULL) { + error = aio_init_aioinfo(p); + if (error != 0) + return (error); + } ki = p->p_aioinfo; error = 0; From nobody Sat Jul 12 01:44:25 2025 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 4bfBG14hG5z617ql; Sat, 12 Jul 2025 01:44:25 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bfBG13FBNz3G9L; Sat, 12 Jul 2025 01:44:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752284665; 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=O18oxrWmylbZ8ZuUAJLa4ajrNd+nJgpIqTiscG8YQDA=; b=XH9Sa4Q42e4bHXNQxOSAVLebletGh1zidl72osZSM4sKTme4lsbV5c0aT75ZwNuQEcFDBS 9HEfJ/BUsWEcjTUNJvnoxJayvxXwcHkUuXSi9YAImB0ZhD5l/GgoF0px6IVp/IxiHqGTfF vNMJpZf0Sktkmk1zJ4SiiEotVK69oNRz7iuNEAAVFeKOxFfJFCv1uY2bIY8+P9hMhHNA+2 bpHb28mVMUTl7P8DFgsEDq5e9bowwfJ3nSAZ9rE9z1X6yq9z7r6f9tXbg1NShAAVfOHF1F /Dpn3hcQC2DQF8nwFEy/amZL5OP/JYNgZvZspGIPtXQbT8HgII6okGcAuTLnIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752284665; 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=O18oxrWmylbZ8ZuUAJLa4ajrNd+nJgpIqTiscG8YQDA=; b=q70Za/5/ocQ38cITAFGbX7AcVBC/iyZyV/PrI36YskQncp3EbnmYOWgQc6RhFGYoCWmuAj 3VLso0/O7oC7wDVX2Fa5EgYP9Ub8mW7ZAjx0XHtKxKEyTOXoT9Uloi7hyopE+T4ynuDKCI yQQuNuWkx0j9bID+bxkgnQzvz5DHSM2OzjZNWxbO85W1bTSvlpz94AcigdzjpyKuU4u+Lj YGysGANorgMKSMQL3iPcu+l3hRX9EyufpZL7OmRIAGNhN7kfdwGTsBG2GJx2zNdnzGgEpN NJDBNpXWz0asNBbB20qmz3e1rOYgY6yllirtW/aBMqjV/35jmy1LeLUDzRH1dA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752284665; a=rsa-sha256; cv=none; b=hG+BcWO3t9g4kn3dcgmwojlL/JuCeU87QdvccxbwcywhHrJja3VQ/7xXfp57umHscsysNa 4CdOgF5VycRib1rLmG/b78Vx27nsWfvLtn2Xb2XMTPMkQH1bddDesg8jWqhhjQ/3NrGv/h tuDWi1Dih/RPzwd59ERfwCASELUALop8JkGSoeqVpiFTEItss4mzCxPZ/PJFLeT5JFkXoW RMWNEN4W7sO5UqYAhjHP0jzjV3ugI6RiZRIZaHPZb86mFXKCkWoIJ2O7n/vy1wkWDiZTfZ oRRX7UIe7b3E/Il5v3Z/LWWDnjjZYSZgbCISxnm7qlauY9I/Vnn9/0eS3cHvIA== 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 4bfBG12rPRz129x; Sat, 12 Jul 2025 01:44:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56C1iPp9050670; Sat, 12 Jul 2025 01:44:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56C1iPGi050668; Sat, 12 Jul 2025 01:44:25 GMT (envelope-from git) Date: Sat, 12 Jul 2025 01:44:25 GMT Message-Id: <202507120144.56C1iPGi050668@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: bc0d313bc84d - stable/14 - aio: if there is at least one aio thread, hide an error from aio_init_aioinfo() 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: bc0d313bc84d3ef11be8c77ee65fe89cac73183b Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=bc0d313bc84d3ef11be8c77ee65fe89cac73183b commit bc0d313bc84d3ef11be8c77ee65fe89cac73183b Author: Konstantin Belousov AuthorDate: 2025-07-07 14:35:11 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-12 01:41:35 +0000 aio: if there is at least one aio thread, hide an error from aio_init_aioinfo() (cherry picked from commit 0c38e3dbbf6eaa2755d34189149c9140cacd4bb1) --- sys/kern/vfs_aio.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sys/kern/vfs_aio.c b/sys/kern/vfs_aio.c index ff1e522f7cf2..a14865f6b20c 100644 --- a/sys/kern/vfs_aio.c +++ b/sys/kern/vfs_aio.c @@ -464,8 +464,15 @@ aio_init_aioinfo(struct proc *p) error = 0; while (num_aio_procs < MIN(target_aio_procs, max_aio_procs)) { error = aio_newproc(NULL); - if (error != 0) + if (error != 0) { + /* + * At least one worker is enough to have AIO + * functional. Clear error in that case. + */ + if (num_aio_procs > 0) + error = 0; break; + } } return (error); } From nobody Sat Jul 12 01:44:26 2025 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 4bfBG26YpYz617kS; Sat, 12 Jul 2025 01:44:26 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bfBG249hrz3G0M; Sat, 12 Jul 2025 01:44:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752284666; 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=I3YO5gxZXFrSZQbJ0VRso47o7ZZPy0m1o490byz6OHQ=; b=lHX8qPkJoQsrV7OrtbJbCavmOFahmmKlsuoaMsjYh+6ddkDFexsmxaBpRRBqIsrEahof4l rY41u9bbjtL12IRK3V4SuuxYrQs/am+rKSOQDScT1nfdzrEfucP4FU3MN9kHgMRv4U8h/4 5j1sz+zQdf/BmnYEH2g+AN/n+lsesUVo/PkRwZ0XEdIbqnbAryUf0vPigrzYPmFiHsvHMB ROXX3i3J4hLDADCqmOS/hEa2UZ1+aK5rQ9BkEtYeghtOGBZ6fZ9DO6FyAB3fPUCcglg5EB 9gY6z9PGT2c9pU4x2chk5SSjwMyYJFbVeGZOsQ7kORPjJwy/WfnYTMnd4nlYLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752284666; 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=I3YO5gxZXFrSZQbJ0VRso47o7ZZPy0m1o490byz6OHQ=; b=FkrAtaxRgx+V+U9gB6PrFJUggXE3y9lfcUBi+7OmQmnjuKsbTvIGxZLBq0P5UjMdo3QvWS fzEGi7PqsQu7eNeQ948NmoT1MEPqvcGxoO8lzAqQn0NZQrtjoCDtLwgtA1oWRuzU3dRdfU Q7+NBJwtMt3/rtt9MU8pmnhKBoPSykYTH6NNbMbTTWOqeegcnJxvMGeylLoOgSFPfqh1GX 0Vqt+ZXrwOiniGRICWeOSiQaotWY8PQdoud0lywCfttKGkVZrpgm8sdAz9asMgVjS+IkFV YZzMqOR+3H5tbnbJgOIkSyoWQPkMOlfPYDSFN62DR7NzZ+3UI/YVisCUH1ZdkQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752284666; a=rsa-sha256; cv=none; b=t0ZiGPkbOTrwa4QV7LotyZ92Ccr9yexY6yfJX8v4cWQ3oXgEeIoFffIFlidxgV61U0MwqC n72CtVitemy90j8gegDLA4yoQ9Oo1HIKofaw/pqAj6x+rpzJppurKqBqhDAfiybJZodAc5 /V0iI88y3Nt9rAXXBOsEns5st/3a8xnmYzYsiNcBSxL6vpwOE/W+aLN4nQXdGXHnM/KuXZ Pq8rUVdj1+8n71RiSx97VLr3ybmTbm2y0oD4j9OW9vhKKfPYV2IabW6Jt2VfwI705H3HPb lpDwq1W7SPCfKyewrrxeXUtm0VhAIeYvbFpyI7uZ9MLqOOj77dMRamg+fTcw5g== 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 4bfBG23lLKz12Cy; Sat, 12 Jul 2025 01:44:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56C1iQQi050709; Sat, 12 Jul 2025 01:44:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56C1iQkl050706; Sat, 12 Jul 2025 01:44:26 GMT (envelope-from git) Date: Sat, 12 Jul 2025 01:44:26 GMT Message-Id: <202507120144.56C1iQkl050706@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: d9290ae86570 - stable/14 - sys/sysent.h: use two nibbles for flags, and remove unused SY_THR_FLAGMASK 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d9290ae8657094879674ed280ee6ebfd89679eae Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=d9290ae8657094879674ed280ee6ebfd89679eae commit d9290ae8657094879674ed280ee6ebfd89679eae Author: Konstantin Belousov AuthorDate: 2025-07-06 12:13:50 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-12 01:41:35 +0000 sys/sysent.h: use two nibbles for flags, and remove unused SY_THR_FLAGMASK (cherry picked from commit baa15beed7f1f51c213ae434d3655c6664da8786) --- sys/sys/sysent.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/sys/sys/sysent.h b/sys/sys/sysent.h index a23c338f9ce2..a120c13f39cd 100644 --- a/sys/sys/sysent.h +++ b/sys/sys/sysent.h @@ -79,11 +79,10 @@ struct sysent { /* system call table */ */ #define SYF_CAPENABLED 0x00000001 -#define SY_THR_FLAGMASK 0x7 -#define SY_THR_STATIC 0x1 -#define SY_THR_DRAINING 0x2 -#define SY_THR_ABSENT 0x4 -#define SY_THR_INCR 0x8 +#define SY_THR_STATIC 0x01 +#define SY_THR_DRAINING 0x02 +#define SY_THR_ABSENT 0x04 +#define SY_THR_INCR 0x08 #ifdef KLD_MODULE #define SY_THR_STATIC_KLD 0 From nobody Sat Jul 12 01:44:27 2025 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 4bfBG371Vrz617qs; Sat, 12 Jul 2025 01:44:27 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bfBG358DYz3G2g; Sat, 12 Jul 2025 01:44:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752284667; 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=pk/qVi2eQiBfFNgwOLpdcepAPBicsaog8P9URbF8vGw=; b=v1bT4ak6wD3MtsrzWG5Jv4+TiNaycjI8lbrcCA59qgV8K1yOWlq8OcNE4EsFnMocMXwknP cLKNG7u5y1lyeHg0oMbZ6n1OWlVxdGrc8iApY1U2GYWIPC4ZBXYlGzK2FYksz4uBFauP9Z B9lwkAFkHx+YpIZUwjNWOL+w3GeafIXE54CnFhw3kgvcK6tx1WKccrpWEfGVOpJ3uAPo+c u9YCBRvf7k5qFlv37nEUMVtkC1cAeAxI3UdwkYk4msMGooVrkyfe8WPOXmtbALQLe7k3Xa wbold5+8GC0rZ1Opkz0Lwp4H0U0QAev369S3tlyQ8zwbOEkEiNjF2B2Vy2NFZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752284667; 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=pk/qVi2eQiBfFNgwOLpdcepAPBicsaog8P9URbF8vGw=; b=TkLHlxjdCkQWm8g/JarhbSSpv+BH3wFINiC/jN0NyYfv4iEuUp1MM5vavgjKoW25lGMIme 6EBxThnWKLNHI4v6nFe+odlRY3h1INCiWJaODZnsrSELE/NzzUD/Z78xKqHen0FTI1Dr+/ gXBcBNvqBfpYclirW09tFtFr9IZjyd4OfMX7MnJBKd6xwqhQfFuGZIEn/W8dJBAekSyzpD UPHwpccOwuN+RK50WCI6wKnHoCCKoDq17KMf2MmDg5wHT+RSU52jjPxfqwG9f5X6eyUmqn IYQ9R1YL5dSJkQIGTB0qLbIC6ZS7X8PKGSQ/xX+GeRolaZjoyH5s6o6HcHAhUg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752284667; a=rsa-sha256; cv=none; b=XWnfejgMFe6j1u7UWt39krZ289A4YUOxUqV0WMo5mrhdtMUNWDFjgH8EUaLIewIFEhXG0O L7DXAkGrEEam0bficKPcUHS5w2Nq1mzOS/h+mzhN6ypcs1EYINjXoRF3yzt05O5Id9MEty xIKQT6GveKI4QxPs9dMwykRyL/ZtQiwMUINWTPiHLpIDX9AolSF9nk5Mc0nD3hr0/EAvUM ANvV3lhSadEXVnJwMFSaeu+e9yAL03nyRYXtGQY87TppgJxzI40z1BLtIIXeytlnAeA166 2mDwRS6WPOknPo7wGEMNaT3SEVvdg5m4Xz1VhJugKcelLShTXhdyntn1ft7eMw== 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 4bfBG34kksz11yd; Sat, 12 Jul 2025 01:44:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56C1iR4B050742; Sat, 12 Jul 2025 01:44:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56C1iR2k050739; Sat, 12 Jul 2025 01:44:27 GMT (envelope-from git) Date: Sat, 12 Jul 2025 01:44:27 GMT Message-Id: <202507120144.56C1iR2k050739@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 98e530b33891 - stable/14 - kern: add kern_nosys() and use it instead of type-punning the sys_nosys() arg 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 98e530b33891735cc573c538a90cdfde7ae99a96 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=98e530b33891735cc573c538a90cdfde7ae99a96 commit 98e530b33891735cc573c538a90cdfde7ae99a96 Author: Konstantin Belousov AuthorDate: 2025-07-06 12:18:11 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-12 01:41:35 +0000 kern: add kern_nosys() and use it instead of type-punning the sys_nosys() arg (cherry picked from commit 26061e4e542d220c577fb3437a9a9f108dc27698) --- sys/kern/kern_sig.c | 9 +++++++-- sys/kern/kern_syscalls.c | 5 +++-- sys/kern/sysv_msg.c | 2 +- sys/kern/sysv_sem.c | 2 +- sys/kern/sysv_shm.c | 2 +- sys/sys/syscallsubr.h | 1 + 6 files changed, 14 insertions(+), 7 deletions(-) diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index 0291c2647da6..d8be29779386 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -1042,8 +1042,7 @@ osigaction(struct thread *td, struct osigaction_args *uap) int osigreturn(struct thread *td, struct osigreturn_args *uap) { - - return (nosys(td, (struct nosys_args *)uap)); + return (kern_nosys(td, 0)); } #endif #endif /* COMPAT_43 */ @@ -4298,6 +4297,12 @@ struct nosys_args { /* ARGSUSED */ int nosys(struct thread *td, struct nosys_args *args) +{ + return (kern_nosys(td, args->dummy)); +} + +int +kern_nosys(struct thread *td, int dummy) { struct proc *p; diff --git a/sys/kern/kern_syscalls.c b/sys/kern/kern_syscalls.c index f923211cb6c8..e330f8a2ba09 100644 --- a/sys/kern/kern_syscalls.c +++ b/sys/kern/kern_syscalls.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -51,14 +52,14 @@ int lkmnosys(struct thread *td, struct nosys_args *args) { - return (nosys(td, args)); + return (kern_nosys(td, 0)); } int lkmressys(struct thread *td, struct nosys_args *args) { - return (nosys(td, args)); + return (kern_nosys(td, 0)); } struct sysent nosys_sysent = { diff --git a/sys/kern/sysv_msg.c b/sys/kern/sysv_msg.c index 1e84d151b4af..354a01fa7e3f 100644 --- a/sys/kern/sysv_msg.c +++ b/sys/kern/sysv_msg.c @@ -1724,7 +1724,7 @@ freebsd32_msgsys(struct thread *td, struct freebsd32_msgsys_args *uap) return (sys_msgsys(td, (struct msgsys_args *)uap)); } #else - return (nosys(td, NULL)); + return (kern_nosys(td, 0)); #endif } diff --git a/sys/kern/sysv_sem.c b/sys/kern/sysv_sem.c index ad4243464a96..076851235ffa 100644 --- a/sys/kern/sysv_sem.c +++ b/sys/kern/sysv_sem.c @@ -1904,7 +1904,7 @@ freebsd32_semsys(struct thread *td, struct freebsd32_semsys_args *uap) return (sys_semsys(td, (struct semsys_args *)uap)); } #else - return (nosys(td, NULL)); + return (kern_nosys(td, 0)); #endif } diff --git a/sys/kern/sysv_shm.c b/sys/kern/sysv_shm.c index 60e3fe92a4b7..8d1a469127c6 100644 --- a/sys/kern/sysv_shm.c +++ b/sys/kern/sysv_shm.c @@ -1474,7 +1474,7 @@ freebsd32_shmsys(struct thread *td, struct freebsd32_shmsys_args *uap) return (EINVAL); } #else - return (nosys(td, NULL)); + return (kern_nosys(td, 0)); #endif } diff --git a/sys/sys/syscallsubr.h b/sys/sys/syscallsubr.h index 4450a28dc4dd..8fafb8ace311 100644 --- a/sys/sys/syscallsubr.h +++ b/sys/sys/syscallsubr.h @@ -249,6 +249,7 @@ int kern_munlock(struct thread *td, uintptr_t addr, size_t size); int kern_munmap(struct thread *td, uintptr_t addr, size_t size); int kern_nanosleep(struct thread *td, struct timespec *rqt, struct timespec *rmt); +int kern_nosys(struct thread *td, int dummy); int kern_ntp_adjtime(struct thread *td, struct timex *ntv, int *retvalp); int kern_ogetdirentries(struct thread *td, struct ogetdirentries_args *uap, long *ploff); From nobody Sat Jul 12 09:36:08 2025 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 4bfNkK0QrPz61dVm; Sat, 12 Jul 2025 09:36:09 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bfNkJ4T50z3m9T; Sat, 12 Jul 2025 09:36:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752312968; 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=fBJ5w/Vx5LPPKWXOA2OzRdx86AMaxKuwRFWIZlUIQD0=; b=UDUHgjVHPXEKWDBa3k//2UUpwo6tyCc8zYiZQSZ7s3Oz9ySZFF2Rb/H6r9WCl9Ejq7ztDR njEVkKPKqQQ9XfA5MyTVBb7fMouRNmX6G5G+0nV9iKcXkvO1nmi/9Kl4DK5wqWjFKVYwnL 0kfdBk+vNP+VAD6QU3/DZ9eDPEYZe1H+0E9hMCA/lxi8dpyvWj25dj6yMVPOAQdALWj0Dq WSq+i2C5G2ezi56tHY5BCqVva1mNfDQpclQlCDvqw6YGaDsxQ178Q2tnjfRUfq85TjoZ31 0swZIRuv/TXlL7Y8Xvwh6gnkf/xpfoVYWK3rYCLGUrryMDxA3cmkZwILySYNiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752312968; 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=fBJ5w/Vx5LPPKWXOA2OzRdx86AMaxKuwRFWIZlUIQD0=; b=ZvFElJymGluDjKJBrQ72AHanIcEBZ9SyUFypu5xKRkWoTMrsxkcEC3RMJ8fih7CL6fGZ5h Pvdmdq4b7Kna6rTRPUjQT3hyggLlKa8MAVsbnBGASEcEdRkxWafhe9G38mfRRoH8DZ1csI 9Z7gj2p8hUUEOXBiKx4gtkqtll2MS2fIaylwqzwbfh1LRcUh9lwYLq6I/JfukdR4kdHUDw G5OB5SBeZnGByk1w9iGCqbMSP0nB01fPLL0mH7ZZf8EDN3//SHLAYX+Gqyz8Xn9SErmHkP iCP03id7m5SZ1rakoRsZcF2Vwir3mKwMcI5skuRa+l1MrrTJigsXJOKFIscuwg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752312968; a=rsa-sha256; cv=none; b=x19ON7BxJnmEGjEhL5dCmtQ/KKjvyr7XKJTk94julw/G/JVnLsPFqdJZtdzVKgrn8VhGwP cge3pk3db3lt91ZBks0IXDrzjI/HmHAlG7cnvDuBW+mpCyI/oQloc4EVPRazmPJkTn0c6E g2Y2EHDRJays950lryLrPQlw2s4aaKfV5YF0fWFVm6sMdQDbcBTzdSTP6Sc33ABZkhZfFT 7CD+hvYL+LHd5NbDvl4f5eQaGIObZ5i7ov4pFg79+IXhM8hU83BXrRa7JjpF5ETODJuCs6 hEqsEupYmiYtlIEW9EORPSKwvsN/Mo9PeQ9PaajA3NYvXYQDXQzRl2rl1AuE1g== 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 4bfNkJ44nLz2d9; Sat, 12 Jul 2025 09:36:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56C9a87H036682; Sat, 12 Jul 2025 09:36:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56C9a8oH036679; Sat, 12 Jul 2025 09:36:08 GMT (envelope-from git) Date: Sat, 12 Jul 2025 09:36:08 GMT Message-Id: <202507120936.56C9a8oH036679@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 98a1084001d4 - main - dtrace.1: Reference dwatch(1) and tracing(7) 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 98a1084001d4130e6383c186717bd381b8fda1b8 Auto-Submitted: auto-generated The branch main has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=98a1084001d4130e6383c186717bd381b8fda1b8 commit 98a1084001d4130e6383c186717bd381b8fda1b8 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2025-07-12 09:32:08 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2025-07-12 09:35:29 +0000 dtrace.1: Reference dwatch(1) and tracing(7) Reviewed by: bcr Event: Berlin 2025 Hackathon --- cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 b/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 index 1836707d72df..7a98baf39776 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 +++ b/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 @@ -20,7 +20,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 14, 2025 +.Dd July 12, 2025 .Dt DTRACE 1 .Os .Sh NAME @@ -1221,6 +1221,7 @@ Invalid command line options or arguments were specified. .El .Sh SEE ALSO .Xr cpp 1 , +.Xr dwatch 1 , .Xr dtrace_audit 4 , .Xr dtrace_io 4 , .Xr dtrace_ip 4 , @@ -1233,6 +1234,7 @@ Invalid command line options or arguments were specified. .Xr dtrace_udp 4 , .Xr dtrace_udplite 4 , .Xr elf 5 , +.Xr tracing 7 , .Xr SDT 9 .Rs .%T Solaris Dynamic Tracing Guide From nobody Sat Jul 12 09:53:35 2025 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 4bfP6S1nN2z61f7t; Sat, 12 Jul 2025 09:53:36 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bfP6S0l0Mz3sSd; Sat, 12 Jul 2025 09:53:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752314016; 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=KnUtLbEoaVje9Y3x5yjX/4uyc5EkXR8Nzdo5oL2dyF8=; b=mdXN/mnZsXICnhD/vJ0l2Gdwj14t2Lit5pqxkBfJnGiJq0P49eQVg6rALmy53/D0WTZ8Ft kUzONCfOvGzqsGnj0CwM+S4DXkdvJUKbRmSNGyeoD9hubDphRgze8PPg8rZGxz1I0S/LE5 ym3DbOxq7Ehetqp3ehVNQipvsZcavLf/vGun3U4G0aKXIWj5Qp0Kh2YKhsQz3BdWjJb9cb mxYK+hmhXp8dcXBDa6sqIIpReX/8V4DAF8hyqcTew+F1zkSExGQJ5d//wIinvNExeDk0Mr W+HryijBD3E1iro0/ecHUhfnHDPlNgu2jq680+DcOxswmo4EPlAd9GJbWUKnGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752314016; 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=KnUtLbEoaVje9Y3x5yjX/4uyc5EkXR8Nzdo5oL2dyF8=; b=YfbVGqsIMr3FgeoG0xPIDIUUgcGD5MEgN39Rnk/EoFGWoQYefMMvJiKPrqvzp8OBT2gPO5 7X5gnJzJDvy/+AraSULbAcMRn1ROmljptPH9k7H9BC58pSLbXIhbYWHctT//I2k+j9dQyj fZIvJtQLEQ+lqjpdYluuKk0Utkn4xHDpXylkgTJBivh7zwlr19fvLx9ZIdd2BQbfwb1PNi kUthZUSnqisRVl3+1MxFmeF3Mho+qF+D5kYBHnoRpYfTYlZh2OUm2wcFMeIZ6MFfgPq6Dl qEUCmtELGAxr9I3Xp5Vvs4XXuqhs49MUex+h/Y1w7K/wR9wtwmqhs0IhWYvtnw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752314016; a=rsa-sha256; cv=none; b=Gh8WqeU2iKhu2g5J/gNvEAEQBg1eylTvAySoxfri/KEEdNknakR47ZraZYV1OZ/A4eLFge qHR6Pcs6L0T77dhLZvaAr364qmFuZp1BeCl285/Km7hdNZG5BuUf5SwCN7ea+ne6pn6pqt 8YqlkjMn9opfS2QXildKJDIQhaN9FhTwH1jHfxLFs4mekUxhW4ESlTZ/U/rOnSKc77VHAQ RE+qitH2A4VcSqFitEDy6Ek5ViXWdoKICxKut/PkfEsJLynQUEjGP4cjb0EZbdIKeZ1cxI 7z6kxQ06SeUZNFy2aBiYz/cvwc/tWjIo2hr0gjXHWK6sjFxjCjsgsUIl+YUgjQ== 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 4bfP6R6PwMz3CK; Sat, 12 Jul 2025 09:53:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56C9rZxY073778; Sat, 12 Jul 2025 09:53:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56C9rZsk073775; Sat, 12 Jul 2025 09:53:35 GMT (envelope-from git) Date: Sat, 12 Jul 2025 09:53:35 GMT Message-Id: <202507120953.56C9rZsk073775@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: c479d2b29fc9 - main - tracing.7: Pet linters 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c479d2b29fc90d8316af2a14290c87feeb046428 Auto-Submitted: auto-generated The branch main has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=c479d2b29fc90d8316af2a14290c87feeb046428 commit c479d2b29fc90d8316af2a14290c87feeb046428 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2025-07-12 09:52:26 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2025-07-12 09:52:26 +0000 tracing.7: Pet linters Event: Berlin 2025 Hackathon --- share/man/man7/tracing.7 | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/share/man/man7/tracing.7 b/share/man/man7/tracing.7 index 0bd64f197084..7f21bfbbd2a3 100644 --- a/share/man/man7/tracing.7 +++ b/share/man/man7/tracing.7 @@ -3,7 +3,7 @@ .\" .\" Copyright (c) 2025 Mateusz Piotrowski <0mp@FreeBSD.org> .\" -.Dd June 19, 2025 +.Dd July 12, 2025 .Dt TRACING 7 .Os .Sh NAME @@ -34,7 +34,6 @@ for more details. is a user-friendly wrapper for DTrace. It simplifies common DTrace usage patterns and requires less expert knowledge to operate. -.Pp .Ss Userland Tracing .Xr truss 1 traces system calls. @@ -55,7 +54,8 @@ it asynchronously logs entries to a trace file configured with .Xr ktrace 2 (typically .Pa ktrace.out ) , -and it can log other types of kernel events, such as page faults and name lookups +and it can log other types of kernel events, such as page faults +and name lookups .Po refer to .Fl t in @@ -74,10 +74,9 @@ It lets kernel programmers log events to a global ring buffer, which can later be dumped using .Xr ktrdump 8 . .Ss Hardware Counters -.Pp .Xr pmcstat 8 , and its kernel counterpart, -.Xr hwmpc 4 , +.Xr hwpmc 4 , is the .Fx facility for conducting performance measurements with hardware counters. From nobody Sat Jul 12 13:38:47 2025 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 4bfV6J4yS0z61sp1; Sat, 12 Jul 2025 13:38:48 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bfV6J0pfwz3ChQ; Sat, 12 Jul 2025 13:38:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752327528; 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=pXIVuicZApNLZaAZe8JLR8OXozCF/NTiB3jSvThQ0Hs=; b=pUTfFGipwCJ7YJrTR17ZUdAuGgSYFQKJhSTxgisvmrQizf4GAm+q2pzlB3iLPb9ZLTZF87 KkHcprYbP7QsC5bI8q75+oe4hJw/2Jin8hayZM24u7vZLAXYQW69dRudZ1Q8a4bJ/c4Xxa KhaAPrPrGhWOuSp3M3Gjse1NJ+bFJ6ITXCWLHghapS1zUjfZL+HNKIzp9YnQfbILRXfIHR vdrVNtD+LftScuBW2ruu5hoTunRWTAKXs4DEEtWmNGiSQE0dl0tm0znszpG3MxE0oogw9R xRIzPVzLKA7EhSuQg3bUAgn3yOtjx5pKJsIMvyfVH+qUTuqSFvTjFUF/CGfsWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752327528; 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=pXIVuicZApNLZaAZe8JLR8OXozCF/NTiB3jSvThQ0Hs=; b=lOkuUwx3Ybi4ort4vHTGCv4cGg7XErSgWvzPao8dFDTjb6j4BMmNsNRKIdytor3/+3JwCR TRRWuuZjmkd/6BuZgeYQWiIFqNleKEOJfTsfy71ubE3TMbx+al11t1m/oqE3+l0sVBLAI8 LJN/l7FiC180G7Kwxn602VuG8xJMTMGE/4DNMmy4Cc+73Gf1vK02EiCSC3pdxJ+dwHr5MC T3kWw2fxWkjLGa1uoNyxg8+xmh1yufPvolBLoGH0VqAyVOTQHREONyLlXrXKucRy6ibObL 89ZMPUQ8gU5Bpd05v8aH5o2/ndjgM8U6lTuDhQGEACenjpwFEum6W1k4h858IA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752327528; a=rsa-sha256; cv=none; b=iyqhyxPh/oFDOrrPmfkpswyxKMHVSBOB+xoDsVYg0AhnIkS5zEd7PCQfvduh+Rwgo7ayEO ecC9wjaoJo/sVkR5i96er6mqf7sWA70jxTpu3nYObw/u1TYiEqC1NWwf8FxhiLviIshD+W 447HP/H/NVGtWQV25j8gPw05usXaaClJb8KcbOIgy1QmoXWvtmfQ6SeQcoTEjN1eGAHcw2 Bfwnog+kuLVC+s4ONo0gJe1ZmCTx6EXY+PSXdVjqCLrmA12SPqE9GZM5OLufll1my/AvOt hoF0TbmigLS1vt7D1c4RNtibERkGYFIOl683H3NSGHL4jG3YChI95nkXVcJgGw== 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 4bfV6J0FK1z8mX; Sat, 12 Jul 2025 13:38:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56CDclUC088820; Sat, 12 Jul 2025 13:38:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56CDcl4q088817; Sat, 12 Jul 2025 13:38:47 GMT (envelope-from git) Date: Sat, 12 Jul 2025 13:38:47 GMT Message-Id: <202507121338.56CDcl4q088817@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 8423b27345ce - main - pfctl: Refine error message 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8423b27345ceabc545e664b5e75952bb4bf8362e Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=8423b27345ceabc545e664b5e75952bb4bf8362e commit 8423b27345ceabc545e664b5e75952bb4bf8362e Author: Kristof Provost AuthorDate: 2025-07-07 06:30:12 +0000 Commit: Kristof Provost CommitDate: 2025-07-12 09:57:50 +0000 pfctl: Refine error message While code in pf/pfctl confusingly uses either anchor or ruleset depending on the context, pfctl(8) (both manual and user interface) should be consistent. For users there are basically anchors only, so do not imply any difference between the two terminologies. OK sashan Obtained from: OpenBSD, kn , 910e8feeb5 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/pfctl_radix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/pfctl/pfctl_radix.c b/sbin/pfctl/pfctl_radix.c index 21191259adff..5f9f121bc81c 100644 --- a/sbin/pfctl/pfctl_radix.c +++ b/sbin/pfctl/pfctl_radix.c @@ -469,7 +469,7 @@ pfr_strerror(int errnum) case ESRCH: return "Table does not exist"; case ENOENT: - return "Anchor or Ruleset does not exist"; + return "Anchor does not exist"; default: return strerror(errnum); } From nobody Sat Jul 12 13:38:46 2025 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 4bfV6H4pttz61srC; Sat, 12 Jul 2025 13:38:47 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bfV6H11s1z3Cbk; Sat, 12 Jul 2025 13:38:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752327527; 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=jKfDbdE1hV8bQ6uZf9GqYEu7csfc5Ih2+SPPeOoupEU=; b=QcW34zjQdNB36nlyjy9u/B8lQnW1saitEkq9N12PGyXnm2rXTpl1n17jkBx0vMsAJt6KZ2 wVMvER5GFVQSS9AAeEfpe+t6hbwdqYcLHKZ1icnhQC/jalvNx+0xT05duCosyoupkgYNuC 2Q+DXelDGf9xmK8Va3XWNzuZx1t34p5SPR4QLRXMRQykZC7x2UZUPr30IB2yGbT09dgofz vc+CrFqInhSX9pH572XoIH4PEetZGkww1kf5/z8i4EoWxGnLZrnZBaKQX4q7SupbfEF6uW YDWvzwNzQs96n2ujNUBNv8xBfBPcZeQAsz3ln0MVd/ZpcABdsyL6leuQexmZOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752327527; 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=jKfDbdE1hV8bQ6uZf9GqYEu7csfc5Ih2+SPPeOoupEU=; b=eCk0iU4wnUdmxhjUCcueCBZHMQKJBpUxpu4HfJdAQf//HzaQDt5K59dbSGShCueWgkkTUK CEjNw1i3w2zNc9twHj0zdLFp7vMyPyQ+yiCjq/foUMebqTsPWyOTtuEldDoQm6bEpZHLBy ER2Szq86TW39VeEGvhMGrxavpkd1/ArNc9Y5KRioCwoN/3wZXbUpMTEiYmtPM3QVfSRWbS 7yfUBqOWohsZvJDyxItl9/mdLgXZkUOK4YXqjXCZpbxKJg+pXk3cvyOjIsEzXJ4fyFXJM8 44klDZN1uWutHeGWw9aRTC3wzcCTZRsgUdfI3Y4FlZ3O3FoPSHXldIQ4XQ1yIQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752327527; a=rsa-sha256; cv=none; b=mqwp+msqm1U6IQrkfhN0DjHCtb50qKtDI3ue0lELm15GuEOCmKB5DPH4K7GZyAtLReEkfJ DHXd2iWxadztF+mNJBPmb9CiF4w4axo99ScAaMrDj+PzcQMZQEi7NdloqaVZESiFHLOMu3 KvXul6iYokbdB3oS4o80BCgHSbh057ktRb3KozYV5QELcHHnqjQEJ4obTmcyhdomKDd6M1 OqFG0XsPAIy+aBa09n36UJQJbf1ME4kEW5BtsIKSDyUfAShJIKJ0MB/9Nw44LDUHmdZOI/ ehRRiKkv0nN6MIwWErvlGMTsewRE5F4WDBVc7YW8eoYMAsXH7rT9MtXzoq9fAA== 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 4bfV6H023Fz95r; Sat, 12 Jul 2025 13:38:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56CDckbd088781; Sat, 12 Jul 2025 13:38:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56CDckZF088778; Sat, 12 Jul 2025 13:38:46 GMT (envelope-from git) Date: Sat, 12 Jul 2025 13:38:46 GMT Message-Id: <202507121338.56CDckZF088778@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: b2c8af25d5e0 - main - pfctl: Merge radix_perror() into simpler warnx()/errx() usage 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b2c8af25d5e0e5ff5ee25c4788afa5b2c836af8d Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=b2c8af25d5e0e5ff5ee25c4788afa5b2c836af8d commit b2c8af25d5e0e5ff5ee25c4788afa5b2c836af8d Author: Kristof Provost AuthorDate: 2025-07-07 06:28:39 +0000 Commit: Kristof Provost CommitDate: 2025-07-12 09:57:49 +0000 pfctl: Merge radix_perror() into simpler warnx()/errx() usage Less nesting for clearer code. OK sashan Obtained from: OpenBSD, kn , e13f010528 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/pfctl_table.c | 32 +++++++++++--------------------- 1 file changed, 11 insertions(+), 21 deletions(-) diff --git a/sbin/pfctl/pfctl_table.c b/sbin/pfctl/pfctl_table.c index 0b52f88eafbb..8033d3515572 100644 --- a/sbin/pfctl/pfctl_table.c +++ b/sbin/pfctl/pfctl_table.c @@ -61,7 +61,6 @@ static int load_addr(struct pfr_buffer *, int, char *[], char *, int, int); static void print_addrx(struct pfr_addr *, struct pfr_addr *, int); static int nonzero_astats(struct pfr_astats *); static void print_astats(struct pfr_astats *, int); -static void radix_perror(void); static void xprintf(int, const char *, ...); static void print_iface(struct pfi_kif *, int); @@ -75,14 +74,14 @@ static const char *istats_text[2][2][2] = { { { "In6/Pass:", "In6/Block:" }, { "Out6/Pass:", "Out6/Block:" } } }; -#define RVTEST(fct) do { \ - if ((!(opts & PF_OPT_NOACTION) || \ - (opts & PF_OPT_DUMMYACTION)) && \ - (fct)) { \ - if ((opts & PF_OPT_RECURSE) == 0) \ - radix_perror(); \ - goto _error; \ - } \ +#define RVTEST(fct) do { \ + if ((!(opts & PF_OPT_NOACTION) || \ + (opts & PF_OPT_DUMMYACTION)) && \ + (fct)) { \ + if ((opts & PF_OPT_RECURSE) == 0) \ + warnx("%s", pfr_strerror(errno)); \ + goto _error; \ + } \ } while (0) #define CREATE_TABLE do { \ @@ -93,7 +92,7 @@ static const char *istats_text[2][2][2] = { (opts & PF_OPT_DUMMYACTION)) && \ (pfr_add_table(&table, &nadd, flags)) && \ (errno != EPERM)) { \ - radix_perror(); \ + warnx("%s", pfr_strerror(errno)); \ goto _error; \ } \ if (nadd) { \ @@ -559,13 +558,6 @@ print_astats(struct pfr_astats *as, int dns) (unsigned long long)as->pfras_bytes[dir][op]); } -void -radix_perror(void) -{ - extern char *__progname; - fprintf(stderr, "%s: %s.\n", __progname, pfr_strerror(errno)); -} - int pfctl_define_table(char *name, int flags, int addrs, const char *anchor, struct pfr_buffer *ab, u_int32_t ticket) @@ -647,10 +639,8 @@ pfctl_show_ifaces(const char *filter, int opts) for (;;) { pfr_buf_grow(&b, b.pfrb_size); b.pfrb_size = b.pfrb_msize; - if (pfi_get_ifaces(filter, b.pfrb_caddr, &b.pfrb_size)) { - radix_perror(); - exit(1); - } + if (pfi_get_ifaces(filter, b.pfrb_caddr, &b.pfrb_size)) + errx(1, "%s", pfr_strerror(errno)); if (b.pfrb_size <= b.pfrb_msize) break; } From nobody Sat Jul 12 13:38:49 2025 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 4bfV6K5BG9z61sWB; Sat, 12 Jul 2025 13:38:49 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bfV6K1SG6z3CTS; Sat, 12 Jul 2025 13:38:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752327529; 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=e3iOSoXFmV8W5Lg88hxtRP9e6Kx6EHIIqvR0uDNEZ/0=; b=OH2fX5ufuRsQ276xc5Rupn89nDBmj5PZz0ze7OgPThM19wxe4hVJzMGT04ob3pnTaUhj2a bGHDFKrrtUvJotrBGBd/t6SM2rI2C/guvm9CJwlT0YKZpsIgKM7Z2+dXJedR/gxDAtGPL0 cnyveF036eX0SX7+eKRsUrmzVCJ1mgCL009684T1Q6MzO6rI2aserYJTVHpTDZ20AwFbtc EyMPk76CyU/pnpc4TJ7aROi1Xbr2X4w3zr8t4giATsV5k9uL21y50QplTMGP/mKEnW45LG Y4pC4BCK0RV1RhUvPGmPlH9IlFdTD1zYf7Td5+CXp0bAMyWDf/kXLCWizMylrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752327529; 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=e3iOSoXFmV8W5Lg88hxtRP9e6Kx6EHIIqvR0uDNEZ/0=; b=KFYqpUOw3pPSIcWszzOHANul0hglkReX4LkXKrSlmle0mnYKNjZYyA62Swhbfz6YmklFzs onFg+QuUEHGxzTTc5wVPakMYLUvPTLOY+QhQ12vdQJI6RsWHy7OuCkmfmac+yqOHubB1Pr vT3R2SFcjBd0I8JjBliyAeDfm3H5v5/DIISBAfPBR/mIaCCvUxKRw/zo6ZTPcirIECRVIZ 4X5qh1sN/8HAJ3TtCQxAueHpnjH7zTQJpFZdUaWDDLqFd+LN9P8bazrl7N0fhmSt3CZZuF ZG4pjHKSh2+AJb7lVeEI8P+zAy+jydn63MHPymUkXcbwwI66A4Z0YaFPz0F5yg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752327529; a=rsa-sha256; cv=none; b=c/qdOmOvpqr9+YPwdQLH/uqUMBxEFUO0wuPexRp2iMVxTGbt4+Jf5eHCECBYk7XZfKruMf 5Mbz0VEmCpDtMjQppzoxzoGi4NYCXnPWAefSGzKiwLGPJWZ/O/zDCyo5JuecRolp5qNfy1 4IlpWRMcDuXlS7LDchJDISMu+BTcPFfl+PWmp3hrivIhITXHtW9kI1i2PeaOtwdThXljMQ NDj0ghdD4nNfuRidos2g6qeiKHw5m43PEr/YnzxayT+QROxYbuJlHXe2dAbFdOJKXIt4TM mA2zHnLWCFx0SDBDzzsEXtIJwAoWbJHq6Y8J3mgeSjekd/9gaxVjv+2lDd6pbg== 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 4bfV6K0n1tz8px; Sat, 12 Jul 2025 13:38:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56CDcnDP088854; Sat, 12 Jul 2025 13:38:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56CDcnRX088851; Sat, 12 Jul 2025 13:38:49 GMT (envelope-from git) Date: Sat, 12 Jul 2025 13:38:49 GMT Message-Id: <202507121338.56CDcnRX088851@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 7153a62d2978 - main - pfctl: Unify error message for nonexisting anchors 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7153a62d29784780fdc1d61aebd92c76fb158627 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=7153a62d29784780fdc1d61aebd92c76fb158627 commit 7153a62d29784780fdc1d61aebd92c76fb158627 Author: Kristof Provost AuthorDate: 2025-07-07 06:45:04 +0000 Commit: Kristof Provost CommitDate: 2025-07-12 09:57:50 +0000 pfctl: Unify error message for nonexisting anchors pf(4) returns EINVAL for DIOCGETRULE, DIOCGETRULES and DIOCGETRULESET if the specified anchor does not exist. Extend and rename {pfr -> pf}_strerror() to make error message more consistent. There are other occasions as well but those need additional tweaks; that's stuff for another diff. OK and rename from sashan Obtained from: OpenBSD, kn , e5c920154c Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/pfctl.c | 24 +++++++++++++++++++----- sbin/pfctl/pfctl_optimize.c | 8 ++++---- sbin/pfctl/pfctl_radix.c | 13 ------------- 3 files changed, 23 insertions(+), 22 deletions(-) diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c index 8d2b556d7085..b4453c850de4 100644 --- a/sbin/pfctl/pfctl.c +++ b/sbin/pfctl/pfctl.c @@ -1350,7 +1350,7 @@ pfctl_show_rules(int dev, char *path, int opts, enum pfctl_show format, for (nr = 0; nr < mnr; ++nr) { if ((ret = pfctl_get_ruleset(pfh, npath, nr, &prs)) != 0) - errc(1, ret, "DIOCGETRULESET"); + errx(1, "%s", pfr_strerror(ret)); INDENT(depth, !(opts & PF_OPT_VERBOSE)); printf("anchor \"%s\" all {\n", prs.name); pfctl_show_rules(dev, npath, opts, @@ -1365,14 +1365,14 @@ pfctl_show_rules(int dev, char *path, int opts, enum pfctl_show format, if (opts & PF_OPT_SHOWALL) { ret = pfctl_get_rules_info_h(pfh, &ri, PF_PASS, path); if (ret != 0) { - warnc(ret, "DIOCGETRULES"); + warnx("%s", pfr_strerror(ret)); goto error; } header++; } ret = pfctl_get_rules_info_h(pfh, &ri, PF_SCRUB, path); if (ret != 0) { - warnc(ret, "DIOCGETRULES"); + warnx("%s", pfr_strerror(ret)); goto error; } if (opts & PF_OPT_SHOWALL) { @@ -1565,12 +1565,12 @@ pfctl_show_nat(int dev, const char *path, int opts, char *anchorname, int depth, fprintf(stderr, "NAT anchor '%s' " "not found.\n", anchorname); else - errc(1, ret, "DIOCGETRULESETS"); + errx(1, "%s", pfr_strerror(ret)); } for (nr = 0; nr < mnr; ++nr) { if ((ret = pfctl_get_ruleset(pfh, npath, nr, &prs)) != 0) - errc(1, ret, "DIOCGETRULESET"); + errx(1, "%s", pfr_strerror(ret)); INDENT(depth, !(opts & PF_OPT_VERBOSE)); printf("nat-anchor \"%s\" all {\n", prs.name); pfctl_show_nat(dev, npath, opts, @@ -3643,3 +3643,17 @@ main(int argc, char *argv[]) exit(exit_val); } + +char * +pfr_strerror(int errnum) +{ + switch (errnum) { + case ESRCH: + return "Table does not exist"; + case EINVAL: + case ENOENT: + return "Anchor does not exist"; + default: + return strerror(errnum); + } +} diff --git a/sbin/pfctl/pfctl_optimize.c b/sbin/pfctl/pfctl_optimize.c index e727324bbf40..24b774bc66be 100644 --- a/sbin/pfctl/pfctl_optimize.c +++ b/sbin/pfctl/pfctl_optimize.c @@ -903,13 +903,13 @@ load_feedback_profile(struct pfctl *pf, struct superblocks *superblocks) struct pf_opt_queue queue; struct pfctl_rules_info rules; struct pfctl_rule a, b, rule; - int nr, mnr; + int nr, mnr, ret; TAILQ_INIT(&queue); TAILQ_INIT(&prof_superblocks); - if (pfctl_get_rules_info_h(pf->h, &rules, PF_PASS, "")) { - warn("DIOCGETRULES"); + if ((ret = pfctl_get_rules_info_h(pf->h, &rules, PF_PASS, "")) != 0) { + warnx("%s", pfr_strerror(ret)); return (1); } mnr = rules.nr; @@ -924,7 +924,7 @@ load_feedback_profile(struct pfctl *pf, struct superblocks *superblocks) if (pfctl_get_rule_h(pf->h, nr, rules.ticket, "", PF_PASS, &rule, anchor_call)) { - warn("DIOCGETRULENV"); + warnx("%s", pfr_strerror(ret)); free(por); return (1); } diff --git a/sbin/pfctl/pfctl_radix.c b/sbin/pfctl/pfctl_radix.c index 5f9f121bc81c..00e4207d377b 100644 --- a/sbin/pfctl/pfctl_radix.c +++ b/sbin/pfctl/pfctl_radix.c @@ -461,16 +461,3 @@ pfr_next_token(char buf[BUF_SIZE], FILE *fp) buf[i] = '\0'; return (1); } - -char * -pfr_strerror(int errnum) -{ - switch (errnum) { - case ESRCH: - return "Table does not exist"; - case ENOENT: - return "Anchor does not exist"; - default: - return strerror(errnum); - } -} From nobody Sat Jul 12 13:38:50 2025 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 4bfV6M1h5dz61sd2; Sat, 12 Jul 2025 13:38:51 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bfV6L2Gjhz3CYL; Sat, 12 Jul 2025 13:38:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752327530; 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=ka51YlIwpHBu8/RDRMHa4pZQgf6BLPr79ACE7n0R6dQ=; b=wZdtJCtZFEvHyJSd/Y2BhkkJFLOhAEf5wbAq3HH7nTMsH8n23l4+lHe3eH88tLnnd6XP2F +zSr7HG2x7yt4juQaGuXj13UWniDeRu2TO/6nRpEzrT9ILRr5BM8DtTYWeATgKwFuPteIP cuuSvuZcZXzUZ+7J53abAfx4cqXUWG1bxs6LQwpC2hEgXwcKxQdLqRH5HsUaZEz6+8IK6K mWLdyWIpzMtg0WNEBHqkDaC+BY0LmNcRy021USawLxGv++TXemyIpSntHugKgPxRiC3JSy GjeZ9Mf2BT1LKXGCuBWPEH33tJtQSkxFaVcRrthNdFpOOEasYbOapFsjnKxMEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752327530; 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=ka51YlIwpHBu8/RDRMHa4pZQgf6BLPr79ACE7n0R6dQ=; b=vH7OJJETelNnYRVcp9A1GWKR70qDcoHSirSRZdV55Kzn8ZxcwJoT+IlsGMZJhzU+CN0hRC A4A7ekYlRjK3vso9o/GlMALoO3+CJftIb4yav2P274XSLrZiBF85dH1w8JCP7aBzQIMT0g eemhkUB9QWlFzgk6nPj8zvtYNKfv5xXwTSPRgGJ4+7gqeeHLAVPlAdsmhuAIvQ9yyVIbEw ta97yqWJhYEbial7j/ct1CS7hw2i9odQZHCkVCLzKCovWKXLmAFfDh4s8Krf5+RYU4wLwU B/JYaibVrG0X0+OW2PJBAV4bsH2X3gR581FYpfvSL3mzWrCugMxTNweOpu2/2Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752327530; a=rsa-sha256; cv=none; b=oKM9VpcHnn30G1LxArqZkGF1YsPzpX4N72RHmnJvACEqzXX1qJI+FBnt7Z1dWaWNzmx4T7 K+Fu1wtMBEdS96QzP1VnsZt+dygjPazkxGKpHQeVAfHKfdqu0ouRMEFDKh2mllGIwFSn2Q aNT958mLm7nVsxYx2tFbQfuZMxj2OSV3zhtjf8FS3l7VvAhtV5ivM3SclleyKDfXXrX6Q/ 1Ol4kDkGTM/dDroCxLO658PnvNEVE90xax/6s+F5tOHw90r2wRVMVsCosw9EQxTcUCxfvw 0mAY/XeoQtVQOiVis/mcTgfAUFryS9rEFnReWnKgOREI8/LCFYZ7UzulEcLY5g== 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 4bfV6L1mrPz8sg; Sat, 12 Jul 2025 13:38:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56CDcowP088889; Sat, 12 Jul 2025 13:38:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56CDcotK088886; Sat, 12 Jul 2025 13:38:50 GMT (envelope-from git) Date: Sat, 12 Jul 2025 13:38:50 GMT Message-Id: <202507121338.56CDcotK088886@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 004062345bbf - main - pfctl: Do the actual pfr_strerror() to pf_strerror() rename 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 004062345bbfaa191252ac2df15ca151dcfdfc4f Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=004062345bbfaa191252ac2df15ca151dcfdfc4f commit 004062345bbfaa191252ac2df15ca151dcfdfc4f Author: Kristof Provost AuthorDate: 2025-07-07 07:07:31 +0000 Commit: Kristof Provost CommitDate: 2025-07-12 09:57:50 +0000 pfctl: Do the actual pfr_strerror() to pf_strerror() rename Missed in previous Obtained from: OpenBSD, kn , c802a0d9d6 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/parse.y | 2 +- sbin/pfctl/pfctl.c | 12 ++++++------ sbin/pfctl/pfctl.h | 2 +- sbin/pfctl/pfctl_optimize.c | 4 ++-- sbin/pfctl/pfctl_table.c | 6 +++--- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index 28f461bf715d..2188324c15cb 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -5458,7 +5458,7 @@ process_tabledef(char *name, struct table_opts *opts, int popts) name); else yyerror("cannot define table %s: %s", name, - pfr_strerror(errno)); + pf_strerror(errno)); goto _error; } diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c index b4453c850de4..10f3ee1f44e9 100644 --- a/sbin/pfctl/pfctl.c +++ b/sbin/pfctl/pfctl.c @@ -1350,7 +1350,7 @@ pfctl_show_rules(int dev, char *path, int opts, enum pfctl_show format, for (nr = 0; nr < mnr; ++nr) { if ((ret = pfctl_get_ruleset(pfh, npath, nr, &prs)) != 0) - errx(1, "%s", pfr_strerror(ret)); + errx(1, "%s", pf_strerror(ret)); INDENT(depth, !(opts & PF_OPT_VERBOSE)); printf("anchor \"%s\" all {\n", prs.name); pfctl_show_rules(dev, npath, opts, @@ -1365,14 +1365,14 @@ pfctl_show_rules(int dev, char *path, int opts, enum pfctl_show format, if (opts & PF_OPT_SHOWALL) { ret = pfctl_get_rules_info_h(pfh, &ri, PF_PASS, path); if (ret != 0) { - warnx("%s", pfr_strerror(ret)); + warnx("%s", pf_strerror(ret)); goto error; } header++; } ret = pfctl_get_rules_info_h(pfh, &ri, PF_SCRUB, path); if (ret != 0) { - warnx("%s", pfr_strerror(ret)); + warnx("%s", pf_strerror(ret)); goto error; } if (opts & PF_OPT_SHOWALL) { @@ -1565,12 +1565,12 @@ pfctl_show_nat(int dev, const char *path, int opts, char *anchorname, int depth, fprintf(stderr, "NAT anchor '%s' " "not found.\n", anchorname); else - errx(1, "%s", pfr_strerror(ret)); + errx(1, "%s", pf_strerror(ret)); } for (nr = 0; nr < mnr; ++nr) { if ((ret = pfctl_get_ruleset(pfh, npath, nr, &prs)) != 0) - errx(1, "%s", pfr_strerror(ret)); + errx(1, "%s", pf_strerror(ret)); INDENT(depth, !(opts & PF_OPT_VERBOSE)); printf("nat-anchor \"%s\" all {\n", prs.name); pfctl_show_nat(dev, npath, opts, @@ -3645,7 +3645,7 @@ main(int argc, char *argv[]) } char * -pfr_strerror(int errnum) +pf_strerror(int errnum) { switch (errnum) { case ESRCH: diff --git a/sbin/pfctl/pfctl.h b/sbin/pfctl/pfctl.h index 5b5b3d3e5fff..afecc78086e0 100644 --- a/sbin/pfctl/pfctl.h +++ b/sbin/pfctl/pfctl.h @@ -83,7 +83,7 @@ void *pfr_buf_next(struct pfr_buffer *, const void *); int pfr_buf_grow(struct pfr_buffer *, int); int pfr_buf_load(struct pfr_buffer *, char *, int, int (*)(struct pfr_buffer *, char *, int, int), int); -char *pfr_strerror(int); +char *pf_strerror(int); int pfi_get_ifaces(const char *, struct pfi_kif *, int *); int pfi_clr_istats(const char *, int *, int); diff --git a/sbin/pfctl/pfctl_optimize.c b/sbin/pfctl/pfctl_optimize.c index 24b774bc66be..d65503a3efb3 100644 --- a/sbin/pfctl/pfctl_optimize.c +++ b/sbin/pfctl/pfctl_optimize.c @@ -909,7 +909,7 @@ load_feedback_profile(struct pfctl *pf, struct superblocks *superblocks) TAILQ_INIT(&prof_superblocks); if ((ret = pfctl_get_rules_info_h(pf->h, &rules, PF_PASS, "")) != 0) { - warnx("%s", pfr_strerror(ret)); + warnx("%s", pf_strerror(ret)); return (1); } mnr = rules.nr; @@ -924,7 +924,7 @@ load_feedback_profile(struct pfctl *pf, struct superblocks *superblocks) if (pfctl_get_rule_h(pf->h, nr, rules.ticket, "", PF_PASS, &rule, anchor_call)) { - warnx("%s", pfr_strerror(ret)); + warnx("%s", pf_strerror(ret)); free(por); return (1); } diff --git a/sbin/pfctl/pfctl_table.c b/sbin/pfctl/pfctl_table.c index 8033d3515572..f583f5ef8e79 100644 --- a/sbin/pfctl/pfctl_table.c +++ b/sbin/pfctl/pfctl_table.c @@ -79,7 +79,7 @@ static const char *istats_text[2][2][2] = { (opts & PF_OPT_DUMMYACTION)) && \ (fct)) { \ if ((opts & PF_OPT_RECURSE) == 0) \ - warnx("%s", pfr_strerror(errno)); \ + warnx("%s", pf_strerror(errno)); \ goto _error; \ } \ } while (0) @@ -92,7 +92,7 @@ static const char *istats_text[2][2][2] = { (opts & PF_OPT_DUMMYACTION)) && \ (pfr_add_table(&table, &nadd, flags)) && \ (errno != EPERM)) { \ - warnx("%s", pfr_strerror(errno)); \ + warnx("%s", pf_strerror(errno)); \ goto _error; \ } \ if (nadd) { \ @@ -640,7 +640,7 @@ pfctl_show_ifaces(const char *filter, int opts) pfr_buf_grow(&b, b.pfrb_size); b.pfrb_size = b.pfrb_msize; if (pfi_get_ifaces(filter, b.pfrb_caddr, &b.pfrb_size)) - errx(1, "%s", pfr_strerror(errno)); + errx(1, "%s", pf_strerror(errno)); if (b.pfrb_size <= b.pfrb_msize) break; } From nobody Sat Jul 12 13:38:51 2025 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 4bfV6M74lJz61srG; Sat, 12 Jul 2025 13:38:51 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bfV6M2v9Nz3CfB; Sat, 12 Jul 2025 13:38:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752327531; 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=ei1Tka1kcedDyDgqoE0XSBbD3Z9ETKucbJfS+vVfxKg=; b=UIPP4VJiAWDJdgWI8lE8E2EB1U3+o93s3bzYcFPlwppcjdGIWShrTmfoHLbs2LZyep17YB j2q2UYbZVjs2zEDU3ES06jMEN7ezaR4MpUT2XO2KE9Cm/+ipNTypwKddlkN/KRfc3jVgJS ZPWqjLnJ53feb1NjBcB9oFjVihhywW2R5cdD7xSHXpsIGk6GvAwaxKm4J/gCPeXc1f6zR5 Pu83jGyP2PVbEqZnqBWRqRhrFHqirjVADZjTIq07FJgqwaJ+TwE+SeMO3kwuHqqmYR95fs A9I3gfI7nS9A3WfveLVWmUgUtFqOeF65CmaS+vLyUA1EtGtK7TJt+4M2Yibqzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752327531; 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=ei1Tka1kcedDyDgqoE0XSBbD3Z9ETKucbJfS+vVfxKg=; b=LFKK56V5EO+6b//oXNB+2HN5BYsbdBYKvysFNB45adEyTAAGTXq/Ot86fCL4hXVbFYemGW DHOEjOzUeZ3DngkbzrrNyRhyUIQd8l4lNGzZ4LfxRM4BIdVraKQTiOGb+vinRk5IL6nO6+ qoHSxSs3wnkEOr/8yC8EerKDXEFQx3qD/tEgxFQ2JfxmtkcLLaOEDH7VRWIV1qTOOV4tiG Spbij1Yw/vVa8j9e3lgOVqESw/tWGA6uVyKPiSox0IcLdJSge0j92c+/stD7yC4lxnxG2/ RALdIrRwcI6FWrLNkjeE6Krc41Pav8jt0FPAlntzs+jW52xyJEG2j+13hAvPng== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752327531; a=rsa-sha256; cv=none; b=B3lsHA0fu/bXf9IPCm9Rxy5C7UnW3HMLJP8PNufJV3/icFSyPLNDqCpqdZ+iRhE67KldFi nQ5aqgyW0dw3fpSRwt3H4/5Hxqy3ds9/qMbyqxTau+HWuaaDpa7G9ko+lLXXX6z7S6frtg V0gY4Ga5rAjzSilqb0+t0DcOcHbuwnlN4Xi1lVLpXdWzfZQrgSUUh6hGPgfdtDWcFNd7nw qM/7p8y9t97cP8WeXRoiZdTtlC2dyYAPZ3FZgj6kH7VYqxuTesonmSgDNcoLZ/D6jscPT3 IK5DE7sSiVQQ00xc2eDkCTcrOWk61UmlTIxb6dJWHPAY4xA8rpXuvuiX5ODy0Q== 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 4bfV6M2HXQz8py; Sat, 12 Jul 2025 13:38:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56CDcpb1088924; Sat, 12 Jul 2025 13:38:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56CDcp2C088921; Sat, 12 Jul 2025 13:38:51 GMT (envelope-from git) Date: Sat, 12 Jul 2025 13:38:51 GMT Message-Id: <202507121338.56CDcp2C088921@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: c87390026a4e - main - pfctl: Fail on missing anchor 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c87390026a4e11355351d7a22ce456d1ea3cfe06 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=c87390026a4e11355351d7a22ce456d1ea3cfe06 commit c87390026a4e11355351d7a22ce456d1ea3cfe06 Author: Kristof Provost AuthorDate: 2025-07-07 07:09:32 +0000 Commit: Kristof Provost CommitDate: 2025-07-12 09:57:50 +0000 pfctl: Fail on missing anchor There is no reason to continue on anchor specific paths if the given anchor does not exist. OK sashan Obtained from: OpenBSD, kn , ad846651a1 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/pfctl.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c index 10f3ee1f44e9..dca9bba06a3e 100644 --- a/sbin/pfctl/pfctl.c +++ b/sbin/pfctl/pfctl.c @@ -1340,13 +1340,8 @@ pfctl_show_rules(int dev, char *path, int opts, enum pfctl_show format, u_int32_t mnr, nr; memset(&prs, 0, sizeof(prs)); - if ((ret = pfctl_get_rulesets(pfh, npath, &mnr)) != 0) { - if (ret == EINVAL) - fprintf(stderr, "Anchor '%s' " - "not found.\n", anchorname); - else - errc(1, ret, "DIOCGETRULESETS"); - } + if ((ret = pfctl_get_rulesets(pfh, npath, &mnr)) != 0) + errx(1, "%s", pf_strerror(ret)); for (nr = 0; nr < mnr; ++nr) { if ((ret = pfctl_get_ruleset(pfh, npath, nr, &prs)) != 0) @@ -2962,13 +2957,8 @@ pfctl_walk_anchors(int dev, int opts, const char *anchor, int ret; memset(&pr, 0, sizeof(pr)); - if ((ret = pfctl_get_rulesets(pfh, anchor, &mnr)) != 0) { - if (ret == EINVAL) - fprintf(stderr, "Anchor '%s' not found.\n", anchor); - else - errc(1, ret, "DIOCGETRULESETS"); - return (-1); - } + if ((ret = pfctl_get_rulesets(pfh, anchor, &mnr)) != 0) + errx(1, "%s", pf_strerror(ret)); for (nr = 0; nr < mnr; ++nr) { char sub[MAXPATHLEN]; From nobody Sat Jul 12 13:38:54 2025 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 4bfV6R2vCmz61sp8; Sat, 12 Jul 2025 13:38:55 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bfV6Q6tTMz3CfQ; Sat, 12 Jul 2025 13:38:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752327535; 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=WduKrSCntcrs7jNS2g3M/1AMUTE1GNX2nKvlw3VfP74=; b=beVOARJALvSr+t7aHf3jVVcKvw0fhiOEQQ4/Z6Vo+PFdpjYatSrA53A2hHjznH42IMBViI Z78r9e4NNKxnA4uUiYw9uViWHQTYLSn/475e1H5OwDTdnJWBYHYBQKZLWp1diSGP+XkAsm a6drJ+YQNrhRPT5trLuKMuu/gFRdFU+C7b6FnnW9cTMgfmJCsb5LYMYBjFYxtMoylhawX5 3hcoJtwI5wj6ERBZHRul9KJJaAwAHPZgW3E02QQ00Ma90Z18jXgzyUhzeeZaH6U4nHHOJ7 gX6AAAZLThZd/0KMWV2CwSJG0CajayRDymi9lO1fDIF48Y2RNos+BpJV9UWmBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752327535; 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=WduKrSCntcrs7jNS2g3M/1AMUTE1GNX2nKvlw3VfP74=; b=ZRwPkCO8I0hnvJ8+6hlxSKNV/DswugwxdOMo2fMLgAQZyOIDuqBuQZszjxTb7EOZHWM1w5 Oi84pdNFETwDws76p1L0w9GjFVYrE0ESMC/L/TKVbNGEk4BnTaGMR23IiNGej7FJKwgqHt dxdOwIaHNnj8NDgUjBOzprx5NmVuJkAzsD0LMSgf1hrqeo6BR4r09n/epXiqXoZDmk88Tf +K/lqcZVlj59mYA8i1T8R7eaEA7fKsvoufUVsIwcbIXFASH4i36wD361hzp1ddMI18Tvbj TQXL6tuIC4Ffkbobovyu09Hy7nfV6fSM91/u3aqDX4G3mxrCIJ/cpM8l2NWexw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752327535; a=rsa-sha256; cv=none; b=xsEY0La0EDWOTh8/gbYbj40F0GQGlTTiTPEs5U45ueb10y/MGdqb/YM27XKqX6wB36/Z8k Te1qCyWcUhzPUlummXIJx/hv6mHV42Z/qVc8/sXrlFpNbtFRtEpt/mI1E4YsLqTxtMNlfp Kuhzaao4kuhWLyZpdqyIr5wCngMbXEWPO3m1HkcVDELU74Ym1NvRGKSc1315XHdVIJzlLE JNO6j3eJbYhoRGNEJjOnR3lCOugaA9PnWwu2ZtXNb+Pg5f32+2tNccbx/6xPZPCd4hj2QD HhsT3yY7L2hjyjmjB/EpeMpQIxJDleRD8GRPKCs3I6NJXhQ+zeNQawkWybeThQ== 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 4bfV6Q4t3Fz8mY; Sat, 12 Jul 2025 13:38:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56CDcs9N089036; Sat, 12 Jul 2025 13:38:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56CDcsNQ089033; Sat, 12 Jul 2025 13:38:54 GMT (envelope-from git) Date: Sat, 12 Jul 2025 13:38:54 GMT Message-Id: <202507121338.56CDcsNQ089033@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 3030d29571e5 - main - pfctl: restore '.' at the end of these errors 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3030d29571e54b609ce8652a45cdb39e814b4b73 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=3030d29571e54b609ce8652a45cdb39e814b4b73 commit 3030d29571e54b609ce8652a45cdb39e814b4b73 Author: Kristof Provost AuthorDate: 2025-07-07 07:55:35 +0000 Commit: Kristof Provost CommitDate: 2025-07-12 09:57:51 +0000 pfctl: restore '.' at the end of these errors The sys/netpfil/pf/table:reset_nonzero test expects them, and we're better off not modifying errors without good reason. Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/pfctl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c index dca9bba06a3e..271286deeda7 100644 --- a/sbin/pfctl/pfctl.c +++ b/sbin/pfctl/pfctl.c @@ -3639,10 +3639,10 @@ pf_strerror(int errnum) { switch (errnum) { case ESRCH: - return "Table does not exist"; + return "Table does not exist."; case EINVAL: case ENOENT: - return "Anchor does not exist"; + return "Anchor does not exist."; default: return strerror(errnum); } From nobody Sat Jul 12 13:38:53 2025 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 4bfV6Q0Zb6z61sTp; Sat, 12 Jul 2025 13:38:54 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bfV6P4Vlkz3CX0; Sat, 12 Jul 2025 13:38:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752327533; 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=0GSLK4zHRbKynMxwxhqhX/RF5/suLGOdsqsTnYIrXWs=; b=gJSfPuK7dXcJ3flCkOajpoGk2O94Wsrycmm6gbuQstaVTXjet1zhCiKrjqV3Bf3QWtrKVe C2LHNAKQDOi0SmtRHPoHmE3oqRis3GAUaPnQeYzZJhBWceez17WKJt/Jov3WmGH1leHZzN TXM/ge/te1gA3GS7n+MMg+vL+EAjhNPO7rWC4NH/tVVftfTxA0Web0Z7EE5OXG6u3HFKaf YDhOayovv6hm614Lo9V4fEiv8Vu/D5qcg7PSPRAHVGRMBjUekMj+3rajxM+wR62MIRi4XF 8L6N3qn6BVeBJe2+k1xTaM/Qt4yYYu06qfjs2a/QIVhysOq+LOfWgkfCYDMKqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752327533; 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=0GSLK4zHRbKynMxwxhqhX/RF5/suLGOdsqsTnYIrXWs=; b=uuyeHorGQuo1MRW0iipy8Sa2RvBkMY2KfqMXUb6nPDDLu9DaRNWCbq6HEW/cjdi4kTMDOL PA1XkYOt2BvOqQys1B0bHF+mDVgqYAUp8ulNm5PZMzrTy1U/quMfnMV+ZxjeFKN82huKWs Q9hULE+Pjd4TraVGYOGtRqLEYALLcOQ2hO2dEitoiPP1K6Jefc60vj1LuUmHBmgc9/Sp1P WCxB2c3qHlIc2UVdXiK4jGFOaUCkIs9ar7ERltayvakySPEs7JlS28XraqqSOqKn2EUO8X 8cX32aKVDAzWThJUDH2TBwmoOpXxF1Jt8lUoLcN+sTn+7x7I//8CxUCp+RnmWQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752327533; a=rsa-sha256; cv=none; b=oaPNqWNUsvqLypaXkDtXyKGqvn+nZ3k0EHroY8ziwmDeM8HmjOIejSnd2n6VQV9zdvoUa8 IuI2g3Z3nDF8orhT0ca7QjC3gbVaQk4UG05YCOM8LwTRFKkDkmGWNXZHmi2b2QtfEDaxa+ 7TTOmogCHAWSpaVxgMuqQNU8Ay06BHfucHQBLw8WFIDRC+psbLa40HMCDpQ0w81h4+RwqS HR/2bdPO/wFxQMHBwcC+7X9P8cGrBpS2PjUjZgoOZa/2gYQGJjUMnJYTAnm+Sx32k4/1zb o50OqI0d57yBZF8tIjQe7IhXdt7N3VKpcgeHXG2j1LsOQmibrxSgVKUpCFfy7w== 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 4bfV6P3x0Gz9H1; Sat, 12 Jul 2025 13:38:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56CDcrnF088995; Sat, 12 Jul 2025 13:38:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56CDcrKV088992; Sat, 12 Jul 2025 13:38:53 GMT (envelope-from git) Date: Sat, 12 Jul 2025 13:38:53 GMT Message-Id: <202507121338.56CDcrKV088992@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: a9706d78bddf - main - pfctl: replace TAILQ concatenation loop with TAILQ_CONCAT 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a9706d78bddf3e002d108d7ceb189cf40064fea2 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=a9706d78bddf3e002d108d7ceb189cf40064fea2 commit a9706d78bddf3e002d108d7ceb189cf40064fea2 Author: Kristof Provost AuthorDate: 2025-07-07 07:16:56 +0000 Commit: Kristof Provost CommitDate: 2025-07-12 09:57:51 +0000 pfctl: replace TAILQ concatenation loop with TAILQ_CONCAT OK kn@, sashan@, florian@ Obtained from: OpenBSD, bket , c8d5c2349e Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/parse.y | 14 +++----------- sbin/pfctl/pfctl_optimize.c | 17 +++-------------- 2 files changed, 6 insertions(+), 25 deletions(-) diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index 2188324c15cb..9a917d1d8464 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -7202,19 +7202,11 @@ mv_rules(struct pfctl_ruleset *src, struct pfctl_ruleset *dst) struct pfctl_rule *r; for (i = 0; i < PF_RULESET_MAX; ++i) { - while ((r = TAILQ_FIRST(src->rules[i].active.ptr)) - != NULL) { - TAILQ_REMOVE(src->rules[i].active.ptr, r, entries); - TAILQ_INSERT_TAIL(dst->rules[i].active.ptr, r, entries); + TAILQ_FOREACH(r, src->rules[i].active.ptr, entries) dst->anchor->match++; - } + TAILQ_CONCAT(dst->rules[i].active.ptr, src->rules[i].active.ptr, entries); src->anchor->match = 0; - while ((r = TAILQ_FIRST(src->rules[i].inactive.ptr)) - != NULL) { - TAILQ_REMOVE(src->rules[i].inactive.ptr, r, entries); - TAILQ_INSERT_TAIL(dst->rules[i].inactive.ptr, - r, entries); - } + TAILQ_CONCAT(dst->rules[i].inactive.ptr, src->rules[i].inactive.ptr, entries); } } diff --git a/sbin/pfctl/pfctl_optimize.c b/sbin/pfctl/pfctl_optimize.c index d65503a3efb3..b82e88652f86 100644 --- a/sbin/pfctl/pfctl_optimize.c +++ b/sbin/pfctl/pfctl_optimize.c @@ -723,11 +723,7 @@ reorder_rules(struct pfctl *pf, struct superblock *block, int depth) * it based on a more optimal skipstep order. */ TAILQ_INIT(&head); - while ((por = TAILQ_FIRST(&block->sb_rules))) { - TAILQ_REMOVE(&block->sb_rules, por, por_entry); - TAILQ_INSERT_TAIL(&head, por, por_entry); - } - + TAILQ_CONCAT(&head, &block->sb_rules, por_entry); while (!TAILQ_EMPTY(&head)) { largest = 1; @@ -748,11 +744,7 @@ reorder_rules(struct pfctl *pf, struct superblock *block, int depth) * Nothing useful left. Leave remaining rules in order. */ DEBUG("(%d) no more commonality for skip steps", depth); - while ((por = TAILQ_FIRST(&head))) { - TAILQ_REMOVE(&head, por, por_entry); - TAILQ_INSERT_TAIL(&block->sb_rules, por, - por_entry); - } + TAILQ_CONCAT(&block->sb_rules, &head, por_entry); } else { /* * There is commonality. Extract those common rules @@ -863,10 +855,7 @@ block_feedback(struct pfctl *pf, struct superblock *block) */ TAILQ_INIT(&queue); - while ((por1 = TAILQ_FIRST(&block->sb_rules)) != NULL) { - TAILQ_REMOVE(&block->sb_rules, por1, por_entry); - TAILQ_INSERT_TAIL(&queue, por1, por_entry); - } + TAILQ_CONCAT(&queue, &block->sb_rules, por_entry); while ((por1 = TAILQ_FIRST(&queue)) != NULL) { TAILQ_REMOVE(&queue, por1, por_entry); From nobody Sat Jul 12 13:38:55 2025 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 4bfV6S59H9z61stb; Sat, 12 Jul 2025 13:38:56 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bfV6R6Ks8z3Cfg; Sat, 12 Jul 2025 13:38:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752327535; 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=WVC905ryfPPIf6pwb6iejwfneNZj8uygIr1++BjvwVM=; b=A+2wvM+Kgtbwwi66bgUfkJWWG+mK+gMMPsZhHGWBFDfwBigbcKDMUscayEWXzRDrQQC6+N hLWr+xp0wE3cB9KUu/l8Fqpd4JSBvIIdT0nMYLP8dJFmIwChiriUd6k8I6gJKbhlrLE8e7 /FFUPynv0/xLeose5zMx8MwuZWBZSacFfIGwXfg5FLhUrRsEhWHYq1qVQlFuMyqPqCEdn+ 3g0l1IoEEs2uR+3kg+TR1XCCPa9OuW17a3GM+OOpnlsZoPTg2jHc2kchHh05QgLU0Vs+Ck EVIaI+d7qyEUGM/cJQTxXbN42gqLx3K1tg9e9BES9qniZI8F2DNhn9I/IRrjrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752327535; 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=WVC905ryfPPIf6pwb6iejwfneNZj8uygIr1++BjvwVM=; b=NURzLTWAce988AuYOzghKTQLesac0AIrHjoUZuhXgUIG/Ucz346xo2+PKpGTdW1ZN7p2Kr eq8scXJgl9K/p7orydsfr97fh5ixnwBUKAIQ/mJ6NaIpxGzMxVjXGk8w82gkHdziDA0+b0 Aish3cq+N+TVxCY77ivA8ZieGrVC/oMtBE46adq2iFaKhd5RmBLrPNzQUKeM35WBdLjVDR BkSNhoKO3y49JOehen9m/OTCD+f4yTtpJGI4MAsArnYskJntYoxPdFZynLVZxdmOecef5Z ilhoB/qqSdKH7+pnrZKldJWaALNd3fYjdpryI4vXZC4RqaJ1cJg8GiSJJBMHGg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752327535; a=rsa-sha256; cv=none; b=smBKv/D/MXhCwK2Tuk/VaC15i6JU0kqbp4FjTDL86st722W7rviXiMlL4YaSwXD9J+aBtS alCbMH1k5WwCzDsY1A2pu4ClUlVDg88ZJNM9GBgWZ+eAyM2WEQ8SFhCPNClcCecMZ8FJWh G/y/xyAPBZnRIyjJZuvdQJqC1tVLkM6Ba5X18UCdQ9QLsclsWDBwtgnynSua2gQY3PUBcm +gE8RzfvMrF/UY/cAAWOaA/BeMY/LoQVtAUp536n7z/ZymMmXCXjx63i+XDLqIQJUTUmD0 MYNII/rfmZ95Yj5GGky6r91yRUrr8kuRhHa2tiPTzKVde1rk8XnrBcYch9l+ag== 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 4bfV6R5XS8z8q0; Sat, 12 Jul 2025 13:38:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56CDctdu089075; Sat, 12 Jul 2025 13:38:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56CDctLv089070; Sat, 12 Jul 2025 13:38:55 GMT (envelope-from git) Date: Sat, 12 Jul 2025 13:38:55 GMT Message-Id: <202507121338.56CDctLv089070@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 8bced6260072 - main - pf: Fix pfr_kentry_byaddr() to be used for a rule in an anchor 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8bced626007201293dbbbc217d4a6dd7e8ecc9fc Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=8bced626007201293dbbbc217d4a6dd7e8ecc9fc commit 8bced626007201293dbbbc217d4a6dd7e8ecc9fc Author: Kristof Provost AuthorDate: 2025-07-07 09:26:06 +0000 Commit: Kristof Provost CommitDate: 2025-07-12 09:57:51 +0000 pf: Fix pfr_kentry_byaddr() to be used for a rule in an anchor It couldn't find an entry if its table is attached a table on the root. This fixes the problem "route-to least-states" doesn't work. The problem is found by IIJ. OK sashan Obtained from: OpenBSD, yasuoka , a7d8badaea Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf_table.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/sys/netpfil/pf/pf_table.c b/sys/netpfil/pf/pf_table.c index 43e4366845a2..4faf328a2315 100644 --- a/sys/netpfil/pf/pf_table.c +++ b/sys/netpfil/pf/pf_table.c @@ -2074,11 +2074,11 @@ pfr_lookup_table(struct pfr_table *tbl) (struct pfr_ktable *)tbl)); } -int -pfr_match_addr(struct pfr_ktable *kt, struct pf_addr *a, sa_family_t af) +static struct pfr_kentry * +pfr_kentry_byaddr(struct pfr_ktable *kt, struct pf_addr *a, sa_family_t af, + int exact) { struct pfr_kentry *ke = NULL; - int match; PF_RULES_RASSERT(); @@ -2121,11 +2121,26 @@ pfr_match_addr(struct pfr_ktable *kt, struct pf_addr *a, sa_family_t af) default: unhandled_af(af); } + if (exact && ke && KENTRY_NETWORK(ke)) + ke = NULL; + + return (ke); +} + +int +pfr_match_addr(struct pfr_ktable *kt, struct pf_addr *a, sa_family_t af) +{ + struct pfr_kentry *ke = NULL; + int match; + + ke = pfr_kentry_byaddr(kt, a, af, 0); + match = (ke && !ke->pfrke_not); if (match) pfr_kstate_counter_add(&kt->pfrkt_match, 1); else pfr_kstate_counter_add(&kt->pfrkt_nomatch, 1); + return (match); } From nobody Sat Jul 12 13:38:56 2025 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 4bfV6T4XSMz61srP; Sat, 12 Jul 2025 13: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bfV6S752zz3Cjd; Sat, 12 Jul 2025 13:38:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752327537; 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=d/I3GsDzxfKgegM+xdMzyvg9iSCcQyibL+qVlxKw2vQ=; b=BSEfvQME40hlO+NHvD6GZ1yr9FhUlBLPKuaYKG902f27WTwtvqJNfyt0H/FNsWhrKSkrQz mBTKwnv2yZcxkJJaM9ETLNiHH6P8ZGMQhzloNG08oQYxFbPo1Un2ykBLoil16z4RoqZDw0 DZe/ZV4FyhSEcUAcQQeAfBi7DvGUiLVDE59NVTV4SZkMRHbBeNHHZRm5fKLTX+45V1w5ax BNPViQD1IeTzCPnp2dLXIqGsdgJwHNohQH7CV4p50WKKGEf3vTTQnBo6DacYGCiewUEOtz HZ+o5zSeYKw/uCYcemW1QeotG1oF5we5zBON7BvgEIrUs/M4RH+UDjv7XzOhuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752327537; 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=d/I3GsDzxfKgegM+xdMzyvg9iSCcQyibL+qVlxKw2vQ=; b=veJJazHcWeYVRa4sOfXxurcxht4O0FhqdNlD2LLddkGakeb61B4VEYB0HSlGo+P77A9max UxsXjosmAHnP6+fYoE5SRVYPdiN151TibWnSWoUf9Loyai59MDfqnJwLFHT7YLL1lGBbhy tdkCCxBzVUViyIjXlUDwyPpZAo1QkkMa4849qXX/P3IBGqXjdGb+OPpGnK17ZcIEOXiGdt HP+5OZwSIihJoEuKKeWwl5HgXCg/+NPOpIKLq6p/YcLlwKI+CYO7kls9NGwlgDxw75juuJ mV4R3/D/yjNgWyweqDneW+0/8wIBnfHM2aXslWgAuoPas9SzNNomvhU6RMt0DA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752327537; a=rsa-sha256; cv=none; b=n4OsfBsGMtw7Fs+7rh/CFg+disfjU3tznqxbb1dpCY1j8as5jEwYe0EDV5CVEo9XmI7jg4 67PWoGltxweHkOLfcaXh2eFSrDmpqCTaR4aSUK8gDReAdV5I6j7h0hmB7rssU3aPgKf+mO NJesX47gAl32fXxMiV8BNmFsgLNPe9DtkigBd1+O9GEFdjabXMP0k3kYZpr9+XSG8Pcy7I 4QTCh/RY20+ensZpV4DfFdMTdauOuadZLaU3GJQsaJeUQprMRoX6VNOoALbS2EWU4h2ffP ZOmNun6AQNa8D+0FCxooxsWpYda0EQ5tvPqwLXQHd3PmafoOAIQHt0b1tFFYnA== 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 4bfV6S6Yw1z8sh; Sat, 12 Jul 2025 13:38:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56CDcuIh089110; Sat, 12 Jul 2025 13:38:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56CDcuYH089107; Sat, 12 Jul 2025 13:38:56 GMT (envelope-from git) Date: Sat, 12 Jul 2025 13:38:56 GMT Message-Id: <202507121338.56CDcuYH089107@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: a4b7e540009f - main - pfctl.8: Mention hostid and checksum 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a4b7e540009f7ae5eac07387762d2063cff25369 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=a4b7e540009f7ae5eac07387762d2063cff25369 commit a4b7e540009f7ae5eac07387762d2063cff25369 Author: Kristof Provost AuthorDate: 2025-07-07 09:28:36 +0000 Commit: Kristof Provost CommitDate: 2025-07-12 09:57:52 +0000 pfctl.8: Mention hostid and checksum Complete the description of "-s info -v" such that grepping for them in the manual pager yields something. Feedback jmc OK sashan Obtained from: OpenBSD, kn , 0f5c867d7c Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/pfctl.8 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sbin/pfctl/pfctl.8 b/sbin/pfctl/pfctl.8 index 508dcc6ea8d4..f582c6301124 100644 --- a/sbin/pfctl/pfctl.8 +++ b/sbin/pfctl/pfctl.8 @@ -487,7 +487,10 @@ Show the contents of the source tracking table. Show filter information (statistics and counters). When used together with .Fl v , -source tracking statistics are also shown. +source tracking statistics, the firewall's 32-bit hostid number and the +main ruleset's MD5 checksum for use with +.Xr pfsync 4 +are also shown. .It Fl s Cm Running Show the running status and provide a non-zero exit status when disabled. .It Fl s Cm labels From nobody Sat Jul 12 13:38:57 2025 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 4bfV6W0lwLz61stj; Sat, 12 Jul 2025 13:38:59 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bfV6V1BF0z3Cg8; Sat, 12 Jul 2025 13:38:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752327538; 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=X2i6EHWhbwt99ssikSZwvUS8Yg8NMvWWowGViNbXpUA=; b=jNIwRZf6m5MnUwPpSsl+6OWHVV2J4irjm5e+ITmsTk9AVupimPrrHAhw+ip50eLLZvJxYN qaBFpITsufG3OXrv2AuAO+kTGDK2Ub9+HTzpop0XI8n84wXEaYXF8ZwS+vK8cGzAWFYyLh DfmS4ljWB8YNknV7DF797LhGzTNa6Xr5LbP1cy0hqIcH9irGdI+Kp7KPnPh6voZi7eqlhs jcSALRubr5NxO89xd0MRmH7vPUUenWlqnKTe/0RZjpWaO8eYsjcuukOhJrd13UmAcZB8Ev pbIOrHsXVLgqnjLWeFrcM+AAvLeBw+6TgzGt+z9uaIotKqYYkUMWcCL3fvDVpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752327538; 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=X2i6EHWhbwt99ssikSZwvUS8Yg8NMvWWowGViNbXpUA=; b=jbNgooquh3IgkpEy5JcwHoHIwX0qzb/XNMPC3eFooAUlAZxnLfLgmKL+v6WqEGXocmKrGU m//U1TCcA0D0e1RopIwYFlznybyXAav/h7nVP2/BdVYTIkRdJL0Pb+Y2V5FQ5QbbBgkFZz 2Occnzx+DY9q3geVMEBqM4fHf9UOZZrZJwS8ErCv55pYtzbWSWMdgzBY99BC1VGjXfLAc2 nslr3ESVCjOp5CskgBPh4tE6a6l63etHeRa1cp8DGSnB4RsGxZURYz2nsK6pj2YarFfLfa ObMi3t9Mv/3IytLIeW4eDUPe1eKQEfsN85w9vBSvdNBaXFudu2vfTvX0IDRm2g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752327538; a=rsa-sha256; cv=none; b=i61qenSYKAzh0QOCDe6Ij6XNY8C5zqr3Y4EB7BXAOAVala333o0n7gWURxE5WOv7uGfmuX TQzDHeisOnFqjBNuypOA0oZjR3ZyQiJmYu84blKGmjPZQf6taFkSF2huR1dwMJdkBJ5VC6 en1kxQlTr5K74Yk+RgRdq5z8LTg2dwuaDSTjqctpQE20KnhbZSFJRjSfJQexZbD2njdY2H ZkNh5Zwvo6XGtjDVBYeb+VoFVzIvAC6VLvGub63563DOmoAN8+nEp2rTCMW6OQadnzM6PC s83PdB8b2AknlWXbJ0duW6ZgdOs1SjbcWVJlvHMQa6pwZioORxMA+s6+Hpdy8g== 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 4bfV6V0M74z8mZ; Sat, 12 Jul 2025 13:38:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56CDcvYr089145; Sat, 12 Jul 2025 13:38:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56CDcvIl089142; Sat, 12 Jul 2025 13:38:57 GMT (envelope-from git) Date: Sat, 12 Jul 2025 13:38:57 GMT Message-Id: <202507121338.56CDcvIl089142@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 9f21a946d016 - main - pf: rename PF_OPT_TABLE_PREFIX to PF_OPTIMIZER_TABLE_PFX 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9f21a946d01690cdfba43beba60ab04fc884741a Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=9f21a946d01690cdfba43beba60ab04fc884741a commit 9f21a946d01690cdfba43beba60ab04fc884741a Author: Kristof Provost AuthorDate: 2025-07-07 09:39:07 +0000 Commit: Kristof Provost CommitDate: 2025-07-12 09:57:52 +0000 pf: rename PF_OPT_TABLE_PREFIX to PF_OPTIMIZER_TABLE_PFX Move it to pf.h. OPT is misleading and usually refers to command line arguments to pfctl ok sashan kn Obtained from: OpenBSD, henning , 9c6ad19ba4 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/pfctl_optimize.c | 6 +++--- sbin/pfctl/pfctl_parser.h | 1 - sys/netpfil/pf/pf.h | 1 + 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sbin/pfctl/pfctl_optimize.c b/sbin/pfctl/pfctl_optimize.c index b82e88652f86..1d2a60555f19 100644 --- a/sbin/pfctl/pfctl_optimize.c +++ b/sbin/pfctl/pfctl_optimize.c @@ -1248,7 +1248,7 @@ add_opt_table(struct pfctl *pf, struct pf_opt_tbl **tbl, sa_family_t af, /* This is just a temporary table name */ snprintf((*tbl)->pt_name, sizeof((*tbl)->pt_name), "%s%d", - PF_OPT_TABLE_PREFIX, tablenum++); + PF_OPTIMIZER_TABLE_PFX, tablenum++); DEBUG("creating table <%s>", (*tbl)->pt_name); } @@ -1315,9 +1315,9 @@ pf_opt_create_table(struct pfctl *pf, struct pf_opt_tbl *tbl) /* Now we have to pick a table name that isn't used */ again: DEBUG("translating temporary table <%s> to <%s%x_%d>", tbl->pt_name, - PF_OPT_TABLE_PREFIX, table_identifier, tablenum); + PF_OPTIMIZER_TABLE_PFX, table_identifier, tablenum); snprintf(tbl->pt_name, sizeof(tbl->pt_name), "%s%x_%d", - PF_OPT_TABLE_PREFIX, table_identifier, tablenum); + PF_OPTIMIZER_TABLE_PFX, table_identifier, tablenum); PFRB_FOREACH(t, &table_buffer) { if (strcasecmp(t->pfrt_name, tbl->pt_name) == 0) { /* Collision. Try again */ diff --git a/sbin/pfctl/pfctl_parser.h b/sbin/pfctl/pfctl_parser.h index 778105c2b96d..7a3c0c2a523f 100644 --- a/sbin/pfctl/pfctl_parser.h +++ b/sbin/pfctl/pfctl_parser.h @@ -263,7 +263,6 @@ struct pf_opt_tbl { struct node_tinithead pt_nodes; struct pfr_buffer *pt_buf; }; -#define PF_OPT_TABLE_PREFIX "__automatic_" /* optimizer pf_rule container */ struct pf_opt_rule { diff --git a/sys/netpfil/pf/pf.h b/sys/netpfil/pf/pf.h index 2009d2907985..db353d185368 100644 --- a/sys/netpfil/pf/pf.h +++ b/sys/netpfil/pf/pf.h @@ -490,6 +490,7 @@ struct pf_osfp_ioctl { #define PF_ANCHOR_NAME_SIZE 64 #define PF_ANCHOR_MAXPATH (MAXPATHLEN - PF_ANCHOR_NAME_SIZE - 1) +#define PF_OPTIMIZER_TABLE_PFX "__automatic_" struct pf_rule { struct pf_rule_addr src; From nobody Sat Jul 12 13:38:59 2025 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 4bfV6W58whz61stk; Sat, 12 Jul 2025 13:38:59 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bfV6W1lP7z3CmD; Sat, 12 Jul 2025 13:38:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752327539; 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=wQfmzB2jnVastGX9Kro1/jI2dZ4mmcFEi57YUclnK3U=; b=a3KwwVAkFruhm40Qmq9qGtIHqJmcZJba6dqRwd9BqpIXd7sEqLNuWO6VP+s8F5w1w24S/X hNA9yOLRdIDQnJOmmlgZXqyyEpUm+WdTwaMM9JlWalW4QahNICb8EyTrZlvPC07mRJe8Ko krG//B9s5T9qhHk1DJjVnmgNUCI19+40VQBZHZE4DNwEWtiGcU7O4q0BbdYUmYrho4r2J9 eGWbkBS27WIOwLhQfcfLI4s2sJKAe9NsxHT0EsXgJYLZZj33CT7xgBvi7A1HoUFst1v0CB 3Ahqht9Jio2U5XgJ8JfBnEyGvEJ8k2Z6lLOEsUGjqQxAmpeveOwOrr3fquLdpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752327539; 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=wQfmzB2jnVastGX9Kro1/jI2dZ4mmcFEi57YUclnK3U=; b=jV+xDVwTsd/Q12t+PNPFG6mqz2+AuUb4yROuz+TsKh8c1coOsSmT6SHSj8xQe+cWG1WwyZ JuoBiSv4sI6Rhu9LfFp2zD8p3ZDZswY5yKfUTKgEgIeIvJTrF37VF30Lr2dW0SZm5h6Qtf TdRUvmVQEtzc6giBbZM4y+zpzLG5TDP9LU0Hqowb1rkRHKdRoO/UX0LAjT510ZEo19xNPM hA4zmrgFCAbEOz4Ck6pUAxfIC0gIv4IKOtWm48F3fTFc85Xu/0koqCyUKc9ZstQ5rWLQGp WQES2tgmrSVismpl1MS7UbrkjE6dDDkCkwgXF9FpMV3m6iqD/zd1PL0WSMwSUw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752327539; a=rsa-sha256; cv=none; b=mvYEdvL9rjdXtxNqWFTEniSS1BqY09qt8zzeieS6hlTSxuUG2C35z7qxMH+okojwUATKUf w2+vSzeQIKLegy+Td8UviES5v9P43nz0HlYrjAhwgHpQZ0lDXY4Xd/Mxuqh+PI27XamLuL jBDQ1svnkGTTlMWOChD480IJqSUMwq0x8gAGI0iiDFSpJbAQyxPzsSEjdI3tsQiJriPGkZ y+l23uLGqPsJ7jAAbvKdA1yurDgvnkGA7LnHV9Wh/WWkmCwVVBwbX9G9vxYhE4XlRGEiz/ BNVRUEbp46Ox/ubZRzCSIZZljNpgoTQLC8vij8zRJLIPu9RXhQaiMyY7rlZmjQ== 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 4bfV6W1J8bz9H2; Sat, 12 Jul 2025 13:38:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56CDcx71089180; Sat, 12 Jul 2025 13:38:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56CDcxpo089177; Sat, 12 Jul 2025 13:38:59 GMT (envelope-from git) Date: Sat, 12 Jul 2025 13:38:59 GMT Message-Id: <202507121338.56CDcxpo089177@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 116eabaa0b5d - main - pf: when calculating the ruleset's checksum, skip automatic table names. 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 116eabaa0b5df490be19715fc032affbcda3f016 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=116eabaa0b5df490be19715fc032affbcda3f016 commit 116eabaa0b5df490be19715fc032affbcda3f016 Author: Kristof Provost AuthorDate: 2025-07-07 09:40:49 +0000 Commit: Kristof Provost CommitDate: 2025-07-12 09:57:52 +0000 pf: when calculating the ruleset's checksum, skip automatic table names. the checksum is exclusively used for pfsync to verify rulesets are identical on all nodes. the automatic table names are random and have a near zero chance to match. found at a customer in zurich ok sashan kn Obtained from: OpenBSD, henning , 7f1a6fd2a8 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf_ioctl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index c96741023db9..c14211edf10f 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -1274,7 +1274,9 @@ pf_hash_rule_addr(MD5_CTX *ctx, struct pf_rule_addr *pfr) PF_MD5_UPD(pfr, addr.iflags); break; case PF_ADDR_TABLE: - PF_MD5_UPD(pfr, addr.v.tblname); + if (strncmp(pfr->addr.v.tblname, PF_OPTIMIZER_TABLE_PFX, + strlen(PF_OPTIMIZER_TABLE_PFX))) + PF_MD5_UPD(pfr, addr.v.tblname); break; case PF_ADDR_ADDRMASK: /* XXX ignore af? */ From nobody Sat Jul 12 13:39:00 2025 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 4bfV6X7562z61sWL; Sat, 12 Jul 2025 13:39:00 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bfV6X2jvYz3CgZ; Sat, 12 Jul 2025 13:39:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752327540; 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=1N5CqexLM/9QJi0i/1iXj4N/lHZLQMZIvklyHh0/GCk=; b=i9d5NG4/WtWst3inC9lQZEELgC04r2gJ/uenakP3q6lf1o/oWUVScBCiSK+Oh7i42T366G lwYnm4i5TfQn9d1/drPrVlsI4F+bv7rLhfMQ9jm1/xUzrcHhpToicgclpIJv9bUe+vsvVS A9Lt+tbIqTE1iKYaRvDevLsfBz9EUIX+aB1uf75HrrP6miZwgcwG40390cQO3XM3FPxv+z Mtq5XkMDFeMgSj60xqhtAgTVuMGv4uvUBtpdi8+Zj6Qri6bJOIboKfwKbx4+ciUnSmhKgM nconhxt4fzjOtV+zbInEA81QmkOG3FIwDT3N5hQtEIhK9kg/q+NEkGIIu+DVjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752327540; 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=1N5CqexLM/9QJi0i/1iXj4N/lHZLQMZIvklyHh0/GCk=; b=wWc6M/R0v5vHfABafr3DU3VlDVbT6h/a1S1YKNml1gDS8Dkf5E6q711erwgTRzZYWYApI/ cnczfbhZRSO8+qny1LsE9g4y+kMOUJZXNsdmNasZ4ey9gWc01cr+O0lpivS8tlj17aoSXP e4yGIiQ00wZ+BpFmA0iJtN0YHuFeTl8GiwWS7lpNb2BoEoebgisEAVW8OTlGHVtiGAxeL3 QaCFkVfU3ggJXPlelT1fSqVSDDyNVLUEN4CtzAYYadRa/j2Uv+b/M7awj8cZDfVCURz1P5 5agqXbrCgtIuKZGXWjIZ/b/mGVTcITVe/rRaZS5gXjITuhjMpcecKpmCY3PiNg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752327540; a=rsa-sha256; cv=none; b=M0tgDfDhihWvG9qq224do8VjtPtP2f3JNpjnsnC1WypTMJ9xxx8sReABxmY8aK6tNqB3ZZ 1ufYu9VjkSalwkfoBnnaCysoXa8ge8aD2kAgnulnrOxRZEBitH8SelgkVgO0mcYiASljJe 1rkRYB6moFzj5J5sbtPkZ7fby3iZhk5beOH3j0SITOZkRao6a/sYcXoy1piVYjSOaBfQFS vJ9bBWZqq+Pcnsto0BcfTj9hefgfBuyF1iGuMEfG7F7YEdqHM8F5i+rFUcg+R14DZJmpKM 8ElU/rShzovNpl91l3usXVR2P+TQsxNgHPjYlUimO/dB03ldundmlaHxLqTSlA== 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 4bfV6X2HQ6z8LL; Sat, 12 Jul 2025 13:39:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56CDd0II089227; Sat, 12 Jul 2025 13:39:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56CDd0bK089224; Sat, 12 Jul 2025 13:39:00 GMT (envelope-from git) Date: Sat, 12 Jul 2025 13:39:00 GMT Message-Id: <202507121339.56CDd0bK089224@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 7c5cc952ff73 - main - pf: Use the table on root always if current table is not active. 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7c5cc952ff73f9b70d0f22d6600ddb1885daa784 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=7c5cc952ff73f9b70d0f22d6600ddb1885daa784 commit 7c5cc952ff73f9b70d0f22d6600ddb1885daa784 Author: Kristof Provost AuthorDate: 2025-07-07 10:02:58 +0000 Commit: Kristof Provost CommitDate: 2025-07-12 09:57:52 +0000 pf: Use the table on root always if current table is not active. ok sashan Obtained from: OpenBSD, yasuoka , 26b6297991 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/net/pfvar.h | 2 ++ sys/netpfil/pf/pf_lb.c | 49 ++++++++++++++++++++--------------------------- sys/netpfil/pf/pf_table.c | 26 ++++++++++++++++--------- 3 files changed, 40 insertions(+), 37 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 36fab1a03ee6..f915f6d0f8fa 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -2534,6 +2534,8 @@ int pfr_ina_rollback(struct pfr_table *, u_int32_t, int *, int); int pfr_ina_commit(struct pfr_table *, u_int32_t, int *, int *, int); int pfr_ina_define(struct pfr_table *, struct pfr_addr *, int, int *, int *, u_int32_t, int); +struct pfr_ktable + *pfr_ktable_select_active(struct pfr_ktable *); MALLOC_DECLARE(PFI_MTYPE); VNET_DECLARE(struct pfi_kkif *, pfi_all); diff --git a/sys/netpfil/pf/pf_lb.c b/sys/netpfil/pf/pf_lb.c index 308d76c46e5b..97e69c9d1986 100644 --- a/sys/netpfil/pf/pf_lb.c +++ b/sys/netpfil/pf/pf_lb.c @@ -545,6 +545,7 @@ pf_map_addr(sa_family_t af, struct pf_krule *r, struct pf_addr *saddr, { u_short reason = PFRES_MATCH; struct pf_addr *raddr = NULL, *rmask = NULL; + struct pfr_ktable *kt; uint64_t hashidx; int cnt; @@ -600,29 +601,25 @@ pf_map_addr(sa_family_t af, struct pf_krule *r, struct pf_addr *saddr, pf_poolmask(naddr, raddr, rmask, saddr, af); break; case PF_POOL_RANDOM: - if (rpool->cur->addr.type == PF_ADDR_TABLE) { - cnt = rpool->cur->addr.p.tbl->pfrkt_cnt; - if (cnt == 0) - rpool->tblidx = 0; + if (rpool->cur->addr.type == PF_ADDR_TABLE || + rpool->cur->addr.type == PF_ADDR_DYNIFTL) { + if (rpool->cur->addr.type == PF_ADDR_TABLE) + kt = rpool->cur->addr.p.tbl; else - rpool->tblidx = (int)arc4random_uniform(cnt); - memset(&rpool->counter, 0, sizeof(rpool->counter)); - if (pfr_pool_get(rpool->cur->addr.p.tbl, - &rpool->tblidx, &rpool->counter, af, NULL)) { + kt = rpool->cur->addr.p.dyn->pfid_kt; + kt = pfr_ktable_select_active(kt); + if (kt == NULL) { reason = PFRES_MAPFAILED; goto done_pool_mtx; /* unsupported */ } - pf_addrcpy(naddr, &rpool->counter, af); - } else if (rpool->cur->addr.type == PF_ADDR_DYNIFTL) { - cnt = rpool->cur->addr.p.dyn->pfid_kt->pfrkt_cnt; + cnt = kt->pfrkt_cnt; if (cnt == 0) rpool->tblidx = 0; else rpool->tblidx = (int)arc4random_uniform(cnt); memset(&rpool->counter, 0, sizeof(rpool->counter)); - if (pfr_pool_get(rpool->cur->addr.p.dyn->pfid_kt, - &rpool->tblidx, &rpool->counter, af, - pf_islinklocal)) { + if (pfr_pool_get(kt, &rpool->tblidx, &rpool->counter, + af, pf_islinklocal)) { reason = PFRES_MAPFAILED; goto done_pool_mtx; /* unsupported */ } @@ -671,29 +668,25 @@ pf_map_addr(sa_family_t af, struct pf_krule *r, struct pf_addr *saddr, hashidx = pf_hash(saddr, (struct pf_addr *)&hash, &rpool->key, af); - if (rpool->cur->addr.type == PF_ADDR_TABLE) { - cnt = rpool->cur->addr.p.tbl->pfrkt_cnt; - if (cnt == 0) - rpool->tblidx = 0; + if (rpool->cur->addr.type == PF_ADDR_TABLE || + rpool->cur->addr.type == PF_ADDR_DYNIFTL) { + if (rpool->cur->addr.type == PF_ADDR_TABLE) + kt = rpool->cur->addr.p.tbl; else - rpool->tblidx = (int)(hashidx % cnt); - memset(&rpool->counter, 0, sizeof(rpool->counter)); - if (pfr_pool_get(rpool->cur->addr.p.tbl, - &rpool->tblidx, &rpool->counter, af, NULL)) { + kt = rpool->cur->addr.p.dyn->pfid_kt; + kt = pfr_ktable_select_active(kt); + if (kt == NULL) { reason = PFRES_MAPFAILED; goto done_pool_mtx; /* unsupported */ } - pf_addrcpy(naddr, &rpool->counter, af); - } else if (rpool->cur->addr.type == PF_ADDR_DYNIFTL) { - cnt = rpool->cur->addr.p.dyn->pfid_kt->pfrkt_cnt; + cnt = kt->pfrkt_cnt; if (cnt == 0) rpool->tblidx = 0; else rpool->tblidx = (int)(hashidx % cnt); memset(&rpool->counter, 0, sizeof(rpool->counter)); - if (pfr_pool_get(rpool->cur->addr.p.dyn->pfid_kt, - &rpool->tblidx, &rpool->counter, af, - pf_islinklocal)) { + if (pfr_pool_get(kt, &rpool->tblidx, &rpool->counter, + af, pf_islinklocal)) { reason = PFRES_MAPFAILED; goto done_pool_mtx; /* unsupported */ } diff --git a/sys/netpfil/pf/pf_table.c b/sys/netpfil/pf/pf_table.c index 4faf328a2315..2034f4422ef1 100644 --- a/sys/netpfil/pf/pf_table.c +++ b/sys/netpfil/pf/pf_table.c @@ -2082,9 +2082,8 @@ pfr_kentry_byaddr(struct pfr_ktable *kt, struct pf_addr *a, sa_family_t af, PF_RULES_RASSERT(); - if (!(kt->pfrkt_flags & PFR_TFLAG_ACTIVE) && kt->pfrkt_root != NULL) - kt = kt->pfrkt_root; - if (!(kt->pfrkt_flags & PFR_TFLAG_ACTIVE)) + kt = pfr_ktable_select_active(kt); + if (kt == NULL) return (0); switch (af) { @@ -2150,9 +2149,8 @@ pfr_update_stats(struct pfr_ktable *kt, struct pf_addr *a, sa_family_t af, { struct pfr_kentry *ke = NULL; - if (!(kt->pfrkt_flags & PFR_TFLAG_ACTIVE) && kt->pfrkt_root != NULL) - kt = kt->pfrkt_root; - if (!(kt->pfrkt_flags & PFR_TFLAG_ACTIVE)) + kt = pfr_ktable_select_active(kt); + if (kt == NULL) return; switch (af) { @@ -2321,9 +2319,8 @@ pfr_pool_get(struct pfr_ktable *kt, int *pidx, struct pf_addr *counter, unhandled_af(af); } - if (!(kt->pfrkt_flags & PFR_TFLAG_ACTIVE) && kt->pfrkt_root != NULL) - kt = kt->pfrkt_root; - if (!(kt->pfrkt_flags & PFR_TFLAG_ACTIVE)) + kt = pfr_ktable_select_active(kt); + if (kt == NULL) return (-1); idx = *pidx; @@ -2470,3 +2467,14 @@ pfr_dynaddr_update(struct pfr_ktable *kt, struct pfi_dynaddr *dyn) unhandled_af(dyn->pfid_af); } } + +struct pfr_ktable * +pfr_ktable_select_active(struct pfr_ktable *kt) +{ + if (!(kt->pfrkt_flags & PFR_TFLAG_ACTIVE) && kt->pfrkt_root != NULL) + kt = kt->pfrkt_root; + if (!(kt->pfrkt_flags & PFR_TFLAG_ACTIVE)) + return (NULL); + + return (kt); +} From nobody Sat Jul 12 13:39:01 2025 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 4bfV6Z0Fnwz61sWM; Sat, 12 Jul 2025 13:39:02 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bfV6Y3jp0z3CwW; Sat, 12 Jul 2025 13:39:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752327541; 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=NRmkoCQ65C0f1tBHw/V0YU9v1MxSA3t0VyT+j03Art8=; b=AUN6ljxq2vZGUDHBEgocwMjiIBJwuBVAKtUxgKAqc43I9GIHh21Wf5ZwITFJdYlPDZZhyD vQ2OMzBAl7EHokSOYfH0LsXa52Mj676877PEEYN1toCWpHjx/Whsij/WryocRMNHKEOlyW OkTMBw60p1OkZvIeEuu50pBMYWPLaU1zDIRhyu7flHRAvC1I6cNp6Bup5m85G6walqBP/e UaLuVV+MZF4z/Zt9SF5vljd/4CoTdbZfVqqzLP/nGFh6XzZVfTdaUhaErcVUbpQXnc1Ojy KHjsiXlj433xN+AzU6+LABc+LiE9XfJNi7iGXO1e2JX8TwRlzWIHe/D8WvDEBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752327541; 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=NRmkoCQ65C0f1tBHw/V0YU9v1MxSA3t0VyT+j03Art8=; b=e16iFJVsc9TQLJBM+/v7/NG8isdz/J7zWDOddvDoQGIHzGQi4joy4Pa45eENU+x+jYZLLh SONc8tdaU4rJUAYjsNIUXXtlamrUnWKv/v/wposjqUdNBdSCKuDFaX3IMZ4Rdjjfx3OdKS jvyVnfP4Fx5FI97hglStW8M2o+KTM45+OXiXHTnqZjrqukNnD1Y0f31XGoJSTKpogcHTZo +fkUAoSz5aK66ZiegSMxUAQxQNed7zrFeXmRNG6V84FA3d4g7ME2OQiFY1WgJEXpl91vSL mKtJJ0DE4DNyuMnHaGnWNugeeeZAgcQGBLLMtTYB6dWbE+AYnRJ9EF79iGT6mA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752327541; a=rsa-sha256; cv=none; b=IHdaCAufDtG+Qx57HjncO21YRdsz5zOAF2DawuOjTx/QQnOJpnO5rn5dSjaKCUuf1ZHvvS 8L89AxW1HeipeFfbYpAjwAOC2Bz47WHpLF/B/UxggIqyOZQFD1hNIBWtPKkAJi42bSjaQ3 xf1sEEsqXlv80tPVgoCDSRDVfx+tCakxWCyvD7P9ILN+MseDIqc4xap8jpE8NSwET/4YNI atbmy2Tk2vcEFr7gJsMSIunWWKyfLL28QYVULw+bM9eVrxC6HBtK3ldXO79FW3TlV1OzYQ CB7HZmKUGKiPD+SIeGHRGjrd+BtDemGvd9VbdeqM6/DIoLRJhEWS9WIzW0nYEw== 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 4bfV6Y33Z8z8LM; Sat, 12 Jul 2025 13:39:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56CDd126089265; Sat, 12 Jul 2025 13:39:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56CDd103089262; Sat, 12 Jul 2025 13:39:01 GMT (envelope-from git) Date: Sat, 12 Jul 2025 13:39:01 GMT Message-Id: <202507121339.56CDd103089262@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 3e827cbaa364 - main - ipfilter: fix LINT-NOINET6 build 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3e827cbaa3641d7137d7c7f1af326243bf46ae15 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=3e827cbaa3641d7137d7c7f1af326243bf46ae15 commit 3e827cbaa3641d7137d7c7f1af326243bf46ae15 Author: Kristof Provost AuthorDate: 2025-07-12 13:00:38 +0000 Commit: Kristof Provost CommitDate: 2025-07-12 13:04:16 +0000 ipfilter: fix LINT-NOINET6 build Event: Berlin 2025 Hackathon Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c b/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c index 04850549db98..6eb6cf2a7a47 100644 --- a/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c +++ b/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c @@ -463,13 +463,14 @@ ipf_send_ip(fr_info_t *fin, mb_t *m) int ipf_send_icmp_err(int type, fr_info_t *fin, int dst) { - int err, hlen, xtra, iclen, ohlen, avail, code; + int err, hlen, xtra, iclen, ohlen, avail; struct in_addr dst4; struct icmp *icmp; struct mbuf *m; i6addr_t dst6; void *ifp; #ifdef USE_INET6 + int code; ip6_t *ip6; #endif ip_t *ip, *ip2; @@ -477,8 +478,8 @@ ipf_send_icmp_err(int type, fr_info_t *fin, int dst) if ((type < 0) || (type >= ICMP_MAXTYPE)) return (-1); - code = fin->fin_icode; #ifdef USE_INET6 + code = fin->fin_icode; /* See NetBSD ip_fil_netbsd.c r1.4: */ if ((code < 0) || (code >= sizeof(icmptoicmp6unreach)/sizeof(int))) return (-1); From nobody Sat Jul 12 14:19:41 2025 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 4bfW1V2Dd4z61vtd; Sat, 12 Jul 2025 14:19:42 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bfW1V0nmJz3Wx2; Sat, 12 Jul 2025 14:19:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752329982; 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=ok5c5iHxKtk0jEU1lY3orrTzyrKRTremph4Q4RtXxGE=; b=lePKSG1NWkieNsvfLqqaCnA/tmJxklH7QwccEhzW1/9+iinnl+pnzqIpx1pguTDDD0Ivq6 5j6DXTS4fAm4yx+XBUMci9NTzaXCjCyLkU6EROLn/FMBimafLXr94pfG7QiWDrwVLmNjs/ cSjU2u+wgKbufMQXhyOmii9+vlkWq140TZ09gGte/4Ndk9xetMsSSSsv5QumJkf2rd7395 B7NVrqioH2wysziruWDoE55/nBKYmHSvOV7om8qAiBjOgKLEDPy5PBhKjcBcitgE6Lf1/B wjgIM08s4lWFFzak+z6Efyx4ycPemzRUXBw4teGef0plD9WCsWU0eFx+k7l76g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752329982; 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=ok5c5iHxKtk0jEU1lY3orrTzyrKRTremph4Q4RtXxGE=; b=n4sczJxlusAhuS7ZR7xpeDhHT4cO5UX8MrlaDucOmtARuA43EgMCdpb0ZFWb8JIs5tLV8R T5s8IuEH5PE95jQc4wIHBP4axTiKQSUeQWvYXRywiqtTabARYtJgLpr7jGJungDlAZzNhn 8ogGjP36O3JtigdwUK4TQycFSElavkOew57q0eSZNTav0m8490kHdwZLdHnKIZboZpT/qn rU+Tk/pjgSkZwWeIyiwkWlBbw8Gh0lEUMumFi+i4q80LJ8GzNQjIw8v8M+DbDslqQWtTNe 4nEE8MHp9KJ7B4DrtWyCfEXMrCNxtct4DnswlNBYYik0sDt6kVJFNqWfPkBqtw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752329982; a=rsa-sha256; cv=none; b=uyVWOAZ1tmdtUJlevFdg8I9ZrtnWTBSNZ4N1QwF1qNutVJQeZVPsn3zPrZw4OjopMJjVL3 ggLv3sw+haHwsqviE4JPO/Irqfq8h83CL1V8dDztW3Y28WiPM9FlJX3+xbTNeLpYZxtQPX 5xk4kxkQ8Ojs4iRRxSUp8S5HO2TbVFRgfs0bQpIpjmk5RouJ5ljxgmjm2RPrpQFQ8dYuwd op9spjpoZV5OCIqRRNz8DEVUXpJmA+bV0mXEvNlYHNS9yvO68YRzFPrXmgnnBe7jXy2Iok EBMGGgYTGxXhSUYD7kE1baK32u6CKex1BqCGRVF0oQ2PT4vRkHqJBDQrTB0cLw== 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 4bfW1T70RdzBGh; Sat, 12 Jul 2025 14:19:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56CEJfen064970; Sat, 12 Jul 2025 14:19:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56CEJf92064967; Sat, 12 Jul 2025 14:19:41 GMT (envelope-from git) Date: Sat, 12 Jul 2025 14:19:41 GMT Message-Id: <202507121419.56CEJf92064967@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kajetan Staszkiewicz Subject: git: dedb4d3597e5 - main - pf: Don't return src node and hash from pf_map_addr_sn 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dedb4d3597e548bf72c380c850b061a8f5bec729 Auto-Submitted: auto-generated The branch main has been updated by ks: URL: https://cgit.FreeBSD.org/src/commit/?id=dedb4d3597e548bf72c380c850b061a8f5bec729 commit dedb4d3597e548bf72c380c850b061a8f5bec729 Author: Kajetan Staszkiewicz AuthorDate: 2025-05-08 08:28:22 +0000 Commit: Kajetan Staszkiewicz CommitDate: 2025-07-12 14:15:10 +0000 pf: Don't return src node and hash from pf_map_addr_sn The function pf_map_addr_sn() already returns naddr and nkif, there is no need to return the source node too, it is redundant. --- sys/net/pfvar.h | 1 - sys/netpfil/pf/pf.c | 4 +-- sys/netpfil/pf/pf_lb.c | 86 ++++++++++++++++++++++---------------------------- 3 files changed, 39 insertions(+), 52 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index f915f6d0f8fa..8ee4d00daaff 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -2714,7 +2714,6 @@ u_short pf_map_addr(u_int8_t, struct pf_krule *, u_short pf_map_addr_sn(u_int8_t, struct pf_krule *, struct pf_addr *, struct pf_addr *, struct pfi_kkif **nkif, struct pf_addr *, - struct pf_ksrc_node **, struct pf_srchash **, struct pf_kpool *, pf_sn_types_t); int pf_get_transaddr_af(struct pf_krule *, struct pf_pdesc *); diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index d5f01e5c4956..41658a29014e 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -5901,8 +5901,6 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, M_SETFIB(pd->m, pd->act.rtableid); if (r->rt) { - struct pf_ksrc_node *sn = NULL; - struct pf_srchash *snh = NULL; /* * Set act.rt here instead of in pf_rule_to_actions() because * it is applied only from the last pass rule. @@ -5910,7 +5908,7 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, pd->act.rt = r->rt; /* Don't use REASON_SET, pf_map_addr increases the reason counters */ ctx.reason = pf_map_addr_sn(pd->af, r, pd->src, &pd->act.rt_addr, - &pd->act.rt_kif, NULL, &sn, &snh, &(r->route), PF_SN_ROUTE); + &pd->act.rt_kif, NULL, &(r->route), PF_SN_ROUTE); if (ctx.reason != 0) goto cleanup; } diff --git a/sys/netpfil/pf/pf_lb.c b/sys/netpfil/pf/pf_lb.c index 97e69c9d1986..d4728f61dce8 100644 --- a/sys/netpfil/pf/pf_lb.c +++ b/sys/netpfil/pf/pf_lb.c @@ -80,7 +80,6 @@ static enum pf_test_status pf_step_into_translation_anchor(int, struct pf_test_c struct pf_krule *); static int pf_get_sport(struct pf_pdesc *, struct pf_krule *, struct pf_addr *, uint16_t *, uint16_t, uint16_t, - struct pf_ksrc_node **, struct pf_srchash **, struct pf_kpool *, struct pf_udp_mapping **, pf_sn_types_t); static bool pf_islinklocal(const sa_family_t, const struct pf_addr *); @@ -291,10 +290,8 @@ pf_match_translation(int rs_num, struct pf_test_ctx *ctx) } static int -pf_get_sport(struct pf_pdesc *pd, struct pf_krule *r, - struct pf_addr *naddr, uint16_t *nport, uint16_t low, - uint16_t high, struct pf_ksrc_node **sn, - struct pf_srchash **sh, struct pf_kpool *rpool, +pf_get_sport(struct pf_pdesc *pd, struct pf_krule *r, struct pf_addr *naddr, + uint16_t *nport, uint16_t low, uint16_t high, struct pf_kpool *rpool, struct pf_udp_mapping **udp_mapping, pf_sn_types_t sn_type) { struct pf_state_key_cmp key; @@ -322,19 +319,24 @@ pf_get_sport(struct pf_pdesc *pd, struct pf_krule *r, pf_addrcpy(&udp_source.addr, &pd->nsaddr, pd->af); udp_source.port = pd->nsport; if (udp_mapping) { + struct pf_ksrc_node *sn = NULL; + struct pf_srchash *sh = NULL; *udp_mapping = pf_udp_mapping_find(&udp_source); if (*udp_mapping) { pf_addrcpy(naddr, &(*udp_mapping)->endpoints[1].addr, pd->af); *nport = (*udp_mapping)->endpoints[1].port; - /* Try to find a src_node as per pf_map_addr(). */ - if (*sn == NULL && rpool->opts & PF_POOL_STICKYADDR && + /* + * Try to find a src_node as per pf_map_addr(). + * XXX: Why? This code seems to do nothing. + */ + if (rpool->opts & PF_POOL_STICKYADDR && (rpool->opts & PF_POOL_TYPEMASK) != PF_POOL_NONE) - *sn = pf_find_src_node(&pd->nsaddr, r, - pd->af, sh, sn_type, false); - if (*sn != NULL) - PF_SRC_NODE_UNLOCK(*sn); + sn = pf_find_src_node(&pd->nsaddr, r, + pd->af, &sh, sn_type, false); + if (sn != NULL) + PF_SRC_NODE_UNLOCK(sn); return (0); } else { *udp_mapping = pf_udp_mapping_create(pd->af, &pd->nsaddr, @@ -346,7 +348,7 @@ pf_get_sport(struct pf_pdesc *pd, struct pf_krule *r, } if (pf_map_addr_sn(pd->naf, r, &pd->nsaddr, naddr, NULL, &init_addr, - sn, sh, rpool, sn_type)) + rpool, sn_type)) goto failed; if (pd->proto == IPPROTO_ICMP) { @@ -470,9 +472,8 @@ pf_get_sport(struct pf_pdesc *pd, struct pf_krule *r, * pick a different source address since we're out * of free port choices for the current one. */ - (*sn) = NULL; if (pf_map_addr_sn(pd->naf, r, &pd->nsaddr, naddr, NULL, - &init_addr, sn, sh, rpool, sn_type)) + &init_addr, rpool, sn_type)) return (1); break; case PF_POOL_NONE: @@ -503,7 +504,6 @@ pf_islinklocal(const sa_family_t af, const struct pf_addr *addr) static int pf_get_mape_sport(struct pf_pdesc *pd, struct pf_krule *r, struct pf_addr *naddr, uint16_t *nport, - struct pf_ksrc_node **sn, struct pf_srchash **sh, struct pf_udp_mapping **udp_mapping, struct pf_kpool *rpool) { uint16_t psmask, low, highmask; @@ -523,16 +523,14 @@ pf_get_mape_sport(struct pf_pdesc *pd, struct pf_krule *r, for (i = cut; i <= ahigh; i++) { low = (i << ashift) | psmask; - if (!pf_get_sport(pd, r, - naddr, nport, low, low | highmask, sn, sh, rpool, - udp_mapping, PF_SN_NAT)) + if (!pf_get_sport(pd, r, naddr, nport, low, low | highmask, + rpool, udp_mapping, PF_SN_NAT)) return (0); } for (i = cut - 1; i > 0; i--) { low = (i << ashift) | psmask; - if (!pf_get_sport(pd, r, - naddr, nport, low, low | highmask, sn, sh, rpool, - udp_mapping, PF_SN_NAT)) + if (!pf_get_sport(pd, r, naddr, nport, low, low | highmask, + rpool, udp_mapping, PF_SN_NAT)) return (0); } return (1); @@ -767,36 +765,33 @@ done_pool_mtx: u_short pf_map_addr_sn(sa_family_t af, struct pf_krule *r, struct pf_addr *saddr, struct pf_addr *naddr, struct pfi_kkif **nkif, struct pf_addr *init_addr, - struct pf_ksrc_node **sn, struct pf_srchash **sh, struct pf_kpool *rpool, - pf_sn_types_t sn_type) + struct pf_kpool *rpool, pf_sn_types_t sn_type) { + struct pf_ksrc_node *sn = NULL; + struct pf_srchash *sh = NULL; u_short reason = 0; - KASSERT(*sn == NULL, ("*sn not NULL")); - /* * If this is a sticky-address rule, try to find an existing src_node. - * Request the sh to be unlocked if sn was not found, as we never - * insert a new sn when parsing the ruleset. */ if (rpool->opts & PF_POOL_STICKYADDR && (rpool->opts & PF_POOL_TYPEMASK) != PF_POOL_NONE) - *sn = pf_find_src_node(saddr, r, af, sh, sn_type, false); + sn = pf_find_src_node(saddr, r, af, &sh, sn_type, false); - if (*sn != NULL) { - PF_SRC_NODE_LOCK_ASSERT(*sn); + if (sn != NULL) { + PF_SRC_NODE_LOCK_ASSERT(sn); /* If the supplied address is the same as the current one we've * been asked before, so tell the caller that there's no other * address to be had. */ - if (PF_AEQ(naddr, &(*sn)->raddr, af)) { + if (PF_AEQ(naddr, &(sn->raddr), af)) { reason = PFRES_MAPFAILED; goto done; } - pf_addrcpy(naddr, &(*sn)->raddr, af); + pf_addrcpy(naddr, &(sn->raddr), af); if (nkif) - *nkif = (*sn)->rkif; + *nkif = sn->rkif; if (V_pf_status.debug >= PF_DEBUG_NOISY) { printf("pf_map_addr: src tracking maps "); pf_print_host(saddr, 0, af); @@ -828,8 +823,8 @@ pf_map_addr_sn(sa_family_t af, struct pf_krule *r, struct pf_addr *saddr, } done: - if ((*sn) != NULL) - PF_SRC_NODE_UNLOCK(*sn); + if (sn != NULL) + PF_SRC_NODE_UNLOCK(sn); if (reason) { counter_u64_add(V_pf_status.counters[reason], 1); @@ -883,8 +878,6 @@ pf_get_transaddr(struct pf_test_ctx *ctx, struct pf_krule *r, { struct pf_pdesc *pd = ctx->pd; struct pf_addr *naddr; - struct pf_ksrc_node *sn = NULL; - struct pf_srchash *sh = NULL; uint16_t *nportp; uint16_t low, high; u_short reason; @@ -912,8 +905,8 @@ pf_get_transaddr(struct pf_test_ctx *ctx, struct pf_krule *r, high = rpool->proxy_port[1]; } if (rpool->mape.offset > 0) { - if (pf_get_mape_sport(pd, r, naddr, nportp, &sn, - &sh, &ctx->udp_mapping, rpool)) { + if (pf_get_mape_sport(pd, r, naddr, nportp, + &ctx->udp_mapping, rpool)) { DPFPRINTF(PF_DEBUG_MISC, ("pf: MAP-E port allocation (%u/%u/%u)" " failed\n", @@ -923,8 +916,8 @@ pf_get_transaddr(struct pf_test_ctx *ctx, struct pf_krule *r, reason = PFRES_MAPFAILED; goto notrans; } - } else if (pf_get_sport(pd, r, naddr, nportp, low, high, &sn, - &sh, rpool, &ctx->udp_mapping, PF_SN_NAT)) { + } else if (pf_get_sport(pd, r, naddr, nportp, low, high, + rpool, &ctx->udp_mapping, PF_SN_NAT)) { DPFPRINTF(PF_DEBUG_MISC, ("pf: NAT proxy port allocation (%u-%u) failed\n", rpool->proxy_port[0], rpool->proxy_port[1])); @@ -1010,7 +1003,7 @@ pf_get_transaddr(struct pf_test_ctx *ctx, struct pf_krule *r, uint16_t cut, low, high, nport; reason = pf_map_addr_sn(pd->af, r, &pd->nsaddr, naddr, NULL, - NULL, &sn, &sh, rpool, PF_SN_NAT); + NULL, rpool, PF_SN_NAT); if (reason != 0) goto notrans; if ((rpool->opts & PF_POOL_TYPEMASK) == PF_POOL_BITMASK) @@ -1127,8 +1120,6 @@ pf_get_transaddr_af(struct pf_krule *r, struct pf_pdesc *pd) struct pf_addr ndaddr, nsaddr, naddr; u_int16_t nport = 0; int prefixlen = 96; - struct pf_srchash *sh = NULL; - struct pf_ksrc_node *sns = NULL; bzero(&nsaddr, sizeof(nsaddr)); bzero(&ndaddr, sizeof(ndaddr)); @@ -1147,9 +1138,8 @@ pf_get_transaddr_af(struct pf_krule *r, struct pf_pdesc *pd) panic("pf_get_transaddr_af: no nat pool for source address"); /* get source address and port */ - if (pf_get_sport(pd, r, &nsaddr, &nport, - r->nat.proxy_port[0], r->nat.proxy_port[1], &sns, &sh, &r->nat, - NULL, PF_SN_NAT)) { + if (pf_get_sport(pd, r, &nsaddr, &nport, r->nat.proxy_port[0], + r->nat.proxy_port[1], &r->nat, NULL, PF_SN_NAT)) { DPFPRINTF(PF_DEBUG_MISC, ("pf: af-to NAT proxy port allocation (%u-%u) failed", r->nat.proxy_port[0], r->nat.proxy_port[1])); @@ -1175,7 +1165,7 @@ pf_get_transaddr_af(struct pf_krule *r, struct pf_pdesc *pd) /* get the destination address and port */ if (! TAILQ_EMPTY(&r->rdr.list)) { if (pf_map_addr_sn(pd->naf, r, &nsaddr, &naddr, NULL, NULL, - &sns, NULL, &r->rdr, PF_SN_NAT)) + &r->rdr, PF_SN_NAT)) return (-1); if (r->rdr.proxy_port[0]) pd->ndport = htons(r->rdr.proxy_port[0]); From nobody Sat Jul 12 14:24:04 2025 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 4bfW6Y1lNbz61w9j; Sat, 12 Jul 2025 14:24:05 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bfW6Y19JCz3Zj0; Sat, 12 Jul 2025 14:24:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752330245; 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=Hn19xXmm5pt5y1maKimD30RTfrSP0ZSWSQiGou5lw/g=; b=PwGhMN9nXIMPAUoMtkhZLFqEnPpaFQaEywxEGOlqpN5Zou6M+vAbfMt7/GlMGuxn3dW1mU yTUoAH3Z/tqVt4fG+F1wBqS51o3Jn7mU+A9hSubcgrX2CdSEuKNhPQk7vOZWpD+h9Hypht zj6/E9X1ah/pAFhwHtUv8CYnHIQrOe1SAQ9iZ/VFUA+T8HAWSoqnoMTyhvkh4bsjVtm7sQ kfxKBu/Ptk6LUENGda1IEmIa78YO+FHU+QPTUHNTsw+QchMVxU25l01V7ArPbGU0n3ZbvZ X+QwlrFbRr4MO9ovrhUDUsXpU8HReYM2vKG1ElO9Zt/JVDTrhVwd96DMEAQXTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752330245; 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=Hn19xXmm5pt5y1maKimD30RTfrSP0ZSWSQiGou5lw/g=; b=VO2F3tf2ollq70WBC5brDZR95FJ/HXLR44lvcgbPhrgyLGb9u9LzUgEU0OOT0pSSUeOq7I l6nZ3jOXOKdrhQTq7MdCwwyN0aA/P03XdZEf8cyRmiBPjvz4kwYlO9K0J0VDWKIvJpVkSm mhdCYmmVPmK1i4hxP9JeliV/RxKgDd99yFs2yON+tzWdJ4lJ0KPTY+aLU0jD6rFpZFMTl6 cAC32f9F/tA8C7nekUnVRVgaFZnQJsB3kBvoIPVVInYl/M12mEH5FMlqQAAgjSGOJclC3B /RMjjHFzDKojJT/ydVyjMQTKImNrcW3WilnJuAKj/SYcwxOPjk3wqtqTAqVF1w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752330245; a=rsa-sha256; cv=none; b=Ex/yu8jW5Z9DvmoQ+BupBVE69H07TJ2INk3sEseL2du0Q1Us4eBPjiclrsXEkqrcYDvunn 3jqjItLqWafHJ2pmT7qzIyqyw/keeAT4ODl13TmezhSQjskL2mOX+r1fxWBNuQg3yyfhzz LiW3X8L13uVEpEP3yUJ/VC9Hf0xfJkLtYFw80/Wj0mSVbdmj/ZX7kvnGsDqenTuY/N9fdr vu4TNkzx19Df30+cWN7CGPEoVhxg/tXuJ9XP2bv2a/lVIUZxiqocPhW6JWu3gnnA098Rp0 kPqgSM6AvXb/bIVJd7zpIVFRBP6ahPZBtwf/IlVgyqkF8JiseLR+OIObglZndg== 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 4bfW6Y0gsPzBKl; Sat, 12 Jul 2025 14:24:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56CEO40T082537; Sat, 12 Jul 2025 14:24:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56CEO4F6082534; Sat, 12 Jul 2025 14:24:04 GMT (envelope-from git) Date: Sat, 12 Jul 2025 14:24:04 GMT Message-Id: <202507121424.56CEO4F6082534@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brad Davis Subject: git: 0430faacb61d - main - gstat(8): Fix typo in example to filter the results 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brd X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0430faacb61d83ea6eaf3100b44e95de2b5f83ff Auto-Submitted: auto-generated The branch main has been updated by brd: URL: https://cgit.FreeBSD.org/src/commit/?id=0430faacb61d83ea6eaf3100b44e95de2b5f83ff commit 0430faacb61d83ea6eaf3100b44e95de2b5f83ff Author: Brad Davis AuthorDate: 2025-07-12 14:20:31 +0000 Commit: Brad Davis CommitDate: 2025-07-12 14:23:48 +0000 gstat(8): Fix typo in example to filter the results Reported by: rpokala Fixes: 5652050565f7 - gstat.8: Add an example of how to filter the results --- usr.sbin/gstat/gstat.8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/gstat/gstat.8 b/usr.sbin/gstat/gstat.8 index 2975a93c7fef..e882aa75b8d7 100644 --- a/usr.sbin/gstat/gstat.8 +++ b/usr.sbin/gstat/gstat.8 @@ -124,7 +124,7 @@ Quit .Ex -std .Sh EXAMPLES To filter the output to only physical disks named ada0 through ada4: -.Dl # gstat -f ada0[0-4]$ +.Dl # gstat -f ada[0-4]$ .Sh SEE ALSO .Xr systat 1 , .Xr geom 4 , From nobody Sat Jul 12 14:31:41 2025 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 4bfWHL0tfKz61wlQ; Sat, 12 Jul 2025 14:31:42 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bfWHL00p1z3dGR; Sat, 12 Jul 2025 14:31:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752330702; 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=HQCvv2QYJ0OsKmMdlIQ5MvPfdkSka+5TSxKPjnv8hYo=; b=iBIHYqPpT/4iVE7cYYJlpJwjuFGfCbUg8piqa7+llymYb2ECqHU8BBTD09BsLLlYikq6e5 MyvzMqWHenxJj/E00uqZWfkRkd8SxfD2glhkkCrFb1fS6l56RylxYPkZ7Kdqg+l34x3YeB bWOJJD19Y6lJYx96DMg+HMQXaOBWlagwunlhdXuvc65hbMd+Q98uPaE8C9QspBoR3t+mO/ //ArOhCO5rmyNsR38Uuc5IsFQchYUkrZTOma8SOmGiPYf0PVRW8vd3+D4ydiKyAEFeBvpl 2M79YoMj/mWTHt7BzqWahwgjncO1IHVy7s4MJMgYpRAGzQVsgwjWeact/CeViA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752330702; 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=HQCvv2QYJ0OsKmMdlIQ5MvPfdkSka+5TSxKPjnv8hYo=; b=IyN/14PDViQ3FYhCal/7rWSLXvDsYQ+MAzgYGEMCtQgYxMKu8wHi0ThlDM9PXfoRmPIcDg zOJZPSM3Murgo/no1MhnqAnLakkKbXdFG5IrMMKrmWldrLtOJleHjWP1pExwiSfqVm1wBS fLJ1pMyzXbEFNhNeVc8+DFyTKIa5r9NsZlNmgSfa1yQj6SLKLxTWjKaEqOCSnF1RPH+JcO VqXW1p+Qc3uZRI6zozBJopPUwcB5kABrOUqf9tDboNYwQ0bk2OQvxs1rEa6MpA1NCTiufG Qej5yq2lffzJY0Qf2NEdgMuPU/kCzrb8j6mdmmcY8gyt+HTBZvs4vCASWvE07w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752330702; a=rsa-sha256; cv=none; b=tonbkbeaquOJcmDS7KZvOnOhpOLL5672ITgwXDPcF40cSiSQdX7mJAYquoqzQ1YW6kav7L XAXfXYvs8B7OOi92kWl3M+Cys+co5rYUmSuciwAI4KW83HUuZ0iD0ysSSS4G5v9qHH9VET vOiVirKswpugUwp37kpqQrWjP4h0OWoRU2UjUbMjkVJTwnBOTg27HrakzGSlCaK0XyI2nu bsKHZfqbh53YyO4gBDaFaXENqm384uN5L6no1MI5Y5gGGlw/6Z3MKe6ptskhAJJ7tD8Y24 ockL29D1a4zLTMuyhVWuK9gaOJpC/0K2TtUAxrbmElgyz64bsNj2AG1JUx3qZQ== 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 4bfWHK6jDfzBG1; Sat, 12 Jul 2025 14:31:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56CEVf4O094759; Sat, 12 Jul 2025 14:31:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56CEVfBi094756; Sat, 12 Jul 2025 14:31:41 GMT (envelope-from git) Date: Sat, 12 Jul 2025 14:31:41 GMT Message-Id: <202507121431.56CEVfBi094756@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kajetan Staszkiewicz Subject: git: 16a9f31b8aae - main - pf: Don't access sk and nk before they are allocated 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 16a9f31b8aae6cc16baf283183470fc17c9b488e Auto-Submitted: auto-generated The branch main has been updated by ks: URL: https://cgit.FreeBSD.org/src/commit/?id=16a9f31b8aae6cc16baf283183470fc17c9b488e commit 16a9f31b8aae6cc16baf283183470fc17c9b488e Author: Kajetan Staszkiewicz AuthorDate: 2025-06-03 14:10:52 +0000 Commit: Kajetan Staszkiewicz CommitDate: 2025-07-12 14:27:46 +0000 pf: Don't access sk and nk before they are allocated The NAT addresses are chosen during ruleset parsing. The new afto code stores post-nat addresses in nsaddr. The old nat code (also used for new nat-to rules) creates state keys and stores addresses in them. Ensure proper way of accessing the NAT addresses in case sticky-address is used for af-to rules. Reviewed by: kp Approved by: kp Sponsored by: InnoGames GmbH Differential Revision: https://reviews.freebsd.org/D50768 --- sys/netpfil/pf/pf.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 41658a29014e..acdeebb85e30 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -6054,9 +6054,16 @@ pf_create_state(struct pf_krule *r, struct pf_test_ctx *ctx, /* src node for translation rule */ if (ctx->nr != NULL) { KASSERT(ctx->nat_pool != NULL, ("%s: nat_pool is NULL", __func__)); + /* + * The NAT addresses are chosen during ruleset parsing. + * The new afto code stores post-nat addresses in nsaddr. + * The old nat code (also used for new nat-to rules) creates + * state keys and stores addresses in them. + */ if ((ctx->nat_pool->opts & PF_POOL_STICKYADDR) && (sn_reason = pf_insert_src_node(sns, snhs, ctx->nr, - &ctx->sk->addr[pd->sidx], pd->af, &ctx->nk->addr[1], NULL, + ctx->sk ? &(ctx->sk->addr[pd->sidx]) : pd->src, pd->af, + ctx->nk ? &(ctx->nk->addr[1]) : &(pd->nsaddr), NULL, PF_SN_NAT)) != 0 ) { REASON_SET(&ctx->reason, sn_reason); goto csfailed; From nobody Sat Jul 12 15:36:18 2025 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 4bfXjv1M7Rz620t6; Sat, 12 Jul 2025 15:36:19 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bfXjv0dr5z48lv; Sat, 12 Jul 2025 15:36:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752334579; 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=ok1wNH4cPnCXWzXP+b/Xdxu6c4ayKFaKThvkF7pqJmc=; b=WwTCKQ9rPeOWuzU8TkgpdbVk2R4HomqMZREJ/MlD/r4Y3+YfFNuY/CIv+PY7w15/55orVg fjcwXobAM63RU+J7+GEsQ8a545APh0t6njzn6orag3+dJAj2HGZq8zWg+kGEmqyEouTV1J 1qIpvSjpq0sdsTfkx+x6X6Ysp8FWbehtx2J3CoA/nyCs6aL8A+lZYQb6c9rNtW0gnaYAL0 Q/9H/jAcz8s+8k0dqhGHJ0xbEKmv48czStkYAguqZ+GgTF2ODmT9d56V74iIhlkmXDlyvv hHJkrL3Ma48OYScKZu6rnuiccoB42lNh1X7WRlSNDxhknfaXKWZD2PA4d8SWxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752334579; 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=ok1wNH4cPnCXWzXP+b/Xdxu6c4ayKFaKThvkF7pqJmc=; b=yGWWIiwrZ3AofahxYw3GvwcQy1WtHHgIe5As3mEeEDBtop/MjWKQi2Rh29ZthSPpGs/709 2b9n2xfJjMWtTuCOqCyMmiEriVr3LFW5i8HTCsdHTgZV0eRfmL5h9AdajPuZk7q38UU0oh JLBvehFPZmrfnk2OKBwU0k6/WXn3RUlUpTlVadmBMJ8DwXVR3eYZpENHlZXMOoSF77Ake5 zj5GhPC/3v+Ym9ns5UtGVaCkx3WA4Yt4UZcvaD7tMMkyKInWhUDtoOBhAqbN1z27zWbiIv 3m5z5e0JcDmv7CJ0P1pY4rdFwVltfsDhJ0yh+jlbDq6bp9lr1l3Et98leWhOcA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752334579; a=rsa-sha256; cv=none; b=pu2PqK55WNPrLYF8HmDmb7vOwTXNNJAjuWFazOrviIRFrYQ6TfPptLwqxmAiybT/Fna+r4 yqLOjauKXr9lLChivv+v2ruG+JkCwzqreDy7plqKdrO1TLaSlVjR6FKx73ORXWD+KGsAsR TGabaN3ayo1Uk9HGVkwQbkNB/Nckf8OCHMCWkh8qkpjuwYDseL/n4xBH854sk9osQRact8 9bZ+dQm/33Dsxx8uNBquVzulsLd/Ezo3AE2aVpwO1uhN0xaOWJufLCNYrtGAnoNNPcqK+U Ii4b3jwJg7dsGzN5Hv51VYv7wIgL9V4+SxsoE5EN2uOF1Kg0MpQkpxZoQdrAwA== 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 4bfXjv070czDHx; Sat, 12 Jul 2025 15:36:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56CFaIga014924; Sat, 12 Jul 2025 15:36:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56CFaIkq014921; Sat, 12 Jul 2025 15:36:18 GMT (envelope-from git) Date: Sat, 12 Jul 2025 15:36:18 GMT Message-Id: <202507121536.56CFaIkq014921@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 0f15030a6eb6 - stable/14 - pf: fix ICMP ECHO handling of ID conflicts 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0f15030a6eb6e4e0d7f22bffa27eb9be9ab233f8 Auto-Submitted: auto-generated The branch stable/14 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=0f15030a6eb6e4e0d7f22bffa27eb9be9ab233f8 commit 0f15030a6eb6e4e0d7f22bffa27eb9be9ab233f8 Author: Damir Bikmuhametov AuthorDate: 2025-06-26 17:26:14 +0000 Commit: Kristof Provost CommitDate: 2025-07-12 07:50:18 +0000 pf: fix ICMP ECHO handling of ID conflicts After applying FreeBSD-SA-24:05.pf, a problem with ICMP ECHO passing through PF NAT was raised: two or more Windows workstations cannot ping the same destination address at the same time. More precisely, only one workstation pings normally, while the pings of the others are rejected by the packet filter. The thing is that Windows always uses the same ICMP ID (1). Therefore, the state is created only for the workstation that started pinging earlier. In the pf_get_sport() function, we compare *nport with the ICMP_ECHO constant, while icmptype (virtual_type actually) is passed in the pd->ndport parameter. MFC after: 2 weeks Reviewed by: kp (cherry picked from commit e7abf8829d8d496a8753946f67fb2016851b4f7c) --- sys/netpfil/pf/pf_lb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netpfil/pf/pf_lb.c b/sys/netpfil/pf/pf_lb.c index 2623a22db86b..a9cbc71cb5f4 100644 --- a/sys/netpfil/pf/pf_lb.c +++ b/sys/netpfil/pf/pf_lb.c @@ -233,7 +233,7 @@ pf_get_sport(sa_family_t af, u_int8_t proto, struct pf_krule *r, return (1); if (proto == IPPROTO_ICMP) { - if (*nport == htons(ICMP_ECHO)) { + if (dport == htons(ICMP_ECHO)) { low = 1; high = 65535; } else @@ -241,7 +241,7 @@ pf_get_sport(sa_family_t af, u_int8_t proto, struct pf_krule *r, } #ifdef INET6 if (proto == IPPROTO_ICMPV6) { - if (*nport == htons(ICMP6_ECHO_REQUEST)) { + if (dport == htons(ICMP6_ECHO_REQUEST)) { low = 1; high = 65535; } else From nobody Sat Jul 12 15:37:05 2025 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 4bfXkn6MlJz621L9; Sat, 12 Jul 2025 15:37:05 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bfXkn5c6jz49M0; Sat, 12 Jul 2025 15:37:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752334625; 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=JO8aVWbmUCBVJF4hGqZPnefqK75yXXIBtRDsslPN/iI=; b=lmwPGrdWLA3B3cW7EG36szzvtA1i1W9/KEXlH8gWxxuKa1YhQVPYWjjhr6FA2Buuywi7/l BbTe8RfhaZXVgPEmsDXvvjonpnmce9vNtZt9h6fKe5YSEXrcNwY0mS+3qtV3VrKg/43QOF +NSlWC9npVHcJJYseuyhIWCU/OuGMEnF0iy8qJieCA27Yg5C1v6E5qP16A6Aiagy5TEexJ M7IgLtwxSLFpVSlyd26m39nCSGMOaaPf3q0l+KP+gUDlFQl26gPzqT23dkrHYFR7qRAzCQ U0qOYz5uIA2CWIcKnuGlX6xVEowAgAOv4Dd9hd3EbIRpmzWGcbNeSwvUyw0qfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752334625; 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=JO8aVWbmUCBVJF4hGqZPnefqK75yXXIBtRDsslPN/iI=; b=YHxFBF/Zbui6Bd90SYhhIDffRxbks92Il6a3ZMuSpSEgo8bTd54J0+sBWx4+MNcizoc/I6 vlKHGFz1gtJ/jmNUJOCt+kOG4D7tZPeDlyY779goT6DqCcjblj/xDM5JJJAzSpWy2buPXt wUDxRhzf1AMkQdkiPGLsr/1yPErKMjWvUHxfwGPk02byE2UcUkE221nGsM44dDQhH1nOY7 iwXwGCZQzaI1DnT6b6TwWmu7Yx56+F5E550qPpzEIOG1tLVA2PWP8eta+SJr2JsxVUTQjh qVlXH2EmF9vGMr3TelCuypEdBg7ZbVpN4USaHHnYOuWmgHxFb5NiBbURqBMsCQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752334625; a=rsa-sha256; cv=none; b=mzTQ3UYVD0SNaveOhW0zXbUxHBAh+KR/2Wv9KpgGgK+zmQzNdO6Fx2x7Y/V3m7QlxB5G29 ea0dXIpYVcMrU5rmj5OK6qPilNzZ5U5O6jTX1SDjAvmhclIYAwSWwRCjJFb1tyPYcs3OUr vdUuZxg6ksu77gnPh0IlhLIYPefXLZJPRA5JT5uUXNIJbHp3eywSPoXJDxtAgF4mVOvsUe FeB9WwTUsncfIkff2wk+NXa9nCybBKyP9eSCU7CtNcavmb19hZ5fsKzhDG3askGEpHjIfD J/8duZph/YBi92Kfb/7K/lBGp8NG+uK8TgdPq3I6kAxqrN6gtF4IqAw9KviFGg== 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 4bfXkn5BbbzD9G; Sat, 12 Jul 2025 15:37:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56CFb5BZ015290; Sat, 12 Jul 2025 15:37:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56CFb5Kh015287; Sat, 12 Jul 2025 15:37:05 GMT (envelope-from git) Date: Sat, 12 Jul 2025 15:37:05 GMT Message-Id: <202507121537.56CFb5Kh015287@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 57c652dfa1c0 - stable/13 - pf: fix ICMP ECHO handling of ID conflicts 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 57c652dfa1c08a361e29b7edb7fe05b63ffae235 Auto-Submitted: auto-generated The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=57c652dfa1c08a361e29b7edb7fe05b63ffae235 commit 57c652dfa1c08a361e29b7edb7fe05b63ffae235 Author: Damir Bikmuhametov AuthorDate: 2025-06-26 17:26:14 +0000 Commit: Kristof Provost CommitDate: 2025-07-12 07:50:55 +0000 pf: fix ICMP ECHO handling of ID conflicts After applying FreeBSD-SA-24:05.pf, a problem with ICMP ECHO passing through PF NAT was raised: two or more Windows workstations cannot ping the same destination address at the same time. More precisely, only one workstation pings normally, while the pings of the others are rejected by the packet filter. The thing is that Windows always uses the same ICMP ID (1). Therefore, the state is created only for the workstation that started pinging earlier. In the pf_get_sport() function, we compare *nport with the ICMP_ECHO constant, while icmptype (virtual_type actually) is passed in the pd->ndport parameter. MFC after: 2 weeks Reviewed by: kp (cherry picked from commit e7abf8829d8d496a8753946f67fb2016851b4f7c) --- sys/netpfil/pf/pf_lb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netpfil/pf/pf_lb.c b/sys/netpfil/pf/pf_lb.c index 2571a0c5312e..001f26c13d48 100644 --- a/sys/netpfil/pf/pf_lb.c +++ b/sys/netpfil/pf/pf_lb.c @@ -223,7 +223,7 @@ pf_get_sport(sa_family_t af, u_int8_t proto, struct pf_krule *r, return (1); if (proto == IPPROTO_ICMP) { - if (*nport == htons(ICMP_ECHO)) { + if (dport == htons(ICMP_ECHO)) { low = 1; high = 65535; } else @@ -231,7 +231,7 @@ pf_get_sport(sa_family_t af, u_int8_t proto, struct pf_krule *r, } #ifdef INET6 if (proto == IPPROTO_ICMPV6) { - if (*nport == htons(ICMP6_ECHO_REQUEST)) { + if (dport == htons(ICMP6_ECHO_REQUEST)) { low = 1; high = 65535; } else From nobody Sat Jul 12 16:02:27 2025 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 4bfYJ403PJz60nHy; Sat, 12 Jul 2025 16:02:28 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bfYJ33q99z3Kgd; Sat, 12 Jul 2025 16:02:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752336147; 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=iXgidW5WJK6PICacmB4X6kWjrvyzfB0VLCZYpeZBQMU=; b=Tc6GrP3YaL6DpdLwXXj1pzKDkzztxAw3VETZ4NEezIFjzuTD2UZnzfiXBFPa4dlnPv2QPc i2LiA+u8tnXToly2epLLSoExgLKAmDAvclVHBJjqEU1MRqAKUVdx/97fXqYy/HFAuzT7Er wX+vycM69ekn+VhRXx5/nC8vpJlndOOxr/y5dGjoewbBCylnxO4lDL2GsvA2i3/eskOs+F pkwyKn6fibKEnAqkWN9p63Vi7ZuWnilua5qtk6mXB3Sj2U+3VEFPwj4my6+Wl7uA7qqSqG Q3pf6f32UVnZTGYxQLalClkleRr012AG/w5PExBxdSA9L6SyvkP+NRR73qsJQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752336147; 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=iXgidW5WJK6PICacmB4X6kWjrvyzfB0VLCZYpeZBQMU=; b=kGSEZgukETS80Qg7ok7e77ZQO43YXDt74eWBqjYmLkbONQFJ8MOvMS3V/f4pCEn5SUTfGX tfkJA9FCfBnE7w0rnBQIUAW9We89uHJWxEH2lGG5J263TbQ9tij6ZSG2dbwfX+015+IZtE trzVHH056sq7DqBCA/sc8SjRHRe3yCOWkXRxjeF9qYBU21LrqNdjRkfyfcXAOYK0a0HuPU LD5BmdqYvwEdeD+wXvZvvxP/440gpwJlXQrPDL2QkBrEoGGETn88vl/hUoemqJlOu2QH1S F98V/wj0WiVOGnr+Y9SruaFgOYqKRkpSQR8DLoWqoahKozn+X4Sf+hgXOWwovg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752336147; a=rsa-sha256; cv=none; b=fCqKMW4PQTHuJ0v/p5GIlH4huwvInuJQpyE6LmFmtcoKopveK4w+0MtvhzICVVdilkglVF lwSab97s1Z8/Xmt6mB+v2E44q0rs/xtrEOOmqZtVLEDRpxG0N9/Y5G4drgZUiZ9QLZvEM2 sgMP4s8Se4LeKheHtlOg1z10UxXa+HNVmZyyx/AX2Leih4bVEG973vG8sWArVghLcnoiUM WLel6RBSSlAKQpAuazzY3fFG4Tp71BVAS1ninLJP1izw+oHc2LjAndDvoB/mSPqAzOjsfr MGoLFEeW2MYOvsuB4HScZwbpW6tRHWa71H8+8BJ6JJxzj1Wgb1bGlNoiEimdDA== 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 4bfYJ33KKJzTKB; Sat, 12 Jul 2025 16:02:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56CG2RQn070875; Sat, 12 Jul 2025 16:02:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56CG2RSu070873; Sat, 12 Jul 2025 16:02:27 GMT (envelope-from git) Date: Sat, 12 Jul 2025 16:02:27 GMT Message-Id: <202507121602.56CG2RSu070873@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 47ffc24fbb64 - main - tracing.7: Aproposify 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 47ffc24fbb6476676c0d40b28e43c83dbc8fac9d Auto-Submitted: auto-generated The branch main has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=47ffc24fbb6476676c0d40b28e43c83dbc8fac9d commit 47ffc24fbb6476676c0d40b28e43c83dbc8fac9d Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2025-07-12 15:57:13 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2025-07-12 16:02:00 +0000 tracing.7: Aproposify By adding "FreeBSD" to Nd we make tracing(7) discoverable when running `apropos freebsd`. Reported by: ziaee Event: Berlin Hackathon 202507 --- share/man/man7/tracing.7 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man7/tracing.7 b/share/man/man7/tracing.7 index 7f21bfbbd2a3..4c9aee8ce913 100644 --- a/share/man/man7/tracing.7 +++ b/share/man/man7/tracing.7 @@ -8,7 +8,7 @@ .Os .Sh NAME .Nm tracing -.Nd introduction to tracing and performance monitoring facilities +.Nd introduction to tracing and performance monitoring facilities on FreeBSD .Sh DESCRIPTION .Fx features a large variety of tracing and performance monitoring facilities. From nobody Sat Jul 12 16:24:24 2025 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 4bfYnP0X2nz60pNw; Sat, 12 Jul 2025 16:24:25 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bfYnN6kqKz3QDD; Sat, 12 Jul 2025 16:24:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752337464; 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=LnzYbetuIZrN1+DkIJNFeN1t61914soR8okwRzEcDjU=; b=WtrIVzfnee66a2BD6QaXKLrfVRU+O1TKhbpnS3Ybuij+hSiPGxMVYmasZoAdXkYcQDavx2 FsWvt0oIBT+sN8uZ3cp2Iy/MDd9dtakhoBhd1jVTnK1t5xkmh0O7p0fX/i5f7yiiAyQYJG C2vsEP4gseOKK2INXBdxVPjz8afeyo1SzkyGeoozP5+dG6EhX9bl499l4KpOLiMkneGLRn LMKkrYNZC1sYkVHCc5dpUHM9/Uj6WqJtMFQI/+xIty+Z7B3pZzxGkUg0gI6gllxjXz1G5r yg6P2Zsj1OkOu38Sf1nsfPbrYwYc05l84JAmkAMKF3J+m7UK4PyO2thxdw3rJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752337464; 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=LnzYbetuIZrN1+DkIJNFeN1t61914soR8okwRzEcDjU=; b=xTKpinKEHqYKE3j4T8EAQxtTY6UInfFi/K0fP9Y8zR7ZbzouvDVhhu3LvadtCkfOPj3i3c 8UADaSdGEKueQxupI0BxNOLn4ixGI2oL3Ovf5ToBmdO0fmjSoRByJnV3b8wv8vKdyQi//R dSGKC3VVGszq/rrns33RiqdMkXvPXRiyZQkR66w2L8W5X1W+i1V6gP6BbJVouc5biKNwrB xQwqBLyH+DAVLdOnfS1B04/fZYv5a/LiUE8rWB5I0b1XIFj6lHzG3LZQ1YYF9lMatT6Dcf dghin6cIJn78D0pvz4QC1R2DzMXdOUwJ9eXpWbqtzsEnjuzQ8zE9t9Xp3y2ajw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752337465; a=rsa-sha256; cv=none; b=R5/1qSdcqr9Dp17Hl02oGfIMbP5k97/MjAgA1+13eY+b7YjzxQFU5UczsinecnjfyGB4p9 fAlLjY+tRPT8vtsdoGvBNTTtw431edqDYnJyH8FJE3TjvEZP3JfLDyLAUmzFnGJWtjhrbu HuSugRFswZRGB1JGnPsfM6RtviOxoXRVYRbwPUQ48KPBlR1lU76mDQlfiZp+kaSk29bpLp Zhiq86DfiYSSx/1mvvsp4WRmsbjKkpPlkrn8e/5x/67uLLcdVCmN5HRXU7mrbSJJUZ+1UA wBwhvd/LeevWenlYmmqEq0NOU8oQ1SuUWH/yxQBjYJ8pOiZXH1UnFltk/ZcLag== 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 4bfYnN604KzVcb; Sat, 12 Jul 2025 16:24:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56CGOOXo008094; Sat, 12 Jul 2025 16:24:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56CGOOkX008091; Sat, 12 Jul 2025 16:24:24 GMT (envelope-from git) Date: Sat, 12 Jul 2025 16:24:24 GMT Message-Id: <202507121624.56CGOOkX008091@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 46f18ecf8d3c - main - rc: Use check_jail to check values of security.jail MIBs 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 46f18ecf8d3cdda1cd433841c44a4c1268ab9721 Auto-Submitted: auto-generated The branch main has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=46f18ecf8d3cdda1cd433841c44a4c1268ab9721 commit 46f18ecf8d3cdda1cd433841c44a4c1268ab9721 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2025-07-12 16:20:32 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2025-07-12 16:20:32 +0000 rc: Use check_jail to check values of security.jail MIBs PR: 282404 Reviewed by: markj, netchild Approved by: markj (mentor) MFC after: 2 weeks Event: Berlin Hackathon 202507 Differential Revision: https://reviews.freebsd.org/D47329 --- libexec/rc/rc | 4 ++-- libexec/rc/rc.d/hostname | 4 ++-- libexec/rc/rc.d/routing | 2 +- libexec/rc/rc.d/zfs | 8 ++++---- libexec/rc/rc.d/zfsbe | 2 +- libexec/rc/rc.shutdown | 4 ++-- libexec/rc/rc.subr | 2 +- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/libexec/rc/rc b/libexec/rc/rc index 5ed47d6eac20..db3c3e20ab44 100644 --- a/libexec/rc/rc +++ b/libexec/rc/rc @@ -83,9 +83,9 @@ fi trap "_rc_conf_loaded=false; load_rc_config" ALRM skip="-s nostart" -if [ `/sbin/sysctl -n security.jail.jailed` -eq 1 ]; then +if check_jail jailed; then skip="$skip -s nojail" - if [ `/sbin/sysctl -n security.jail.vnet` -ne 1 ]; then + if ! check_jail vnet; then skip="$skip -s nojailvnet" fi fi diff --git a/libexec/rc/rc.d/hostname b/libexec/rc/rc.d/hostname index 8b26c4f60633..0bc31ccd787e 100755 --- a/libexec/rc/rc.d/hostname +++ b/libexec/rc/rc.d/hostname @@ -42,8 +42,8 @@ hostname_start() # If we are not inside a jail, set the host name. # If we are inside a jail, set the host name if it is permitted. # - if [ `$SYSCTL_N security.jail.jailed` -eq 1 ]; then - if [ `$SYSCTL_N security.jail.set_hostname_allowed` -eq 0 ]; then + if check_jail jailed; then + if ! check_jail set_hostname_allowed; then return fi else diff --git a/libexec/rc/rc.d/routing b/libexec/rc/rc.d/routing index 893acb83cf4a..dd75604125a3 100755 --- a/libexec/rc/rc.d/routing +++ b/libexec/rc/rc.d/routing @@ -331,7 +331,7 @@ _check_dynamicrouting() # copied from /etc/rc skip="-s nostart" - if [ `/sbin/sysctl -n security.jail.jailed` -eq 1 ]; then + if check_jail jailed; then skip="$skip -s nojail" fi [ -n "$local_startup" ] && find_local_scripts_new diff --git a/libexec/rc/rc.d/zfs b/libexec/rc/rc.d/zfs index 26bf3046444b..f88f65c2ec18 100755 --- a/libexec/rc/rc.d/zfs +++ b/libexec/rc/rc.d/zfs @@ -18,7 +18,7 @@ required_modules="zfs" zfs_start_jail() { - if [ `$SYSCTL_N security.jail.mount_allowed` -eq 1 ]; then + if check_jail mount_allowed; then zfs mount -a fi } @@ -34,7 +34,7 @@ zfs_start_main() zfs_start() { - if [ `$SYSCTL_N security.jail.jailed` -eq 1 ]; then + if check_jail jailed; then zfs_start_jail else zfs_start_main @@ -54,7 +54,7 @@ zfs_poststart() zfs_stop_jail() { - if [ `$SYSCTL_N security.jail.mount_allowed` -eq 1 ]; then + if check_jail mount_allowed; then zfs unmount -a fi } @@ -67,7 +67,7 @@ zfs_stop_main() zfs_stop() { - if [ `$SYSCTL_N security.jail.jailed` -eq 1 ]; then + if check_jail jailed; then zfs_stop_jail else zfs_stop_main diff --git a/libexec/rc/rc.d/zfsbe b/libexec/rc/rc.d/zfsbe index f61f3bf097f0..22d53f219679 100755 --- a/libexec/rc/rc.d/zfsbe +++ b/libexec/rc/rc.d/zfsbe @@ -64,7 +64,7 @@ activate_bootonce() be_start() { - if [ `$SYSCTL_N security.jail.jailed` -eq 1 ]; then + if check_jail jailed; then : else mount -p | while read _dev _mp _type _rest; do diff --git a/libexec/rc/rc.shutdown b/libexec/rc/rc.shutdown index 18f67f5ca124..3dfd7a7e0936 100644 --- a/libexec/rc/rc.shutdown +++ b/libexec/rc/rc.shutdown @@ -83,9 +83,9 @@ fi # and perform the operation # rcorder_opts="-k shutdown" -if [ `/sbin/sysctl -n security.jail.jailed` -eq 1 ]; then +if check_jail jailed; then rcorder_opts="$rcorder_opts -s nojail" - if [ `/sbin/sysctl -n security.jail.vnet` -ne 1 ]; then + if ! check_jail vnet; then rcorder_opts="$rcorder_opts -s nojailvnet" fi fi diff --git a/libexec/rc/rc.subr b/libexec/rc/rc.subr index 2eaf336b5220..e4ed5de6cde6 100644 --- a/libexec/rc/rc.subr +++ b/libexec/rc/rc.subr @@ -1689,7 +1689,7 @@ $_cpusetcmd $command $rc_flags $command_args" start) # We cannot use protect(1) inside jails. if [ -n "$_oomprotect" ] && [ -f "${PROTECT}" ] && - [ "$(sysctl -n security.jail.jailed)" -eq 0 ]; then + ! check_jail jailed; then [ -z "${rc_pid}" ] && eval $_pidcmd case $_oomprotect in [Aa][Ll][Ll]) From nobody Sat Jul 12 16:24:25 2025 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 4bfYnQ2BSqz60pLf; Sat, 12 Jul 2025 16:24:26 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bfYnP6j5pz3QGd; Sat, 12 Jul 2025 16:24:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752337466; 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=Bc8Mig+o01AvF1cfjiAMiEGCjfyrRDGRmWlRXwkkn1E=; b=qOqjqjOPKnjKzvPuCNJXX4dJWS4y8pGgR4mf/Aa7mqoTAD/6WyFOgcM59hSv9y9l4U6Idc iq4JX/Hx1ejF9fnh9U/7fOcv0Pv32lVYJj4Cd0oviPW8tjd9ptUwmbxYV0w1SlBhgKIGRo fnPfzB1iqNnX3Uhp+D6dT+ZjTOVdti/vMf2gfvD3zLqjLpXhAeJ7K25xg9T9zJK49bTpI3 4ckRGH3WVfR0AoVCB8Da8AwA1S4hBVtZVYjiT4t26PzCb6iaHivRW1v8Utc9c07T/70erw H/LXDuYgXIGQvmSsi2HN1p8kXa/YsUbllDMpUnjIujAytRigppJanpXBWR/TgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752337466; 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=Bc8Mig+o01AvF1cfjiAMiEGCjfyrRDGRmWlRXwkkn1E=; b=opt2QSyj96v07h/FichQDfaVJ2pcqdJOcl+pumXvHnPoX6XjJbeAJ4amEEckFsRx1NCUUp ZhTKZu0cyA1CCO1I8s6Ee0PTfIsb3Co6L7I1sLtRzo2jhu/evMT4x+PLZk33XHjU8p+CJA 89w2z5RGZiI1RZkRaEbK/bElFItUUEoZRC5nxIKfblqatce3OLwoP4Kx4b3V+X6BmS8sDZ vm7kMveQLHM3edRZ3HAYraGLHmVCEoL3+BkZ2EPGOP+n1RhjEQbI3ME7HTsV/bTOSv9pey IIl/qqOXfbsKg0kwS2YYiegOSk5v5r4ShcpE9WhYMUF1CG+6QvEjYKfS+KxfWg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752337466; a=rsa-sha256; cv=none; b=KLJ8zL2KOOmg7ealh7psJIx7VOp1nXwOTzLnaPaeJcnq/WkeU9ti8QqX58aB9OtgHyxOOt WSFcIX8zykAnWW6KnQ/QK8Ael8PRGcpjfxrQR5y98MvdUYjWpSGUJzU5az7vhrGeaxIPtA 0ctVWVFLTgX0LUmUwQbP8Y+zLSjww5c6NC+fq99xtb6WQS5G4p/ioqltgAD4WzZxk2I32M 0MhUal3ak4eKXxpjz2D7Savw1sw5uOKhwoJxXmlWWxif7kUvHAEM4r0Ahwy99QeKakND4Z Io7G1qgdBH7PpgMB3Pkk/fgORSYItB6TmQNpPBPF/cTO8Eo7qv+XAhnvzt+VwQ== 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 4bfYnP6H5SzW0g; Sat, 12 Jul 2025 16:24:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56CGOP5v008127; Sat, 12 Jul 2025 16:24:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56CGOPV4008124; Sat, 12 Jul 2025 16:24:25 GMT (envelope-from git) Date: Sat, 12 Jul 2025 16:24:25 GMT Message-Id: <202507121624.56CGOPV4008124@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 5d5258653ba4 - main - rc.subr: Fix a typo in check_jail()'s description 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5d5258653ba4b37c38e48443f265ee4dcedf9a50 Auto-Submitted: auto-generated The branch main has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=5d5258653ba4b37c38e48443f265ee4dcedf9a50 commit 5d5258653ba4b37c38e48443f265ee4dcedf9a50 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2025-07-12 16:23:03 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2025-07-12 16:23:03 +0000 rc.subr: Fix a typo in check_jail()'s description MFC after: 3 days Event: Berlin Hackathon 202507 --- libexec/rc/rc.subr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libexec/rc/rc.subr b/libexec/rc/rc.subr index e4ed5de6cde6..a2e2e98a5087 100644 --- a/libexec/rc/rc.subr +++ b/libexec/rc/rc.subr @@ -2671,7 +2671,7 @@ check_required_after() } # check_jail mib -# Return true if security.jail.$mib exists and set to 1. +# Return true if security.jail.$mib exists and is set to 1. check_jail() { From nobody Sat Jul 12 16:29:40 2025 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 4bfYvT13r6z60pm7; Sat, 12 Jul 2025 16:29:41 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bfYvS6pvTz3T33; Sat, 12 Jul 2025 16:29:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752337781; 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=02TWLk7lFTZArWjXnLtAYeiM0yHS6rxFbGGiarBzLUI=; b=gNzg8HrTop/TXUjuTYmJ4iy09B8MB6P5wOzOUhHAHxhh1YoP80Hjfq46wqAiQHLbcYw7Fm Jerq7PzHZUmmj3PmpLrma2328gsLBJHSVKyUjvku8RmpseBtRhXEvxQjKStPb6GLX87Squ /cZayvfuPba9Lv3FFFbNlCc+Cooa14O7FW1r68B9Kr17hATW7BHJ3GhTsnMbdVkK5xzKak 1MjnCsYPUt4H6wxv9xixSiTRdZSep9u9Cjk27af9KVU30gPOBpb1YACJymFC56elKdbUFG NRWP2XbKE5IMaMD8TRkpc02AOsEfZDh6DNUht9oFEIB91RoBxaWNZkBOWE87ng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752337781; 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=02TWLk7lFTZArWjXnLtAYeiM0yHS6rxFbGGiarBzLUI=; b=hlpkFX38w4w1vIW2i6FizcnhVHyN/uxJYR0b79RM2JDnobqSVSIYxAfw+nFtpGFsfzil6n wk4npDCtE1B42//vY0zcR9oJh7P2UJms6UVk8ptLGv8etVl7pVmaxFStfLUNGR5ZhWuuVb 1xuYKuUqr3hirB3mOsusAOAFB/JUyM2G/ldfqIeXicH8E5LblpbTogjOY7o2UyOKzR29SS FHvuofktbdVYK6NyzxmjuhXZ2R/yINCLB9UMTiRcUodGF6vE2Y62Gx2y+XM06Jhybf5aCa HC5Pc3y9omuh5dcvqiOFmTfHFEXhjQJQIuToDFp03AyDSXR0c2svCDRv4UD9QQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752337781; a=rsa-sha256; cv=none; b=V2WRpWP8VIcOkKecy5qfB6I7Wf+v3mSaf/jbWOQQHKZsGEYn1bwMjCqTIeb0jSTvWrVq/G BnTCi+SpWMJML5BojGErqz+bYU66P80zyDt+wn5eZV6tyh49DobpU/QDVme7OKMo7Vzg+m klO5no0oA2wkXrTmb9z6AJhyScOfU5bm5a7QTIHJmYgCAE+KWsht2cnD0qDWKrhwmiy1qJ F31WZ1s4ZuoJRBAsBvY8QAQ59ZDSKUD6dTblMk28czhH60CKabVeHhwQV94iAJQsF8Cbee U9+j0f3EGiVnn8PvrnUZLqxr8I7vY4VntXuxLrL+WyS+v+6e1eWIbsOEmN95MA== 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 4bfYvS6Fg3zVfn; Sat, 12 Jul 2025 16:29:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56CGTeYJ009782; Sat, 12 Jul 2025 16:29:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56CGTewA009779; Sat, 12 Jul 2025 16:29:40 GMT (envelope-from git) Date: Sat, 12 Jul 2025 16:29:40 GMT Message-Id: <202507121629.56CGTewA009779@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: f5dba673345e - main - pf tests: fix anchor:nat test 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f5dba673345e2bbc63df057976d9296cb735f96f Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=f5dba673345e2bbc63df057976d9296cb735f96f commit f5dba673345e2bbc63df057976d9296cb735f96f Author: Kristof Provost AuthorDate: 2025-07-12 15:41:10 +0000 Commit: Kristof Provost CommitDate: 2025-07-12 16:29:27 +0000 pf tests: fix anchor:nat test Don't assume that the epair we created is epair0. Event: Berlin 2025 Hackathon --- tests/sys/netpfil/pf/anchor.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/sys/netpfil/pf/anchor.sh b/tests/sys/netpfil/pf/anchor.sh index 4692c06142df..64ca84b34c3d 100644 --- a/tests/sys/netpfil/pf/anchor.sh +++ b/tests/sys/netpfil/pf/anchor.sh @@ -350,9 +350,9 @@ nat_body() jexec alcatraz pfctl -sn -a "foo/bar" jexec alcatraz pfctl -sn -a "foo/baz" - atf_check -s exit:0 -o match:"nat log on epair0a inet from 192.0.2.0/24 to any port = domain -> 192.0.2.1" \ + atf_check -s exit:0 -o match:"nat log on ${epair}a inet from 192.0.2.0/24 to any port = domain -> 192.0.2.1" \ jexec alcatraz pfctl -sn -a "*" - atf_check -s exit:0 -o match:"rdr on epair0a inet proto tcp from any to any port = echo -> 127.0.0.1 port 7" \ + atf_check -s exit:0 -o match:"rdr on ${epair}a inet proto tcp from any to any port = echo -> 127.0.0.1 port 7" \ jexec alcatraz pfctl -sn -a "*" } From nobody Sat Jul 12 17:03:30 2025 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 4bfZfW59gxz60rf2; Sat, 12 Jul 2025 17:03:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bfZfW4R2Qz3lGj; Sat, 12 Jul 2025 17:03:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752339811; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4UcrM1nuvseJk7t4thFpjAOxbCep04jDJKqzM1vgcp4=; b=ZDsKBfQkF08sTmmTsX4URlWJ6wFHwHyEW3t7dp7DeJgZQQrQilKdU9U92WjKNvfivdkMII w/LKOoP75+ZE/oX6yf20pyapEk9TFYoHuRRH5+4CWzs3Ey8PbPecyAWTxRycgDXPQxf6h6 wbe6RmZLchr3pn9n1Ft3ash9ZGULVZkBX8gDnNVhYtd8VXLQ6NaTBeQWuMFsKsziuA3wDW fh79pi5rIrOfC+YYyv3UKNf1EgFi96Deb5sK1yGgos0ZyBGK9qbxjQ+Pjwe1oczB6ht2fO E8ruxeBZSvuC+AH2c2n7CeHruUgQXRXp1qO6yE1KJ0MmAMkmPHuQEnNBSYJU4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752339811; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4UcrM1nuvseJk7t4thFpjAOxbCep04jDJKqzM1vgcp4=; b=WS9CANchjLpXZQmML5FftaBvze5o5JN/2ogeNB8qUcY9P9B0FRpx2FQ1PtFh02iZQWzvKE qSshoN9nUyCAAdt1fGfXEyUuTRNGzxBjxjXLK2x8tgnoffXH2X03cacEIDxemPZAp9rfNT z2zVbfw5GCRIclT6aYJE/TvzqQmCXh6+dBJAgKATXHI+FwEM+GXi85wKP1Ex5XaEl7TZgG iaKwS8KFTCDc7PTJIiv47sM+ehf9laKrl4QVrF2tqWMrxcgT166z1p13OWZv8/vJKnJS5f ecyquzVXVb0vhTgPLuhZGeT9GtghxZE3SBK3mpQURdFkWt87UgGikT6ZhGscXQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752339811; a=rsa-sha256; cv=none; b=Kx8FrN+uLTBUPhDP1XxlV50CcnWWHrLDlKKn4sEbv5DcByZtRGVf26yN4TXd+fsuD3y0k+ AgfPF1zUb3FnN56XzeEdYK70spN3O4yfVvpuq5xzPceKT1EHDF2GJ3bTCgql2QjVaWpMJj J5KdLR4uq/Mncy4OEWSXi4USQ5H3yGFJzsxqPSe08ftlOyBcU9zx9Jy9yqvyAiBfn/UV55 znxKk73ih9NaNnVc4XUC7z0EpUwWuB0SVO4qsl8g7Y3UsP9/JZrzEjimqEAnEJ9kiewnSj ah8A8fZ4aEtesJTCdmT1oRhfaNX6y59GR+cAnhCe6r+jq1SKe+W68jZ5e/4+aw== Received: from [IPV6:2601:5c0:4200:b830:981d:893e:66ee:6efa] (unknown [IPv6:2601:5c0:4200:b830:981d:893e:66ee:6efa]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bfZfW2DjTzv4b; Sat, 12 Jul 2025 17:03:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <5906dd0e-9812-449b-af7a-ee64c9a4ab56@FreeBSD.org> Date: Sat, 12 Jul 2025 13:03:30 -0400 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: 3e827cbaa364 - main - ipfilter: fix LINT-NOINET6 build Content-Language: en-US To: Cy Schubert References: <202507121339.56CDd103089262@gitrepo.freebsd.org> From: John Baldwin Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org, Kristof Provost In-Reply-To: <202507121339.56CDd103089262@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 7/12/25 09:39, Kristof Provost wrote: > The branch main has been updated by kp: > > URL: https://cgit.FreeBSD.org/src/commit/?id=3e827cbaa3641d7137d7c7f1af326243bf46ae15 > > commit 3e827cbaa3641d7137d7c7f1af326243bf46ae15 > Author: Kristof Provost > AuthorDate: 2025-07-12 13:00:38 +0000 > Commit: Kristof Provost > CommitDate: 2025-07-12 13:04:16 +0000 > > ipfilter: fix LINT-NOINET6 build > > Event: Berlin 2025 Hackathon > Sponsored by: Rubicon Communications, LLC ("Netgate") > --- > sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c b/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c > index 04850549db98..6eb6cf2a7a47 100644 > --- a/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c > +++ b/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c > @@ -463,13 +463,14 @@ ipf_send_ip(fr_info_t *fin, mb_t *m) > int > ipf_send_icmp_err(int type, fr_info_t *fin, int dst) > { > - int err, hlen, xtra, iclen, ohlen, avail, code; > + int err, hlen, xtra, iclen, ohlen, avail; > struct in_addr dst4; > struct icmp *icmp; > struct mbuf *m; > i6addr_t dst6; > void *ifp; > #ifdef USE_INET6 > + int code; > ip6_t *ip6; > #endif > ip_t *ip, *ip2; > @@ -477,8 +478,8 @@ ipf_send_icmp_err(int type, fr_info_t *fin, int dst) > if ((type < 0) || (type >= ICMP_MAXTYPE)) > return (-1); > > - code = fin->fin_icode; > #ifdef USE_INET6 > + code = fin->fin_icode; > /* See NetBSD ip_fil_netbsd.c r1.4: */ > if ((code < 0) || (code >= sizeof(icmptoicmp6unreach)/sizeof(int))) > return (-1); I noticed this locally while testing another change, and this is the same build fix I was contemplating. However, I think the check is overly broad as the value of code depends on what type of ICMP error is being sent, and this range check is only valid for destination unreachable errors. That is, I think the check should be moved down to where the code is used which would make the reason for the check more obvious and avoid handling other ICMP packets incorrectly: #ifdef USE_INET6 else if (fin->fin_v == 6) { hlen = sizeof(ip6_t); ohlen = sizeof(ip6_t); iclen = hlen + offsetof(struct icmp, icmp_ip) + ohlen; type = icmptoicmp6types[type]; if (type == ICMP6_DST_UNREACH) code = icmptoicmp6unreach[code]; Here we should probably be doing something like: if (type == ICMP6_DST_UNREACH) { int code; code = fin->fin_code; if (code < 0 || code >= nitems(icmptoicmp6unreach)) { FREE_MB_T(m); return (-1); } code = icmptoicmp6unreach(code); } This would also avoid having the mostly unused `code` variable hanging around for the rest of the function. -- John Baldwin From nobody Sat Jul 12 17:07:28 2025 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 4bfZl56Bb2z60s4n; Sat, 12 Jul 2025 17:07:29 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bfZl55GdWz3mqm; Sat, 12 Jul 2025 17:07:29 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752340049; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=IAwjODVkQtbTfXAaP5fLVk0nw5L+W2b2s/pDribMrCc=; b=vcE+JgNcoolx2RdkSYsj0QQLjdKCUitZE//+M4v+9MFphUIBCmpFJMUNBSptT/+lSqv4C0 SkyYsDPAJO5h7hajSZiOUtzb2B+WtsXjsyrEy7loobgUfKk34putLe8vZMMSd4FWBEeUWb RbktjaqvfaL94NY8fEnnmo1DsjfDyMKIz3r+dpTMJPMlGO1xcKxMsMuT8RcfYBr5YVdQP+ 8+gEVzKsXtyDUokZf/L4kxsLzXkdWtyb5pc0mLORS92E1AJO+GvzwJj1iCx+ZKvCVcY0/C Cqo0tBj0Pv5nXvAfF/PTalkO/ORAmsxx6zfmh+4i8J6KQTYg1egPUDOCkuFa6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752340049; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=IAwjODVkQtbTfXAaP5fLVk0nw5L+W2b2s/pDribMrCc=; b=GatC8Z1BdjVopGG1GcP35GvLIXtMSVCbCwwUsNPPWWENsR0eTVDRhHqvYy9Z1lN5SY4rkS NH6B4jbHyvlyuVTewrsmGDT/Bz6GBFUefopHHnNmpuoZ+vCSqDxVV763UCa2Zc5FJRW+/8 Ld+xlcigA3b6LqmBHlEjG0YD9HyUGKUwHJc6ETPzX0Q0R5LzOvYnfNiZglO5IW0rDVqmPp C7gBWrnHc9p0Fa5kDPrBzeeow3c25SOE9VvXIRSwZ+/GCxsjNiiiOh8lFznOxBAq8UXyaw 7ar28vXSuMZPBxtcG0WsdjkPLgo7x83fjH5S8zDJjp1VKzbK+ycha5zfXuzegA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752340049; a=rsa-sha256; cv=none; b=NaqvHLBR3FSQrbwuF1e1POtNW0VkqIU9kxNdK4Tr46gCA62Dd3BOZ5vsd+GNH3TdBTeWEL Acbkc8adXIQtDskPq1SmL2fdt53q/vB01r94nMZ/e/l69JNPcgUeNubBPRCm1s8k27v2eu Btg0sZKjwH2QDRrRGy9lLmxnPNBib8VR1wk3IE4O3GaAwgcyhKemlaSZE4AJ1pK53b/GMh xRPU9hfXnkeB/QJYyPxB/rly2IzDqHV0o8uImgj5N4GH1KawzXKelLBxWUUr9X+8qRQHK7 HkoT0Uu0Z2eaO2jKtmd6mwsVc2oogSDIgxdTwG6HAiW95ol0tULJNb4mJZ1vdA== Received: from [IPV6:2601:5c0:4200:b830:d81d:ac36:2f10:9f48] (unknown [IPv6:2601:5c0:4200:b830:d81d:ac36:2f10:9f48]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bfZl53LkrzwGb; Sat, 12 Jul 2025 17:07:29 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <85f6ca74-b557-4658-93a0-62774d7da196@FreeBSD.org> Date: Sat, 12 Jul 2025 13:07:28 -0400 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: ba0d9b43e940 - main - kern_descrip.c: provide helpers to translate between fd flags namespace Content-Language: en-US To: Konstantin Belousov Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202507082149.568LnGOU086303@gitrepo.freebsd.org> From: John Baldwin In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 7/11/25 15:00, Konstantin Belousov wrote: > On Fri, Jul 11, 2025 at 11:46:33AM -0400, John Baldwin wrote: >> On 7/8/25 17:49, Konstantin Belousov wrote: >>> The branch main has been updated by kib: >>> >>> URL: https://cgit.FreeBSD.org/src/commit/?id=ba0d9b43e940077f4025e7e4e85d16c8d525db79 >>> >>> commit ba0d9b43e940077f4025e7e4e85d16c8d525db79 >>> Author: Konstantin Belousov >>> AuthorDate: 2025-07-08 16:30:29 +0000 >>> Commit: Konstantin Belousov >>> CommitDate: 2025-07-08 21:48:59 +0000 >>> >>> kern_descrip.c: provide helpers to translate between fd flags namespace >>> Reviewed by: markj >>> Sponsored by: The FreeBSD Foundation >>> Differential revision: https://reviews.freebsd.org/D51206 >>> --- >>> sys/kern/kern_descrip.c | 110 +++++++++++++++++++++++++++++++++++++++--------- >>> 1 file changed, 90 insertions(+), 20 deletions(-) >>> >>> diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c >>> index 406236fc2723..2e1da2fdee29 100644 >>> --- a/sys/kern/kern_descrip.c >>> +++ b/sys/kern/kern_descrip.c >>> @@ -480,6 +480,90 @@ kern_fcntl_freebsd(struct thread *td, int fd, int cmd, intptr_t arg) >>> return (error); >>> } >>> +struct flags_trans_elem { >>> + u_int f; >>> + u_int t; >>> +}; >>> + >>> +static u_int >>> +flags_trans(const struct flags_trans_elem *ftes, int nitems, u_int from_flags) >>> +{ >>> + u_int res; >>> + int i; >>> + >>> + res = 0; >>> + for (i = 0; i < nitems; i++) { >>> + if ((from_flags & ftes[i].f) != 0) >>> + res |= ftes[i].t; >>> + } >>> + return (res); >>> +} >>> + >>> +static uint8_t >>> +fd_to_fde_flags(int fd_flags) >>> +{ >>> + static const struct flags_trans_elem fd_to_fde_flags_s[] = { >>> + { .f = FD_CLOEXEC, .t = UF_EXCLOSE }, >>> + { .f = FD_CLOFORK, .t = UF_FOCLOSE }, >>> + { .f = FD_RESOLVE_BENEATH, .t = UF_RESOLVE_BENEATH }, >>> + }; >>> + >>> + return (flags_trans(fd_to_fde_flags_s, nitems(fd_to_fde_flags_s), >>> + fd_flags)); >>> +} >>> + >>> +static int >>> +fde_to_fd_flags(uint8_t fde_flags) >>> +{ >>> + static const struct flags_trans_elem fde_to_fd_flags_s[] = { >>> + { .f = UF_EXCLOSE, .t = FD_CLOEXEC }, >>> + { .f = UF_FOCLOSE, .t = FD_CLOFORK }, >>> + { .f = UF_RESOLVE_BENEATH, .t = FD_RESOLVE_BENEATH }, >>> + }; >>> + >>> + return (flags_trans(fde_to_fd_flags_s, nitems(fde_to_fd_flags_s), >>> + fde_flags)); >>> +} >>> + >>> +static uint8_t >>> +fddup_to_fde_flags(int fddup_flags) >>> +{ >>> + static const struct flags_trans_elem fddup_to_fde_flags_s[] = { >>> + { .f = FDDUP_FLAG_CLOEXEC, .t = UF_EXCLOSE }, >>> + { .f = FDDUP_FLAG_CLOFORK, .t = UF_FOCLOSE }, >>> + }; >>> + >>> + return (flags_trans(fddup_to_fde_flags_s, nitems(fddup_to_fde_flags_s), >>> + fddup_flags)); >>> +} >>> + >>> +static uint8_t >>> +close_range_to_fde_flags(int close_range_flags) >>> +{ >>> + static const struct flags_trans_elem close_range_to_fde_flags_s[] = { >>> + { .f = CLOSE_RANGE_CLOEXEC, .t = UF_EXCLOSE }, >>> + { .f = CLOSE_RANGE_CLOFORK, .t = UF_FOCLOSE }, >>> + }; >>> + >>> + return (flags_trans(close_range_to_fde_flags_s, >>> + nitems(close_range_to_fde_flags_s), close_range_flags)); >>> +} >>> + >>> +static uint8_t >>> +open_to_fde_flags(int open_flags, bool sticky_orb) >>> +{ >>> + static const struct flags_trans_elem open_to_fde_flags_s[] = { >>> + { .f = O_CLOEXEC, .t = UF_EXCLOSE }, >>> + { .f = O_CLOFORK, .t = UF_FOCLOSE }, >>> + { .f = O_RESOLVE_BENEATH, .t = UF_RESOLVE_BENEATH }, >>> + }; >>> + _Static_assert(open_to_fde_flags_s[nitems(open_to_fde_flags_s) - 1].f == >>> + O_RESOLVE_BENEATH, "O_RESOLVE_BENEATH must be last, for sticky_orb"); >> >> This broke the GCC builds it seems. GCC doesn't think that it can compute this >> expression at compile time. >> >> From https://ci.freebsd.org/job/FreeBSD-main-amd64-gcc14_build/1022/console: >> >> 10:32:02 /workspace/src/sys/kern/kern_descrip.c: In function 'open_to_fde_flags': >> 10:32:02 /workspace/src/sys/kern/kern_descrip.c:560:79: error: expression in static = >> 10:32:02 assertion is not constant >> 10:32:02 560 | _Static_assert(open_to_fde_flags_s[nitems(open_to_fde_flags= >> 10:32:02 _s) - 1].f =3D=3D >> > > I am unable to propose anything better than the patch below. We have enough > #ifdef __clang__ in non-contrib sources already, so this should be not a > huge crime? > > % rg -g '!contrib/*' __clang__ | wc -l > 171 > > commit 96e6b15b0a1407af45ebe1ad38ee53627d09d16b > Author: Konstantin Belousov > Date: Fri Jul 11 21:57:32 2025 +0300 > > kern_descrip.c: only allow complex expression in Static_assert() for clang > > gcc cannot compute the assert expression. > > Reported by: jhb > > diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c > index 93bdd41d1515..c4f5e586b0ed 100644 > --- a/sys/kern/kern_descrip.c > +++ b/sys/kern/kern_descrip.c > @@ -557,8 +557,10 @@ open_to_fde_flags(int open_flags, bool sticky_orb) > { .f = O_CLOFORK, .t = UF_FOCLOSE }, > { .f = O_RESOLVE_BENEATH, .t = UF_RESOLVE_BENEATH }, > }; > +#ifdef __clang__ > _Static_assert(open_to_fde_flags_s[nitems(open_to_fde_flags_s) - 1].f == > O_RESOLVE_BENEATH, "O_RESOLVE_BENEATH must be last, for sticky_orb"); > +#endif I think this is fine. Mark Millard followed up with me offline and it may be that GCC is technically more correct here with what is allowed to be computed as a static constant at compile time FWIW. C++' constexpr allows for a wider range of compile-time constant values compared to C and this sort of thing feels very constexpr-like. -- John Baldwin From nobody Sat Jul 12 17:57:02 2025 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 4bfbrH03JTz60vrZ; Sat, 12 Jul 2025 17:57:03 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bfbrG27lkz483t; Sat, 12 Jul 2025 17:57:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752343022; 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=P0jisrWxuKuzPWxGxYqvcmuHZMeSzl+C1w4qvPmDZH4=; b=Li+hwPtC547hYfpCrAepy2EbRdmg8QONmaXDw6KTitB3UxaCBL2LtEQzJa3WaPB2epGOnc rHwLY5Wz+yhlAlvawTeA5FHJZ6YNWeDBj8YewwxV9W0YCWhVFlEe9hVbJ0RYCB4jzxOqJh M2qVls44aShQ7nqOtfyAfs6MN7gvNh8C1h1qcdkJbNFKRqe96j5p4jXAdiGxSZloXEoz7D 1mJsHQZ9Vlc+MjxDUSijpQUfv+6L1gqC2Xsy70jz4dV+IkOVKPGvMhi+HJy3tfjd61lLnp HW+kN7YNkOhK+ZTeRcJ0E8f6Gq693sMoOwpDDWQ3PamzHfHFJnBb4nrx69otkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752343022; 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=P0jisrWxuKuzPWxGxYqvcmuHZMeSzl+C1w4qvPmDZH4=; b=O3zJONzactrszHpqMmcsS/v60q9zmRIW176rhv27SgB20Zw8BLSXAPapE+XoARMifBz/4j gc8yRlVRr2o6kH+w3Pc3LM2BE/NnOCFg0D/uMPLcEZ54IU9ya122LSHJwQrsIDgH2GxwGU OpZwB9UTAvrABhS3JpESb76n+Q7uPiav4KonL2IJmpaJKXuL5bybRcXdVb+PLp5voSCC98 B1/ZX3D2Bcyfj7VAgswYlUq3mazSv4IzIXu67ycyoGpIFtqe8WVCXpEB++Do8FqlgDIKsU DsosyV9O0U0cRncVqkRYS5Ik4fBG5IQHDADvut8WvEqp9T0W6atz6zYci2VUYQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752343022; a=rsa-sha256; cv=none; b=w+uUAO1vLBsv9XirbZ3KBMpR7WK5L1v0qMef1jYdQSZP89SRp/MSuwUkbRYAEZB94Me+W4 PS7LAE8eVDwpt6G1j+iiGl1b6XgBVZl5HggLGSPdAR2k+rhahtB/XFTmq+o5BF19iWOie2 2z3KQEdXAvia5NXQ5SSqjdmMBEMhzKTbAMPDFaQ4cUb/AiWzLaQPgfURgfiguR6e16fMDm I72oDVuaZPo7yQ/sG/zB7UrxIuZuVgHR3RBLo88Rf8duAWxs5tEu2qQX18FnmMOAucxZXk 38AM7cM9Vt7woddaQasZUO9nQIut+z76uQBPrrwF38HPU09ih2k55UbuWMPPfg== 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 4bfbrG1bwzzYnX; Sat, 12 Jul 2025 17:57:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56CHv25N075598; Sat, 12 Jul 2025 17:57:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56CHv2Vi075595; Sat, 12 Jul 2025 17:57:02 GMT (envelope-from git) Date: Sat, 12 Jul 2025 17:57:02 GMT Message-Id: <202507121757.56CHv2Vi075595@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: fb84b9f400d2 - main - kern_descrip.c: only allow complex expression in Static_assert() for clang 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fb84b9f400d2d2bb8e1336fbacc7fbd14d31974b Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=fb84b9f400d2d2bb8e1336fbacc7fbd14d31974b commit fb84b9f400d2d2bb8e1336fbacc7fbd14d31974b Author: Konstantin Belousov AuthorDate: 2025-07-11 18:57:32 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-12 17:56:13 +0000 kern_descrip.c: only allow complex expression in Static_assert() for clang gcc cannot compute the assert expression, which is formally not required by a C standard. Reported and reviewed by: jhb Sponsored by: The FreeBSD Foundation --- sys/kern/kern_descrip.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index 93bdd41d1515..c4f5e586b0ed 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -557,8 +557,10 @@ open_to_fde_flags(int open_flags, bool sticky_orb) { .f = O_CLOFORK, .t = UF_FOCLOSE }, { .f = O_RESOLVE_BENEATH, .t = UF_RESOLVE_BENEATH }, }; +#ifdef __clang__ _Static_assert(open_to_fde_flags_s[nitems(open_to_fde_flags_s) - 1].f == O_RESOLVE_BENEATH, "O_RESOLVE_BENEATH must be last, for sticky_orb"); +#endif return (flags_trans(open_to_fde_flags_s, nitems(open_to_fde_flags_s) - (sticky_orb ? 0 : 1), open_flags)); From nobody Sat Jul 12 22:39:39 2025 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 4bfk6M5v93z61F36; Sat, 12 Jul 2025 22:39:39 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bfk6M5GPhz4NjM; Sat, 12 Jul 2025 22:39:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752359979; 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=oGO2Kiqqj5Gp8ORhEUH+H50QizgRq+b/R9qgd3gOC5k=; b=q+zajHJI11yA+DOSPMSBc4H3zDpn4B4xI2nXJ1VNzD7mR3hA6EKWu6V0bWPhrDzGTMXSPF V2S6l/tx1OISgnG8ePrCqGIHqufEy8IB9c6U/lsqf/8r21WO/9FWa1S76wHS7z+TWaYmCC CZqHg36Jec1P6q5P/AYcwyjkQLvtiQgPamg66tUSMgSU6nVKosECfDREJEgaLrWXLUJZXP Mk4rVe38k0Hq9fCllQSG8peApmYTimtBxHGN5GNn4B1fpBZp02eaNKl21LMUAz6IMWx2bY mQ2O9pmhBz61cwbuRlswPBV1rvgGe7ZhCv9x/atMqS8fTBaTIVA5yTjPHnUUVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752359979; 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=oGO2Kiqqj5Gp8ORhEUH+H50QizgRq+b/R9qgd3gOC5k=; b=UzgjFckli1BlMyDKTttizQLqDXO8VMqQK+Cu5ivogfaw3DrfgDWnLZ+ouTk9qTzGOIvTat NMAN/0HJ2l98z3Qfk2mjOKHTCtPr8lekZhq8SVoaEVP7MKnxb84L/6iTSstPan102h1VWL OjKz7gk9JmwN83NXy/xPXFYnOzRln5xDIwl3bQrFUgUXEkpfAdL5C8xDvE6VbchvECPQkM 2G7x3HA5iSimQDM3UjRd0mh3k/1UPUPPqf9KU+y9cf8XhHDhZXONSnDF68u1Lo2FtC/7uK 5OxTnGzsTWoPELdoEZMhNLYGnJ6daDPuvh7mLSH6wPAd4k4PANkmAtb9fvDP/w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752359979; a=rsa-sha256; cv=none; b=iD4r4ltH8siH97zrjaCGohcm+ijOgGnFeAQ6EZh03tSRkzfhKHEnQJ37ww4QtUuGV2Q6M1 6M+kwQnzlpXKyC+IoE/FaXaSsD2KFdnjcsE7/meM5eovbhuiy6k1McWswvA/cts+4dDCCZ wd6OdVx8M8EUDW25t3PfM3vuIJYMs5RMGeLjglK19fbFOS9auBNkOCrZTzo7mrwjk5omcf Yod8DkXO2A1a92Xe+eKUDeeTLS/MQlhHHA6Z7ejaW0k0ZgfyYHTBNfXYZNJVTlPUact5Og sbkI6S6LHAGvmbB7OtZ6y83pwkBuOpBG//hYmFMWt7f+HIfHbmDu7nVfhZ2KHA== 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 4bfk6M4h50zjDD; Sat, 12 Jul 2025 22:39:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56CMddnb000272; Sat, 12 Jul 2025 22:39:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56CMddG1000269; Sat, 12 Jul 2025 22:39:39 GMT (envelope-from git) Date: Sat, 12 Jul 2025 22:39:39 GMT Message-Id: <202507122239.56CMddG1000269@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Gallatin Subject: git: 78bdaa57cfba - main - lagg: Fix if_hw_tsomax_update() not being called 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gallatin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 78bdaa57cfbac759a6d79ecad2fae570e294a4b3 Auto-Submitted: auto-generated The branch main has been updated by gallatin: URL: https://cgit.FreeBSD.org/src/commit/?id=78bdaa57cfbac759a6d79ecad2fae570e294a4b3 commit 78bdaa57cfbac759a6d79ecad2fae570e294a4b3 Author: Andrew Gallatin AuthorDate: 2025-07-12 22:35:29 +0000 Commit: Andrew Gallatin CommitDate: 2025-07-12 22:35:29 +0000 lagg: Fix if_hw_tsomax_update() not being called In a mixed lagg, its likely that ifcaps or hwassist may not match between members. If this is true, the logical OR will be short-circuited and if_hw_tsomax_update() will not be called. Fix this by calling it inside the body of the if as well Sponsored by: Netflix MFC after: 2 weeks --- sys/net/if_lagg.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/net/if_lagg.c b/sys/net/if_lagg.c index 9867a718e148..5b52bfa80e3b 100644 --- a/sys/net/if_lagg.c +++ b/sys/net/if_lagg.c @@ -718,6 +718,7 @@ lagg_capabilities(struct lagg_softc *sc) sc->sc_ifp->if_capenable = ena; sc->sc_ifp->if_capenable2 = ena2; sc->sc_ifp->if_hwassist = hwa; + (void)if_hw_tsomax_update(sc->sc_ifp, &hw_tsomax); getmicrotime(&sc->sc_ifp->if_lastchange); if (sc->sc_ifflags & IFF_DEBUG) From nobody Sun Jul 13 00:56:51 2025 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 4bfn8j6Y09z61PjJ; Sun, 13 Jul 2025 00:56:53 +0000 (UTC) (envelope-from ahmadkhalifa570@gmail.com) Received: from mail-yw1-x112c.google.com (mail-yw1-x112c.google.com [IPv6:2607:f8b0:4864:20::112c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bfn8j44nsz3QsN; Sun, 13 Jul 2025 00:56:53 +0000 (UTC) (envelope-from ahmadkhalifa570@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-yw1-x112c.google.com with SMTP id 00721157ae682-710f39f5cb9so28685657b3.3; Sat, 12 Jul 2025 17:56:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1752368211; x=1752973011; darn=freebsd.org; h=cc:to:subject:message-id:date:in-reply-to:references:from :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=foGUA38DdNrv5h+SBwYtFpCiYdG1chqR/Kv/rGmdyWo=; b=mKoBHe2Nb4vzPaaYFHO+pRG3EAyn+24q7rpWEvABRpksB+l8ym3bUOZVBNGT/C5TpH eQTOabaPPTqZhZoSS8mhFrjTrqJUkqP5pZqus0USMrtAGHFJfEjQ6lQa61AHE0Jwg4N4 HIXiCsw3o2JHyXjSM9eAf/H4Sil6k7DAKUQQY8pD+RoqHYGfIctmeP2mupsKdw0Nkkcx UfD2YUitV4fi08Nv/QoQR0/i44iiKnElkfNHUmp0ChSyf8yoYGQlh8pmr47zxfvGogNZ cHzqPmxo45kBewYjkf6CR5YdBRHOEwDc44kF+ca6fdG1MTZixtANrtp9n8gleGodiJnP 6TYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752368211; x=1752973011; h=cc:to:subject:message-id:date:in-reply-to:references:from :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=foGUA38DdNrv5h+SBwYtFpCiYdG1chqR/Kv/rGmdyWo=; b=F33SfiT641iyaF2hqX+ukLP1SnJy5k7z4voytCTkZWdeEPxpX5GwhcsqC9L3jvA1XO +YlsywcuL0QpzA/KI8jeLj5pndKdBTl0UbSOFkfDFqwaQMROjcGBLhVZ+UbV6WEPoy0/ v8tRrWwOEOET7dDl2/x2FttxoP4u+tZoU2WgbNlWOKvQ0K3UVYHMjshADj6U3v79/2eA KUYrqRs5NHaTy6YOEjdQbeS8HQgETaQW2rds0uswGM/KI8DF+F8TdPaoZnsqu1RQH/YX nY0/Jt6wanZMu+Mk0ea37c+IoKqvBKYPHhAw0osQukszUacSWWfV1rCdRxMXXIaZkVbb l2/Q== X-Forwarded-Encrypted: i=1; AJvYcCUEPjc1DwKMG+SO+BwJo+7QSNH6QGTG5dlzC7f7jxdwV+s6+3G5F043Qe0wpBWGvuw8rzovLU9AFCXlX7Wv6o7NiAMe@freebsd.org, AJvYcCUz+8grzDDrdY/9b5+DJXuCN233cw3lP7RLDMNnWhiNCvNPCwORxsRlCPziuWoTWn2HGO8jN4njS5egnE/loA0=@freebsd.org, AJvYcCWmBShpI47aZraGYI6XNqY10FK4UbNgbBfx2Uw4+9t4VHYDnNiDhDmue249CUuBLSmnGKERjmUwpij/YFMrRMTC47+9ehU=@freebsd.org X-Gm-Message-State: AOJu0Yw+yhNVYqrlZ3J0lEUBNp9fVenpGxIitnkc1os3+dXwYOiJvd+y /QtTHc9Gi4yZrPgH9JOLpnRz8C90b12gNZvetEVTflVWYv1ATDItq82GWK9InmzOM27vy8J94zs 2kbUKPHTddfwRFta3cRSOKKX/9aQ5mQbqGg== X-Gm-Gg: ASbGncuAtu0yD4sbj1uEClzraGp8VBROITfyJuSu5/armoHveQGP5Cw3mn4k/f8sBHS lyVl5ab0fOkd3qK8dFUWDdu1XJRbh50DcQXM9sI6VozxsyXF4E6GB9rfodI1Gz2vRjdAFZ0eX+v IbQqGC32Yl7vBPHm4PJQeW7DR8RVaN7JvYDt5W0dKBtlNlgrVjSnwOscL0jx+foqRbZ3aVIwxy3 uWRBlBS X-Google-Smtp-Source: AGHT+IHAbVBju5zC97ECCDZfsMSy8sYhYwEu1IOFJ3n7akVqXe6TMyzuJMcSED8kF7Y6zu7EzvMkteTZ7gn/vdtNe5o= X-Received: by 2002:a05:690c:55c3:10b0:714:31:c9c6 with SMTP id 00721157ae682-717db2b04b7mr75488477b3.30.1752368211567; Sat, 12 Jul 2025 17:56:51 -0700 (PDT) Received: from 490177373942 named unknown by gmailapi.google.com with HTTPREST; Sun, 13 Jul 2025 00:56:51 +0000 Received: from 490177373942 named unknown by gmailapi.google.com with HTTPREST; Sun, 13 Jul 2025 00:56:51 +0000 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org Mime-Version: 1.0 From: Ahmad Khalifa X-Mailer: aerc 0.20.1 References: <202507121757.56CHv2Vi075595@gitrepo.freebsd.org> In-Reply-To: <202507121757.56CHv2Vi075595@gitrepo.freebsd.org> Date: Sun, 13 Jul 2025 00:56:51 +0000 X-Gm-Features: Ac12FXzE203uMRhcsVh7gBMbJY7CmVnb1y5t_lZZUpbv-6SVzZMwwOXMArPy2s8 Message-ID: Subject: Re: git: fb84b9f400d2 - main - kern_descrip.c: only allow complex expression in Static_assert() for clang To: Konstantin Belousov Cc: jhb@freebsd.org, src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4bfn8j44nsz3QsN X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] On Sat Jul 12, 2025 at 8:57 PM +0300, Konstantin Belousov wrote: > The branch main has been updated by kib: > > URL: https://cgit.FreeBSD.org/src/commit/?id=fb84b9f400d2d2bb8e1336fbacc7fbd14d31974b > > commit fb84b9f400d2d2bb8e1336fbacc7fbd14d31974b > Author: Konstantin Belousov > AuthorDate: 2025-07-11 18:57:32 +0000 > Commit: Konstantin Belousov > CommitDate: 2025-07-12 17:56:13 +0000 > > kern_descrip.c: only allow complex expression in Static_assert() for clang > > gcc cannot compute the assert expression, which is formally not required > by a C standard. > > Reported and reviewed by: jhb > Sponsored by: The FreeBSD Foundation > --- > sys/kern/kern_descrip.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c > index 93bdd41d1515..c4f5e586b0ed 100644 > --- a/sys/kern/kern_descrip.c > +++ b/sys/kern/kern_descrip.c > @@ -557,8 +557,10 @@ open_to_fde_flags(int open_flags, bool sticky_orb) > { .f = O_CLOFORK, .t = UF_FOCLOSE }, > { .f = O_RESOLVE_BENEATH, .t = UF_RESOLVE_BENEATH }, > }; > +#ifdef __clang__ > _Static_assert(open_to_fde_flags_s[nitems(open_to_fde_flags_s) - 1].f == > O_RESOLVE_BENEATH, "O_RESOLVE_BENEATH must be last, for sticky_orb"); > +#endif > > return (flags_trans(open_to_fde_flags_s, nitems(open_to_fde_flags_s) - > (sticky_orb ? 0 : 1), open_flags)); This doesn't compile on clang14 when cross-building do we still care about that? See https://github.com/freebsd/freebsd-src/actions/runs/16240751228/job/45856816666 From nobody Sun Jul 13 01:24:22 2025 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 4bfnmQ4KpCz61S38; Sun, 13 Jul 2025 01:24:22 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bfnmQ3dqJz3h72; Sun, 13 Jul 2025 01:24:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752369862; 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=0k8J9kqtcR39C/+IEk7MckcNIkZ0/35VAx6bEgkG4QQ=; b=Au9kwx0EkC4XY/zmZodAMwR6CNxma8Pql+CcM0QVhIBaz4s40xiHxHTiIglPv+oWTuRWrB chVw2pcp94h8HvUw1/OLAr17onZ88QjY53UPnZiql5SzVky8sUE0K894a5X4D6jw1Jllht 0DdsUYmkuDgGFPmHTitWOKpACPFAKij0afN9cZmdijej0Go1UngYm80UprTgLk2kUYw1rL GFMAVLG6WXK4xM1ZzBKT1U5Xf5+ohOEu4bbmp4WWyLXV6hSnR7GW0o0FTDcpjOnMZvEmcE pc5qr5VHgn931FsiFdTr6EQwsv+cVi5Oc/RIRqs9zoanffRnJuVfx8Wkd2zueA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752369862; 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=0k8J9kqtcR39C/+IEk7MckcNIkZ0/35VAx6bEgkG4QQ=; b=ihOJqgmmxO3DW3DEJORqs46JFkuUPnXjduV7yurT1p9PyGtM20h1MTNewQz0wToLZvS8xW EAu6a7uW8Z5SC1v8uB2NKxMISiUMtu+v9dUXcluJg92eaYcKbmjHc1VbDHhAnHIDUt6JBe R0s2/iC37+3lCqdyzEqnfXm+S8Ip6VZ9Tp3UVcgZB06qXERDajIabJSlnutjDkc0Vniakp RQ+TcVRCQ7xHJfwhOTfY0tON+AS8UUl+nhXDqx+P7O1yqEBtPZXo2fug3EVhZaVfFzFCFK p5YY/wTbiKdCTBAyTLEtnIWh8UIxOJpbIxuG/LOgtjREZ9zhBAVwJjAA0qSZ9g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752369862; a=rsa-sha256; cv=none; b=SAHZJiDmbyxpspWS8sKA97+65p0W1SUHEk7y3c3b6Srp5ZzZqknsQkGHwVQfr83E1PGUnG IDSAPjGGVNSodsqvl3IhmS5Ur4mLZ1iP+nEYrYruXum4+RhheZCMKrUuR4MdSrEP9Rpsbl CJcyfKw7S3fTyJgk8hflmFnqKpf+hqqmD7roK0yyexjefKCf6+nprWy4QPUMZSN+BaDa6L 93DnBy8hNR+h+jM71MeQDcHjAl3rWhQ7W4wYTLa/QpEwdJIV196Z6CtqEU7JYxW/hj1BCQ 0tNtIep2QMdpSgYzYhmNoo1AsNc72+z0tARzIxhQ2iny9V9u+wP3KsPHJCEmUA== 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 4bfnmQ2vhbznFb; Sun, 13 Jul 2025 01:24:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56D1OM3c017196; Sun, 13 Jul 2025 01:24:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56D1OM9q017193; Sun, 13 Jul 2025 01:24:22 GMT (envelope-from git) Date: Sun, 13 Jul 2025 01:24:22 GMT Message-Id: <202507130124.56D1OM9q017193@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: bf4d2a45b991 - main - kern_descrip.c: further limit expression in Static_assert() to newer clang 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bf4d2a45b9913bbd4720423288f4bdb2f0afc970 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=bf4d2a45b9913bbd4720423288f4bdb2f0afc970 commit bf4d2a45b9913bbd4720423288f4bdb2f0afc970 Author: Konstantin Belousov AuthorDate: 2025-07-13 01:18:24 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-13 01:24:14 +0000 kern_descrip.c: further limit expression in Static_assert() to newer clang Reported by: vexeduxr Sponsored by: The FreeBSD Foundation --- sys/kern/kern_descrip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index c4f5e586b0ed..a27ab33b34da 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -557,7 +557,7 @@ open_to_fde_flags(int open_flags, bool sticky_orb) { .f = O_CLOFORK, .t = UF_FOCLOSE }, { .f = O_RESOLVE_BENEATH, .t = UF_RESOLVE_BENEATH }, }; -#ifdef __clang__ +#if defined(__clang__) && __clang_major__ >= 19 _Static_assert(open_to_fde_flags_s[nitems(open_to_fde_flags_s) - 1].f == O_RESOLVE_BENEATH, "O_RESOLVE_BENEATH must be last, for sticky_orb"); #endif From nobody Sun Jul 13 01:25:20 2025 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 4bfnnr3vzmz61RXl; Sun, 13 Jul 2025 01:25:36 +0000 (UTC) (envelope-from kib@freebsd.org) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (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 mx1.freebsd.org (Postfix) with ESMTPS id 4bfnnr0RRFz3hsr; Sun, 13 Jul 2025 01:25:35 +0000 (UTC) (envelope-from kib@freebsd.org) Authentication-Results: mx1.freebsd.org; none Received: from tom.home (kib@localhost [127.0.0.1] (may be forged)) by kib.kiev.ua (8.18.1/8.18.1) with ESMTP id 56D1PLUb041310; Sun, 13 Jul 2025 04:25:24 +0300 (EEST) (envelope-from kib@freebsd.org) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 56D1PLUb041310 Received: (from kostik@localhost) by tom.home (8.18.1/8.18.1/Submit) id 56D1PK55041309; Sun, 13 Jul 2025 04:25:20 +0300 (EEST) (envelope-from kib@freebsd.org) X-Authentication-Warning: tom.home: kostik set sender to kib@freebsd.org using -f Date: Sun, 13 Jul 2025 04:25:20 +0300 From: Konstantin Belousov To: Ahmad Khalifa Cc: jhb@freebsd.org, src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: fb84b9f400d2 - main - kern_descrip.c: only allow complex expression in Static_assert() for clang Message-ID: References: <202507121757.56CHv2Vi075595@gitrepo.freebsd.org> 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on tom.home X-Rspamd-Queue-Id: 4bfnnr0RRFz3hsr X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] On Sun, Jul 13, 2025 at 12:56:51AM +0000, Ahmad Khalifa wrote: > On Sat Jul 12, 2025 at 8:57 PM +0300, Konstantin Belousov wrote: > > The branch main has been updated by kib: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=fb84b9f400d2d2bb8e1336fbacc7fbd14d31974b > > > > commit fb84b9f400d2d2bb8e1336fbacc7fbd14d31974b > > Author: Konstantin Belousov > > AuthorDate: 2025-07-11 18:57:32 +0000 > > Commit: Konstantin Belousov > > CommitDate: 2025-07-12 17:56:13 +0000 > > > > kern_descrip.c: only allow complex expression in Static_assert() for clang > > > > gcc cannot compute the assert expression, which is formally not required > > by a C standard. > > > > Reported and reviewed by: jhb > > Sponsored by: The FreeBSD Foundation > > --- > > sys/kern/kern_descrip.c | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c > > index 93bdd41d1515..c4f5e586b0ed 100644 > > --- a/sys/kern/kern_descrip.c > > +++ b/sys/kern/kern_descrip.c > > @@ -557,8 +557,10 @@ open_to_fde_flags(int open_flags, bool sticky_orb) > > { .f = O_CLOFORK, .t = UF_FOCLOSE }, > > { .f = O_RESOLVE_BENEATH, .t = UF_RESOLVE_BENEATH }, > > }; > > +#ifdef __clang__ > > _Static_assert(open_to_fde_flags_s[nitems(open_to_fde_flags_s) - 1].f == > > O_RESOLVE_BENEATH, "O_RESOLVE_BENEATH must be last, for sticky_orb"); > > +#endif > > > > return (flags_trans(open_to_fde_flags_s, nitems(open_to_fde_flags_s) - > > (sticky_orb ? 0 : 1), open_flags)); > > This doesn't compile on clang14 when cross-building do we still care > about that? > > See https://github.com/freebsd/freebsd-src/actions/runs/16240751228/job/45856816666 Thank you for the report. I do not that we should care much, but in this case it costs nothing to care. I went ahead with bf4d2a45b991. From nobody Sun Jul 13 07:27:32 2025 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 4bfxqT4Lsdz61pZF; Sun, 13 Jul 2025 07:27:33 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bfxqS6v9qz3H32; Sun, 13 Jul 2025 07:27:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752391653; 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=UUZX22YsYTKrtWv7z4EPRWKU6yx9EJv02F0KO2W1F4A=; b=f9AE8cGtK1cUTBBdcTDWq3yh63qu5/zs0nZLY5guxXKSS8BW8fc7PuKMW8XxL4+EyWx4s7 XU0iwUZ4RT2An746LScUWVuDldFS8PFqyDtwzTI9aEYOVJ37c1+hPF+NW3Y7qnzvL3XFyP Lzygc9GKwjxHrTNWsk3D7srhyasHl2p1F7bNX0c8gVsobIuO0LKcdNm6UULCQiNdEbS5n8 NK6b0fiUZplEP78t0VQ2QXvxYE7QGfFhdKjf8qgD99WqBgBTSsIfF/kN9GEBZUJVkInDwN WXbkvzbRWry4cIO/voS7xBH1uf7hm47nLUzrtmdtTxcTvFCUO7Tgqu6BULVqiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752391653; 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=UUZX22YsYTKrtWv7z4EPRWKU6yx9EJv02F0KO2W1F4A=; b=MostrwYAuLtRWNATFLA+H0FZo0e0ZMkRniArI3h5nPEeGHetADWOvmB8jf94TtXbfSWYLD C13s5xtZzeewlHa7W3yJFXWKjt249NNM/KA4sJAeAtTtD7NSS8WW7/QibggsxPmQPmXv57 kIpwkiBnAVhPYe7IJTsO0FDznWDd1OOZQ+ajzSt8gBCHN5VLirML+17ejHusgHEHiODI3P sowQUsYKymAcFCeDCxmBQuD442a5qF7NQjkvWjfw5+Z5Fyp78ICYTNDgXKjRt4PEzAj9Pi T0kE/rk0Y2LRUf0Q83KMNEx8HxkxSSktz3xtUz+H1P1z5+sFIBaM46cwSP/2PA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752391653; a=rsa-sha256; cv=none; b=jNdJeF3Q6D1/45VU9yekL4uIbrs4twWz0oK49yNr8RMHBL0Cxpm5onXQxPbwyhl8MSTc+5 gk7K2MpYBYJYCpki3L4wGexnQv/7SoBSoCXhjenA1uqZFt9SUAfoIj812v1CpKttUPyugY vweMfj4OVTJf2OX0docqYoEZcq7AhUGap/JVDR9JG5dursgOOzvYuP/D0FGP9tyjtU0SeC wO/aeab/QZR7yDpedi6xo2RBmnppRoOuVtWOzhMV0m9a9Qnm0+AAP0k/IqneC63urLOg63 ioaatlFkhide2w6wwnMb0GBwiVZeVMitjaoBYIy50IJWoYeq5dxxPBmO98t9DQ== 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 4bfxqS6HYwzyfm; Sun, 13 Jul 2025 07:27:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56D7RW9A094700; Sun, 13 Jul 2025 07:27:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56D7RW9M094697; Sun, 13 Jul 2025 07:27:32 GMT (envelope-from git) Date: Sun, 13 Jul 2025 07:27:32 GMT Message-Id: <202507130727.56D7RW9M094697@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Certner Subject: git: 986edb19a49c - main - LinuxKPI: Have kvzalloc() rely on kvmalloc(), not kmalloc() 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 986edb19a49c7d7d3050c759d9b0826283492ebf Auto-Submitted: auto-generated The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=986edb19a49c7d7d3050c759d9b0826283492ebf commit 986edb19a49c7d7d3050c759d9b0826283492ebf Author: Olivier Certner AuthorDate: 2025-07-07 13:28:21 +0000 Commit: Olivier Certner CommitDate: 2025-07-13 06:46:49 +0000 LinuxKPI: Have kvzalloc() rely on kvmalloc(), not kmalloc() Since commit 19df0c5abcb9d4e9 ("LinuxKPI: make __kmalloc() play by the rules"), kmalloc() systematically allocates contiguous physical memory, as it should. However, kvzalloc() was left defined in terms of kmalloc(), which makes it allocate contiguous physical memory too. This is a too stringent restriction, as kvzalloc() is supposed to be a simple page-zeroing wrapper around kvmalloc(). According to Linux's documentation ("memory-allocation.rst"), kvmalloc() first tries to allocate contiguous memory, falling back to non-contiguous one if that fails. Thus, callers are already supposed to deal with the possibility of non-contiguous memory being returned. Reviewed by: bz Fixes: 19df0c5abcb9 ("LinuxKPI: make __kmalloc() play by the rules") MFC after: 10 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D51247 --- sys/compat/linuxkpi/common/include/linux/slab.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/include/linux/slab.h b/sys/compat/linuxkpi/common/include/linux/slab.h index f3a840d9bf4b..efa5c8cb67b3 100644 --- a/sys/compat/linuxkpi/common/include/linux/slab.h +++ b/sys/compat/linuxkpi/common/include/linux/slab.h @@ -45,7 +45,7 @@ MALLOC_DECLARE(M_KMALLOC); -#define kvzalloc(size, flags) kmalloc(size, (flags) | __GFP_ZERO) +#define kvzalloc(size, flags) kvmalloc(size, (flags) | __GFP_ZERO) #define kvcalloc(n, size, flags) kvmalloc_array(n, size, (flags) | __GFP_ZERO) #define kzalloc(size, flags) kmalloc(size, (flags) | __GFP_ZERO) #define kzalloc_node(size, flags, node) kmalloc_node(size, (flags) | __GFP_ZERO, node) From nobody Sun Jul 13 07:27:31 2025 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 4bfxqS4pnQz61ppm; Sun, 13 Jul 2025 07:27:32 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bfxqR70d4z3H31; Sun, 13 Jul 2025 07:27:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752391652; 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=ZukLrc1x89YuIVKXQLHlepKFvPVSmGroywCCCmjqjK8=; b=MuTkfh2nvzk5oTCiG6MCNgl1dzoXNoMzGm9vdTBRtPiskQ5QKvFcn3Enzw+4jQN89oLTRW OUiRUmewTR5Mf/iHFgKxoc+oT45OWIMVXTnqEwW5WMGBW01+0I31JZcohKOPGK6OpHhjsd cmhuuYMuIWhehyBHqncKP6ej+nnFtmMbtUJPWtCD5X2awx8hmRXsvlnVtdwxDClZSeLZSw 0gfG1L0mx/OQKVN+s8C+/v7GETjE5+nwLmZiCPjQKnYdoL+75JtkBInrSrCi7T9ozXOg3E 1l+QHqTaMCkIQYOTLgk43+sZ2lW6WHP05nmxw9EUfTGK+vzxd4ZcvPcOURYzVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752391652; 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=ZukLrc1x89YuIVKXQLHlepKFvPVSmGroywCCCmjqjK8=; b=FFFKJr5pOpYbEn0dFbaSM+pZhVUF9a4B6f/gfIhpx2TMoEOWIOjbAFKWdOQOaoELrvxmHT FXaTyGJswVwqmSzdNd5kzmCJjJAuwhKuZ73f+QmThjAGGhHhAlFrWs8Ct9A+Rru6okTMFN 7kLgpyO8tO8vG+/uETTIBNBO7G068qcDIHvn26zIz3V24BVpyuPBBwtgVuxXJDVohpdRuk hAmzWUY0MH2sdLhFg+COA4dCL01ETPDVdDbeGLlYaGPTDFwB06vsFAuDDj1gLd0C6iHyPl MQUqNhVPBKP/N93QLTalALMmQ/5LmyxxHLjMnpe65oJEOgQ9FWUS3VjnfFvy9g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752391652; a=rsa-sha256; cv=none; b=j7PjMFss3oZci8Ht9xR3cQKZLoRMd6yU7RxxdZsIyLW7wMFvLUxvZpf+TfSjr0RtXeuj5y dRyhRsLTNlu6CsDgOWIC9omMWkU8MYogmszUcIkn0diuddU2OAaWolGZ3vbbeu7Lv1qMfO OR7PO1AF9E6kjrkQJE6rbZaQVLjizMVF5hZ6oxgsjwI+gZB1q1AVQFgyfJfuUzQkfdJJ/E wayZqIfJmU1kSNuHIDlGppg5sBgc/L5C3piLNAs7G6uMYVYG6exovz/jcl6GexIQJF1aMT B5krgUayP83vYi/VrvF/a+yE9+wGIjxs6Wcu1eWlzKdVcWgrkuoJfmVQIbbB6w== 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 4bfxqR69KXzygw; Sun, 13 Jul 2025 07:27:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56D7RVNW094666; Sun, 13 Jul 2025 07:27:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56D7RVUA094663; Sun, 13 Jul 2025 07:27:31 GMT (envelope-from git) Date: Sun, 13 Jul 2025 07:27:31 GMT Message-Id: <202507130727.56D7RVUA094663@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Certner Subject: git: 4ca9190251bb - main - LinuxKPI: alloc_pages(): Don't reclaim on __GFP_NORETRY 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4ca9190251bbd00c928a3cba54712c3ec25e9e26 Auto-Submitted: auto-generated The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=4ca9190251bbd00c928a3cba54712c3ec25e9e26 commit 4ca9190251bbd00c928a3cba54712c3ec25e9e26 Author: Olivier Certner AuthorDate: 2025-07-07 12:27:48 +0000 Commit: Olivier Certner CommitDate: 2025-07-13 06:41:19 +0000 LinuxKPI: alloc_pages(): Don't reclaim on __GFP_NORETRY Pass VM_ALLOC_NORECLAIM to vm_page_alloc_noobj_contig() so that it avoids reclaiming (currently, calling vm_reserv_reclaim_contig()). According to Linux's documentation, __GFP_NORETRY should not cause any "disruptive reclaim". alloc_pages() is called a lot from the amdgpu DRM driver via ttm_pool_alloc(), which tries to allocate pages of the highest order first and fallback to lower order pages (as allocating contiguous physical pages is in fact not a requirement). This process relies on failing fast, as requested by __GFP_NORETRY. See also related commit 718d1928f874 ("LinuxKPI: make linux_alloc_pages() honor __GFP_NORETRY"). Reviewed by: jeffpc_josefsipek.net, bz MFC after: 10 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D51246 --- sys/compat/linuxkpi/common/src/linux_page.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/compat/linuxkpi/common/src/linux_page.c b/sys/compat/linuxkpi/common/src/linux_page.c index ebb92eacbf9a..628af17df853 100644 --- a/sys/compat/linuxkpi/common/src/linux_page.c +++ b/sys/compat/linuxkpi/common/src/linux_page.c @@ -106,6 +106,7 @@ linux_alloc_pages(gfp_t flags, unsigned int order) if ((flags & M_ZERO) != 0) req |= VM_ALLOC_ZERO; + if (order == 0 && (flags & GFP_DMA32) == 0) { page = vm_page_alloc_noobj(req); if (page == NULL) @@ -113,6 +114,10 @@ linux_alloc_pages(gfp_t flags, unsigned int order) } else { vm_paddr_t pmax = (flags & GFP_DMA32) ? BUS_SPACE_MAXADDR_32BIT : BUS_SPACE_MAXADDR; + + if ((flags & __GFP_NORETRY) != 0) + req |= VM_ALLOC_NORECLAIM; + retry: page = vm_page_alloc_noobj_contig(req, npages, 0, pmax, PAGE_SIZE, 0, VM_MEMATTR_DEFAULT); From nobody Sun Jul 13 07:27:33 2025 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 4bfxqV58sKz61pZG; Sun, 13 Jul 2025 07:27:34 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bfxqV0xkyz3H0f; Sun, 13 Jul 2025 07:27:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752391654; 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=4hw6BJSO57fRJgYm0MnroWiwJcruQSlzvzQAZj7gYtU=; b=YOLV2A3+vzrRlBljRhQ9qCVasyzReFH/GhxoJoVFWUVoTGZXBwwHZ79Slk95BK4dCZx+Qd 0jkY/1k0kopmh+XaQXJtY5Hbye45mbY5moaVzzQniLbtbi9cSEM0nMLPAELz0JpEZyWLZe gtFgkQenTJwj+elg3yHXXmaL/JX7iZ/2PY07AvKITNoA9pKrJ7uJaiToMxAzFtFSmv62Mr TBVnehSA1OFrR3l1lVF+nYguauG/NboBW3JT1AIICawyTKkW2oo+it6UFZkEFt6X83/7Vb gIjzdgRUZtJ4K0fdcKqP3PLKmJXY4QirjAo+v7gPZoGPdE+pw9/+a3V+70eWbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752391654; 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=4hw6BJSO57fRJgYm0MnroWiwJcruQSlzvzQAZj7gYtU=; b=GdFHED1S76NS4ZAI6MaVo0jQjGUwseEYKt5XXwlUol8vGiLGw1A60ZcEdJGoXY1p6Tmtrq AlZbkv8SkRCahy5mY9N0GfyFl9/fhV885Xu0ONWcGshz3/NfjzSuWF5kmml4s3SI7jLU2i JSiz9FbzTwpfrpLWHEo92HWwUSVaYFwVq8INBgU3V4WD4Psix3CCh/sYXiRfDQ4jLuj+4v VnivqOAK1k2mWHoaLP5s7ISn+BnizvFpi0rMQygLuouVM2dIQEiJsjGy2dJA0HsNBmsWMv afK/YllZJt9y8Un+Zv7HCI2nv+KYUiPQPPLx6kLmAyT8gHqu9GhAoyVwLZzeLQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752391654; a=rsa-sha256; cv=none; b=NqeYzXy+/0Q81LwnZ0+ZuKzuSz2Jphpz29R2afNtRBP0JIR+PvnEHsqheSVgZaaxDaUZ2n /LDeMUSdIkNuKqDSDoUk0ORGNfZo8cT9OxHvAg3zG+/Hrx9ycq9nFQo5qBIe5Q6zLDOrlc yMcgdS97GxbX+pbp1zDwCCU2pAxceAf3v6u5OUBHELr6KqHX/UdQU05IsYTSuLOadkwCHJ dbPrFMcfHd341OV0sHXZnwUMsJ1Dupz+SoFu1Fq8N4lTuAPxhAFKc6LntuGnLwn+Wgh/e2 6CRqdYBSxhC9tyURs7CeAQ5viU+bosG91cXbhpdEgIIUhakpqK6ZEG5a5Ko39w== 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 4bfxqV0MPnz106V; Sun, 13 Jul 2025 07:27:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56D7RXH1094741; Sun, 13 Jul 2025 07:27:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56D7RX2q094738; Sun, 13 Jul 2025 07:27:33 GMT (envelope-from git) Date: Sun, 13 Jul 2025 07:27:33 GMT Message-Id: <202507130727.56D7RX2q094738@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Certner Subject: git: 9d1f3ce79d85 - main - pmap: Degrade pmap_page_set_attr*() into a no-op on same attribute 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9d1f3ce79d85855399663e3977766ec46f28cadd Auto-Submitted: auto-generated The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=9d1f3ce79d85855399663e3977766ec46f28cadd commit 9d1f3ce79d85855399663e3977766ec46f28cadd Author: Olivier Certner AuthorDate: 2025-07-08 16:17:30 +0000 Commit: Olivier Certner CommitDate: 2025-07-13 07:13:25 +0000 pmap: Degrade pmap_page_set_attr*() into a no-op on same attribute For 32-bit arm, move the no-op test that was already in place at start of the function so that it stays first even if the '#if 0' block around the call to sf_buf_invalidate_cache() is uncommented at some point (if ever). Reviewed by: jeffpc_josefsipek.net, kib MFC after: 10 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D51253 --- sys/amd64/amd64/pmap.c | 5 +++++ sys/arm/arm/pmap-v6.c | 32 +++++++++++++++----------------- sys/arm64/arm64/pmap.c | 2 ++ sys/i386/i386/pmap.c | 2 ++ sys/powerpc/aim/mmu_oea.c | 3 +++ sys/powerpc/aim/mmu_oea64.c | 3 +++ sys/powerpc/aim/mmu_radix.c | 4 ++++ sys/riscv/riscv/pmap.c | 2 ++ 8 files changed, 36 insertions(+), 17 deletions(-) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 9c985df13ddf..fd02d1ad6690 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -9649,6 +9649,8 @@ pmap_demote_pdpe(pmap_t pmap, pdp_entry_t *pdpe, vm_offset_t va, vm_page_t m) void pmap_page_set_memattr(vm_page_t m, vm_memattr_t ma) { + if (m->md.pat_mode == ma) + return; m->md.pat_mode = ma; @@ -9668,6 +9670,9 @@ pmap_page_set_memattr_noflush(vm_page_t m, vm_memattr_t ma) { int error; + if (m->md.pat_mode == ma) + return; + m->md.pat_mode = ma; if ((m->flags & PG_FICTITIOUS) != 0) diff --git a/sys/arm/arm/pmap-v6.c b/sys/arm/arm/pmap-v6.c index 92eb0589f80b..78883296c5b7 100644 --- a/sys/arm/arm/pmap-v6.c +++ b/sys/arm/arm/pmap-v6.c @@ -5767,7 +5767,7 @@ pmap_page_set_memattr(vm_page_t m, vm_memattr_t ma) CTR5(KTR_PMAP, "%s: page %p - 0x%08X oma: %d, ma: %d", __func__, m, VM_PAGE_TO_PHYS(m), oma, ma); - if ((m->flags & PG_FICTITIOUS) != 0) + if (ma == oma || (m->flags & PG_FICTITIOUS) != 0) return; #if 0 /* @@ -5784,22 +5784,20 @@ pmap_page_set_memattr(vm_page_t m, vm_memattr_t ma) * If page is not mapped by sf buffer, map the page * transient and do invalidation. */ - if (ma != oma) { - pa = VM_PAGE_TO_PHYS(m); - sched_pin(); - pc = get_pcpu(); - cmap2_pte2p = pc->pc_cmap2_pte2p; - mtx_lock(&pc->pc_cmap_lock); - if (pte2_load(cmap2_pte2p) != 0) - panic("%s: CMAP2 busy", __func__); - pte2_store(cmap2_pte2p, PTE2_KERN_NG(pa, PTE2_AP_KRW, - vm_memattr_to_pte2(ma))); - dcache_wbinv_poc((vm_offset_t)pc->pc_cmap2_addr, pa, PAGE_SIZE); - pte2_clear(cmap2_pte2p); - tlb_flush((vm_offset_t)pc->pc_cmap2_addr); - sched_unpin(); - mtx_unlock(&pc->pc_cmap_lock); - } + pa = VM_PAGE_TO_PHYS(m); + sched_pin(); + pc = get_pcpu(); + cmap2_pte2p = pc->pc_cmap2_pte2p; + mtx_lock(&pc->pc_cmap_lock); + if (pte2_load(cmap2_pte2p) != 0) + panic("%s: CMAP2 busy", __func__); + pte2_store(cmap2_pte2p, PTE2_KERN_NG(pa, PTE2_AP_KRW, + vm_memattr_to_pte2(ma))); + dcache_wbinv_poc((vm_offset_t)pc->pc_cmap2_addr, pa, PAGE_SIZE); + pte2_clear(cmap2_pte2p); + tlb_flush((vm_offset_t)pc->pc_cmap2_addr); + sched_unpin(); + mtx_unlock(&pc->pc_cmap_lock); } /* diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c index d2e56a270f54..dbd1ed7b316b 100644 --- a/sys/arm64/arm64/pmap.c +++ b/sys/arm64/arm64/pmap.c @@ -8045,6 +8045,8 @@ pmap_unmapbios(void *p, vm_size_t size) void pmap_page_set_memattr(vm_page_t m, vm_memattr_t ma) { + if (m->md.pv_memattr == ma) + return; m->md.pv_memattr = ma; diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c index 465b4d0f365b..5065b7e61ee8 100644 --- a/sys/i386/i386/pmap.c +++ b/sys/i386/i386/pmap.c @@ -5617,6 +5617,8 @@ __CONCAT(PMTYPE, unmapdev)(void *p, vm_size_t size) static void __CONCAT(PMTYPE, page_set_memattr)(vm_page_t m, vm_memattr_t ma) { + if (m->md.pat_mode == ma) + return; m->md.pat_mode = ma; if ((m->flags & PG_FICTITIOUS) != 0) diff --git a/sys/powerpc/aim/mmu_oea.c b/sys/powerpc/aim/mmu_oea.c index 7746b668265d..ae17b3289593 100644 --- a/sys/powerpc/aim/mmu_oea.c +++ b/sys/powerpc/aim/mmu_oea.c @@ -1469,6 +1469,9 @@ moea_page_set_memattr(vm_page_t m, vm_memattr_t ma) pmap_t pmap; u_int lo; + if (m->md.mdpg_cache_attrs == ma) + return; + if ((m->oflags & VPO_UNMANAGED) != 0) { m->md.mdpg_cache_attrs = ma; return; diff --git a/sys/powerpc/aim/mmu_oea64.c b/sys/powerpc/aim/mmu_oea64.c index 79cea408bb5f..796b1719b8ba 100644 --- a/sys/powerpc/aim/mmu_oea64.c +++ b/sys/powerpc/aim/mmu_oea64.c @@ -2134,6 +2134,9 @@ moea64_page_set_memattr(vm_page_t m, vm_memattr_t ma) CTR3(KTR_PMAP, "%s: pa=%#jx, ma=%#x", __func__, (uintmax_t)VM_PAGE_TO_PHYS(m), ma); + if (m->md.mdpg_cache_attrs == ma) + return; + if ((m->oflags & VPO_UNMANAGED) != 0) { m->md.mdpg_cache_attrs = ma; return; diff --git a/sys/powerpc/aim/mmu_radix.c b/sys/powerpc/aim/mmu_radix.c index 45f7bef8bcc9..a12142fc2d7b 100644 --- a/sys/powerpc/aim/mmu_radix.c +++ b/sys/powerpc/aim/mmu_radix.c @@ -5937,6 +5937,10 @@ mmu_radix_page_set_memattr(vm_page_t m, vm_memattr_t ma) { CTR3(KTR_PMAP, "%s(%p, %#x)", __func__, m, ma); + + if (m->md.mdpg_cache_attrs == ma) + return; + m->md.mdpg_cache_attrs = ma; /* diff --git a/sys/riscv/riscv/pmap.c b/sys/riscv/riscv/pmap.c index 5d15bd671285..26efaecc64d1 100644 --- a/sys/riscv/riscv/pmap.c +++ b/sys/riscv/riscv/pmap.c @@ -4838,6 +4838,8 @@ pmap_unmapbios(void *p, vm_size_t size) void pmap_page_set_memattr(vm_page_t m, vm_memattr_t ma) { + if (m->md.pv_memattr == ma) + return; m->md.pv_memattr = ma; From nobody Sun Jul 13 07:27:35 2025 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 4bfxqX1bssz61pr2; Sun, 13 Jul 2025 07:27:36 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bfxqW1Z7Vz3GmB; Sun, 13 Jul 2025 07:27:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752391655; 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=x/6CO646iY94Me9r6XY+ahLjG67OE0F0Wv4jw5EbZ2o=; b=A3giQdLl3DPTSB+9kjmdzV49HEU1WgJtR09Pc07TBDTvcUgBR67QFTRSM7F2/A4SgZdk4y DlLZz4CJA9eU3wYJNBCTAE0QqLD07fjn2EYwDgsJ1Zx4380iKYg2plFHtmwdgV3R70nIix lObdOOhEqxhRNdxOQHDVaBto4E/il6IfEr8EW8Btiqkz2wM+3WzJoFqYxO8RSuiTF+XM2W JRy8PXIC4BpO8NlgMpA709ZEo8BYuXZbGJFteZoWiG9/UtRCWKkukz1ROZnBeapcxnkfrF V7kT7Chm8KZvBAoZJJyX3N06qaeP0RJ1Rlg1K4haZQgSVgVrJqJWHvPrC7kXPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752391655; 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=x/6CO646iY94Me9r6XY+ahLjG67OE0F0Wv4jw5EbZ2o=; b=LFOf0/ZzWmBgXSBjhUt+m5kSotLm8pzMTuz8LsM+4VcnyXwcHHi7WtV0RZEYyNFhpr2XsB cmarvOR3r3Bww0DUuiichuc4SI4wy1o0djEt1iUX45J88wFmarjbkNBlJ4pUbSzZJu+1jn +2Wr5afirBUsI1nQOw0zdkyth7nSDegw3YQq+J/hBN8AjPY64zUWCw2wrCGz9fsgVDh8H5 tjo3+jWPzETa+Ly0qAsEQ3k8kbtYOR8iNQ+zNSXDjM4aLD5D+1LwcRqAKAtWKpGYsoRYL0 18W6bzc1Y35wshykQwJ+LCBeRC5axT3aOinsppQF1+uNoS2cZ3hT4Zq8UBa+5Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752391655; a=rsa-sha256; cv=none; b=lnCi5EjDo4O0zQLADxSg+xky++lhZCABekaE0ACpIm61O0nbtVedEp7iHxl4Paev6jRtww ybS7c06pnDerMXk7iY17lUcsm708dxXJO4EXkP+/nR5sZzOBfoy2C7zFKkvqZ4p7F7YIGj h/PPubJ2qsq20gB+MG826BOByIOaDKd+oAgcvj8JiFjiegLhdiq3N3oE9jkLYE/mGxQhw0 UntVeziU9yYDwiDd2d0K5TwkD/UlWUSw+Y2NIb4NCbgPGfr04e+a5R/Wtfz3/yWsNL6zLK H/xbIWLMiK4UiXL8tFT+36YrVszJ0ZrSxLWGWKftYwxRaj+wD9x/bShHQOWeLw== 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 4bfxqW0wjrz1078; Sun, 13 Jul 2025 07:27:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56D7RZ9J094781; Sun, 13 Jul 2025 07:27:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56D7RZuf094776; Sun, 13 Jul 2025 07:27:35 GMT (envelope-from git) Date: Sun, 13 Jul 2025 07:27:35 GMT Message-Id: <202507130727.56D7RZuf094776@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Certner Subject: git: 1e78a6a6d857 - main - vm_domainset: Print correct function in KASSERT()/panic() 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1e78a6a6d85702b84f679712aac71f91e481e8f9 Auto-Submitted: auto-generated The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=1e78a6a6d85702b84f679712aac71f91e481e8f9 commit 1e78a6a6d85702b84f679712aac71f91e481e8f9 Author: Olivier Certner AuthorDate: 2025-07-07 14:14:16 +0000 Commit: Olivier Certner CommitDate: 2025-07-13 07:15:22 +0000 vm_domainset: Print correct function in KASSERT()/panic() Some messages in vm_domainset_iter_next() would wrongly refer to vm_domainset_iter_first(). While here, ensure that all assertion/panic messages use '__func__' to avoid this discrepancy in the future if code is moved/copy-pasted again. Reviewed by: markj, alc, kib MFC after: 10 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D51248 --- sys/vm/vm_domainset.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/sys/vm/vm_domainset.c b/sys/vm/vm_domainset.c index 7b8bf4c77663..b44bdb96b0d4 100644 --- a/sys/vm/vm_domainset.c +++ b/sys/vm/vm_domainset.c @@ -131,8 +131,7 @@ static void vm_domainset_iter_next(struct vm_domainset_iter *di, int *domain) { - KASSERT(di->di_n > 0, - ("vm_domainset_iter_first: Invalid n %d", di->di_n)); + KASSERT(di->di_n > 0, ("%s: Invalid n %d", __func__, di->di_n)); switch (di->di_policy) { case DOMAINSET_POLICY_FIRSTTOUCH: /* @@ -149,11 +148,10 @@ vm_domainset_iter_next(struct vm_domainset_iter *di, int *domain) vm_domainset_iter_prefer(di, domain); break; default: - panic("vm_domainset_iter_first: Unknown policy %d", - di->di_policy); + panic("%s: Unknown policy %d", __func__, di->di_policy); } KASSERT(*domain < vm_ndomains, - ("vm_domainset_iter_next: Invalid domain %d", *domain)); + ("%s: Invalid domain %d", __func__, *domain)); } static void @@ -189,13 +187,11 @@ vm_domainset_iter_first(struct vm_domainset_iter *di, int *domain) di->di_n = di->di_domain->ds_cnt; break; default: - panic("vm_domainset_iter_first: Unknown policy %d", - di->di_policy); + panic("%s: Unknown policy %d", __func__, di->di_policy); } - KASSERT(di->di_n > 0, - ("vm_domainset_iter_first: Invalid n %d", di->di_n)); + KASSERT(di->di_n > 0, ("%s: Invalid n %d", __func__, di->di_n)); KASSERT(*domain < vm_ndomains, - ("vm_domainset_iter_first: Invalid domain %d", *domain)); + ("%s: Invalid domain %d", __func__, *domain)); } void From nobody Sun Jul 13 08:08:21 2025 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 4bfykY6F9hz61rRm; Sun, 13 Jul 2025 08:08:21 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bfykY3LCkz3cYY; Sun, 13 Jul 2025 08:08:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752394101; 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=EBRmur2ed9l9uQNHvu3A8AiFDGUY0p9ULpp8pHKRxj0=; b=yUoLM02e+eylnxH9xhQY7n/7ec/X3XcMojbDFvirPnKQMhSDM3cMnOcrmJ3AzdVHtWNran rVGEroydmyu6GQD+2Jz6/8jPedeJj7QGubUpWSRlseJkSSNYb/gm+4stbv/4dK9fR71kND cA90y5gbsa0ov9qzTocgAbjN8wS0+KL09fLkNec3rdCIQ7EmVo9YwvcRbFMC15yAgeu25+ CmQmZM2jPV5drEh8CF35dlp+N97XDhz6igk3LQbGr4K7GjWnN8wxDXOgpfGazbq+NeoJAW U4cDIkLxwPB6sOs0JzBql4lRFYvJPTv52T4lUugwdgCIcc65khanfgPFu3c8qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752394101; 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=EBRmur2ed9l9uQNHvu3A8AiFDGUY0p9ULpp8pHKRxj0=; b=lu4z8DBIiB8WBLUog+dgtPOEIxgnn9sRodFt5XQqhrO82fJ+TuZ1zLvJmBBP/IpwTFm8ub p7V7oCijyAx0CEmeQXb3o6CYkdgzVgi6olWgLCgzzm2+uBBztpjYqMReGRiMrccM82FyHX vjKtI2twdipams2NVyZHYbJtlQ1D4xWXjftn8P4qZiuBovyP1yWbLjMnec4U/BAPf6iSib BfGtHYUWlq5F6xIWEFZLZdobF6YlT/OuejzgcOp1TOK4NOAt9O5ZYNv65S9zM4H+MhgYiL CPxuojHuQX706E64KXvi1dMcNrND+8//EXju8PFH0lvyQsTti0CQ0ejCtWX/GA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752394101; a=rsa-sha256; cv=none; b=OSqeE97/S8vcBknYTrc+VUIxU2WADsyTNYiNhcM2W+qj37CTBobS+FgEqwh3Dlpu1by2WV t2KBa2rpd9bTopr1KfHASyFeK9+q/uI3S09gFJmMKY6KjHFmsnIn0RPMyLZcXmCN69fgIz Fy23hXhOI+LgmHEXcLCORhFS89im+iXhxq+QJl4kKAkKiooaHtuBlR2LK9JaStHX3tBylH VUGt8SFnmSa4W7Ddi0PlvS4XCau2mwy9s7HqksZpAGijlk7spuSzlA9uiIsi5mYVOwh5qm BAKyfnmCqZNXy1HjDYco4g2L5VAUJ2q8vvGAMh160vD3eO0f5a9DoFxJ+tWcMw== 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 4bfykY2lJ0z10vg; Sun, 13 Jul 2025 08:08:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56D88LMp070847; Sun, 13 Jul 2025 08:08:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56D88LF0070844; Sun, 13 Jul 2025 08:08:21 GMT (envelope-from git) Date: Sun, 13 Jul 2025 08:08:21 GMT Message-Id: <202507130808.56D88LF0070844@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dave Cottlehuber Subject: git: 76856ead444d - main - netstat.1: Add common example to list listening sockets 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dch X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 76856ead444ddcbc548308a2b900bb5ae10e8228 Auto-Submitted: auto-generated The branch main has been updated by dch: URL: https://cgit.FreeBSD.org/src/commit/?id=76856ead444ddcbc548308a2b900bb5ae10e8228 commit 76856ead444ddcbc548308a2b900bb5ae10e8228 Author: Lukas Engelhardt AuthorDate: 2025-07-13 08:07:00 +0000 Commit: Dave Cottlehuber CommitDate: 2025-07-13 08:07:00 +0000 netstat.1: Add common example to list listening sockets While here, wrap to 80 characters. Approved by: ziaee Differential Revision: https://reviews.freebsd.org/D51280 --- usr.bin/netstat/netstat.1 | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/usr.bin/netstat/netstat.1 b/usr.bin/netstat/netstat.1 index 1a2c786e90aa..cf6a907c6aa4 100644 --- a/usr.bin/netstat/netstat.1 +++ b/usr.bin/netstat/netstat.1 @@ -416,7 +416,8 @@ When used with or .Fl 6 , limit the output to IPv4 or IPv6 routes respectively. -This option provides details about individual nexthop addresses used in routing decisions. +This option provides details about individual nexthop addresses +used in routing decisions. .It Xo .Bk -words .Nm netstat @@ -430,7 +431,8 @@ When used with or .Fl 6 , restrict the output to IPv4 or IPv6 nexthop groups respectively. -This option shows grouped nexthop entries for multipath or load-balanced routing setups. +This option shows grouped nexthop entries for multipath or +load-balanced routing setups. .It Xo .Bk -words .Nm @@ -926,25 +928,25 @@ binary is not available in the .Sh EXAMPLES Show packet traffic information (packets, bytes, errors, packet drops, etc) for interface re0 updated every 2 seconds and exit after 5 outputs: -.Bd -literal -offset indent -$ netstat -w 2 -q 5 -I re0 -.Ed +.Pp +.Dl netstat -w 2 -q 5 -I re0 .Pp Show statistics for ICMP on any interface: -.Bd -literal -offset indent -$ netstat -s -p icmp -.Ed +.Pp +.Dl netstat -s -p icmp .Pp Show routing tables: -.Bd -literal -offset indent -$ netstat -r -.Ed +.Pp +.Dl netstat -r .Pp Same as above, but without resolving numeric addresses and port numbers to names: -.Bd -literal -offset indent -$ netstat -rn -.Ed +.Pp +.Dl netstat -rn +.Pp +Show IPv4 listening sockets: +.Pp +.Dl netstat -4l .Sh SEE ALSO .Xr fstat 1 , .Xr nfsstat 1 , From nobody Sun Jul 13 08:33:14 2025 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 4bfzHG61byz61sQp for ; Sun, 13 Jul 2025 08:33:14 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bfzHG52Rpz3lVN; Sun, 13 Jul 2025 08:33:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752395594; 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=oWKL20z12wLPbd7LgbXwKpLPafCt1NBuVQ/wS3tANl8=; b=NJA169eE/GHbuM14Em98szgQU+R3eNp/8Uvqk8dGyziGOUfHe2HKukaI5BXu9fNo/scFLg 43CK/OnVKHMc8/1q3hZueX+JZ3ppWlTUt98gg8Xh3PFsA6/h59jt1MoiZBSVWxljnf95a8 nxGoEXIcKnDxWAGOJ7+1xrbDoZohoMyXCCoS8X47FnEw6bzzSjHdgJy1gCK0xt+Wg9zJ4R QbNHoPp/e+KNt4wW9sPtn8coGxtK9TacAQWRXMM8ciBJQ4tmlkSRDcVpJJNADJWq8TpGVH Q9K3oMzHNzPpnMVk6KGyFGia3MnPHSCMXsszQ/Ztl5WxI3Y7UJ66wCXtgALqaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752395594; 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=oWKL20z12wLPbd7LgbXwKpLPafCt1NBuVQ/wS3tANl8=; b=Fw7GrwT2pxGsR/JzTKJvR0NuADrGVmUpL90SWoaS72NOMTsEf6kFcfm4WDnUox2LajHH/S mvWToYwV8Vug/e78Fd9OAePJRWEHKWPfO8aaSJSQJVf3zLpnG8HpPncwIyJwUuUOwNjDMa pLy/tOAfXc1aYQApL+Lg6Qdzsgnh7bcOvD00CrXmPuR/kMBjZEQaF9Ul6mxh4QS/o29zhU CQfMNZOPxF1s28mO9rEDPr56PRRMXTHwwhQB8F/L8gL1qjiqMrcZ7OCN91ikpPVQRfraWb GWXoBxdx8XGZIRA7XVzODs63CleKMPjhu5RLoOugmD6C9rrGtHBsrXhTnEqOig== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752395594; a=rsa-sha256; cv=none; b=yv6rHhJnnFUnMS3vsHoufEl3QjZ+DUHRHvnbjbsSGWHL0Pf0G8NV0WLPDZan5flAXSPfIT GdKkGDDu8FSyz2qGiRvNVUd7WxzoCirpta2wpcnS1jukCUJ4lKK/QQHapsD3dxsW7JKxRv 1d4Y3jzdLPFaXCVnzpENRU7GDmE1wWXTuT5OgynZ+U3KLzaJVOatsFdvjnE9wbfkVUKqzg kuw3MPV9F8mPOSfKaTXFK+8SCDseiyWSp4hOnSLQyShpykH2GgBpDQLpG8miiQhE78NN8K iN1c7c1pf3XLJy51jU+ge0ubn9bGdXXD4V8d73y/8SEfMakLx8VZGDMsFBg4zg== 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 4bfzHG4TL5z11tQ; Sun, 13 Jul 2025 08:33:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56D8XEDS025966; Sun, 13 Jul 2025 08:33:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56D8XEAG025963; Sun, 13 Jul 2025 08:33:14 GMT (envelope-from git) Date: Sun, 13 Jul 2025 08:33:14 GMT Message-Id: <202507130833.56D8XEAG025963@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Kristof Provost Subject: git: aa13f2209fbd - internal/admin - Release Kajetan Staszkiewicz from mentorship 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/internal/admin X-Git-Reftype: branch X-Git-Commit: aa13f2209fbd715d0f2e338ee4b73a1f79ef9c0b Auto-Submitted: auto-generated The branch internal/admin has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=aa13f2209fbd715d0f2e338ee4b73a1f79ef9c0b commit aa13f2209fbd715d0f2e338ee4b73a1f79ef9c0b Author: Kristof Provost AuthorDate: 2025-07-13 08:32:13 +0000 Commit: Kristof Provost CommitDate: 2025-07-13 08:32:13 +0000 Release Kajetan Staszkiewicz from mentorship Approved by: srcmgr (implicit) --- mentors | 1 - 1 file changed, 1 deletion(-) diff --git a/mentors b/mentors index 768abcd2e96f..9dd63800810d 100644 --- a/mentors +++ b/mentors @@ -18,7 +18,6 @@ ivy kevans Co-mentor: des jlduran emaste kgalazka erj Co-mentor: kbowling khorben philip -ks kp oh manu osamaabb cperciva Co-mentor: akiyano ram ken Co-mentor: mav From nobody Sun Jul 13 09:37:39 2025 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 4bg0jc1ZqSz61wXK; Sun, 13 Jul 2025 09:37:40 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bg0jc0zWZz3HsW; Sun, 13 Jul 2025 09:37:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752399460; 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=lBNvpJrCewcV0+ugQkNb/PbT6r/89Wxc/zBo+jfw8bg=; b=x7mxK0h/EOw8J7yeJ3Pi6JmH/oa0mDU4KWZcfSzNdB7h64a9EkcpxQp5WSmAveEu6e+t0W MXNFoSnDur0BEtaM1RNUvy3QdTuv3NFL9Me6Okx/2RFksfJ3xwHjnJ7L7S1Subg1UTUrjJ VX0sAwxN81RZAAIIUaJTotmmWuY3xbiP1EeB8QQ74zZ+7G2TkVNSEK18a+/ODt5Ueu53YV p+qnz1omURU91e8kCE0CSPxK1z+CJLOy4tAR4aTPuwnfrYa2Vl45kzKrlQmt8bo5GFQEYY 1AG2+/xQMwGI6IEBPLf2S3TgessYuLe3bxkGPxP8gC37TUNvOcl6xhJb74FSnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752399460; 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=lBNvpJrCewcV0+ugQkNb/PbT6r/89Wxc/zBo+jfw8bg=; b=EzAM3USEVtHkSMN5ohpSZjVwD7VoYz8LfHo5HYEDXXs4gWgSE4Qzr0maagmiJSTEIXhCjn eo1TzVw0CEg12xeilKtT6plwAjpQ/V/7D2GdnM8iC5nlPVn/WZHjlNcXel9XbQ0aYbnode PWUZTIw/YY5WRSgzc7zs86/aLpBvemobx9ZFBXSsBwWBavW2mVSV+EwLB6YBd1zdiIrgvh fWHTgX54bJkDHBMuLOomOCoky0dQwBynQkRxduIpZ6+Ggz0pCRtZVB+JDLUGjv0z2IBWaB oWLe4N+OTkPxcj5xu5h+34PkKG1OfZR+dNC0sWvRZMpmZKkBcbzyvEYVmH7NjQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752399460; a=rsa-sha256; cv=none; b=j/kHulKlGW/UGZovh2W4CDARM0gS8lKgVnjcPHFME603ZwoAlaHGtvLidI6b3zBKmMHEn0 8LaUMNzkC+l9VYk2pmArEXk6d771rczPa3FQStUDKswPChs5heHsuab+mDb/0JVunqp02O r9sP7pyosBNdtF9EBMgJw22JbaMAyzv8veAoqIMb4jZ/NNQzekIe4atS7jQZ5K9t5S3ZCf mX1E+gk2qJqx8E2Ql8xLiteQ+JJVTF1/p3wtOZ6rfSKJH/nf/3qxQhapg4G5fCtmbYpXXt 2FN2zCBjCMWhoSnesj8vS7ELHIYZU1YPiNjpdSM/lzgvMXuq4Bu08jvuuHvPNw== 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 4bg0jc0Rq9z13DV; Sun, 13 Jul 2025 09:37:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56D9bewp040115; Sun, 13 Jul 2025 09:37:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56D9bdsv040112; Sun, 13 Jul 2025 09:37:39 GMT (envelope-from git) Date: Sun, 13 Jul 2025 09:37:39 GMT Message-Id: <202507130937.56D9bdsv040112@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Lars Engels Subject: git: 5031da20599b - main - bluetooth-config: Fix command line parsing 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: lme X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5031da20599bb1163f0e8d1c4b415ab3bbebce00 Auto-Submitted: auto-generated The branch main has been updated by lme: URL: https://cgit.FreeBSD.org/src/commit/?id=5031da20599bb1163f0e8d1c4b415ab3bbebce00 commit 5031da20599bb1163f0e8d1c4b415ab3bbebce00 Author: Dirk Engling AuthorDate: 2025-07-13 09:25:24 +0000 Commit: Lars Engels CommitDate: 2025-07-13 09:25:24 +0000 bluetooth-config: Fix command line parsing This addresses the problems encountered when parsing options in bluetooth-config. - the optional parameters were not properly shifted after consumption - the command line parameter count was checked before getopts and not after Reported by: sjg Approved by: kp MFC after: 7 days Event: Berlin Hackathon 202507 Differential Revision: --- usr.sbin/bluetooth/bluetooth-config/bluetooth-config.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/usr.sbin/bluetooth/bluetooth-config/bluetooth-config.sh b/usr.sbin/bluetooth/bluetooth-config/bluetooth-config.sh index 48a399a82fc7..148325fcecbc 100755 --- a/usr.sbin/bluetooth/bluetooth-config/bluetooth-config.sh +++ b/usr.sbin/bluetooth/bluetooth-config/bluetooth-config.sh @@ -17,7 +17,7 @@ main() { unset node device started bdaddresses retry # Only one command at the moment is scan (+ add) -[ "$#" -eq 1 -a "$1" = "scan" ] || print_syntax +[ "$1" = "scan" ] || print_syntax shift # Get command line options @@ -28,6 +28,12 @@ while getopts :d:n: arg; do ?) print_syntax;; esac done +shift "$((OPTIND-1))" + +# If there's leftover parameters, print usage +[ "$#" -eq 0 ] || print_syntax +shift + # No use running without super user rights if [ $( id -u ) -ne 0 ]; then From nobody Sun Jul 13 11:45:04 2025 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 4bg3Xc4Tktz60qGr; Sun, 13 Jul 2025 11:45:04 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bg3Xc3j0Rz3TC5; Sun, 13 Jul 2025 11:45:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752407104; 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=cjza6yskqe+gYmnhgQgtiXwOedUAo55HH3UwAOVNndU=; b=ceR+NFkIRBVgsxObu0XrSVwhpmXVxcIcRpIFKs2AhPJdxujmMr7WAuvGQsOaGgcfprQazR zfEND4CuhrpnTDMlwEzbaIry5dqEM+2w6BPjHmxRnXNohyHd8auNkmNnOPFfbG7XJ6AOS7 4BdhV2IG2KcviM+Ft++9xC5rpdN21ttsKV7R/mBiK1w4WuzfCMY6xbFH41nkcy7jW12lTQ k5k9FV9Ziq8nwQzBk3LgyE7Pj+UKezZ3QJgwEtpQhKdHq34sLNTdd9j+I+MwnItAzy0jzU n/sbaXtlqpYLQbQYWTDavcxk0lRUHdwGG9R8QwpnmSGeLkzxN9uIN36ESRWGYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752407104; 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=cjza6yskqe+gYmnhgQgtiXwOedUAo55HH3UwAOVNndU=; b=e8l4vod/oEuOGWbpcuFOuxd3FdEtPkrQgDmDfw1oPj59o8HuLX3gqnFzAluaRNuVtNajs5 Km8HWyaXJH82TLxSeQhWMRnnscQ4I5DTSBimqaEi+WvkO+bDHnZe4l99+Y+ROZz45e0+e1 gQvgHbY96ElXyp3BnZsgXrHK/zGaBCHWGqlDyMnfaLsGwhmA6kvJ5XvDLjLfo1Et8FNzLF 5Z+jcrmRcc5OoulZPe1ks8ea6uVLyi5JClFNRlSQDsnh73nhpxxKUimiG+JlJGURe2wBiC 9oNwY64HLR2okftMgt5ZIQaQxVgc8y4/y0duZ/IlD+/Qr/BCB46q6NOMU6A7fQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752407104; a=rsa-sha256; cv=none; b=yuVqJfciwJaACJoTp3//itEweLguc32omV3jgXO3LyqseMWlmNUs5dmvL5UUiFt2ZZMIz/ K2z51ofli40HSIwk6HZSkg1TdYifRt1+PRTeNVVaIjZ9LsEJBLDf0hDyhOw3qGq8yzKG7e XWK/alWYWNsfNmoBW2aZExaH2yJ3fs4WJjRw/O+S7T1vW+d92xgq98msxIQ9fabUvSjDHV 32Yaws0IK7ktLMbwweRwrqMj05OrQXSY/XCx6O2kGtcRjbWB5tqUAqE32+R+mG9oXwsuD8 jvJzu13TXmemqaU/bTeFeHJ9/TQL9BMuz+PflCBLazmilvAXPjbh2FwwqrlOyQ== 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 4bg3Xc3HmPz16NW; Sun, 13 Jul 2025 11:45:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56DBj4mH084177; Sun, 13 Jul 2025 11:45:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56DBj4a0084174; Sun, 13 Jul 2025 11:45:04 GMT (envelope-from git) Date: Sun, 13 Jul 2025 11:45:04 GMT Message-Id: <202507131145.56DBj4a0084174@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ronald Klop Subject: git: 9d80d681ee9d - stable/14 - swapon: parse md.eli device for encrypted swapfile from fstab 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ronald X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9d80d681ee9ddfb7a403924c877eac26d12e9077 Auto-Submitted: auto-generated The branch stable/14 has been updated by ronald: URL: https://cgit.FreeBSD.org/src/commit/?id=9d80d681ee9ddfb7a403924c877eac26d12e9077 commit 9d80d681ee9ddfb7a403924c877eac26d12e9077 Author: Ronald Klop AuthorDate: 2025-02-06 21:50:46 +0000 Commit: Ronald Klop CommitDate: 2025-07-13 11:44:35 +0000 swapon: parse md.eli device for encrypted swapfile from fstab Summary: Although fstab(5) suggests usage of md(4) and an .eli suffix in the same paragraph, the combination did not work. This patch adds a bit of parsing, creates the md device and then passes that device to the *_geli function. Add unit tests. PR: 186252 Approved by: delphij MFC after: 2 weeks Relnotes: yes Differential Revision: https://reviews.freebsd.org/D48874 (cherry picked from commit 1ee33e3a578c35ff0e8ef5db87a8005f1f99546a) --- etc/mtree/BSD.tests.dist | 2 + sbin/swapon/Makefile | 5 ++ sbin/swapon/swapon.c | 50 ++++++++--- sbin/swapon/tests/Makefile | 5 ++ sbin/swapon/tests/swapon_test.sh | 181 +++++++++++++++++++++++++++++++++++++++ 5 files changed, 233 insertions(+), 10 deletions(-) diff --git a/etc/mtree/BSD.tests.dist b/etc/mtree/BSD.tests.dist index 4e014025f623..f29fad1395f8 100644 --- a/etc/mtree/BSD.tests.dist +++ b/etc/mtree/BSD.tests.dist @@ -481,6 +481,8 @@ .. savecore .. + swapon + .. sysctl .. .. diff --git a/sbin/swapon/Makefile b/sbin/swapon/Makefile index 4cca18367c1e..7696fc51b463 100644 --- a/sbin/swapon/Makefile +++ b/sbin/swapon/Makefile @@ -10,4 +10,9 @@ MLINKS+=swapon.8 swapctl.8 LIBADD= util +.include + +HAS_TESTS= +SUBDIR.${MK_TESTS}+= tests + .include diff --git a/sbin/swapon/swapon.c b/sbin/swapon/swapon.c index b9b865c0fc09..f7ec26decb1d 100644 --- a/sbin/swapon/swapon.c +++ b/sbin/swapon/swapon.c @@ -66,6 +66,8 @@ static char sccsid[] = "@(#)swapon.c 8.1 (Berkeley) 6/5/93"; #include #include +#define DOT_ELI ".eli" + static void usage(void) __dead2; static const char *swap_on_off(const char *, int, char *); static const char *swap_on_off_gbde(const char *, int); @@ -243,8 +245,11 @@ swap_on_off(const char *name, int doingall, char *mntops) (fnmatch(_PATH_DEV MD_NAME "[0-9]*", name, 0) == 0 || fnmatch(MD_NAME "[0-9]*", name, 0) == 0 || strncmp(_PATH_DEV MD_NAME, name, - sizeof(_PATH_DEV) + sizeof(MD_NAME)) == 0 || - strncmp(MD_NAME, name, sizeof(MD_NAME)) == 0)) + sizeof(_PATH_DEV MD_NAME)) == 0 || + strncmp(MD_NAME, name, sizeof(MD_NAME)) == 0 || + strncmp(_PATH_DEV MD_NAME DOT_ELI, name, + sizeof(_PATH_DEV MD_NAME DOT_ELI)) == 0 || + strncmp(MD_NAME DOT_ELI, name, sizeof(MD_NAME DOT_ELI)) == 0)) return (swap_on_off_md(name, mntops, doingall)); basebuf = strdup(name); @@ -257,7 +262,7 @@ swap_on_off(const char *name, int doingall, char *mntops) } /* Swap on encrypted device by GEOM_ELI. */ - if (fnmatch("*.eli", base, 0) == 0) { + if (fnmatch("*" DOT_ELI, base, 0) == 0) { free(basebuf); return (swap_on_off_geli(name, mntops, doingall)); } @@ -399,6 +404,8 @@ swap_on_geli_args(const char *mntops) return (NULL); } Tflag = " -T "; + } else if ((p = strstr(token, "file=")) == token) { + /* ignore known option */ } else if (strcmp(token, "late") == 0) { /* ignore known option */ } else if (strcmp(token, "noauto") == 0) { @@ -488,24 +495,38 @@ swap_on_off_md(const char *name, char *mntops, int doingall) char *p, *vnodefile; size_t linelen; u_long ul; + const char *suffix; + char *devbuf, *dname; + int name_len; fd = -1; sfd = NULL; - if (strlen(name) == (sizeof(MD_NAME) - 1)) + devbuf = strdup(name); + name_len = strlen(name) - strlen(DOT_ELI); + if (name_len > 0 && strcmp(suffix = &name[name_len], DOT_ELI) == 0) { + suffix++; + devbuf[name_len] = '\0'; + } else + suffix = NULL; + /* dname will be name without /dev/ prefix and .eli suffix */ + dname = basename(devbuf); + if (strlen(dname) == (sizeof(MD_NAME) - 1)) mdunit = -1; else { errno = 0; - ul = strtoul(name + 2, &p, 10); + ul = strtoul(dname + 2, &p, 10); if (errno == 0) { if (*p != '\0' || ul > INT_MAX) errno = EINVAL; } if (errno) { - warn("Bad device unit: %s", name); + warn("Bad device unit: %s", dname); + free(devbuf); return (NULL); } mdunit = (int)ul; } + free(devbuf); vnodefile = NULL; if ((p = strstr(mntops, "file=")) != NULL) { @@ -645,10 +666,19 @@ swap_on_off_md(const char *name, char *mntops, int doingall) } } } - snprintf(mdpath, sizeof(mdpath), "%s%s%d", _PATH_DEV, - MD_NAME, mdunit); - mdpath[sizeof(mdpath) - 1] = '\0'; - ret = swap_on_off_sfile(mdpath, doingall); + + if (suffix != NULL && strcmp("eli", suffix) == 0) { + /* Swap on encrypted device by GEOM_ELI. */ + snprintf(mdpath, sizeof(mdpath), "%s%s%d" DOT_ELI, _PATH_DEV, + MD_NAME, mdunit); + mdpath[sizeof(mdpath) - 1] = '\0'; + ret = swap_on_off_geli(mdpath, mntops, doingall); + } else { + snprintf(mdpath, sizeof(mdpath), "%s%s%d", _PATH_DEV, + MD_NAME, mdunit); + mdpath[sizeof(mdpath) - 1] = '\0'; + ret = swap_on_off_sfile(mdpath, doingall); + } if (which_prog == SWAPOFF) { if (ret != NULL) { diff --git a/sbin/swapon/tests/Makefile b/sbin/swapon/tests/Makefile new file mode 100644 index 000000000000..aa0c9cf202d6 --- /dev/null +++ b/sbin/swapon/tests/Makefile @@ -0,0 +1,5 @@ +ATF_TESTS_SH= swapon_test + +TEST_METADATA.swapon_test+= required_user="root" + +.include diff --git a/sbin/swapon/tests/swapon_test.sh b/sbin/swapon/tests/swapon_test.sh new file mode 100755 index 000000000000..3c4286cd6815 --- /dev/null +++ b/sbin/swapon/tests/swapon_test.sh @@ -0,0 +1,181 @@ +# Copyright (c) 2025 Ronald Klop +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# + +atf_test_case attach_mdX cleanup +attach_mdX_head() +{ + atf_set "descr" "mdX device should attach" +} +attach_mdX_body() +{ + # if the swapfile is too small (like 1k) then mdconfig hangs looking up the md + atf_check -s exit:0 -x "truncate -s 10k swapfile" + atf_check -s exit:0 -o save:fstab.out -x "echo 'md3 none swap sw,file=swapfile 0 0'" + atf_check -s exit:0 -o match:"swapon: adding /dev/md3 as swap device" -x "swapon -F fstab.out -a" +} +attach_mdX_cleanup() +{ + swapoff -F fstab.out -a +} + +### +atf_test_case attach_dev_mdX cleanup +attach_dev_mdX_head() +{ + atf_set "descr" "/dev/mdX device should attach" +} +attach_dev_mdX_body() +{ + # if the swapfile is too small (like 1k) then mdconfig hangs looking up the md + atf_check -s exit:0 -x "truncate -s 10k swapfile" + atf_check -s exit:0 -o save:fstab.out -x "echo '/dev/md3 none swap sw,file=swapfile 0 0'" + atf_check -s exit:0 -o match:"swapon: adding /dev/md3 as swap device" -x "swapon -F fstab.out -a" +} +attach_dev_mdX_cleanup() +{ + swapoff -F fstab.out -a +} + +### +atf_test_case attach_md cleanup +attach_md_head() +{ + atf_set "descr" "mdX device should attach" +} +attach_md_body() +{ + # if the swapfile is too small (like 1k) then mdconfig hangs looking up the md + atf_check -s exit:0 -x "truncate -s 10k swapfile" + atf_check -s exit:0 -o save:fstab.out -x "echo 'md none swap sw,file=swapfile 0 0'" + atf_check -s exit:0 -o match:"swapon: adding /dev/md0 as swap device" -x "swapon -F fstab.out -a" +} +attach_md_cleanup() +{ + swapoff -F fstab.out -a +} + +### +atf_test_case attach_dev_md cleanup +attach_dev_md_head() +{ + atf_set "descr" "/dev/md device should attach" +} +attach_dev_md_body() +{ + # if the swapfile is too small (like 1k) then mdconfig hangs looking up the md + atf_check -s exit:0 -x "truncate -s 10k swapfile" + atf_check -s exit:0 -o save:fstab.out -x "echo '/dev/md none swap sw,file=swapfile 0 0'" + atf_check -s exit:0 -o match:"swapon: adding /dev/md0 as swap device" -x "swapon -F fstab.out -a" +} +attach_dev_md_cleanup() +{ + swapoff -F fstab.out -a +} + +### +atf_test_case attach_mdX_eli cleanup +attach_mdX_eli_head() +{ + atf_set "descr" "mdX.eli device should attach" +} +attach_mdX_eli_body() +{ + # if the swapfile is too small (like 1k) then mdconfig hangs looking up the md + atf_check -s exit:0 -x "truncate -s 10k swapfile" + atf_check -s exit:0 -o save:fstab.out -x "echo 'md3.eli none swap sw,file=swapfile 0 0'" + atf_check -s exit:0 -o match:"swapon: adding /dev/md3.eli as swap device" -x "swapon -F fstab.out -a" +} +attach_mdX_eli_cleanup() +{ + swapoff -F fstab.out -a +} + +### +atf_test_case attach_dev_mdX_eli cleanup +attach_dev_mdX_eli_head() +{ + atf_set "descr" "/dev/mdX.eli device should attach" +} +attach_dev_mdX_eli_body() +{ + # if the swapfile is too small (like 1k) then mdconfig hangs looking up the md + atf_check -s exit:0 -x "truncate -s 10k swapfile" + atf_check -s exit:0 -o save:fstab.out -x "echo '/dev/md3.eli none swap sw,file=swapfile 0 0'" + atf_check -s exit:0 -o match:"swapon: adding /dev/md3.eli as swap device" -x "swapon -F fstab.out -a" +} +attach_dev_mdX_eli_cleanup() +{ + swapoff -F fstab.out -a +} + +### +atf_test_case attach_md_eli cleanup +attach_md_eli_head() +{ + atf_set "descr" "md.eli device should attach" +} +attach_md_eli_body() +{ + # if the swapfile is too small (like 1k) then mdconfig hangs looking up the md + atf_check -s exit:0 -x "truncate -s 10k swapfile" + atf_check -s exit:0 -o save:fstab.out -x "echo 'md.eli none swap sw,file=swapfile 0 0'" + atf_check -s exit:0 -o match:"swapon: adding /dev/md0.eli as swap device" -x "swapon -F fstab.out -a" +} +attach_md_eli_cleanup() +{ + swapoff -F fstab.out -a +} + +### +atf_test_case attach_dev_md_eli cleanup +attach_dev_md_eli_head() +{ + atf_set "descr" "/dev/md.eli device should attach" +} +attach_dev_md_eli_body() +{ + # if the swapfile is too small (like 1k) then mdconfig hangs looking up the md + atf_check -s exit:0 -x "truncate -s 10k swapfile" + atf_check -s exit:0 -o save:fstab.out -x "echo '/dev/md.eli none swap sw,file=swapfile 0 0'" + atf_check -s exit:0 -o match:"swapon: adding /dev/md0.eli as swap device" -x "swapon -F fstab.out -a" +} +attach_dev_md_eli_cleanup() +{ + swapoff -F fstab.out -a +} + +### +atf_init_test_cases() +{ + atf_add_test_case attach_mdX + atf_add_test_case attach_dev_mdX + atf_add_test_case attach_md + atf_add_test_case attach_dev_md + + atf_add_test_case attach_mdX_eli + atf_add_test_case attach_dev_mdX_eli + atf_add_test_case attach_md_eli + atf_add_test_case attach_dev_md_eli +} From nobody Sun Jul 13 11:45:05 2025 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 4bg3Xd6GFgz60qGs; Sun, 13 Jul 2025 11:45:05 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bg3Xd4lkyz3TF7; Sun, 13 Jul 2025 11:45:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752407105; 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=IGRTOMkBp9jqFtcmZGxEYGTVJvjT1qldEDZCAac7xgM=; b=WxddqVj4He24vQIx0MY8wW83Uu6rAi4nU9rVpQa7jUcZVKSdn2KKscx2DY1Y85cJC2NVrB 88EingIfj9AJfrMy/DZWwxZys7qwfawf/G8B+IBISADQqBY4Qc/Z0aSmxE7C3QDUOyd+VS 1iF69m23Z/OcniIqpX2GzXYU57kTHHeAbBfn2Xr0Eom6JER1ca9hvmXHAbjIwcODX3jgve xuwCLxh0VKY0cOqDi+jNpprOFHeX1Wqs+jN45XL2lfODKcLIm2+P/4qocniOQuh/cBb6Wi l+YU+Mn2D3Wn04q7M0q17Yz0Eo7tHIIj3Z1kcngIRUe6ySO2vYROAAVMUb1uRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752407105; 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=IGRTOMkBp9jqFtcmZGxEYGTVJvjT1qldEDZCAac7xgM=; b=cdLlymeyydhp/iG52+Lb32PbcQi5pyn+NlqzXhJNd2IZoBoMAbMr++l3x0uRKCBUXEdnLV mvaXRCdqexoidA/ffJLY757exWxz7ZYywVRMwH44PJvstWXWcMsQ1YgxFhLlWdgZwJ+xrk mv8a5+Nh8g8hFfNpzXtWKtjoSvnA/DRzOWGEIKGZ5puzAfd48C4pHBfstHgqwchexpvKpA Kv1uSt6zazELARe1BHoDMwewrxkisMWY9/svAi0qhyL01dY/C1Q2Zlgoi1qHiCcX++VlAf W8XZTbvfr5k+y+fJZDQ/2tr6m0ZYEd3eFyZd0UVSporZWW+Z7UkxXcIK/eIsww== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752407105; a=rsa-sha256; cv=none; b=pcY43gJol38o10BJQhecf8mDuOyKoseqZ8UB2K4CEZ4TG2gnxUrHB749kQOmo83YlodpJn Iu7lCIU+JOBhfzKtQSCrrvx+TxKFEOCWJCh6iirKkeJpqRNDLzWNVU6Wakx+qqS7eatg+0 Wo3wcydJGGEUUt3gz9Zy9Has9a8EEW8B7XOrk6ScKHGrTxE+vGMAvxWKNxXedFDmZdJKeA jItejyE/QECUgCWUst2sJuYBbXlSthurh0h8u4da/b1q9oEgXIw6oWiMvhs1d4G2Ua2x7M 631Wpz+tSLwXWFmd1AQdp+yuSmEGCiwjkBt1N0zgm875u3+0z5v52jqaIe1sjQ== 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 4bg3Xd40m7z16NX; Sun, 13 Jul 2025 11:45:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56DBj5gC084213; Sun, 13 Jul 2025 11:45:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56DBj5gd084210; Sun, 13 Jul 2025 11:45:05 GMT (envelope-from git) Date: Sun, 13 Jul 2025 11:45:05 GMT Message-Id: <202507131145.56DBj5gd084210@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ronald Klop Subject: git: af8af9b28c9d - stable/14 - fix parallel execution of swapon 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ronald X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: af8af9b28c9d7c60f6f37971dc5b734c7f1bc413 Auto-Submitted: auto-generated The branch stable/14 has been updated by ronald: URL: https://cgit.FreeBSD.org/src/commit/?id=af8af9b28c9d7c60f6f37971dc5b734c7f1bc413 commit af8af9b28c9d7c60f6f37971dc5b734c7f1bc413 Author: Siva Mahadevan AuthorDate: 2025-07-01 09:57:29 +0000 Commit: Ronald Klop CommitDate: 2025-07-13 11:44:36 +0000 fix parallel execution of swapon tests And apparantly the CI env already has an md device so be relaxed about which md device is added. PR: 186252 Reported by: markj Fixes: 1ee33e3a578c35ff0e8ef5db87a8005f1f99546a "swapon: parse md.eli device for encrypted swapfile from fstab" Pull Request: https://github.com/freebsd/freebsd-src/pull/1747 (cherry picked from commit 83b08f40264177ecf03fce808474815816f9846f) --- sbin/swapon/tests/swapon_test.sh | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/sbin/swapon/tests/swapon_test.sh b/sbin/swapon/tests/swapon_test.sh index 3c4286cd6815..b6d31ecaeed0 100755 --- a/sbin/swapon/tests/swapon_test.sh +++ b/sbin/swapon/tests/swapon_test.sh @@ -32,8 +32,8 @@ attach_mdX_body() { # if the swapfile is too small (like 1k) then mdconfig hangs looking up the md atf_check -s exit:0 -x "truncate -s 10k swapfile" - atf_check -s exit:0 -o save:fstab.out -x "echo 'md3 none swap sw,file=swapfile 0 0'" - atf_check -s exit:0 -o match:"swapon: adding /dev/md3 as swap device" -x "swapon -F fstab.out -a" + atf_check -s exit:0 -o save:fstab.out -x "echo 'md31 none swap sw,file=swapfile 0 0'" + atf_check -s exit:0 -o match:"swapon: adding /dev/md31 as swap device" -x "swapon -F fstab.out -a" } attach_mdX_cleanup() { @@ -50,8 +50,8 @@ attach_dev_mdX_body() { # if the swapfile is too small (like 1k) then mdconfig hangs looking up the md atf_check -s exit:0 -x "truncate -s 10k swapfile" - atf_check -s exit:0 -o save:fstab.out -x "echo '/dev/md3 none swap sw,file=swapfile 0 0'" - atf_check -s exit:0 -o match:"swapon: adding /dev/md3 as swap device" -x "swapon -F fstab.out -a" + atf_check -s exit:0 -o save:fstab.out -x "echo '/dev/md32 none swap sw,file=swapfile 0 0'" + atf_check -s exit:0 -o match:"swapon: adding /dev/md32 as swap device" -x "swapon -F fstab.out -a" } attach_dev_mdX_cleanup() { @@ -62,14 +62,14 @@ attach_dev_mdX_cleanup() atf_test_case attach_md cleanup attach_md_head() { - atf_set "descr" "mdX device should attach" + atf_set "descr" "md device should attach" } attach_md_body() { # if the swapfile is too small (like 1k) then mdconfig hangs looking up the md atf_check -s exit:0 -x "truncate -s 10k swapfile" atf_check -s exit:0 -o save:fstab.out -x "echo 'md none swap sw,file=swapfile 0 0'" - atf_check -s exit:0 -o match:"swapon: adding /dev/md0 as swap device" -x "swapon -F fstab.out -a" + atf_check -s exit:0 -o match:"swapon: adding /dev/md[0-9][0-9]* as swap device" -x "swapon -F fstab.out -a" } attach_md_cleanup() { @@ -87,7 +87,7 @@ attach_dev_md_body() # if the swapfile is too small (like 1k) then mdconfig hangs looking up the md atf_check -s exit:0 -x "truncate -s 10k swapfile" atf_check -s exit:0 -o save:fstab.out -x "echo '/dev/md none swap sw,file=swapfile 0 0'" - atf_check -s exit:0 -o match:"swapon: adding /dev/md0 as swap device" -x "swapon -F fstab.out -a" + atf_check -s exit:0 -o match:"swapon: adding /dev/md[0-9][0-9]* as swap device" -x "swapon -F fstab.out -a" } attach_dev_md_cleanup() { @@ -104,8 +104,8 @@ attach_mdX_eli_body() { # if the swapfile is too small (like 1k) then mdconfig hangs looking up the md atf_check -s exit:0 -x "truncate -s 10k swapfile" - atf_check -s exit:0 -o save:fstab.out -x "echo 'md3.eli none swap sw,file=swapfile 0 0'" - atf_check -s exit:0 -o match:"swapon: adding /dev/md3.eli as swap device" -x "swapon -F fstab.out -a" + atf_check -s exit:0 -o save:fstab.out -x "echo 'md33.eli none swap sw,file=swapfile 0 0'" + atf_check -s exit:0 -o match:"swapon: adding /dev/md33.eli as swap device" -x "swapon -F fstab.out -a" } attach_mdX_eli_cleanup() { @@ -122,8 +122,8 @@ attach_dev_mdX_eli_body() { # if the swapfile is too small (like 1k) then mdconfig hangs looking up the md atf_check -s exit:0 -x "truncate -s 10k swapfile" - atf_check -s exit:0 -o save:fstab.out -x "echo '/dev/md3.eli none swap sw,file=swapfile 0 0'" - atf_check -s exit:0 -o match:"swapon: adding /dev/md3.eli as swap device" -x "swapon -F fstab.out -a" + atf_check -s exit:0 -o save:fstab.out -x "echo '/dev/md34.eli none swap sw,file=swapfile 0 0'" + atf_check -s exit:0 -o match:"swapon: adding /dev/md34.eli as swap device" -x "swapon -F fstab.out -a" } attach_dev_mdX_eli_cleanup() { @@ -141,7 +141,7 @@ attach_md_eli_body() # if the swapfile is too small (like 1k) then mdconfig hangs looking up the md atf_check -s exit:0 -x "truncate -s 10k swapfile" atf_check -s exit:0 -o save:fstab.out -x "echo 'md.eli none swap sw,file=swapfile 0 0'" - atf_check -s exit:0 -o match:"swapon: adding /dev/md0.eli as swap device" -x "swapon -F fstab.out -a" + atf_check -s exit:0 -o match:"swapon: adding /dev/md[0-9][0-9]*.eli as swap device" -x "swapon -F fstab.out -a" } attach_md_eli_cleanup() { @@ -159,7 +159,7 @@ attach_dev_md_eli_body() # if the swapfile is too small (like 1k) then mdconfig hangs looking up the md atf_check -s exit:0 -x "truncate -s 10k swapfile" atf_check -s exit:0 -o save:fstab.out -x "echo '/dev/md.eli none swap sw,file=swapfile 0 0'" - atf_check -s exit:0 -o match:"swapon: adding /dev/md0.eli as swap device" -x "swapon -F fstab.out -a" + atf_check -s exit:0 -o match:"swapon: adding /dev/md[0-9][0-9]*.eli as swap device" -x "swapon -F fstab.out -a" } attach_dev_md_eli_cleanup() { From nobody Sun Jul 13 11:53:07 2025 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 4bg3jw3tpyz60r5V; Sun, 13 Jul 2025 11:53:08 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bg3jw1Qlnz3YKk; Sun, 13 Jul 2025 11:53:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752407588; 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=bUwpg/Hd1KBBUNkT26H79bb10nKYqnoLA3pa1UDSrB4=; b=DW7wr+sBLyIQTcs5E68xth4flS2pW/tOt5rXFFYTGuN2CNNcomOoa3t1tuqOxKh867vq1g HCfrsxMseXlS7XcJR0t9nViMHv+glULHQypYq5NNVFh+YLlHqymGr8iEg8PmbMyq2yclOh CPBgKto1xS036NY6RzQsAx1339RHo4nbjbog6n3XMvpxvHdC/BX7dHxw5BFc9YT8yvgUeE 4HDrMNMdkHLTNIEtH/hYKL9PiuKGtJQIyHcz7Al1o+dr+wS5mbnXH2dhuBZcl6haJ945m0 o8wnnx15rzg/a8Ymi9dDNhGfYi6q52vdwJrx7cBHof2DLr8F2zvw+AGFteBCow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752407588; 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=bUwpg/Hd1KBBUNkT26H79bb10nKYqnoLA3pa1UDSrB4=; b=yihPeuzYiHORUzUFNfjtcdbaw2Jk6mz3o4/Qj3QrSKbr0vKS+3rDK8lYlm33S7hA2yeRFz yaCvE1Y2hIL/z+iyt/csOm3RGPCEuL5BBWOosj3B2IybSe9jybljG1B+MPpiZncRcyYMEa sfG8gCKjZBN15qsFRljVDlcUxlODRPle9L7ZJ1fvTVJxqsgbIBT5Jc4sPYNn1eSm+lcnP0 /lCfrB4MI5If9EkSSeMdABLxTxIBIoZyDbHzhrxRyaVt+29TlAfh0C2zzdRMvRjw6hg7ah M4c0EsFWAWFmvVncB7iBbSfQr9fw4I+BhMxbsxMFEJPsnnn91zVAMYWNCkkO4Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752407588; a=rsa-sha256; cv=none; b=x14Xuvisg4L4I+qVWPcq0DnpZJkq/RgglQEQPELJWVhAhi6CvPQwq0aKLapvwtkVMmr9i2 5xJKWm97TlmDhUNhiC+2VoNCCcGy5WsNZSlkC1xO3Z3VqonJSfGAHesSDS3S2oPEl+PYED fzL3nL4S5GQcWY9l26Bui3jmFuRjHTR7szcrQ15Pm5xOJmhLBYNuT0k03OZH3L3f6TGEDr BEPnYmzUSmpRmQScISTlkd7wHrCj0lm6n7C99IgkkGomO+nTkdq3WD+bQwZf8JltIrmIgZ R/FcuOjspbCj+10UiafUgmbf3Lxe464YaaOfyZrp+oI6IUNCLUiMWYtZFJN2tA== 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 4bg3jw0TLGz16VY; Sun, 13 Jul 2025 11:53:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56DBr8cH001783; Sun, 13 Jul 2025 11:53:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56DBr7mv001780; Sun, 13 Jul 2025 11:53:07 GMT (envelope-from git) Date: Sun, 13 Jul 2025 11:53:07 GMT Message-Id: <202507131153.56DBr7mv001780@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kajetan Staszkiewicz Subject: git: cbd06dd2afd5 - main - pf: Fix error handling when pf_map_addr() fails 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cbd06dd2afd543fc3cb9aa95ab2219a9ec60619d Auto-Submitted: auto-generated The branch main has been updated by ks: URL: https://cgit.FreeBSD.org/src/commit/?id=cbd06dd2afd543fc3cb9aa95ab2219a9ec60619d commit cbd06dd2afd543fc3cb9aa95ab2219a9ec60619d Author: Kajetan Staszkiewicz AuthorDate: 2025-06-05 18:40:28 +0000 Commit: Kajetan Staszkiewicz CommitDate: 2025-07-13 11:48:39 +0000 pf: Fix error handling when pf_map_addr() fails When pf_map_addr() fails, for example for a NAT pool, we expect packet will not be forwarded. The error returned by pf_map_addr() has been ignored in pf_map_addr_sn(), though, causing packets being forwarded without NAT applied. Catch the error, return the error to caller, let the caller handle error counters for route-to pools just like it does for NAT pools. Add tests for NAT and route-to rules. Improve logging by not hardcoding function name and use __func__ instead. Reviewed by: kp Approved by: kp Sponsored by: InnoGames GmbH Differential Revision: https://reviews.freebsd.org/D50763 --- sys/netpfil/pf/pf.c | 9 +++++---- sys/netpfil/pf/pf_lb.c | 18 ++++++------------ tests/sys/netpfil/pf/nat.sh | 33 +++++++++++++++++++++++++++++++++ tests/sys/netpfil/pf/route_to.sh | 35 +++++++++++++++++++++++++++++++++++ 4 files changed, 79 insertions(+), 16 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index acdeebb85e30..a410fe570c39 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -5906,11 +5906,12 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, * it is applied only from the last pass rule. */ pd->act.rt = r->rt; - /* Don't use REASON_SET, pf_map_addr increases the reason counters */ - ctx.reason = pf_map_addr_sn(pd->af, r, pd->src, &pd->act.rt_addr, - &pd->act.rt_kif, NULL, &(r->route), PF_SN_ROUTE); - if (ctx.reason != 0) + if ((transerror = pf_map_addr_sn(pd->af, r, pd->src, + &pd->act.rt_addr, &pd->act.rt_kif, NULL, &(r->route), + PF_SN_ROUTE)) != PFRES_MATCH) { + REASON_SET(&ctx.reason, transerror); goto cleanup; + } } if (pd->virtual_proto != PF_VPROTO_FRAGMENT && diff --git a/sys/netpfil/pf/pf_lb.c b/sys/netpfil/pf/pf_lb.c index d4728f61dce8..9db1d88ce52e 100644 --- a/sys/netpfil/pf/pf_lb.c +++ b/sys/netpfil/pf/pf_lb.c @@ -755,10 +755,6 @@ pf_map_addr(sa_family_t af, struct pf_krule *r, struct pf_addr *saddr, done_pool_mtx: mtx_unlock(&rpool->mtx); - if (reason) { - counter_u64_add(V_pf_status.counters[reason], 1); - } - return (reason); } @@ -793,7 +789,7 @@ pf_map_addr_sn(sa_family_t af, struct pf_krule *r, struct pf_addr *saddr, if (nkif) *nkif = sn->rkif; if (V_pf_status.debug >= PF_DEBUG_NOISY) { - printf("pf_map_addr: src tracking maps "); + printf("%s: src tracking maps ", __func__); pf_print_host(saddr, 0, af); printf(" to "); pf_print_host(naddr, 0, af); @@ -808,14 +804,16 @@ pf_map_addr_sn(sa_family_t af, struct pf_krule *r, struct pf_addr *saddr, * Source node has not been found. Find a new address and store it * in variables given by the caller. */ - if (pf_map_addr(af, r, saddr, naddr, nkif, init_addr, rpool) != 0) { - /* pf_map_addr() sets reason counters on its own */ + if ((reason = pf_map_addr(af, r, saddr, naddr, nkif, init_addr, + rpool)) != 0) { + if (V_pf_status.debug >= PF_DEBUG_MISC) + printf("%s: pf_map_addr has failed\n", __func__); goto done; } if (V_pf_status.debug >= PF_DEBUG_NOISY && (rpool->opts & PF_POOL_TYPEMASK) != PF_POOL_NONE) { - printf("pf_map_addr: selected address "); + printf("%s: selected address ", __func__); pf_print_host(naddr, 0, af); if (nkif) printf("@%s", (*nkif)->pfik_name); @@ -826,10 +824,6 @@ done: if (sn != NULL) PF_SRC_NODE_UNLOCK(sn); - if (reason) { - counter_u64_add(V_pf_status.counters[reason], 1); - } - return (reason); } diff --git a/tests/sys/netpfil/pf/nat.sh b/tests/sys/netpfil/pf/nat.sh index f1fdf6405d97..16c981f97399 100644 --- a/tests/sys/netpfil/pf/nat.sh +++ b/tests/sys/netpfil/pf/nat.sh @@ -777,6 +777,38 @@ binat_match_cleanup() kill $(cat ${PWD}/inetd_tester.pid) } +atf_test_case "empty_pool" "cleanup" +empty_pool_head() +{ + atf_set descr 'NAT with empty pool' + atf_set require.user root +} + +empty_pool_body() +{ + pft_init + setup_router_server_ipv6 + + + pft_set_rules router \ + "block" \ + "pass inet6 proto icmp6 icmp6-type { neighbrsol, neighbradv }" \ + "pass in on ${epair_tester}b" \ + "pass out on ${epair_server}a inet6 from any to ${net_server_host_server} nat-to " \ + + # pf_map_addr_sn() won't be able to pick a target address, because + # the table used in redireciton pool is empty. Packet will not be + # forwarded, error counter will be increased. + ping_server_check_reply exit:1 + # Ignore warnings about not-loaded ALTQ + atf_check -o "match:map-failed +1 +" -x "jexec router pfctl -qvvsi 2> /dev/null" +} + +empty_pool_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "exhaust" @@ -794,4 +826,5 @@ atf_init_test_cases() atf_add_test_case "nat_match" atf_add_test_case "binat_compat" atf_add_test_case "binat_match" + atf_add_test_case "empty_pool" } diff --git a/tests/sys/netpfil/pf/route_to.sh b/tests/sys/netpfil/pf/route_to.sh index 5c0d355b8ea1..91c12c8ce2ae 100644 --- a/tests/sys/netpfil/pf/route_to.sh +++ b/tests/sys/netpfil/pf/route_to.sh @@ -859,6 +859,40 @@ ttl_cleanup() pft_cleanup } + +atf_test_case "empty_pool" "cleanup" +empty_pool_head() +{ + atf_set descr 'Route-to with empty pool' + atf_set require.user root +} + +empty_pool_body() +{ + pft_init + setup_router_server_ipv6 + + + pft_set_rules router \ + "block" \ + "pass inet6 proto icmp6 icmp6-type { neighbrsol, neighbradv }" \ + "pass in on ${epair_tester}b route-to (${epair_server}a ) inet6 from any to ${net_server_host_server}" \ + "pass out on ${epair_server}a" + + # pf_map_addr_sn() won't be able to pick a target address, because + # the table used in redireciton pool is empty. Packet will not be + # forwarded, error counter will be increased. + ping_server_check_reply exit:1 + # Ignore warnings about not-loaded ALTQ + atf_check -o "match:map-failed +1 +" -x "jexec router pfctl -qvvsi 2> /dev/null" +} + +empty_pool_cleanup() +{ + pft_cleanup +} + + atf_init_test_cases() { atf_add_test_case "v4" @@ -877,4 +911,5 @@ atf_init_test_cases() atf_add_test_case "dummynet_double" atf_add_test_case "sticky" atf_add_test_case "ttl" + atf_add_test_case "empty_pool" } From nobody Sun Jul 13 12:23:54 2025 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 4bg4PQ4HDHz60ssN; Sun, 13 Jul 2025 12:23:54 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bg4PQ3QRzz3rGx; Sun, 13 Jul 2025 12:23:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752409434; 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=xMxfTq6qxPD0pOGyg8JnhQGB/s+dKg42rv8icHfR+sI=; b=qndsPgDBC01Kayr+fEuAWetoq0NJaadoxFhPaqZoXqvJzfzSDkyHks29JUKKzg1FRovUgV ax/iNEnH63ZrcUHqzke+8nXCuhnkfwmZSzVPeAeY9v5JUWgEmX3Nyqq1VtXKqDLLRahXXm Jj/cOkZH3Bu6aRa2dA1iopK5Cb8vEQF4QTjUp2Kelqs/fpc0hgPzloFZO6zOUQRtvf0Mqc vdRpkO0t2v/r6Es21+tjtQXa5Mk7IhHtRvTgwQSZgFA2SZfiLnpusXBuQwx5RudUY0k68c WjdOczYQJIa8HyblIgWRDxwz7uCYR8+j4eLQR5FloqZEDoh95qkjJTNlGyrLFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752409434; 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=xMxfTq6qxPD0pOGyg8JnhQGB/s+dKg42rv8icHfR+sI=; b=hA3WtySflcCpIpENOkBQADu0oh9psB1goerlYrfT76gkWmRAeKz2j83Tv0a5noLbAdcVY8 yHjGDWph2+1HdqVFgoulvxNwCSq9M0x+B1qrsV162Ain7XQpX+X1T6rj3EbU6o67LnJYJP oF6fYx2RvkGcjNY4n5p6t5WJPryu+FD2dRfEYUV1RHMU6p8eMnQ1Y+jByMk9LAAdN0eauA BWPRivD+9r7r2fMXe/GdiQNU9i8zsizqFh3EjAiY/hsbqGw1SQp7qihUo2AnG/+oL+D7Xu kUdzYi30GcXeiOxB8xjoglb9bjpLLKmg/5TBWuXG15sCQlmF+Pe1nTGuzzWTsg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752409434; a=rsa-sha256; cv=none; b=fDikk1WY0bn9qFDGw4CoURrfX1pZSMWtb7GjMQ+Yc7+KuZJ+Xx8hctSAaNigK+A92Pwhks jBgF0GPj8kfm7MWylapGg3awTVqUf26zqmxA+ImcWVYETSjGgkxwlOkJB+cmdjvLvjqSpS DtBY0DXY1R4quqT8oJt/J3Q+QbRVW7Ba4TwLvYAQQkZhHjVL0H9snLY0xKU/0o1N8jiB+s kIYcf760a/ayMWe3+St/LmYd6rXcOuKgF++VfRR3y2fEyBxuK0mZbgyElIqZb5czwINCRo ZWOQE7KIh4sK3kgMbrBdg6yP6pMqdJlutWuO/qDav3rEcN+o1tV74LqgHepNqQ== 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 4bg4PQ30Z8z17g4; Sun, 13 Jul 2025 12:23:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56DCNs1M059098; Sun, 13 Jul 2025 12:23:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56DCNsBh059095; Sun, 13 Jul 2025 12:23:54 GMT (envelope-from git) Date: Sun, 13 Jul 2025 12:23:54 GMT Message-Id: <202507131223.56DCNsBh059095@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Robert Clausecker Subject: git: b98b82a8bff9 - main - share/termcap: ti703 does not actually support tabs 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fuz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b98b82a8bff951b5c1dc1b3b590a986e027efd84 Auto-Submitted: auto-generated The branch main has been updated by fuz: URL: https://cgit.FreeBSD.org/src/commit/?id=b98b82a8bff951b5c1dc1b3b590a986e027efd84 commit b98b82a8bff951b5c1dc1b3b590a986e027efd84 Author: Robert Clausecker AuthorDate: 2025-07-13 10:29:15 +0000 Commit: Robert Clausecker CommitDate: 2025-07-13 12:23:48 +0000 share/termcap: ti703 does not actually support tabs This is a mistake I made when I originally wrote this entry. Event: Berlin Hackathon 202507 MFC after: 1 week --- share/termcap/termcap | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/share/termcap/termcap b/share/termcap/termcap index 9704d85c942f..3ec56111ed8e 100644 --- a/share/termcap/termcap +++ b/share/termcap/termcap @@ -3549,8 +3549,7 @@ ti931|ti 931:\ # using \EPC\\ and \EPD\\, but I don't think there is a # capability for that. ti703|ti707|Texas Instruments Silent 703/707, 80 cols:\ - :am:hc:os:xn:\ - :co#80:it#8:\ + :am:hc:os:xn:co#80:\ :do=\n:le=\b:cr=\r:nd= :bl=^G:ta=\t:is=\EPC\\: ti703-w|ti707-w|Texas Instruments Silent 703/707, 132 cols:\ :co#132:is=\EPD\\:tc=ti703: From nobody Sun Jul 13 12:23:55 2025 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 4bg4PS1VGLz60sg1; Sun, 13 Jul 2025 12:23:56 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bg4PR6KRnz3r3Q; Sun, 13 Jul 2025 12:23:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752409435; 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=ZB3Jg0YVn8c9v1h/sVcMh9niBVHRm07KDdyaa7QzbQU=; b=TT6eSTpusSSsqyY4ap1g7p+6aaPgZeJmVR/V5bnGKhc0p7xUBO4qUlPyAJtiYnf4URDDI2 ycdoIs6V3L/DzyjkHuKzDJtwaWakT6DyM9vWef0fsQ8uOf4KayVxDzkg6Es0OE1PBgxTnT 1gS7iEgor3Sm61mhExZYjQR9+6R5RCpGup/Tcpc25rWpRiCRtPV6jPhRHFoCGzG7E4PxNt 6+uLB2+gDOhP9gKSQweQfnlPKYaLhrNETItLHnShGzInMxhdIpy2lEZuVxHxyOiWE/4GjI RG8ArlpXGLO5y23MylXG8wOOzdeBw354jFSo/ElC0S1HJlGuSmnEgKJUzWsijw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752409435; 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=ZB3Jg0YVn8c9v1h/sVcMh9niBVHRm07KDdyaa7QzbQU=; b=TZpsRIuxOhsw13XdKlLx4qpkhWbh+EtGairkbNrQwIIINPoEX7i0Hx7LdB47MOqRkxjnRW 4WMrxpWZjz6DkII+AtbTrt4Uw+M3gP0n1WD27/8Xoz2id9xY1klNtpuKyId45V36j4J4aq 010fN1BonHbnJJhzeFzOMlTITrSoVNMInMUK5TfmdZY0AhvkDu0WF492J3U3hk4iJlqvi1 AS9oLaYocLOI5JZfrjMqGwJEC+WPT/IJpcT2o9Z9Ps2eq+2O9z78VsXG8nY1g0B20XCpBv dn8FNSN290QZADoU+YqYiaVeifrUTUw0ZHQPqZL8uVC95o6Vb/lIri8N72y1WQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752409435; a=rsa-sha256; cv=none; b=eDw+/QYbgpRVaosbZj3LiRUYp5WW/w5kOstDL221Wr6x/zmVgfR/uS9Kew3TebuouioVrw m3Y+ULoRmCztzPbjg9MsgGCmmrtnyvGb94381wbEZvVQnC8TMNXbfkOKo2/3zcyZRwkG0l jIO7w6+T30mNklp2wx038pepEpPD/TKiQNw/L/v0CMxXMoUcdD3agYYCmCLDxSZai4GJ+J btwYy7SccC84/LWXgEMTm1Rf0CWd2pEk4qX/Ar6K0BQBEInOwJfnF6IQns5TPtqdEM0hwP a8hCp5taSOeKpmCx34ZKWoJV73pLp1VUrbuq6xahdy7tzzW7umTv1WrPMkwsiA== 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 4bg4PR4BMRz17g5; Sun, 13 Jul 2025 12:23:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56DCNtk4059136; Sun, 13 Jul 2025 12:23:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56DCNtrr059133; Sun, 13 Jul 2025 12:23:55 GMT (envelope-from git) Date: Sun, 13 Jul 2025 12:23:55 GMT Message-Id: <202507131223.56DCNtrr059133@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Robert Clausecker Subject: git: 804f961c5cdd - main - share/termcap: add xterm-ghostty entry 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fuz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 804f961c5cddcffa950ff7f13025021cdd95ba46 Auto-Submitted: auto-generated The branch main has been updated by fuz: URL: https://cgit.FreeBSD.org/src/commit/?id=804f961c5cddcffa950ff7f13025021cdd95ba46 commit 804f961c5cddcffa950ff7f13025021cdd95ba46 Author: Robert Clausecker AuthorDate: 2025-07-13 12:10:48 +0000 Commit: Robert Clausecker CommitDate: 2025-07-13 12:23:48 +0000 share/termcap: add xterm-ghostty entry As generated by ghostty during the build with some copy-editing. Submitted by: Tim Culverhouse PR: 287642 Event: Berlin Hackathon 202507 MFC after: 1 week --- share/termcap/termcap | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/share/termcap/termcap b/share/termcap/termcap index 3ec56111ed8e..46b89d0b3ddf 100644 --- a/share/termcap/termcap +++ b/share/termcap/termcap @@ -4807,6 +4807,26 @@ alacritty+common|base fragment for alacritty:\ :te=\E[?1049l\E[23;0;0t:ti=\E[?1049h\E[22;0;0t:\ :ts=\E]2;:ue=\E[24m:up=\E[A:us=\E[4m:vb=\E[?5h\E[?5l:\ :ve=\E[?12l\E[?25h:vi=\E[?25l:vs=\E[?12;25h: + +# From Tim Culverhouse +xterm-ghostty|ghostty|Ghostty:\ + :am:hs:km:mi:ms:xn:\ + :co#80:it#8:li#24:\ + :AL=\E[%dL:DC=\E[%dP:DL=\E[%dM:DO=\E[%dB:IC=\E[%d@:\ + :LE=\E[%dD:RI=\E[%dC:SF=\E[%dS:SR=\E[%dT:UP=\E[%dA:\ + :ae=\E(B:al=\E[L:as=\E(0:bl=^G:bt=\E[Z:cd=\E[J:ce=\E[K:\ + :cl=\E[H\E[2J:cm=\E[%i%d;%dH:cr=\r:cs=\E[%i%d;%dr:\ + :ct=\E[3g:dc=\E[P:dl=\E[M:do=\n:ds=\E]2;\007:ec=\E[%dX:\ + :ei=\E[4l:fs=^G:ho=\E[H:ic=\E[@:im=\E[4h:k1=\EOP:k2=\EOQ:\ + :k3=\EOR:k4=\EOS:k5=\E[15~:k6=\E[17~:k7=\E[18~:k8=\E[19~:\ + :k9=\E[20~:kD=\E[3~:kI=\E[2~:kN=\E[6~:kP=\E[5~:kb=\177:\ + :kd=\EOB:ke=\E[?1l\E>:kh=\EOH:kl=\EOD:kr=\EOC:\ + :ks=\E[?1h\E=:ku=\EOA:le=^H:mb=\E[5m:md=\E[1m:me=\E[0m:\ + :mh=\E[2m:mr=\E[7m:nd=\E[C:rc=\E8:sc=\E7:se=\E[27m:sf=\n:\ + :so=\E[7m:sr=\EM:st=\EH:ta=^I:te=\E[?1049l:ti=\E[?1049h:\ + :ts=\E]2;:ue=\E[24m:up=\E[A:us=\E[4m:vb=\E[?5h\E[?5l:\ + :ve=\E[?12l\E[?25h:vi=\E[?25l:vs=\E[?12;25h: + # # END OF TERMCAP # ------------------------ From nobody Sun Jul 13 13:01:24 2025 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 4bg5Dk26zHz60wgT; Sun, 13 Jul 2025 13:01:26 +0000 (UTC) (envelope-from vishwin@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bg5Dj5qcmz3HY4; Sun, 13 Jul 2025 13:01:25 +0000 (UTC) (envelope-from vishwin@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752411685; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=hzlIj2joLmP3EJWHyeP11ZMXgWFGig8nT6sll8Op4+k=; b=UTIq1Hl9nT1EAEBT8rXbsh1ndCrb18AFOWzvcZZj8ubzG4bnmi7eG5WExBFOyZ/l4NlzHs Qx6oNYBnitHNQtCl6Z9Orcn7OVCpa60We+kHzcXHrSJRJI944hgHNHjlBMTiINyVWiaZAU aoVNIHQcvN8HVzu7YKzTYOJx+It+n6o5JeIKc7GPkiCMZieUSkkzZ2rDfbgPIIoM3oa2es PaRjVueKY+ajpRrTD5y+SO4EIHjEStgS8TDXckbcMey4c3HxWXPGe4xEi3Fw+A3pg8fyDM xkSRqPdpAyIn1GvSVYBl0iWqMgftT8N363eYWQYYBxJtbkqkK9hpfOHTwQ8CuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752411685; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=hzlIj2joLmP3EJWHyeP11ZMXgWFGig8nT6sll8Op4+k=; b=Fe04RjEKZYhIx8VgZbvA0ecijFTx+UB2YXibZw0hCjOzVmopXLz1hysX+iJ1psrPa9AB84 KqA7fp+Csvle5yQzQj27yRJrGNenIKiGbV8mEOjdI9VHmhIhuirDMhpo4Z2EXnSVCJ5VS+ GtBLV49gogc6MeBiazdxxpRQ7BFvC+lKY1ytCd411DgZs+wSJq8QPM4+HN903eQ6XqIb85 Yc9l+nwTmdVpkXv8SWXWXsMu9oEDZfIymQQ7zikTWO/dQ2TC1XH0SaYHRT3fw94htLBW9c vCuHzuC/o5hJNpeAInlBNM1UdQc2LVD99MiZa7Vf6ut8vuxbk6tRNKe8TMSnGQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752411685; a=rsa-sha256; cv=none; b=imSjRkfNpmofI+05wWSs/icVPGPj+sRWbClrXvJ/4/NZMfTmO4l1gkAdhdFJyXvQLpAx69 BiZEzHzmFua6f2mWir3HiBZFbUxGjJC5DRkaWF3GeQIMHIFdrwMVGmXt05FV1myrFWbbgw xDvK81dUZoSPGVUZysV9HOGFRdlHpTvARg/3ZQtQqxpWrNvy+HV5KphhWVqPSdiheBndIH QHwYWZ05TusY0QzdH04Yz8ZiZcPyELvR4EwkXdlOZONC7jrVyP/CNJq2bdIh7VZxi7zWaM rsoD94+qTV2iNKxTRhOdmGxWFasmnO+4NtKHqsK3m8z6/3RXLkYQ9D63N3j40w== Received: from [IPV6:2601:98a:d00:c180:56ee:75ff:fe50:69b5] (unknown [IPv6:2601:98a:d00:c180:56ee:75ff:fe50:69b5]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: vishwin/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bg5Dj3kQlz8Cy; Sun, 13 Jul 2025 13:01:25 +0000 (UTC) (envelope-from vishwin@freebsd.org) Message-ID: Date: Sun, 13 Jul 2025 09:01:24 -0400 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: f1f230439fa4 - main - vfs: Initial revision of inotify To: Mark Johnston , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202507041455.564EtqwS073424@gitrepo.freebsd.org> Content-Language: en-GB From: Charlie Li Autocrypt: addr=vishwin@freebsd.org; keydata= xjMEaEicoBYJKwYBBAHaRw8BAQdAZBuydpjFLGem4uRJPWaYMXX2e+BN1jDhbD3tcqbxhdfN MkNoYXJsaWUgTGkgKEZyZWVCU0QgUHJvamVjdCkgPHZpc2h3aW5ARnJlZUJTRC5vcmc+wpkE ExYKAEEWIQTHxcCLnAXo3rFg6k7P+1cn7slqBAUCaEicoAIbAwUJCWYBgAULCQgHAgIiAgYV CgkICwIEFgIDAQIeBwIXgAAKCRDP+1cn7slqBM/bAP9bhA4e0LxJYFYJlftZM5WHrMSPpUe6 G2pVqmQWTQ0EZQEA0PNryfH3qRWWPSI8mFNRnG24hi5/aXFqCnHj1tcJ9Q/OOARoSJygEgor BgEEAZdVAQUBAQdAUT4TzYFmV6ueIGwjX0N+445KZV6ns1Wiw67QMsJZxHkDAQgHwn4EGBYK ACYWIQTHxcCLnAXo3rFg6k7P+1cn7slqBAUCaEicoAIbDAUJCWYBgAAKCRDP+1cn7slqBPO/ AQCPuGiyyfJClICRs/ToG0MsT8YcPdBygzuUIIeGpkjJpgEA7AoFCQ0Y28Y3hIDFn2k9PH3B nGWL3g05W0ds2qoj+gQ= Organization: FreeBSD Project In-Reply-To: <202507041455.564EtqwS073424@gitrepo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------CWWw7Mfv2fBZ9PfjZZk0Yuj6" This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------CWWw7Mfv2fBZ9PfjZZk0Yuj6 Content-Type: multipart/mixed; boundary="------------xUtkXr0K6mUW7RFH7YGv5QTA"; protected-headers="v1" From: Charlie Li To: Mark Johnston , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Message-ID: Subject: Re: git: f1f230439fa4 - main - vfs: Initial revision of inotify References: <202507041455.564EtqwS073424@gitrepo.freebsd.org> In-Reply-To: <202507041455.564EtqwS073424@gitrepo.freebsd.org> --------------xUtkXr0K6mUW7RFH7YGv5QTA Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: base64 TWFyayBKb2huc3RvbiB3cm90ZToNCj4gICBzeXMva2Vybi92ZnNfdm5vcHMuYyAgICAgICB8 ICAgIDMgKy0NCj4gDQo+IA0KQWZ0ZXIgdGhpcyBlbnRpcmUgc2VyaWVzIG9mIGNvbW1pdHMs IHdpdGggYWxsIHBvcnRzIHJlYnVpbHQsIEknbSBnZXR0aW5nIA0KcGFuaWNzIGltbWVkaWF0 ZWx5IHVwb24gc3RhcnRpbmcgYSBkZXNrdG9wLCBmb3VuZCB3aXRoIGJvdGggeGZjZSBhbmQg DQpjaW5uYW1vbjoNCg0KU3VuIEp1bCAxMyAwODozMDozOCBFRFQgMjAyNQ0KDQpGcmVlQlNE IGxlaG1hbiAxNS4wLUNVUlJFTlQgRnJlZUJTRCAxNS4wLUNVUlJFTlQgIzIgDQptYWluLW4y Nzg3MTAtZjVkYmE2NzMzNDVlOiBTYXQgSnVsIDEyIDE5OjE4OjU5IEVEVCAyMDI1IA0Kcm9v dEBsZWhtYW46L3Vzci9vYmovdXNyL3NyYy9hbWQ2NC5hbWQ2NC9zeXMvT0RZU1NFWSAgYW1k NjQNCg0KcGFuaWM6IEFzc2VydGlvbiAqZW9mZmxhZyAhPSAwIGZhaWxlZCBhdCAvdXNyL3Ny Yy9zeXMva2Vybi92ZnNfdm5vcHMuYzo0MDU4DQoNClJlYWRpbmcgc3ltYm9scyBmcm9tIC9i b290L2tlcm5lbC9rZXJuZWwuLi4NClJlYWRpbmcgc3ltYm9scyBmcm9tIC91c3IvbGliL2Rl YnVnLy9ib290L2tlcm5lbC9rZXJuZWwuZGVidWcuLi4NClJlYWRpbmcgc3ltYm9scyBmcm9t IC9ib290L2tlcm5lbC96ZnMua28uLi4NClJlYWRpbmcgc3ltYm9scyBmcm9tIC91c3IvbGli L2RlYnVnLy9ib290L2tlcm5lbC96ZnMua28uZGVidWcuLi4NClJlYWRpbmcgc3ltYm9scyBm cm9tIC9ib290L21vZHVsZXMvaTkxNWttcy5rby4uLg0KKE5vIGRlYnVnZ2luZyBzeW1ib2xz IGZvdW5kIGluIC9ib290L21vZHVsZXMvaTkxNWttcy5rbykNClJlYWRpbmcgc3ltYm9scyBm cm9tIC9ib290L21vZHVsZXMvZHJtLmtvLi4uDQooTm8gZGVidWdnaW5nIHN5bWJvbHMgZm91 bmQgaW4gL2Jvb3QvbW9kdWxlcy9kcm0ua28pDQpSZWFkaW5nIHN5bWJvbHMgZnJvbSAvYm9v dC9rZXJuZWwvaWljLmtvLi4uDQpSZWFkaW5nIHN5bWJvbHMgZnJvbSAvdXNyL2xpYi9kZWJ1 Zy8vYm9vdC9rZXJuZWwvaWljLmtvLmRlYnVnLi4uDQpSZWFkaW5nIHN5bWJvbHMgZnJvbSAv Ym9vdC9rZXJuZWwvbGludXhrcGlfdmlkZW8ua28uLi4NClJlYWRpbmcgc3ltYm9scyBmcm9t IC91c3IvbGliL2RlYnVnLy9ib290L2tlcm5lbC9saW51eGtwaV92aWRlby5rby5kZWJ1Zy4u Lg0KUmVhZGluZyBzeW1ib2xzIGZyb20gL2Jvb3QvbW9kdWxlcy9kbWFidWYua28uLi4NCihO byBkZWJ1Z2dpbmcgc3ltYm9scyBmb3VuZCBpbiAvYm9vdC9tb2R1bGVzL2RtYWJ1Zi5rbykN ClJlYWRpbmcgc3ltYm9scyBmcm9tIC9ib290L2tlcm5lbC9saW5kZWJ1Z2ZzLmtvLi4uDQpS ZWFkaW5nIHN5bWJvbHMgZnJvbSAvdXNyL2xpYi9kZWJ1Zy8vYm9vdC9rZXJuZWwvbGluZGVi dWdmcy5rby5kZWJ1Zy4uLg0KUmVhZGluZyBzeW1ib2xzIGZyb20gL2Jvb3QvbW9kdWxlcy90 dG0ua28uLi4NCihObyBkZWJ1Z2dpbmcgc3ltYm9scyBmb3VuZCBpbiAvYm9vdC9tb2R1bGVz L3R0bS5rbykNClJlYWRpbmcgc3ltYm9scyBmcm9tIC9ib290L2tlcm5lbC9pZl9pd2x3aWZp LmtvLi4uDQpSZWFkaW5nIHN5bWJvbHMgZnJvbSAvdXNyL2xpYi9kZWJ1Zy8vYm9vdC9rZXJu ZWwvaWZfaXdsd2lmaS5rby5kZWJ1Zy4uLg0KUmVhZGluZyBzeW1ib2xzIGZyb20gL2Jvb3Qv a2VybmVsL2lmX2l3bS5rby4uLg0KUmVhZGluZyBzeW1ib2xzIGZyb20gL3Vzci9saWIvZGVi dWcvL2Jvb3Qva2VybmVsL2lmX2l3bS5rby5kZWJ1Zy4uLg0KUmVhZGluZyBzeW1ib2xzIGZy b20gL2Jvb3Qva2VybmVsL2N1c2Uua28uLi4NClJlYWRpbmcgc3ltYm9scyBmcm9tIC91c3Iv bGliL2RlYnVnLy9ib290L2tlcm5lbC9jdXNlLmtvLmRlYnVnLi4uDQpSZWFkaW5nIHN5bWJv bHMgZnJvbSAvYm9vdC9rZXJuZWwvdXBsY29tLmtvLi4uDQpSZWFkaW5nIHN5bWJvbHMgZnJv bSAvdXNyL2xpYi9kZWJ1Zy8vYm9vdC9rZXJuZWwvdXBsY29tLmtvLmRlYnVnLi4uDQpSZWFk aW5nIHN5bWJvbHMgZnJvbSAvYm9vdC9rZXJuZWwvbmxzeXNldmVudC5rby4uLg0KUmVhZGlu ZyBzeW1ib2xzIGZyb20gL3Vzci9saWIvZGVidWcvL2Jvb3Qva2VybmVsL25sc3lzZXZlbnQu a28uZGVidWcuLi4NCl9fY3VydGhyZWFkICgpIGF0IC91c3Ivc3JjL3N5cy9hbWQ2NC9pbmNs dWRlL3BjcHVfYXV4Lmg6NTcNCjU3ICAgICAgICAgICAgICBfX2FzbSgibW92cSAlJWdzOiVj MSwlMCIgOiAiPXIiICh0ZCkNCihrZ2RiKSAjMCAgX19jdXJ0aHJlYWQgKCkgYXQgL3Vzci9z cmMvc3lzL2FtZDY0L2luY2x1ZGUvcGNwdV9hdXguaDo1Nw0KICAgICAgICAgdGQgPSA8b3B0 aW1pemVkIG91dD4NCiMxICBkb2FkdW1wICh0ZXh0ZHVtcD10ZXh0ZHVtcEBlbnRyeT0xKQ0K ICAgICBhdCAvdXNyL3NyYy9zeXMva2Vybi9rZXJuX3NodXRkb3duLmM6Mzk5DQogICAgICAg ICBlcnJvciA9IDANCiAgICAgICAgIGNvcmVkdW1wID0gPG9wdGltaXplZCBvdXQ+DQojMiAg MHhmZmZmZmZmZjgwYjk4OTgzIGluIGtlcm5fcmVib290IChob3d0bz0yNjApDQogICAgIGF0 IC91c3Ivc3JjL3N5cy9rZXJuL2tlcm5fc2h1dGRvd24uYzo1MTkNCiAgICAgICAgIG9uY2Ug PSAwDQogICAgICAgICBfX3BjID0gMHgwDQojMyAgMHhmZmZmZmZmZjgwYjk4ZWE3IGluIHZw YW5pYyAoDQogICAgIGZtdD0weGZmZmZmZmZmODEzMWU4NTUgIkFzc2VydGlvbiAlcyBmYWls ZWQgYXQgJXM6JWQiLA0KICAgICBhcD1hcEBlbnRyeT0weGZmZmZmZTAwYzQ3OTdhNTApIGF0 IA0KL3Vzci9zcmMvc3lzL2tlcm4va2Vybl9zaHV0ZG93bi5jOjk3NA0KICAgICAgICAgYnVm ID0gIkFzc2VydGlvbiAqZW9mZmxhZyAhPSAwIGZhaWxlZCBhdCANCi91c3Ivc3JjL3N5cy9r ZXJuL3Zmc192bm9wcy5jOjQwNTgiLCAnXDAwMCcgPHJlcGVhdHMgMTg3IHRpbWVzPg0KICAg ICAgICAgX19wYyA9IDB4MA0KICAgICAgICAgX19wYyA9IDB4MA0KICAgICAgICAgX19wYyA9 IDB4MA0KICAgICAgICAgb3RoZXJfY3B1cyA9IHtfX2JpdHMgPSB7MTMsIDAgPHJlcGVhdHMg MTUgdGltZXM+fX0NCiAgICAgICAgIHRkID0gMHhmZmZmZjgwMDM3NWMxNzgwDQogICAgICAg ICBib290b3B0ID0gPHVuYXZhaWxhYmxlPg0KICAgICAgICAgbmV3cGFuaWMgPSA8b3B0aW1p emVkIG91dD4NCiM0ICAweGZmZmZmZmZmODBiOThjZDMgaW4gcGFuaWMgKGZtdD08dW5hdmFp bGFibGU+KQ0KICAgICBhdCAvdXNyL3NyYy9zeXMva2Vybi9rZXJuX3NodXRkb3duLmM6ODg3 DQogICAgICAgICBhcCA9IHt7Z3Bfb2Zmc2V0ID0gMzIsIGZwX29mZnNldCA9IDQ4LA0KICAg ICAgICAgICAgIG92ZXJmbG93X2FyZ19hcmVhID0gMHhmZmZmZmUwMGM0Nzk3YTgwLA0KICAg ICAgICAgICAgIHJlZ19zYXZlX2FyZWEgPSAweGZmZmZmZTAwYzQ3OTdhMjB9fQ0KIzUgIDB4 ZmZmZmZmZmY4MGNiYWViYyBpbiB2bl9kaXJfbmV4dF9kaXJlbnQgKHZwPTB4ZmZmZmY4MDEw NGQzZGRjMCwNCiAgICAgdGQ9PG9wdGltaXplZCBvdXQ+LCBkaXJidWY9MHhmZmZmZmUwMGM0 NWM5MDAwICJcMDAxIiwNCiAgICAgZGlyYnVmbGVuPTxvcHRpbWl6ZWQgb3V0PiwgZHBwPTB4 ZmZmZmZlMDBjNDc5N2M1OCwgDQpsZW49MHhmZmZmZmUwMGM0Nzk3YzQ4LA0KICAgICBvZmY9 MHhmZmZmZmUwMGM0Nzk3YzQwLCBlb2ZmbGFnPTB4ZmZmZmZlMDBjNDc5N2M2MCkNCiAgICAg YXQgL3Vzci9zcmMvc3lzL2tlcm4vdmZzX3Zub3BzLmM6NDA1OA0KICAgICAgICAgdWlvID0g e3Vpb19pb3YgPSAweGZmZmZmZTAwYzQ3OTdhZTgsIHVpb19pb3ZjbnQgPSAxLCB1aW9fb2Zm c2V0IA0KPSAxMjgsDQogICAgICAgICAgIHVpb19yZXNpZCA9IDM1ODQwLCB1aW9fc2VnZmxn ID0gVUlPX1NZU1NQQUNFLCB1aW9fcncgPSBVSU9fUkVBRCwNCiAgICAgICAgICAgdWlvX3Rk ID0gMHhmZmZmZjgwMDM3NWMxNzgwfQ0KICAgICAgICAgaW92ID0ge2lvdl9iYXNlID0gMHhm ZmZmZmUwMGM0NWM5MDAwLCBpb3ZfbGVuID0gMzU4NDB9DQogICAgICAgICBkcCA9IDB4MA0K ICAgICAgICAgcmVjbGVuID0gPG9wdGltaXplZCBvdXQ+DQogICAgICAgICBlcnJvciA9IDxv cHRpbWl6ZWQgb3V0Pg0KICAgICAgICAgc3VjY2VzcyA9IDxvcHRpbWl6ZWQgb3V0Pg0KIzYg IDB4ZmZmZmZmZmY4MGM4OWJhNSBpbiB2bl9pbm90aWZ5X2FkZF93YXRjaCAodnA9MHhmZmZm ZjgwMTA0ZDNkZGMwLA0KICAgICB2cEBlbnRyeT08ZXJyb3IgcmVhZGluZyB2YXJpYWJsZTog dmFsdWUgaXMgbm90IGF2YWlsYWJsZT4sDQogICAgIHNjPTB4ZmZmZmY4MDAwMzExNTYwMCwN CiAgICAgc2NAZW50cnk9PGVycm9yIHJlYWRpbmcgdmFyaWFibGU6IHZhbHVlIGlzIG5vdCBh dmFpbGFibGU+LCANCm1hc2s9MTY3ODk0NTQsDQogICAgIG1hc2tAZW50cnk9PGVycm9yIHJl YWRpbmcgdmFyaWFibGU6IHZhbHVlIGlzIG5vdCBhdmFpbGFibGU+LA0KICAgICB3ZHA9MHhm ZmZmZmUwMGM0Nzk3ZGQ0LA0KICAgICB3ZHBAZW50cnk9PGVycm9yIHJlYWRpbmcgdmFyaWFi bGU6IHZhbHVlIGlzIG5vdCBhdmFpbGFibGU+LA0KICAgICB0ZD0weGZmZmZmODAwMzc1YzE3 ODAsDQogICAgIHRkQGVudHJ5PTxlcnJvciByZWFkaW5nIHZhcmlhYmxlOiB2YWx1ZSBpcyBu b3QgYXZhaWxhYmxlPikNCiAgICAgYXQgL3Vzci9zcmMvc3lzL2tlcm4vdmZzX2lub3RpZnku Yzo3NDcNCiAgICAgICAgIG5kID0ge25pX2RpcnAgPSAweGZmZmZmZTAwYzQ1YzkwNTggImVm aSIsIG5pX3NlZ2ZsZyA9IFVJT19TWVNTUEFDRSwNCiAgICAgICAgICAgbmlfcmlnaHRzbmVl ZGVkID0gMHhmZmZmZmZmZjgxNGYyMDEwIDxjYXBfbm9fcmlnaHRzPiwNCiAgICAgICAgICAg bmlfc3RhcnRkaXIgPSAweDAsIG5pX3Jvb3RkaXIgPSAweGZmZmZmODAwMDkzOGE4OTgsIG5p X3RvcGRpciANCj0gMHgwLA0KICAgICAgICAgICBuaV9kaXJmZCA9IC0xMDAsIG5pX2xjZiA9 IDAsIG5pX2ZpbGVjYXBzID0ge2ZjX3JpZ2h0cyA9IHsNCiAgICAgICAgICAgICAgIGNyX3Jp Z2h0cyA9IHswLCAwfX0sIGZjX2lvY3RscyA9IDB4MCwgZmNfbmlvY3RscyA9IC0xLA0KICAg ICAgICAgICAgIGZjX2ZjbnRscyA9IDB9LCBuaV92cCA9IDB4ZmZmZmY4MDEwNGQzZGMwOCwN CiAgICAgICAgICAgbmlfZHZwID0gMHhmZmZmZjgwMTA0ZDNkZGMwLCBuaV9yZXNmbGFncyA9 IDAsIG5pX2RlYnVnZmxhZ3MgPSA3LA0KICAgICAgICAgICBuaV9sb29wY250ID0gMCwgbmlf cGF0aGxlbiA9IDEsIG5pX25leHQgPSAweGZmZmZmODAwNzRjOGE0MDMgIiIsDQogICAgICAg ICAgIG5pX2NuZCA9IHtjbl9mbGFncyA9IDg5MjU0Nzg5MTIsIGNuX2NyZWQgPSAweGZmZmZm ODAwMDMxMDBhMDAsDQogICAgICAgICAgICAgY25fbmFtZWlvcCA9IExPT0tVUCwgY25fbGtm bGFncyA9IDIwOTcxNTIsDQogICAgICAgICAgICAgY25fcG5idWYgPSAweGZmZmZmODAwNzRj OGE0MDAgImVmaSIsDQogICAgICAgICAgICAgY25fbmFtZXB0ciA9IDB4ZmZmZmY4MDA3NGM4 YTQwMCAiZWZpIiwgY25fbmFtZWxlbiA9IDN9LA0KICAgICAgICAgICBuaV9jYXBfdHJhY2tl ciA9IHt0cWhfZmlyc3QgPSAweDAsIHRxaF9sYXN0ID0gDQoweGZmZmZmZTAwYzQ3OTdjMDh9 LA0KICAgICAgICAgICBuaV9yYmVuZWF0aF9kcHAgPSAweDAsIG5pX25jdHJhY2tfbW50ID0g MHgwLCBuaV9kdnBfc2VxYyA9IDQ5MywNCiAgICAgICAgICAgbmlfdnBfc2VxYyA9IDB9DQog ICAgICAgICBkcCA9IDB4ZmZmZmZlMDBjNDVjOTA0MA0KICAgICAgICAgb2ZmID0gMTI4DQog ICAgICAgICBsZW4gPSAwDQogICAgICAgICBidWZsZW4gPSAzNTg0MA0KICAgICAgICAgYnVm ID0gMHhmZmZmZmUwMGM0NWM5MDAwICJcMDAxIg0KICAgICAgICAgZW9mID0gMA0KICAgICAg ICAgZXJyb3IgPSAwDQogICAgICAgICB3YXRjaCA9IDxvcHRpbWl6ZWQgb3V0Pg0KICAgICAg ICAgd2F0Y2gxID0gPG9wdGltaXplZCBvdXQ+DQogICAgICAgICB3ZCA9IDxvcHRpbWl6ZWQg b3V0Pg0KIzcgIDB4ZmZmZmZmZmY4MTIzMjFjOSBpbiBWT1BfSU5PVElGWV9BRERfV0FUQ0hf QVBWICh2b3A9PG9wdGltaXplZCBvdXQ+LA0KICAgICBhPWFAZW50cnk9MHhmZmZmZmUwMGM0 Nzk3ZGEwKSBhdCB2bm9kZV9pZi5jOjQ0MTANCiAgICAgICAgIHJjID0gPG9wdGltaXplZCBv dXQ+DQojOCAgMHhmZmZmZmZmZjgwYzhhNTBhIGluIFZPUF9JTk9USUZZX0FERF9XQVRDSCAo dnA9MHhmZmZmZjgwMTA0ZDNkZGMwLA0KICAgICB2cEBlbnRyeT08ZXJyb3IgcmVhZGluZyB2 YXJpYWJsZTogdmFsdWUgaXMgbm90IGF2YWlsYWJsZT4sDQogICAgIHNjPTB4ZmZmZmY4MDAw MzExNTYwMCwNCiAgICAgc2NAZW50cnk9PGVycm9yIHJlYWRpbmcgdmFyaWFibGU6IHZhbHVl IGlzIG5vdCBhdmFpbGFibGU+LCANCm1hc2s9MTY3ODk0NTQsDQogICAgIG1hc2tAZW50cnk9 PGVycm9yIHJlYWRpbmcgdmFyaWFibGU6IHZhbHVlIGlzIG5vdCBhdmFpbGFibGU+LA0KICAg ICB3ZHA9MHhmZmZmZmUwMGM0Nzk3ZGQ0LCB0ZD0weGZmZmZmODAwMzc1YzE3ODAsDQogICAg IHRkQGVudHJ5PTxlcnJvciByZWFkaW5nIHZhcmlhYmxlOiB2YWx1ZSBpcyBub3QgYXZhaWxh YmxlPikNCiAgICAgYXQgLi92bm9kZV9pZi5oOjI1NTINCiAgICAgICAgIGEgPSB7YV9nZW4g PSB7DQogICAgICAgICAgICAgYV9kZXNjID0gMHhmZmZmZmZmZjgxYjg2YWQwIDx2b3BfaW5v dGlmeV9hZGRfd2F0Y2hfZGVzYz59LA0KICAgICAgICAgICBhX3ZwID0gMHhmZmZmZjgwMTA0 ZDNkZGMwLCBhX3NjID0gMHhmZmZmZjgwMDAzMTE1NjAwLA0KICAgICAgICAgICBhX21hc2sg PSAxNjc4OTQ1NCwgYV93ZHAgPSAweGZmZmZmZTAwYzQ3OTdkZDQsDQogICAgICAgICAgIGFf dGQgPSAweGZmZmZmODAwMzc1YzE3ODB9DQojOSAga2Vybl9pbm90aWZ5X2FkZF93YXRjaCAo ZmQ9PHVuYXZhaWxhYmxlPiwNCiAgICAgZmRAZW50cnk9PGVycm9yIHJlYWRpbmcgdmFyaWFi bGU6IHZhbHVlIGlzIG5vdCBhdmFpbGFibGU+LA0KICAgICBkZmQ9PHVuYXZhaWxhYmxlPiwN CiAgICAgZGZkQGVudHJ5PTxlcnJvciByZWFkaW5nIHZhcmlhYmxlOiB2YWx1ZSBpcyBub3Qg YXZhaWxhYmxlPiwNCiAgICAgcGF0aD08dW5hdmFpbGFibGU+LA0KICAgICBwYXRoQGVudHJ5 PTxlcnJvciByZWFkaW5nIHZhcmlhYmxlOiB2YWx1ZSBpcyBub3QgYXZhaWxhYmxlPiwNCiAg ICAgbWFzaz0xNjc4OTQ1NCwNCiAgICAgbWFza0BlbnRyeT08ZXJyb3IgcmVhZGluZyB2YXJp YWJsZTogdmFsdWUgaXMgbm90IGF2YWlsYWJsZT4sDQogICAgIHRkPTB4ZmZmZmY4MDAzNzVj MTc4MCwNCiAgICAgdGRAZW50cnk9PGVycm9yIHJlYWRpbmcgdmFyaWFibGU6IHZhbHVlIGlz IG5vdCBhdmFpbGFibGU+KQ0KICAgICBhdCAvdXNyL3NyYy9zeXMva2Vybi92ZnNfaW5vdGlm eS5jOjkzNQ0KICAgICAgICAgbmQgPSB7DQogICAgICAgICAgIG5pX2RpcnAgPSAweGM0NWJm ODAwMDkwIDxlcnJvcjogQ2Fubm90IGFjY2VzcyBtZW1vcnkgYXQgDQphZGRyZXNzIDB4YzQ1 YmY4MDAwOTA+LCBuaV9zZWdmbGcgPSBVSU9fVVNFUlNQQUNFLA0KICAgICAgICAgICBuaV9y aWdodHNuZWVkZWQgPSAweGZmZmZmZmZmODE0ZjIwMTAgPGNhcF9ub19yaWdodHM+LA0KICAg ICAgICAgICBuaV9zdGFydGRpciA9IDB4MCwgbmlfcm9vdGRpciA9IDB4ZmZmZmY4MDAwOTM4 YTg5OCwgbmlfdG9wZGlyIA0KPSAweDAsDQogICAgICAgICAgIG5pX2RpcmZkID0gLTEwMCwg bmlfbGNmID0gMCwgbmlfZmlsZWNhcHMgPSB7ZmNfcmlnaHRzID0gew0KICAgICAgICAgICAg ICAgY3JfcmlnaHRzID0gezAsIDB9fSwgZmNfaW9jdGxzID0gMHgwLCBmY19uaW9jdGxzID0g LTEsDQogICAgICAgICAgICAgZmNfZmNudGxzID0gMH0sIG5pX3ZwID0gMHhmZmZmZjgwMTA0 ZDNkZGMwLA0KICAgICAgICAgICBuaV9kdnAgPSAweGZmZmZmODAwMDMxNzkzNzAsIG5pX3Jl c2ZsYWdzID0gMSwgbmlfZGVidWdmbGFncyA9IDMsDQogICAgICAgICAgIG5pX2xvb3BjbnQg PSAwLCBuaV9wYXRobGVuID0gMSwNCiAgICAgICAgICAgbmlfbmV4dCA9IDB4ZmZmZmY4MDA3 NGM4YTQwOSANCiJcMzAwXDI1NVwzMzZcMzM2XDMwMFwyNTVcMzM2XDMzNlwzMDBcMjU1XDMz NlwzMzZcMzAwXDI1NVwzMzZcMzM2XDMwMFwyNTVcMzM2XDMzNlwzMDBcMjU1XDMzNlwzMzZc MzAwXDI1NVwzMzZcMzM2XDMwMFwyNTVcMzM2XDMzNlwzMDBcMjU1XDMzNlwzMzZcMzAwXDI1 NVwzMzZcMzM2XDMwMFwyNTVcMzM2XDMzNlwzMDBcMjU1XDMzNlwzMzZcMzAwXDI1NVwzMzZc MzM2XDMwMFwyNTVcMzM2XDMzNlwzMDBcMjU1XDMzNlwzMzZcMzAwXDI1NVwzMzZcMzM2XDMw MFwyNTVcMzM2XDMzNlwzMDBcMjU1XDMzNlwzMzZcMzAwXDI1NVwzMzZcMzM2XDMwMFwyNTVc MzM2XDMzNlwzMDBcMjU1XDMzNlwzMzZcMzAwXDI1NVwzMzZcMzM2XDMwMFwyNTVcMzM2XDMz NlwzMDBcMjU1XDMzNlwzMzZcMzAwXDI1NVwzMzZcMzM2XDMwMFwyNTVcMzM2XDMzNlwzMDBc MjU1XDMzNlwzMzZcMzAwXDI1NVwzMzZcMzM2XDMwMFwyNTVcMzM2XDMzNlwzMDBcMjU1XDMz NlwzMzZcMzAwXDI1NVwzMzZcMzM2XDMwMFwyNTVcMzM2XDMzNlwzMDBcMjU1XDMzNlwzMzZc MzAwXDI1NVwzMzZcMzM2XDMwMFwyNTVcMzM2XDMzNlwzMDBcMjU1XDMzNlwzMzZcMzAwXDI1 NVwzMzZcMzM2XDMwMFwyNTVcMzM2XDMzNlwzMDBcMjU1XDMzNlwzMzZcMzAwXDI1NVwzMzZc MzM2XDMwMFwyNTVcMzM2XDMzNlwzMDBcMjU1XDMzNlwzMzZcMzAwXDI1NVwzMzZcMzM2XDMw MFwyNTVcMzM2XDMzNlwzMDBcMjU1XDMzNlwzMzZcMzAwXDI1NVwzMzZcMzM2XDMwMFwyNTVc MzM2XDMzNlwzMDBcMjU1XDMzNlwzMzZcMzAwXDI1NVwzMzZcMzM2XDMwMFwyNTVcMzM2Iiwg DQo8aW5jb21wbGV0ZSBzZXF1ZW5jZSBcMzM2Pi4uLiwNCiAgICAgICAgICAgbmlfY25kID0g e2NuX2ZsYWdzID0gODkyNTc0MTM4MCwgY25fY3JlZCA9IDB4ZmZmZmY4MDAwMzEwMGEwMCwN CiAgICAgICAgICAgICBjbl9uYW1laW9wID0gTE9PS1VQLCBjbl9sa2ZsYWdzID0gMjA5NzE1 MiwgY25fcG5idWYgPSAweDAsDQogICAgICAgICAgICAgY25fbmFtZXB0ciA9IDB4ZmZmZmY4 MDA3NGM4YTQwNiANCiJcMjU1XDMzNlwzMzZcMzAwXDI1NVwzMzZcMzM2XDMwMFwyNTVcMzM2 XDMzNlwzMDBcMjU1XDMzNlwzMzZcMzAwXDI1NVwzMzZcMzM2XDMwMFwyNTVcMzM2XDMzNlwz MDBcMjU1XDMzNlwzMzZcMzAwXDI1NVwzMzZcMzM2XDMwMFwyNTVcMzM2XDMzNlwzMDBcMjU1 XDMzNlwzMzZcMzAwXDI1NVwzMzZcMzM2XDMwMFwyNTVcMzM2XDMzNlwzMDBcMjU1XDMzNlwz MzZcMzAwXDI1NVwzMzZcMzM2XDMwMFwyNTVcMzM2XDMzNlwzMDBcMjU1XDMzNlwzMzZcMzAw XDI1NVwzMzZcMzM2XDMwMFwyNTVcMzM2XDMzNlwzMDBcMjU1XDMzNlwzMzZcMzAwXDI1NVwz MzZcMzM2XDMwMFwyNTVcMzM2XDMzNlwzMDBcMjU1XDMzNlwzMzZcMzAwXDI1NVwzMzZcMzM2 XDMwMFwyNTVcMzM2XDMzNlwzMDBcMjU1XDMzNlwzMzZcMzAwXDI1NVwzMzZcMzM2XDMwMFwy NTVcMzM2XDMzNlwzMDBcMjU1XDMzNlwzMzZcMzAwXDI1NVwzMzZcMzM2XDMwMFwyNTVcMzM2 XDMzNlwzMDBcMjU1XDMzNlwzMzZcMzAwXDI1NVwzMzZcMzM2XDMwMFwyNTVcMzM2XDMzNlwz MDBcMjU1XDMzNlwzMzZcMzAwXDI1NVwzMzZcMzM2XDMwMFwyNTVcMzM2XDMzNlwzMDBcMjU1 XDMzNlwzMzZcMzAwXDI1NVwzMzZcMzM2XDMwMFwyNTVcMzM2XDMzNlwzMDBcMjU1XDMzNlwz MzZcMzAwXDI1NVwzMzZcMzM2XDMwMFwyNTVcMzM2XDMzNlwzMDBcMjU1XDMzNlwzMzZcMzAw XDI1NVwzMzZcMzM2XDMwMFwyNTVcMzM2XDMzNlwzMDBcMjU1XDMzNlwzMzZcMzAwXDI1NVwz MzZcMzM2XDMwMFwyNTVcMzM2XDMzNlwzMDBcMjU1XDMzNlwzMzZcMzAwXDI1NVwzMzZcMzM2 XDMwMCIuLi4sIA0KY25fbmFtZWxlbiA9IDN9LA0KICAgICAgICAgICBuaV9jYXBfdHJhY2tl ciA9IHt0cWhfZmlyc3QgPSAweDAsIHRxaF9sYXN0ID0gDQoweGZmZmZmZTAwYzQ3OTdkNzB9 LA0KICAgICAgICAgICBuaV9yYmVuZWF0aF9kcHAgPSAweDAsIG5pX25jdHJhY2tfbW50ID0g MHgwLCBuaV9kdnBfc2VxYyA9IDAsDQogICAgICAgICAgIG5pX3ZwX3NlcWMgPSAwfQ0KICAg ICAgICAgd2QgPSAyDQogICAgICAgICBmcCA9IDB4ZmZmZmY4MDAzNzU3ZDIzMA0KICAgICAg ICAgdnAgPSAweGZmZmZmODAxMDRkM2RkYzANCiAgICAgICAgIGVycm9yID0gPG9wdGltaXpl ZCBvdXQ+DQogICAgICAgICBzYyA9IDB4ZmZmZmY4MDAwMzExNTYwMA0KICAgICAgICAgY291 bnQgPSA8b3B0aW1pemVkIG91dD4NCiMxMCAweGZmZmZmZmZmODExNjk5OGUgaW4gc3lzY2Fs bGVudGVyICh0ZD0weGZmZmZmODAwMzc1YzE3ODApDQogICAgIGF0IC91c3Ivc3JjL3N5cy9h bWQ2NC9hbWQ2NC8uLi8uLi9rZXJuL3N1YnJfc3lzY2FsbC5jOjE5Mw0KICAgICAgICAgc2Ug PSAweGZmZmZmZmZmODFhYzgzZjAgPHN5c2VudCsxODk3Nj4NCiAgICAgICAgIHAgPSAweGZm ZmZmZTAwODMxNTE1YzANCiAgICAgICAgIHNhID0gMHhmZmZmZjgwMDM3NWMxYjk4DQogICAg ICAgICBlcnJvciA9IDxvcHRpbWl6ZWQgb3V0Pg0KICAgICAgICAgc3lfdGhyX3N0YXRpYyA9 IHRydWUNCiAgICAgICAgIHRyYWNlZCA9IDxvcHRpbWl6ZWQgb3V0Pg0KICAgICAgICAgX2F1 ZGl0X2VudGVyZWQgPSA8b3B0aW1pemVkIG91dD4NCiMxMSBhbWQ2NF9zeXNjYWxsICh0ZD0w eGZmZmZmODAwMzc1YzE3ODAsIHRyYWNlZD0wKQ0KICAgICBhdCAvdXNyL3NyYy9zeXMvYW1k NjQvYW1kNjQvdHJhcC5jOjEyMTUNCiAgICAgICAgIGtzaSA9IHtrc2lfbGluayA9IHt0cWVf bmV4dCA9IDB4ZmZmZmY4MDAzNzVjMTc4MCwNCiAgICAgICAgICAgICB0cWVfcHJldiA9IDB4 ZmZmZmZmZmY4MzE2ZDQwMH0sIGtzaV9pbmZvID0gew0KICAgICAgICAgICAgIHNpX3NpZ25v ID0gLTIxMjc5Njc3MTUsIHNpX2Vycm5vID0gLTEsIHNpX2NvZGUgPSA5Mjg3ODIyMDgsDQog ICAgICAgICAgICAgc2lfcGlkID0gLTIwNDgsIHNpX3VpZCA9IDIxOTkzMTEzNjAsIHNpX3N0 YXR1cyA9IC0xLA0KICAgICAgICAgICAgIHNpX2FkZHIgPSAweGZmZmZmZmZmMDAwMDAwMDAs IHNpX3ZhbHVlID0ge3NpdmFsX2ludCA9IDAsDQogICAgICAgICAgICAgICBzaXZhbF9wdHIg PSAweDYwMTAwMDAwMDAwLCBzaWd2YWxfaW50ID0gMCwNCiAgICAgICAgICAgICAgIHNpZ3Zh bF9wdHIgPSAweDYwMTAwMDAwMDAwfSwgX3JlYXNvbiA9IHtfZmF1bHQgPSB7DQogICAgICAg ICAgICAgICAgIF90cmFwbm8gPSAxNTM3fSwgX3RpbWVyID0ge190aW1lcmlkID0gMTUzNywg X292ZXJydW4gPSAwfSwNCiAgICAgICAgICAgICAgIF9tZXNncSA9IHtfbXFkID0gMTUzN30s IF9wb2xsID0ge19iYW5kID0gMTUzN30sIF9jYXBzaWN1bSA9IHsNCiAgICAgICAgICAgICAg ICAgX3N5c2NhbGwgPSAxNTM3fSwgX19zcGFyZV9fID0ge19fc3BhcmUxX18gPSAxNTM3LA0K ICAgICAgICAgICAgICAgICBfX3NwYXJlMl9fID0gezAsIDAsIC0xMDgyMTI0NzY4LCAzMTQx LCA5Mjg3ODIyMDgsIC0yMDQ4LA0KICAgICAgICAgICAgICAgICAgIDF9fX19LCBrc2lfZmxh Z3MgPSAtOTk4NjcwNzA0LCBrc2lfc2lncSA9IDB4NDZ9DQojMTIgPHNpZ25hbCBoYW5kbGVy IGNhbGxlZD4NCk5vIGxvY2Fscy4NCiMxMyAweDAwMDAwMDA4MmM0ZDI5YWEgaW4gPz8gKCkN Ck5vIHN5bWJvbCB0YWJsZSBpbmZvIGF2YWlsYWJsZS4NCkJhY2t0cmFjZSBzdG9wcGVkOiBD YW5ub3QgYWNjZXNzIG1lbW9yeSBhdCBhZGRyZXNzIDB4ODMxNzQ2ODE4DQooa2dkYikgL3Vz ci9saWJleGVjL2tnZGIvYWN0dHJhY2UucHk6ODogRXJyb3IgaW4gc291cmNlZCBjb21tYW5k IGZpbGU6DQpVbmRlZmluZWQgY29tbWFuZDogImltcG9ydCIuICBUcnkgImhlbHAiLg0KKGtn ZGIpIFVuZGVmaW5lZCBjb21tYW5kOiAiYWN0dHJhY2UiLiAgVHJ5ICJoZWxwIi4NCihrZ2Ri KQ0KDQpUaGVyZSBpcyBhbHNvIGEgZmxvb2Qgb2YgImZzdGF0OiB6bm9kZV90IHNpemUgbWlz bWF0Y2gsIGRhdGEgY291bGQgYmUgDQp3cm9uZyIgaW4gdGhhdCBwb3J0aW9uIG9mIHRoZSBk dW1wLg0KDQotLSANCkNoYXJsaWUgTGkNCi4uLm5vcGUsIHN0aWxsIGRvbid0IGhhdmUgYW4g ZXhpdCBsaW5lLg0KDQo= --------------xUtkXr0K6mUW7RFH7YGv5QTA-- --------------CWWw7Mfv2fBZ9PfjZZk0Yuj6 Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature.asc" -----BEGIN PGP SIGNATURE----- wnsEABYIACMWIQTHxcCLnAXo3rFg6k7P+1cn7slqBAUCaHOuJAUDAAAAAAAKCRDP+1cn7slqBDGe AQCoVNYrnd7SOAVWSfWkIZhZrNk6qGKRCcOJ87K4CDOtigD/SlxPfxiv8Y4tMfb1XdstnbM2f4OR +WNdZUseQfKkfgk= =wzSH -----END PGP SIGNATURE----- --------------CWWw7Mfv2fBZ9PfjZZk0Yuj6-- From nobody Sun Jul 13 13:11:39 2025 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 4bg5SX2bKLz60xPq; Sun, 13 Jul 2025 13:11:40 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bg5SW6sJjz3NJc; Sun, 13 Jul 2025 13:11:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752412300; 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=F6b+aD/rVL5gPek3FevQdstL/h2zqSbNQ8y98RXH+Lw=; b=Kz7gs72mEAFxlAEHaR3YwPxA6PC/Mf9VGw6a1vTzXW0KiX1dyjKES40Qf/huQd+PFdNw9N bHiT6xyabzRwR518crJ1AK3UVmZ8wILW7cTk4ZFWsfeEB7lMikfK0riR/Rwf8Uf+tK15Ot RnRUMgLypzWw3PJ/MX/UMu2Ihba1H/jNcJ6PLTY3iz5FONtw3hZpHoWsr2/t+gXOE8TfqN cyKsMoR94EmOgCd/L+xYs1oUR77577wsj33K/D20WIeriuOyWj13HOZrMXqM68qsrS4hYq IWi3rXU585lHTWnah3smDHkcqUttjFBwYs2m5pIfh4Z/rg7e6CKcYXo6eBVEUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752412300; 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=F6b+aD/rVL5gPek3FevQdstL/h2zqSbNQ8y98RXH+Lw=; b=fjvpEo8gZ4wtr7qqugxQenWuMPbex+uRshG2vxW/h3zw+ygtDm44iTfdeIh2rcgl9VUIEG tRnPIWfq5b19GuaT9Y9YNLhtGo+GOyKE91cW6fGOEFe4l7+KgpoCfY/1vXPh0UAQYjiKCx fOT9cW/nS/AAd0zkcZbEBn9Rgs75v7PNyXWCG5GaWLvJtJyyjDgySV7/9a5D/HHV7WseXQ WjKos+pYoxaV9EICm+xDFFyDc2hx5Asxg/RcrQodT0OLE6/JamosQTal9mxTAfJmKiV8KS i/Qo3DIcoG1fD3fLGjF2Lp/BbH+u2QIOzD2senB2/Nzn4fOKbjfqTvkENpaSYQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752412300; a=rsa-sha256; cv=none; b=wwMeRjUBmPcFN4viqYGi2+58mOK0rONla6D9zNyqZ3rzshiV6roeh6cPHu5VC/iPijM3oD fo64MnXrO8CoXGiT0qLC8D53jSEK6/wNBQP6iRc7BHWuJFn7FuWiZoY3v+NTdPF6ViLzCn lDMyf+NwaAFm5rNdvaTlWs+JtPy/o8gAICoAxAAijZ1i2yTHTN/qJ7aHZIWQLLuR0WQGMh IZG4kLaShX8Lr1EwDFh/YoTKuL8wYXjC8NNxqwPABsY0ZUrg/oJK9zfeJyCCbksqvy4DaV qDzE3VqBA+o0PLiR3Y3FOyRp6tEeV5t0mhwH9CojJ3xr66uJTyO7oZm3xrCuXw== 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 4bg5SW57N1z18bf; Sun, 13 Jul 2025 13:11:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56DDBdY8056447; Sun, 13 Jul 2025 13:11:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56DDBdFX056444; Sun, 13 Jul 2025 13:11:39 GMT (envelope-from git) Date: Sun, 13 Jul 2025 13:11:39 GMT Message-Id: <202507131311.56DDBdFX056444@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kajetan Staszkiewicz Subject: git: c46bf1e3c9c5 - main - pf tests: Add jail configuration for route_to and ipv6-nexthop 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c46bf1e3c9c5bb652f9c23117008f920bfb37b94 Auto-Submitted: auto-generated The branch main has been updated by ks: URL: https://cgit.FreeBSD.org/src/commit/?id=c46bf1e3c9c5bb652f9c23117008f920bfb37b94 commit c46bf1e3c9c5bb652f9c23117008f920bfb37b94 Author: Kajetan Staszkiewicz AuthorDate: 2025-06-09 15:26:57 +0000 Commit: Kajetan Staszkiewicz CommitDate: 2025-07-13 13:11:18 +0000 pf tests: Add jail configuration for route_to and ipv6-nexthop tests Maybe it could later replace previous IPv4 and IPv6 jail configurations. Reviewed by: kp Approved by: kp Sponsored by: InnoGames GmbH Differential Revision: https://reviews.freebsd.org/D50764 --- tests/sys/netpfil/pf/utils.subr | 101 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) diff --git a/tests/sys/netpfil/pf/utils.subr b/tests/sys/netpfil/pf/utils.subr index 6af10e80390d..3f8d437920f9 100644 --- a/tests/sys/netpfil/pf/utils.subr +++ b/tests/sys/netpfil/pf/utils.subr @@ -274,6 +274,107 @@ setup_router_server_ipv6() jexec server inetd -p ${PWD}/inetd.pid $inetd_conf } +# Create a router and 2 server jails for nat64 and rfc5549 test cases. +# The router is connected to servers, both are dual-stack, and to the +# tester jail. All links are dual stack. +setup_router_server_nat64() +{ + pft_init + + epair_tester=$(vnet_mkepair) + epair_server1=$(vnet_mkepair) + epair_server2=$(vnet_mkepair) + + # Funny how IPv4 address space is to small to even assign nice /24 + # prefixes on all needed networks. On IPv6 we have a separate /64 for + # each link, loopback server, and client/SNAT pool. On IPv4 we must + # use small /28 prefixes, so even though we define all networks + # as variables we can't easily use them in tests if additional addresses + # are needed. + + # IP addresses which can be used by the tester jail. + # Can be used as SNAT or as source with pft_ping.py. It is up to + # the test code to make them accessible from router. + net_clients_4=203.0.113 + net_clients_4_mask=24 + net_clients_6=2001:db8:44 + net_clients_6_mask=64 + + # IP addresses on loopback interfaces of both servers. They can be + # accessed using the route-to targtet. + host_server_4=192.0.2.100 + host_server_6=2001:db8:4203::100 + + net_tester_4=198.51.100 + net_tester_4_mask=28 + net_tester_4_host_router=198.51.100.1 + net_tester_4_host_tester=198.51.100.2 + + net_tester_6=2001:db8:4200 + net_tester_6_mask=64 + net_tester_6_host_router=2001:db8:4200::1 + net_tester_6_host_tester=2001:db8:4200::2 + + net_server1_4=198.51.100 + net_server1_4_mask=28 + net_server1_4_host_router=198.51.100.17 + net_server1_4_host_server=198.51.100.18 + + net_server1_6=2001:db8:4201 + net_server1_6_mask=64 + net_server1_6_host_router=2001:db8:4201::1 + net_server1_6_host_server=2001:db8:4201::2 + + net_server2_4=198.51.100 + net_server2_4_mask=28 + net_server2_4_host_router=198.51.100.33 + net_server2_4_host_server=198.51.100.34 + + net_server2_6=2001:db8:4202 + net_server2_6_mask=64 + net_server2_6_host_router=2001:db8:4202::1 + net_server2_6_host_server=2001:db8:4202::2 + + vnet_mkjail router ${epair_tester}b ${epair_server1}a ${epair_server2}a + jexec router ifconfig ${epair_tester}b inet ${net_tester_4_host_router}/${net_tester_4_mask} up + jexec router ifconfig ${epair_tester}b inet6 ${net_tester_6_host_router}/${net_tester_6_mask} up no_dad + jexec router ifconfig ${epair_server1}a inet ${net_server1_4_host_router}/${net_server1_4_mask} up + jexec router ifconfig ${epair_server1}a inet6 ${net_server1_6_host_router}/${net_server1_6_mask} up no_dad + jexec router ifconfig ${epair_server2}a inet ${net_server2_4_host_router}/${net_server2_4_mask} up + jexec router ifconfig ${epair_server2}a inet6 ${net_server2_6_host_router}/${net_server2_6_mask} up no_dad + jexec router sysctl net.inet.ip.forwarding=1 + jexec router sysctl net.inet6.ip6.forwarding=1 + jexec router pfctl -e + + ifconfig ${epair_tester}a inet ${net_tester_4_host_tester}/${net_tester_4_mask} up + ifconfig ${epair_tester}a inet6 ${net_tester_6_host_tester}/${net_tester_6_mask} up no_dad + route add 0.0.0.0/0 ${net_tester_4_host_router} + route add -6 ::/0 ${net_tester_6_host_router} + + inetd_conf=$(mktemp) + echo "discard stream tcp46 nowait root internal" >> $inetd_conf + + vnet_mkjail server1 ${epair_server1}b + jexec server1 /etc/rc.d/netif start lo0 + jexec server1 ifconfig ${epair_server1}b inet ${net_server1_4_host_server}/${net_server1_4_mask} up + jexec server1 ifconfig ${epair_server1}b inet6 ${net_server1_6_host_server}/${net_server1_6_mask} up no_dad + jexec server1 ifconfig lo0 ${host_server_4}/32 alias + jexec server1 ifconfig lo0 inet6 ${host_server_6}/128 alias + jexec server1 inetd -p ${PWD}/inetd_1.pid $inetd_conf + jexec server1 route add 0.0.0.0/0 ${net_server1_4_host_router} + + jexec server1 route add -6 ::/0 ${net_server1_6_host_router} + vnet_mkjail server2 ${epair_server2}b + jexec server2 /etc/rc.d/netif start lo0 + jexec server2 ifconfig ${epair_server2}b inet ${net_server2_4_host_server}/${net_server2_4_mask} up + jexec server2 ifconfig ${epair_server2}b inet6 ${net_server2_6_host_server}/${net_server2_6_mask} up no_dad + jexec server2 ifconfig lo0 ${host_server_4}/32 alias + jexec server2 ifconfig lo0 inet6 ${host_server_6}/128 alias + jexec server2 inetd -p ${PWD}/inetd_2.pid $inetd_conf + jexec server2 route add 0.0.0.0/0 ${net_server2_4_host_router} + jexec server2 route add -6 ::/0 ${net_server2_6_host_router} +} + # Ping the dummy static NDP target. # Check for pings being forwarded through the router towards the target. ping_dummy_check_request() From nobody Sun Jul 13 13:11:40 2025 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 4bg5SY6s5vz60xV2; Sun, 13 Jul 2025 13:11:41 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bg5SX6D7xz3N0g; Sun, 13 Jul 2025 13:11:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752412300; 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=tyVjDyCAgBZrcJYrva5yP16/ICYNO56XKxcNiQ7tlzw=; b=cPFFv6QXXzcSxQkShxckFJu2eXiGM1akanr66+KMZYN1PNhHgu5KVQMD/q3nACFm8rl3nA TyUz/4sCOMCZyuaipnEuCis/w/EAN5oWS1Lz02OiWerxlLie+YMJLLdjJRNoUmXx5dkjFF UOiyHq14YpXbDABVYFDp5YEAL8ids4q7GVW+HNr+McPtRAoZIKeTCBbOogf40nC3ZGEFgH C4sRy1fEWg0rQUwwQ08/BGmF2WRvLL5RhHr2tholAibsVLudFqkE8moqwi77c3eAg7SiM9 cQVlK3Onqmte1wp2K6FwujCFBawJeAL8Z46jKUc0tAsjhboTIDYMa+qygnFo6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752412300; 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=tyVjDyCAgBZrcJYrva5yP16/ICYNO56XKxcNiQ7tlzw=; b=Ss05zfCJQIn/qbIJAqLhhGTbmpmX1AiAYOaBhuqWTXc7x3rOsQGVWEpNaR9ISlA/PGiR4R B0pYfUq1UYK9+VZ8REeD9Ec0yVqwFndg2ocCbVZSMt5pbJyqG9zrmdfjzqhzUj9BDNZDVJ lyRjFZJ5PBPmpuJQkIFr/6Py6qbTIejk8SPMdIzoV/bdHmNqy9wBj52CHHsSm+ErDqEqTH yMzo9fRvL53bMDkADJlQxvKM2V0V1jA6vI9ox9vXYJU2YMVI8qCu9NGSwZDoiVrCT8a90K 1wF0r28sCDeSkehT18OUpCbW60HG7gPyFSs3RFGL4jXOjtKCzDhh0M+VsaRkRA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752412300; a=rsa-sha256; cv=none; b=uapmT2lAi2ksn61UJ3xrSdiCoFWGn0P2J7Y0wl4ZfR/ajoniZAUpjRm83i6wT1GxnOa14K WdkYPYe7uVpy5TlWakr955cbt2HAuzsc6Qbacm59nQhqSLN6cNYOILBafVs9x4CYXfIWyU AdZuV2kgMz79k9BXIWpSwsTlviXe49r48hT7HyXOBn8zsgeLswkjPMVymQMY983DuQCol3 pKGBqvQtKFIJvvBZ+omwV3Xm7eHWzbYCysioPK82D8PuoZB3goE3sgkRIHKpOtMyQ/TM7i rlub4GtUgQBoRvZZkES2ADjNeyOOVgX6J77cthXG4FHHWsSsnDtgrrbE9d5SZQ== 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 4bg5SX5plHz18TJ; Sun, 13 Jul 2025 13:11:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56DDBe9k056481; Sun, 13 Jul 2025 13:11:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56DDBeOq056478; Sun, 13 Jul 2025 13:11:40 GMT (envelope-from git) Date: Sun, 13 Jul 2025 13:11:40 GMT Message-Id: <202507131311.56DDBeOq056478@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kajetan Staszkiewicz Subject: git: 04dcbb44340f - main - pf: Prevent infinite looping over tables in round-robin pools 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 04dcbb44340f3e42b130282112e9f741fccffc9f Auto-Submitted: auto-generated The branch main has been updated by ks: URL: https://cgit.FreeBSD.org/src/commit/?id=04dcbb44340f3e42b130282112e9f741fccffc9f commit 04dcbb44340f3e42b130282112e9f741fccffc9f Author: Kajetan Staszkiewicz AuthorDate: 2025-06-10 14:22:43 +0000 Commit: Kajetan Staszkiewicz CommitDate: 2025-07-13 13:11:21 +0000 pf: Prevent infinite looping over tables in round-robin pools In FreeBSD each redirection pool (struct pf_kpool) consists of multiple hosts (struct pf_addr_wrap). In OpenBSD that is not the case, and a round-robin pool having a table as a host loops infinitely only over that single table. In FreeBSD once all addresses from a table are returned the pool must iterate to the next host. Add a custom flag to have pfr_pool_get() break its loop once it reaches the last index. Use this flag in round-robin pools. When changing pool's host set index to 0 to always start iterating each table from beginning. Reviewed by: kp Approved by: kp Sponsored by: InnoGames GmbH Differential Revision: https://reviews.freebsd.org/D50779 --- sys/net/pfvar.h | 2 +- sys/netpfil/pf/pf_lb.c | 16 ++++---- sys/netpfil/pf/pf_table.c | 4 +- tests/sys/netpfil/pf/route_to.sh | 82 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 94 insertions(+), 10 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 8ee4d00daaff..1f2011634695 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -2500,7 +2500,7 @@ int pfr_match_addr(struct pfr_ktable *, struct pf_addr *, sa_family_t); void pfr_update_stats(struct pfr_ktable *, struct pf_addr *, sa_family_t, u_int64_t, int, int, int); int pfr_pool_get(struct pfr_ktable *, int *, struct pf_addr *, sa_family_t, - pf_addr_filter_func_t); + pf_addr_filter_func_t, bool); void pfr_dynaddr_update(struct pfr_ktable *, struct pfi_dynaddr *); struct pfr_ktable * pfr_attach_table(struct pf_kruleset *, char *); diff --git a/sys/netpfil/pf/pf_lb.c b/sys/netpfil/pf/pf_lb.c index 9db1d88ce52e..26f7ab41eef4 100644 --- a/sys/netpfil/pf/pf_lb.c +++ b/sys/netpfil/pf/pf_lb.c @@ -617,7 +617,7 @@ pf_map_addr(sa_family_t af, struct pf_krule *r, struct pf_addr *saddr, rpool->tblidx = (int)arc4random_uniform(cnt); memset(&rpool->counter, 0, sizeof(rpool->counter)); if (pfr_pool_get(kt, &rpool->tblidx, &rpool->counter, - af, pf_islinklocal)) { + af, pf_islinklocal, false)) { reason = PFRES_MAPFAILED; goto done_pool_mtx; /* unsupported */ } @@ -684,7 +684,7 @@ pf_map_addr(sa_family_t af, struct pf_krule *r, struct pf_addr *saddr, rpool->tblidx = (int)(hashidx % cnt); memset(&rpool->counter, 0, sizeof(rpool->counter)); if (pfr_pool_get(kt, &rpool->tblidx, &rpool->counter, - af, pf_islinklocal)) { + af, pf_islinklocal, false)) { reason = PFRES_MAPFAILED; goto done_pool_mtx; /* unsupported */ } @@ -701,11 +701,12 @@ pf_map_addr(sa_family_t af, struct pf_krule *r, struct pf_addr *saddr, if (rpool->cur->addr.type == PF_ADDR_TABLE) { if (!pfr_pool_get(rpool->cur->addr.p.tbl, - &rpool->tblidx, &rpool->counter, af, NULL)) + &rpool->tblidx, &rpool->counter, af, NULL, true)) goto get_addr; } else if (rpool->cur->addr.type == PF_ADDR_DYNIFTL) { if (!pfr_pool_get(rpool->cur->addr.p.dyn->pfid_kt, - &rpool->tblidx, &rpool->counter, af, pf_islinklocal)) + &rpool->tblidx, &rpool->counter, af, pf_islinklocal, + true)) goto get_addr; } else if (pf_match_addr(0, raddr, rmask, &rpool->counter, af)) goto get_addr; @@ -715,9 +716,10 @@ pf_map_addr(sa_family_t af, struct pf_krule *r, struct pf_addr *saddr, rpool->cur = TAILQ_FIRST(&rpool->list); else rpool->cur = TAILQ_NEXT(rpool->cur, entries); + rpool->tblidx = -1; if (rpool->cur->addr.type == PF_ADDR_TABLE) { if (pfr_pool_get(rpool->cur->addr.p.tbl, - &rpool->tblidx, &rpool->counter, af, NULL)) { + &rpool->tblidx, &rpool->counter, af, NULL, true)) { /* table contains no address of type 'af' */ if (rpool->cur != acur) goto try_next; @@ -725,9 +727,9 @@ pf_map_addr(sa_family_t af, struct pf_krule *r, struct pf_addr *saddr, goto done_pool_mtx; } } else if (rpool->cur->addr.type == PF_ADDR_DYNIFTL) { - rpool->tblidx = -1; if (pfr_pool_get(rpool->cur->addr.p.dyn->pfid_kt, - &rpool->tblidx, &rpool->counter, af, pf_islinklocal)) { + &rpool->tblidx, &rpool->counter, af, pf_islinklocal, + true)) { /* table contains no address of type 'af' */ if (rpool->cur != acur) goto try_next; diff --git a/sys/netpfil/pf/pf_table.c b/sys/netpfil/pf/pf_table.c index 2034f4422ef1..e3f3ab9025f7 100644 --- a/sys/netpfil/pf/pf_table.c +++ b/sys/netpfil/pf/pf_table.c @@ -2294,7 +2294,7 @@ pfr_detach_table(struct pfr_ktable *kt) int pfr_pool_get(struct pfr_ktable *kt, int *pidx, struct pf_addr *counter, - sa_family_t af, pf_addr_filter_func_t filter) + sa_family_t af, pf_addr_filter_func_t filter, bool loop_once) { struct pf_addr *addr, cur, mask, umask_addr; union sockaddr_union uaddr, umask; @@ -2339,7 +2339,7 @@ _next_block: ke = pfr_kentry_byidx(kt, idx, af); if (ke == NULL) { /* we don't have this idx, try looping */ - if (loop || (ke = pfr_kentry_byidx(kt, 0, af)) == NULL) { + if ((loop || loop_once) || (ke = pfr_kentry_byidx(kt, 0, af)) == NULL) { pfr_kstate_counter_add(&kt->pfrkt_nomatch, 1); return (1); } diff --git a/tests/sys/netpfil/pf/route_to.sh b/tests/sys/netpfil/pf/route_to.sh index 91c12c8ce2ae..fd1653cce311 100644 --- a/tests/sys/netpfil/pf/route_to.sh +++ b/tests/sys/netpfil/pf/route_to.sh @@ -893,6 +893,87 @@ empty_pool_cleanup() } +atf_test_case "table_loop" "cleanup" + +table_loop_head() +{ + atf_set descr 'Check that iterating over tables poperly loops' + atf_set require.user root +} + +table_loop_body() +{ + setup_router_server_nat64 + + # Clients will connect from another network behind the router. + # This allows for using multiple source addresses. + jexec router route add -6 ${net_clients_6}::/${net_clients_6_mask} ${net_tester_6_host_tester} + jexec router route add ${net_clients_4}.0/${net_clients_4_mask} ${net_tester_4_host_tester} + + # The servers are reachable over additional IP addresses for + # testing of tables and subnets. The addresses are noncontinougnus + # for pf_map_addr() counter tests. + for i in 0 1 4 5; do + a1=$((24 + i)) + jexec server1 ifconfig ${epair_server1}b inet ${net_server1_4}.${a1}/32 alias + jexec server1 ifconfig ${epair_server1}b inet6 ${net_server1_6}::42:${i}/128 alias + a2=$((40 + i)) + jexec server2 ifconfig ${epair_server2}b inet ${net_server2_4}.${a2}/32 alias + jexec server2 ifconfig ${epair_server2}b inet6 ${net_server2_6}::42:${i}/128 alias + done + + jexec router pfctl -e + pft_set_rules router \ + "set debug loud" \ + "set reassemble yes" \ + "set state-policy if-bound" \ + "table { ${net_server1_6}::42:4/127 ${net_server1_6}::42:0/127 }" \ + "table { ${net_server2_6}::42:4/127 }" \ + "pass in on ${epair_tester}b \ + route-to { \ + (${epair_server1}a ) \ + (${epair_server2}a ) \ + (${epair_server2}a ) \ + } \ + inet6 proto tcp \ + keep state" + + # Both hosts of the pool are tables. Each table gets iterated over once, + # then the pool iterates to the next host, which is also iterated, + # then the pool loops back to the 1st host. If an empty table is found, + # it is skipped. Unless that's the only table, that is tested by + # the "empty_pool" test. + for port in $(seq 1 7); do + port=$((4200 + port)) + atf_check -s exit:0 ${common_dir}/pft_ping.py \ + --sendif ${epair_tester}a --replyif ${epair_tester}a \ + --fromaddr ${net_clients_6}::1 --to ${host_server_6} \ + --ping-type=tcp3way --send-sport=${port} + done + + states=$(mktemp) || exit 1 + jexec router pfctl -qvvss | normalize_pfctl_s > $states + cat $states + + for state_regexp in \ + "${epair_tester}b tcp ${host_server_6}\[9\] <- ${net_clients_6}::1\[4201\] .* route-to: ${net_server1_6}::42:0@${epair_server1}a" \ + "${epair_tester}b tcp ${host_server_6}\[9\] <- ${net_clients_6}::1\[4202\] .* route-to: ${net_server1_6}::42:1@${epair_server1}a" \ + "${epair_tester}b tcp ${host_server_6}\[9\] <- ${net_clients_6}::1\[4203\] .* route-to: ${net_server1_6}::42:4@${epair_server1}a" \ + "${epair_tester}b tcp ${host_server_6}\[9\] <- ${net_clients_6}::1\[4204\] .* route-to: ${net_server1_6}::42:5@${epair_server1}a" \ + "${epair_tester}b tcp ${host_server_6}\[9\] <- ${net_clients_6}::1\[4205\] .* route-to: ${net_server2_6}::42:4@${epair_server2}a" \ + "${epair_tester}b tcp ${host_server_6}\[9\] <- ${net_clients_6}::1\[4206\] .* route-to: ${net_server2_6}::42:5@${epair_server2}a" \ + "${epair_tester}b tcp ${host_server_6}\[9\] <- ${net_clients_6}::1\[4207\] .* route-to: ${net_server1_6}::42:0@${epair_server1}a" \ + ; do + grep -qE "${state_regexp}" $states || atf_fail "State not found for '${state_regexp}'" + done +} + +table_loop_cleanup() +{ + pft_cleanup +} + + atf_init_test_cases() { atf_add_test_case "v4" @@ -912,4 +993,5 @@ atf_init_test_cases() atf_add_test_case "sticky" atf_add_test_case "ttl" atf_add_test_case "empty_pool" + atf_add_test_case "table_loop" } From nobody Sun Jul 13 13:46:57 2025 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 4bg6FQ6VkRz610SG; Sun, 13 Jul 2025 13:47:06 +0000 (UTC) (envelope-from olce@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bg6FQ3vBQz3kHg; Sun, 13 Jul 2025 13:47:06 +0000 (UTC) (envelope-from olce@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752414426; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=VEKagoPUawdf52LP6cnqf+sfAWhNeZLYjtGK/f7CTyQ=; b=SMNdjMvEa7DSAinw09M0ApnT/A8WsBAHMvrdNOSe+5zriyjmz0Cz5tDfNGs21tV+fCYmqD 6G0pL7HdEcXgSk/MP6XbgssvbculXWayhlb62JEtwtlvamDIHKTb7qo/NrOeI8uKluwzwe jeZjxE3q3YP0KPSAPIfUU1KpTdonWIhDaOz832B6LinWtMfm05N9LtepYIh6giZSMtg2pV glesahPl2iNaq8hvZ9PQGp1j4Ak2bA7UG8O/jLfn0ZsAiEBSN0ERnawYmU0EhP4YH+8Rva TV4rXLvzQ7bMVs57jcU2vISHwoQjls5iGAujkQ64l2m3o0/+C2nUoFFeZtA8/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752414426; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=VEKagoPUawdf52LP6cnqf+sfAWhNeZLYjtGK/f7CTyQ=; b=J4Nede/FoM8wV4qGg8fc3IHUOOg1E/xd7x5IYNW1zr4LWQPjF1kcoRLNt+vC6aQ5AHHIm7 GycSI8Y4GehX1GiT6rsfZOBl/ma+DIVexnJSMrNTwp5h8AiqZjQppZmKeQxAaq4Rd1YvdO p3POBnyuCdlHROViI68ib1xJY8KuCmsIQte6gJoGx+WfJ34DBVsGTirTC7cLfy24sb7RBM 7gkjUex7HoYmtfa85qzpzhYBD3+Czxn44NKc6bCZzuy1cZ/QuOg7CObS2KdE/NINXdHLsa /H3Y+oGzJ1+sICSAfmlIyAARz247Z2saYUiCWZ43SNL7GX2MsXZy27k8o8clew== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752414426; a=rsa-sha256; cv=none; b=qnRdOLpRNqBCOQxwQIKXumPqh9BNFcDHhqcuu0rONRoOzCm7GGvGBIR97ekuzw8mcN6330 gzuarqoKjMs0KoCrh67X6X9BN2DP+J7TuuhbqLwFgiwkDEbGG2GX2HPE4OwJb0L2u6C0PE W5fREYYZlQoFENh2FO60cGKM6aOWeTsfR4UbWwEJczc52j9DbUsBSMmsEz89hGw0pWZqsK PAdA2Qk1ZF7iLOog1NivkWXKy1uJwhdAuQ2Xtyfi0QelOo9BhI7Gs/SK42tbxFq0eh8psB LpzX/zrvz600bxxOT3VbEaDdM6/vaD3s0RxGiSGEmbWwcUoyeRape4EZI/LNQw== Received: from francois.localnet (h175-177-044-048.catv02.itscom.jp [175.177.44.48]) (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) (Authenticated sender: olce/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bg6FN6jhrz8Wb; Sun, 13 Jul 2025 13:47:04 +0000 (UTC) (envelope-from olce@freebsd.org) From: Olivier Certner To: Charlie Li Cc: Mark Johnston , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: f1f230439fa4 - main - vfs: Initial revision of inotify Date: Sun, 13 Jul 2025 22:46:57 +0900 Message-ID: <2937929.UcPf6a0QyJ@francois> Organization: FreeBSD In-Reply-To: References: <202507041455.564EtqwS073424@gitrepo.freebsd.org> 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart5090732.Cjmsv3J8Qz"; micalg="pgp-sha384"; protocol="application/pgp-signature" --nextPart5090732.Cjmsv3J8Qz Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="utf-8"; protected-headers="v1" From: Olivier Certner To: Charlie Li Date: Sun, 13 Jul 2025 22:46:57 +0900 Message-ID: <2937929.UcPf6a0QyJ@francois> Organization: FreeBSD In-Reply-To: MIME-Version: 1.0 Hi Charlie, The panic you're seeing is caused by 'MPASS(*eofflag != 0);' in vn_dir_next_dirent(). This test is here to check that VOP_READDIR() works properly. In particular, if VOP_READDIR() returned 0 (no error), and the length it filled is 0 (nothing was added), then we must be at EOF, and VOP_READDIR() must have set '*eofflag' to something non-zero. UFS has been verified to abide by this rule (unless the directory being read is malformed). Which filesystem are you using? Shot in the dark & educated guess: You're using ZFS, and you've just stumbled on the following case (lines from 'zfs_vnops_os.c'): /* * Quit if directory has been removed (posix) */ if ((*eofp = zp->z_unlinked) != 0) { zfs_exit(zfsvfs, FTAG); return (0); } which is a corner case that apparently has been missed. Just add some 'if (eofflag != NULL) *eofflag = 1;' inside the "then" block there and retry. It looks like all other cases in this function are handled correctly (but I have not thoroughly verified). I'll be mostly AFK for the next 10 days, so probably won't be able to follow-up, but hope that will help. Thanks and regards. -- Olivier Certner --nextPart5090732.Cjmsv3J8Qz Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQIzBAABCQAdFiEEmNCxHjkosai0LYIujKEwQJceJicFAmhzuNEACgkQjKEwQJce Jicmvw/9ESjkkrFQMefCpoBllHcvrouHPUVDbqBtUvTnCfxoB7vfJyR7EC2iyAKR EbUAZaEGRl7EH37/4859qIFh9NIkTJ6if/KV4rvHkbi7V0h0EHA1oEWA7mjNzAyt aaXodxKb8/t2+hL7zJg+9wi6ELmmJbNZPROgGN5XOCiGhO7Inb/gCruLniJ0pqZq 9/HfXp/u66pk1We3s2J/9fSjGBDn15+OWk667862HoShU18rqNaE3dAg9GMZ/2Ab Gap/EsPN2mA6Xv/sdB3TosNtXrWCS9dk2W7LHxTPLSOlEucGp06ICNDoQ3Gj/V1i ha6PvPEmlxaXBvmH2W9KYOVlF3M90WaallX01oLO5PwRK/bURnmYxoZzNQQeFME6 AbqRXVZlRD7fBw0CyFRMUPWFva4O3pxuTwVjjnrT3y6cxGQ/Bg451kD2d92W0L1t 8wTLKAYRP0RsD+THTpjVtfe00TzIgjYFXnMUuAvU8iihlDaACbIRMaObtVq5LJKj tGCdQ7+qqrUeCIKMCrx+eeRPxmMeZ0bLIaR+SIzQ3TahBdgbEgkJs62vStymXVtz ZlyaZ5CzbzXfqhqEzeSKZ2vALeC02ct4kDw47pFWrPXvKpdFM1Pf5Y4Fq3fDPVEd kU4h1ShThWU4gwrC6VNzbQEj+xY23/vxcSHnHvHYfofaOI7y57g= =g38I -----END PGP SIGNATURE----- --nextPart5090732.Cjmsv3J8Qz-- From nobody Sun Jul 13 14:24:08 2025 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 4bg74B3c6Kz612NQ; Sun, 13 Jul 2025 14:24:10 +0000 (UTC) (envelope-from vishwin@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bg74B2HK2z488k; Sun, 13 Jul 2025 14:24:10 +0000 (UTC) (envelope-from vishwin@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752416650; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=gUR+T73JzmHDb/uu++NDYZBOtrpEjgD/fFFROrw77JA=; b=I6dRP3nU0YC3kPBAzStgtDuC99k/5CfFSwGpxALHeawNgZOt5X+gHFgMIOtiX23BkQEopt /O8gMjL624GySIqbrl8LqtNpAvl4ub08c8cj8cHAJc0gUW0NG33rH2/Og2Yx0E/aMzhvvx /DwgmRv7J9IjxANH6C7fRIzQqxmQmyaHn5sQCjY7cG+5hdFLNcl5misJTxE5dCg4IU4FsU ILfFXbpc4tURBpCG95UlOvo+nqOI7paZy9Eb5EBKT7iqd5YPKbGgRFXeF1gpC+ZvcoPyO3 n04dKuFC+xcmaKXrpt2GrufL60KVsZFRIqHW7fwhgG7FhQKMucOO8ns4iF1NbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752416650; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=gUR+T73JzmHDb/uu++NDYZBOtrpEjgD/fFFROrw77JA=; b=HFt+WFVQGLI+OEK8VwqhCltXYlwNSO/xrt2zh8bdms9tSeL4i6rVa1JM35KTlTswmvcMpa RCdqt/cfYDmR0tYcwGsKpEUqGPtCyJqqQDYSsJARYl/DMajkFPyCV8qZFafDNJrGro/kyy TEyx9VywIIyRTX3ccZVQnDdxAT5AFD6o7kCs4MBfA9Ft8OPXYOW0hp3OZNCz93T9Cyhc2s MtC8xFqGmk4axicKEBNrNpjZt1tmR8PS/ARU8joIQhxUiiwJxDH+q7ogWZgoZgMYx9Z8iV DJrM9FXjsQ8L080uhJRdMU/suXithpRnlELl5LLd3UVetTq7O59bDcGU6hM7Wg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752416650; a=rsa-sha256; cv=none; b=JviFni2A9xqG12F6pKFM1oY+JorepW5ZZangDxnBw9Y6gsbzFm7yUjNEBk7yD5O8nd1N8T T7MLWBIDzZszoOBoURQgb4SZvYcgjcIencZ0BS6fMhziR5scY0wmcNPErM87rK8dPFcbXX u2u2nj6CHb4qjqrD757Qd0L8bgBOo2q/rPnEMtHTN0T89EpQCsVEzam1ypWwbLwy0vXtoc p8r2G6cdHmrj6AUNOZvtVvPmb1ubhUT6KXIQ7ezE5OvNum4KQudCCv1O+EX97XTGkxri/C Syl/9TxOkRjm5BrS2b/e82JyDSy9DWOs7ZCKboIC8ZhbNQjBSQiAxxNr0gNKeA== Received: from [IPV6:2601:98a:d00:c180:56ee:75ff:fe50:69b5] (unknown [IPv6:2601:98a:d00:c180:56ee:75ff:fe50:69b5]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: vishwin/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bg7496vySz9b5; Sun, 13 Jul 2025 14:24:09 +0000 (UTC) (envelope-from vishwin@freebsd.org) Message-ID: <03300e95-af5b-4f20-ab52-823c80763dc6@freebsd.org> Date: Sun, 13 Jul 2025 10:24:08 -0400 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: f1f230439fa4 - main - vfs: Initial revision of inotify To: Olivier Certner Cc: Mark Johnston , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202507041455.564EtqwS073424@gitrepo.freebsd.org> <2937929.UcPf6a0QyJ@francois> Content-Language: en-GB From: Charlie Li Autocrypt: addr=vishwin@freebsd.org; keydata= xjMEaEicoBYJKwYBBAHaRw8BAQdAZBuydpjFLGem4uRJPWaYMXX2e+BN1jDhbD3tcqbxhdfN MkNoYXJsaWUgTGkgKEZyZWVCU0QgUHJvamVjdCkgPHZpc2h3aW5ARnJlZUJTRC5vcmc+wpkE ExYKAEEWIQTHxcCLnAXo3rFg6k7P+1cn7slqBAUCaEicoAIbAwUJCWYBgAULCQgHAgIiAgYV CgkICwIEFgIDAQIeBwIXgAAKCRDP+1cn7slqBM/bAP9bhA4e0LxJYFYJlftZM5WHrMSPpUe6 G2pVqmQWTQ0EZQEA0PNryfH3qRWWPSI8mFNRnG24hi5/aXFqCnHj1tcJ9Q/OOARoSJygEgor BgEEAZdVAQUBAQdAUT4TzYFmV6ueIGwjX0N+445KZV6ns1Wiw67QMsJZxHkDAQgHwn4EGBYK ACYWIQTHxcCLnAXo3rFg6k7P+1cn7slqBAUCaEicoAIbDAUJCWYBgAAKCRDP+1cn7slqBPO/ AQCPuGiyyfJClICRs/ToG0MsT8YcPdBygzuUIIeGpkjJpgEA7AoFCQ0Y28Y3hIDFn2k9PH3B nGWL3g05W0ds2qoj+gQ= Organization: FreeBSD Project In-Reply-To: <2937929.UcPf6a0QyJ@francois> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------b74AKVv9eZSSsYnCCSYaNhRJ" This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------b74AKVv9eZSSsYnCCSYaNhRJ Content-Type: multipart/mixed; boundary="------------UdCh0UxPth8DOV9XjhrtCHJG"; protected-headers="v1" From: Charlie Li To: Olivier Certner Cc: Mark Johnston , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Message-ID: <03300e95-af5b-4f20-ab52-823c80763dc6@freebsd.org> Subject: Re: git: f1f230439fa4 - main - vfs: Initial revision of inotify References: <202507041455.564EtqwS073424@gitrepo.freebsd.org> <2937929.UcPf6a0QyJ@francois> In-Reply-To: <2937929.UcPf6a0QyJ@francois> --------------UdCh0UxPth8DOV9XjhrtCHJG Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: base64 T2xpdmllciBDZXJ0bmVyIHdyb3RlOg0KPiBUaGUgcGFuaWMgeW91J3JlIHNlZWluZyBpcyBj YXVzZWQgYnkgJ01QQVNTKCplb2ZmbGFnICE9IDApOycgaW4gdm5fZGlyX25leHRfZGlyZW50 KCkuICBUaGlzIHRlc3QgaXMgaGVyZSB0byBjaGVjayB0aGF0IFZPUF9SRUFERElSKCkgd29y a3MgcHJvcGVybHkuICBJbiBwYXJ0aWN1bGFyLCBpZiBWT1BfUkVBRERJUigpIHJldHVybmVk IDAgKG5vIGVycm9yKSwgYW5kIHRoZSBsZW5ndGggaXQgZmlsbGVkIGlzIDAgKG5vdGhpbmcg d2FzIGFkZGVkKSwgdGhlbiB3ZSBtdXN0IGJlIGF0IEVPRiwgYW5kIFZPUF9SRUFERElSKCkg bXVzdCBoYXZlIHNldCAnKmVvZmZsYWcnIHRvIHNvbWV0aGluZyBub24temVyby4gIFVGUyBo YXMgYmVlbiB2ZXJpZmllZCB0byBhYmlkZSBieSB0aGlzIHJ1bGUgKHVubGVzcyB0aGUgZGly ZWN0b3J5IGJlaW5nIHJlYWQgaXMgbWFsZm9ybWVkKS4gIFdoaWNoIGZpbGVzeXN0ZW0gYXJl IHlvdSB1c2luZz8NCj4gDQo+IFNob3QgaW4gdGhlIGRhcmsgJiBlZHVjYXRlZCBndWVzczog WW91J3JlIHVzaW5nIFpGUywgYW5kIHlvdSd2ZSBqdXN0IHN0dW1ibGVkIG9uIHRoZSBmb2xs b3dpbmcgY2FzZSAobGluZXMgZnJvbSAnemZzX3Zub3BzX29zLmMnKToNCj4gDQo+ICAgICAg ICAgIC8qDQo+ICAgICAgICAgICAqIFF1aXQgaWYgZGlyZWN0b3J5IGhhcyBiZWVuIHJlbW92 ZWQgKHBvc2l4KQ0KPiAgICAgICAgICAgKi8NCj4gICAgICAgICAgaWYgKCgqZW9mcCA9IHpw LT56X3VubGlua2VkKSAhPSAwKSB7DQo+ICAgICAgICAgICAgICAgICAgemZzX2V4aXQoemZz dmZzLCBGVEFHKTsNCj4gICAgICAgICAgICAgICAgICByZXR1cm4gKDApOw0KPiAgICAgICAg ICB9DQo+IA0KPiB3aGljaCBpcyBhIGNvcm5lciBjYXNlIHRoYXQgYXBwYXJlbnRseSBoYXMg YmVlbiBtaXNzZWQuICBKdXN0IGFkZCBzb21lICdpZiAoZW9mZmxhZyAhPSBOVUxMKSAqZW9m ZmxhZyA9IDE7JyBpbnNpZGUgdGhlICJ0aGVuIiBibG9jayB0aGVyZSBhbmQgcmV0cnkuICBJ dCBsb29rcyBsaWtlIGFsbCBvdGhlciBjYXNlcyBpbiB0aGlzIGZ1bmN0aW9uIGFyZSBoYW5k bGVkIGNvcnJlY3RseSAoYnV0IEkgaGF2ZSBub3QgdGhvcm91Z2hseSB2ZXJpZmllZCkuDQo+ IA0KPiBJJ2xsIGJlIG1vc3RseSBBRksgZm9yIHRoZSBuZXh0IDEwIGRheXMsIHNvIHByb2Jh Ymx5IHdvbid0IGJlIGFibGUgdG8gZm9sbG93LXVwLCBidXQgaG9wZSB0aGF0IHdpbGwgaGVs cC4NCj4gDQpZZXMgdGhpcyBpcyBaRlMsIEkgd2lsbCBnaXZlIHlvdXIgc3VnZ2VzdGlvbiBh IHRyeS4gSSBkbyBoYXZlIG9uZSBVRlMgDQpzeXN0ZW0gYnV0IHNpbmNlIEkgZG9uJ3QgaGF2 ZSBzdXBwb3J0aW5nIGluZnJhc3RydWN0dXJlIGZvciB0aGF0IG1hY2hpbmUgDQp0byBlYXNp bHkgcm9sbCBiYWNrIEkgaGF2ZW4ndCB0ZXN0ZWQgdGhlcmUuDQoNCi0tIA0KQ2hhcmxpZSBM aQ0KLi4ubm9wZSwgc3RpbGwgZG9uJ3QgaGF2ZSBhbiBleGl0IGxpbmUuDQo= --------------UdCh0UxPth8DOV9XjhrtCHJG-- --------------b74AKVv9eZSSsYnCCSYaNhRJ Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature.asc" -----BEGIN PGP SIGNATURE----- wnsEABYIACMWIQTHxcCLnAXo3rFg6k7P+1cn7slqBAUCaHPBiQUDAAAAAAAKCRDP+1cn7slqBJvY AQDDFlX3Od/Fs34DF15mSnz9dGcs65R7hckdIr2EyQngEgEApcQMdtw8NapdrLb8pRfHSVcq5V9a BCyG1HIexSyiOgo= =rWWt -----END PGP SIGNATURE----- --------------b74AKVv9eZSSsYnCCSYaNhRJ-- From nobody Sun Jul 13 14:48:18 2025 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 4bg7c34mfmz614GR; Sun, 13 Jul 2025 14:48:19 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bg7c32cvGz3QHv; Sun, 13 Jul 2025 14:48:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752418099; 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=51/V6WbUTtjbzquuriCvKtXGCjHzfIgnAunhJxJAz84=; b=t9MfI27g0uGUq6vTIJKlfyCE19QORmxB5frPEAqBufL08LonzR3h/lY6oWFh9vTJ0OZS7N evpN1fxlIi5ZHVuYP8jj2g/MzQJfR3G9KijuZXURU+nO9nlgrwG40U7W+iY3X1DoS7LCmv IP9zavuHrlJkNorNumKeaFIuMwXA97vfOKWaai71oSOgf9n9oFZcPsWLWqitit2g0WcF25 ptZWoRl6M34nHT1/BJPZu9rJr8q9JXDv+HSEurD4hACwFrEoJpda2CDJGzh5BGFswOwRp0 NXZOyzBzmbY7YrgBIUofsYYnRomazV6HrO8+eKhNTo7fvTNRIhW31N1dG1JQjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752418099; 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=51/V6WbUTtjbzquuriCvKtXGCjHzfIgnAunhJxJAz84=; b=bAOh6SR0GZO97GPBlEIJnzmwZ3vCX3mLbNwmfQ2Peh0CuXi45AHuM0B+Ew0mJjbCMFIblC ioU7ZMqNnenmtVN/vajwnEs+uZr/gblebUMCznc9VogGhnBcBZk8U84Iy8IEn33ihnnnlA Z6RC3+0DCSPU/RluZyB9njcfWei2WbMWpkDTMpHrYoTEb1CvyoB2K2mg5kQyODGZ7f1ZfA cf8mS9g4AGjMCfpvB1H/G/Xz+/QF3i0QIBO6kY2/ZUOidAV9CaY3uOHAZBmujjQtf3cV0i EQEY5LSp4LJKZt6NDSWlNFPs2UA9Pda+/CNosH6BGQ9GX89v6BEMZFQWXZ2hDw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752418099; a=rsa-sha256; cv=none; b=ybs+Vjrua8LnfH+cXHAq8UMchEXQACYqEaJBEDsrzpelNWNdbAccW3lGRIiiVIKEYr1BU3 d7q+FszLLKGBg27wwAQoekXG6WBQg8SbpwazRRBPVu4KYjab4tXvJTb3Um0Di49hpfIwvc QIyB2mAM2D6tGWMeiCFuNbpyd+eIsZAX6IPY5j+DVg7d0fB0dvJ23fFji/PQRB0ouli6cQ GaB0/rve5dly6/YIG5qYXGVqnm4ekNt3aiOkBCGS0l/KEY7EK8B1SB8rUD3h0K0oJlfuBg eOOO47TCBFb122vG5oFkWenEHYwUuQmhFoiOCPqon+rqIM4tjAdQvbPTNjt18A== 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 4bg7c31SC0z1BsZ; Sun, 13 Jul 2025 14:48:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56DEmIlQ030288; Sun, 13 Jul 2025 14:48:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56DEmIZk030285; Sun, 13 Jul 2025 14:48:18 GMT (envelope-from git) Date: Sun, 13 Jul 2025 14:48:18 GMT Message-Id: <202507131448.56DEmIZk030285@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kajetan Staszkiewicz Subject: git: 2b2ac1aa9a34 - main - =?utf-8?Q?pf tests: Fix rdr pass test to really use 'pass =E2=80=A6 rdr-to' syntax?= 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2b2ac1aa9a345ce48aa3306e0292f9fde9c82312 Auto-Submitted: auto-generated The branch main has been updated by ks: URL: https://cgit.FreeBSD.org/src/commit/?id=2b2ac1aa9a345ce48aa3306e0292f9fde9c82312 commit 2b2ac1aa9a345ce48aa3306e0292f9fde9c82312 Author: Kajetan Staszkiewicz AuthorDate: 2025-07-13 13:19:13 +0000 Commit: Kajetan Staszkiewicz CommitDate: 2025-07-13 14:48:01 +0000 pf tests: Fix rdr pass test to really use 'pass … rdr-to' syntax Reviewed by: kp Event: Berlin Hackathon 202507 Sponsored by: InnoGames GmbH --- tests/sys/netpfil/pf/rdr.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/sys/netpfil/pf/rdr.sh b/tests/sys/netpfil/pf/rdr.sh index 4c08b4973891..f7c920bbfa8f 100644 --- a/tests/sys/netpfil/pf/rdr.sh +++ b/tests/sys/netpfil/pf/rdr.sh @@ -142,7 +142,7 @@ tcp_v6_pass_body() { tcp_v6_setup # Sets ${epair_…} variables tcp_v6_common \ - "rdr on ${epair_one}a proto tcp from any to any port 80 -> 2001:db8:b::2 port 8000" + "pass in on ${epair_one}a proto tcp from any to any port 80 rdr-to 2001:db8:b::2 port 8000" } tcp_v6_pass_cleanup() From nobody Sun Jul 13 14:53:42 2025 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 4bg7kS0CPLz614Z7; Sun, 13 Jul 2025 14:53:52 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qk1-x735.google.com (mail-qk1-x735.google.com [IPv6:2607:f8b0:4864:20::735]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bg7kR2CHXz3Vfb; Sun, 13 Jul 2025 14:53:51 +0000 (UTC) (envelope-from markjdb@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-qk1-x735.google.com with SMTP id af79cd13be357-7dd8773f9d9so279611585a.2; Sun, 13 Jul 2025 07:53:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1752418425; x=1753023225; darn=freebsd.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=85jWj4DcWO5TYJGtsaRxJRLJs/KLVFUTWmhtt1h4w8s=; b=m2tDztfqH925q4DgvE3A5aUR6aYN93uwHvbGgtkY0suxxDIozWFo0TwRVza1U/XXH2 WWZFRQxBr9RwCaeW/l5fpNKtz1DXLYGulE/0faBobPf12r4dTbaVLUFh/ffnFTkgMNaS kg0XcIItkgA3+3rZw8HikCSuB45deAyeGm7NP6joWlN3fqP9cn9vzIjSzk55A9fS0FtD 72nTVXIZ9tlIJj2utAMMKBxYFashhQ982o1wnK6pLyMKoCetDuMUxkxjQ3VxWnPf7KEQ Hg8/VyhObcHbASn6OLMsBwcw6mjEJnoQuN6Fzqhv3eiEdkA64BusMAki0bBq8curmIyH CvGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752418425; x=1753023225; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=85jWj4DcWO5TYJGtsaRxJRLJs/KLVFUTWmhtt1h4w8s=; b=bUI8l+YQfTA9LvsNRQngAeFqOC46+ZyJPJVmwvqpoKdSOiut7kFQIFGJvl6ALp0O8V s2sUcyXC2NTjRxIe7j8t5GVUCBYFmhHNRzRJMwVx+j2rYAB6tZMRhcGC9Z8x+vtFP+JU u8esUfwEZOFEBiADd9W79lJHQMD4frEI1ZLIVkRcgyOoncSOAYoOTyTOTJ8Lcd+umbzM eZNl82BfSrlkjwBWJsiAEfwjZNCi6ovAoU5JPFybFd1SA+VT+pHytRhXx5Zo2Rbu+j3j 4vDCF4mPYnqiKb6bXBeD+EqjnfCdttkuo8lfqydaI9VXv+xUiR0b2rgq1E1JE70G8eLq 37jg== X-Forwarded-Encrypted: i=1; AJvYcCVF0TmCBBSEaJXMbYL2lkO49SZyWYkiH6MiXqwLzwFRn5hsnear8qecuIkJflpAVa1yhWafcI0OpCQ+DSInG+EGomZsJsA=@freebsd.org, AJvYcCXdj2l5GgBILi3Zh7MnN1hLiljF/5K6erUHvWHP1FBhqcs7P5OTyiWZbqhT5OPub4/b+FD6v21M2Bbd/q31KLCWFoUO@freebsd.org, AJvYcCXoyOha/UrGK7FcYthpyF1m3m+gNm5ZenbFjIv5hJ+rgc2YxtbaflhIPP4iYHrnj+0nyv/YrXjGWlK4D0xui58=@freebsd.org X-Gm-Message-State: AOJu0Yy/IEnyIuo3U90af3+vmS46Bo/rBbda8wjUf4EPLUKoEpj49kHx LtRqteIFUUqzQEU0BZRfRs0KqVVh6ZoTM4lSO76f5ocCb5hF9v3aJuOEZZJJnQ== X-Gm-Gg: ASbGncvhOpjcvaCF3yeYL1uflX9p3hBzG7yjCujnGsMAX2Y0xRBjORpt/nMAK/OLK9M p22so1bhpYchae1Ut+wUuucevPSBLx0Mr8+oTm67eGV8T3OUwvixBo5H+/2YC1VYVrOL5oWdka7 yADrg/aZ2iIsUlCk7ImsGzR3foeKsIdAk7Bb6NLzmXtl87wSMrBq78QmriPbUAAHLRTdJmaWtWD KS+kHiBTMiWaCTIbt0FCrBWgByPDINfFd3JlNG2IWMCZmr7YaScaJLO9GlnwJWdv+CSFtBhidTj KV1ccgpC3VRPUWjyFUaKRgv8IvcCjQ2s2zLHb5kVgYOsdxyBkBJ95PNrtIFASkcTowP462MAcBs k4nA9zuZQa7jC4RDUJkZSdPXWQmu4/A28M4Uw X-Google-Smtp-Source: AGHT+IGVzU8bgynvLLKciAu/3SE6v/7/CJmgUE8gjRcFnVuOn4hCJlTNZLmfdcvfAEcCRFR2XAlbdQ== X-Received: by 2002:a05:620a:4416:b0:7d4:635f:3e42 with SMTP id af79cd13be357-7debfcc7a3bmr1177998785a.20.1752418425118; Sun, 13 Jul 2025 07:53:45 -0700 (PDT) Received: from nuc (192-0-220-237.cpe.teksavvy.com. [192.0.220.237]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7dcde32bfcasm415715885a.65.2025.07.13.07.53.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Jul 2025 07:53:44 -0700 (PDT) Date: Sun, 13 Jul 2025 10:53:42 -0400 From: Mark Johnston To: Olivier Certner Cc: Charlie Li , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: f1f230439fa4 - main - vfs: Initial revision of inotify Message-ID: References: <202507041455.564EtqwS073424@gitrepo.freebsd.org> <2937929.UcPf6a0QyJ@francois> 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2937929.UcPf6a0QyJ@francois> X-Rspamd-Queue-Id: 4bg7kR2CHXz3Vfb X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] On Sun, Jul 13, 2025 at 10:46:57PM +0900, Olivier Certner wrote: > Hi Charlie, > > The panic you're seeing is caused by 'MPASS(*eofflag != 0);' in vn_dir_next_dirent(). This test is here to check that VOP_READDIR() works properly. In particular, if VOP_READDIR() returned 0 (no error), and the length it filled is 0 (nothing was added), then we must be at EOF, and VOP_READDIR() must have set '*eofflag' to something non-zero. UFS has been verified to abide by this rule (unless the directory being read is malformed). Which filesystem are you using? > > Shot in the dark & educated guess: You're using ZFS, and you've just stumbled on the following case (lines from 'zfs_vnops_os.c'): > > /* > * Quit if directory has been removed (posix) > */ > if ((*eofp = zp->z_unlinked) != 0) { > zfs_exit(zfsvfs, FTAG); > return (0); > } > > which is a corner case that apparently has been missed. Just add some 'if (eofflag != NULL) *eofflag = 1;' inside the "then" block there and retry. It looks like all other cases in this function are handled correctly (but I have not thoroughly verified). The store to *eofp sets eofflag, so that is not the problem. Based on the presence of "efi" as a component name in the stack trace that Charlie provided, I suspect the problem is rather in msdosfs, but I don't immediately see what's wrong there. > I'll be mostly AFK for the next 10 days, so probably won't be able to follow-up, but hope that will help. > > Thanks and regards. > > -- > Olivier Certner From nobody Sun Jul 13 15:12:08 2025 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 4bg87k3YJyz615TY; Sun, 13 Jul 2025 15:12:18 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qt1-x82f.google.com (mail-qt1-x82f.google.com [IPv6:2607:f8b0:4864:20::82f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bg87j74Prz3l6B; Sun, 13 Jul 2025 15:12:17 +0000 (UTC) (envelope-from markjdb@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-qt1-x82f.google.com with SMTP id d75a77b69052e-4a9bff7fc6dso30179901cf.1; Sun, 13 Jul 2025 08:12:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1752419532; x=1753024332; darn=freebsd.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=OxUBiQ8hu647wvWpeIV8eryA4Of5ok+v772B9eSNCyw=; b=hsSo5V9wxc7Yb+z+4mM74OZaehQu8Eg2UmpAKrc1+04C83h7y1vFZPhf0x61yvN8Db hBwuz/axX60gvfOciZQFOd9Q8Xc+T0ViVzOJFhvG/t5IKbFoy4rjanWWSDLtQ3G+dm0v OM6dAVD81iKw389aVO8hcsoKNM3wXktVLCkIX3nHFSQ/akhQVe4efCR1JxzA5ygAVbvj XIRYoFa/RQApNvR7KVP+us4PrTGu2XJ2n1TBllq7h/ko1jKNtmk6/seMBcHFTS+3jhvq 3PFpukBJtTL4V8EWmweTPOt9dNO8RffDGCzh4EdXAlDbNiYJePdCOC1rQGNpS4bj9ynC C+Zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752419532; x=1753024332; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OxUBiQ8hu647wvWpeIV8eryA4Of5ok+v772B9eSNCyw=; b=A99MruvQzpyi5ymdaYQmj+hxEt7lmPRyO/TgbC57lrHcQP4XxTb6jSnMV7fSZZaatF Lb+37aJOeIgbn/Bi5wghd3tj/9wjQbeV+c79ImMz65zv8U30FDMMVXC1/Ju9Lc3bQPVR b3ZJZaCOyf42cms8wzvpqpdaLt1nk7E3MxgAFqvOZmcwKYvOVKk4JK2MHEOKnKMscwRq 693yQaC6Hi4q6wr9D9c1iluPHWAgl1rJi5l7O7HvLa2YpTAUA6FnfXdAVC0r8Zr9Vo5p FzX88/rhUuHWX0WpSvPWLkBtbHVP5h0gCENWkr404bA9w1AD4yAofm0DbwHd5Wm08WgO T0AQ== X-Forwarded-Encrypted: i=1; AJvYcCUHE9TLm8PPPzlZ7Twi6s0JCBoKrT4ROZg+Hrj79SudF+xeiqcjR5nBUs+KPlg2BVyoZ1yBPAXjrEUClATTA8nBbMPw@freebsd.org, AJvYcCVspY7UlxBBBNYHfxMXG1nd46oO1CAfr1yVMPq+1QldeVf4dqbXmqI/57B9HBVuU+nWaadlxxNSygvyy/xKyKS9UYTQlmQ=@freebsd.org X-Gm-Message-State: AOJu0YxSszYnIovzqxRpWKmxileLjAvR6vgh1+6u4sQuT0qHLkpmSNRi QcKVhhalkCltg8rTwqgQuA3YEr3JGNNjpvuy0YkSb8Dymo+pgH29jUjcmgzozw== X-Gm-Gg: ASbGncvFK1E3YyTplluQMDZTSPSaWJ4l+49fEXmdoXZS9PkG3/KLn6mGa4oKVlkNqFU 7sphH8pZqMzWaSp0SXsh4DcquzVgra5otdDgyp2LvfvZjMERPDx+5uwPg1tBCfGqlM93WpFJxFe u0c6hNz/UZPuKhs++Dy2CYUiRgbNbBmJnCcnnEOO0TYEI8iUk02YOecF4HhoZ9+OjrLM54Cfokg H3Tutl+aF1jaC6tgjeT5ASJ9UQZH5dbE/oYh/xLcGzXn6po78VNg7icVa/mn4mdL1g8mK2NM9br SBQHfdGQgkbsiyKtotKekt5Gu43nFuv+LU7T1bfphIyt5ODlu7JI6c98vafQHkc3H4qApTFlyWD oSTpu0Yn1QPMobDN9a96WZa2KvX4Q/h/Fuin3 X-Google-Smtp-Source: AGHT+IFGbt4b5r5UqGKJXAtaYAkf4PGm1uWG1tjeiles3n9vqdfuPG5lb7uzRf5mstAN62obhLv15Q== X-Received: by 2002:a05:622a:4d8e:b0:4a9:8299:4e00 with SMTP id d75a77b69052e-4a9e9a50750mr229134661cf.0.1752419531340; Sun, 13 Jul 2025 08:12:11 -0700 (PDT) Received: from nuc (192-0-220-237.cpe.teksavvy.com. [192.0.220.237]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-4ab04d910desm25829621cf.9.2025.07.13.08.12.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Jul 2025 08:12:10 -0700 (PDT) Date: Sun, 13 Jul 2025 11:12:08 -0400 From: Mark Johnston To: Charlie Li Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: f1f230439fa4 - main - vfs: Initial revision of inotify Message-ID: References: <202507041455.564EtqwS073424@gitrepo.freebsd.org> 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4bg87j74Prz3l6B X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] On Sun, Jul 13, 2025 at 09:01:24AM -0400, Charlie Li wrote: > Mark Johnston wrote: > > sys/kern/vfs_vnops.c | 3 +- > > > > > After this entire series of commits, with all ports rebuilt, I'm getting > panics immediately upon starting a desktop, found with both xfce and > cinnamon: > > Sun Jul 13 08:30:38 EDT 2025 > > FreeBSD lehman 15.0-CURRENT FreeBSD 15.0-CURRENT #2 > main-n278710-f5dba673345e: Sat Jul 12 19:18:59 EDT 2025 > root@lehman:/usr/obj/usr/src/amd64.amd64/sys/ODYSSEY amd64 > > panic: Assertion *eofflag != 0 failed at /usr/src/sys/kern/vfs_vnops.c:4058 Could you please try this patch? https://reviews.freebsd.org/D51290 From nobody Sun Jul 13 15:21:04 2025 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 4bg8L20VByz616DW; Sun, 13 Jul 2025 15:21:14 +0000 (UTC) (envelope-from olce@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bg8L13RR0z3sM8; Sun, 13 Jul 2025 15:21:13 +0000 (UTC) (envelope-from olce@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752420073; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=DoJilKACp29ttkZe+IRyGzmhG+ybtTLn5PpQGLwM8RM=; b=wAhJU20ayUa/NEY2n1VsNJ1+b/Q16HSUeoZuTTlx7H2EroYj3QKG134DjttCk0bHW8knEQ oyxGtfchqFbn1pTC6Ju4q2Z0oaNrOb9RQd51sa8YxXg5C+BxR6Tkvs2qNg4AtMLcztghg6 Hpad6QKM+AJX92kZHlTVT4kzwoZIRrKk6la4mIeoJnyxsJSFZHYKekHGwkJe65G4zXF775 lTTe3LgIf46IdsqpJh10iB93BUMr6NYMGVzHPXtShZZhDN0PpEEBe9IlnYx5odMWecdyge ynCrY3UBS2flWbFr5TCAM46M5cDK7vg6mRNPG7bGe7h2OiPsrknfx7Tw/Ks9xQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752420073; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=DoJilKACp29ttkZe+IRyGzmhG+ybtTLn5PpQGLwM8RM=; b=isH4I4pxx1K2sPpcSs6mhza7bvoNnpEvO6NPXOeY9v2JWVrts4kRyNQKQLGyE4Ery08f/k JUsvn0PEzB56tH5jRXGURO0jGU1l2R1v2CuQuM1Jpun3h1qcYtjM9o14cVkrr98ZjKW8W8 JgIvpVa64FlyHuYM5FY8ZWYKdYKcEcETebaRAqVMX6wUWv4K/xLT/S1RGb02xYx2e2HQ+r ptxcJl31TAGxRTkKq9tnJoZF0EL9bTgX2F7k+G4lLM2dHyW9RGoHvDFF0fnusrDj+vAos8 7ALi5stweNL5rlvl7aifpClKvLPJfrOp753s3wu52xCp+gnPDFxphaNceZFL0Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752420073; a=rsa-sha256; cv=none; b=T7Ul0f/Ejqm94PDetT7o8txH1O+n3d7KEK+/lNz+kLbc5Ev/60uslocqoxSKqN8ba6gYSL B5BQMEMaOubZ+c5FA0z7CX3SyAcbK+6B6KYbl5+75zqpmrJBXKlAk0hzi+rqBAoSCBxIPl voS68J22HL0uJs1VkK+b82Ks9Pk99M2IivJ1IPtlocQFURDCgmivdknpHK7Jbj5JMK/HFk 17MiI3kGU/1Fd7XM3IQBObwEZCGvg7yA0fUAomikA7c5N8xXKWJnDjFPCtvpTqRL7la8MI 6lm+zvtQVp9eBdk2DH9ZBJxm+eh9DfkNL1gMmPcqlAuxUjQ9btWcoFeSwaRN/g== Received: from francois.localnet (h175-177-044-048.catv02.itscom.jp [175.177.44.48]) (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) (Authenticated sender: olce/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bg8Kz6SnyzBWg; Sun, 13 Jul 2025 15:21:11 +0000 (UTC) (envelope-from olce@freebsd.org) From: Olivier Certner To: Mark Johnston Cc: Charlie Li , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: f1f230439fa4 - main - vfs: Initial revision of inotify Date: Mon, 14 Jul 2025 00:21:04 +0900 Message-ID: <3224371.fEyhCgFcho@francois> Organization: FreeBSD In-Reply-To: References: <202507041455.564EtqwS073424@gitrepo.freebsd.org> <2937929.UcPf6a0QyJ@francois> 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart6956069.Qb2xPn7ZBO"; micalg="pgp-sha384"; protocol="application/pgp-signature" --nextPart6956069.Qb2xPn7ZBO Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="utf-8"; protected-headers="v1" From: Olivier Certner To: Mark Johnston Date: Mon, 14 Jul 2025 00:21:04 +0900 Message-ID: <3224371.fEyhCgFcho@francois> Organization: FreeBSD In-Reply-To: MIME-Version: 1.0 > The store to *eofp sets eofflag, so that is not the problem. Indeed, I missed that. Checking the rest of the function, I see no problem here. > Based on the presence of "efi" as a component name in the stack trace > that Charlie provided, I suspect the problem is rather in msdosfs, but I > don't immediately see what's wrong there. Based on that, I've just read msdosfs_readdir(), and the problem could be there: """ if (dep->de_FileSize - (offset - bias) <= 0) """ because dep->de_FileSize is an *unsigned* long, and the test only passes with 'offset - bias' exactly equal to 'de_FileSize'. The assignment to `diff` in the loop above would be wrong as well. -- Olivier Certner --nextPart6956069.Qb2xPn7ZBO Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQIzBAABCQAdFiEEmNCxHjkosai0LYIujKEwQJceJicFAmhzzuAACgkQjKEwQJce Jid25g/6ArOIvsrLTJogChCET+ovk8EsjmnPbnWgxakceyV03KX3rJ0MauoTDV01 BghhwylQolKa5i/wBV89s2p92OMgf4mgP5OqDWUwOFJZDTtNHNvMkCjEs1BVcHcl BB107XkZy4tOba2yM1sWv8GtnRuV0OojK+Myq96iouq3bf1qQKH3Z3T7VDCeo8io 8TC0HzwH1nSyiefVMpJwCSa22FmycemytZhvMjS9TeB6EpaafS8HX/ftenxT683e tWX3sPmkXOeH5Ud9XS4UFTthwVJIRbs/JpziKXkCKS5/n/Xdo6siCdEaoqAVbqCj +DsQa9RLAU2nNOmqqoxmLpkQi7TD8vkjkvrXPgGeBkkh2uoKHbZwkeWeG05Jr4sC voKMzS0+yEbpxJfAo2mMcZLXnj1lu9LE5cKG2Z97E+babtDhwpz59mUg0dvi4Dv2 0//aJC5I+vyYoW9bFmZH2EK6BNGYNkBSRFPctNPywmMcpD5k+ym4PvMFJ+I6+ue8 l3xvdn/Rw67X68l62+lt1t84ttqlVo0Z5jGWmWfjvKH/eQcewsyPJ1mROlJjUoBJ jLHpzGwKpYfaUaLpW6jtsWy5qf5FjBpjaszjHGEUMItExePcwMKWFm+OEPnFcxvs yYMovlW8vrQrhx+awimdYKnIR028g/smNrf6x5vTlPXEcuwpv2A= =96JS -----END PGP SIGNATURE----- --nextPart6956069.Qb2xPn7ZBO-- From nobody Sun Jul 13 15:36:00 2025 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 4bg8g511mcz616qN; Sun, 13 Jul 2025 15:36:01 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bg8g43PSFz40Hv; Sun, 13 Jul 2025 15:36:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752420960; 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=MjabJL6hnDe/TgMTg0kGsOXXKaYyqiB/kKDMpAEP4PE=; b=fJOx8LuGK38uBNwkM6mM7+tC7IfIzDltP/qWh3MfXRqh6Vb7r2InMsmNBRHAPgJkpMT7C5 koYBZQCkTwNSAh5+qn/1P33/9xeBU1qtFE+otT7Czqnq9JrVTw7OeJwao1Q7FM16WJlE7k Wwl8DQG6wHZax5iqi08UXToAR6CmBpvA0uA19eTFJGYlnk/G9HgUkuO0MnGXHJ+QWrg24W D/vtf22+VBCaXd0v4gmYKN2Jt36RtpP0T8bqjfTW/bhkBrA0Aa+tUODfpS2VjcOWKVQF6v 3+mabOmHuALN9uVOBhuadSdgbi/Gfk2gGx1KWo7CVWa80gRpQk75COE1aOUOGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752420960; 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=MjabJL6hnDe/TgMTg0kGsOXXKaYyqiB/kKDMpAEP4PE=; b=Caxp/Qx2ipnMSb0FFbexBw7YrlGT+9UIeW++owK92c+sLndftlWtt/58Kqt1trGN18902q kvDspEQJo6P9+40RnKD0SwDbAhn1/SJvD3ZSOcJ3mG4XUPXHSCdRCQN875L7+TWTSp8VgW rVyrgxBEomQRQbCTDbkhkX3FwYhFY1FzRzBXBbRYBoLXfnR/YgKUVnmQO6rYGKs0cU3Y2+ uDtqlbuVBisy3/Pg5803NlY8F3VxHvYrD96hA5ZM7eJOag7cqILNINb6lCJ02TRhUo6KPK CC+ueFKpLOhyz6cSReTTHzST4nrXoK8bfjrXzK/sgqQLo5cz7COGJ61Z5p+3XQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752420960; a=rsa-sha256; cv=none; b=rnwV/KXrzs5KoTzvKx5H/l8UiGmz7TL1Sw4rd26StJ/XUUfyISZpCCAj29I0T9uGzvQz7N GGvRE1HSc/kon+zJKtxY7pruemmLQYJ7+LjsqyqpKK8chInxylvCh/fUoEHgSj94pjbw02 92MNyhlPbx5WsFiyOCK+gIqONiMaIY9LqwclZABmlMvatgsop7Rkow/oK1JAvRBOAiNUor CD5UT2OwiQmgdf6D96BV2yQszyh5Vq0mo3NU2dwAAIByxT+I1r84p6y5A6c364TzBc86bL w/b11kSjdRQrYsc1ZRNBfp31fGSfeUeom+JUKXZx76x+UfD2GkxUOZI+zTNjVg== 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 4bg8g42y6PzRl; Sun, 13 Jul 2025 15:36:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56DFa0Ph022741; Sun, 13 Jul 2025 15:36:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56DFa0lm022738; Sun, 13 Jul 2025 15:36:00 GMT (envelope-from git) Date: Sun, 13 Jul 2025 15:36:00 GMT Message-Id: <202507131536.56DFa0lm022738@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 10d336114d48 - main - tracing(7): Add hwt(4) 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 10d336114d488193d06bffa1755bf61f2a027a8f Auto-Submitted: auto-generated The branch main has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=10d336114d488193d06bffa1755bf61f2a027a8f commit 10d336114d488193d06bffa1755bf61f2a027a8f Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2025-07-12 09:40:27 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2025-07-13 15:32:48 +0000 tracing(7): Add hwt(4) Also, reference tracing(7) from hwt(4). Reviewed by: bnovkov Event: Berlin Hackathon 202507 Differential Revision: https://reviews.freebsd.org/D51276 --- share/man/man4/hwt.4 | 3 ++- share/man/man7/tracing.7 | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/share/man/man4/hwt.4 b/share/man/man4/hwt.4 index df02a4672f36..299332c72542 100644 --- a/share/man/man4/hwt.4 +++ b/share/man/man4/hwt.4 @@ -3,7 +3,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.Dd July 7, 2025 +.Dd July 12, 2025 .Dt HWT 4 .Os .Sh NAME @@ -131,6 +131,7 @@ For SPE-only, the kernel is waiting for userspace to notify that it has copied out a buffer to avoid data loss/overwriting buffers. .El .Sh SEE ALSO +.Xr tracing 7 , .Xr hwt 8 .Sh HISTORY The diff --git a/share/man/man7/tracing.7 b/share/man/man7/tracing.7 index 4c9aee8ce913..f3e3a5bf98c4 100644 --- a/share/man/man7/tracing.7 +++ b/share/man/man7/tracing.7 @@ -73,6 +73,10 @@ It comes in handy for some niche purposes during kernel development. It lets kernel programmers log events to a global ring buffer, which can later be dumped using .Xr ktrdump 8 . +.Ss Hardware-Accelerated Tracing +.Xr hwt 4 +is a kernel trace framework providing infrastructure +for hardware-assisted tracing. .Ss Hardware Counters .Xr pmcstat 8 , and its kernel counterpart, From nobody Sun Jul 13 15:40:22 2025 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 4bg8m71Ch9z617Bf; Sun, 13 Jul 2025 15:40:23 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bg8m65XSyz42pD; Sun, 13 Jul 2025 15:40:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752421222; 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=Z9Y78t1anJnupUmvEjx+wq6fdd8UZmCpZy/OBzkdpbQ=; b=PkfPLEWVfQCinPm2dZthNOYgEXWIw4lkCcnKrq1GKjDNU6FAvQ3TZI5guOYLXk/Nra2lov j9lFv9DjcVenOQGHUzttgNUArq7ZmLUj8U91EH0xKpnho25bKxbMGQnoH/RMC9wKdYKcn2 sLK74UJG4ucRwZ/4LD8pXwO6oR9pq0MYJcij/0WBa55I0SxCtYwKm/zN1Hf3e73vulfzbC 4fHxEKLbB8b4cMbjsr/r2o1WHotQIzA4U0OQ4pM7BAcjHmaob0E1E9yljcN4PFMSMJO8a7 uJNlyL+/git/PvC+47LZ6ul1hLG7gN3Xqyw826Vp4bt1QiAXiY55HPaB/ic5mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752421222; 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=Z9Y78t1anJnupUmvEjx+wq6fdd8UZmCpZy/OBzkdpbQ=; b=P9KY9tzhvX6fd70T3JqH/wMltFmjdOBmqa0BQGHIqWMl69eZhm0M7EneMyhgTfLDXP1BNh lBJWdqRDmmjGA8YHNiG1IKjWB70yD3B5pTmlU73qafiyVLBes2o126AWvNjyETK+odd9xv kguQm3at5smbQGtF/IfcfQ1dl/t3Mb753ZzEt71aQiN+7QijSli6y5UQAGtodmC1C4XqX8 2aSQFPRAVIdADCMAvGWPkh5JudRJbUVVTyfi7eUZAASi1Fj4T9aMp88Mi/4Ap8Buk/e9wY m11MNW3xZEe2BHerGY9GvfKudPm6uAM4wEteNdsgkFyxyY+TOhV9dG0+a3NaGw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752421222; a=rsa-sha256; cv=none; b=ex0QVvREBdvC7lAJ59AcJuIUa0m+IayXiFaJdfQIXd65GiYpiU+zp/zA0M3eApZdFoibGk FSCIhw/yVzZ9ThuHtt1KUSKMpXohUka5xo0lOs3OeQmrNCrPHACWzumCIVi9exoxZNo73s cwZtfJh0Ysx4zB4QZja2wfuKviLcRTe5M5+Zw/ozLmmH7l9xUV/T4ymoD/KAtZpsQjF5PY 6pObteyIDX0P8tevmhuA9KTWTGDvujpQutf43Wlv442bjF6nQJ+4f628JoAIOAbDfiHdYz 9euOIaaip2HugQB45iFT/dKiMJbadYfERMcbIyVnX1m0ZVgY0DAJQx7DgzvB5Q== 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 4bg8m64gg1zRm; Sun, 13 Jul 2025 15:40:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56DFeMkj032828; Sun, 13 Jul 2025 15:40:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56DFeMNn032825; Sun, 13 Jul 2025 15:40:22 GMT (envelope-from git) Date: Sun, 13 Jul 2025 15:40:22 GMT Message-Id: <202507131540.56DFeMNn032825@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eugene Grosbein Subject: git: 8f43b39b1c38 - stable/14 - ifconfig_netlink.c: MFC: optimise non-listing case 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: eugen X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8f43b39b1c38bde166314d4682daae7bf15a5445 Auto-Submitted: auto-generated The branch stable/14 has been updated by eugen: URL: https://cgit.FreeBSD.org/src/commit/?id=8f43b39b1c38bde166314d4682daae7bf15a5445 commit 8f43b39b1c38bde166314d4682daae7bf15a5445 Author: Alexander V. Chernikov AuthorDate: 2025-07-01 13:16:57 +0000 Commit: Eugene Grosbein CommitDate: 2025-07-13 15:38:58 +0000 ifconfig_netlink.c: MFC: optimise non-listing case This change produced by melifaro and the commit is concerted with him as he is pretty busy IRL these days. The change restores performance of /sbin/ifconfig utility for non-listing case after it switched from rtsock to netlink(4) API in FreeBSD 14+. PR: 287872 (cherry picked from commit b1b17432aa1be670564161232d110461a5dde4ce) --- sbin/ifconfig/ifconfig_netlink.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sbin/ifconfig/ifconfig_netlink.c b/sbin/ifconfig/ifconfig_netlink.c index 03fe1e418082..11b3595dafe6 100644 --- a/sbin/ifconfig/ifconfig_netlink.c +++ b/sbin/ifconfig/ifconfig_netlink.c @@ -162,7 +162,7 @@ struct ifmap { * Memory is allocated using snl temporary buffers */ static struct ifmap * -prepare_ifmap(struct snl_state *ss) +prepare_ifmap(struct snl_state *ss, const char *ifname) { struct snl_writer nw = {}; @@ -170,6 +170,8 @@ prepare_ifmap(struct snl_state *ss) struct nlmsghdr *hdr = snl_create_msg_request(&nw, RTM_GETLINK); hdr->nlmsg_flags |= NLM_F_DUMP; snl_reserve_msg_object(&nw, struct ifinfomsg); + if (ifname != NULL) + snl_add_msg_attr_string(&nw, IFLA_IFNAME, ifname); if (! (hdr = snl_finalize_msg(&nw)) || !snl_send_message(ss, hdr)) return (NULL); @@ -457,7 +459,7 @@ list_interfaces_nl(struct ifconfig_args *args) nl_init_socket(&ss); - struct ifmap *ifmap = prepare_ifmap(&ss); + struct ifmap *ifmap = prepare_ifmap(&ss, args->ifname); struct iface **sorted_ifaces = snl_allocz(&ss, ifmap->count * sizeof(void *)); for (uint32_t i = 0, num = 0; i < ifmap->size; i++) { if (ifmap->ifaces[i] != NULL) { From nobody Sun Jul 13 15:46:16 2025 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 4bg8tw57V3z617rl; Sun, 13 Jul 2025 15:46:16 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bg8tw1l0tz45B2; Sun, 13 Jul 2025 15:46:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752421576; 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=Vb6Mig0hCPg7zmImDguDxXkUyTEILL1iIqC0JQOTY78=; b=l1MERIaxG8q7CSOUNF5eP5Md6d17CHN5xQi0Je7TDcbYP0lsqjb3ahvaieBpskSkFWee5j UpAB7pWLVTAK/u+f/7YOz3nWWGs0qCHs1bra3RjDCnXDLkVj8t0kJdI/j0F0hM8y40fzux s1FIMqbbMfGEzm96z1ApIWb//bhjwRjWwGGHfbG79v//ivhiKUKm/MgZvGkYMzK2cNsOPn H0tcuvJoB4YyKKxED/3PlC4dVzmJ+LbNWmr057kW7Sl+sHpo5hN6eOZbBL90yzPgaKUdhB XUjVnH+zz3Xe0MjloCaNIi6JG7yLLdbKqrdxo2u84Bk1RKWB3nYoihZcAnMUjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752421576; 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=Vb6Mig0hCPg7zmImDguDxXkUyTEILL1iIqC0JQOTY78=; b=mqgqCQpdspCj1pojox9vKIUNHv5LGnXtrqo+Ot5FaoPHDzsdFhRl8ErpjcAG1Gze96+g5m fqeXkyCZe8oOEjvaJ835sY8VaUF7Nb/X1NpD3gRQOABnTFB42eyzQEKK2M1EnPaFf32jcM ZQEb0+7lNuVL00QqaalnGYqTAM5+y2iJ6xCXhDIHLych7oCORtCZy7mZuYtOLjQnPR3Ytl AzpZJAHpm1d4LeLgQNKGVsaC91CM+AbGnKmAN8YLLXRz7pMpGTqVz7ksqiZpcCMnqKZV/c yw+K4pQTj1qySZmZyW+HZ8qTYrVWdrKOBB5m2XV4IpJPEsY8DrPypMHCxMNAXA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752421576; a=rsa-sha256; cv=none; b=uDExggq7LtMkygiiELZv9adhp3CyAv2QvCIiIebI67oVHuvBuyGUgtsUuOGRN4sniSf5mO 3EvL9kNBzBkTJHo4O3sBTv+Y307nNtO8n64RtyRINuZz5H4LvoUFD/YOX/UCQdL2GTrN0E C2gVbDihLWVd30IEDxjI0LWcY2BKbvvFffmhC9y5ufufinmAePeuBWr993S9EWYaO/UBiP 7tD3L/b2czuoraFPK2M33jWks9t3DYUIGKmAwc+RsbojhupDR1szYvXYQJgS2p8ZBX1t3r IsAs5zHVppFkg7x8vicizLbs68dBBzC+B9jsBd3lqC9oL/xsd2/k2+uvCpkFhw== 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 4bg8tw15SCz1CmB; Sun, 13 Jul 2025 15:46:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56DFkGTt042424; Sun, 13 Jul 2025 15:46:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56DFkGlF042421; Sun, 13 Jul 2025 15:46:16 GMT (envelope-from git) Date: Sun, 13 Jul 2025 15:46:16 GMT Message-Id: <202507131546.56DFkGlF042421@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eugene Grosbein Subject: git: a5b6a029eb5e - stable/14 - libexec/rc: MFC: improve performance of pccard_ether script 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: eugen X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a5b6a029eb5ea6cfd5d285f7a5c08cb2c3b7b052 Auto-Submitted: auto-generated The branch stable/14 has been updated by eugen: URL: https://cgit.FreeBSD.org/src/commit/?id=a5b6a029eb5ea6cfd5d285f7a5c08cb2c3b7b052 commit a5b6a029eb5ea6cfd5d285f7a5c08cb2c3b7b052 Author: Eugene Grosbein AuthorDate: 2025-07-01 14:13:10 +0000 Commit: Eugene Grosbein CommitDate: 2025-07-13 15:44:07 +0000 libexec/rc: MFC: improve performance of pccard_ether script Replace "ifconfig -ul" with "ifconfig -n" because netlink-enabled /sbin/ifconfig utility has sub-optimal performance for listing. Combined with the commit b1b17432aa1be670564161232d110461a5dde4ce, these changes mostly eliminate performance regression of the command "service devd start" for a system having hundreds of network interfaces created before devd starts, after FreeBSD 14+ switched /sbin/ifconfig to netlink(4) PR: 287872 (cherry picked from commit 6d3bc576abbd84f736d917f5bfec4e3fe7e6c125) --- libexec/rc/network.subr | 20 ++++++++++++++++++++ libexec/rc/pccard_ether | 17 +++++++++-------- 2 files changed, 29 insertions(+), 8 deletions(-) diff --git a/libexec/rc/network.subr b/libexec/rc/network.subr index 931fbec19a60..2113a3f66f0f 100644 --- a/libexec/rc/network.subr +++ b/libexec/rc/network.subr @@ -653,6 +653,26 @@ ifexists() ${IFCONFIG_CMD} -n $1 > /dev/null 2>&1 } +# ifisup if +# Returns 0 if the interface exists and UP, +# returns 1 if the interface exists and not UP, +# returns 2 otherwise. +ifisup() +{ + local _if + + [ -z "$1" ] && return 1 + _if="$1" + + set -- $(${IFCONFIG_CMD} -n ${_if} 2>/dev/null) + case "$1$2" in + ${_if}:*']*) return 0 ;; + ${_if}:*) return 1 ;; + esac + + return 2 +} + # ipv4_up if # add IPv4 addresses to the interface $if ipv4_up() diff --git a/libexec/rc/pccard_ether b/libexec/rc/pccard_ether index 7ca58f210085..957983e55a8e 100755 --- a/libexec/rc/pccard_ether +++ b/libexec/rc/pccard_ether @@ -69,16 +69,17 @@ checkauto() pccard_ether_start() { - ifexists $ifn || exit 1 - - if [ -z "$rc_force" ]; then - for uif in `ifconfig -ul`; do - if [ "${uif}" = "${ifn}" ]; then - # Interface is already up, so ignore it. + ifisup $ifn + case $? in + 0) # Interface is already up, so ignore it. + if [ -z "$rc_force"]; then exit 0 fi - done - fi + ;; + 2) # Interface does not exist. + exit 1 + ;; + esac /etc/rc.d/netif quietstart $ifn From nobody Sun Jul 13 15:46:17 2025 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 4bg8tx4n1Vz617lj; Sun, 13 Jul 2025 15:46:17 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bg8tx2Qgxz45Gp; Sun, 13 Jul 2025 15:46:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752421577; 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=g7sGl0PtOjzlNhJeF4x349LRvpzaxgpmU3/dnu16qzM=; b=jgLCnwzeuTyg/lWl/P03QjowDB7/odsZLTI6XX9wHI9SvLdtUZZoaRt2k/widcxQTQ+3+f XKAUvYRfqZmitSgTwCq+Z4R9mNYNkYrJWviVAA7DTIqt8z1a49K5wlsdFm25G0wrXKfvPJ ggO1xMbZoT8XWXSSmsrhRkYsuaFCWY9RFaLr2eRGkQEb17mzUpwqngFMmiCxxiMKRdsWwx eXX+/K6MAFopG5PPGZkTO9Cqwyse8+Cka4oWYYYZJUzkGNK+ciPePVAFJR5UAqXCJCV2eF cIPM+8jQ2ntb7lUi8YkyCF9KHuKwwzTGHzAzQLOKCwsitThVHADsB2NaSajC0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752421577; 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=g7sGl0PtOjzlNhJeF4x349LRvpzaxgpmU3/dnu16qzM=; b=AwL+Xyx2onJCZqkpWUdUqejpTBA55fivOK8st8MvNPKjYt9rztRJDJUgZ+rQ1kw7MzI5nb afmHzVg4MLhk0qr7SPUeLE7kdzIVaFwItTFoRRY8oh2bCmG5x4zmyzMKWunZyiHmjb3+cE Qi+nXLTX4FwXME4zEs6JA9SA3aVaNfzWV9PDY4FIR42tPepWy/WYOzqk+oViJJwwCe80wF wUG9K2OMZbSUvszExe/PBcjhO3FjLSRPwf5FO5CnJnX+AwZPbsYOpTtSw+8R9yFBHSySDD yso7rz9ia/33gWYmg5U0HBL9bw+9pfTKu5jcetHuuhKEC2TSL+o7V6rXZVzKGQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752421577; a=rsa-sha256; cv=none; b=dTWYEx1ZlkgoLD6npTSTuqdkXdJWH7/vTLDsMwuuOSQNi9PJyRcD8Xn94GgI/9EyDsmDb2 hHiY15KJztgQ+NppuBC3RuUgtbVG/YIUhPPzYKfBIzXjMQ04RFt4+ysq+2I58bpisQQPdI ODzBi/yxMYOadaejAlKH6Ha8kf32XLeKKABdlr6yPoaA7IY+pOGI1hj/j3+HSYH+t6/zxy /85laYXNBHhWCbBKGuZjF+9hD0uJY8MXx/5jdS+8V8nnqsInntCdZLXwcwWYx4IM3IzbC1 3Jvp/vtBmzWFCQfvpsQyR81eMHZWb0nVfjYmRgh4dpPYtMVTCLkdqu+Qd6OThA== 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 4bg8tx20h1zDN; Sun, 13 Jul 2025 15:46:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56DFkHJl042463; Sun, 13 Jul 2025 15:46:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56DFkH88042460; Sun, 13 Jul 2025 15:46:17 GMT (envelope-from git) Date: Sun, 13 Jul 2025 15:46:17 GMT Message-Id: <202507131546.56DFkH88042460@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eugene Grosbein Subject: git: c4673251c979 - stable/14 - network.subr: MFC: correct return code in case of bad call to ifisup() 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: eugen X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c4673251c9793353d52ed2e56b54fd6557466ac1 Auto-Submitted: auto-generated The branch stable/14 has been updated by eugen: URL: https://cgit.FreeBSD.org/src/commit/?id=c4673251c9793353d52ed2e56b54fd6557466ac1 commit c4673251c9793353d52ed2e56b54fd6557466ac1 Author: Eugene Grosbein AuthorDate: 2025-07-01 14:33:19 +0000 Commit: Eugene Grosbein CommitDate: 2025-07-13 15:45:41 +0000 network.subr: MFC: correct return code in case of bad call to ifisup() This is rather cosmetic correction. PR: 287872 (cherry picked from commit 24e8ed535ff673b9ea751c3d3b2a68ef0a29b0e2) --- libexec/rc/network.subr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libexec/rc/network.subr b/libexec/rc/network.subr index 2113a3f66f0f..5e4f2c1f39a0 100644 --- a/libexec/rc/network.subr +++ b/libexec/rc/network.subr @@ -661,7 +661,7 @@ ifisup() { local _if - [ -z "$1" ] && return 1 + [ -z "$1" ] && return 2 _if="$1" set -- $(${IFCONFIG_CMD} -n ${_if} 2>/dev/null) From nobody Sun Jul 13 15:49:17 2025 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 4bg8yQ2w11z617mK; Sun, 13 Jul 2025 15:49:18 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bg8yP3sNGz46qH; Sun, 13 Jul 2025 15:49:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752421757; 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=+xULdIiDagW9gW0u3fF/2vF+tR/xuWTdMo7V4hMj9lU=; b=I3EwC7xeGpBKXS0EfijNI8UyuEPRIc3A56pQ1LzEhz7WiDjsQFvSWx3NhpfZmdv+QDrski Ft/2341B9dTolrv76J3kyzibqmbW/Rrm6V6/KERgujs9B2tCTZx6XV8mqK+zkE2COaVJOu jLWum5eM6WriJevfAoHpro63WY2VzF5sO6Yjg9X5jj4VIIZT2d13j0skIqP/Diroguh/9u xvNA0tPJdSbtd7VJ+xj8G2K4PDvef1wPYsYFvrNgBebo8X5eRkkSe5rd/yaqb970rtNyZ9 PFP7NG3g6gONfk2D+3jVMxV+jSVjvplQmH3F5uhHImZpvyqfWkIcoWF8xErsmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752421757; 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=+xULdIiDagW9gW0u3fF/2vF+tR/xuWTdMo7V4hMj9lU=; b=SJQcEPS35wqXp5AJXnM4BlWT4PMLZytX/INWq6Nmkim2En9RUh/yYe/GGfmf9yQPa/NkwS PFUuBVTVHzTRNKW9fGKWn72elZJc7bL1gD21fuuaeC2mOvCBzfnNVzfSMCzr7S59UScT9K MtJY3AiPk23vcSQ0FZhUjOrBmwvjQY7Sl0GtthXgGixkxOHf/AWpbP9l7Aof1ewJduDwWD aG4yXxtXeBAShwVHlve3RoOqI9hwhMAGEbjhmf+d3gVCpuK3dMGcsh0sPSUm6/OqBpzNV2 i1NhZ52B2JFEbdsPU3emt+NWrI1zlk3okAOxqJQ+zCSYHW66z9Ayq0suTMh3aQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752421757; a=rsa-sha256; cv=none; b=G2Aq1N6O95wzT3GcaKarn0AqfzkahkdslrkFJkd3bRlgKxV1/2R7KWFazmAikce7zDoBE+ 5NLyAPDYf9G+l1deobEGPvuHTL9Tams4msn9GS4Hw0uYmlE6rdHUp2W7UbKnbuBrF17fMy x++zDJamORmMcnRGlBUFP4JUR6NsHU/ZKDcCqgD6YtK0AzBOT9wTZZZmX37fVXItwQRt5P dTAwXXC7wPNChKaIR4TJCzps57sTjSf72G9tZ5WRc3aV3MSefBInmwQISBgk3EoWcaBDUD gH0DOjwci5wVWH3FbiWH8U+wnlhPkIdagmUjvpM0kRsL7wrZMp2xzPVINz0wuw== 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 4bg8yP2shtz9p; Sun, 13 Jul 2025 15:49:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56DFnHlM043477; Sun, 13 Jul 2025 15:49:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56DFnHBR043474; Sun, 13 Jul 2025 15:49:17 GMT (envelope-from git) Date: Sun, 13 Jul 2025 15:49:17 GMT Message-Id: <202507131549.56DFnHBR043474@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eugene Grosbein Subject: git: 5d15e09a26c6 - stable/13 - libexec/rc: MFC: improve performance of pccard_ether script 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: eugen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5d15e09a26c6b08fc0d5cd7deca082ba5b9cabd4 Auto-Submitted: auto-generated The branch stable/13 has been updated by eugen: URL: https://cgit.FreeBSD.org/src/commit/?id=5d15e09a26c6b08fc0d5cd7deca082ba5b9cabd4 commit 5d15e09a26c6b08fc0d5cd7deca082ba5b9cabd4 Author: Eugene Grosbein AuthorDate: 2025-07-01 14:13:10 +0000 Commit: Eugene Grosbein CommitDate: 2025-07-13 15:48:37 +0000 libexec/rc: MFC: improve performance of pccard_ether script Replace "ifconfig -ul" with "ifconfig -n" because netlink-enabled /sbin/ifconfig utility has sub-optimal performance for listing. Combined with the commit b1b17432aa1be670564161232d110461a5dde4ce, these changes mostly eliminate performance regression of the command "service devd start" for a system having hundreds of network interfaces created before devd starts, after FreeBSD 14+ switched /sbin/ifconfig to netlink(4) PR: 287872 (cherry picked from commit 6d3bc576abbd84f736d917f5bfec4e3fe7e6c125) (cherry picked from commit 24e8ed535ff673b9ea751c3d3b2a68ef0a29b0e2) --- libexec/rc/network.subr | 20 ++++++++++++++++++++ libexec/rc/pccard_ether | 17 +++++++++-------- 2 files changed, 29 insertions(+), 8 deletions(-) diff --git a/libexec/rc/network.subr b/libexec/rc/network.subr index 931fbec19a60..5e4f2c1f39a0 100644 --- a/libexec/rc/network.subr +++ b/libexec/rc/network.subr @@ -653,6 +653,26 @@ ifexists() ${IFCONFIG_CMD} -n $1 > /dev/null 2>&1 } +# ifisup if +# Returns 0 if the interface exists and UP, +# returns 1 if the interface exists and not UP, +# returns 2 otherwise. +ifisup() +{ + local _if + + [ -z "$1" ] && return 2 + _if="$1" + + set -- $(${IFCONFIG_CMD} -n ${_if} 2>/dev/null) + case "$1$2" in + ${_if}:*']*) return 0 ;; + ${_if}:*) return 1 ;; + esac + + return 2 +} + # ipv4_up if # add IPv4 addresses to the interface $if ipv4_up() diff --git a/libexec/rc/pccard_ether b/libexec/rc/pccard_ether index 7ca58f210085..957983e55a8e 100755 --- a/libexec/rc/pccard_ether +++ b/libexec/rc/pccard_ether @@ -69,16 +69,17 @@ checkauto() pccard_ether_start() { - ifexists $ifn || exit 1 - - if [ -z "$rc_force" ]; then - for uif in `ifconfig -ul`; do - if [ "${uif}" = "${ifn}" ]; then - # Interface is already up, so ignore it. + ifisup $ifn + case $? in + 0) # Interface is already up, so ignore it. + if [ -z "$rc_force"]; then exit 0 fi - done - fi + ;; + 2) # Interface does not exist. + exit 1 + ;; + esac /etc/rc.d/netif quietstart $ifn From nobody Sun Jul 13 17:09:08 2025 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 4bgBkY2yqtz61D6y; Sun, 13 Jul 2025 17:09:09 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bgBkX6pc0z4C9V; Sun, 13 Jul 2025 17:09:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752426549; 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=SkeX07Q62cznuLzB26r6xz3kDDQCsuJmrLfh0UhkmD8=; b=Qn6pjKUUd+cB4XSWjhB84ngnhPELMR54Y6eqNIj4mq8O5KguB1wELeHOSuldDiGe+oC8wu Vreje83vyfLwXnyPO4RtF99ljWdShPEKqfpfZZXXw823jcIWnkwkNAafqHupbgI0KtHbTZ 9ruzscF6n3rX7u3azsipGot+3filev0WXaIOToHPBJdK82mPD5+2dnXY6PfuLdcgB12u6J glEUpGcCCTBVBtXiK4jgacYhd1ZucCPaKdKuEdSFLlxp1AN1FvrLypyVOs1dYA51fSjyRL Ocy7yiAItdb5eZxudmwUdjX8gh9GbTEJtuMN+zku+XSHRWh5/i7OTcTAvWaAaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752426549; 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=SkeX07Q62cznuLzB26r6xz3kDDQCsuJmrLfh0UhkmD8=; b=uLc2jozItvkB7HHKWJxAOsN0U9KAoTY80VRw2biqe76+RVSo8KQjFnZiqejp9OTVebkGP1 FuIjWDGRe21GVlLMbsYI7wPIjrbaTEmkJSWJiTdZYY0Z2TeLw7bQC+HeVTcH4SMd0thQcl 5yV0H1gTxiOniMNinBHwtEU5YPlb0s16/FGFn5LcNmr/4bck40jymfe/9kjvCptE2aewLO gNcFiNdd8TCO2N1l5vI1Cvmd2MZmuUoR6jUjNpCMDrTV3ICIx5CfSet/yilhKqq0jeHET/ T8wXg4V18Q3LXy1mBekaU2ueDwgVWwDeHNkMgCAblVEocJsuxR6r+SwMFf69oQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752426549; a=rsa-sha256; cv=none; b=xfgF+TYSFUdZRrx071NmLOtws8KQpQTw5enI4I1UurRI4WhieI9L2Cjvgur13v6powgOXS /akVJYDgrAxIfxlrynNa8MjtapUEnL9znQKM1lDaK/rKCBw6NcyQGeoTZ9LDOyOMvFWOq2 zs1pRCnQ6vs9cGZYRE8ftmfcR4xYIW3d0ZtaQBKGqQTqrBUHRqbWpYdeTtVrYZiYIOOwtC bP7wy30G4iy6Jp4h3pI5Ol7bL4Qz59goGU0n7aZiZasDsW6MvuABkiBefdWwW3yAMyXtx6 gfTAY3Si3eNS87/2Wkm5/g2Jb9ANdsPgQ8I8Gb21r3KXaQwmnWjv5e6MwzsX4w== 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 4bgBkX5xb4z2cL; Sun, 13 Jul 2025 17:09:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56DH98sr094452; Sun, 13 Jul 2025 17:09:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56DH98qO094449; Sun, 13 Jul 2025 17:09:08 GMT (envelope-from git) Date: Sun, 13 Jul 2025 17:09:08 GMT Message-Id: <202507131709.56DH98qO094449@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Cox Subject: git: 2cfd6342ac84 - main - arm64 pmap: do not panic when unable to insert PTP into trie 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: alc X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2cfd6342ac84c6915106fbe141795ca23a96cbba Auto-Submitted: auto-generated The branch main has been updated by alc: URL: https://cgit.FreeBSD.org/src/commit/?id=2cfd6342ac84c6915106fbe141795ca23a96cbba commit 2cfd6342ac84c6915106fbe141795ca23a96cbba Author: Alan Cox AuthorDate: 2025-07-08 23:31:26 +0000 Commit: Alan Cox CommitDate: 2025-07-13 16:55:47 +0000 arm64 pmap: do not panic when unable to insert PTP into trie When pmap_enter_l2() needs to destroy an existing kernel superpage mapping, do not remove the saved page table page (PTP) from the pm_root trie and remap it into the page table. Instead, simply zero it. Then, later the PTP does not need to be unmapped and reinserted into the trie. If the kernel region is not mapped by a superpage, then try to insert the PTP into the pm_root trie before clearing the PTEs. If the PTP insertion fails, then we can return failure with the old mappings still in place. Convert an assertion from a panic to a KASSERT. Reviewed by: kib, markj (an earlier version) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D51220 --- sys/arm64/arm64/pmap.c | 84 ++++++++++++++++++++++++++++++++------------------ 1 file changed, 54 insertions(+), 30 deletions(-) diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c index dbd1ed7b316b..a09da794e77d 100644 --- a/sys/arm64/arm64/pmap.c +++ b/sys/arm64/arm64/pmap.c @@ -497,7 +497,8 @@ static bool pmap_pv_insert_l3c(pmap_t pmap, vm_offset_t va, vm_page_t m, struct rwlock **lockp); static void pmap_remove_kernel_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_t va); static int pmap_remove_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_t sva, - pd_entry_t l1e, struct spglist *free, struct rwlock **lockp); + pd_entry_t l1e, bool demote_kl2e, struct spglist *free, + struct rwlock **lockp); static int pmap_remove_l3(pmap_t pmap, pt_entry_t *l3, vm_offset_t sva, pd_entry_t l2e, struct spglist *free, struct rwlock **lockp); static bool pmap_remove_l3c(pmap_t pmap, pt_entry_t *l3p, vm_offset_t va, @@ -3847,8 +3848,7 @@ pmap_remove_kernel_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_t va) PMAP_LOCK_ASSERT(pmap, MA_OWNED); ml3 = pmap_remove_pt_page(pmap, va); - if (ml3 == NULL) - panic("pmap_remove_kernel_l2: Missing pt page"); + KASSERT(ml3 != NULL, ("pmap_remove_kernel_l2: missing pt page")); ml3pa = VM_PAGE_TO_PHYS(ml3); newl2 = PHYS_TO_PTE(ml3pa) | L2_TABLE; @@ -3873,8 +3873,8 @@ pmap_remove_kernel_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_t va) * pmap_remove_l2: Do the things to unmap a level 2 superpage. */ static int -pmap_remove_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_t sva, - pd_entry_t l1e, struct spglist *free, struct rwlock **lockp) +pmap_remove_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_t sva, pd_entry_t l1e, + bool demote_kl2e, struct spglist *free, struct rwlock **lockp) { struct md_page *pvh; pt_entry_t old_l2; @@ -3910,9 +3910,7 @@ pmap_remove_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_t sva, vm_page_aflag_clear(mt, PGA_WRITEABLE); } } - if (pmap == kernel_pmap) { - pmap_remove_kernel_l2(pmap, l2, sva); - } else { + if (pmap != kernel_pmap) { ml3 = pmap_remove_pt_page(pmap, sva); if (ml3 != NULL) { KASSERT(vm_page_any_valid(ml3), @@ -3923,6 +3921,14 @@ pmap_remove_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_t sva, ml3->ref_count = 0; pmap_add_delayed_free_list(ml3, free, false); } + } else if (demote_kl2e) { + pmap_remove_kernel_l2(pmap, l2, sva); + } else { + ml3 = vm_radix_lookup(&pmap->pm_root, pmap_l2_pindex(sva)); + if (vm_page_any_valid(ml3)) { + ml3->valid = 0; + pmap_zero_page(ml3); + } } return (pmap_unuse_pt(pmap, sva, l1e, free)); } @@ -4232,7 +4238,7 @@ pmap_remove1(pmap_t pmap, vm_offset_t sva, vm_offset_t eva, bool map_delete) if ((l3_paddr & ATTR_DESCR_MASK) == L2_BLOCK) { if (sva + L2_SIZE == va_next && eva >= va_next) { pmap_remove_l2(pmap, l2, sva, pmap_load(l1), - &free, &lock); + true, &free, &lock); continue; } else if (pmap_demote_l2_locked(pmap, l2, sva, &lock) == NULL) @@ -5747,33 +5753,51 @@ pmap_enter_l2(pmap_t pmap, vm_offset_t va, pd_entry_t new_l2, u_int flags, } } SLIST_INIT(&free); - if ((old_l2 & ATTR_DESCR_MASK) == L2_BLOCK) + if ((old_l2 & ATTR_DESCR_MASK) == L2_BLOCK) { (void)pmap_remove_l2(pmap, l2, va, - pmap_load(pmap_l1(pmap, va)), &free, lockp); - else + pmap_load(pmap_l1(pmap, va)), false, &free, lockp); + } else { + if (ADDR_IS_KERNEL(va)) { + /* + * Try to save the ptp in the trie + * before any changes to mappings are + * made. Abort on failure. + */ + mt = PTE_TO_VM_PAGE(old_l2); + if (pmap_insert_pt_page(pmap, mt, false, + false)) { + CTR1(KTR_PMAP, + "pmap_enter_l2: cannot ins kern ptp va %#lx", + va); + return (KERN_RESOURCE_SHORTAGE); + } + /* + * Both pmap_remove_l2() and + * pmap_remove_l3_range() will zero fill + * the L3 kernel page table page. + */ + } pmap_remove_l3_range(pmap, old_l2, va, va + L2_SIZE, &free, lockp); + if (ADDR_IS_KERNEL(va)) { + /* + * The TLB could have an intermediate + * entry for the L3 kernel page table + * page, so request an invalidation at + * all levels after clearing the + * L2_TABLE entry. + */ + pmap_clear(l2); + pmap_s1_invalidate_page(pmap, va, false); + } + } + KASSERT(pmap_load(l2) == 0, + ("pmap_enter_l2: non-zero L2 entry %p", l2)); if (!ADDR_IS_KERNEL(va)) { vm_page_free_pages_toq(&free, true); - KASSERT(pmap_load(l2) == 0, - ("pmap_enter_l2: non-zero L2 entry %p", l2)); } else { KASSERT(SLIST_EMPTY(&free), ("pmap_enter_l2: freed kernel page table page")); - - /* - * Both pmap_remove_l2() and pmap_remove_l3_range() - * will leave the kernel page table page zero filled. - * Nonetheless, the TLB could have an intermediate - * entry for the kernel page table page, so request - * an invalidation at all levels after clearing - * the L2_TABLE entry. - */ - mt = PTE_TO_VM_PAGE(pmap_load(l2)); - if (pmap_insert_pt_page(pmap, mt, false, false)) - panic("pmap_enter_l2: trie insert failed"); - pmap_clear(l2); - pmap_s1_invalidate_page(pmap, va, false); } } @@ -8426,8 +8450,8 @@ pmap_demote_l2_abort(pmap_t pmap, vm_offset_t va, pt_entry_t *l2, struct spglist free; SLIST_INIT(&free); - (void)pmap_remove_l2(pmap, l2, va, pmap_load(pmap_l1(pmap, va)), &free, - lockp); + (void)pmap_remove_l2(pmap, l2, va, pmap_load(pmap_l1(pmap, va)), true, + &free, lockp); vm_page_free_pages_toq(&free, true); } From nobody Sun Jul 13 18:01:38 2025 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 4bgCv65vr1z61H1g; Sun, 13 Jul 2025 18:01:38 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bgCv63SNhz3ZcH; Sun, 13 Jul 2025 18:01:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752429698; 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=mF6rLAruBZERo5QEaKT5X+ukY6p2A4Oq4AV3k4W11ho=; b=A+V0gH/79Fsq80Bc/t03Od67NUwoJWVoed6pIZRZcjw3MFPNWfk1mu/fJ/bErIKItgSnGa kGSxEVnbZ4vCHhmCjny0u8mQvPmfLu3RdXNe7TERkeHgJfro98gsXKoJPaqygQ4lmuyZDv FnQQ2zoCYsChW7hF8Zuwse+xQwOA77QfZMUdCZQ+AmlGzY8lJhy3aQmRVUCRYxjPJh3Q3v oJ28VfcnuZSuRlkfR9y6auVh3Qgcgr8rSJW3BHZMqWaeLG4RuvCC7hU58T83lubz8CS7y6 +I+jPB3iTWM1oZ4MgCJY2RarVqba0C/8DTZgAQJzcIxGh33VWn5K37Olf/1dKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752429698; 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=mF6rLAruBZERo5QEaKT5X+ukY6p2A4Oq4AV3k4W11ho=; b=MyBlLyw5a5fwuqNjIBKuSPNTEYHhB4UZ9buXHyeK6K8F0kdUJdI54QhQMM6WaMwLgX6pFX JSzlFvmHB4WsV18kXUG4tciqgijEf1nt6dl+MnHQHwoG0vmzToVz3p0u4fnN0uAt31c3RL H+bQFNBs+9d7tb6KBDKqvcweh8VLbh2nHXnLkMt5Lc2qgXGNz0L4SK104xInC/kwM2dRx7 DSohsZSEg5I4BQYMrAE6wdRhcy7uO6r3rEyUUFyV6H5tppOprMDzeiM5HiQdWuVicRI3hI enptBsg9LNXyUODTOT5yMzdcevko5GJ1VNFfYpaB9qxBusr0578i3jvDn1QPqA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752429698; a=rsa-sha256; cv=none; b=kHfCAtU8HZhlTbhl+YJEXTyKVWHFpSqh5kkbHW6kpRi5+s1P6am2U/KlT2qTGoxXYm6buD 0plE6Y+nkGAgeviWLjgsV+H/saBFxUSydGQpcfr4c56olyXY4RqNBkzUj3Y0zfC/hyILyc SKmlMZUf7+9GhYSE4083Dv5nZBdAFikOoAY1rpu7C7/6oYJeyjClmIY44J3ou1wdDM/GFo 96Lou0FGlMYKTwNA0IH3xPmvIYFTVAMWrntxQF6xN5hWBogDTZd/3Pg+zn3O6nBJj8PefZ pOcbkECOIK7z1+LP4PXenkByPo1NxOQHP3I3XVLBdIemOHUk8f1d+qcEV2l4VQ== 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 4bgCv633j1z4CY; Sun, 13 Jul 2025 18:01:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56DI1cMw099125; Sun, 13 Jul 2025 18:01:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56DI1cD1099122; Sun, 13 Jul 2025 18:01:38 GMT (envelope-from git) Date: Sun, 13 Jul 2025 18:01:38 GMT Message-Id: <202507131801.56DI1cD1099122@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Justin Hibbits Subject: git: 645bb3efc320 - main - powerpc: Reserve correct scratch region size below stack 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhibbits X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 645bb3efc3209a9ca6dfabb48b1c6475c1d965a9 Auto-Submitted: auto-generated The branch main has been updated by jhibbits: URL: https://cgit.FreeBSD.org/src/commit/?id=645bb3efc3209a9ca6dfabb48b1c6475c1d965a9 commit 645bb3efc3209a9ca6dfabb48b1c6475c1d965a9 Author: Timothy Pearson AuthorDate: 2025-07-06 19:24:07 +0000 Commit: Justin Hibbits CommitDate: 2025-07-13 18:00:56 +0000 powerpc: Reserve correct scratch region size below stack According to the ELF ABI v2, two scratch regions are reserved below the stack pointer, one 288 byte general region and one 224 byte compiler region. FreeBSD only reserved the 288 byte region. Follow the ELV v2 ABI and reserve the full 512 byte region as specified. Signed-off-by: Timothy Pearson MFC after: 1 week Pull Request: https://github.com/freebsd/freebsd-src/pull/1756 --- sys/powerpc/powerpc/exec_machdep.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/powerpc/powerpc/exec_machdep.c b/sys/powerpc/powerpc/exec_machdep.c index 1893d79f29a8..c6b2b01d9d30 100644 --- a/sys/powerpc/powerpc/exec_machdep.c +++ b/sys/powerpc/powerpc/exec_machdep.c @@ -214,10 +214,10 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask) sfpsize = sizeof(sf); #ifdef __powerpc64__ /* - * 64-bit PPC defines a 288 byte scratch region - * below the stack. + * 64-bit PPC defines a 512 byte red zone below + * the existing stack (ELF ABI v2 §2.2.2.4) */ - rndfsize = 288 + roundup(sizeof(sf), 48); + rndfsize = 512 + roundup(sizeof(sf), 48); #else rndfsize = roundup(sizeof(sf), 16); #endif From nobody Sun Jul 13 18:01:39 2025 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 4bgCv81tx1z61H5f; Sun, 13 Jul 2025 18:01:40 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bgCv75T5Bz3ZZB; Sun, 13 Jul 2025 18:01:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752429699; 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=Lw4JCuCIk84wEeml19a1HP9p4KbXZDbfvY2VCpyH1hQ=; b=PwIFIr6idzfK2HofrSPYHv7w25beJDoVqLY1YV9OhhpDx/g9qpn2WPQEg3fq20CuIQAp8T hYlSo64Xm8B+aXqwEtdcGp8FXkdsAH9e3u1nhAZqo0hOjLfhCMulP6hikFKvlF3gKFbJwu gnnsYe1tYZ6evLU2d5yVkHTST4wMX+Ds08AO6eg/cqa7f7dBV98rJ6p4jt3paIkH1bs/oV +5SISMH1dskBbCM0bMosc2W2/MXZjzcrPWP4SsAtJK+HOjOJWJmSjvyOhsO4D26mP4Nvg3 0tFOxi7+a+WdY3IhFttzm+C1KQF7UA5at8LZiLHlVkBTi90nvFOtkEoJv5vxoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752429699; 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=Lw4JCuCIk84wEeml19a1HP9p4KbXZDbfvY2VCpyH1hQ=; b=jh6ymG+7GR81HiDtnTiZDvLfP/UiygF1tEmS0lFNIV+1q9qLbNRhWCIrze+JuC03Khr6Oh G8pacA06WkayVxt9O9D7FhDl7L3GG1+gK2Za0GZiihg5EPQC0UiGlKle0exMKNGUjpEtMC S3wHIvVat7O4Xjkk7ZgnKk742ftIDFxKCaq3ACn3HsFMwcfubsCw7OpOobSwZAav/x9ans Xfv+RzxD7S0/6PrLYpZG12rrAWNjAjDNr0cArtzRAuWNGpCS9UAcFO7iruhxkp9eAy870o 3JxaHlJqDVNym7AYr8TSD72SJkM8aDeS4zrOUDh7k6BvNsThfMVVngk3FwOSWQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752429699; a=rsa-sha256; cv=none; b=s6BQcdNQJmCFFOW76jbIFJgX5TXWwe5g24y4ecXBank7invPa7zTGSFF5RvFFDANdP2RnW fJC/vw6AQm4NmZgizd8fuEgChk0URsLfIGf4lts8YTsZ9E1wvZIK+EXjqouRx7ulDC4Pig 0KwSr77zhREha1Cb/o6ZmgYOBlckC78urC0TbQ87BBa7su3Q223yP3ykO36Cx379mRJ7Iz FfgZx9cNqbyni8SbW5Az0PacInpbFpcZC+ig3TCjTK1j7q0B30oBFjjr2U3KUOprCqsWbU ifFW4s14bJfWUv0qKgpiogF2/D1e+a5eo8x2+zt8avML5vbVwWzs3iW7fUwv2Q== 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 4bgCv7400Mz48l; Sun, 13 Jul 2025 18:01:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56DI1dJA099159; Sun, 13 Jul 2025 18:01:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56DI1doG099156; Sun, 13 Jul 2025 18:01:39 GMT (envelope-from git) Date: Sun, 13 Jul 2025 18:01:39 GMT Message-Id: <202507131801.56DI1doG099156@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Justin Hibbits Subject: git: 077e30e61d7e - main - powerpc: Fix multiple issues with FP/VSX save/restore 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhibbits X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 077e30e61d7e1c90af7df31989bb976a3ace0c69 Auto-Submitted: auto-generated The branch main has been updated by jhibbits: URL: https://cgit.FreeBSD.org/src/commit/?id=077e30e61d7e1c90af7df31989bb976a3ace0c69 commit 077e30e61d7e1c90af7df31989bb976a3ace0c69 Author: Timothy Pearson AuthorDate: 2025-07-06 19:28:30 +0000 Commit: Justin Hibbits CommitDate: 2025-07-13 18:00:56 +0000 powerpc: Fix multiple issues with FP/VSX save/restore Multiple issues existed within the powerpc FP/VSX save/restore functionality, leading to register corruption and loss of register contents in specific scenarios involving high signal load and use of both floating point and VSX instructions. Issue #1 On little endian systems the PCB used the wrong location for the shadowed FP register within the larger VSX register. This appears to have been an attempt to correct issue #2 without understanding how the vector load/store instructions actually operate. Issue #2 On little endian systems, the VSX state save/restore routines swapped 32-bit words within the 64-bit aliased double word for the associated floating point register. This was due to the use of a word-oriented load/store vs. doubleword oriented load/store. Issue #3 The FPU was turned off in the PCB but not in hardware, leading to a potential race condition if the same thread was scheduled immediately after sigreturn. The triggering codebase for this is Go, which makes heavy use of signals and and generates an unusual mix of floating point and VSX assembler. As a result, when combined with th powerpc lazy FPU restore, a condition was repeatedly hit whereby the thread was interrupted in FP+VSX mode, then restored in FP only mode, thus reliably triggering the issues above. Also clean up the associated asm() style issue flagged by GitHub Actions. Signed-off-by: Timothy Pearson MFC after: 1 week Pull Request: https://github.com/freebsd/freebsd-src/pull/1756 --- sys/powerpc/include/pcb.h | 10 +--------- sys/powerpc/include/ucontext.h | 2 ++ sys/powerpc/powerpc/exec_machdep.c | 33 ++++++++++++++++++++++++--------- sys/powerpc/powerpc/fpu.c | 30 ++++++++++++++++++++++++++---- 4 files changed, 53 insertions(+), 22 deletions(-) diff --git a/sys/powerpc/include/pcb.h b/sys/powerpc/include/pcb.h index 050ada6b0f64..0230cf78aba7 100644 --- a/sys/powerpc/include/pcb.h +++ b/sys/powerpc/include/pcb.h @@ -66,16 +66,8 @@ struct pcb { #define PCB_VECREGS 0x200 /* Process had Altivec registers initialized */ struct fpu { union { -#if _BYTE_ORDER == _BIG_ENDIAN - double fpr; - uint32_t vsr[4]; -#else uint32_t vsr[4]; - struct { - double padding; - double fpr; - }; -#endif + double fpr; } fpr[32]; double fpscr; /* FPSCR stored as double for easier access */ } pcb_fpu; /* Floating point processor */ diff --git a/sys/powerpc/include/ucontext.h b/sys/powerpc/include/ucontext.h index d35c6c773fe0..dc87edd578bc 100644 --- a/sys/powerpc/include/ucontext.h +++ b/sys/powerpc/include/ucontext.h @@ -41,6 +41,7 @@ typedef struct __mcontext { int mc_flags; #define _MC_FP_VALID 0x01 #define _MC_AV_VALID 0x02 +#define _MC_VS_VALID 0x04 int mc_onstack; /* saved onstack flag */ int mc_len; /* sizeof(__mcontext) */ __uint64_t mc_avec[32*2]; /* vector register file */ @@ -56,6 +57,7 @@ typedef struct __mcontext32 { int mc_flags; #define _MC_FP_VALID 0x01 #define _MC_AV_VALID 0x02 +#define _MC_VS_VALID 0x04 int mc_onstack; /* saved onstack flag */ int mc_len; /* sizeof(__mcontext) */ uint64_t mc_avec[32*2]; /* vector register file */ diff --git a/sys/powerpc/powerpc/exec_machdep.c b/sys/powerpc/powerpc/exec_machdep.c index c6b2b01d9d30..8a33d0f589a7 100644 --- a/sys/powerpc/powerpc/exec_machdep.c +++ b/sys/powerpc/powerpc/exec_machdep.c @@ -349,13 +349,6 @@ sys_sigreturn(struct thread *td, struct sigreturn_args *uap) if (error != 0) return (error); - /* - * Save FPU state if needed. User may have changed it on - * signal handler - */ - if (uc.uc_mcontext.mc_srr1 & PSL_FP) - save_fpu(td); - kern_sigprocmask(td, SIG_SETMASK, &uc.uc_sigmask, NULL, 0); CTR3(KTR_SIG, "sigreturn: return td=%p pc=%#x sp=%#x", @@ -432,6 +425,7 @@ grab_mcontext(struct thread *td, mcontext_t *mcp, int flags) } if (pcb->pcb_flags & PCB_VSX) { + mcp->mc_flags |= _MC_VS_VALID; for (i = 0; i < 32; i++) memcpy(&mcp->mc_vsxfpreg[i], &pcb->pcb_fpu.fpr[i].vsr[2], sizeof(double)); @@ -481,6 +475,7 @@ set_mcontext(struct thread *td, mcontext_t *mcp) struct pcb *pcb; struct trapframe *tf; register_t tls; + register_t msr; int i; pcb = td->td_pcb; @@ -531,6 +526,22 @@ set_mcontext(struct thread *td, mcontext_t *mcp) tf->srr1 &= ~(PSL_FP | PSL_VSX | PSL_VEC); pcb->pcb_flags &= ~(PCB_FPU | PCB_VSX | PCB_VEC); + /* + * Ensure the FPU is also disabled in hardware. + * + * Without this, it's possible for the register reload to fail if we + * don't switch to a FPU disabled context before resuming the original + * thread. Specifically, if the FPU/VSX unavailable exception is never + * hit, then whatever data is still in the FP/VSX registers when + * sigresume is callled will used by the resumed thread, instead of the + * previously saved data from the mcontext. + */ + critical_enter(); + msr = mfmsr() & ~(PSL_FP | PSL_VSX | PSL_VEC); + isync(); + mtmsr(msr); + critical_exit(); + if (mcp->mc_flags & _MC_FP_VALID) { /* enable_fpu() will happen lazily on a fault */ pcb->pcb_flags |= PCB_FPREGS; @@ -539,8 +550,12 @@ set_mcontext(struct thread *td, mcontext_t *mcp) for (i = 0; i < 32; i++) { memcpy(&pcb->pcb_fpu.fpr[i].fpr, &mcp->mc_fpreg[i], sizeof(double)); - memcpy(&pcb->pcb_fpu.fpr[i].vsr[2], - &mcp->mc_vsxfpreg[i], sizeof(double)); + } + if (mcp->mc_flags & _MC_VS_VALID) { + for (i = 0; i < 32; i++) { + memcpy(&pcb->pcb_fpu.fpr[i].vsr[2], + &mcp->mc_vsxfpreg[i], sizeof(double)); + } } } diff --git a/sys/powerpc/powerpc/fpu.c b/sys/powerpc/powerpc/fpu.c index 0eaff2ea4932..cc8f22f7dda3 100644 --- a/sys/powerpc/powerpc/fpu.c +++ b/sys/powerpc/powerpc/fpu.c @@ -64,8 +64,19 @@ save_fpu_int(struct thread *td) * Save the floating-point registers and FPSCR to the PCB */ if (pcb->pcb_flags & PCB_VSX) { - #define SFP(n) __asm ("stxvw4x " #n ", 0,%0" \ +#if _BYTE_ORDER == _BIG_ENDIAN + #define SFP(n) __asm("stxvw4x " #n ", 0,%0" \ :: "b"(&pcb->pcb_fpu.fpr[n])); +#else + /* + * stxvw2x will swap words within the FP double word on LE systems, + * leading to corruption if VSX is used to store state and FP is + * subsequently used to restore state. + * Use stxvd2x instead. + */ + #define SFP(n) __asm("stxvd2x " #n ", 0,%0" \ + :: "b"(&pcb->pcb_fpu.fpr[n])); +#endif SFP(0); SFP(1); SFP(2); SFP(3); SFP(4); SFP(5); SFP(6); SFP(7); SFP(8); SFP(9); SFP(10); SFP(11); @@ -76,7 +87,7 @@ save_fpu_int(struct thread *td) SFP(28); SFP(29); SFP(30); SFP(31); #undef SFP } else { - #define SFP(n) __asm ("stfd " #n ", 0(%0)" \ + #define SFP(n) __asm("stfd " #n ", 0(%0)" \ :: "b"(&pcb->pcb_fpu.fpr[n].fpr)); SFP(0); SFP(1); SFP(2); SFP(3); SFP(4); SFP(5); SFP(6); SFP(7); @@ -149,8 +160,19 @@ enable_fpu(struct thread *td) :: "b"(&pcb->pcb_fpu.fpscr)); if (pcb->pcb_flags & PCB_VSX) { - #define LFP(n) __asm ("lxvw4x " #n ", 0,%0" \ +#if _BYTE_ORDER == _BIG_ENDIAN + #define LFP(n) __asm("lxvw4x " #n ", 0,%0" \ + :: "b"(&pcb->pcb_fpu.fpr[n])); +#else + /* + * lxvw4x will swap words within the FP double word on LE systems, + * leading to corruption if FP is used to store state and VSX is + * subsequently used to restore state. + * Use lxvd2x instead. + */ + #define LFP(n) __asm("lxvd2x " #n ", 0,%0" \ :: "b"(&pcb->pcb_fpu.fpr[n])); +#endif LFP(0); LFP(1); LFP(2); LFP(3); LFP(4); LFP(5); LFP(6); LFP(7); LFP(8); LFP(9); LFP(10); LFP(11); @@ -161,7 +183,7 @@ enable_fpu(struct thread *td) LFP(28); LFP(29); LFP(30); LFP(31); #undef LFP } else { - #define LFP(n) __asm ("lfd " #n ", 0(%0)" \ + #define LFP(n) __asm("lfd " #n ", 0(%0)" \ :: "b"(&pcb->pcb_fpu.fpr[n].fpr)); LFP(0); LFP(1); LFP(2); LFP(3); LFP(4); LFP(5); LFP(6); LFP(7); From nobody Sun Jul 13 18:01:40 2025 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 4bgCv91N7Qz61Gsm; Sun, 13 Jul 2025 18:01:41 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bgCv85Pqdz3Zs1; Sun, 13 Jul 2025 18:01:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752429700; 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=C/koMnMwzluD4Yk5TBNK6CPT9JLeGE4mnfXqC1R5GDA=; b=aGVzpvqN8dc+xiBw8nOMYCfp9MN31KFY3H6hN6kbNdOFRL1m3UfmgyCggIzhbjkPC3f5OJ wb19/kXAnymqVB+YHZScA+Ajr4Y+nvEElvjEYp2ihHNLvUr9cr9NuN7glGdIsGta7gGuLQ DST1BZErRJ/P2TXtFurrksNbuIznGYa96ae9tGmpBl3hrS2wdT2pRJNyk8T6TPqUbmI+Jo DoqULT4ck0X5p2Vz+4Fp0WFq+ddy6yEHTdDYI9/IgPv3PGik/eg76ZeuH3C6UrHcikVX4u HvNUUjwEQNRWFJUjQHsPhIyIcoOMzkP2AG1sJ7uj3Nd+yhRy8c2fCt9A64aWiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752429700; 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=C/koMnMwzluD4Yk5TBNK6CPT9JLeGE4mnfXqC1R5GDA=; b=sD5Wb0B223xmvcPHxSEeqFSk+BVl74qiU59E7WXuMsgSwZpbOsHRPdlYw13/L/XLvgjKHd xL2U3NdONUZMWbp+N+ypimTObZ1nEzJHcWwfXPEMXq6/jos+rRENNZiurgt4+qhr2uuZER cfiYg0Jma2kc+pm9U20pHQjJ3a974r8yDFVQYiEDQbjDmjNsOiuMaBvioyHmtPFNeGpHCp zX8jON8NHIQ9yp4httnbj9KKdZv41sQs8EPekxMPOW9BleJAigHaKr/arzT8kLLq1+Y26o 94p3Z8mFQodARdhyfeJ/x/lGIxhMyt+j9KPS80fCGBOxoQohoIb3ifSWWw0GHw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752429700; a=rsa-sha256; cv=none; b=ji8w4rW9cQYkx5J8RzTTmMjRBueF9H/rFJZMdMDXKomxM/43JYS8OqXlDh5kzmokICk4OR gDCCm6ry+v6qM45qgdvEF6PAoIa3LeT2Yh+Jg5nm07HqtkjEeIoHp2PXOt+vnea2pSTPR5 0hoiJIyrKoGO8aMpEFBVsuAi5U8XwTFkt9bsHdBTggagm8a12OC8XWhmli5Kzl77FObzH0 jMVbfCqqrF9+nu0HbDljVdLFdLSdxpoIL/O2Yx0KcrGelcRnmqyX3N1Kfp4klgtbEehErn QQxQLeh/i+GYidGSoCTKsq+YkfdsVnZxZoNAl+JLnGrMKHA+zd1LQFrWhBplhQ== 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 4bgCv84y1cz4Cs; Sun, 13 Jul 2025 18:01:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56DI1e7P099197; Sun, 13 Jul 2025 18:01:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56DI1ewi099194; Sun, 13 Jul 2025 18:01:40 GMT (envelope-from git) Date: Sun, 13 Jul 2025 18:01:40 GMT Message-Id: <202507131801.56DI1ewi099194@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Justin Hibbits Subject: git: 8efa35fea384 - main - libc/powerpc64: Fix swapcontext(3) 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhibbits X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8efa35fea384d209c683dfbae8f49f2737a41941 Auto-Submitted: auto-generated The branch main has been updated by jhibbits: URL: https://cgit.FreeBSD.org/src/commit/?id=8efa35fea384d209c683dfbae8f49f2737a41941 commit 8efa35fea384d209c683dfbae8f49f2737a41941 Author: Timothy Pearson AuthorDate: 2025-07-08 13:41:15 +0000 Commit: Justin Hibbits CommitDate: 2025-07-13 18:00:56 +0000 libc/powerpc64: Fix swapcontext(3) On PowerPC platforms a valid link to the Table of Contents (TOC) is required for PLT lookups to function. This TOC pointer is stored in a dedicated register, and is used along with the stack pointer by both C prologue and PLT lookup code. When calling swapcontext() with uc_link != NULL, a PLT lookup to setcontext(3) is attempted from within the _ctx_done context. The exiting process has usually trashed both r1 and r2 at this point, leading to a crash within the PLT lookup before setcontext(2) is reached to restore the linked context. Save and restore r2 as in a regular function. This ensures the subsequent PLT lookup to setcontext(3) succeeds. Signed-off-by: Timothy Pearson MFC after: 1 week Pull Request: https://github.com/freebsd/freebsd-src/pull/1759 --- lib/libc/powerpc64/gen/_ctx_start.S | 14 ++++++++ lib/libc/powerpc64/gen/makecontext.c | 3 +- lib/libc/tests/sys/Makefile | 4 +-- lib/libc/tests/sys/swapcontext_test.c | 63 +++++++++++++++++++++++++++++++++++ 4 files changed, 81 insertions(+), 3 deletions(-) diff --git a/lib/libc/powerpc64/gen/_ctx_start.S b/lib/libc/powerpc64/gen/_ctx_start.S index c2f8abfd6486..98225f9c1138 100644 --- a/lib/libc/powerpc64/gen/_ctx_start.S +++ b/lib/libc/powerpc64/gen/_ctx_start.S @@ -34,6 +34,16 @@ ld %r2,8(%r14) ld %r14,0(%r14) #else + /* + * The stack frame was already set up in makecontext(), + * so we can safely use the guaranteed fields here. + * + * Note we do step on the allocated stack frame's TOC, + * but since we never return from this function (i.e. + * never restore the stack frame) this should be safe. + */ + std %r2,24(%r1) /* save TOC */ + /* Load global entry point */ mr %r12,%r14 #endif @@ -41,6 +51,10 @@ blrl /* branch to start function */ mr %r3,%r15 /* pass pointer to ucontext as argument */ nop +#if defined(_CALL_ELF) && _CALL_ELF != 1 + /* Restore TOC */ + ld %r2,24(%r1) +#endif bl CNAME(_ctx_done) /* branch to ctxt completion func */ /* * we should never return from the diff --git a/lib/libc/powerpc64/gen/makecontext.c b/lib/libc/powerpc64/gen/makecontext.c index 75c2d40bdd60..9e3a976fa1bd 100644 --- a/lib/libc/powerpc64/gen/makecontext.c +++ b/lib/libc/powerpc64/gen/makecontext.c @@ -78,7 +78,7 @@ __makecontext(ucontext_t *ucp, void (*start)(void), int argc, ...) */ stackargs = (argc > 8) ? argc - 8 : 0; sp = (char *) ucp->uc_stack.ss_sp + ucp->uc_stack.ss_size - - sizeof(uintptr_t)*(stackargs + 2); + - sizeof(uintptr_t)*(stackargs + 6); sp = (char *)((uintptr_t)sp & ~0x1f); mc = &ucp->uc_mcontext; @@ -119,6 +119,7 @@ __makecontext(ucontext_t *ucp, void (*start)(void), int argc, ...) mc->mc_srr0 = *(uintptr_t *)_ctx_start; #else mc->mc_srr0 = (uintptr_t) _ctx_start; + mc->mc_gpr[12] = (uintptr_t) _ctx_start;/* required for prologue */ #endif mc->mc_gpr[1] = (uintptr_t) sp; /* new stack pointer */ mc->mc_gpr[14] = (uintptr_t) start; /* r14 <- start */ diff --git a/lib/libc/tests/sys/Makefile b/lib/libc/tests/sys/Makefile index 89d341ff400a..88f8191a16eb 100644 --- a/lib/libc/tests/sys/Makefile +++ b/lib/libc/tests/sys/Makefile @@ -7,11 +7,11 @@ ATF_TESTS_C+= brk_test .endif ATF_TESTS_C+= cpuset_test ATF_TESTS_C+= errno_test +ATF_TESTS_C+= swapcontext_test ATF_TESTS_C+= queue_test ATF_TESTS_C+= sendfile_test -# TODO: clone, lwp_create, lwp_ctl, posix_fadvise, recvmmsg, -# swapcontext +# TODO: clone, lwp_create, lwp_ctl, posix_fadvise, recvmmsg NETBSD_ATF_TESTS_C+= access_test NETBSD_ATF_TESTS_C+= bind_test NETBSD_ATF_TESTS_C+= chroot_test diff --git a/lib/libc/tests/sys/swapcontext_test.c b/lib/libc/tests/sys/swapcontext_test.c new file mode 100644 index 000000000000..f341a746e515 --- /dev/null +++ b/lib/libc/tests/sys/swapcontext_test.c @@ -0,0 +1,63 @@ +/*- + * Copyright (c) 2025 Raptor Computing Systems, LLC + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#include +#include +#include +#include + +#include + +#define STACK_SIZE (64ull << 10) + +static volatile int callback_reached = 0; + +static ucontext_t uctx_save, uctx_switch; + +static void swapcontext_callback() +{ + // Increment callback reached variable + // If this is called multiple times, we will fail the test + // If this is not called at all, we will fail the test + callback_reached++; +} + +ATF_TC(swapcontext_basic); +ATF_TC_HEAD(swapcontext_basic, tc) +{ + atf_tc_set_md_var(tc, "descr", + "Verify basic functionality of swapcontext"); +} + +ATF_TC_BODY(swapcontext_basic, tc) +{ + char *stack; + int res; + + stack = malloc(STACK_SIZE); + ATF_REQUIRE_MSG(stack != NULL, "malloc failed: %s", strerror(errno)); + res = getcontext(&uctx_switch); + ATF_REQUIRE_MSG(res == 0, "getcontext failed: %s", strerror(errno)); + + uctx_switch.uc_stack.ss_sp = stack; + uctx_switch.uc_stack.ss_size = STACK_SIZE; + uctx_switch.uc_link = &uctx_save; + makecontext(&uctx_switch, swapcontext_callback, 0); + + res = swapcontext(&uctx_save, &uctx_switch); + + ATF_REQUIRE_MSG(res == 0, "swapcontext failed: %s", strerror(errno)); + ATF_REQUIRE_MSG(callback_reached == 1, + "callback failed, reached %d times", callback_reached); +} + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, swapcontext_basic); + + return (atf_no_error()); +} + From nobody Sun Jul 13 18:24:51 2025 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 4bgDPv6mB3z61JY6; Sun, 13 Jul 2025 18:24:51 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bgDPv3f0Sz3tVs; Sun, 13 Jul 2025 18:24:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752431091; 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=yYkkP2RT7hcdjo9XsvcMP1EgPdpPcHyBc6sIPue57DU=; b=R+HTz1lcp5KLcO6pCGEP1rajXUzqB5H66+2Zdt0nTPTr+CpNYD7W5lkJr4LRdg6idZr7ZV ZWsWbdnaITTHciODJfYah8/eOqqJeO53DiKpnfch+ILPjBUDq1pNVJh3yB/UeH8Zkfiesq I5UY6ilm0kh8Dw1W4h/fQgJW5GwjRbQTppcUWoXr0VUNcJOR1fz8dNdBTjn2ZvrdfRFyOQ VIPou1Eubwp8uQcH4fd9pDdi/VhEKTLw50E41wkSD8iCtH9KBvxz65CbtLPTyAR5cTWtIO CBu1g/v3yeHlYsMZVdWa/uoD+PbLPXLX/95QoKykKRSXuBYkewu1uck/N3UQ7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752431091; 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=yYkkP2RT7hcdjo9XsvcMP1EgPdpPcHyBc6sIPue57DU=; b=bZWqyIWwOgfk+kFiTuUXlGIPrypXe4BHE9Mv99KCr/g1GcmRVKAhQltF8GufJY4zNTz4Y7 tZTlv10btL2uBRVt5/Cfioo/eG0IFJ7HHSLV9gRkdnImFijKOcimbX0+KnNWTpnsGEbzSH 4x5c/UXfvZvoRbHjmdAoywGjd/eq2KKrjRZHRfbxsIHtqU7+Unquua+JUPX2CkxpxFzuIG MjGbKdsjd4jum2cFqm87Y6gfODuz3ob9Ul2TtebK84LZTAEESfJVEczmQJkNrgwu3t/Tbx 2/JoGcbcEEubGfeHd5gR45BUz2OUipEKXJ8YFUY3omgoeOPUwOQr5UeS0d++mg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752431091; a=rsa-sha256; cv=none; b=hJ+1CZAiphPlPGobgRWQL/8xfGFlAyq3A+MHqP8tOeSmFNxp85NRtZejylIii6V0dMiZZA wVs1PuT7cy3m+FKmh/vhXqq0pT3BxE0dhFmPMc1X3YDABvShJNY5DeKX9jIcb7xVlglH3J dM/phf8zNuf9hR1by7WLdw/uJyTkkhfDH3m/U6nzKWMXUrCzNrBJ9Nyst9Wa+UyOMM2X9S wUQHRRBH2KrW1brnP09slcn1vm9DBWLZGiG/1wJU0RP+bZdJCWIPuQB0ShDal3zhkE0YJi GLg4/R78aQzHJbJuYMCTcuEO30ugu3IP1yOyLFG/uQYNYQytCTchaIPbLAe6XA== 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 4bgDPv2pP0z4kP; Sun, 13 Jul 2025 18:24:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56DIOpxD043826; Sun, 13 Jul 2025 18:24:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56DIOpn0043823; Sun, 13 Jul 2025 18:24:51 GMT (envelope-from git) Date: Sun, 13 Jul 2025 18:24:51 GMT Message-Id: <202507131824.56DIOpn0043823@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: da89500adbea - main - rc_subr_test: Bump some sleep timeouts 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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/main X-Git-Reftype: branch X-Git-Commit: da89500adbea360533d2442a674c8af0741b7ff1 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=da89500adbea360533d2442a674c8af0741b7ff1 commit da89500adbea360533d2442a674c8af0741b7ff1 Author: Mark Johnston AuthorDate: 2025-07-13 15:08:00 +0000 Commit: Mark Johnston CommitDate: 2025-07-13 18:24:36 +0000 rc_subr_test: Bump some sleep timeouts The test verifies that the rc framework will OOM-protect a process spawned by rc. It just wraps a 5-second /bin/sleep invocation as part of this test. The rc framework uses procctl to set the OOM-protect bit after the process has started, i.e., it uses procctl -p. So, with a 5 second timeout, it's possible for the process to exit before procctl actually runs, if the system is heavily loaded. (I see this failure occasionally with KMSAN configured and many tests running in parallel.) Bump the timeout to reduce the risk of this happening. The timeout value is arbitrary since the test will stop the rc process, i.e., we don't have to wait for 60 seconds to elapse before the test passes. MFC after: 1 week --- libexec/rc/tests/rc_subr_test.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libexec/rc/tests/rc_subr_test.sh b/libexec/rc/tests/rc_subr_test.sh index 60f77c2c2de3..9931389e7a02 100644 --- a/libexec/rc/tests/rc_subr_test.sh +++ b/libexec/rc/tests/rc_subr_test.sh @@ -52,7 +52,7 @@ oomprotect_all_body() _rc_arg="$4" setvar "${name}_oomprotect" all command="/usr/sbin/daemon" - command_args="-P $pidfile -p $_childpidfile -- /bin/sleep 5" + command_args="-P $pidfile -p $_childpidfile -- /bin/sleep 60" run_rc_command "$_rc_arg" LITERAL @@ -92,7 +92,7 @@ oomprotect_yes_body() setvar "${name}_oomprotect" yes procname="/bin/sleep" command="/usr/sbin/daemon" - command_args="-p $pidfile -- $procname 5" + command_args="-p $pidfile -- $procname 60" run_rc_command "$_rc_arg" LITERAL From nobody Sun Jul 13 18:24:52 2025 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 4bgDPw6X3wz61JZd; Sun, 13 Jul 2025 18:24:52 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bgDPw3ynVz3tbK; Sun, 13 Jul 2025 18:24:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752431092; 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=wvDq1YgT29nhrJNana5uF3u7lC7RSqkeX2pCpumfsAM=; b=nIBueT2k0y7yGl0N3uEgrhASGIurXPislWVcjhXdU97Bx8WfDIG25snhqfqAyDA97ZsNUM 4zjOxh92tpRkrii/f3e94OJSD4TSU1az2AvGXywbo/15YPfWUdLcEjtcTvpi2WpCV7lZtF +yRhbMMVBov+Btv/PRt7sVzsI0rUbbUVaXKBpGof4SoNcyTYCj6HcJ6VKWVsQnOwHDjIUk ThvfaQ/gVZMdBLyQ3g1LG1PSuJWwDRljT4aLh40PTiy+YlGC1yiLS1/J1YFUFjAsi4aRnT hZmbKuSfFkdhKPa8xbi9ARGJJnD31xEqlwm/qSrtG8BKYbIRk8zjb9wZEPoT6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752431092; 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=wvDq1YgT29nhrJNana5uF3u7lC7RSqkeX2pCpumfsAM=; b=Q/fuH2HExYxPhZbPUv0gOUVzf8lhkltof83fFJlOrlQeY1c1KIauX7GidXerUc4o7UxCC1 lvg31b1laibCa3nvddsl+kUe/Y02265nZd6gfsnJmsCrJAF4gvdX7GrfKm6t9a4iAmm/O8 /qQvhAarPBdq86oSkt81sCynYUg2DM22JCpDxxwMkpQy7ZXEtFh5ftL0gm6gT11pHvslcI w88JEw0bRPjQTzOV/QYybJxK5VrKYoOL9GOFPt5zVu5so/OOGnuFFatqrSOc7WuhLgar/1 AV57umH/f5HVCOz0AEt5vLd93w6ofMIBp6rd2fZTxjRhBi3K9nqeTt9mQFEWgg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752431092; a=rsa-sha256; cv=none; b=qLu3aDEc9QywyPmT1hb7m5l8dk+bxCT0QE47PpAAYJpohqD5Ba/1oPdqKlS+UxpTN9Exg0 C8b2aSvCxmL//sqI0lo+Z50hSGXipTuzfu623eREGwD21hirk3btsG6tQBHkLZB6plsyOh 7pQvH6qAi6CY8biBhswAS7JtMOWWtHpGTtdDrYp4fY0RB7VRDtzp6BRy64mKdggxHtRBPq FOn1qGtwjxJtpFbHpuxQvXMj4Wo8AXbuZqtWLDRxxGYwkxwJtSlNJIntnq6Y4yqeYRZwq0 wyK6H1XaTtd+zjIAn4Oh8UbwAPiA/Y+W5bZeQPg8xkbFc8RYrO57k1yd4T7d8A== 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 4bgDPw3R8vz51F; Sun, 13 Jul 2025 18:24:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56DIOqNf043863; Sun, 13 Jul 2025 18:24:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56DIOqxd043860; Sun, 13 Jul 2025 18:24:52 GMT (envelope-from git) Date: Sun, 13 Jul 2025 18:24:52 GMT Message-Id: <202507131824.56DIOqxd043860@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: 9f6718073382 - main - msdosfs: Fix handling of eofflag in VOP_READDIR 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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/main X-Git-Reftype: branch X-Git-Commit: 9f6718073382608519912e178e4c313dd61246b3 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=9f6718073382608519912e178e4c313dd61246b3 commit 9f6718073382608519912e178e4c313dd61246b3 Author: Mark Johnston AuthorDate: 2025-07-13 15:05:51 +0000 Commit: Mark Johnston CommitDate: 2025-07-13 18:24:36 +0000 msdosfs: Fix handling of eofflag in VOP_READDIR We also need to set it when an end-of-directory marker is reached. Reported by: vishwin Reviewed by: kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D51290 --- sys/fs/msdosfs/msdosfs_vnops.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/sys/fs/msdosfs/msdosfs_vnops.c b/sys/fs/msdosfs/msdosfs_vnops.c index 5db61c8951f6..33e0d94954d7 100644 --- a/sys/fs/msdosfs/msdosfs_vnops.c +++ b/sys/fs/msdosfs/msdosfs_vnops.c @@ -1521,6 +1521,9 @@ msdosfs_readdir(struct vop_readdir_args *ap) ap->a_vp, uio, ap->a_cred, ap->a_eofflag); #endif + if (ap->a_eofflag != NULL) + *ap->a_eofflag = 0; + /* * msdosfs_readdir() won't operate properly on regular files since * it does i/o only with the filesystem vnode, and hence can @@ -1614,8 +1617,11 @@ msdosfs_readdir(struct vop_readdir_args *ap) on = (offset - bias) & pmp->pm_crbomask; n = min(pmp->pm_bpcluster - on, uio->uio_resid); diff = dep->de_FileSize - (offset - bias); - if (diff <= 0) - break; + if (diff <= 0) { + if (ap->a_eofflag != NULL) + *ap->a_eofflag = 1; + goto out; + } n = min(n, diff); error = pcbmap(dep, lbn, &bn, &cn, &blsize); if (error) @@ -1646,6 +1652,8 @@ msdosfs_readdir(struct vop_readdir_args *ap) */ if (dentp->deName[0] == SLOT_EMPTY) { brelse(bp); + if (ap->a_eofflag != NULL) + *ap->a_eofflag = 1; goto out; } /* @@ -1743,15 +1751,6 @@ out: uio->uio_offset = off; - /* - * Set the eofflag (NFS uses it) - */ - if (ap->a_eofflag) { - if (dep->de_FileSize - (offset - bias) <= 0) - *ap->a_eofflag = 1; - else - *ap->a_eofflag = 0; - } return (error); } From nobody Sun Jul 13 19:31:01 2025 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 4bgFtG1WzQz61NCs; Sun, 13 Jul 2025 19:31:02 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bgFtG0ZdCz3k09; Sun, 13 Jul 2025 19:31:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752435062; 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=8b58XgNvL8NPPwQ8e7wsD2XtVOD/NzrSHjyGEgXt+nU=; b=Qona6dos7gPN4CokOtjVQMtOrwCr1FNXR5d6A9kjgcKuLtS8tggOjRhvZN6ngkIzlP632M xI1Lye9ZrbDOOV5SzRqKiNJxRyMaH9qzEJJPPs8CpWYn/Erz2N2OaCSWy6v44i25n0xQfn uOeGIeO88h2uUYj0digPKzF2WLaVT+Yi6dhpqBdpJBWccJkAdFjbGNvJoVFbCW6B5Ak95E I4yeVWqIlyqEkprG2Y66bvLsUnlTje6/UzMia/kTUWyNifpVC90jNu/kNagg2rXbHnexch C8fYDdFC58kEKaN+NhxELXQ5pPaa43fyu8dKPKv1X6MS/fS/7NLL+0J5Nnpbtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752435062; 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=8b58XgNvL8NPPwQ8e7wsD2XtVOD/NzrSHjyGEgXt+nU=; b=SRuVWp0/zpsBCbfKrb89+NostADwHL3U2YIaLxyGPupVSU5TqkwLZ6g++4lZXqo6zClDNJ YReMigdVe+Tvd6GyXvevsZnvGI5BKCZpoxLYRsOz+SE+Tzw2dHhoJC3Tq6KMfLWGBjk+tr vnOjGtydkNMjjPehmW5PX6JjeYBtqtd7UliOqYbidC5UEHKYhK/uNu9uXYqXgXPjrqOgP6 B/qR12ywg2AnIUtbrHVKqkgu/gRzZGe9q4UGPGxaQfpgNL8OIYaxDKdmzMWgWLSwT62UUH h0aFFTQJIhK3ACVqhuRrYe6G8J1LCiwkYvuNSkm/KBn+yACJOQZav+kOVRV8aQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752435062; a=rsa-sha256; cv=none; b=u8wUm/OkoIDWCRojEUPSs1Tt9HiUINbanIJxyC5g0MWqlcbudKsD+u6B4DCwsv9bE03vOo OL0HIUFq734z2MFuKxGGiaHJ00H7FOpyJsAil2juMVh27CcWQ2R+O1//1iUMN056zw22O5 pO2ZBo0C1xG42I/WmOpVLYcic1EQCqsjVB0wFVjtOzZoQTv0Ta4/dt0TyOql64ue6dB1u6 m4pJ1CYf01nZF+o1/+AWjaiZViIMMdRwz4Lp2XHMwswG65Rd4d9o4Qlx4+kJvQvC5TbKpY UgXcEYMzMvJ/u5CUUMjCc2p3PFNXWiRLQYTh+mht7+4bZZbJ93vN7vzS9CIzqw== 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 4bgFtG07M2z69v; Sun, 13 Jul 2025 19:31:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56DJV1mf069455; Sun, 13 Jul 2025 19:31:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56DJV1tr069452; Sun, 13 Jul 2025 19:31:01 GMT (envelope-from git) Date: Sun, 13 Jul 2025 19:31:01 GMT Message-Id: <202507131931.56DJV1tr069452@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: c87176dd16ab - stable/14 - fwget: pci_intel_video: do no log on no match 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c87176dd16abdf3d957589eccf5c2864687e2674 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=c87176dd16abdf3d957589eccf5c2864687e2674 commit c87176dd16abdf3d957589eccf5c2864687e2674 Author: Bjoern A. Zeeb AuthorDate: 2025-06-18 16:50:18 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-07-13 19:25:01 +0000 fwget: pci_intel_video: do no log on no match We should never "log" a statement on no match for a given device we do not know about. We do not control the PCI ID assignments and thus cannot predict if we would even support such a device. This also triggers an invalid output in the installer. Leave it as log_verbose for now. Sponsored by: The FreeBSD Foundation PR: 287639 Reviewed by: manu, emaste Differential Revision: https://reviews.freebsd.org/D50916 (cherry picked from commit f1f71cc717aa672caf046ffe1f3dd77e622b8b35) --- usr.sbin/fwget/pci/pci_video_intel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/fwget/pci/pci_video_intel b/usr.sbin/fwget/pci/pci_video_intel index 3824c4a49ffb..2f9012ed1f52 100644 --- a/usr.sbin/fwget/pci/pci_video_intel +++ b/usr.sbin/fwget/pci/pci_video_intel @@ -72,7 +72,7 @@ pci_video_intel() addpkg "gpu-firmware-intel-kmod-alderlake gpu-firmware-intel-kmod-tigerlake" ;; *) - log "No package found for device $1" + log_verbose "No package found for device $1" ;; esac } From nobody Sun Jul 13 19:31:03 2025 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 4bgFtH49Zgz61NFq; Sun, 13 Jul 2025 19:31:03 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bgFtH26Myz3k0L; Sun, 13 Jul 2025 19:31:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752435063; 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=Sp4CqLkLYU3uCftCUyGaiPFsT6sQOMJnWCeqm9w6m50=; b=hq0Xw09CQYxFwT7WeGJ9FMWEBlBJgIVoUxjSMxO1kt2R/EP+ur6wBjI4zIzClZj5AXknd5 DT/fEj57VA3Qdlm430K/1oEfxRzH09q9H1gNM1J6ZbDs9jThhMHklHHvE87XGsXI+Q0WQ3 EVQWeJv8mutnQyGt/UHypVoYYuODb/47HMflPd1mzDNfNcnNg3KWGZv1BeSAh9oDvcsr4C iLWSp+SqY6/yhZG/6Ds1H+A/klLwBRZ/naZk0jw8yCdAi/szlM268gtzYHD7KU6sPZ2eUv IhaYELcJND/+34SLK/m/5DNhUovqNTinTiWyf4/Obb/tWvmQ3HY4+3BU7c2gOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752435063; 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=Sp4CqLkLYU3uCftCUyGaiPFsT6sQOMJnWCeqm9w6m50=; b=a3TJ3HgtLTEdM4/YsOvmRbFFSCAZFJtq7mVw5gnvAbJdZC5HWcda6ZBh1QCpjehJFdQd1s kPkk9pGM+8eNs7ufL/s3s8FZ8SDqkcmuzJtOJW0IAuzgw5fVoG7kgaL9IHSe+2pwv6MwnD auOmbcxbHlecDcYehCfzQ7V2ds6SACDG7BOarJFVkoGn6tRtcp20x44/Vtoj00GCYzRnO+ 6IRMB1b4i6kARy79/FqqPkRaHvDVtQKD1MF81FfOxYcnjFhXKVKR+AD5SqtVLJpnsrrLDv wLlYibsX5/JlS8cpR2vHHNLyvkNQWPK2lwupwhKrH3H/miOujApenPQYntBYDw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752435063; a=rsa-sha256; cv=none; b=BAKQAvoswKEa3dapWjeiEC3t/46RadXISeqS+HTrlzF/O3h5ubeOF+0ydYvCeDPfrv+9Wt V6i4GBvWHyEPGo/JjjjiH7ncnoyitPGsuX1QeooS8ja1eO+iALX5ohUqcPmnygU62ApL+m qlO1dir0s5D0uadH3ELwEwEIweRPVHinA1DXnwhEd3Bfx6exALaGNyDbvAhnWPq/vb18h+ BELBfRw6fdGMaW+PD0+zYqyhzl+lOqiFMChuhK5gmcAmOnotQZDP0ix67xnI54Xu5uG8uG aJpl9q9HVCz87IpSAOeD+kWJOCIvaddZJQ8rANQWE5HqzcneVrkT1Z0rAxkWDA== 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 4bgFtH0tD0z6Yk; Sun, 13 Jul 2025 19:31:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56DJV3Zq069496; Sun, 13 Jul 2025 19:31:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56DJV3wJ069493; Sun, 13 Jul 2025 19:31:03 GMT (envelope-from git) Date: Sun, 13 Jul 2025 19:31:03 GMT Message-Id: <202507131931.56DJV3wJ069493@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 5c16917bac65 - stable/14 - net80211: in ieee80211_sta_join() only do_ht if HT is avail 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 5c16917bac65f6d44ec8208861ace61835d38825 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=5c16917bac65f6d44ec8208861ace61835d38825 commit 5c16917bac65f6d44ec8208861ace61835d38825 Author: Bjoern A. Zeeb AuthorDate: 2025-06-18 21:58:20 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-07-13 19:25:02 +0000 net80211: in ieee80211_sta_join() only do_ht if HT is avail In ieee80211_sta_join() there are currently two ways to set "do_ht": (1) after checking HT IEs are avail, and (2) after checking VHT IEs are avail and we are not on 2GHz. In the latter case no one checks that HT IEs are available and when we hit ieee80211_ht_updateparams_final() htinfo may be NULL and we panic. Avoid this by only checking for VHT if do_ht was set. No VHT without HT IEs. While here switch do_ht to be a bool. Sponsored by: The FreeBSD Foundation PR: 287625 Fixes: 51172f62a753f Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D50923 (cherry picked from commit f51c794cbc80682931d47264e3c18329bae0a2c1) --- sys/net80211/ieee80211_node.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/net80211/ieee80211_node.c b/sys/net80211/ieee80211_node.c index ae22dc036bb6..288f25ec9681 100644 --- a/sys/net80211/ieee80211_node.c +++ b/sys/net80211/ieee80211_node.c @@ -939,7 +939,7 @@ ieee80211_sta_join(struct ieee80211vap *vap, struct ieee80211_channel *chan, { struct ieee80211com *ic = vap->iv_ic; struct ieee80211_node *ni; - int do_ht = 0; + bool do_ht; ni = ieee80211_alloc_node(&ic->ic_sta, vap, se->se_macaddr, __func__, __LINE__); @@ -1015,6 +1015,7 @@ ieee80211_sta_join(struct ieee80211vap *vap, struct ieee80211_channel *chan, * association request/response, the only appropriate place * to setup the HT state is here. */ + do_ht = false; if (ni->ni_ies.htinfo_ie != NULL && ni->ni_ies.htcap_ie != NULL && vap->iv_flags_ht & IEEE80211_FHT_HT) { @@ -1022,7 +1023,7 @@ ieee80211_sta_join(struct ieee80211vap *vap, struct ieee80211_channel *chan, ieee80211_ht_updateparams(ni, ni->ni_ies.htcap_ie, ni->ni_ies.htinfo_ie); - do_ht = 1; + do_ht = true; } /* @@ -1031,7 +1032,7 @@ ieee80211_sta_join(struct ieee80211vap *vap, struct ieee80211_channel *chan, * * For now, don't allow 2GHz VHT operation. */ - if (ni->ni_ies.vhtopmode_ie != NULL && + if (do_ht && ni->ni_ies.vhtopmode_ie != NULL && ni->ni_ies.vhtcap_ie != NULL && vap->iv_vht_flags & IEEE80211_FVHT_VHT) { if (IEEE80211_IS_CHAN_2GHZ(ni->ni_chan)) { From nobody Sun Jul 13 19:31:04 2025 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 4bgFtJ4f8Cz61N7W; Sun, 13 Jul 2025 19:31:04 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bgFtJ2R11z3jsD; Sun, 13 Jul 2025 19:31:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752435064; 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=TervRr0d2+L6Gsf4rVBSzJiBJ+uNjCRY/03R3Hx5D20=; b=NTfnNH/xqHwa6CLtDddiYTtVtR2jDQjOYaTUbZECKH7VcurYpseVVqCBjhv7QxDZddAptv ZN0foD83snxp3ATbKzklAJHxAtJesvHuFjFqEYhEdPnKu2UWosyIEZFNRPYczyimxaGZ7N oIOVDlYCELi0JLppsT29ho0t0cttVqJF7kIoLdYLe8xpknhcLnXgRjWDqQe4vq2Gdufo8y SBOlayKmvU4ymzycKj1O9G8jR+armviAB7uWEa8IxzaJqNnXuRZG/Sn0JEjx+tkvisNcTp o1qjqYytpMiC0zyfDWhQxZLI0EocX8ZUNvRWR7mZ3uE/tdxuQml07gN2AigteA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752435064; 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=TervRr0d2+L6Gsf4rVBSzJiBJ+uNjCRY/03R3Hx5D20=; b=yH9r5zRnyXSLYLGlMiIukye028PBJeR8y4xI1be4BtLFOd1FPgbuOUnWvV+GVVHwXjb4VA 9IqU9cAShuEGUQcI4WYMhgNbrMI/ut73IKSLxYgwnnZqnwXD5xhcgxkJp7GhQdzB5dyuO/ 4vFopMA2xU+LhH5BB3yKyh1Gd5MLkCoTYw2s167H4LJ5nOYdrN49Nam1O4oQSjkyWk4x56 ncdmWWkl2RtslxJG66ZKaYqw2DDWedyimafCE0O6DZoevByICmqESjhaic3Bmx6VSoYgDg 67c7qn/Z1U7A9WRkAV2kUbsY64uxBdHd3fcO+me6kEbc7i2gpxJ6TVijCRuc0Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752435064; a=rsa-sha256; cv=none; b=wprNpIatc4931d+liolw56x4zAQjUhWJVMz0DP2Gn2SDG1ODoWY2RSQZerwGv078VK8Jka ex8IBhVKpx8ME99ScPwEBK6PQpAFqHkuX7zG3dYXKfzfyzzU2N+Q6yVAEWSKCAXJdLmelZ dElq1BAF0Pl1kDaKycjcfR7wq1t4/DNZT+zpOY9NziMPAT5QGElS2lep/qodHToG1iVsLI H848/IJySZEwb5G1uibT3asseNCbIWl9n8/a9G75A/zfyOTnMXIW09bmoWDoEBMfcnx+4n /a64rt+3jbQy2qguSytTg5rG8QI27H2FpmxZBdWi6+JhveW2kwFlms8VIXjDGg== 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 4bgFtJ1qMYz6Fx; Sun, 13 Jul 2025 19:31:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56DJV4wr069544; Sun, 13 Jul 2025 19:31:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56DJV4ns069541; Sun, 13 Jul 2025 19:31:04 GMT (envelope-from git) Date: Sun, 13 Jul 2025 19:31:04 GMT Message-Id: <202507131931.56DJV4ns069541@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 1f2679e83362 - stable/14 - net80211: regdomain: ETSI: add missing 11a and 11na entries 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1f2679e83362eb49d036a2f8b66c602c68ec5c04 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=1f2679e83362eb49d036a2f8b66c602c68ec5c04 commit 1f2679e83362eb49d036a2f8b66c602c68ec5c04 Author: Bjoern A. Zeeb AuthorDate: 2025-07-05 01:47:13 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-07-13 19:25:02 +0000 net80211: regdomain: ETSI: add missing 11a and 11na entries The frequency range 5745-5865 (channels 149-173) wrongly has a VHT160 channel listed (going up to 5885/177 which is not avail in ETSI) but no 11a, 11na listed. Add the 11a and 11na in addition to the 11ac 20/40 and 80. Turns out the VHT40 entry for 5805-5845 was also missing. We already had the neccessary setting for taiwan, so just adjust the freqband ref. The problem is that without the 11a base channel ieee80211_find_channel() in ieee80211_lookup_channel_rxstatus() will fail and sta_recv_mgmt() will not get the correct channel but will use ic->ic_curchan (which is not updated on scan offloading) and the scan result entry will be added as channel 1. Sponsored by: The FreeBSD Foundation Reviewed by: adrian (previous version) Differential Revision: https://reviews.freebsd.org/D51163 (cherry picked from commit 07948e050808158567c0ca7d345ad035115c0d88) --- lib/lib80211/regdomain.xml | 44 ++++++++++++++++++++++++++++++++++++-------- 1 file changed, 36 insertions(+), 8 deletions(-) diff --git a/lib/lib80211/regdomain.xml b/lib/lib80211/regdomain.xml index 9116e54c31cf..16b74445f429 100644 --- a/lib/lib80211/regdomain.xml +++ b/lib/lib80211/regdomain.xml @@ -494,6 +494,10 @@ IEEE80211_CHAN_PASSIVE IEEE80211_CHAN_DFS + + + 13 + @@ -548,6 +552,14 @@ IEEE80211_CHAN_PASSIVE IEEE80211_CHAN_DFS + + + 13 + + + + 13 + @@ -645,7 +657,7 @@ IEEE80211_CHAN_DFS - + 13 IEEE80211_CHAN_HT40 IEEE80211_CHAN_VHT40 @@ -658,13 +670,6 @@ IEEE80211_CHAN_VHT80 IEEE80211_CHAN_DFS - - - 13 - IEEE80211_CHAN_HT40 - IEEE80211_CHAN_VHT160 - IEEE80211_CHAN_DFS - @@ -2304,6 +2309,29 @@ 20 20 IEEE80211_CHAN_A + + 5745 + 5865 + 20 + 20 + IEEE80211_CHAN_A + + + 5745 + 5865 + 20 + 20 + IEEE80211_CHAN_A + IEEE80211_CHAN_HT20 + + + 5745 + 5845 + 40 + 20 + IEEE80211_CHAN_A + IEEE80211_CHAN_HT40 + 5660 5700 20 20 From nobody Sun Jul 13 19:31:05 2025 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 4bgFtK6xrtz61N0k; Sun, 13 Jul 2025 19:31:05 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bgFtK4G8rz3k7R; Sun, 13 Jul 2025 19:31:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752435065; 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=zijFVUNoeO5Y6mHlcnl65iyA5covviLopwZt/Ddztlk=; b=lWKt9o7yySltd0Vh8d/ah09i+jTnAuRn9jwgvl/9mNlvcZz8ydF2NCTtKCHzIuWSwcVFOJ riqTc8mAb/Rtz7KQbb+/3z7MzoVYoCQf1lXCmi8GOlkQFdEzzPw9ILUisMevv6zMi9jb8n 9vnycBihkizMgGHgotF58+6IkCRN6bRYdVz7grh8U+rO4syJ8DgVCJlu56b8fSu0FczNoB nuhrnMxi0nFrR59auLiRZeRDy3J5lS8S/woX/8IsfiDzWV4lgyST5/6liub0gc/reNWOE4 VeEdNGj5U/qBUq9/ticSO7guXn577PRQJctQdr/FfYpcv+qacrjyYyiwZPd5Tw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752435065; 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=zijFVUNoeO5Y6mHlcnl65iyA5covviLopwZt/Ddztlk=; b=akKmzKpx4i+U4SwOxfChe0nblK3G7AzkqQarnO6wka0WU8uGu0dJ5g3n3jpKZKe3qvNgSS X93oXcJACzIWRcELTtEglEMveGL6m7a9gXPbgOpx7lv7esH+fJvQr5wNuTigCUlxTEcfzu DHM1Dr7+zOtrBPsUU6/FRvbvhWyuc4wQimUdZ5htsjCalILvQpYXNukCYChrYGoUEzV/hH SMp2perKJUKwOqfgae3Hi9eVecUv1bL66cC1JPrA20OCKstkaiEs46sPeVeve/jwrRXwmP ykakdeCZZrsotx8ZJa1EK22ZyyK6MRIj5ID3gr6Q2bYC5EgYICqErtoSxpbmBA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752435065; a=rsa-sha256; cv=none; b=ktZxBt9SbbLjxV+yL8zDRI7q56t5e20dglcr/ozuHUXOm4wDzwWQ12d6Xv2TBcu6sWpwqM AAK3JDybUCJfF/dPFd3/Ejc+UMUwpgEVDs7mwgWdG97tNBJmcxaf/xKrKzfQYC5j0PsPAZ LH0f8Eb1MSdbdB4Fl7SXbMTmpQt9hRiNFcV3MF7MkEG/WWEN5hODIV8SjOPdoAgwudwjlb ezoSPO/RtuclvYjw01SEp+lV5CKoFCpqJZpHF2aOCAZNk2yKEiy8Pda2JJLUrQe7KgPcsE tc9cNn2lFks13Q2CZEZ81EnfFDOPapYhDmBYLkmOJz8PXM56nRK1KvnnfMq9Xg== 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 4bgFtK3kh8z6S2; Sun, 13 Jul 2025 19:31:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56DJV5be069580; Sun, 13 Jul 2025 19:31:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56DJV5sq069577; Sun, 13 Jul 2025 19:31:05 GMT (envelope-from git) Date: Sun, 13 Jul 2025 19:31:05 GMT Message-Id: <202507131931.56DJV5sq069577@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 48c4eac328ea - stable/14 - bwn(4): BWN_GPL_PHY: make compile again 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 48c4eac328eaffe4eed0461d75e6c2bb463b3efc Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=48c4eac328eaffe4eed0461d75e6c2bb463b3efc commit 48c4eac328eaffe4eed0461d75e6c2bb463b3efc Author: Bjoern A. Zeeb AuthorDate: 2025-06-22 00:15:38 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-07-13 19:25:02 +0000 bwn(4): BWN_GPL_PHY: make compile again compiler complains about error: comparison of different enumeration types ('bwn_phy_band_t' and 'bwn_band_t'); so use the correct enum value. Sponsored by: The FreeBSD Foundation PR: 287695 Reported by: (tom.mcclean gmail.com) (cherry picked from commit 2f16c8d4fa0f5788d52d74fa875c386c475249ec) --- sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_ppr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_ppr.c b/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_ppr.c index edba922ffb58..ec1f0f69f615 100644 --- a/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_ppr.c +++ b/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_ppr.c @@ -247,7 +247,7 @@ bool bwn_ppr_load_max_from_sprom(struct bwn_mac *mac, struct bwn_ppr *ppr, } } - if (band == BWN_BAND_2G) { + if (band == BWN_PHY_BAND_2G) { uint16_t ck2gpo; error = bhnd_nvram_getvar_uint16(sc->sc_dev, BHND_NVAR_CCK2GPO, From nobody Sun Jul 13 19:31:06 2025 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 4bgFtL4pPxz61N1s; Sun, 13 Jul 2025 19:31:06 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bgFtL3Mh9z3k2g; Sun, 13 Jul 2025 19:31:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752435066; 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=EYdi4Xyhin51kEdn0Hs7Nr6s68rSK1/Ts8V3QTDhmc0=; b=jyQXgYRpM0VosHe4khJpEToCG8qbPrVgfVouVDWc59YLkn7hodnqijv5zv9mCC8G8VbA3s fmdUhkghdSQfnGX1Hleetzua582d+0IHm1K5JoQE070mio+kvGd6Ys/K9iiSmyBl4mhv3m ruFc1/lBE1Ra+eWUwYfGWGqgVV1wiCTOJALWjXhGAXjaByv0+qEGNGCQBBgokA2jeHMMNJ 9V/pK6h2IllFhb+sLSUXiMw5HcpdUvLOoiiUGL0pD/dI4j2I8bijlkAc8mg8yyIpoZ3FsM OcMJEQbsuw5FCgEjRkzoQJOiw6uf77o4OL6CzXiLAZ8qYQEDqJDzOrM+e3zIxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752435066; 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=EYdi4Xyhin51kEdn0Hs7Nr6s68rSK1/Ts8V3QTDhmc0=; b=nSrovRBaWi1wdaCJNYLUOigJq81axtIqYRr8Yh6xKjPZkv+4zswOmh+u42RBvurN1K6e+a rvfDPTuQiubOrHkJ8zfTYC8TT2JHL6QWywoLS2Fo573+5/ivpAkDkHr5OJlblF/4ZEgsv9 HARtlxyTW37L/9K0YlJVCHqC3/y+oPB2QfqMmgnpvkFrXqSE8fIcP2Jy70t/YzrpMIL2mq JPE8OGpjwB8FKNelz55N/5KUaAA7mWNSQwm31E91crPT9DtTFXXscH7VSB8mCPadsDmT5z OSMn4hBCs9K45I1dxFHeLTftKYuUu2mXFUdhlYUcRvdi1XzJ5gne0t1SQA/uLA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752435066; a=rsa-sha256; cv=none; b=cuOU1RlC7ZjQAsrg+Z6AcyEKkUCPoD/jv3s9QBrC3NvuArktr0JhO2hERGlfjdokwFB/dx keHAZVemKWk93p3pq0sPhs0FXMzwsHljqZqUUPFLz1wno9RdefVO/2YzI2t1u3IVtNvsYB vADhrY5z5DCbBk1cy64FlVO0HFGGUWh0VPjm1kWWH4lTYxcMfqZSSAfgTuQBP+9fkrIITu RFb4rI3cOFRgX4JTsBHeRnU2ySvQHkHbOsdFhPBqW2ha+lxEJcUH+hQlfnhc4SqZ7ho3CN vd/iHUF8SuX899U9V0OgFrvEo/5aBOMw5oBxyf11asWcqkZt8AKa0wCA35BGvw== 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 4bgFtL2ykrz650; Sun, 13 Jul 2025 19:31:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56DJV6db069617; Sun, 13 Jul 2025 19:31:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56DJV6v5069614; Sun, 13 Jul 2025 19:31:06 GMT (envelope-from git) Date: Sun, 13 Jul 2025 19:31:06 GMT Message-Id: <202507131931.56DJV6v5069614@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: dbd83c481e1c - stable/14 - LinuxKPI: add missing bus_dmamap_sync() calls or exclude them 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: dbd83c481e1c9ccf9432f5c4cd482a8a53921d60 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=dbd83c481e1c9ccf9432f5c4cd482a8a53921d60 commit dbd83c481e1c9ccf9432f5c4cd482a8a53921d60 Author: Bjoern A. Zeeb AuthorDate: 2024-05-21 22:32:19 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-07-13 19:25:02 +0000 LinuxKPI: add missing bus_dmamap_sync() calls or exclude them Rename linux_dma_unmap() to lkpi_dma_unmap(), and linux_dma_map_phys() to lkpi_dma_map_phys() so that we get the full set of function arguments (direction and attributes were missing). Leave the old functions as wrappers as they are called from drm-kmod linuxkpi/bsd still, and leaving them also allows us to MFC this change. Add missing bus_dmamap_sync() calls. Rather than inlining them in each inline function push them down to the actual implementation. From there do not inline them either but call the appropriate function dealing with the sync so that we do not have the same code splattered in many places. Adhere to the DMA_ATTR_SKIP_CPU_SYNC attribute and skip synching when requested. A previous, less complete version of this change already allowed me to load firmware on arm64 for iwlwifi (again). There are four more places which are not currently done as the functions which came with an OFED sync a long time ago seem to be unused these days. Leaving a pr_debug("TODO") call there. Also dma_[un]map_resource() when brought in from drm-kmod/linuxkpi/bsd (D30933) should be adjusted to pass the full arguments as the amdgpu callers are requesting to skip synching. Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45294 (cherry picked from commit f99d393f7f787ff080c12b92243adcc310ac7c58) --- .../linuxkpi/common/include/linux/dma-mapping.h | 50 ++++++++++++---------- sys/compat/linuxkpi/common/src/linux_pci.c | 49 ++++++++++++++++++--- 2 files changed, 70 insertions(+), 29 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/dma-mapping.h b/sys/compat/linuxkpi/common/include/linux/dma-mapping.h index 84f0361de765..09d5e4b6bc22 100644 --- a/sys/compat/linuxkpi/common/include/linux/dma-mapping.h +++ b/sys/compat/linuxkpi/common/include/linux/dma-mapping.h @@ -96,13 +96,17 @@ void *linux_dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, gfp_t flag); void *linuxkpi_dmam_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, gfp_t flag); -dma_addr_t linux_dma_map_phys(struct device *dev, vm_paddr_t phys, size_t len); -void linux_dma_unmap(struct device *dev, dma_addr_t dma_addr, size_t size); +dma_addr_t linux_dma_map_phys(struct device *dev, vm_paddr_t phys, size_t len); /* backward compat */ +dma_addr_t lkpi_dma_map_phys(struct device *, vm_paddr_t, size_t, + enum dma_data_direction, unsigned long); +void linux_dma_unmap(struct device *dev, dma_addr_t dma_addr, size_t size); /* backward compat */ +void lkpi_dma_unmap(struct device *, dma_addr_t, size_t, + enum dma_data_direction, unsigned long); int linux_dma_map_sg_attrs(struct device *dev, struct scatterlist *sgl, - int nents, enum dma_data_direction dir __unused, + int nents, enum dma_data_direction direction, unsigned long attrs __unused); void linux_dma_unmap_sg_attrs(struct device *dev, struct scatterlist *sg, - int nents __unused, enum dma_data_direction dir __unused, + int nents __unused, enum dma_data_direction direction, unsigned long attrs __unused); void linuxkpi_dma_sync(struct device *, dma_addr_t, size_t, bus_dmasync_op_t); @@ -173,16 +177,17 @@ dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, dma_addr_t dma_addr) { - linux_dma_unmap(dev, dma_addr, size); + lkpi_dma_unmap(dev, dma_addr, size, DMA_BIDIRECTIONAL, 0); kmem_free(cpu_addr, size); } static inline dma_addr_t dma_map_page_attrs(struct device *dev, struct page *page, size_t offset, - size_t size, enum dma_data_direction dir, unsigned long attrs) + size_t size, enum dma_data_direction direction, unsigned long attrs) { - return (linux_dma_map_phys(dev, page_to_phys(page) + offset, size)); + return (lkpi_dma_map_phys(dev, page_to_phys(page) + offset, size, + direction, attrs)); } /* linux_dma_(un)map_sg_attrs does not support attrs yet */ @@ -197,7 +202,8 @@ dma_map_page(struct device *dev, struct page *page, unsigned long offset, size_t size, enum dma_data_direction direction) { - return (linux_dma_map_phys(dev, page_to_phys(page) + offset, size)); + return (lkpi_dma_map_phys(dev, page_to_phys(page) + offset, size, + direction, 0)); } static inline void @@ -205,7 +211,7 @@ dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size, enum dma_data_direction direction) { - linux_dma_unmap(dev, dma_address, size); + lkpi_dma_unmap(dev, dma_address, size, direction, 0); } static inline void @@ -263,28 +269,33 @@ dma_sync_single_for_device(struct device *dev, dma_addr_t dma, linuxkpi_dma_sync(dev, dma, size, op); } +/* (20250329) These four seem to be unused code. */ static inline void dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nelems, enum dma_data_direction direction) { + pr_debug("%s:%d: TODO dir %d\n", __func__, __LINE__, direction); } static inline void dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nelems, enum dma_data_direction direction) { + pr_debug("%s:%d: TODO dir %d\n", __func__, __LINE__, direction); } static inline void dma_sync_single_range_for_cpu(struct device *dev, dma_addr_t dma_handle, - unsigned long offset, size_t size, int direction) + unsigned long offset, size_t size, enum dma_data_direction direction) { + pr_debug("%s:%d: TODO dir %d\n", __func__, __LINE__, direction); } static inline void dma_sync_single_range_for_device(struct device *dev, dma_addr_t dma_handle, - unsigned long offset, size_t size, int direction) + unsigned long offset, size_t size, enum dma_data_direction direction) { + pr_debug("%s:%d: TODO dir %d\n", __func__, __LINE__, direction); } #define DMA_MAPPING_ERROR (~(dma_addr_t)0) @@ -306,24 +317,17 @@ static inline unsigned int dma_set_max_seg_size(struct device *dev, static inline dma_addr_t _dma_map_single_attrs(struct device *dev, void *ptr, size_t size, - enum dma_data_direction direction, unsigned long attrs __unused) + enum dma_data_direction direction, unsigned long attrs) { - dma_addr_t dma; - - dma = linux_dma_map_phys(dev, vtophys(ptr), size); - if (!dma_mapping_error(dev, dma)) - dma_sync_single_for_device(dev, dma, size, direction); - - return (dma); + return (lkpi_dma_map_phys(dev, vtophys(ptr), size, + direction, attrs)); } static inline void _dma_unmap_single_attrs(struct device *dev, dma_addr_t dma, size_t size, - enum dma_data_direction direction, unsigned long attrs __unused) + enum dma_data_direction direction, unsigned long attrs) { - - dma_sync_single_for_cpu(dev, dma, size, direction); - linux_dma_unmap(dev, dma, size); + lkpi_dma_unmap(dev, dma, size, direction, attrs); } static inline size_t diff --git a/sys/compat/linuxkpi/common/src/linux_pci.c b/sys/compat/linuxkpi/common/src/linux_pci.c index 2c2f92082a4e..52d9120fed5a 100644 --- a/sys/compat/linuxkpi/common/src/linux_pci.c +++ b/sys/compat/linuxkpi/common/src/linux_pci.c @@ -1511,17 +1511,34 @@ linux_dma_map_phys_common(struct device *dev __unused, vm_paddr_t phys, #endif dma_addr_t -linux_dma_map_phys(struct device *dev, vm_paddr_t phys, size_t len) +lkpi_dma_map_phys(struct device *dev, vm_paddr_t phys, size_t len, + enum dma_data_direction direction, unsigned long attrs) { struct linux_dma_priv *priv; + dma_addr_t dma; priv = dev->dma_priv; - return (linux_dma_map_phys_common(dev, phys, len, priv->dmat)); + dma = linux_dma_map_phys_common(dev, phys, len, priv->dmat); + if (dma_mapping_error(dev, dma)) + return (dma); + + if ((attrs & DMA_ATTR_SKIP_CPU_SYNC) == 0) + dma_sync_single_for_device(dev, dma, len, direction); + + return (dma); +} + +/* For backward compat only so we can MFC this. Remove before 15. */ +dma_addr_t +linux_dma_map_phys(struct device *dev, vm_paddr_t phys, size_t len) +{ + return (lkpi_dma_map_phys(dev, phys, len, DMA_NONE, 0)); } #if defined(__i386__) || defined(__amd64__) || defined(__aarch64__) void -linux_dma_unmap(struct device *dev, dma_addr_t dma_addr, size_t len) +lkpi_dma_unmap(struct device *dev, dma_addr_t dma_addr, size_t len, + enum dma_data_direction direction, unsigned long attrs) { struct linux_dma_priv *priv; struct linux_dma_obj *obj; @@ -1538,6 +1555,10 @@ linux_dma_unmap(struct device *dev, dma_addr_t dma_addr, size_t len) return; } LINUX_DMA_PCTRIE_REMOVE(&priv->ptree, dma_addr); + + if ((attrs & DMA_ATTR_SKIP_CPU_SYNC) == 0) + dma_sync_single_for_cpu(dev, dma_addr, len, direction); + bus_dmamap_unload(obj->dmat, obj->dmamap); bus_dmamap_destroy(obj->dmat, obj->dmamap); DMA_PRIV_UNLOCK(priv); @@ -1546,11 +1567,19 @@ linux_dma_unmap(struct device *dev, dma_addr_t dma_addr, size_t len) } #else void -linux_dma_unmap(struct device *dev, dma_addr_t dma_addr, size_t len) +lkpi_dma_unmap(struct device *dev, dma_addr_t dma_addr, size_t len, + enum dma_data_direction direction, unsigned long attrs) { } #endif +/* For backward compat only so we can MFC this. Remove before 15. */ +void +linux_dma_unmap(struct device *dev, dma_addr_t dma_addr, size_t len) +{ + lkpi_dma_unmap(dev, dma_addr, len, DMA_NONE, 0); +} + void * linux_dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, gfp_t flag) @@ -1652,7 +1681,7 @@ linuxkpi_dma_sync(struct device *dev, dma_addr_t dma_addr, size_t size, int linux_dma_map_sg_attrs(struct device *dev, struct scatterlist *sgl, int nents, - enum dma_data_direction direction, unsigned long attrs __unused) + enum dma_data_direction direction, unsigned long attrs) { struct linux_dma_priv *priv; struct scatterlist *sg; @@ -1686,6 +1715,9 @@ linux_dma_map_sg_attrs(struct device *dev, struct scatterlist *sgl, int nents, sg_dma_address(sg) = seg.ds_addr; } + if ((attrs & DMA_ATTR_SKIP_CPU_SYNC) != 0) + goto skip_sync; + switch (direction) { case DMA_BIDIRECTIONAL: bus_dmamap_sync(priv->dmat, sgl->dma_map, BUS_DMASYNC_PREWRITE); @@ -1699,6 +1731,7 @@ linux_dma_map_sg_attrs(struct device *dev, struct scatterlist *sgl, int nents, default: break; } +skip_sync: DMA_PRIV_UNLOCK(priv); @@ -1708,7 +1741,7 @@ linux_dma_map_sg_attrs(struct device *dev, struct scatterlist *sgl, int nents, void linux_dma_unmap_sg_attrs(struct device *dev, struct scatterlist *sgl, int nents __unused, enum dma_data_direction direction, - unsigned long attrs __unused) + unsigned long attrs) { struct linux_dma_priv *priv; @@ -1716,6 +1749,9 @@ linux_dma_unmap_sg_attrs(struct device *dev, struct scatterlist *sgl, DMA_PRIV_LOCK(priv); + if ((attrs & DMA_ATTR_SKIP_CPU_SYNC) != 0) + goto skip_sync; + switch (direction) { case DMA_BIDIRECTIONAL: bus_dmamap_sync(priv->dmat, sgl->dma_map, BUS_DMASYNC_POSTREAD); @@ -1730,6 +1766,7 @@ linux_dma_unmap_sg_attrs(struct device *dev, struct scatterlist *sgl, default: break; } +skip_sync: bus_dmamap_unload(priv->dmat, sgl->dma_map); bus_dmamap_destroy(priv->dmat, sgl->dma_map); From nobody Sun Jul 13 19:31:07 2025 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 4bgFtM6vxPz61Mwm; Sun, 13 Jul 2025 19:31:07 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bgFtM4dtMz3k2n; Sun, 13 Jul 2025 19:31:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752435067; 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=GxmZlHi8uIVYRBxXGAeqjirTCiW9awW0qYnSPq8Q+/U=; b=YbXMEXvcX6l1KLBWSFiM5F3/4yloxA8rCzbZB5rmuMmp0NnkohnJS5VORalQkiCcQqnDR9 2KhN6adzXgythgrP9VrhweIy+NOKXKKSoYnELnXcb34BJXQd1MswLp2fqPeMmd+WaiRLQb MzdgUNE6DkiJgcu3S4r2ykh4ZbYYLN3V9d7bPWZUVmhAVyIQ+GGmPvJ+F8slcmmRkMnyUX Bpg0J2B50/UZ87D/8TRX8IfgI6fGCys5R9Q6ynV+rGxH0KOD4Y/DicKY5xvVK7YHLZOnU9 rA7txyYThi9tGzjX845o5wy3BkFlM+qFk1kgYwSR9jv6J6BE5ZjL/y+7D8yWOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752435067; 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=GxmZlHi8uIVYRBxXGAeqjirTCiW9awW0qYnSPq8Q+/U=; b=Jc6pis8JDp+HNunWpTzC08lVM72zejyx6TELWynYPe5kQoiOcNSBkQPWYlsg12frzhAPy0 Liz5zxV7QW4rAXXqBmIRK4Rpyaf8DoU6CroaQJ4bTXbR2FNaldHaEdkdj4qzSquBb5y6te 32IcRhAnp+w8Ev0s/X92XesJfOQeh0kyReckRVBdm5ItHqLQSBFj0G6/U8GHkXgWDHfkNp okP9bbCXvud4WbArQsFAfBsfzfQi+ZZxpB2H9gFcHFfsX8Owv8qhHkF5H9hc4ZmTmoaMmI a8SlGxQgsCKHODQZXHoC/vuUl9GKX6dK/Eslyot1Tub1R351aKkQBrUIhKwxiQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752435067; a=rsa-sha256; cv=none; b=S6XtOrJe4kiotrHLRfAcK75Yj06NJgd4aJwTcA/3mbg++GbFExxX8t8KmyEzI0W/RrH33Z 9qp5fJfolQbO73vs8JimZYw0oZ5PMIP26+msSbDOkF91ebH0L475NLmq7X9sTPpOB+KME/ pxccThAwPjYczU8Np0n9BVAUUSH04jxuFQwDjGCjIVOwagoTW5ABQKlAIHStWCmCAjyI0N n2eImZBTUadmOsjIX3PjZTnaBTYhze3dQQJbIqjuk/KcYOVRNCQrFqDavJ/5VjoeRBiMeg 9rrEZ925SnEExsDsiHtzx4TYwEPUkKKINJZZNsJvjfukZz71lwjG8zN7oQXbtw== 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 4bgFtM3SDxz6Ym; Sun, 13 Jul 2025 19:31:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56DJV7vJ070012; Sun, 13 Jul 2025 19:31:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56DJV7cZ069997; Sun, 13 Jul 2025 19:31:07 GMT (envelope-from git) Date: Sun, 13 Jul 2025 19:31:07 GMT Message-Id: <202507131931.56DJV7cZ069997@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 106294d5801f - stable/14 - LinuxKPI: Implement dma_map_resource/dma_unmap_resource functions 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 106294d5801f6c617812534f773ea101bfbc7655 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=106294d5801f6c617812534f773ea101bfbc7655 commit 106294d5801f6c617812534f773ea101bfbc7655 Author: Bjoern A. Zeeb AuthorDate: 2025-04-01 14:51:03 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-07-13 19:25:03 +0000 LinuxKPI: Implement dma_map_resource/dma_unmap_resource functions dma_map_resource() and dma_unmap_resource() functions are used to map and unmap of memory-mapped IO resources so they can be accessed by the device. Required by drm-kmod v5.5 to be built. While for drm-kmod 6.6-lts only amdgpu uses these in one place and the code apparently has not been exercised a lot it has been around like this for years. With changing the underlying implementations bring it into the tree; should we find errors with it they can also be fixed here. Bump __FreeBSD version to be able to detect this change. Obtained from: D30933 (by wulf) Sponsored by: The FreeBSD Foundation Reviewed by: dumbbell Differential Revision: https://reviews.freebsd.org/D49625 (cherry picked from commit a02180cf60a6a0102669b678e9c81ad9f1aa4d91) --- UPDATING | 4 ++++ sys/compat/linuxkpi/common/include/linux/dma-mapping.h | 14 ++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/UPDATING b/UPDATING index c1778cc50d83..4d06a05650bf 100644 --- a/UPDATING +++ b/UPDATING @@ -12,6 +12,10 @@ Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before updating system packages and/or ports. +20250713: + LinuxKPI dma-mapping.h were pulled into the tree from drm-kmod. + Bump _FreeBSD_version to 1403503 to be able to detect this change. + 20250707: Commit f5195b1a63df removed in6_maxmtu and its setter in6_setmaxmtu(). in6_maxmtu is used to store the max IPv6 MTU of all interfaces, diff --git a/sys/compat/linuxkpi/common/include/linux/dma-mapping.h b/sys/compat/linuxkpi/common/include/linux/dma-mapping.h index 09d5e4b6bc22..2d8e1196d3d3 100644 --- a/sys/compat/linuxkpi/common/include/linux/dma-mapping.h +++ b/sys/compat/linuxkpi/common/include/linux/dma-mapping.h @@ -214,6 +214,20 @@ dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size, lkpi_dma_unmap(dev, dma_address, size, direction, 0); } +static inline dma_addr_t +dma_map_resource(struct device *dev, phys_addr_t paddr, size_t size, + enum dma_data_direction direction, unsigned long attrs) +{ + return (lkpi_dma_map_phys(dev, paddr, size, direction, attrs)); +} + +static inline void +dma_unmap_resource(struct device *dev, dma_addr_t dma, size_t size, + enum dma_data_direction direction, unsigned long attrs) +{ + lkpi_dma_unmap(dev, dma, size, direction, attrs); +} + static inline void dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma, size_t size, enum dma_data_direction direction) From nobody Sun Jul 13 19:31:08 2025 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 4bgFtP1gVrz61NDH; Sun, 13 Jul 2025 19:31:09 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bgFtN4p19z3k7k; Sun, 13 Jul 2025 19:31:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752435068; 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=/MiBTIp89e6sblPWZuz6kOb/jKTtos2LWcBtEKZRIuw=; b=FkiDu975EKaXjj98+ROjUdtJgMlBVlqyu0/CxORlrnlYgHkMLV0KSNWeSF/rA2WK/cyj+f l7SKnhtfKvJOSZBrEy80L3EoU1G6DId9qbxcEbt0ggJxp7vE0f9GVSj7RON8g2psOx31ej TrWtVYIb8uOX0sviE+7El6+rpL/nMz0xZ8A1SGY286u/7dupD0hjjKNY1IRQwU8KwQwBdI bAb6lhkdxqejYtqdq/60Ga1/2ta3Q732nUCgGGoEHH1uULViF663Cci8JXHAcbZdhmygIr oSr2bODBeFC2nBWBQVn3o0p5UqQ9FdHgBvEu8g3FkQGwAZmWyvfpqmCluTO25A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752435068; 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=/MiBTIp89e6sblPWZuz6kOb/jKTtos2LWcBtEKZRIuw=; b=TqeJhfSzT3JQCep7Jg6rc+0jHebgWMcLbfJpmhOFexLM0kLarI9NB3OQ5dRcOqBzBTZbAs Niyw4jjfzIXmFsHB5vMenLDVIFtgQ1fbQS4B9569vme32lppTXwUtOvNiPffbdEysUlPDG MI9ssLiqqupzWidDPBiUsnAmIMizio4quUZ/BPlKp+o81AWJ8PC9JfPtsQ2DbcZviFwu28 ofKelrAjannSso+jHx0wEkUEGC9qLuSV7nMI37Cv2lzMNLmXpCPmJdhVAc15cDy2ZyCF8m F4d2azNxiM8mURyGQdB7M25yc0ki3hlHaQChCBJT6wT/9blh0hLo/+nvD8vwXQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752435068; a=rsa-sha256; cv=none; b=J6cfkocgR9fxsx08Av4tGRRRndFgAL9CyuzqYomES7eBcmrAbaPjhj5K0o2TIaKhgqRV40 +aUmDEaOH+AviEjpTe9En8MFhx/XHKIfitoe/VW6aw0zpqjCNzgKdZe7KoTELdG4JdpkoB YMARvrU1KJO6wvYUvTQ9ZZvbmOuGy4PAB94IEAzw/3MA1tCPX2a1ZZNLbUwcQjMvTqTaup Mc6VHEjluAkTTN72c6Kbwlm8JXIEaWMrXpxfXqWvyMSc3OPC6lTbNzXF1xeS07zDWWddf+ 8mUA3KTIPHbyUzavFJdlD4R34JV1xm/S9XxI4QUfV5oMOX+BSfFq4Ov1qoyM9A== 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 4bgFtN4Pltz66k; Sun, 13 Jul 2025 19:31:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56DJV8wg070750; Sun, 13 Jul 2025 19:31:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56DJV8kh070747; Sun, 13 Jul 2025 19:31:08 GMT (envelope-from git) Date: Sun, 13 Jul 2025 19:31:08 GMT Message-Id: <202507131931.56DJV8kh070747@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 00544b72f65f - stable/14 - LinuxKPI: MODULE_DEVICE_TABLE() remove hard coded pci 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 00544b72f65f3f160d829445a0b8a26b375bfab9 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=00544b72f65f3f160d829445a0b8a26b375bfab9 commit 00544b72f65f3f160d829445a0b8a26b375bfab9 Author: Bjoern A. Zeeb AuthorDate: 2025-06-22 22:44:40 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-07-13 19:25:03 +0000 LinuxKPI: MODULE_DEVICE_TABLE() remove hard coded pci While we currently only use MODULE_DEVICE_TABLE() for pci (or so I thought [*]), this may soon change. Remove a hard coded "pci" for the bus and use the bus name passed in as _bus. [*] see follow-up change Sponsored by: The FreeBSD Foundation Reviewed by: imp, dumbbell Differential Revision: https://reviews.freebsd.org/D51048 (cherry picked from commit f58e032410c93d67c83d6bce8a3e6711f377a4be) --- sys/compat/linuxkpi/common/include/linux/pci.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/include/linux/pci.h b/sys/compat/linuxkpi/common/include/linux/pci.h index ccf86c7778e9..15fedb87e6e6 100644 --- a/sys/compat/linuxkpi/common/include/linux/pci.h +++ b/sys/compat/linuxkpi/common/include/linux/pci.h @@ -83,7 +83,7 @@ static driver_t _ ## _bus ## _ ## _table ## _driver = { \ 0 \ }; \ \ -DRIVER_MODULE(lkpi_ ## _table, pci, _ ## _bus ## _ ## _table ## _driver,\ +DRIVER_MODULE(lkpi_ ## _table, _bus, _ ## _bus ## _ ## _table ## _driver,\ 0, 0); \ \ MODULE_PNP_INFO("U32:vendor;U32:device;V32:subvendor;V32:subdevice", \ From nobody Sun Jul 13 19:31:10 2025 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 4bgFtR4pyzz61N0p; Sun, 13 Jul 2025 19:31:11 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bgFtQ74qQz3k1s; Sun, 13 Jul 2025 19:31:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752435071; 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=3eeUdS5pLfPIbUpQHWZK0uP3iYZkh1N+iaIf9pI9Zn0=; b=eB3b8QbwycIfkf+CIVBweHeiCkTQhzumOqMPDHP5ZEeAmv7pcM+5i/jQEJxeB3GxMr2jVq 6rNgtQX6LqQqnLXdaydVXlDeYZzMLjYpLPwHDfJlDZeT4/Qkxcs4CQJ6mVZFE2YaLm6LvZ +5Qw12x9Si7tnmRvnKU1oUba7nKneFTOvQlrCjEi+Xpjse+OuEONolWIGXRRh3aL5K+I/2 6EfgpdLWbu3i/bEcke9cqtR3UNGhGMvxbaPlEkx7vWAMfzLesFPnyVPOHoaBsAe9viqqFk hYrAWsKHON5VkKd3QAYAe0VqsOTsobRHtFnNrWRW8TKpO4ceJNdXitencRPAEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752435071; 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=3eeUdS5pLfPIbUpQHWZK0uP3iYZkh1N+iaIf9pI9Zn0=; b=cI/17J1l55PHvY07iTqUU4k2OBL9VpsLvqBVQHRQbusSmkXje5uHQo8tGHDz7I/8l+P4lk KLo8Uv3Vzo1jRaMw4cvc5D116D25KRFUb1MUjDy2NW7t5h0a84Ae5mf0svYNr/tuI4eejT mZTmurdrIoTgTCYb20B1MVxd8HFaxGPwquOpINyqlJwVv/qHzAI/HzZNtzZeTfsq52VhHF +rWMnZaCAkbyIcmnsMYOmB0Mkl1sic4NktiSaUgiJVOUkDFD4ym3qD7KUHLXmBA/i+T7w1 huwwFAFfYr9lvPyk51nJ6AzYWSmu1/BpvFqKrqSh7cBLPcllVB9SJghvcIZxFA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752435071; a=rsa-sha256; cv=none; b=DnsNU0KRkk9mJEznf9ZwIEEIfKmZZKYy2eJ1A9uyHK3m6J5k3g9gK+VtT/3eruyZHuEvxv +oNw0Sm9nX/4YibEDufht5NjZwTKWQTOgobpiev2dxKqvm+sMXkpAsdyCoCOj2EJfkYQPk N4GwfOoTnZZJM0S9g6bImEctlPW2JTsV2Eiac2AXpicDgXrmlKYY7/eMYLi1Dj0+jLsJzn Fn8KFYUwtzk2Ej6tYaBZinPB8sO9h3Easllg9eQS4rOkyg5tMeQq7+hqr0pUVMaLRg/StA UiiFOjUQeeZYFWRiSwpajvKKSAmqQXvmwdYCFSpOYSj574TDmChF9VPdR6BbWA== 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 4bgFtQ5wX2z6S5; Sun, 13 Jul 2025 19:31:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56DJVAse070828; Sun, 13 Jul 2025 19:31:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56DJVAsK070825; Sun, 13 Jul 2025 19:31:10 GMT (envelope-from git) Date: Sun, 13 Jul 2025 19:31:10 GMT Message-Id: <202507131931.56DJVAsK070825@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: ddf9cecb559d - stable/14 - LinuxKPI: acpi: provide union [linuxkpi]_acpi_(object|buffer) 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ddf9cecb559d1504d5024648e983a46ab3136739 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=ddf9cecb559d1504d5024648e983a46ab3136739 commit ddf9cecb559d1504d5024648e983a46ab3136739 Author: Bjoern A. Zeeb AuthorDate: 2025-06-15 10:38:56 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-07-13 19:25:03 +0000 LinuxKPI: acpi: provide union [linuxkpi]_acpi_(object|buffer) Provide union acpi_(object|buffer) as linuxkpi_ versions and in Linux native lower case spelling so that driver code compiles unmodified. Use the linuxkpi_ prefix to avoid name clashes with the native ACPI implementation which uses CamelCase. Use the linuxkpi_ names internally and redefine the linuxkpi_ unions to their native names so they are avail as expected in drivers. As a transition to not break drm-kmod which has in-place (no #ifdef) changes from Linux spelling ot FreeBSD spelling, introduce LINUXKPI_WANT_LINUX_ACPI so we have the Linux spelling as an opt-in. That way the transition can happen gracefully and once "top-of-trees" are all sorted we can remove the #ifdefs here again. Bump __FreeBSD_version to be able to detect this change. Sponsored by: The FreeBSD Foundation Reviewed by: wulf (previous version), dumbbell Differential Revision: https://reviews.freebsd.org/D50863 (cherry picked from commit 2ddfcc013c251f13c8c9b24970b8134ddd49afea) --- sys/compat/linuxkpi/common/include/acpi/acpi.h | 76 ++++++++++++++++++++++++-- 1 file changed, 71 insertions(+), 5 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/acpi/acpi.h b/sys/compat/linuxkpi/common/include/acpi/acpi.h index e0218bdde12e..1e398d05ba20 100644 --- a/sys/compat/linuxkpi/common/include/acpi/acpi.h +++ b/sys/compat/linuxkpi/common/include/acpi/acpi.h @@ -3,6 +3,10 @@ * * Copyright (c) 2017 Mark Johnston * Copyright (c) 2020 Vladimir Kondratyev + * Copyright (c) 2025 The FreeBSD Foundation + * + * Portions of this software were developed by Björn Zeeb + * under sponsorship from the FreeBSD Foundation. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -30,6 +34,13 @@ #ifndef _LINUXKPI_ACPI_ACPI_H_ #define _LINUXKPI_ACPI_ACPI_H_ +/* + * LINUXKPI_WANT_LINUX_ACPI is a temporary workaround to allow drm-kmod + * to update all needed branches without breaking builds. + * Once that happened and checks are implemented based on __FreeBSD_verison + * we will remove these conditions again. + */ + /* * FreeBSD import of ACPICA has a typedef for BOOLEAN which conflicts with * amdgpu driver. Workaround it on preprocessor level. @@ -46,8 +57,8 @@ typedef int64_t INT64; #include #undef BOOLEAN +typedef ACPI_IO_ADDRESS acpi_io_address; typedef ACPI_HANDLE acpi_handle; -typedef ACPI_OBJECT acpi_object; typedef ACPI_OBJECT_HANDLER acpi_object_handler; typedef ACPI_OBJECT_TYPE acpi_object_type; typedef ACPI_STATUS acpi_status; @@ -55,12 +66,62 @@ typedef ACPI_STRING acpi_string; typedef ACPI_SIZE acpi_size; typedef ACPI_WALK_CALLBACK acpi_walk_callback; +union linuxkpi_acpi_object { + acpi_object_type type; + struct { + acpi_object_type type; + UINT64 value; + } integer; + struct { + acpi_object_type type; + UINT32 length; + char *pointer; + } string; + struct { + acpi_object_type type; + UINT32 length; + UINT8 *pointer; + } buffer; + struct { + acpi_object_type type; + UINT32 count; + union linuxkpi_acpi_object *elements; + } package; + struct { + acpi_object_type type; + acpi_object_type actual_type; + acpi_handle handle; + } reference; + struct { + acpi_object_type type; + UINT32 proc_id; + acpi_io_address pblk_address; + UINT32 pblk_length; + } processor; + struct { + acpi_object_type type; + UINT32 system_level; + UINT32 resource_order; + } power_resource; +}; + +#ifdef LINUXKPI_WANT_LINUX_ACPI +struct linuxkpi_acpi_buffer { + acpi_size length; /* Length in bytes of the buffer */ + void *pointer; /* pointer to buffer */ +}; + +typedef struct linuxkpi_acpi_buffer lkpi_acpi_buffer_t; +#else +typedef ACPI_BUFFER lkpi_acpi_buffer_t; +#endif + static inline ACPI_STATUS acpi_evaluate_object(ACPI_HANDLE Object, ACPI_STRING Pathname, - ACPI_OBJECT_LIST *ParameterObjects, ACPI_BUFFER *ReturnObjectBuffer) + ACPI_OBJECT_LIST *ParameterObjects, lkpi_acpi_buffer_t *ReturnObjectBuffer) { return (AcpiEvaluateObject( - Object, Pathname, ParameterObjects, ReturnObjectBuffer)); + Object, Pathname, ParameterObjects, (ACPI_BUFFER *)ReturnObjectBuffer)); } static inline const char * @@ -83,9 +144,9 @@ acpi_get_data(ACPI_HANDLE ObjHandle, ACPI_OBJECT_HANDLER Handler, void **Data) } static inline ACPI_STATUS -acpi_get_name(ACPI_HANDLE Object, UINT32 NameType, ACPI_BUFFER *RetPathPtr) +acpi_get_name(ACPI_HANDLE Object, UINT32 NameType, lkpi_acpi_buffer_t *RetPathPtr) { - return (AcpiGetName(Object, NameType, RetPathPtr)); + return (AcpiGetName(Object, NameType, (ACPI_BUFFER *)RetPathPtr)); } static inline ACPI_STATUS @@ -101,4 +162,9 @@ acpi_put_table(ACPI_TABLE_HEADER *Table) AcpiPutTable(Table); } +#ifdef LINUXKPI_WANT_LINUX_ACPI +#define acpi_object linuxkpi_acpi_object +#define acpi_buffer linuxkpi_acpi_buffer +#endif + #endif /* _LINUXKPI_ACPI_ACPI_H_ */ From nobody Sun Jul 13 19:31:09 2025 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 4bgFtR1cQWz61N0n; Sun, 13 Jul 2025 19:31:11 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bgFtP5y1Rz3k1b; Sun, 13 Jul 2025 19:31:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752435069; 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=rEaiX0gvhP87QlnOutCWP23EviEnXBJDG6xtMaeYm5E=; b=kpzFepIA0mVqvjp6Ifxc/Nw0ovDWQfNmTvzTFAoXYJk46rdlcDXzq+bqog+tcspom+hQc8 GgKiPllwoFG874F4TsuRLh/LIsWx+fb8jzk0+Sj+FAZDlRWBFUzB0iqNOIsQm7RGqilAAd R4rB12zH9cArt6RNfwwnO5SM3X+tLQ3gc/HiPh33XSB6GssDwjLnyVxWKUt4jqjPYH0YFD Y9CoPyBRC6444rjS7qMX1Pm1+cLNV0BJvCaa1J9QRJb3QBt1XH9xDng7DMCKxsls4ENTQl JXNEYTOVHRAmR7cspn6ZF5BuRsVKer8hJ3LcU52RpIly46hQ9MP7VOicHPaimQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752435069; 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=rEaiX0gvhP87QlnOutCWP23EviEnXBJDG6xtMaeYm5E=; b=EzyoQNMS28C66yAKKiyeFvpXcUZemcuHTE/G0CCi5Id0c3gpEE8EfiUtFW/lALOn9C45k+ TAkwBFhEp7ZBtvE0o4jBugkxxPo6Gk8e355XfJZ+U5FN3oPoedwvyWuXyogQIxeH0AR6wc k4II2+/HSYYm6JqqxvVpcU0EF6wTyblfxL0jwpa/8MUMETNlgZKGPTQRr4sc1ZZwj+Y7TS w+KRJ/FL6val/f5NKZlZD7vYP/AeF0ZvD5tQhWMrASBR2FBj0w5MphOxrFRPMnmh6nyXtp 6853eVvylSQKQtm3ar52qO67gO6z5n0pgRqOmn6vh4SKM8mFSsSsfVSP4s4l2g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752435069; a=rsa-sha256; cv=none; b=jWRg8MFZXahIxH9cA9GLSX2hwfvhystIujlrBo9tQeh+P+DwCZA7OPbNm4r964MU0bk3bH DKTgOs7nHoVthiadI7rk98A+NvnXx0VIzELr7SmcfFjkTbDXP1WKTvdMcSmV+Et2xPg2/3 YPukDG6HlLIJqTgoA5P3mUkTXIgyr1iXzeafotZsQOqqC4CqqSWTQNkMCvpZ98i8tdsrfd x1MbayLnudAoZ7SXLF87jhPcVIxo709fNiuAVAYIbwC+o4+q1Y9KQkR8vk5N68BzaAO3Ht 10j83YkoXJ39Ei2itmswn59j9WLc6m7iZ2BJinALBVoKXZr8FWaGCy///sHC8w== 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 4bgFtP5GNzz6S4; Sun, 13 Jul 2025 19:31:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56DJV9T0070789; Sun, 13 Jul 2025 19:31:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56DJV9iI070786; Sun, 13 Jul 2025 19:31:09 GMT (envelope-from git) Date: Sun, 13 Jul 2025 19:31:09 GMT Message-Id: <202507131931.56DJV9iI070786@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 87e6f90667e5 - stable/14 - LinuxKPI: MODULE_DEVICE_TABLE() factor out the bus specific MODULE_PNP_INFO() 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 87e6f90667e5a841592d8a2522f90981fd3e3fff Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=87e6f90667e5a841592d8a2522f90981fd3e3fff commit 87e6f90667e5a841592d8a2522f90981fd3e3fff Author: Bjoern A. Zeeb AuthorDate: 2025-06-22 22:50:33 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-07-13 19:25:03 +0000 LinuxKPI: MODULE_DEVICE_TABLE() factor out the bus specific MODULE_PNP_INFO() In order to be able to use MODULE_DEVICE_TABLE() with multiple bus attachments, factor out the bus-specfic MODULE_PNP_INFO() and place it next to the structure defining the table. As it turns out bnxt(4) has been using the MODULE_DEVICE_TABLE() with PCI attachments for the "auxillary" bus so far. That makes little sense. Define the MODULE_PNP_INFO() to nothing for that. We may consider pulling these LinucKPI bits in semi-native drivers into LinuxKPI one day as that route is not really sustainabke. Sponsored by: The FreeBSD Foundation Reviewed by: imp, dumbbell Differential Revision: https://reviews.freebsd.org/D51049 (cherry picked from commit 2f5666c1727c949491f73e6c3277b7b542131714) --- sys/compat/linuxkpi/common/include/linux/pci.h | 7 +++++-- sys/dev/bnxt/bnxt_en/bnxt_auxbus_compat.h | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/pci.h b/sys/compat/linuxkpi/common/include/linux/pci.h index 15fedb87e6e6..9d0725089269 100644 --- a/sys/compat/linuxkpi/common/include/linux/pci.h +++ b/sys/compat/linuxkpi/common/include/linux/pci.h @@ -70,6 +70,10 @@ struct pci_device_id { uintptr_t driver_data; }; +#define MODULE_DEVICE_TABLE_BUS_pci(_bus, _table) \ +MODULE_PNP_INFO("U32:vendor;U32:device;V32:subvendor;V32:subdevice", \ + _bus, lkpi_ ## _table, _table, nitems(_table) - 1) + /* Linux has an empty element at the end of the ID table -> nitems() - 1. */ #define MODULE_DEVICE_TABLE(_bus, _table) \ \ @@ -86,8 +90,7 @@ static driver_t _ ## _bus ## _ ## _table ## _driver = { \ DRIVER_MODULE(lkpi_ ## _table, _bus, _ ## _bus ## _ ## _table ## _driver,\ 0, 0); \ \ -MODULE_PNP_INFO("U32:vendor;U32:device;V32:subvendor;V32:subdevice", \ - _bus, lkpi_ ## _table, _table, nitems(_table) - 1) +MODULE_DEVICE_TABLE_BUS_ ## _bus(_bus, _table) #define PCI_ANY_ID -1U diff --git a/sys/dev/bnxt/bnxt_en/bnxt_auxbus_compat.h b/sys/dev/bnxt/bnxt_en/bnxt_auxbus_compat.h index 1d844a67c928..c4c9e789cf3e 100644 --- a/sys/dev/bnxt/bnxt_en/bnxt_auxbus_compat.h +++ b/sys/dev/bnxt/bnxt_en/bnxt_auxbus_compat.h @@ -39,6 +39,7 @@ struct auxiliary_device_id { char name[AUXILIARY_NAME_SIZE]; uint64_t driver_data; }; +#define MODULE_DEVICE_TABLE_BUS_auxiliary(_bus, _table) struct auxiliary_device { struct device dev; From nobody Sun Jul 13 19:31:11 2025 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 4bgFtS6YlYz61NDN; Sun, 13 Jul 2025 19:31:12 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bgFtS0RYxz3k8G; Sun, 13 Jul 2025 19:31:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752435072; 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=S2VdhuarmuhycBN4uN/FFyQevA+caxP8naI6FXWHRh8=; b=Um/cScsGCUxtrW0FQbt60ZNYeeT/91N0bXxQdqgbMVB/U5yVFGItGZvt8e++2PruJvvIve wplBP1wXW+ESLkd2uaxsfNptkYEKcg+3zfQeknR0R4ii/pRbs3jeaSx6bX9ahGnLs07fQG Do9CKA4e62eUASJnsC9JiVv14pNWrXz6sKlRE6mThQjUv2oXOpDAEU8XikKzXiA7h2ACRp lczSzznjutb5qSZ3U6gOgoGXci2MBdymleFG0QE1eOwUzTJM7giWWES/cFcyIpA8C9R/GM 1mHXEjtpGY8o9RofIo9YepYawkXeU0fEik7G8rRVUfGxhZoO78qnpoK1+WJM3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752435072; 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=S2VdhuarmuhycBN4uN/FFyQevA+caxP8naI6FXWHRh8=; b=nD8QrteLjjJugzSa6ph8BlgYetDMYqWs51z6TYl420apvtlqsZEwb6r+hi4B9SniuBmA+T 2gq6ewwrUSebVlwarWDK65TeYen9mZOOdRsa6hXnvo9AXXbHTmYl/Qt5MFQDDxz2a8c6X0 0/qPT7OBGGmoRznoW4odmDf3cDPEtvOFfeImqYi3o/S9GQdyvK0+uhunnx6ZEJg4ceyJh5 vp2A1WT081beZLL8z8/N81ZuGeldfLaFTqUH89mZpFU7GRHTBCgBce6Sv25WOgMq+8+nt4 w0xknywR1a3iG0BAuzab/KvqddFO88Ws+t0QX8GWmbkcOrHFp/JWX9TODlrLug== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752435072; a=rsa-sha256; cv=none; b=ZR7GFIA6DG93bAvCP+Cr9KcBrOLiAmrcVroJnZ8sFzJKuLXo3DdYo2HJcsZJKjr76dntsz cF6/TsHmvQFj/oAELuEaoXkJAdf4MOtq16ugT7WMl4qjVcn6K9luSwM2Qz2qpX9XhhwyST F85imTNCQWRH4S7PQrKnDOxwSX4SovsocpEiHtk/dF1EA9RvP8hNfAV4PV2YIw/EfrdJdh f1wqotlbtAonS+/K7jm0hywFsT8sifIZBsMrG6oRDE/j77AhqxVWfth8TM0CBTMaNJw6HS SIWi2dHc9+6p6fuoHmffqdKMNk5DR+xNpgt32UzUTzkl6iUYSAJS83qbGMlx2Q== 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 4bgFtR6cTgz6S6; Sun, 13 Jul 2025 19:31:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56DJVBAv070863; Sun, 13 Jul 2025 19:31:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56DJVBKI070860; Sun, 13 Jul 2025 19:31:11 GMT (envelope-from git) Date: Sun, 13 Jul 2025 19:31:11 GMT Message-Id: <202507131931.56DJVBKI070860@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 45f0c867803b - stable/14 - LinuxKPI: acpi: add acpi_evaluate_dsm() 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 45f0c867803bed4251b9c1bc65d610796e6e1cac Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=45f0c867803bed4251b9c1bc65d610796e6e1cac commit 45f0c867803bed4251b9c1bc65d610796e6e1cac Author: Bjoern A. Zeeb AuthorDate: 2025-06-15 10:43:18 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-07-13 19:25:03 +0000 LinuxKPI: acpi: add acpi_evaluate_dsm() Add a acpi_evaluate_dsm() wrapper around the native implementation as needd by wireless drivers. Sponsored by: The FreeBSD Foundation Reviewed by: dumbbell Differential Revision: https://reviews.freebsd.org/D50864 (cherry picked from commit ba6460df5607e572e9c868413c75ce9bc5ce9a00) --- sys/compat/linuxkpi/common/include/acpi/acpi_bus.h | 6 ++++++ sys/compat/linuxkpi/common/src/linux_acpi.c | 19 +++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/acpi/acpi_bus.h b/sys/compat/linuxkpi/common/include/acpi/acpi_bus.h index 65bcbe7f1bdd..47195e7d66a6 100644 --- a/sys/compat/linuxkpi/common/include/acpi/acpi_bus.h +++ b/sys/compat/linuxkpi/common/include/acpi/acpi_bus.h @@ -58,4 +58,10 @@ bool lkpi_acpi_dev_present(const char *hid, const char *uid, struct acpi_device *lkpi_acpi_dev_get_first_match_dev(const char *hid, const char *uid, int64_t hrv); +union linuxkpi_acpi_object; + +union linuxkpi_acpi_object * +acpi_evaluate_dsm(ACPI_HANDLE ObjHandle, const guid_t *guid, + UINT64 rev, UINT64 func, union linuxkpi_acpi_object *arg); + #endif /* _LINUXKPI_ACPI_ACPI_BUS_H_ */ diff --git a/sys/compat/linuxkpi/common/src/linux_acpi.c b/sys/compat/linuxkpi/common/src/linux_acpi.c index 6a9afb3ddff0..d18c69d9210d 100644 --- a/sys/compat/linuxkpi/common/src/linux_acpi.c +++ b/sys/compat/linuxkpi/common/src/linux_acpi.c @@ -39,6 +39,7 @@ #include #include +#include #include #include @@ -99,6 +100,17 @@ acpi_evaluate_dsm_typed(ACPI_HANDLE handle, const char *uuid, int rev, argv4, &buf, type)) ? (ACPI_OBJECT *)buf.Pointer : NULL); } +union linuxkpi_acpi_object * +acpi_evaluate_dsm(ACPI_HANDLE ObjHandle, const guid_t *guid, + UINT64 rev, UINT64 func, union linuxkpi_acpi_object *pkg) +{ + ACPI_BUFFER buf; + + return (ACPI_SUCCESS(acpi_EvaluateDSM(ObjHandle, (const uint8_t *)guid, + rev, func, (ACPI_OBJECT *)pkg, &buf)) ? + (union linuxkpi_acpi_object *)buf.Pointer : NULL); +} + static void linux_handle_power_suspend_event(void *arg __unused) { @@ -323,6 +335,13 @@ acpi_evaluate_dsm_typed(ACPI_HANDLE handle, const char *uuid, int rev, return (NULL); } +union linuxkpi_acpi_object * +acpi_evaluate_dsm(ACPI_HANDLE ObjHandle, const guid_t *guid, + UINT64 rev, UINT64 func, union linuxkpi_acpi_object *pkg) +{ + return (NULL); +} + int register_acpi_notifier(struct notifier_block *nb) { From nobody Sun Jul 13 19:31:14 2025 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 4bgFtV3J1Lz61N7h; Sun, 13 Jul 2025 19:31:14 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bgFtV1wG4z3kC7; Sun, 13 Jul 2025 19:31:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752435074; 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=ov3zO46JvaYNJQSkjUuKdvEwV2r3WqHux4tgVVrQJUc=; b=vi7Qub0a2uezOn6+BLUGzFQwDD1YdN5UWW+IuD1vDpo48XKlouCKQ25w11Eg5WAelEc/P9 wzAx7TSYh+ZVaHRxnLLT3doGXljZKW2Jk3Lzfqm3WPqJwzrJnNpB9tN0YTrvciudON2wHr ZRtfUWGORhVvp5Fw6oO59w0Vkuv6oq7hW6fMOT6qCUvjot1lnfRYYmh/C8AqmHcwqp5vR8 Ft3H4K48arJmZUeX4niSmfMJPGW/cVYfiSluDpzWZJtX7ktvoGeYevAA2ZGu9cBar19esU QBEwGvB+URnsVLj/5leFl49Oy0PEje2DLIqNsNXl8xUvYeByxXQz4uYEUXYUGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752435074; 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=ov3zO46JvaYNJQSkjUuKdvEwV2r3WqHux4tgVVrQJUc=; b=VFtJCs0jeeA7zt/G7jQ59H+PcZ8BvjajYaq6JBfGHCfS0iI5bk/kdcTu9gyiBqEf/1aqDq kI2YNiLEJi4+gUxUfZvDTP4cdc9kuuDIc1yBIgLS7dgrBA5GHR9wH9WGMJiBb4gdHQG+Rw pfNRwSdjPnVL4hoknRDduyVejy96mRbA4VV6u4swCEOxxT0je3oXEIWeekUbry/u+8TR22 aMYo76tQ1fxRzkl2yI9nc+as+M9DkHLMidDH2ausYII7+k+vmavS0hJxr8rCboNrqGdTb/ 7yRqB5GFZ3EeB7Fqxz6hItCws9tQpcbSJPFCWpYe1KBCpLWoMT7t6JodF2VAfQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752435074; a=rsa-sha256; cv=none; b=K6E/yZUghLhw0Ql53kF8wgZubWrE996sJSzIkg08dCDf/KF+QJ4qktDFAFFmuJjw1vt1wg 49dwuvb5XRkB8OY82tRDWF64UPPk4T47GRaMt0YSR8hnucSdRZepkyyWMmPfrC02kd6fTd YZIDA0aKWHn47A8YClEqheTIFuPylHPYr4hMGD6KH2iEXH3rSrMzBc22g7TCETKL1RA3RI zek+sivaBl0yijDbknPlqjr8xQq8L6V5/jtEbtsnmoRVkLZMRqqu5BJYyCK4g9lwXdDxQT 5wqz5Yfe0IrCKRWYv7UbHh2NagghnG8svK20CrpU+15mUI1RZSdQJsHdx2HL3w== 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 4bgFtV1W3kz6gq; Sun, 13 Jul 2025 19:31:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56DJVEKY071615; Sun, 13 Jul 2025 19:31:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56DJVEJH071600; Sun, 13 Jul 2025 19:31:14 GMT (envelope-from git) Date: Sun, 13 Jul 2025 19:31:14 GMT Message-Id: <202507131931.56DJVEJH071600@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: f39c377274bd - stable/14 - rtw89: enable ACPI support on FreeBSD 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f39c377274bd02fa0f8e7c4d1a05d3d617de895a Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=f39c377274bd02fa0f8e7c4d1a05d3d617de895a commit f39c377274bd02fa0f8e7c4d1a05d3d617de895a Author: Bjoern A. Zeeb AuthorDate: 2025-06-15 10:44:55 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-07-13 19:26:25 +0000 rtw89: enable ACPI support on FreeBSD Now that LinuxKPI supports the lower case Linux ACPI spellings under LINUXKPI_WANT_LINUX_ACPI remove the #ifdef around the code and compile in ACPI support. Sponsored by: The FreeBSD Foundation (cherry picked from commit 8c97c46418f9767a9984df259116da08d9659076) --- sys/contrib/dev/rtw89/acpi.c | 26 -------------------------- sys/modules/rtw89/Makefile | 1 + 2 files changed, 1 insertion(+), 26 deletions(-) diff --git a/sys/contrib/dev/rtw89/acpi.c b/sys/contrib/dev/rtw89/acpi.c index 02d4526c1538..f5dedb12c129 100644 --- a/sys/contrib/dev/rtw89/acpi.c +++ b/sys/contrib/dev/rtw89/acpi.c @@ -8,7 +8,6 @@ #include "acpi.h" #include "debug.h" -#if defined(__linux__) static const guid_t rtw89_guid = GUID_INIT(0xD2A8C3E8, 0x4B69, 0x4F00, 0x82, 0xBD, 0xFE, 0x86, 0x07, 0x80, 0x3A, 0xA7); @@ -149,14 +148,6 @@ int rtw89_acpi_evaluate_dsm(struct rtw89_dev *rtwdev, ACPI_FREE(obj); return ret; } -#elif defined(__FreeBSD__) -int rtw89_acpi_evaluate_dsm(struct rtw89_dev *rtwdev, - enum rtw89_acpi_dsm_func func, - struct rtw89_acpi_dsm_result *res) -{ - return -ENOENT; -} -#endif int rtw89_acpi_evaluate_rtag(struct rtw89_dev *rtwdev, struct rtw89_acpi_rtag_result *res) @@ -180,28 +171,15 @@ int rtw89_acpi_evaluate_rtag(struct rtw89_dev *rtwdev, if (ACPI_FAILURE(status)) return -EIO; -#if defined(__linux__) obj = buf.pointer; if (obj->type != ACPI_TYPE_BUFFER) { -#elif defined(__FreeBSD__) - obj = buf.Pointer; - if (obj->Type != ACPI_TYPE_BUFFER) { -#endif rtw89_debug(rtwdev, RTW89_DBG_ACPI, -#if defined(__linux__) "acpi: expect buffer but type: %d\n", obj->type); -#elif defined(__FreeBSD__) - "acpi: expect buffer but type: %d\n", obj->Type); -#endif ret = -EINVAL; goto out; } -#if defined(__linux__) buf_len = obj->buffer.length; -#elif defined(__FreeBSD__) - buf_len = obj->Buffer.Length; -#endif if (buf_len != sizeof(*res)) { rtw89_debug(rtwdev, RTW89_DBG_ACPI, "%s: invalid buffer length: %u\n", __func__, buf_len); @@ -209,11 +187,7 @@ int rtw89_acpi_evaluate_rtag(struct rtw89_dev *rtwdev, goto out; } -#if defined(__linux__) *res = *(struct rtw89_acpi_rtag_result *)obj->buffer.pointer; -#elif defined(__FreeBSD__) - *res = *(struct rtw89_acpi_rtag_result *)obj->Buffer.Pointer; -#endif rtw89_hex_dump(rtwdev, RTW89_DBG_ACPI, "antenna_gain: ", res, sizeof(*res)); diff --git a/sys/modules/rtw89/Makefile b/sys/modules/rtw89/Makefile index bed007f9aa51..ae31b7dbd1b6 100644 --- a/sys/modules/rtw89/Makefile +++ b/sys/modules/rtw89/Makefile @@ -40,6 +40,7 @@ SRCS+= ${LINUXKPI_GENSRCS} SRCS+= opt_wlan.h opt_inet6.h opt_inet.h opt_acpi.h CFLAGS+= -DKBUILD_MODNAME='"rtw89"' +CFLAGS+= -DLINUXKPI_WANT_LINUX_ACPI CFLAGS+= -I${DEVRTW89DIR} CFLAGS+= ${LINUXKPI_INCLUDES} From nobody Sun Jul 13 19:31:12 2025 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 4bgFtV0bZSz61N0x; Sun, 13 Jul 2025 19:31:14 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bgFtT1Bd3z3kGv; Sun, 13 Jul 2025 19:31:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752435073; 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=ueFIp5Bv/jq1/h5FlyRZglBdaziwDrBl0xFQyg+NkWc=; b=RMJ0nPrbMJDRWKOj/EmbhXoQFgzUY9U1UG3ySij0iEYstJRpPR2oqDz+zwtvnX06qEUCeC NqDWV9UL7oktl9YqvBELIj5v7X0Xv2cxo/1hxiffp5Imdld/96mdwwWLfMbKWNtBCzO+iH 9YNx9kX8brhSbSbPMBp20oZeKIektXaQqY7w1XjCUYxiWyRHHZsNM11ijCTq2cl/Rr0lRC jpXhbagv+aeMU/QUhEXRivxv21TAdQk+yUE5jCO4QHUzlPfhjV0OmlPnhDjuSKXB/bhcUQ EKssEZrBD+IfDMd0LfbJLVk1H8chECxcUHAxE3dQFalVzGoGKDfsUNXcNAKDPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752435073; 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=ueFIp5Bv/jq1/h5FlyRZglBdaziwDrBl0xFQyg+NkWc=; b=Tc48rgGviSgng/84KqUgAqeBV8avBLrsMnDEr1SPJQVrgbsx+liZcnmdD9aBPi9i7QP/Su Cz1quBBWOSvNb8Wp1hHwRsX8VN7n+KhwPYoWdFJ2ON/+ylltSbQrFPs7+v1io8hyFLYkEU nxe3WBqFziPZUtOvl3S36iQIZLbOdL6N255gc1Z9aRLmASUiPFthAWqY9JZcJ54G6d6K04 6EX+4sE0NLqL7UGP1DG/bWVdgk1dGKWSKck3I85srciYQEo1P2IdYE7BUc0OnDQuJiHdPO CcKoYWoeD0H4KNrqparh8k6eeK/DoZLf1XzPa6TrDE/MFSjzIqEqResRDeZsMg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752435073; a=rsa-sha256; cv=none; b=HUPvyr6nSucK2d707iM4iGTnRO+3fzOwaZvn3Bkkar6NoZOuOZnWdGVhGnm9uxwA7z9MEI 5K0LqGbYtG/UYtfgJVOg5BJVMZfOvfXpQainhx4wzKDuY1RoFJ7+TohFTkU1IFwfaTr3LY kuAL78x0aka9cfa7JjAqLafDBHE3J95cd5c8kXw0BxDmrDq5eQT/2yi1WC2KAMgw3gv77Q zu/QjSom4BAteCl+J2KD6QFNt8mTl/sRoeECrklcuB7DqH+BlBr0Xa4x7fWAh1f1RA2NHI PCnwvgXxAS13ZrXNhF2fd68Z5SaD3g0SwvZn1QBaIMHiJWJn+G9E0ou353LakQ== 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 4bgFtT0khHz66m; Sun, 13 Jul 2025 19:31:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56DJVDMI070898; Sun, 13 Jul 2025 19:31:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56DJVCVl070895; Sun, 13 Jul 2025 19:31:12 GMT (envelope-from git) Date: Sun, 13 Jul 2025 19:31:12 GMT Message-Id: <202507131931.56DJVCVl070895@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 6cdcf08c9c5e - stable/14 - Bump __FreeBSD_verion for LinuxKPI changes to dma-mapping.h and acpi. 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 6cdcf08c9c5eda6dc3b8395cefd9d30a4f5e2f1a Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=6cdcf08c9c5eda6dc3b8395cefd9d30a4f5e2f1a commit 6cdcf08c9c5eda6dc3b8395cefd9d30a4f5e2f1a Author: Bjoern A. Zeeb AuthorDate: 2025-07-04 03:19:23 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-07-13 19:26:25 +0000 Bump __FreeBSD_verion for LinuxKPI changes to dma-mapping.h and acpi. Sponsored by: The FreeBSD Foundation (cherry picked from commit 842da154a0ce8f866d65f495537a13ffa8fb9cc0) --- UPDATING | 3 ++- sys/sys/param.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/UPDATING b/UPDATING index 4d06a05650bf..be2d8be0ff49 100644 --- a/UPDATING +++ b/UPDATING @@ -14,7 +14,8 @@ and/or ports. 20250713: LinuxKPI dma-mapping.h were pulled into the tree from drm-kmod. - Bump _FreeBSD_version to 1403503 to be able to detect this change. + LinuxKPI acpi changes effecting drivers and drm-kmod. + Bump __FreeBSD_version to 1403503 to be able to detect these changes. 20250707: Commit f5195b1a63df removed in6_maxmtu and its setter in6_setmaxmtu(). diff --git a/sys/sys/param.h b/sys/sys/param.h index 4d26484e3bb2..68cbc92b5791 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -75,7 +75,7 @@ * cannot include sys/param.h and should only be updated here. */ #undef __FreeBSD_version -#define __FreeBSD_version 1403502 +#define __FreeBSD_version 1403503 /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From nobody Sun Jul 13 19:31:15 2025 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 4bgFtX1vT8z61NDT; Sun, 13 Jul 2025 19:31:16 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bgFtW4CjWz3kFb; Sun, 13 Jul 2025 19:31:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752435075; 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=FKVjsgYwyrwlag79XXVebkIO1ntYJI2S4FvCljdOocM=; b=KoQJEyi1m0yVHIPsvs3SAbGE3tzxzsLzVP8fJZUa/8INb8UgeltMofRRRkpgwogn6D9M1n 1GSXT3nQR3L4lL6lrfNYORdjU2XANw7diBQP3A0aeYwRSUpjL/rDGKZPpgorz+vVRvj4hi EAYEHr200UOMQBUU5Y6qnXUoeWPg5khxRMuSmEMXMebJP9xUvDmbqIteFGKMk25k3R8ITs Bjw+TP/XO1lHH8L4gybvO5+g1fTzby1h/9vsLKOMM85XKTxggiUA430eZ7l9vFTWkGvOpp IARs7vGWCCWQ6QQOLAYUvJ9BOz6rA3Rh3H6PDanAxmCXzb4N4qrTo79YxzaX6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752435075; 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=FKVjsgYwyrwlag79XXVebkIO1ntYJI2S4FvCljdOocM=; b=kvgpP0WX/fYx4sh0Fur38bFQ33hff4kaybrDZjtyjmUKlI2F5D70P1AEzHQu+Qrmndf2AC Vk/aJCioMloNduNI4b6PTq5jvqCSy3U0tjQVRbFeXL71t0D2RZVKO4H4EAReZDUfF1yXW1 1x7Y3K+2NM+gKU2mFz5/IXdAhKUPO0QIEfGn0R6aCjHm6ZOXjnzgl3/lSPAuEx7W/hAP0x 367HOWxUzRrXyXXrj9paqgOMjo1bB02DZO5Snkz+lFMcJFwUkvAP+MxMjE7eT1isv2BkQ/ ehMH8CGAPDRo88TrsVM6Saa9W7mAr3vWrxFkvTkUiYAAwtxayimK/vbAxRPhOw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752435075; a=rsa-sha256; cv=none; b=MnZPfu8+Z0iGUKAI+fHN/MArz8R9DamINxcL3pdSusmIfq3sDkNb3/PQg4siCIxrdE6HcG NVKldglLrm1fc4yPXSWa9d884ObviqWFtgCoH4l12SHYZmE0/LqmZNMnAir4bNsEE8HaQ8 w9r81ljMXQdxNkN1OInC1VbDAiUFiiLyCziZ3UdtL73qmJ1ZvCn0KMlhUhShGa+lwSS1Jx EoLUA8OnG0SkaYhpWiws7ErA/eoMewsGTZXQWnbMnXujubgQssPT4aOJCzAVphEMulrQ3e RH3Mj7UtWzBwdHUh5HX1WHKJDnl7I/Qnei1NUPMb4aDeZ4XnVisAyRanVZIU9Q== 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 4bgFtW2CYWz6B4; Sun, 13 Jul 2025 19:31:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56DJVFxR071848; Sun, 13 Jul 2025 19:31:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56DJVFJl071845; Sun, 13 Jul 2025 19:31:15 GMT (envelope-from git) Date: Sun, 13 Jul 2025 19:31:15 GMT Message-Id: <202507131931.56DJVFJl071845@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: c4496f82680c - stable/14 - iwlwifi: compile in ACPI support 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c4496f82680c5edb0820598817ea22e322250317 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=c4496f82680c5edb0820598817ea22e322250317 commit c4496f82680c5edb0820598817ea22e322250317 Author: Bjoern A. Zeeb AuthorDate: 2025-06-15 10:46:22 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-07-13 19:26:25 +0000 iwlwifi: compile in ACPI support Now that LinuxKPI supports the lower case Linux ACPI spellings under LINUXKPI_WANT_LINUX_ACPI we only need to provide the debug macro to allow us to compile in ACPI support. This ties into regulatory and will be used, e.g., for 11ax, 11be, and Per Platform Antenna Gain (PPAG) settings. Sponsored by: The FreeBSD Foundation (cherry picked from commit 228b43c258d24c293b135ae94c120e7ccf0a7aea) --- sys/contrib/dev/iwlwifi/iwl-debug.h | 4 +++- sys/modules/iwlwifi/Makefile | 8 +++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/sys/contrib/dev/iwlwifi/iwl-debug.h b/sys/contrib/dev/iwlwifi/iwl-debug.h index 43288a5a8d74..7b3b402766b4 100644 --- a/sys/contrib/dev/iwlwifi/iwl-debug.h +++ b/sys/contrib/dev/iwlwifi/iwl-debug.h @@ -47,7 +47,7 @@ enum iwl_dl { IWL_DL_DROP = 0x00000010, IWL_DL_EEPROM = 0x00000020, IWL_DL_FW = 0x00000040, - /* = 0x00000080, */ + IWL_DL_DEV_RADIO = 0x00000080, IWL_DL_HC = 0x00000100, IWL_DL_HT = 0x00000200, IWL_DL_INFO = 0x00000400, @@ -195,6 +195,8 @@ void __iwl_dbg(struct device *, u32, bool, const char *, const char *fmt, ...); IWL_DPRINTF(_subsys, IWL_DL_WEP, _fmt, ##__VA_ARGS__) #define IWL_DEBUG_WOWLAN(_subsys, _fmt, ...) \ IWL_DPRINTF(_subsys, IWL_DL_WOWLAN, _fmt, ##__VA_ARGS__) +#define IWL_DEBUG_DEV_RADIO(_dev, _fmt, ...) \ + IWL_DPRINTF_DEV((_dev), IWL_DL_DEV_RADIO, _fmt, ##__VA_ARGS__) #define IWL_DEBUG_PCI_RW(_subsys, _fmt, ...) \ IWL_DPRINTF(_subsys, IWL_DL_PCI_RW, _fmt, ##__VA_ARGS__) diff --git a/sys/modules/iwlwifi/Makefile b/sys/modules/iwlwifi/Makefile index fd11e670b540..7f4ef7d8d32d 100644 --- a/sys/modules/iwlwifi/Makefile +++ b/sys/modules/iwlwifi/Makefile @@ -5,6 +5,7 @@ DEVIWLWIFIDIR= ${SRCTOP}/sys/contrib/dev/iwlwifi WITH_CONFIG_PM= 0 WITH_DEBUGFS= 1 +WITH_CONFIG_ACPI= 1 KMOD= if_iwlwifi @@ -41,6 +42,12 @@ CFLAGS+= -DCONFIG_PM CFLAGS+= -DCONFIG_PM_SLEEP .endif +.if defined(WITH_CONFIG_ACPI) && ${WITH_CONFIG_ACPI} > 0 +SRCS+= fw/acpi.c +CFLAGS+= -DCONFIG_ACPI +CFLAGS+= -DLINUXKPI_WANT_LINUX_ACPI +.endif + SRCS+= iwl-devtrace.c # Other @@ -57,7 +64,6 @@ CFLAGS+= -DCONFIG_IWLMVM=1 # Helpful after fresh imports. #CFLAGS+= -ferror-limit=0 -#CFLAGS+= -DCONFIG_ACPI=1 #CFLAGS+= -DCONFIG_INET=1 # Need LKPI TSO implementation. #CFLAGS+= -DCONFIG_IPV6=1 CFLAGS+= -DCONFIG_IWLWIFI_DEBUG=1 From nobody Sun Jul 13 21:26:27 2025 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 4bgJRR4Sl3z61W6C; Sun, 13 Jul 2025 21:26:27 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bgJRR36HJz3VQN; Sun, 13 Jul 2025 21:26:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752441987; 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=WcCPC2fzdTYVewmBdTmIszZX7qHOB5UaWTEotdMbUfE=; b=DdHbfaiKFqmn2VyUpadu4kqDFjdm8FYMOtpglbLiARj0Q06VFmiudqRFJTTXnaG9Q1p9gQ lgrzOBNAeX+saHkSXCHy/Pv++YrTdRG1Kfdkscxl3NYPKtt1uZ/UVakuVHJrRrfbaNzw1z /bidMau4cM3+gYJeaXDOKLvuKprqukQ/VQuNLCDz5hWpM8B4X/CgruQAyWKDb4ZQ4yoTk7 /hXpHvjQfBrPqZ22VXxWu8JW6dHH1WYf44Xj9J4JkSj4VCoBMm1xwGuFEYq2ls3dt/k5bV /6tNPHqHiBSXAdiDW+h32MZ6IKlpka8P1YYdT4mW9ya/Z/f+0Ax1mTMc2G8Mgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752441987; 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=WcCPC2fzdTYVewmBdTmIszZX7qHOB5UaWTEotdMbUfE=; b=hoO/krSeiPpIX/z+GtPLmOKLSkNvRIIFluxg+fdyb5H/0nUd8DzLC2zBAB5Ir4bnkNQcBM kb04TDyJJxnNgRuM1Gp+edltnirOOdCOH1NB5CQZPK24tVev62d6H3uAt1xbGiF5fQnWig UMRkMWxbNgi+cpK4jdLdyI06d2Ztxh505da+9cTcn4JqyecfcDuwhLSsh6yjN/kQPabEve gSutBcJPj2CfvTfKQRgfVXzMwbnHZjbhR1sC7jP1Ji3WDS2QU4Ag3vCFA4Ng/HCcCgXzqf Nfx2LbPNr5KVBvfZWyplE09J5U3J7sl/g6QUWm6JJBF7v9e25jq7HLkMlvKang== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752441987; a=rsa-sha256; cv=none; b=gFRTFSE0yjaotQ1ZDwwetquRx0AFNmu3a4c2bwoOKHmCIW8e+zAfOjHuJXRSDMspSzxC8d oOiHBJbL98b2KBRVJGG6EuGy9UxPpLws7HEy4UJRbruy+TQX7I/wLDoQATONv7HbgDKuD/ AEa3LPBgCEvMJH+gU0wE56JPlYpGm5E8iU0AB+8X7MLfyJ99lWDBIpSX3ruqXqGtnvzTbR i3jN78fNePd3J9vkntVSBH/G9EBpjZfR5svzphDM/dv5CdDKySBbqf1rtgAaLcGkDrktWs +omapbeVD3vqFIUZWcSLjZJCrh62f1namDa1vrRcSqMXQEmaXg5DYboxvXVxWw== 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 4bgJRR2Qlmz9Wn; Sun, 13 Jul 2025 21:26:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56DLQRJh084734; Sun, 13 Jul 2025 21:26:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56DLQRuS084731; Sun, 13 Jul 2025 21:26:27 GMT (envelope-from git) Date: Sun, 13 Jul 2025 21:26:27 GMT Message-Id: <202507132126.56DLQRuS084731@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 697bf0f416e4 - main - fortune: Fix typo in dmesgd.nycbug.org example 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 697bf0f416e4fe0fdd974b9eacdaed140fe18061 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=697bf0f416e4fe0fdd974b9eacdaed140fe18061 commit 697bf0f416e4fe0fdd974b9eacdaed140fe18061 Author: Christos Margiolis AuthorDate: 2025-07-13 21:25:07 +0000 Commit: Christos Margiolis CommitDate: 2025-07-13 21:25:58 +0000 fortune: Fix typo in dmesgd.nycbug.org example No functional change, but commit for correctness nonetheless. MFC after: 1 day Differential Revision: https://reviews.freebsd.org/D51293 --- usr.bin/fortune/datfiles/freebsd-tips | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/fortune/datfiles/freebsd-tips b/usr.bin/fortune/datfiles/freebsd-tips index 1e9501e3a6fb..6a2b59ff5fa7 100644 --- a/usr.bin/fortune/datfiles/freebsd-tips +++ b/usr.bin/fortune/datfiles/freebsd-tips @@ -555,7 +555,7 @@ Use "sysrc name=value" to add an entry and "sysrc -x name" to delete an entry. You can upload the dmesg of your system to help developers get an overview of commonly used hardware and peripherals for FreeBSD. Use the curl package to upload it like this: curl -v -d "nickname=$USER" -d "description=FreeBSD/$(uname -m) on \ -$(kenv smbios.system.maker) $(kenv smbios.system.product)" -d "do=addd" \ +$(kenv smbios.system.maker) $(kenv smbios.system.product)" -d "do=add" \ --data-urlencode 'dmesg@/var/run/dmesg.boot' http://dmesgd.nycbug.org/index.cgi % Want to know how much memory (in bytes) your machine has installed? Let