From nobody Mon Apr 29 01:27:22 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VSQfy1qJnz5HtpR; Mon, 29 Apr 2024 01:27: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VSQfy1GVQz4hsv; Mon, 29 Apr 2024 01:27:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714354042; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eXPPa8osEEDLjwDugd4U5dpSj4rJxDIJjvy3Bj2gXfQ=; b=IiRq49b54YKxqJccm6p09bd/oVmTKUeWkpzYf6Ems6L4p4JiPyE1UWVo/61ft1Oq1cifQh qkAKkt9Rkhpj/vn/wn28St9Sbwt080nZCicM+UC07fgiBp7tneZkuXMonl1eYtqjzBC4qw Av40nT3FX7OV+hKQ7cxAXL42FJ9zh/s34U4Ze1o+EoCSAq//iUSGuRUggCJbiQOoUOe6lc 5uwzCcG5GiXGAcUlI66PVEK3fRml2bmB+5XW6mAgtvuidVa73MNWL96CJg1JggmWVk9it4 p/m3QLWicGc0IkkPI9ZHA36Z9hLfoGPkBU+MEWH+6IxS/7EHe1dbsUBKWmZmJQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714354042; a=rsa-sha256; cv=none; b=QFyzNtIrdMfq21lLHiwKggmwnO7RvBT42GqdCi9d3h1pfPro1G0kmpJ7N/u6Ujzl3TSbJH JA1+jq4UtKBw29gjcwq7drS0aOKeaWxodZt6UInOCsLs+xdU73/Z9juQ798+D9KToktxf+ ZXSqCKPT/cwoJMwZ5/8EZk/yWfcUmcwaHQXONJTyUCUZHXQh2zOYkcJQTouCbeL8dpbtx1 RzjL6FIPnVQoyqMzZAc8ga+B4zKb7aGYd9n44HxEPdjFXHWchfsxTrsOt1oe75zSLlNans b0JgNsEyuk/wAPthN9Zprwj3p8aninOzWP8paKKlH6iUqK0JzTEgm3MKLbw+uA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714354042; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eXPPa8osEEDLjwDugd4U5dpSj4rJxDIJjvy3Bj2gXfQ=; b=LE7JLXtrpZ4bciuDcF0dRElZ2tYkh+PP51WezpOHjcWFbLEJ95LzBkmQA0/GN11+r2Kwc0 RZk0PB3QT2lLWRdZaXp8AZC79HS1qdrflKCTdDbKRp8+up3I/ueNum3/J0I6mN7judqMLL drmkt/R4D86I+2u9+a2x5fbbQP/2HOGf8TqhEwlJyiYfUB9Fx9YKOgHdLORUrwB3E8E01/ 7IoGXyDOosagIE/E7zsaERYLpb/qLTr8RroJSyn2UWu9v4yWWzcRaAI6wngQXmQ/4WirFq J4UocU2JW0EnlE9ki3iDoFQJMiOPPezLPiZwCpQVGj95oyehz+5QBD4Xm/J/dQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VSQfy0nctzpHN; Mon, 29 Apr 2024 01:27:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43T1RMwW038885; Mon, 29 Apr 2024 01:27:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43T1RMSJ038882; Mon, 29 Apr 2024 01:27:22 GMT (envelope-from git) Date: Mon, 29 Apr 2024 01:27:22 GMT Message-Id: <202404290127.43T1RMSJ038882@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Jason A. Harmening" Subject: git: 05e8ab627bc6 - main - unionfs_rename: fix numerous locking issues List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jah X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 05e8ab627bc6fc6e607aea94b60fd264b8a6c736 Auto-Submitted: auto-generated The branch main has been updated by jah: URL: https://cgit.FreeBSD.org/src/commit/?id=05e8ab627bc6fc6e607aea94b60fd264b8a6c736 commit 05e8ab627bc6fc6e607aea94b60fd264b8a6c736 Author: Jason A. Harmening AuthorDate: 2024-02-18 00:20:51 +0000 Commit: Jason A. Harmening CommitDate: 2024-04-29 01:19:48 +0000 unionfs_rename: fix numerous locking issues There are a few places in which unionfs_rename() accesses fvp's private data without holding the necessary lock/interlock. Moreover, the implementation completely fails to handle the case in which fdvp is not the same as tdvp; in this case it simply fails to lock fdvp at all. Finally, it locks fvp while potentially already holding tvp's lock, but makes no attempt to deal with possible LOR there. Fix this by optimistically using the vnode interlock to protect the short accesses to fdvp and fvp private data, sequentially. If a file copy or shadow directory creation is required to prepare the upper FS for the rename operation, the interlock must be dropped and fdvp/fvp locked as necessary. Additionally, use ERELOOKUP (as suggested by kib@) to simplify the locking logic and eliminate unionfs_relookup() calls for file-copy/ shadow-directory cases that require tdvp's lock to be dropped. Reviewed by: kib (earlier version), olce Tested by: pho Differential Revision: https://reviews.freebsd.org/D44788 --- sys/fs/unionfs/union_vnops.c | 152 +++++++++++++++++++++++++++---------------- 1 file changed, 96 insertions(+), 56 deletions(-) diff --git a/sys/fs/unionfs/union_vnops.c b/sys/fs/unionfs/union_vnops.c index 187d0513da25..aa2a7273825a 100644 --- a/sys/fs/unionfs/union_vnops.c +++ b/sys/fs/unionfs/union_vnops.c @@ -1167,7 +1167,6 @@ unionfs_rename(struct vop_rename_args *ap) struct unionfs_mount *ump; struct unionfs_node *unp; int error; - int needrelookup; UNIONFS_INTERNAL_DEBUG("unionfs_rename: enter\n"); @@ -1185,7 +1184,6 @@ unionfs_rename(struct vop_rename_args *ap) rfvp = fvp; rtdvp = tdvp; rtvp = tvp; - needrelookup = 0; /* check for cross device rename */ if (fvp->v_mount != tdvp->v_mount || @@ -1201,58 +1199,114 @@ unionfs_rename(struct vop_rename_args *ap) if (fvp == tvp) goto unionfs_rename_abort; - /* - * from/to vnode is unionfs node. - */ - - KASSERT_UNIONFS_VNODE(fdvp); - KASSERT_UNIONFS_VNODE(fvp); KASSERT_UNIONFS_VNODE(tdvp); if (tvp != NULLVP) KASSERT_UNIONFS_VNODE(tvp); - + if (fdvp != tdvp) + VI_LOCK(fdvp); unp = VTOUNIONFS(fdvp); + if (unp == NULL) { + if (fdvp != tdvp) + VI_UNLOCK(fdvp); + error = ENOENT; + goto unionfs_rename_abort; + } #ifdef UNIONFS_IDBG_RENAME UNIONFS_INTERNAL_DEBUG("fdvp=%p, ufdvp=%p, lfdvp=%p\n", fdvp, unp->un_uppervp, unp->un_lowervp); #endif if (unp->un_uppervp == NULLVP) { error = ENODEV; - goto unionfs_rename_abort; + } else { + rfdvp = unp->un_uppervp; + vref(rfdvp); } - rfdvp = unp->un_uppervp; - vref(rfdvp); + if (fdvp != tdvp) + VI_UNLOCK(fdvp); + if (error != 0) + goto unionfs_rename_abort; + VI_LOCK(fvp); unp = VTOUNIONFS(fvp); + if (unp == NULL) { + VI_UNLOCK(fvp); + error = ENOENT; + goto unionfs_rename_abort; + } + #ifdef UNIONFS_IDBG_RENAME UNIONFS_INTERNAL_DEBUG("fvp=%p, ufvp=%p, lfvp=%p\n", fvp, unp->un_uppervp, unp->un_lowervp); #endif ump = MOUNTTOUNIONFSMOUNT(fvp->v_mount); + /* + * If we only have a lower vnode, copy the source file to the upper + * FS so that the rename operation can be issued against the upper FS. + */ if (unp->un_uppervp == NULLVP) { - switch (fvp->v_type) { - case VREG: - if ((error = vn_lock(fvp, LK_EXCLUSIVE)) != 0) - goto unionfs_rename_abort; - error = unionfs_copyfile(unp, 1, fcnp->cn_cred, td); - VOP_UNLOCK(fvp); - if (error != 0) - goto unionfs_rename_abort; - break; - case VDIR: - if ((error = vn_lock(fvp, LK_EXCLUSIVE)) != 0) - goto unionfs_rename_abort; - error = unionfs_mkshadowdir(ump, rfdvp, unp, fcnp, td); - VOP_UNLOCK(fvp); - if (error != 0) - goto unionfs_rename_abort; - break; - default: - error = ENODEV; - goto unionfs_rename_abort; + bool unlock_fdvp = false, relock_tdvp = false; + VI_UNLOCK(fvp); + if (tvp != NULLVP) + VOP_UNLOCK(tvp); + if (fvp->v_type == VREG) { + /* + * For regular files, unionfs_copyfile() will expect + * fdvp's upper parent directory vnode to be unlocked + * and will temporarily lock it. If fdvp == tdvp, we + * should unlock tdvp to avoid recursion on tdvp's + * lock. If fdvp != tdvp, we should also unlock tdvp + * to avoid potential deadlock due to holding tdvp's + * lock while locking unrelated vnodes associated with + * fdvp/fvp. + */ + VOP_UNLOCK(tdvp); + relock_tdvp = true; + } else if (fvp->v_type == VDIR && tdvp != fdvp) { + /* + * For directories, unionfs_mkshadowdir() will expect + * fdvp's upper parent directory vnode to be locked + * and will temporarily unlock it. If fdvp == tdvp, + * we can therefore leave tdvp locked. If fdvp != + * tdvp, we should exchange the lock on tdvp for a + * lock on fdvp. + */ + VOP_UNLOCK(tdvp); + unlock_fdvp = true; + relock_tdvp = true; + vn_lock(fdvp, LK_EXCLUSIVE | LK_RETRY); } - - needrelookup = 1; + vn_lock(fvp, LK_EXCLUSIVE | LK_RETRY); + unp = VTOUNIONFS(fvp); + if (unp == NULL) + error = ENOENT; + else if (unp->un_uppervp == NULLVP) { + switch (fvp->v_type) { + case VREG: + error = unionfs_copyfile(unp, 1, fcnp->cn_cred, td); + break; + case VDIR: + error = unionfs_mkshadowdir(ump, rfdvp, unp, fcnp, td); + break; + default: + error = ENODEV; + break; + } + } + VOP_UNLOCK(fvp); + if (unlock_fdvp) + VOP_UNLOCK(fdvp); + if (relock_tdvp) + vn_lock(tdvp, LK_EXCLUSIVE | LK_RETRY); + if (tvp != NULLVP) + vn_lock(tvp, LK_EXCLUSIVE | LK_RETRY); + /* + * Since we've dropped tdvp's lock at some point in the copy + * sequence above, force the caller to re-drive the lookup + * in case the relationship between tdvp and tvp has changed. + */ + if (error == 0) + error = ERELOOKUP; + goto unionfs_rename_abort; } if (unp->un_lowervp != NULLVP) @@ -1260,7 +1314,10 @@ unionfs_rename(struct vop_rename_args *ap) rfvp = unp->un_uppervp; vref(rfvp); + VI_UNLOCK(fvp); + unp = VTOUNIONFS(tdvp); + #ifdef UNIONFS_IDBG_RENAME UNIONFS_INTERNAL_DEBUG("tdvp=%p, utdvp=%p, ltdvp=%p\n", tdvp, unp->un_uppervp, unp->un_lowervp); @@ -1273,11 +1330,12 @@ unionfs_rename(struct vop_rename_args *ap) ltdvp = unp->un_lowervp; vref(rtdvp); - if (tdvp == tvp) { - rtvp = rtdvp; - vref(rtvp); - } else if (tvp != NULLVP) { + if (tvp != NULLVP) { unp = VTOUNIONFS(tvp); + if (unp == NULL) { + error = ENOENT; + goto unionfs_rename_abort; + } #ifdef UNIONFS_IDBG_RENAME UNIONFS_INTERNAL_DEBUG("tvp=%p, utvp=%p, ltvp=%p\n", tvp, unp->un_uppervp, unp->un_lowervp); @@ -1298,24 +1356,6 @@ unionfs_rename(struct vop_rename_args *ap) if (rfvp == rtvp) goto unionfs_rename_abort; - if (needrelookup != 0) { - if ((error = vn_lock(fdvp, LK_EXCLUSIVE)) != 0) - goto unionfs_rename_abort; - error = unionfs_relookup_for_delete(fdvp, fcnp, td); - VOP_UNLOCK(fdvp); - if (error != 0) - goto unionfs_rename_abort; - - /* Lock of tvp is canceled in order to avoid recursive lock. */ - if (tvp != NULLVP && tvp != tdvp) - VOP_UNLOCK(tvp); - error = unionfs_relookup_for_rename(tdvp, tcnp, td); - if (tvp != NULLVP && tvp != tdvp) - vn_lock(tvp, LK_EXCLUSIVE | LK_RETRY); - if (error != 0) - goto unionfs_rename_abort; - } - error = VOP_RENAME(rfdvp, rfvp, fcnp, rtdvp, rtvp, tcnp); if (error == 0) { From nobody Mon Apr 29 02:41:38 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VSSJg0xtdz5J267; Mon, 29 Apr 2024 02:41: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VSSJg0mKkz4pDn; Mon, 29 Apr 2024 02:41:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714358499; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VyVrr/4eOtioSE/YtCWrVUo0E3fAc5M23rGh6NGARpk=; b=BAc9XM5LiiRN1u7jHcjfjzVSl7A3ZY++lhAxtd39Q5wC0xJwPctsgCIDxx3zISly1jIzwQ 59YoSg7mD0OFrITMZ8g4XmgXkKLjS3isBa2YnksXL8X4/NPPkcJ95pOC+iLCGyoByRzJUm us7ZdjOTzRQb8EMa6qrx2zyMN7fpQIM8mybLwI8LVSahsowAJkD1wt2ZTTZbWnHFufEJ/a yvNqDqrkJD5OzL+MPYcmxq6FEgU40xdaIVIRWQhl+ixD4rPoFDTRZ0aHQ6dNhsDmCIY9cf pkOn3vgZWn7xaYa8QEE2nT/5U8GydRaTnj0koxeDwf3F1ulca1yHSH7oxza2Ng== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714358499; a=rsa-sha256; cv=none; b=Qr4bYeGEFU1YP1hrtPumPznoApSauzY1R32/wyr7tFAZ/rtJjz6zQLvMSVDOMuPzyF7cMD 5/V9Y91aGBM4ShquZuPNh7eO04ch0TEkOJn4/8rsY2jMEihjq1Pi0/+lza29zTtOHcNpK3 jcK9eXUadNIGCmtbCNpvRpQE0VuMyxnQoZPP+efT7nPxvFNbZCd8PK+x2M3d+XARmaMn1k c40VL3ULglFOYpjIdRy3nNK+yHwLac8rx/It8FJ5oZn5XTBS8D8XEy1AU+CcM17SJB9pzu 1wQ/oUMJD31omg7rw3BArBLkh3MRri0arJshphvtKGtNbnRqHkc/dpDqCOpWEA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714358499; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VyVrr/4eOtioSE/YtCWrVUo0E3fAc5M23rGh6NGARpk=; b=Y3TTOYWvg0JOwrCsf6wAWqYpSSwYkMm44t0xLLuwmAi80wYnnhy6b53xbCrqrMWo3sirkv WgeLtB6FgfTurioaADsYw3mLFoDGAntqd9zgduRk93vzv+Te6WZ64e55qb5FUVoWY6cRT8 lKurPHFKQbtvPGhWpzg/Uay8mQp2rT5Mdz2c/SAcvRghp668WZdrnlTBDzXF+VKU+4jTxM BXbNzTXhBTznu5eXwJf/9IChK4gmKnXYhRJmfEbgNGT7i1FZc156dDg9vaocIOPG0b2Pfh HTonZEFTkfg3PaUO1MZpahpzHsWGLe+j539UVIMrtMmyRsuPpCaBeh/MCNQA4A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VSSJg0MZtzrfC; Mon, 29 Apr 2024 02:41:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43T2fcdG072223; Mon, 29 Apr 2024 02:41:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43T2fckp072220; Mon, 29 Apr 2024 02:41:38 GMT (envelope-from git) Date: Mon, 29 Apr 2024 02:41:38 GMT Message-Id: <202404290241.43T2fckp072220@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: 2b8df536a681 - main - axgbe: Various stability improvements List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 2b8df536a68169953a9fa470b78a021156d997aa Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=2b8df536a68169953a9fa470b78a021156d997aa commit 2b8df536a68169953a9fa470b78a021156d997aa Author: Stephan de Wit AuthorDate: 2024-04-29 01:57:26 +0000 Commit: Warner Losh CommitDate: 2024-04-29 01:57:51 +0000 axgbe: Various stability improvements Hook in RSS glue. Default to "off" for the split header feature to ensure netmap compatibility. Change the PCS indirection register values based on hardware type (ported from Linux). Move tunable settings to sysctl_init() and set the defaults there. Ensure it's called at the right time by moving it back. Reset PHY RX data path when mailbox command times out (Ported from Linux). Check if VLAN HW tagging is enabled before assuming a VLAN tag is present in a descriptor. Disable the hardware filter since multicast traffic is dropped in promisc mode. Remove unnecessary return statement. Missing sfp_get_mux, causing a race between ports to read SFP(+) sideband signals. Validate and fix incorrectly initialized polarity/configuration registers. Remove unnecessary SFP reset. axgbe_isc_rxd_pkt_get has no error state, remove unnecessary big packet check. Enable RSF to prevent zero-length packets while in Netmap mode. DMA cache coherency update (ported from Linux). Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1103 --- sys/dev/axgbe/if_axgbe_pci.c | 98 +++++++++++++++++------ sys/dev/axgbe/xgbe-common.h | 16 ++++ sys/dev/axgbe/xgbe-dev.c | 9 ++- sys/dev/axgbe/xgbe-i2c.c | 2 - sys/dev/axgbe/xgbe-phy-v2.c | 186 +++++++++++++++++++++++++++++++++++++++++-- sys/dev/axgbe/xgbe-sysctl.c | 16 ++++ sys/dev/axgbe/xgbe-txrx.c | 7 +- sys/dev/axgbe/xgbe.h | 6 +- 8 files changed, 298 insertions(+), 42 deletions(-) diff --git a/sys/dev/axgbe/if_axgbe_pci.c b/sys/dev/axgbe/if_axgbe_pci.c index beb4ff338dc7..3e68525067fb 100644 --- a/sys/dev/axgbe/if_axgbe_pci.c +++ b/sys/dev/axgbe/if_axgbe_pci.c @@ -56,6 +56,12 @@ #include "ifdi_if.h" #include "opt_inet.h" #include "opt_inet6.h" +#include "opt_rss.h" + +#ifdef RSS +#include +#include +#endif MALLOC_DEFINE(M_AXGBE, "axgbe", "axgbe data"); @@ -103,6 +109,7 @@ static bool axgbe_if_needs_restart(if_ctx_t, enum iflib_restart_event); #endif static void axgbe_set_counts(if_ctx_t); static void axgbe_init_iflib_softc_ctx(struct axgbe_if_softc *); +static void axgbe_initialize_rss_mapping(struct xgbe_prv_data *); /* MII interface registered functions */ static int axgbe_miibus_readreg(device_t, int, int); @@ -277,11 +284,11 @@ axgbe_register(device_t dev) * No tunable found, generate one with default values * Note: only a reboot will reveal the new kenv */ - error = kern_setenv("dev.ax.sph_enable", "1"); + error = kern_setenv("dev.ax.sph_enable", "0"); if (error) { printf("Error setting tunable, using default driver values\n"); } - axgbe_sph_enable = 1; + axgbe_sph_enable = 0; } if (!axgbe_sph_enable) { @@ -389,6 +396,7 @@ axgbe_if_attach_pre(if_ctx_t ctx) if_softc_ctx_t scctx; if_shared_ctx_t sctx; device_t dev; + device_t rdev; unsigned int ma_lo, ma_hi; unsigned int reg; int ret; @@ -430,9 +438,23 @@ axgbe_if_attach_pre(if_ctx_t ctx) sc->pdata.xgmac_res = mac_res[0]; sc->pdata.xpcs_res = mac_res[1]; - /* Set the PCS indirect addressing definition registers*/ - pdata->xpcs_window_def_reg = PCS_V2_WINDOW_DEF; - pdata->xpcs_window_sel_reg = PCS_V2_WINDOW_SELECT; + /* + * Set the PCS indirect addressing definition registers. + * A newer version of the hardware is using the same PCI ids + * for the network device but has altered register definitions + * for determining the window settings for the indirect PCS access. + * This code checks hardware usage and uses the register values + * accordingly. + */ + rdev = pci_find_dbsf(0, 0, 0, 0); + if (rdev && pci_get_device(rdev) == 0x15d0 + && pci_get_vendor(rdev) == 0x1022) { + pdata->xpcs_window_def_reg = PCS_V2_RV_WINDOW_DEF; + pdata->xpcs_window_sel_reg = PCS_V2_RV_WINDOW_SELECT; + } else { + pdata->xpcs_window_def_reg = PCS_V2_WINDOW_DEF; + pdata->xpcs_window_sel_reg = PCS_V2_WINDOW_SELECT; + } /* Configure the PCS indirect addressing support */ reg = XPCS32_IOREAD(pdata, pdata->xpcs_window_def_reg); @@ -714,6 +736,47 @@ axgbe_init_iflib_softc_ctx(struct axgbe_if_softc *sc) scctx->isc_txrx = &axgbe_txrx; } +static void +axgbe_initialize_rss_mapping(struct xgbe_prv_data *pdata) +{ + int i; + + /* Get RSS key */ +#ifdef RSS + int qid; + uint32_t rss_hash_config = 0; + + rss_getkey((uint8_t *)&pdata->rss_key); + + rss_hash_config = rss_gethashconfig(); + + if (rss_hash_config & RSS_HASHTYPE_RSS_IPV4) + XGMAC_SET_BITS(pdata->rss_options, MAC_RSSCR, IP2TE, 1); + if (rss_hash_config & RSS_HASHTYPE_RSS_TCP_IPV4) + XGMAC_SET_BITS(pdata->rss_options, MAC_RSSCR, TCP4TE, 1); + if (rss_hash_config & RSS_HASHTYPE_RSS_UDP_IPV4) + XGMAC_SET_BITS(pdata->rss_options, MAC_RSSCR, UDP4TE, 1); +#else + arc4rand(&pdata->rss_key, ARRAY_SIZE(pdata->rss_key), 0); + + XGMAC_SET_BITS(pdata->rss_options, MAC_RSSCR, IP2TE, 1); + XGMAC_SET_BITS(pdata->rss_options, MAC_RSSCR, TCP4TE, 1); + XGMAC_SET_BITS(pdata->rss_options, MAC_RSSCR, UDP4TE, 1); +#endif + + /* Setup RSS lookup table */ + for (i = 0; i < XGBE_RSS_MAX_TABLE_SIZE; i++) { +#ifdef RSS + qid = rss_get_indirection_to_bucket(i) % pdata->rx_ring_count; + XGMAC_SET_BITS(pdata->rss_table[i], MAC_RSSDR, DMCH, qid); +#else + XGMAC_SET_BITS(pdata->rss_table[i], MAC_RSSDR, DMCH, + i % pdata->rx_ring_count); +#endif + } + +} + static int axgbe_alloc_channels(if_ctx_t ctx) { @@ -1336,11 +1399,9 @@ xgbe_default_config(struct xgbe_prv_data *pdata) pdata->tx_sf_mode = MTL_TSF_ENABLE; pdata->tx_threshold = MTL_TX_THRESHOLD_64; pdata->tx_osp_mode = DMA_OSP_ENABLE; - pdata->rx_sf_mode = MTL_RSF_DISABLE; + pdata->rx_sf_mode = MTL_RSF_ENABLE; pdata->rx_threshold = MTL_RX_THRESHOLD_64; pdata->pause_autoneg = 1; - pdata->tx_pause = 1; - pdata->rx_pause = 1; pdata->phy_speed = SPEED_UNKNOWN; pdata->power_down = 0; pdata->enable_rss = 1; @@ -1355,7 +1416,7 @@ axgbe_if_attach_post(if_ctx_t ctx) struct xgbe_phy_if *phy_if = &pdata->phy_if; struct xgbe_hw_if *hw_if = &pdata->hw_if; if_softc_ctx_t scctx = sc->scctx; - int i, ret; + int ret; /* set split header support based on tunable */ pdata->sph_enable = axgbe_sph_enable; @@ -1373,6 +1434,8 @@ axgbe_if_attach_post(if_ctx_t ctx) if (ret) axgbe_error("%s: exit error %d\n", __func__, ret); + axgbe_sysctl_init(pdata); + /* Configure the defaults */ xgbe_default_config(pdata); @@ -1408,15 +1471,7 @@ axgbe_if_attach_post(if_ctx_t ctx) scctx->isc_nrxqsets); DBGPR("Channel count set to: %u\n", pdata->channel_count); - /* Get RSS key */ -#ifdef RSS - rss_getkey((uint8_t *)pdata->rss_key); -#else - arc4rand(&pdata->rss_key, ARRAY_SIZE(pdata->rss_key), 0); -#endif - XGMAC_SET_BITS(pdata->rss_options, MAC_RSSCR, IP2TE, 1); - XGMAC_SET_BITS(pdata->rss_options, MAC_RSSCR, TCP4TE, 1); - XGMAC_SET_BITS(pdata->rss_options, MAC_RSSCR, UDP4TE, 1); + axgbe_initialize_rss_mapping(pdata); /* Initialize the PHY device */ pdata->sysctl_an_cdr_workaround = pdata->vdata->an_cdr_workaround; @@ -1452,11 +1507,6 @@ axgbe_if_attach_post(if_ctx_t ctx) pdata->rx_buf_size = ret; DBGPR("%s: rx_buf_size %d\n", __func__, ret); - /* Setup RSS lookup table */ - for (i = 0; i < XGBE_RSS_MAX_TABLE_SIZE; i++) - XGMAC_SET_BITS(pdata->rss_table[i], MAC_RSSDR, DMCH, - i % pdata->rx_ring_count); - /* * Mark the device down until it is initialized, which happens * when the device is accessed first (for configuring the iface, @@ -1468,8 +1518,6 @@ axgbe_if_attach_post(if_ctx_t ctx) scctx->isc_max_frame_size = if_getmtu(ifp) + 18; scctx->isc_min_frame_size = XGMAC_MIN_PACKET; - axgbe_sysctl_init(pdata); - axgbe_pci_init(pdata); return (0); diff --git a/sys/dev/axgbe/xgbe-common.h b/sys/dev/axgbe/xgbe-common.h index 4d504682d1af..e2096463703b 100644 --- a/sys/dev/axgbe/xgbe-common.h +++ b/sys/dev/axgbe/xgbe-common.h @@ -479,6 +479,8 @@ #define MAC_PFR_VTFE_WIDTH 1 #define MAC_PFR_VUCC_INDEX 22 #define MAC_PFR_VUCC_WIDTH 1 +#define MAC_PFR_RA_INDEX 31 +#define MAC_PFR_RA_WIDTH 1 #define MAC_PMTCSR_MGKPKTEN_INDEX 1 #define MAC_PMTCSR_MGKPKTEN_WIDTH 1 #define MAC_PMTCSR_PWRDWN_INDEX 0 @@ -1319,10 +1321,18 @@ #define MDIO_PMA_10GBR_FECCTRL 0x00ab #endif +#ifndef MDIO_PMA_RX_CTRL1 +#define MDIO_PMA_RX_CTRL1 0x8051 +#endif + #ifndef MDIO_PCS_DIG_CTRL #define MDIO_PCS_DIG_CTRL 0x8000 #endif +#ifndef MDIO_PCS_DIGITAL_STAT +#define MDIO_PCS_DIGITAL_STAT 0x8010 +#endif + #ifndef MDIO_AN_XNP #define MDIO_AN_XNP 0x0016 #endif @@ -1402,6 +1412,8 @@ #define XGBE_KR_TRAINING_ENABLE BIT(1) #define XGBE_PCS_CL37_BP BIT(12) +#define XGBE_PCS_PSEQ_STATE_MASK 0x1c +#define XGBE_PCS_PSEQ_STATE_POWER_GOOD 0x10 #define XGBE_AN_CL37_INT_CMPLT BIT(0) #define XGBE_AN_CL37_INT_MASK 0x01 @@ -1423,6 +1435,10 @@ #define XGBE_PMA_PLL_CTRL_ENABLE BIT(15) #define XGBE_PMA_PLL_CTRL_DISABLE 0x0000 +#define XGBE_PMA_RX_RST_0_MASK BIT(4) +#define XGBE_PMA_RX_RST_0_RESET_ON 0x10 +#define XGBE_PMA_RX_RST_0_RESET_OFF 0x00 + /* Bit setting and getting macros * The get macro will extract the current bit field value from within * the variable diff --git a/sys/dev/axgbe/xgbe-dev.c b/sys/dev/axgbe/xgbe-dev.c index 786e04930780..39d0dab144a2 100644 --- a/sys/dev/axgbe/xgbe-dev.c +++ b/sys/dev/axgbe/xgbe-dev.c @@ -1451,7 +1451,8 @@ xgbe_dev_read(struct xgbe_channel *channel) if (!err || !etlt) { /* No error if err is 0 or etlt is 0 */ - if (etlt == 0x09) { + if (etlt == 0x09 && + (if_getcapenable(pdata->netdev) & IFCAP_VLAN_HWTAGGING)) { XGMAC_SET_BITS(packet->attributes, RX_PACKET_ATTRIBUTES, VLAN_CTAG, 1); packet->vlan_ctag = XGMAC_GET_BITS_LE(rdesc->desc0, @@ -2029,6 +2030,12 @@ xgbe_config_mac_address(struct xgbe_prv_data *pdata) { xgbe_set_mac_address(pdata, if_getlladdr(pdata->netdev)); + /* + * Promisc mode does not work as intended. Multicast traffic + * is triggering the filter, so enable Receive All. + */ + XGMAC_IOWRITE_BITS(pdata, MAC_PFR, RA, 1); + /* Filtering is done using perfect filtering and hash filtering */ if (pdata->hw_feat.hash_table_size) { XGMAC_IOWRITE_BITS(pdata, MAC_PFR, HPF, 1); diff --git a/sys/dev/axgbe/xgbe-i2c.c b/sys/dev/axgbe/xgbe-i2c.c index 5883e96ed37e..fe9184aa1dd5 100644 --- a/sys/dev/axgbe/xgbe-i2c.c +++ b/sys/dev/axgbe/xgbe-i2c.c @@ -327,8 +327,6 @@ out: if (state->ret || XI2C_GET_BITS(isr, IC_RAW_INTR_STAT, STOP_DET)) pdata->i2c_complete = true; - return; - reissue_check: /* Reissue interrupt if status is not clear */ if (pdata->vdata->irq_reissue_support) diff --git a/sys/dev/axgbe/xgbe-phy-v2.c b/sys/dev/axgbe/xgbe-phy-v2.c index d8c372cac642..d08ed118a8a8 100644 --- a/sys/dev/axgbe/xgbe-phy-v2.c +++ b/sys/dev/axgbe/xgbe-phy-v2.c @@ -376,6 +376,9 @@ struct xgbe_phy_data { unsigned int sfp_gpio_address; unsigned int sfp_gpio_mask; unsigned int sfp_gpio_inputs; + unsigned int sfp_gpio_outputs; + unsigned int sfp_gpio_polarity; + unsigned int sfp_gpio_configuration; unsigned int sfp_gpio_rx_los; unsigned int sfp_gpio_tx_fault; unsigned int sfp_gpio_mod_absent; @@ -1461,13 +1464,19 @@ xgbe_phy_sfp_signals(struct xgbe_prv_data *pdata) axgbe_printf(3, "%s: befor sfp_mod:%d sfp_gpio_address:0x%x\n", __func__, phy_data->sfp_mod_absent, phy_data->sfp_gpio_address); + ret = xgbe_phy_sfp_get_mux(pdata); + if (ret) { + axgbe_error("I2C error setting SFP MUX\n"); + return; + } + gpio_reg = 0; ret = xgbe_phy_i2c_read(pdata, phy_data->sfp_gpio_address, &gpio_reg, sizeof(gpio_reg), gpio_ports, sizeof(gpio_ports)); if (ret) { axgbe_error("%s: I2C error reading SFP GPIO addr:0x%x\n", __func__, phy_data->sfp_gpio_address); - return; + goto put_mux; } phy_data->sfp_gpio_inputs = (gpio_ports[1] << 8) | gpio_ports[0]; @@ -1481,6 +1490,136 @@ xgbe_phy_sfp_signals(struct xgbe_prv_data *pdata) axgbe_printf(3, "%s: after sfp_mod:%d sfp_gpio_inputs:0x%x\n", __func__, phy_data->sfp_mod_absent, phy_data->sfp_gpio_inputs); + +put_mux: + xgbe_phy_sfp_put_mux(pdata); +} + +static int +xgbe_read_gpio_expander(struct xgbe_prv_data *pdata) +{ + struct xgbe_phy_data *phy_data = pdata->phy_data; + uint8_t gpio_reg, gpio_ports[2]; + int ret = 0; + + ret = xgbe_phy_sfp_get_mux(pdata); + if (ret) { + axgbe_error("I2C error setting SFP MUX\n"); + return (ret); + } + + gpio_reg = 2; + for (int i = 0; i < 3; i++) { + ret = xgbe_phy_i2c_read(pdata, phy_data->sfp_gpio_address, + &gpio_reg, sizeof(gpio_reg), gpio_ports, sizeof(gpio_ports)); + + if (ret) { + axgbe_error("%s: I2C error reading GPIO expander register: %d\n", + __func__, gpio_reg); + goto put_mux; + } + + if (gpio_reg == 2) + phy_data->sfp_gpio_outputs = (gpio_ports[1] << 8) | gpio_ports[0]; + else if (gpio_reg == 4) + phy_data->sfp_gpio_polarity = (gpio_ports[1] << 8) | gpio_ports[0]; + else if (gpio_reg == 6) + phy_data->sfp_gpio_configuration = (gpio_ports[1] << 8) | gpio_ports[0]; + + memset(gpio_ports, 0, sizeof(gpio_ports)); + gpio_reg += 2; + } + +put_mux: + xgbe_phy_sfp_put_mux(pdata); + + return (ret); +} + +static void +xgbe_log_gpio_expander(struct xgbe_prv_data *pdata) +{ + struct xgbe_phy_data *phy_data = pdata->phy_data; + + axgbe_printf(1, "Input port registers: 0x%x\n", phy_data->sfp_gpio_inputs); + axgbe_printf(1, "Output port registers: 0x%x\n", phy_data->sfp_gpio_outputs); + axgbe_printf(1, "Polarity port registers: 0x%x\n", phy_data->sfp_gpio_polarity); + axgbe_printf(1, "Configuration port registers: 0x%x\n", phy_data->sfp_gpio_configuration); +} + +static int +xgbe_phy_validate_gpio_expander(struct xgbe_prv_data *pdata) +{ + struct xgbe_phy_data *phy_data = pdata->phy_data; + uint8_t gpio_data[3] = {0}; + int shift = GPIO_MASK_WIDTH * (3 - phy_data->port_id); + int rx_los_pos = (1 << phy_data->sfp_gpio_rx_los); + int tx_fault_pos = (1 << phy_data->sfp_gpio_tx_fault); + int mod_abs_pos = (1 << phy_data->sfp_gpio_mod_absent); + int port_sfp_pins = (mod_abs_pos | rx_los_pos | tx_fault_pos); + uint16_t config = 0; + int ret = 0; + + ret = xgbe_phy_get_comm_ownership(pdata); + if (ret) + return (ret); + + ret = xgbe_read_gpio_expander(pdata); + if (ret) + goto put; + + ret = xgbe_phy_sfp_get_mux(pdata); + if (ret) { + axgbe_error("I2C error setting SFP MUX\n"); + goto put; + } + + if (phy_data->sfp_gpio_polarity) { + axgbe_printf(0, "GPIO polarity inverted, resetting\n"); + + xgbe_log_gpio_expander(pdata); + gpio_data[0] = 4; /* polarity register */ + + ret = xgbe_phy_i2c_write(pdata, phy_data->sfp_gpio_address, + gpio_data, sizeof(gpio_data)); + + if (ret) { + axgbe_error("%s: I2C error writing to GPIO polarity register\n", + __func__); + goto put_mux; + } + } + + config = phy_data->sfp_gpio_configuration; + if ((config & port_sfp_pins) != port_sfp_pins) { + xgbe_log_gpio_expander(pdata); + + /* Write the I/O states to the configuration register */ + axgbe_error("Invalid GPIO configuration, resetting\n"); + gpio_data[0] = 6; /* configuration register */ + config = config & ~(0xF << shift); /* clear port id bits */ + config |= port_sfp_pins; + gpio_data[1] = config & 0xff; + gpio_data[2] = (config >> 8); + + ret = xgbe_phy_i2c_write(pdata, phy_data->sfp_gpio_address, + gpio_data, sizeof(gpio_data)); + if (ret) { + axgbe_error("%s: I2C error writing to GPIO configuration register\n", + __func__); + goto put_mux; + } + } else { + axgbe_printf(0, "GPIO configuration valid\n"); + } + +put_mux: + xgbe_phy_sfp_put_mux(pdata); + +put: + xgbe_phy_put_comm_ownership(pdata); + + return (ret); } static void @@ -1512,9 +1651,6 @@ xgbe_phy_sfp_detect(struct xgbe_prv_data *pdata) struct xgbe_phy_data *phy_data = pdata->phy_data; int ret, prev_sfp_state = phy_data->sfp_mod_absent; - /* Reset the SFP signals and info */ - xgbe_phy_sfp_reset(phy_data); - ret = xgbe_phy_get_comm_ownership(pdata); if (ret) return; @@ -1532,6 +1668,11 @@ xgbe_phy_sfp_detect(struct xgbe_prv_data *pdata) if (ret) { /* Treat any error as if there isn't an SFP plugged in */ axgbe_error("%s: eeprom read failed\n", __func__); + ret = xgbe_read_gpio_expander(pdata); + + if (!ret) + xgbe_log_gpio_expander(pdata); + xgbe_phy_sfp_reset(phy_data); xgbe_phy_sfp_mod_absent(pdata); goto put; @@ -2102,6 +2243,30 @@ xgbe_phy_pll_ctrl(struct xgbe_prv_data *pdata, bool enable) DELAY(200); } +static void +xgbe_phy_rx_reset(struct xgbe_prv_data *pdata) +{ + int reg; + + reg = XMDIO_READ_BITS(pdata, MDIO_MMD_PCS, MDIO_PCS_DIGITAL_STAT, + XGBE_PCS_PSEQ_STATE_MASK); + + if (reg == XGBE_PCS_PSEQ_STATE_POWER_GOOD) { + /* + * Mailbox command timed out, reset of RX block is required. + * This can be done by asserting the reset bit and waiting + * for its completion. + */ + XMDIO_WRITE_BITS(pdata, MDIO_MMD_PMAPMD, MDIO_PMA_RX_CTRL1, + XGBE_PMA_RX_RST_0_MASK, XGBE_PMA_RX_RST_0_RESET_ON); + DELAY(20); + XMDIO_WRITE_BITS(pdata, MDIO_MMD_PMAPMD, MDIO_PMA_RX_CTRL1, + XGBE_PMA_RX_RST_0_MASK, XGBE_PMA_RX_RST_0_RESET_OFF); + DELAY(50); + axgbe_printf(0, "%s: firmware mailbox reset performed\n", __func__); + } +} + static void xgbe_phy_perform_ratechange(struct xgbe_prv_data *pdata, unsigned int cmd, unsigned int sub_cmd) @@ -2112,8 +2277,10 @@ xgbe_phy_perform_ratechange(struct xgbe_prv_data *pdata, unsigned int cmd, xgbe_phy_pll_ctrl(pdata, false); /* Log if a previous command did not complete */ - if (XP_IOREAD_BITS(pdata, XP_DRIVER_INT_RO, STATUS)) + if (XP_IOREAD_BITS(pdata, XP_DRIVER_INT_RO, STATUS)) { axgbe_error("firmware mailbox not ready for command\n"); + xgbe_phy_rx_reset(pdata); + } /* Construct the command */ XP_SET_BITS(s0, XP_DRIVER_SCRATCH_0, COMMAND, cmd); @@ -3467,6 +3634,15 @@ xgbe_phy_start(struct xgbe_prv_data *pdata) switch (phy_data->port_mode) { case XGBE_PORT_MODE_SFP: axgbe_printf(3, "%s: calling phy detect\n", __func__); + + /* + * Validate the configuration of the GPIO expander before + * we interpret the SFP signals. + */ + axgbe_printf(1, "Checking GPIO expander validity\n"); + xgbe_phy_validate_gpio_expander(pdata); + + phy_data->sfp_phy_retries = 0; xgbe_phy_sfp_detect(pdata); break; default: diff --git a/sys/dev/axgbe/xgbe-sysctl.c b/sys/dev/axgbe/xgbe-sysctl.c index d5ddfbbd0bd6..16523381e1a3 100644 --- a/sys/dev/axgbe/xgbe-sysctl.c +++ b/sys/dev/axgbe/xgbe-sysctl.c @@ -1607,6 +1607,10 @@ axgbe_sysctl_init(struct xgbe_prv_data *pdata) pdata->sysctl_xgmac_reg = 0; pdata->sysctl_xpcs_mmd = 1; pdata->sysctl_xpcs_reg = 0; + pdata->link_workaround = 1; + pdata->tx_pause = 1; + pdata->rx_pause = 1; + pdata->enable_rss = 1; SYSCTL_ADD_UINT(clist, top, OID_AUTO, "axgbe_debug_level", CTLFLAG_RWTUN, &pdata->debug_level, 0, "axgbe log level -- higher is verbose"); @@ -1619,6 +1623,18 @@ axgbe_sysctl_init(struct xgbe_prv_data *pdata) CTLFLAG_RWTUN, &pdata->link_workaround, 0, "enable the workaround for link issue in coming up"); + SYSCTL_ADD_UINT(clist, top, OID_AUTO, "rss_enabled", + CTLFLAG_RDTUN, &pdata->enable_rss, 1, + "shows the RSS feature state (1 - enable, 0 - disable)"); + + SYSCTL_ADD_UINT(clist, top, OID_AUTO, "tx_pause", + CTLFLAG_RDTUN, &pdata->tx_pause, 1, + "shows the Flow Control TX pause feature state (1 - enable, 0 - disable)"); + + SYSCTL_ADD_UINT(clist, top, OID_AUTO, "rx_pause", + CTLFLAG_RDTUN, &pdata->rx_pause, 1, + "shows the Flow Control RX pause feature state (1 - enable, 0 - disable)"); + SYSCTL_ADD_PROC(clist, top, OID_AUTO, "xgmac_register", CTLTYPE_STRING | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, pdata, 0, sysctl_xgmac_reg_addr_handler, "IU", diff --git a/sys/dev/axgbe/xgbe-txrx.c b/sys/dev/axgbe/xgbe-txrx.c index 52274dba4352..fd3d821e2e53 100644 --- a/sys/dev/axgbe/xgbe-txrx.c +++ b/sys/dev/axgbe/xgbe-txrx.c @@ -702,7 +702,7 @@ axgbe_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri) struct xgbe_packet_data *packet = &ring->packet_data; struct xgbe_ring_data *rdata; unsigned int last, context_next, context; - unsigned int buf1_len, buf2_len, max_len, len = 0, prev_cur; + unsigned int buf1_len, buf2_len, len = 0, prev_cur; int i = 0; axgbe_printf(2, "%s: rxq %d cidx %d cur %d dirty %d\n", __func__, @@ -767,11 +767,9 @@ read_again: axgbe_printf(2, "%s: csum flags 0x%x\n", __func__, ri->iri_csum_flags); } - max_len = if_getmtu(pdata->netdev) + ETH_HLEN; if (XGMAC_GET_BITS(packet->attributes, RX_PACKET_ATTRIBUTES, VLAN_CTAG)) { ri->iri_flags |= M_VLANTAG; ri->iri_vtag = packet->vlan_ctag; - max_len += VLAN_HLEN; axgbe_printf(2, "%s: iri_flags 0x%x vtag 0x%x\n", __func__, ri->iri_flags, ri->iri_vtag); } @@ -788,9 +786,6 @@ read_again: if (__predict_false(len == 0)) axgbe_printf(1, "%s: Discarding Zero len packet\n", __func__); - if (__predict_false(len > max_len)) - axgbe_error("%s: Big packet %d/%d\n", __func__, len, max_len); - if (__predict_false(packet->errors)) axgbe_printf(1, "<-- %s: rxq: %d len: %d frags: %d cidx %d cur: %d " "dirty: %d error 0x%x\n", __func__, ri->iri_qsidx, len, i, diff --git a/sys/dev/axgbe/xgbe.h b/sys/dev/axgbe/xgbe.h index 4719b16f47d6..5e4cc40bb2c9 100644 --- a/sys/dev/axgbe/xgbe.h +++ b/sys/dev/axgbe/xgbe.h @@ -180,9 +180,9 @@ #define XGBE_DMA_SYS_AWCR 0x30303030 /* DMA cache settings - PCI device */ -#define XGBE_DMA_PCI_ARCR 0x00000003 -#define XGBE_DMA_PCI_AWCR 0x13131313 -#define XGBE_DMA_PCI_AWARCR 0x00000313 +#define XGBE_DMA_PCI_ARCR 0x000f0f0f +#define XGBE_DMA_PCI_AWCR 0x0f0f0f0f +#define XGBE_DMA_PCI_AWARCR 0x00000f0f /* DMA channel interrupt modes */ #define XGBE_IRQ_MODE_EDGE 0 From nobody Mon Apr 29 04:27:11 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VSVfS3wd1z5JBSC; Mon, 29 Apr 2024 04:27: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VSVfS0qX4z416f; Mon, 29 Apr 2024 04:27:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714364832; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Bzlx66yR2n6ZOMyN59m/GthgMlbXbC4fUVP7M5t063I=; b=HPJ5wloyC68EKRuDO2LYLfJHa+dUQtwWVZjejDVFs6yGAOcwctd2eUeCDIMW6GHwNmbpkU RiWz5zr1aVV4TEZi91jW3QHveSxj1QLReWxy6eT2Bcy4DqbfMlqeQ9GbeSIUa+opFzAJJn IsnuckzggvKMgh9tajzVzm8dQ5UTvJf8NUSTAaHDA21akN3bPVQZngaHPchNyThCr9qSmm 9Jx4wsI4qDM/Q2JaRWa0wn9euLVCS9wZLLdQseYZlGdNCswMFa3fUMmQMRvert/ikS9qgl f264VkOErRg3QXV8nlyGvF0cGRlOvu7ermUSwTGSRDWSYhTLh6ZnjX+iv8SDvA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714364832; a=rsa-sha256; cv=none; b=ZFKo/d5aV+HfLRT43KjvEJOIdgN/5sgjD+2cOLb7vDMyFOCkMY+OIEoQkKtzZ3pw002vIQ TV4ORi7zKLlR2+69OHlUZTuXUurL3t6zmxMFsuN5e5YJwuPeNO9LNu1Tu/ldFxk5Nj9MrX ljN1dgV10h6TeHArDCTN5zBk0KgvKPi9VPcya3gij70WmELRH8VUMnjqRed4DRBcNScrxW +JVjGWrDMzgLjgH9iTQICi8oSy5WuDx8o5eQXhZEb+Z2ig1shEcHHyao91RSJg8KpSmB/e xWzmfeEnlw2jE1okW370VdEBv4dmSfCmp9TS71/9d91PbQqG7rJxpUh+puRTuA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714364832; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Bzlx66yR2n6ZOMyN59m/GthgMlbXbC4fUVP7M5t063I=; b=bHIRAZl+3rZ3QqLM/lh2GTkeE1GntOWHAspFxv6A0qlkV9Eh8M9da2hkaL6lB1NCGNNBTR y+SsY0QXRpirhEZlS7LX6R/OKclnVYtnYq97Ay0D414orvKt4KwkHMe0Q/UJ1Ca96kanXW idVpz7SgJ4suSBkmsoKkzjzz0cUqq2L+YrI6LFjXdJR6efqDgfmNTgC3y/d+GLhmOFhLnx HLVbS0tMYiJLVqFN1W78rj7O9702Er70ONFf0932uFEDirc1/GGrBX+qT0TdyVWtDS9Wan RMmegqs9rKgVZkyQFwhjd17D2lNpUBUeX3mw1+Onl4QKtbpz6LyoAaxJhenFyQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VSVfS03ZMzvHT; Mon, 29 Apr 2024 04:27:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43T4RBpG044445; Mon, 29 Apr 2024 04:27:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43T4RBcE044442; Mon, 29 Apr 2024 04:27:11 GMT (envelope-from git) Date: Mon, 29 Apr 2024 04:27:11 GMT Message-Id: <202404290427.43T4RBcE044442@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: fdbf7cab91ae - main - bluetooth: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0]) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: fdbf7cab91ae9ae7ca87bd47acb7400813bd7160 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=fdbf7cab91ae9ae7ca87bd47acb7400813bd7160 commit fdbf7cab91ae9ae7ca87bd47acb7400813bd7160 Author: Elyes Haouas AuthorDate: 2024-04-29 02:55:30 +0000 Commit: Warner Losh CommitDate: 2024-04-29 03:24:46 +0000 bluetooth: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0]) Pull Request: https://github.com/freebsd/freebsd-src/pull/888 Signed-off-by: Elyes Haouas --- usr.sbin/bluetooth/bthidcontrol/sdp.c | 6 +++--- usr.sbin/bluetooth/bthidd/kbd.c | 5 +++-- usr.sbin/bluetooth/hccontrol/hccontrol.c | 5 +++-- usr.sbin/bluetooth/hccontrol/node.c | 7 ++++--- usr.sbin/bluetooth/sdpcontrol/search.c | 5 +++-- usr.sbin/bluetooth/sdpd/profile.c | 5 +++-- usr.sbin/bluetooth/sdpd/sar.c | 3 ++- usr.sbin/bluetooth/sdpd/srr.c | 3 ++- usr.sbin/bluetooth/sdpd/ssr.c | 3 ++- 9 files changed, 25 insertions(+), 17 deletions(-) diff --git a/usr.sbin/bluetooth/bthidcontrol/sdp.c b/usr.sbin/bluetooth/bthidcontrol/sdp.c index dc83229f080c..4754744a866a 100644 --- a/usr.sbin/bluetooth/bthidcontrol/sdp.c +++ b/usr.sbin/bluetooth/bthidcontrol/sdp.c @@ -30,7 +30,7 @@ * $Id: sdp.c,v 1.3 2004/02/17 22:14:57 max Exp $ */ -#include +#include #include #include #define L2CAP_SOCKET_CHECKED @@ -79,10 +79,10 @@ SDP_ATTR_RANGE( 0x0209, /* HIDBatteryPower */ SDP_ATTR_RANGE( 0x020d, /* HIDNormallyConnectable */ 0x020d) }; -#define nattrs (sizeof(attrs)/sizeof(attrs[0])) +#define nattrs nitems(attrs) static sdp_attr_t values[8]; -#define nvalues (sizeof(values)/sizeof(values[0])) +#define nvalues nitems(values) static uint8_t buffer[nvalues][512]; diff --git a/usr.sbin/bluetooth/bthidd/kbd.c b/usr.sbin/bluetooth/bthidd/kbd.c index c1616c7e4bd3..a807a9b27dec 100644 --- a/usr.sbin/bluetooth/bthidd/kbd.c +++ b/usr.sbin/bluetooth/bthidd/kbd.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -319,7 +320,7 @@ static int32_t const x[] = /* Right GUI E7 */ E0PREFIX|0x5C /* E0 DC */ }; -#define xsize ((int32_t)(sizeof(x)/sizeof(x[0]))) +#define xsize (int32_t)nitems(x) /* * Get a max HID keycode (aligned) @@ -437,7 +438,7 @@ kbd_write(bitstr_t *m, int32_t fb, int32_t make, int32_t fd) int32_t i, *b, *eob, n, buf[64]; b = buf; - eob = b + sizeof(buf)/sizeof(buf[0]); + eob = b + nitems(buf); i = fb; while (i < xsize) { diff --git a/usr.sbin/bluetooth/hccontrol/hccontrol.c b/usr.sbin/bluetooth/hccontrol/hccontrol.c index c1ce016e6246..bd63c9aff6ec 100644 --- a/usr.sbin/bluetooth/hccontrol/hccontrol.c +++ b/usr.sbin/bluetooth/hccontrol/hccontrol.c @@ -33,6 +33,7 @@ #define L2CAP_SOCKET_CHECKED #include #include +#include #include #include #include @@ -153,11 +154,11 @@ socket_open(char const *node) (void * const) &filter, sizeof(filter)) < 0) err(4, "Could not setsockopt()"); - size = (sizeof(mib)/sizeof(mib[0])); + size = nitems(mib); if (sysctlnametomib("net.bluetooth.hci.command_timeout",mib,&size) < 0) err(5, "Could not sysctlnametomib()"); - if (sysctl(mib, sizeof(mib)/sizeof(mib[0]), + if (sysctl(mib, nitems(mib), (void *) &timeout, &size, NULL, 0) < 0) err(6, "Could not sysctl()"); diff --git a/usr.sbin/bluetooth/hccontrol/node.c b/usr.sbin/bluetooth/hccontrol/node.c index b100900f527d..61b60ba95db5 100644 --- a/usr.sbin/bluetooth/hccontrol/node.c +++ b/usr.sbin/bluetooth/hccontrol/node.c @@ -31,6 +31,7 @@ */ #include +#include #define L2CAP_SOCKET_CHECKED #include #include @@ -160,7 +161,7 @@ hci_read_node_features(int s, int argc, char **argv) return (ERROR); fprintf(stdout, "Features: "); - for (n = 0; n < sizeof(r.features)/sizeof(r.features[0]); n++) + for (n = 0; n < nitems(r.features); n++) fprintf(stdout, "%#02x ", r.features[n]); fprintf(stdout, "\n%s\n", hci_features2str(r.features, buffer, sizeof(buffer))); @@ -243,8 +244,8 @@ hci_read_neighbor_cache(int s, int argc, char **argv) for (n = 0; n < r.num_entries; n++) { uint8_t addrtype = r.entries[n].addrtype; - if(addrtype >= sizeof(addrtype2str)/sizeof(addrtype2str[0])) - addrtype = sizeof(addrtype2str)/sizeof(addrtype2str[0]) - 1; + if(addrtype >= nitems(addrtype2str)) + addrtype = nitems(addrtype2str) - 1; fprintf(stdout, "%1s %-17.17s " \ "%02x %02x %02x %02x %02x %02x %02x %02x " \ diff --git a/usr.sbin/bluetooth/sdpcontrol/search.c b/usr.sbin/bluetooth/sdpcontrol/search.c index 94c34828a949..2a4b2468c7f7 100644 --- a/usr.sbin/bluetooth/sdpcontrol/search.c +++ b/usr.sbin/bluetooth/sdpcontrol/search.c @@ -30,6 +30,7 @@ * $Id: search.c,v 1.2 2003/09/08 17:35:15 max Exp $ */ +#include #include #define L2CAP_SOCKET_CHECKED #include @@ -51,7 +52,7 @@ static uint32_t attrs[] = SDP_ATTR_RANGE( SDP_ATTR_BLUETOOTH_PROFILE_DESCRIPTOR_LIST, SDP_ATTR_BLUETOOTH_PROFILE_DESCRIPTOR_LIST) }; -#define attrs_len (sizeof(attrs)/sizeof(attrs[0])) +#define attrs_len nitems(attrs) /* Buffer for the attributes */ #define NRECS 25 /* request this much records from the SDP server */ @@ -60,7 +61,7 @@ static uint8_t buffer[NRECS * attrs_len][BSIZE]; /* SDP attributes */ static sdp_attr_t values[NRECS * attrs_len]; -#define values_len (sizeof(values)/sizeof(values[0])) +#define values_len nitems(values) /* * Print Service Class ID List diff --git a/usr.sbin/bluetooth/sdpd/profile.c b/usr.sbin/bluetooth/sdpd/profile.c index 3c6ada6871c7..e6d81f8ef4b1 100644 --- a/usr.sbin/bluetooth/sdpd/profile.c +++ b/usr.sbin/bluetooth/sdpd/profile.c @@ -32,6 +32,7 @@ * $Id: profile.c,v 1.6 2004/01/13 19:31:54 max Exp $ */ +#include #include #define L2CAP_SOCKET_CHECKED #include @@ -77,7 +78,7 @@ profile_get_descriptor(uint16_t uuid) int32_t i; - for (i = 0; i < sizeof(profiles)/sizeof(profiles[0]); i++) + for (i = 0; i < nitems(profiles); i++) if (profiles[i]->uuid == uuid) return (profiles[i]); @@ -444,7 +445,7 @@ bnep_profile_create_protocol_descriptor_list( }; uint16_t i, psm, version = 0x0100, - nptypes = sizeof(ptype)/sizeof(ptype[0]), + nptypes = nitems(ptype), nptypes_size = nptypes * 3; if (datalen != 2 || 18 + nptypes_size > 255 || diff --git a/usr.sbin/bluetooth/sdpd/sar.c b/usr.sbin/bluetooth/sdpd/sar.c index 0470109ebc07..68193b567fd3 100644 --- a/usr.sbin/bluetooth/sdpd/sar.c +++ b/usr.sbin/bluetooth/sdpd/sar.c @@ -30,6 +30,7 @@ * $Id: sar.c,v 1.2 2004/01/08 23:46:51 max Exp $ */ +#include #include #include #include @@ -304,7 +305,7 @@ server_send_service_attribute_response(server_p srv, int32_t fd) iov[3].iov_len = 1 + cs[0]; do { - size = writev(fd, (struct iovec const *) &iov, sizeof(iov)/sizeof(iov[0])); + size = writev(fd, (struct iovec const *) &iov, nitems(iov)); } while (size < 0 && errno == EINTR); /* Check if we have sent (or failed to sent) last response chunk */ diff --git a/usr.sbin/bluetooth/sdpd/srr.c b/usr.sbin/bluetooth/sdpd/srr.c index 8e887a4841de..b16eb25c9ea4 100644 --- a/usr.sbin/bluetooth/sdpd/srr.c +++ b/usr.sbin/bluetooth/sdpd/srr.c @@ -30,6 +30,7 @@ * $Id: srr.c,v 1.1 2004/01/13 01:54:39 max Exp $ */ +#include #include #include #include @@ -129,7 +130,7 @@ server_send_service_register_response(server_p srv, int32_t fd) iov[1].iov_len = srv->fdidx[fd].rsp_size; do { - size = writev(fd, (struct iovec const *) &iov, sizeof(iov)/sizeof(iov[0])); + size = writev(fd, (struct iovec const *) &iov, nitems(iov)); } while (size < 0 && errno == EINTR); srv->fdidx[fd].rsp_cs = 0; diff --git a/usr.sbin/bluetooth/sdpd/ssr.c b/usr.sbin/bluetooth/sdpd/ssr.c index c6b3a1f65fe1..1a29dde97ee5 100644 --- a/usr.sbin/bluetooth/sdpd/ssr.c +++ b/usr.sbin/bluetooth/sdpd/ssr.c @@ -30,6 +30,7 @@ * $Id: ssr.c,v 1.5 2004/01/13 01:54:39 max Exp $ */ +#include #include #include #include @@ -269,7 +270,7 @@ server_send_service_search_response(server_p srv, int32_t fd) iov[3].iov_len = 1 + cs[0]; do { - size = writev(fd, (struct iovec const *) &iov, sizeof(iov)/sizeof(iov[0])); + size = writev(fd, (struct iovec const *) &iov, nitems(iov)); } while (size < 0 && errno == EINTR); /* Check if we have sent (or failed to sent) last response chunk */ From nobody Mon Apr 29 04:27:14 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VSVfV3vS9z5JBSG; Mon, 29 Apr 2024 04:27: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VSVfV1Y61z41P5; Mon, 29 Apr 2024 04:27:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714364834; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nkd+JSM25me7v7cYbB2KpDH60Mu/P7i458RkUFO7kBs=; b=nVhlj2XGNd0j5o12fCQf4SB9sHlK+M2xKXxWSiDHfAUI2mcyinFySeJOEnykX2c7s66gBr 5E9BpCY/gqKDq/zr2X16fUZtmw+tLcJY/C2N/F5v9ay47LBWFVlA5XzaEEkddXV3z/DnOS K6WLdp4Z5hL7SE5qUfdt2+v9X37vAON2Fv06fM0pfLEBRGlVqsHtAMS4zHXhz4wYS+CKx3 EK2Rl6TAiBOIO1cLTIgQ1ONPNxccHYqbm66WO3Ep2CO3uZnUgZSmCEsoLYBuuo7efmjaME emdB55dib3XbwZGyz2hlVZPl5WI/Z0C3aPlf6n8Kg0A1Tpw/YFsu3rD/k5lYsw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714364834; a=rsa-sha256; cv=none; b=dn76AcPyMHzr6EPf2guG9hRAF979vSoJxK6rsMfAVGLybQNO0r8SCLYcN4t2BXRIH+4j4p P6/3iiinj+h7I5nVufnX5+/i6COYfeAd27HXcdO2LLh58LaBvv4cWiJtkUhwCJUl29dYX/ wTFr3a1M4Qy2oKaCha/ihMnGXZ/5EeUENMrz2LpOtJIbvvdnPkLoQ3H47Cn4hzq+kzbbtl 1vc7dVNEma70JrkEaE5SMYgop4NhJfQ4DbSvNtBZ53Fzh9yaPltfezb5qkI2FpQFLHs1Sc z5yHiEavETPTqs7aDmcgOEXUBTrZ0p8CPKjbefw9AydfOJeDluNIEMqCq9WJ2A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714364834; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nkd+JSM25me7v7cYbB2KpDH60Mu/P7i458RkUFO7kBs=; b=QOQJOf06h2JL5s/z2FmNW8kLwUPa6DPezfm6fDVDgMTVM7u2b5PmML5RdELMcidRZBLZn7 0wRgr9rkvy7DBm7oFFp41z0VthwPmke+EFgaKfdiE9g3hgDQ2RwcbAwRu9pTV8FF5nYP2d tFU1/doSeFHYU9+pe95NqzNxNAt7Yb0VDxiLje/+Qb/2NLqZkPLCyAeztNC4E6EpGNd0OU 67pXTo11M/BzdL63k3UhXhNZgdI9tb2i9ymNo++IIgFY5rtmitGreVOztp1ZoLsNXjTQp7 GPxt80BMBpcFIH0FO5TqHTtvaGqH94K7JJerMT8CUUGxJUZrvZJTS3F3WI5SCg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VSVfV12FwzvGb; Mon, 29 Apr 2024 04:27:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43T4REiT044536; Mon, 29 Apr 2024 04:27:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43T4RE3A044533; Mon, 29 Apr 2024 04:27:14 GMT (envelope-from git) Date: Mon, 29 Apr 2024 04:27:14 GMT Message-Id: <202404290427.43T4RE3A044533@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: d1d652c06015 - main - rtadvctl: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0]) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: d1d652c060150985e1e580eb57b4b6829f6845c9 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=d1d652c060150985e1e580eb57b4b6829f6845c9 commit d1d652c060150985e1e580eb57b4b6829f6845c9 Author: Elyes Haouas AuthorDate: 2024-04-29 02:55:30 +0000 Commit: Warner Losh CommitDate: 2024-04-29 03:24:46 +0000 rtadvctl: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0]) Pull Request: https://github.com/freebsd/freebsd-src/pull/888 Signed-off-by: Elyes Haouas --- usr.sbin/rtadvctl/rtadvctl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.sbin/rtadvctl/rtadvctl.c b/usr.sbin/rtadvctl/rtadvctl.c index 727fa6ee1a52..9fdb643cef10 100644 --- a/usr.sbin/rtadvctl/rtadvctl.c +++ b/usr.sbin/rtadvctl/rtadvctl.c @@ -27,8 +27,8 @@ * */ +#include #include -#include #include #include #include @@ -137,7 +137,7 @@ usage(void) { int i; - for (i = 0; (size_t)i < sizeof(dtable)/sizeof(dtable[0]); i++) { + for (i = 0; (size_t)i < nitems(dtable); i++) { if (dtable[i].dt_comm == NULL) break; printf("%s\n", dtable[i].dt_comm); @@ -172,7 +172,7 @@ main(int argc, char *argv[]) if (argc == 0) usage(); - for (i = 0; (size_t)i < sizeof(dtable)/sizeof(dtable[0]); i++) { + for (i = 0; (size_t)i < nitems(dtable); i++) { if (dtable[i].dt_comm == NULL || strcmp(dtable[i].dt_comm, argv[0]) == 0) { action = dtable[i].dt_act; From nobody Mon Apr 29 04:27:12 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VSVfT3YJtz5JBv9; Mon, 29 Apr 2024 04:27: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VSVfT0prkz41G5; Mon, 29 Apr 2024 04:27:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714364833; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AvfmL+ielotoUhTPSw07Vb7HYd+Ghz/FW+Z89SBeROo=; b=jFkBRMyc6+lx+gnYP/QnS/L92MCyUCnkY1DstMkhrudoU5ovwCOudfhpgDLra6RfvScuCr Apv1di2/Fmg3S77UnUH2E6vte6Yb6GO4JMToDsKgYMlWncPDcAkr0smizgU2iwHmvyL/XY BX9ywkdbQvEoR9UQN6Bfsd3k8IxuMU+OmI7Jy87G4vVw4JN6BkTB5zcYGFV5DujSuqALbA TIyqQJYOBbC3pgX5PYAx2wbGLP8f48xqjZpGi1/ZtUmSViymx7RSKNeFIjO6FpFnenHEMP NFDHziRz7ksO16WiYj+0ypJ4Wvr3zXJMhJj8Jqf+wZTXLUzN1Gcs3oUgw1rIwA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714364833; a=rsa-sha256; cv=none; b=TlcvaZ8AJN4SKFaWa19mdCN4p+WMmvp8YQ8qsrj6zwmN19TY6Gs29nq5x8FUjkQET0Bklm 0NzYd/lbgglxzqcaU4wk01mShIRYy1HAtZCpMH3nxPaJat//3SYE+nbrZs252EnE8IsN2D imnNPxnb8y2nieQtEAVxnn0NORU5hGB29zT48jMX/GkXPFEOe0b5yoQoW7DI6evMOYmECe vvCpEd4YWyPB6bdO492TzDx9eJ/JoYWEvfjSst8oCOupZZsZ11FPNwxgaMXMWoF7ZgYCF9 +hJBi6Y2u9xRXRG+JqSRubNfYnUcF1fpPerk1sOh1IKGlXAIVf9qKcnr0aDeCg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714364833; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AvfmL+ielotoUhTPSw07Vb7HYd+Ghz/FW+Z89SBeROo=; b=FbLvA3My15cEXvxOI2Xv2hUo2XQIlPmuqD2ZIRM01HiNXo8HdhJy5EBA+TsHb/aK5WFuDZ YAWn5xqYreUcJUB/8E024BDHUVA6CLwJWfj6Muj+kHb1jjA6UTvdElNvloogH1fc8ecC52 SIiouIPhGDSTUj9Kig95AAHaANntKA3p3ZLI7/4BiJEADOdfGVq0NxIfiH7/sLnyVSIIw3 XCucMG4wh6AEVjL7ol9RCeXwhFpna60smO2dT4g1ZDrpDqXkJFMbkK+smxDYlQ1eGcXhlj eHF87ubFYXWhuWUYt8EE0v7fWbM2X6H2vV31k/UC/CiGiRwfp53gZFQutGn82g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VSVfT02nqzv10; Mon, 29 Apr 2024 04:27:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43T4RCQR044491; Mon, 29 Apr 2024 04:27:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43T4RCbx044488; Mon, 29 Apr 2024 04:27:12 GMT (envelope-from git) Date: Mon, 29 Apr 2024 04:27:12 GMT Message-Id: <202404290427.43T4RCbx044488@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: 93e96d6c87dc - main - rtadvd: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0]) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 93e96d6c87dc8dd84cdfc56a155dc0611f55ac86 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=93e96d6c87dc8dd84cdfc56a155dc0611f55ac86 commit 93e96d6c87dc8dd84cdfc56a155dc0611f55ac86 Author: Elyes Haouas AuthorDate: 2024-04-29 02:55:30 +0000 Commit: Warner Losh CommitDate: 2024-04-29 03:24:46 +0000 rtadvd: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0]) Pull Request: https://github.com/freebsd/freebsd-src/pull/888 Signed-off-by: Elyes Haouas --- usr.sbin/rtadvd/control.c | 6 +++--- usr.sbin/rtadvd/control_server.c | 4 ++-- usr.sbin/rtadvd/if.c | 2 +- usr.sbin/rtadvd/rtadvd.c | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/usr.sbin/rtadvd/control.c b/usr.sbin/rtadvd/control.c index 80af6371a269..54a944833f64 100644 --- a/usr.sbin/rtadvd/control.c +++ b/usr.sbin/rtadvd/control.c @@ -27,8 +27,8 @@ * */ +#include #include -#include #include #include #include @@ -75,7 +75,7 @@ cm_recv(int fd, char *buf) pfds[0].events = POLLIN; for (;;) { - i = poll(pfds, sizeof(pfds)/sizeof(pfds[0]), + i = poll(pfds, nitems(pfds), CM_RECV_TIMEOUT); if (i == 0) @@ -131,7 +131,7 @@ cm_recv(int fd, char *buf) msglen); for (;;) { - i = poll(pfds, sizeof(pfds)/sizeof(pfds[0]), + i = poll(pfds, nitems(pfds), CM_RECV_TIMEOUT); if (i == 0) diff --git a/usr.sbin/rtadvd/control_server.c b/usr.sbin/rtadvd/control_server.c index e96a1958dd10..60fdc5ca2ec0 100644 --- a/usr.sbin/rtadvd/control_server.c +++ b/usr.sbin/rtadvd/control_server.c @@ -27,8 +27,8 @@ * */ +#include #include -#include #include #include #include @@ -527,7 +527,7 @@ cm_getprop(struct ctrl_msg_pl *cp) return (1); for (i = 0; - i < sizeof(getprop_dtable) / sizeof(getprop_dtable[0]); + i < nitems(getprop_dtable); i++) { if (strcmp(cp->cp_key, getprop_dtable[i].dt_comm) == 0) return (getprop_dtable[i].dt_act(cp)); diff --git a/usr.sbin/rtadvd/if.c b/usr.sbin/rtadvd/if.c index 6212639ba028..e1702a0aa72a 100644 --- a/usr.sbin/rtadvd/if.c +++ b/usr.sbin/rtadvd/if.c @@ -642,7 +642,7 @@ getinet6sysctl(int code) mib[3] = code; size = sizeof(value); - if (sysctl(mib, sizeof(mib)/sizeof(mib[0]), &value, &size, NULL, 0) + if (sysctl(mib, nitems(mib), &value, &size, NULL, 0) < 0) { syslog(LOG_ERR, "<%s>: failed to get ip6 sysctl(%d): %s", __func__, code, diff --git a/usr.sbin/rtadvd/rtadvd.c b/usr.sbin/rtadvd/rtadvd.c index aa9038b65e63..fa5640afa96c 100644 --- a/usr.sbin/rtadvd/rtadvd.c +++ b/usr.sbin/rtadvd/rtadvd.c @@ -328,7 +328,7 @@ main(int argc, char *argv[]) "<%s> there's no timer. waiting for inputs", __func__); } - if ((i = poll(set, sizeof(set)/sizeof(set[0]), + if ((i = poll(set, nitems(set), timeout ? (timeout->tv_sec * 1000 + timeout->tv_nsec / 1000 / 1000) : INFTIM)) < 0) { From nobody Mon Apr 29 04:27:15 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VSVfW5zGvz5JBmY; Mon, 29 Apr 2024 04:27: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VSVfW3C6Dz412Z; Mon, 29 Apr 2024 04:27:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714364835; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TSdOzTNpc3WmNbp7/xiu3casLWk2x4g8dk0Bg+vy4Bs=; b=O4vRVpFFJVN/BYtd7PL3w6m3VlNE7hw6++P5NoYSCQ+vf0bG0pG9FHVZ7kKj66KU4C+MB5 aQWv7rnIbg4fGQieEFgoGwvF4xkpGeXhMuZQDnuGJmuhH7sKeD0bIrF02fojDHrHdhhQMD xxfqXhgAcQUhO64bH8NIRdCRP8PrsawtQcThVJnsIMTrRWR6kDP11IqRpMFKQHG7oqA7Ix eWE3NwmjOK0ULwBWMlv1zs6CRoW07UJT42C9I+a6d+MfXr7fUQJI12m1jTdjtvtUVoqwnQ k2MgmT5mP21LV3hhJj+XUCp9kviK8JrAfihtczrANKbd8XaIxUO6FA0+PDIYRw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714364835; a=rsa-sha256; cv=none; b=M7Qr9HSx7+vLNGxg16q3OKvhHNZFI8xPbkUyJMpxr9t1kiTitXcYPvOgcs9z3SLaKCPg8K A+W5Lzfbqylo4WfFzPaR1NVuQRTQhCcUOtUBAlyFf0oC2xk+FI0xwzgVFc7shUHgKEOE0E KH3hleOTZZMXPivFs0S6G7c8UBv5vM+oHvDHYHR5wjdVgPg85+cJC66Ti918UFrkBFzQPK UCKtDaEGhEZBL8y30kV5nmqu1R36gHlMTBdveJbJZf/qtpDS5KLNV3iF4TMIE4gXp0ukWd 78o3gs/levzM9UGsEpNK73Sz5o7uQzgqZNifLAogi4T6Q2Vnb8dhq72mtk2fJg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714364835; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TSdOzTNpc3WmNbp7/xiu3casLWk2x4g8dk0Bg+vy4Bs=; b=kXpwJDfkskK7VmCqRT63kUfwwZ+mv/lb6iQ82ITpmaPVbcJpOZ+8qxvc7GkUiWTS0EzL96 x+E9UM517acKnAUESoS+rb6bjbSnnVFP5HHsakTsIdNki+zjual28qXdJ+NWGS7WvN2ac1 3H40Iq211ZU3r9hkoqxSdHEeokizgFMNJmD2iJPvMAvumdBI3x7EdLE+EmNH/Pg8zff4EF AaIb7AzhkCP5HiXm+DYrJqAKBAScyZMcM1O9YrYMFlIdqcTVMAdZ5WxOONdaNAhfcRQA37 yl+lVvfC1jKersD94VrsfZHOw6pjZ76qe/4R4USLJyOotLK1oclWBN6BT2utig== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VSVfW245Vzv11; Mon, 29 Apr 2024 04:27:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43T4RFY7044583; Mon, 29 Apr 2024 04:27:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43T4RFQJ044580; Mon, 29 Apr 2024 04:27:15 GMT (envelope-from git) Date: Mon, 29 Apr 2024 04:27:15 GMT Message-Id: <202404290427.43T4RFQJ044580@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: 8918cc95e869 - main - btxld: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0]) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 8918cc95e869ce4a9c7fb15221577444a8c66215 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=8918cc95e869ce4a9c7fb15221577444a8c66215 commit 8918cc95e869ce4a9c7fb15221577444a8c66215 Author: Elyes Haouas AuthorDate: 2023-11-07 17:10:52 +0000 Commit: Warner Losh CommitDate: 2024-04-29 03:24:47 +0000 btxld: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0]) Pull Request: https://github.com/freebsd/freebsd-src/pull/888 Signed-off-by: Elyes Haouas --- usr.sbin/btxld/elfh.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.sbin/btxld/elfh.c b/usr.sbin/btxld/elfh.c index 8e9ea16c2cf6..5122aca8b3c9 100644 --- a/usr.sbin/btxld/elfh.c +++ b/usr.sbin/btxld/elfh.c @@ -26,7 +26,7 @@ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include +#include #include #include @@ -53,9 +53,9 @@ const struct elfh elfhdr = { 0, /* e_flags */ htole16(sizeof(elfhdr.e)), /* e_ehsize */ htole16(sizeof(elfhdr.p[0])), /* e_phentsize */ - htole16(sizeof(elfhdr.p) / sizeof(elfhdr.p[0])), /* e_phnum */ + htole16(nitems(elfhdr.p)), /* e_phnum */ htole16(sizeof(elfhdr.sh[0])), /* e_shentsize */ - htole16(sizeof(elfhdr.sh) / sizeof(elfhdr.sh[0])), /* e_shnum */ + htole16(nitems(elfhdr.sh)), /* e_shnum */ htole16(1) /* e_shstrndx */ }, { From nobody Mon Apr 29 04:27:16 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VSVfX6Zm0z5JBgS; Mon, 29 Apr 2024 04:27: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VSVfX4FRbz416j; Mon, 29 Apr 2024 04:27:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714364836; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5YW42YWWig4rUEcciHUSi9cD9i3W56Icb+zZMYU56l4=; b=mPGMdju0WmzLUE6tOo3fM32gzbHPWLmXObv1JqsmUB8VvuqFlSz8my/+icgVhaeT2y+CWc 0s4gOemSf/jkwRLOmbNIW3EJPLuIiiMcaEJt8d1aR3013msm1vHUTk/b/Y+TdR4KSadL+w N1BD1dsjGtG7DzZrKMypWlt0fe5jphOF81j/MZqLf3IvjOVy9LFL0XM93TIkLUdQrQyS6/ Li1imLDLaqN7CrVuwozwtJsRWjj621bmVPgcLymND/iUA++sRZdUjc9XUBkbge/wmj+L90 bc/g/3gellvKcZNk/Tjv1qtEqhDsAaNNZsf18dW17R2U0MEUPpcuF6oLlFLmqA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714364836; a=rsa-sha256; cv=none; b=FLYuTxDTc/x22pEwHTcvcYiwykMKnx0pVJQJci0nsHGPRrh+26bCHw1vn7alDhEDUiAVkT +Poxtam/2bGqZtdjlF/6WFzE+yO/c7oKRrklkfrnDoIL3q3J6JV4Iq8R65ptEkJBQs6H5h 4ss2rhxcgVD8NolachzAkNlIFF5A/4anwOKWTrK6BYVDU2/Q9TQShGn77I/Qzl0B4RcDji QWhDYHDPAgLvJ1Lcjs1PAsr0k0RazAVVG0c8MsfLygh1GK2+3NUS6id8mnoSXqTwfHPx+o YECK2k6Ku+svNBpIS/wAkpUBEzJLC7tsOU97R5cXmpEC3nIXr7pYoObMduliRg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714364836; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5YW42YWWig4rUEcciHUSi9cD9i3W56Icb+zZMYU56l4=; b=MJ0LXNkoFoifOHNzt6MrumCfIlm0W2bFPhr072/FmInLPhZetPNpneFEThE3KeDS6zuoz6 Fhi6OLx+tyLVVgQ9Qe/4BK4gdDpHbI4NE23pcrmYE6px+z5qNKs8TXcOHWbgBodYLaqRda CnPJDMwHga2KTM9GnXAhIAhjxZ28yqj635QPLuRoJj7YN64K0WRfakIv+nkBIRsqsR/jWB raVK6VRPnsAlZDfiI1IZkrBp+3sUtZBkdc4EXOteEcrKcSoSCM9ACFqqKKWIJ1Z9fgHLZI 1Q8EiaiLS2nJ39pRdJtnmqVTBQlZNTPHuKVva2U788d07ZsM7h1kwHQa8BVRDQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VSVfX35FSzv30; Mon, 29 Apr 2024 04:27:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43T4RGFr044628; Mon, 29 Apr 2024 04:27:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43T4RGWj044625; Mon, 29 Apr 2024 04:27:16 GMT (envelope-from git) Date: Mon, 29 Apr 2024 04:27:16 GMT Message-Id: <202404290427.43T4RGWj044625@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: 2f8ea2f605ac - main - ctladm: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0]) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 2f8ea2f605acbeadb3c2fe9d336fcf558f2d4fa6 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=2f8ea2f605acbeadb3c2fe9d336fcf558f2d4fa6 commit 2f8ea2f605acbeadb3c2fe9d336fcf558f2d4fa6 Author: Elyes Haouas AuthorDate: 2023-11-07 17:11:10 +0000 Commit: Warner Losh CommitDate: 2024-04-29 03:24:47 +0000 ctladm: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0]) Pull Request: https://github.com/freebsd/freebsd-src/pull/888 Signed-off-by: Elyes Haouas --- usr.sbin/ctladm/ctladm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.sbin/ctladm/ctladm.c b/usr.sbin/ctladm/ctladm.c index 9d2f14de28ed..81b8d3196357 100644 --- a/usr.sbin/ctladm/ctladm.c +++ b/usr.sbin/ctladm/ctladm.c @@ -2809,7 +2809,7 @@ cctl_islist_start_element(void *user_data, const char *name, const char **attr) if ((u_int)islist->level >= (sizeof(islist->cur_sb) / sizeof(islist->cur_sb[0]))) errx(1, "%s: too many nesting levels, %zd max", __func__, - sizeof(islist->cur_sb) / sizeof(islist->cur_sb[0])); + nitems(islist->cur_sb)); islist->cur_sb[islist->level] = sbuf_new_auto(); if (islist->cur_sb[islist->level] == NULL) @@ -3240,7 +3240,7 @@ cctl_start_element(void *user_data, const char *name, const char **attr) if ((u_int)devlist->level >= (sizeof(devlist->cur_sb) / sizeof(devlist->cur_sb[0]))) errx(1, "%s: too many nesting levels, %zd max", __func__, - sizeof(devlist->cur_sb) / sizeof(devlist->cur_sb[0])); + nitems(devlist->cur_sb)); devlist->cur_sb[devlist->level] = sbuf_new_auto(); if (devlist->cur_sb[devlist->level] == NULL) @@ -3504,7 +3504,7 @@ cctl_start_pelement(void *user_data, const char *name, const char **attr) if ((u_int)portlist->level >= (sizeof(portlist->cur_sb) / sizeof(portlist->cur_sb[0]))) errx(1, "%s: too many nesting levels, %zd max", __func__, - sizeof(portlist->cur_sb) / sizeof(portlist->cur_sb[0])); + nitems(portlist->cur_sb)); portlist->cur_sb[portlist->level] = sbuf_new_auto(); if (portlist->cur_sb[portlist->level] == NULL) From nobody Mon Apr 29 04:27:17 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VSVfZ06tjz5JBrp; Mon, 29 Apr 2024 04:27: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VSVfY4qhvz41Lg; Mon, 29 Apr 2024 04:27:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714364837; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=h/y0KgHf2s7qC5Q8Iz9xxYcyteGsntNhkmudTtYhrZw=; b=vL7s71cx96GXVxgSRip08B0XZeublmPlFnTUYy5w3Eog6Z9kgnKaXsBauE64EMrdcBZFdY M6uZg8v8zpIvp5Wwo+9CRBOD8gh82LsIAbjEX0RH5Bw2SHVgWp4biRKvTE443NAJigujUf 4yTEOK9Pcd/7pPnZ8CfbSAmwnvU5KpE7/R6VjrXid6q3uv4i2/Hk01cMMF9QasYzOlWokQ VsYVQxTuiUt0QXtc65WFBY/fjaOaBfRdhZGfRnicuqQAhLl2bzfxSv3iJyPMrLm9jGvBEo fqUnRFa07dFvHCJJp7eFC9otoknRh+kmyX6AbRpOhdySxssmcx32/AdZqIdd8Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714364837; a=rsa-sha256; cv=none; b=tx00ur7C+I5CX64QD5eOAhA4nb6aBq5BpfDI0mhoPNQXkgtrcemyzGjs58WUv+WyUpXjb1 BIwRtrpD50g/AQ4Srz6a7fDbMOPki9sVgSOBDcMXqDkb8b8w0zNu7IDpXExsNGt683E/RK l69gzFuOkv0TYx0G6LxjOayqf55keVKJGpQh6sNlKQuw6exZwVG0KigPGlREasJ3N7gPAv 0eVACMPeKgUIYdNUbfyYg28WFscjzXW7I/EDfPhqAp0U+ejX97oMIaJmdwv5GfvP3/LIn9 IgVovNA1dnlfekocpwxWta4bupKYBjv/ISQ/2lLZTG6Do9WKCzDeEIF6MR2J+A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714364837; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=h/y0KgHf2s7qC5Q8Iz9xxYcyteGsntNhkmudTtYhrZw=; b=nOvuRtQyES0z4LOliYiyZJcd/bt5eugPQuWROkn5pGnhy/FyFlqUiv8e4jV9Zt/zEXB18a Hadts+dn5Wf2rvOlTUBabTsxob9qQWCdEo0J+zolvXWQ/ub0uueL/IozJvgCJY2aMhTSgO TwVjeVM1BfAL7JKenzA6Ezb6+G2z290l7e8BY5LqTpGzr7PU0bEum6ttlvhwdvcJn+xvsX 9qET6H+DoTF5Srt3PXAT4Tbz+7R31s9MXemv5fo5Ctx5voX9CcQf2Smx1sLeusXO+R9lMF du2ery8/psiIHAplUVQ9tdQv0JmZrofZybxeqfwXhylJr579pLHxwAVy10un7w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VSVfY3gFqzvGc; Mon, 29 Apr 2024 04:27:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43T4RHw9044675; Mon, 29 Apr 2024 04:27:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43T4RHnC044672; Mon, 29 Apr 2024 04:27:17 GMT (envelope-from git) Date: Mon, 29 Apr 2024 04:27:17 GMT Message-Id: <202404290427.43T4RHnC044672@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: 8f65dcd6276b - main - ctld: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0]) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 8f65dcd6276bf139a2fe87c1bbeffcc1fed015e4 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=8f65dcd6276bf139a2fe87c1bbeffcc1fed015e4 commit 8f65dcd6276bf139a2fe87c1bbeffcc1fed015e4 Author: Elyes Haouas AuthorDate: 2023-11-07 17:11:34 +0000 Commit: Warner Losh CommitDate: 2024-04-29 03:24:47 +0000 ctld: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0]) Pull Request: https://github.com/freebsd/freebsd-src/pull/888 Signed-off-by: Elyes Haouas --- usr.sbin/ctld/kernel.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/ctld/kernel.c b/usr.sbin/ctld/kernel.c index cdc0b0fa187d..dd1c89d0e9b8 100644 --- a/usr.sbin/ctld/kernel.c +++ b/usr.sbin/ctld/kernel.c @@ -168,7 +168,7 @@ cctl_start_element(void *user_data, const char *name, const char **attr) if ((u_int)devlist->level >= (sizeof(devlist->cur_sb) / sizeof(devlist->cur_sb[0]))) log_errx(1, "%s: too many nesting levels, %zd max", __func__, - sizeof(devlist->cur_sb) / sizeof(devlist->cur_sb[0])); + nitems(devlist->cur_sb)); devlist->cur_sb[devlist->level] = sbuf_new_auto(); if (devlist->cur_sb[devlist->level] == NULL) @@ -290,7 +290,7 @@ cctl_start_pelement(void *user_data, const char *name, const char **attr) if ((u_int)devlist->level >= (sizeof(devlist->cur_sb) / sizeof(devlist->cur_sb[0]))) log_errx(1, "%s: too many nesting levels, %zd max", __func__, - sizeof(devlist->cur_sb) / sizeof(devlist->cur_sb[0])); + nitems(devlist->cur_sb)); devlist->cur_sb[devlist->level] = sbuf_new_auto(); if (devlist->cur_sb[devlist->level] == NULL) From nobody Mon Apr 29 04:27:18 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VSVfb2N2cz5JBrr; Mon, 29 Apr 2024 04:27: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VSVfZ68Hwz41G8; Mon, 29 Apr 2024 04:27:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714364838; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XVjQrBrsvlyMthA6HIqqkQZR+Yv6Edxcp6RToSiDLyw=; b=jtEax3Ioya/aLl2Mzo9h1s1onYceQcz9WVak0RZrN4Yt0c5azdBRzr1IBEZFWjgebmV410 JWTo+OvKcSVjjbvD2ZjV3oyxCqv7HJORXn2EivY1xPR8ImOomF54PiiBJcC2ObezTJk+R6 md+yzYalHszCy7iwpMhGFmnvUyrof5syWF5x8oLU25OkK3UfJKa2L6ubBdKWWD3KGJe18f /xwzrCOGJpBTjI7XFkSDSCzSZBa5rDP2aXjH8CNR9TqYNj10ABsA1yCuBA23fnUGnAKF7z t7s44CR3uEXpjkGyI6VSMKJkFLnbvWujsfhWk/7zldVEovd32+with8Wu+5eqw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714364838; a=rsa-sha256; cv=none; b=dPWmdYTz4IgE4pZp2a2Fmlnz/xS5GS3vASYYRBizmo8poK+hNgCBT02O23gPjUUp6EDhzP u9PBzGtoSaB3na99vvBFDsmgvu+2OdG2HAsjpeEiDRhlW+oZAY3LUjLReKhWoIjej1UYlv +k72Ikvt2wWaYZOdztRu+j4DxAAreiK21xw+SthRgjNhER45ff7NjU0giQiXWcKY+enHj4 oFjRUMCBNlAmTkJUB0HOvRN+rM/U4FYOVrvWUHFW4lQRpVd9KHyxPUuZWGASIw/XCOT8OO Z1fZ63gGwbgYeDHjx72hIXGtaoh+CIwObJGqsYZ4aLbTawxUhn22STE21uWy6A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714364838; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XVjQrBrsvlyMthA6HIqqkQZR+Yv6Edxcp6RToSiDLyw=; b=eAogfeCPrua1wXHwTgI0jJdvttmVE/q2ink2Ywb1DG8TOlFxXsUnPCzzzQNxkDzgBhFYbT 6tXtZX3UOFTB12UL/QoOE8RMuGOS21l7hZWO2w4ihKJ8Ufuh1pxRN2z/vwd2pxgVsHIsW+ pzdl5JnkN2q+lOySx3jywSS+V33FxqH06JFuRJF8o5HrFEr1W1MoghkAQMHXTEfi0pn+6T seQMrU2b/jlgRjuymh3+VLkLE1kCjmA/AUcXUwWIbFsx0wqe+i0NUdl0Myr02L5Ce+NBJZ lZvBp7UFRGF8H1iDLFlx2lR0Uc8DgZY7iXGlviCBbFR2OEWZjSNUQ8swypzJoQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VSVfZ4DR9zvHV; Mon, 29 Apr 2024 04:27:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43T4RIHF044726; Mon, 29 Apr 2024 04:27:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43T4RI8i044723; Mon, 29 Apr 2024 04:27:18 GMT (envelope-from git) Date: Mon, 29 Apr 2024 04:27:18 GMT Message-Id: <202404290427.43T4RI8i044723@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: 338d9c35d55d - main - kbdcontrol: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0]) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 338d9c35d55dd69c02d2d7d887ee658eaa667bac Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=338d9c35d55dd69c02d2d7d887ee658eaa667bac commit 338d9c35d55dd69c02d2d7d887ee658eaa667bac Author: Elyes Haouas AuthorDate: 2023-11-07 17:11:56 +0000 Commit: Warner Losh CommitDate: 2024-04-29 03:24:47 +0000 kbdcontrol: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0]) Pull Request: https://github.com/freebsd/freebsd-src/pull/888 Signed-off-by: Elyes Haouas --- usr.sbin/kbdcontrol/kbdcontrol.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/kbdcontrol/kbdcontrol.c b/usr.sbin/kbdcontrol/kbdcontrol.c index e55165fd0888..4e27febe2164 100644 --- a/usr.sbin/kbdcontrol/kbdcontrol.c +++ b/usr.sbin/kbdcontrol/kbdcontrol.c @@ -1117,7 +1117,7 @@ get_kbd_type_name(int type) }; unsigned int i; - for (i = 0; i < sizeof(name_table)/sizeof(name_table[0]); ++i) { + for (i = 0; i < nitems(name_table); ++i) { if (type == name_table[i].type) return name_table[i].name; } From nobody Mon Apr 29 04:27:21 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VSVff3Lkdz5JBSJ; Mon, 29 Apr 2024 04:27: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VSVff0DRkz41M9; Mon, 29 Apr 2024 04:27:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714364842; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=slvFxcS3COSughuB7b8QxZx4EbXPQVA6WlV9BR2Ew70=; b=igBMThBdYF10vTKKSuHj4l1ytd5k++johWgWoMfyardRKeflZ2T7btUJ0XM8EwQRnE47L/ WrYh+iBh23zff4JkCipibwr4axiZW9t+ixPW6CHE1Iu9i4eTc95jfwg2sEzZ76QGQFfiSx fBte045LcxGSMY+P/e8cJ3pO7UQL3y38rfRVPANwRLgH9wP0zflOsc1UT+MP0ktSHa+aPq CJ4kQKLVh5Dl0xy2DtTIl/MOSmJ4tC2o2mI+xeo1MXBhROn6/RRMmmY5d3mcJ9Sq7Bhzlg nY3fTAK0eROlg90lns+46zwVyCuEbmGI2b461bLefksAR2XJcKtrOF+AUWSixQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714364842; a=rsa-sha256; cv=none; b=OMgN3snulKhwYr8wVQOQ8L45dX+am5YGbPkK6SQ4wv82/7bl1UxR+uG6+ercozKXMsUhkW CinmqNPRtpXZQ8USiotdNp+AZR5uDxESYo6nqOpLwaHAqigC/WtjPx5a6Dnjqi2Nx5oNbO HaWnq2b//OT7TNI4BkJgHio03k57XynSB5n2YkYHCTvElFFer0IJ3fizg4gZYzBjD3O2yF 6D//REnrfNK6A52sUU6USp3rO3xmtYgEeW0//d42B+5yDc9V1cQF4Cd0/WrexVHl55/SJX WiJcjoOF+6rFdbY0lwqxqwXWR3JTwATZ+Yw2IViYfJpmwMEoxgHnsvRZCdJTGw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714364842; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=slvFxcS3COSughuB7b8QxZx4EbXPQVA6WlV9BR2Ew70=; b=pYl0iCkkyrgerU0gDSRR0YUTSUavpFctVXCFZDJKbJJoJA1Kog0gmqWJAPJwRZy/7dJ9EL EDAalcP2fp+y7M8+1Beo46HoK0+f6lOo71wlTaPOlNLznv3LLlAFUOKM4yo57/BuzynGut 8+AZRaO0ehlccavxvFHkQoMSRwpquluCWgTfsJFumlyYL0swUSosQ4CUvTVBCjZifTgmd9 cvnFzbPoEq/mUabBbM0rtHreilJQxC5Ugl4VspuL6Kz05njLFgFdD3JhiHOI1iUz9B9UHB lcZPHzXEadjTM2uOJw04NfK1MQ/0YPN9Y+ZGP7aERdzmzCDRZv6Pxvq3NxM2wA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VSVfd6qGPzv12; Mon, 29 Apr 2024 04:27:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43T4RLgu044865; Mon, 29 Apr 2024 04:27:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43T4RLnm044862; Mon, 29 Apr 2024 04:27:21 GMT (envelope-from git) Date: Mon, 29 Apr 2024 04:27:21 GMT Message-Id: <202404290427.43T4RLnm044862@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: 67db7b43d07e - main - ppp: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0]) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 67db7b43d07e9b29564f6b4734f8d2e975cc805c Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=67db7b43d07e9b29564f6b4734f8d2e975cc805c commit 67db7b43d07e9b29564f6b4734f8d2e975cc805c Author: Elyes Haouas AuthorDate: 2023-11-07 17:13:19 +0000 Commit: Warner Losh CommitDate: 2024-04-29 03:30:55 +0000 ppp: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0]) Pull Request: https://github.com/freebsd/freebsd-src/pull/888 Signed-off-by: Elyes Haouas --- usr.sbin/ppp/chat.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/usr.sbin/ppp/chat.h b/usr.sbin/ppp/chat.h index 54e86834be60..c8fcf9a9c3cc 100644 --- a/usr.sbin/ppp/chat.h +++ b/usr.sbin/ppp/chat.h @@ -26,6 +26,8 @@ * SUCH DAMAGE. */ +#include + #define CHAT_EXPECT 0 #define CHAT_SEND 1 #define CHAT_DONE 2 @@ -74,7 +76,7 @@ struct chat { #define descriptor2chat(d) \ ((d)->type == CHAT_DESCRIPTOR ? (struct chat *)(d) : NULL) -#define VECSIZE(v) (sizeof(v) / sizeof(v[0])) +#define VECSIZE(v) nitems(v) extern void chat_Init(struct chat *, struct physical *); extern int chat_Setup(struct chat *, const char *, const char *); From nobody Mon Apr 29 04:27:23 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VSVfg2bfwz5JBpy; Mon, 29 Apr 2024 04:27: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VSVfg1WKsz40tl; Mon, 29 Apr 2024 04:27:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714364843; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Hfgxtt3szG8fWlG0RckBtuQ4U3fiCUSIJsf3bWsFQaE=; b=sW4qk5OVECD0375n31McaUOFYP42QjskG8IfCOzy88zVPxMp9t/oRrtJhgxx2QB+GqPlnw sRJV7l9/l7u5oNCC1fExM89Z6VxQ9bKn3gmYikHQoSE0s7zM11hq0KaJWRUkn8G8xJpSEH GqBdwrZs3kFlxkQay5h59qrtvnRkBVA7/BbteYY68sno3Gwg4L15/10mSVWkLQ79d33kis JrszWH3Kw1DRB9offjbbIjwjXB/E/oFkKZZ7dvujOqKqOBc/+BgNCPktqeUiG8rKPGHwVl ZNUq9IMEh3olQ1b6BNUjwE3D/+VCbaj8v3cuRyLDQ7NY1zNJrhgLAF82371dGQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714364843; a=rsa-sha256; cv=none; b=JsUMa7uduKTqOfe0Dm9ZQZq6UY5DqAWKpbdx3ahNmfkTO8hdVqF/twcuIz0eWqU5pISPUm 7qBVvXDTrjWK7UGUiITHT3cDWhJirlgLB6Bmo5LOytD1T0pt8F4z9DSlmMp5rDJrHSPr63 u0rvS1zMVYbVTrFvmrYccupn1X9Wz+EOfp4YXM/sutxzZWGow15ffsIvmIPwWZQF0Yh0HM Qk1B1hR3hYkFmbgte8UQiKqRJXoujuqCwovir3a2WqjmfaI3a6qnEoPKAZ9D3b4zR6FvHX VGtYp3JJeu5JnmknkJbqLOTjID4hsK9bwFsZBFPVX/uFFV8+dXTNUiywRj5kTg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714364843; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Hfgxtt3szG8fWlG0RckBtuQ4U3fiCUSIJsf3bWsFQaE=; b=eH9FRf8+jANjosj/S9E2fX7b+MWhScyQkehdMWuLHWBD2pWRNGCsAWEc/SvT/pd3ztXjAz ul24bjvxv5PcHAqEh8Wb4qry8a3YxdZc1chiFCY4X1a2nJ7QbROUbvkUIhvQEeWaQWsxXt n4JQTbVImfYDBDkDG4YF9fWMT4zQ2gl4Kbjk85NE70GrBlI0KjVUHYQZwDm/lRSKwF8tc2 rxJrkvcBmFGLqVIF8SeZIhxFS4jgIkqnX5MDd6iDIxqxWyO3GhGt3qNLCNYC3MvMiR/O3z XehNj4Hz/vljo/B+2ItwrezRy/etCbZ0Dm7y4yy7t2x14IbEtO95dT/Mlx3iyw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VSVfg0rGVzvHW; Mon, 29 Apr 2024 04:27:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43T4RNIt044910; Mon, 29 Apr 2024 04:27:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43T4RNrn044907; Mon, 29 Apr 2024 04:27:23 GMT (envelope-from git) Date: Mon, 29 Apr 2024 04:27:23 GMT Message-Id: <202404290427.43T4RNrn044907@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: f93475cf0fd8 - main - pstat: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0]) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: f93475cf0fd8a7992131a5b8c7f94372a3e44f9c Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=f93475cf0fd8a7992131a5b8c7f94372a3e44f9c commit f93475cf0fd8a7992131a5b8c7f94372a3e44f9c Author: Elyes Haouas AuthorDate: 2023-11-07 17:13:32 +0000 Commit: Warner Losh CommitDate: 2024-04-29 03:30:55 +0000 pstat: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0]) Pull Request: https://github.com/freebsd/freebsd-src/pull/888 Signed-off-by: Elyes Haouas --- usr.sbin/pstat/pstat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/pstat/pstat.c b/usr.sbin/pstat/pstat.c index aab7e902cc4c..fd11c7666955 100644 --- a/usr.sbin/pstat/pstat.c +++ b/usr.sbin/pstat/pstat.c @@ -388,7 +388,7 @@ filemode(void) printf(sizeof(uintptr_t) == 4 ? fhdr32 : fhdr64); wid = (int)sizeof(uintptr_t) * 2; for (fp = (struct xfile *)buf, i = 0; i < openf; ++fp, ++i) { - if ((size_t)fp->xf_type >= sizeof(dtypes) / sizeof(dtypes[0])) + if ((size_t)fp->xf_type >= nitems(dtypes)) continue; (void)printf("%*jx", wid, (uintmax_t)(uintptr_t)fp->xf_file); (void)printf(" %-6.6s", dtypes[fp->xf_type]); From nobody Mon Apr 29 04:27:20 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VSVfd1qV4z5JBvL; Mon, 29 Apr 2024 04:27: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VSVfc6Dbjz41PR; Mon, 29 Apr 2024 04:27:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714364840; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1RwVkoQQNZKWbOB4nMs6vwRMkK9oV2SUjpEzd1gq3Zg=; b=m/t0yJDZPjrTCknbGCdbl4CM4ujILzoZvSAM3l4PW9k7y3OUKqKDKqX2aO4bgP+UF34v3S VHn2CkclO1zSZdWVeIBGxpfSK+iLeyjEXFQ8r0Yby71HZGIbwBXgKlP5VMm61NrZDQQT2y UPEGBRPPfxwz3S9SGu/wT9Fz39HcEbLarPPE8Y1oJOpMk2eeH9kHcyjsreWYtINI/BmM2I aS2kcckO3/eEAZjVieD+zf8exk3MnvudBHZ22V7UM+zZSvaVBizAj59MvgNffgL+PT3zbO T8KGVikSMUEDh8ay80vbd4NdPzLjF8at50Tv4R5NiqfWrxFEk8eWi5xHxA5UYQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714364840; a=rsa-sha256; cv=none; b=ywu/f00JH8xiM6aQ89cJVSmCbgEuwuhv9+tME3Eo/3WZqpIByJiqt4AtGniNmmFjhLa4F1 7k/yAHBiAm42m4MKC3hEiIV/dg6Ay02tzuShPciCB5JpC9x/+oE+ZgQ30um+9EJMSyY9M1 IcThB7YKcpr+KNGjbdI2OHzVgKciS9fmrM47P6EO5j/9P3BqlX73E+Uugu0tBPPrmWwcvN CBAARWvxPRDUu15jK+Lt8MQxynG393uVi/e3Cfq2T8nN0guLgeSTviYXRRkE/hp53xKWFJ rBVeSNcryFJ8wlorGbSPMRn3v8OvkesS5RLuI34AsYFxRtuiz/3Bju72daUOhQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714364840; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1RwVkoQQNZKWbOB4nMs6vwRMkK9oV2SUjpEzd1gq3Zg=; b=lPEH9E1J3nsQlWFyJ7BuixLsC2NM1MHkY34ngfMjAAB9ZVLN30PG2ye6QRECd5bvGykud8 jp3qcUrkMCi61s8pw1qH9z1jG+usH8YSoHZY+yC2b9toJ46NMmcFiI7hP/WYvDL4ZNs2Ng jmYJ2oPAQASc/BAFzSv1W9VRz+5IVfsVrp4b6DRR45OOhZ8Sti+nlscNUgQyyldmC90bMP UVVH+yf3I80n0UEqnQiGq5aKgc3uGXUw4qg7SwfyTnQyftktmS0yZyTFBhNRYGyA1TBQ+f FYZ1N4MfaI7c/IQy4jHKh5pI9ad0uXnqt4B+r9KPNCEDUIuVIXI1ywjCQj/+3A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VSVfc5YPQztlX; Mon, 29 Apr 2024 04:27:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43T4RK1W044820; Mon, 29 Apr 2024 04:27:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43T4RKkx044817; Mon, 29 Apr 2024 04:27:20 GMT (envelope-from git) Date: Mon, 29 Apr 2024 04:27:20 GMT Message-Id: <202404290427.43T4RKkx044817@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: bccbb2fc4bce - main - ndp: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0]) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: bccbb2fc4bce6c3efc1ba93f222de320db8e020a Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=bccbb2fc4bce6c3efc1ba93f222de320db8e020a commit bccbb2fc4bce6c3efc1ba93f222de320db8e020a Author: Elyes Haouas AuthorDate: 2023-11-07 17:13:02 +0000 Commit: Warner Losh CommitDate: 2024-04-29 03:30:54 +0000 ndp: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0]) Pull Request: https://github.com/freebsd/freebsd-src/pull/888 Signed-off-by: Elyes Haouas --- usr.sbin/ndp/ndp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/usr.sbin/ndp/ndp.c b/usr.sbin/ndp/ndp.c index 9d9ae02dc1e2..dcb3b5e3571b 100644 --- a/usr.sbin/ndp/ndp.c +++ b/usr.sbin/ndp/ndp.c @@ -1171,7 +1171,7 @@ rtrlist(void) size_t l; struct timeval now; - if (sysctl(mib, sizeof(mib) / sizeof(mib[0]), NULL, &l, NULL, 0) < 0) { + if (sysctl(mib, nitems(mib), NULL, &l, NULL, 0) < 0) { xo_err(1, "sysctl(ICMPV6CTL_ND6_DRLIST)"); /*NOTREACHED*/ } @@ -1182,7 +1182,7 @@ rtrlist(void) xo_err(1, "malloc"); /*NOTREACHED*/ } - if (sysctl(mib, sizeof(mib) / sizeof(mib[0]), buf, &l, NULL, 0) < 0) { + if (sysctl(mib, nitems(mib), buf, &l, NULL, 0) < 0) { xo_err(1, "sysctl(ICMPV6CTL_ND6_DRLIST)"); /*NOTREACHED*/ } @@ -1257,7 +1257,7 @@ plist(void) int ninflags = opts.nflag ? NI_NUMERICHOST : 0; char namebuf[NI_MAXHOST]; - if (sysctl(mib, sizeof(mib) / sizeof(mib[0]), NULL, &l, NULL, 0) < 0) { + if (sysctl(mib, nitems(mib), NULL, &l, NULL, 0) < 0) { xo_err(1, "sysctl(ICMPV6CTL_ND6_PRLIST)"); /*NOTREACHED*/ } @@ -1266,7 +1266,7 @@ plist(void) xo_err(1, "malloc"); /*NOTREACHED*/ } - if (sysctl(mib, sizeof(mib) / sizeof(mib[0]), buf, &l, NULL, 0) < 0) { + if (sysctl(mib, nitems(mib), buf, &l, NULL, 0) < 0) { xo_err(1, "sysctl(ICMPV6CTL_ND6_PRLIST)"); /*NOTREACHED*/ } From nobody Mon Apr 29 04:27:19 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VSVfc1rfzz5JBmk; Mon, 29 Apr 2024 04:27: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VSVfb62T6z419p; Mon, 29 Apr 2024 04:27:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714364839; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=njnsMEYzCcXkA/3vi29aiZvDq29HZs+FrqpEHIIE9no=; b=F0DsE9K0RT/4AkYvlzeWQ5Yo7qpy5xkgLl6/cwFb7zwm/LTZIypXQKigy/72zyqLqbAWxT oDtiAivrTJgDVesZaPSXs0DC9QeNNBOKkFfhnp77AgLjF97NGajQEXV4nqjduFc5FoNMn8 94J6m+1oh4eTNm/SrVR/eRg/SIJF99eL2tzYCq1p323qvI46tvKD5D4OFZOYXiNJHoH9eO ZgRV4Wtk4F+OXuRfXuMJ1HwHa7llGTNz5dITeiody+IKODHK0fd6NMzxBjXii5VOI9IB9G nUo98f9NzH3OFszbn8xJE7ayGj6tW5AofNH9ue/EggL2TU1FKfnzErKwckO3uQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714364839; a=rsa-sha256; cv=none; b=tyaVX8+bwLpQ6ZN7Yfju/thh16t/rmPShUuWi+SDThxyDKUEwbfkl6u9ShcHaqQUuO9VRE cSLEI36TCyhmrCmJL0kkcvFR4VqU5zyCrqmxZ9wppE4RLTGN6LYNLQDOuJf2b3hG/jA69c DXcUqTWL2l4R3jt3DD7+xVhnu/+UddaCTHn2NvnX5E5RW26cJbnkM/jM8h24qaZYP1WrTQ tvvPjGYWG8mPzerTPTWVBJu1FJ4t00Htk7082xvHiymrlGhk3G2QGyYoQNjCX9vUF3KDNj UyPTfugXLfw89kNdyLgWfUSc6UILKzOKGGzci2JFETiPpJ3DrdIidGDlzxUZxA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714364839; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=njnsMEYzCcXkA/3vi29aiZvDq29HZs+FrqpEHIIE9no=; b=yKND0IfDlfFAmiSm1w3vjNpmwxKs9enqKhd1+B6o4KSZ0Itg07dNmuYdhgODx5hGyLQ8Fq DoebBhzmM++M139kn9Mi4cKcidMmk7zVbunXuP3+B1/q7zQ8a7RFYLPhWpuYOu7PiBVHpn KJV5kIQRlTibIQCVSQILmPSMhJiqT0ueDPbKDRZ9s9d4H3EGpAtWfVHCT3Yln4uJCYvhG7 st9nCQFh0+UWNPJ+2jgoNabFJrUGIO/QTID13MRzTPsx4nfuFkkDzI3gveuRGUIP60oi4v on/7Zs/NOxL3UYy1boDziEjIn1jIK2s256fcqYq5lYeqidtebIICfJY6OtqBkQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VSVfb4vR8zvGd; Mon, 29 Apr 2024 04:27:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43T4RJd0044775; Mon, 29 Apr 2024 04:27:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43T4RJEe044772; Mon, 29 Apr 2024 04:27:19 GMT (envelope-from git) Date: Mon, 29 Apr 2024 04:27:19 GMT Message-Id: <202404290427.43T4RJEe044772@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: 83409a9357a4 - main - moused: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0]) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 83409a9357a43f2ba595c84ae6904ab4c3ac1ab9 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=83409a9357a43f2ba595c84ae6904ab4c3ac1ab9 commit 83409a9357a43f2ba595c84ae6904ab4c3ac1ab9 Author: Elyes Haouas AuthorDate: 2023-11-07 17:12:44 +0000 Commit: Warner Losh CommitDate: 2024-04-29 03:30:54 +0000 moused: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0]) Pull Request: https://github.com/freebsd/freebsd-src/pull/888 Signed-off-by: Elyes Haouas --- usr.sbin/moused/moused.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/usr.sbin/moused/moused.c b/usr.sbin/moused/moused.c index 201e0b6ce0f6..068919f2e941 100644 --- a/usr.sbin/moused/moused.c +++ b/usr.sbin/moused/moused.c @@ -1033,7 +1033,7 @@ moused(void) bstate[i].count = 0; bstate[i].ts = mouse_button_state_ts; } - for (i = 0; i < (int)(sizeof(zstate) / sizeof(zstate[0])); ++i) { + for (i = 0; i < (int)nitems(zstate); ++i) { zstate[i].count = 0; zstate[i].ts = mouse_button_state_ts; } @@ -1489,7 +1489,7 @@ r_identify(void) rodent.mode.level = 0; if (ioctl(rodent.mfd, MOUSE_GETMODE, &rodent.mode) == 0) { if (rodent.mode.protocol == MOUSE_PROTO_UNKNOWN || - rodent.mode.protocol >= (int)(sizeof(proto) / sizeof(proto[0]))) { + rodent.mode.protocol >= (int)nitems(proto)) { logwarnx("unknown mouse protocol (%d)", rodent.mode.protocol); return (MOUSE_PROTO_UNKNOWN); } else { @@ -1564,8 +1564,7 @@ r_name(int type) { const char *unknown = "unknown"; - return (type == MOUSE_PROTO_UNKNOWN || - type >= (int)(sizeof(rnames) / sizeof(rnames[0])) ? + return (type == MOUSE_PROTO_UNKNOWN || type >= (int)nitems(rnames) ? unknown : rnames[type]); } From nobody Mon Apr 29 04:27:24 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VSVfj198fz5JBmy; Mon, 29 Apr 2024 04: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VSVfh2Bn0z41BM; Mon, 29 Apr 2024 04: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=1714364844; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dLr1TgHIZU4x3HUl+XltFC72YiqA3SczyvRKXDPso+4=; b=mPs7WV7HW+lekuirw3LBekNZBMgwWgvSaKUu/HUzlV+q6YW+4qLLn7DpwQgoVc6055zEyU LqhhOFrXRzNqOs1aQu4HSPz3gLkdWVkk6tzoAtBK75TH9LBYamaRY8EBkPmBYjORxwOHZ0 kHqjvLob3Cevx2JzoFZdJXTkIfnV4GanqXUN6gJgNatroMcuG3m1y6G2Q6YNE6sHlcP7k6 VlB9Eq09TQJkv7LVhpBNtMWZcjrHVQPy7Ng4OaegYZqLljLwqszLkdrJam5bSbd860IBQ2 gOib8v8FPnhB8iTjYhvS956AYDi/JY6ol+1OEdVUzt+wWu7mB9fs1Tlpph1VjA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714364844; a=rsa-sha256; cv=none; b=Ikj/UbsHqWFL0kg0Jd/7H9DC8YFhRG0xBvfuSqPs8h1wyJSLqYYLiz35yPORyxqOS5JYo0 m1mKLgP4SoDYHS+KKJnI7GEK7eqQ4OJm1q11wWE2c3E3NG66Rz8OnkCoQkZzLHGD7WkEFU RT2hUcFEPsdTXvG0Pep8nOM+N3Xtel9iIG1SZSVo0ygFa1ViZtEQT8Bf67mJlTyk2ZUwpF j9BBhhW/2AlOXGIQJemYE3NPw6rFPaaDQ0ES7Bt//1ASXsTYeZvMPQ5K7INVBuRFQ8ju85 EqdIW4rh0qe4s4sKAsWDPSaThKw+bJMEtkIhRXX7J2TXr6yHCnhUVj8Q8Wuuqw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714364844; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dLr1TgHIZU4x3HUl+XltFC72YiqA3SczyvRKXDPso+4=; b=tXffeZ6rjIQq1QibDs2tLeD8qR6dTkFBH9KJsgjR3stbzlK2qCqIA3aX35XfLS4lOGZC0y ig857caXxOIhIhKE3L+/dxK4h/7JNdho1yYPlCt1zo7HA1aWQoMYJiZDFQnGbOWiklbPWR JCCIyE3vxuZqIVPmv8UDA3nPj8WW8FOssw3IxA883EUfFeixib4/ruxYEtBcWZ+r1HbPWS 080DYg5ZhTJh6T1W8q8D+65be2ywIliTndTm06aJ0SxX2aOl1xRkBcXUU2x8UmWxswXHtc exJbxsTqNhLZcVagO9qkowUcaJVXw9NRYcJYrLo9AnaCckORot7UlHEIboBEjA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VSVfh1JF6ztlY; Mon, 29 Apr 2024 04:27:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43T4ROf3044961; Mon, 29 Apr 2024 04:27:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43T4ROqg044958; Mon, 29 Apr 2024 04:27:24 GMT (envelope-from git) Date: Mon, 29 Apr 2024 04:27:24 GMT Message-Id: <202404290427.43T4ROqg044958@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: 4c6e656e2e5a - main - rwhod: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0]) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 4c6e656e2e5a25773135a7469a647649147c90f4 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=4c6e656e2e5a25773135a7469a647649147c90f4 commit 4c6e656e2e5a25773135a7469a647649147c90f4 Author: Elyes Haouas AuthorDate: 2023-11-07 17:13:47 +0000 Commit: Warner Losh CommitDate: 2024-04-29 03:30:55 +0000 rwhod: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0]) Pull Request: https://github.com/freebsd/freebsd-src/pull/888 Signed-off-by: Elyes Haouas --- usr.sbin/rwhod/rwhod.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/rwhod/rwhod.c b/usr.sbin/rwhod/rwhod.c index 2f589e2492e3..237663eef74d 100644 --- a/usr.sbin/rwhod/rwhod.c +++ b/usr.sbin/rwhod/rwhod.c @@ -478,7 +478,7 @@ sender_process(void) we->we_idle = htonl(now - stb.st_atime); } (void) getloadavg(avenrun, - sizeof(avenrun) / sizeof(avenrun[0])); + nitems(avenrun)); for (i = 0; i < 3; i++) mywd.wd_loadav[i] = htonl((u_long)(avenrun[i] * 100)); cc = (char *)wend - (char *)&mywd; From nobody Mon Apr 29 04:27:25 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VSVfk2L97z5JBvQ; Mon, 29 Apr 2024 04:27: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VSVfj34SBz417w; Mon, 29 Apr 2024 04:27:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714364845; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+zbHBsd2/fVftsu6m+A/6c3nube3vJv3wjNBaLL0byA=; b=gx7w1N5sFo+7cTjAy477rFCRZVe8rmEzCW+VltWRA8IQwBQ4Nvx21cv1wKeo0Oo6XjDqA4 hwVYgMEUPpY18cOL/7VmgofBo4Im5PxK3vmCFsOEO/reXVw1qpNWNCkrIKy3u78kMIONTU vecEkCGeCDU2EgG8w/oG6P1IQaa4u32FCD2197igmloW4rWQfmuA9c68CyKGo67NpbHgwB PU4x4paFpgPPD8wHVtukPnL2PGWirRleTWtp28Uptjclw7RksWt5fjvqDeikO3THLvP3Rk f4EWPkdfEbOZEyS3U+ZcDvy07btpDlD0KW1cIOzdd1jqv2mG4ITDr8YqN+Hc5w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714364845; a=rsa-sha256; cv=none; b=JLKyEL4PjKTFKxvLW0uUTx6flOds2TyNy1J/oYxxRMcXAdIkxMNVKf8tB5M08/p3kFrCdK 9ercVifjYk0lZkce+4CBwpL6vlBI2njJpDd8KZtBfti9rrqfUmRzce0B4J6bzUr0IkNaoh SOeevO40+C0vuxKphh/CyIwvjejERBFDpx6sO8EZu0Gcb2Ab1iZQsaT7oQ6h7eB7cGTz1s LxJtKPWbrJQ8Idlg68xW5ZhCV5FsfLyxQ6naOuP3LttcY3kLimPHOaXenq/5AwaRh//wnI vwWkuDSP0vp0+znkuAmTfPuMZSvaU6OzUEoZaQMPplIpNzAh/wTECGTzRljO2Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714364845; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+zbHBsd2/fVftsu6m+A/6c3nube3vJv3wjNBaLL0byA=; b=jhR3lNVP28CYzdQl5oUwju8iAoAj4RVBNm1MHmpsUMLGHVmR1ZWRaGpM6aQHbTirJFoA2v miE6ShymUC8K86Z+jHSqU49l7524nPBSwCnUoa/UgOr5i4vnY3aFjnSY06M2qgOTchUm11 oauaRMXB7522ALCTvRL085AU8x0qqvPaEpt2Hr60RkXh1L4MNQLFTQKjtSLQfiUL0xf2IV 7COdqbJcEzcKeCPd7T6F5cQywHhVI/M31nxJb4CeZjN5CMdJNzT/ZlFRpZW6NDBU/G5+DS 8QcTgcbZHHBkoH2aQ7Z9bl3dhXSDEN/wSGfppzYXc/Wbx0sQAW72BXfBV14fWA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VSVfj2H8GzvGf; Mon, 29 Apr 2024 04:27:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43T4RPcE045008; Mon, 29 Apr 2024 04:27:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43T4RPMW045005; Mon, 29 Apr 2024 04:27:25 GMT (envelope-from git) Date: Mon, 29 Apr 2024 04:27:25 GMT Message-Id: <202404290427.43T4RPMW045005@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: abab59f662b3 - main - usbconfig: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0]) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: abab59f662b380f5ad46de03f9818f8c1f5ca0c4 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=abab59f662b380f5ad46de03f9818f8c1f5ca0c4 commit abab59f662b380f5ad46de03f9818f8c1f5ca0c4 Author: Elyes Haouas AuthorDate: 2023-11-07 17:14:17 +0000 Commit: Warner Losh CommitDate: 2024-04-29 03:30:55 +0000 usbconfig: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0]) Pull Request: https://github.com/freebsd/freebsd-src/pull/888 Signed-off-by: Elyes Haouas --- usr.sbin/usbconfig/usbconfig.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/usbconfig/usbconfig.c b/usr.sbin/usbconfig/usbconfig.c index 7d257fea52cd..e28f8de9f75c 100644 --- a/usr.sbin/usbconfig/usbconfig.c +++ b/usr.sbin/usbconfig/usbconfig.c @@ -36,7 +36,7 @@ #include #include #include -#include +#include #include #include @@ -210,7 +210,7 @@ get_token(const char *str, uint8_t narg) { uint8_t n; - for (n = 0; n != (sizeof(token) / sizeof(token[0])); n++) { + for (n = 0; n != nitems(token); n++) { if (strcasecmp(str, token[n].name) == 0) { if (token[n].narg > narg) { /* too few arguments */ From nobody Mon Apr 29 04:27:26 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VSVfk6pnBz5JBn3; Mon, 29 Apr 2024 04:27: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VSVfk3vCYz41S2; Mon, 29 Apr 2024 04:27:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714364846; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=N2/Gc6OAnXhl/scf9yxcJwGxBuI7+E7+2NzbPQbRUQs=; b=Gwx8BLNdg4Iw0Jz322qJJH6wNeOKR8lyxmxrDvD3JAyI2VMlFNKedXi9F6COhmnQSRpeO9 OXfZbHhv8XlKVJ+s6lqVBdl7OYW6JKrOiY48Xt4oRoAmS+o1IciGtF3Ro9/j87BCRp6FSD Fxi5yosJLiqVjrBahaj4X5PGClXQVuAOAS20DCEcPM9Ny/6tB+5CCRv0TcH3tykA8gzmU/ bNw+tpkxJLy9LfTXZNsgzVldYgR4vDKz2Zorj9GumA8l02n3jGLeB9oeldLgU07/h5TpBX c/MJ7VZglJHhZJwbqQc1Y9ZqRqtv5yJ9U4Ky3PxrNzFP4rPzw0KOppgI4uPjjw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714364846; a=rsa-sha256; cv=none; b=DStf9BEfqSRtDhpcKgIiq7i0dB+/87DZgfmymXnCaYAuXKXJUJoYgt/ZL8qVI9TmsnIfRb qmFZ5dZVjDCLwzXljoek4OJkuCvC5oXMpXxW8olW22v9ikhZVkE4kmPKifX5tyCBU+ZNIj sw472ZkVc7Wb4FxLSPGgT6vYqLajI27tkXwbeCc+c8wBYIuDz1Gh07lQkvWc1Mrs6ZsUM+ 3X3U8jYscjf1z0zdGJAnklL0L2AeIZ9jC6uwJIVgntFy89NC6XKS3CK19d8JgAT2r6Ttav 8jrnHQwpKeogSjq2XK5tZIcipOu98Xw3V2pQYxWKv22jGGHHCF5IWcGz556guw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714364846; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=N2/Gc6OAnXhl/scf9yxcJwGxBuI7+E7+2NzbPQbRUQs=; b=nUSptMZ+OD9A0Ebl4FX8ijG4N/q08I3j0M2W6frNnfa4JZgfqEC/SGFK8qGAXYqQQUvqsb qweVl5tM/K++e77CCe4rNhwjXdVmxtoNbZ+wwdcvTOIBFjbiVKu0ymc+/3pkedIlsYg1cq Iek5JtDpFCiFOm3FvBZwfAhHhrwUr50/ckTpqqnNSQO3kEStQQ+vqfpvE7HGEAYFqymN7f SbGy4zDaaMnQ944xTiEWZiPVjfR9Uih4NaUNIGy6BI5j4n1FOsedo3LAfvqforJa+3EnwH 2CQ5SoTWXoGZ6O9qjEGhy1ANwcjVDN8Z4zuxp+5bbtwTlIglA1P2MZVjogn8fg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VSVfk3GfDzv13; Mon, 29 Apr 2024 04:27:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43T4RQi3045053; Mon, 29 Apr 2024 04:27:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43T4RQHv045050; Mon, 29 Apr 2024 04:27:26 GMT (envelope-from git) Date: Mon, 29 Apr 2024 04:27:26 GMT Message-Id: <202404290427.43T4RQHv045050@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: cbfd42cc07cc - main - wlandebug: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0]) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: cbfd42cc07cc1b684a1d512e1265a1cd5e47e677 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=cbfd42cc07cc1b684a1d512e1265a1cd5e47e677 commit cbfd42cc07cc1b684a1d512e1265a1cd5e47e677 Author: Elyes Haouas AuthorDate: 2023-11-07 17:14:34 +0000 Commit: Warner Losh CommitDate: 2024-04-29 03:30:55 +0000 wlandebug: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0]) Pull Request: https://github.com/freebsd/freebsd-src/pull/888 Signed-off-by: Elyes Haouas --- usr.sbin/wlandebug/wlandebug.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/wlandebug/wlandebug.c b/usr.sbin/wlandebug/wlandebug.c index b44d82d8dd1d..b086de94eb2a 100644 --- a/usr.sbin/wlandebug/wlandebug.c +++ b/usr.sbin/wlandebug/wlandebug.c @@ -33,7 +33,7 @@ * wlandebug [-i interface] flags * (default interface is wlan.0). */ -#include +#include #include #include @@ -47,7 +47,7 @@ #include -#define N(a) (sizeof(a)/sizeof(a[0])) +#define N(a) nitems(a) const char *progname; From nobody Mon Apr 29 04:27:29 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VSVfp2QBdz5JBSP; Mon, 29 Apr 2024 04:27:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VSVfn75dKz41YB; Mon, 29 Apr 2024 04:27:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714364850; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tUhAKRFzCo61H5AbRRhJ5lpB1HNMV6+VNjwyNF67IGo=; b=LGQNWQdrle8AZq3gqdru7M9ohhhyiJQN2ElgCrR+IflVzjOO9VoykzB6P5DiQi/86lQXwY 1QdOKt/yQzVN2yVFKX3DUfSzlpqF6oWQ/xJSJjVu5Rjg65TkTtix5vAXkdcXVkwHzFyRTu 4XuMfsMWAMoh54BHej5we7VCFw3oqX5Pq5v1DMmB0x7jcsJVjfJuedcFx2BAQmYw2cbuKQ MlzzBSoSCk0fPpzxFloUxrosv3gZm3gN6lHHb0qxz1p3K17oe1irvIxABREXjrpivTvj4w zaeJ03mQSEnTNIpxGZr7eoPfuxnESHQmrNGa667OuEa01MchdqPUC3iABG6RjA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714364850; a=rsa-sha256; cv=none; b=uhTo2F9e1VCA3YrYLBIagOytbZnjscb6BLQ8wipZX2Hbgzm1UZmkyf6i6of4xStsEikY6k znNc44hf5rXsIhSE6BKa45LhBEtdcu18LLIkJuqWzf5Ertko6Rxyr3Vb2bnWYp3rys+sgJ Dg6VCLF57xrKKd7QuIypay7CunsgGYxk6Wgq4ZIeRbQ7GhO9JabnigjvWTdCcJVc2YghJG YHogh7JuFQcOlKMjpaorgKuw7W5619ko8r5gZH8o03X8nN1hSc0dyxNS5OqG/RIUIzX6MP +p0LE/ku5EOT9ZoBln1w9WYAlN0d+THxae1lFTnIn3Mh/cyIqpqqLvoWC4TJWQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714364850; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tUhAKRFzCo61H5AbRRhJ5lpB1HNMV6+VNjwyNF67IGo=; b=EvXvhM1ZIZ5jtUihBOZ+qqPf3mU1wcvoKOL8P4F3BWBPmGatxPHDAoX1IraaKaR0AHfrPW dded2hSyXO6QWrpSxbnqGl0xhvhpw5ee1U7+Tm02gZB924AcnCpRk6xTF6b0KxzxNGQ2RD 00R0lpjxXwwowPAu48jNaBzNgJ5IEqKA+kM4MHz5VaQ4cPmhDLzrylbpw7bx7vQlx/+Xdw 6s8q+OTxG3Rj3oDov13dtu2rYt6LTcmAc/RMnIr1nkzAtdnF1WudiXQNr283T+l0EjUxgh LgwvRbAGXH3ZPn2wP/Tf2A3aVZGR4jOOSbFxzBmQZCaAPq3+RSX8t59crrxdpg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VSVfn6T0Zztnf; Mon, 29 Apr 2024 04:27:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43T4RThP045194; Mon, 29 Apr 2024 04:27:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43T4RT17045191; Mon, 29 Apr 2024 04:27:29 GMT (envelope-from git) Date: Mon, 29 Apr 2024 04:27:29 GMT Message-Id: <202404290427.43T4RT17045191@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: 7028e630d611 - main - camcontrol: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0]) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 7028e630d6110789502cfc0f17b36b6f513ec297 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=7028e630d6110789502cfc0f17b36b6f513ec297 commit 7028e630d6110789502cfc0f17b36b6f513ec297 Author: Elyes Haouas AuthorDate: 2023-11-07 17:37:33 +0000 Commit: Warner Losh CommitDate: 2024-04-29 04:21:09 +0000 camcontrol: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0]) Pull Request: https://github.com/freebsd/freebsd-src/pull/888 Signed-off-by: Elyes Haouas --- sbin/camcontrol/attrib.c | 4 ++-- sbin/camcontrol/epc.c | 11 +++++------ sbin/camcontrol/zone.c | 7 +++---- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/sbin/camcontrol/attrib.c b/sbin/camcontrol/attrib.c index 7e89dbc3d48e..4cf9832756b4 100644 --- a/sbin/camcontrol/attrib.c +++ b/sbin/camcontrol/attrib.c @@ -36,7 +36,7 @@ #include #include #include -#include +#include #include #include #include @@ -265,7 +265,7 @@ scsiattrib(struct cam_device *device, int argc, char **argv, char *combinedopt, int entry_num = 0; status = scsi_get_nv(elem_type_map, - sizeof(elem_type_map) / sizeof(elem_type_map[0]), + nitems(elem_type_map), optarg, &entry_num, SCSI_NV_FLAG_IG_CASE); if (status == SCSI_NV_FOUND) element_type = elem_type_map[entry_num].value; diff --git a/sbin/camcontrol/epc.c b/sbin/camcontrol/epc.c index 206b34594f4f..4273ad19047c 100644 --- a/sbin/camcontrol/epc.c +++ b/sbin/camcontrol/epc.c @@ -33,10 +33,9 @@ * ATA Extended Power Conditions (EPC) support */ -#include +#include #include #include -#include #include #include #include @@ -151,7 +150,7 @@ epc_print_pcl_desc(struct ata_power_cond_log_desc *desc, const char *prefix) max_chars = 75; num_printed = printf("%sFlags: ", prefix); - for (i = 0; i < (sizeof(epc_flags) / sizeof(epc_flags[0])); i++) { + for (i = 0; i < nitems(epc_flags); i++) { if ((desc->flags & epc_flags[i].value) == 0) continue; if (first == 0) { @@ -466,7 +465,7 @@ check_power_mode: } mode_name = scsi_nv_to_str(epc_power_cond_map, - sizeof(epc_power_cond_map) / sizeof(epc_power_cond_map[0]), count); + nitems(epc_power_cond_map), count); printf("Current power state: "); /* Note: ident can be null in power_only mode */ if ((ident == NULL) @@ -638,7 +637,7 @@ epc(struct cam_device *device, int argc, char **argv, char *combinedopt, int entry_num; status = scsi_get_nv(epc_cmd_map, - (sizeof(epc_cmd_map) / sizeof(epc_cmd_map[0])), + nitems(epc_cmd_map), optarg, &entry_num, SCSI_NV_FLAG_IG_CASE); if (status == SCSI_NV_FOUND) action = epc_cmd_map[entry_num].value; @@ -715,7 +714,7 @@ epc(struct cam_device *device, int argc, char **argv, char *combinedopt, int entry_num; status = scsi_get_nv(epc_ps_map, - (sizeof(epc_ps_map) / sizeof(epc_ps_map[0])), + nitems(epc_ps_map), optarg, &entry_num, SCSI_NV_FLAG_IG_CASE); if (status == SCSI_NV_FOUND) power_src = epc_ps_map[entry_num].value; diff --git a/sbin/camcontrol/zone.c b/sbin/camcontrol/zone.c index d651ca0e2acf..dc87cd9a9570 100644 --- a/sbin/camcontrol/zone.c +++ b/sbin/camcontrol/zone.c @@ -34,10 +34,9 @@ * This is an implementation of the SCSI ZBC and ATA ZAC specs. */ -#include +#include #include #include -#include #include #include #include @@ -353,7 +352,7 @@ zone(struct cam_device *device, int argc, char **argv, char *combinedopt, int entry_num; status = scsi_get_nv(zone_cmd_map, - (sizeof(zone_cmd_map) / sizeof(zone_cmd_map[0])), + nitems(zone_cmd_map), optarg, &entry_num, SCSI_NV_FLAG_IG_CASE); if (status == SCSI_NV_FOUND) action = zone_cmd_map[entry_num].value; @@ -387,7 +386,7 @@ zone(struct cam_device *device, int argc, char **argv, char *combinedopt, int entry_num; status = scsi_get_nv(zone_rep_opts, - (sizeof(zone_rep_opts) /sizeof(zone_rep_opts[0])), + nitems(zone_rep_opts), optarg, &entry_num, SCSI_NV_FLAG_IG_CASE); if (status == SCSI_NV_FOUND) rep_option = zone_rep_opts[entry_num].value; From nobody Mon Apr 29 04:27:27 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VSVfm2FnWz5JBsF; Mon, 29 Apr 2024 04:27: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VSVfl5n1zz41Kd; Mon, 29 Apr 2024 04:27:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714364847; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2ExCi0D/MSWDkHuhwUWWtltvzcNBAi1+MinP2LdGsek=; b=Q0AelU7+GWSZvktB1y1ZdV6VT9x7xfUlD72FlSkiC/N6jPj/0rsrwbNtK0SU89Nh2W72dz fyyuL9aqcWJiZn6Uk4MBIgRYv+e6jp+ff1ELPxTY93+gR776ody8Bb0icAGnDuKCQFrA4U GQef6kJephX71zIsQ5FUQgP9yY7QRNcRzkCIy0X7mwbZzyJQx0rZmQ2sKTH/f7vtIotZJc OwHTNDMGA7H+5WC7+aS7+H4v8o0SVUtVhlajJhbcFEYygiQMduDYwJZfqXeSzPNPFTNSlW uxGm0g6xLsyXmPZQQ/0sb8EiG1NIYtijlHe4vRmZbKVbLex+HkGmiBrhC61bBg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714364847; a=rsa-sha256; cv=none; b=Q3e74NxiuAKYzFDBUHX+KSUddfUeYWwJ4NhYPTfGPmyDAqLfLPVWh1XJfP04rv26dP5bIJ l2lpVCp78z56i2oj/MZvoLsxgKJutSlyL/PrrfIbItBN7tYbcjv58xcOUV9qnv3WQc9JS2 KMmZ/gVC1/iXIi0t9oKQhffZBHlkIAyh+TWzZUqL6aDAN88CAQX0xiebeXRGPmH8YHU+ra cJof3BtPd46fIBX9ZwOpFbV4M+i60YOGAbutDqtV1gG1WpM+nzfrjwLRkorGqrqH16MnnW 6EFLb9XfiIf8+JuSF/yBNe8oHnoFDkyGVZGSl2onWFspC27GhXpmXwgp53zoCA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714364847; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2ExCi0D/MSWDkHuhwUWWtltvzcNBAi1+MinP2LdGsek=; b=ABMlyry897Fci/bPG1Wu5Eql6M1jGlnz209dC2uarmJlo3GL2kaN96zA0lHQQIqUFzAOes 9wVTN/zUYAgIXsBGOn51u8fQzfIIEUvvKUShvYjCdny1mOQA707JYEuo5fnFfCxJ2WJWRV q55HbRPRSJrXSv6RHwZxQAWI/itTQ1PSK7/j4Gr9DYKtgSDpaeiX83Z5tGfw6c3VEURl0r BityszkPre1/KnazS3Kglgh6rSmZByEIyT6desUlfcgQeA4tU4i4sNOE/h8ZQC4W/VS36d T9gPRKYwwpc/XLm9GfkIyDP1b2FrVbjOPerKXwFnFQPk2A74yX47UCGzM9X2Yg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VSVfl4GR6zv14; Mon, 29 Apr 2024 04:27:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43T4RRjX045098; Mon, 29 Apr 2024 04:27:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43T4RRph045095; Mon, 29 Apr 2024 04:27:27 GMT (envelope-from git) Date: Mon, 29 Apr 2024 04:27:27 GMT Message-Id: <202404290427.43T4RRph045095@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: b561d8f59c7d - main - zonectl: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0]) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: b561d8f59c7de56f5da576530961aaeea2d89875 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=b561d8f59c7de56f5da576530961aaeea2d89875 commit b561d8f59c7de56f5da576530961aaeea2d89875 Author: Elyes Haouas AuthorDate: 2023-11-07 17:14:45 +0000 Commit: Warner Losh CommitDate: 2024-04-29 03:30:55 +0000 zonectl: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0]) Pull Request: https://github.com/freebsd/freebsd-src/pull/888 Signed-off-by: Elyes Haouas --- usr.sbin/zonectl/zonectl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/zonectl/zonectl.c b/usr.sbin/zonectl/zonectl.c index 56cd3c436d10..53e5e6599597 100644 --- a/usr.sbin/zonectl/zonectl.c +++ b/usr.sbin/zonectl/zonectl.c @@ -32,8 +32,8 @@ #include #include +#include #include -#include #include #include #include @@ -401,7 +401,7 @@ main(int argc, char **argv) int entry_num; status = scsi_get_nv(zone_cmd_map, - (sizeof(zone_cmd_map) / sizeof(zone_cmd_map[0])), + nitems(zone_cmd_map), optarg, &entry_num, SCSI_NV_FLAG_IG_CASE); if (status == SCSI_NV_FOUND) action = zone_cmd_map[entry_num].value; From nobody Mon Apr 29 04:27:30 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VSVfq2sspz5JBnB; Mon, 29 Apr 2024 04:27: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VSVfq0cHWz41W9; Mon, 29 Apr 2024 04: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=1714364851; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YlIb79QTU4HZ3oybrh25hEslEMdgR2cUFhXYGZ2QdMc=; b=h2TBzUMIYQPj4JwVw/K1GjLisV0/5MvrwK84/clCDcE1Wovkg++N8WbooomW07AMhepeCH fRxG27vdnVpArz7Cac6tq9ON0dTAS8ABGOLCQOjilOJIW8UVWyMtGMrbwhmOC7kQzyP2pi 0KUL2z3Ex5gfyv7Qwy8Akv6K+O5Xacchk1VR7reztA1ncZok05xMYmgwplT87FekiX0RVt /sgZr6a7s+PRLxM06DM2zyaPBxCtTjqd4ApYHGss9/I0zb2BhZZYx1JA1CCcneUEzgSYgj 0SVBh6jsCY0vg8/TbXn8fvJLEQCSsdHgqknc42zaPLFkdU+6K7JuGOT2lIFQnQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714364851; a=rsa-sha256; cv=none; b=Nkymdi19AEMaHzY5087jfIBn4RY9CqtY7zddc5l7kcMthS7pcJV/s33aZdJAntdZX70jPj av9Ov2e+tfl1Jb78XRYcyYTudRWN5YjeaQ5hiv1gQufVa4Anr68rQ7j/ksr0SCzYAfomhc zqH4HKRqyCKWBshHYmmEYhfhZH3xThxmKHInmEiAlZ9eRelDF4j+Sef5Z2Yai7vke+byee bru5aM4Qpp39PqS/gUY3y4Nf+Svt5Q3ubLOB6/8whZcoLubr01jGcKCUgICtoiwxDizEmK 81wlgodFm+DNH4x/RnmD4G5fWoSCJfwQIkG3XmLohan0gpBm7bCAqlc0fYtv9w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714364851; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YlIb79QTU4HZ3oybrh25hEslEMdgR2cUFhXYGZ2QdMc=; b=qHp4CveJmgTY/xF0oaX6VuPtaAzDloSMl+KAXmpOXymfifNaRQ1rNQ+7EOG8LzQ14Cw+GE dG4GSshBbH2pFuSheP8TEVPC+bRY3CMX6AfeKzpH+kbk9oy1yrA9+JNP+SATCxDtZJUzO5 7jxMJS++jaDy2S0Yj7zHZz+F5l/ZeG9QQbXhzojZPZDdXoqSuY37ZZ5biBxZ28c4XaI/TG SccH86EoUoL3nfkkSdN6TkVONZ7X3J+inN94hGIDq0CsUvm9mF1behyyvkKRS+w1xpJ9e+ CiTE/vdNbrLwHokUZNr4G71Y7osn+C6wAX1gFmqE5HwD0Fu1+wdSJq3omYN7Dg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VSVfq02WHzvGg; Mon, 29 Apr 2024 04:27:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43T4RUH4045239; Mon, 29 Apr 2024 04:27:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43T4RUvB045236; Mon, 29 Apr 2024 04:27:30 GMT (envelope-from git) Date: Mon, 29 Apr 2024 04:27:30 GMT Message-Id: <202404290427.43T4RUvB045236@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: 70fad8acae73 - main - ipf: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0]) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 70fad8acae7324525df09b46e3ee2007f3ecf0fe Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=70fad8acae7324525df09b46e3ee2007f3ecf0fe commit 70fad8acae7324525df09b46e3ee2007f3ecf0fe Author: Elyes Haouas AuthorDate: 2023-11-07 17:38:03 +0000 Commit: Warner Losh CommitDate: 2024-04-29 04:21:09 +0000 ipf: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0]) Pull Request: https://github.com/freebsd/freebsd-src/pull/888 Signed-off-by: Elyes Haouas --- sbin/ipf/common/lexer.c | 5 +++-- sbin/ipf/libipf/facpri.c | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/sbin/ipf/common/lexer.c b/sbin/ipf/common/lexer.c index 5a898c72032d..d1980765ef93 100644 --- a/sbin/ipf/common/lexer.c +++ b/sbin/ipf/common/lexer.c @@ -10,6 +10,7 @@ # include "netinet/ip_scan.h" #endif #include +#include #include #ifdef TEST_LEXER # define NO_YACC @@ -675,7 +676,7 @@ yysetfixeddict(wordtab_t *newdict) if (yydebug) printf("yysetfixeddict(%lx)\n", (u_long)newdict); - if (yysavedepth == sizeof(yysavewords)/sizeof(yysavewords[0])) { + if (yysavedepth == nitems(yysavewords)) { fprintf(stderr, "%d: at maximum dictionary depth\n", yylineNum); return; @@ -694,7 +695,7 @@ yysetdict(wordtab_t *newdict) if (yydebug) printf("yysetdict(%lx)\n", (u_long)newdict); - if (yysavedepth == sizeof(yysavewords)/sizeof(yysavewords[0])) { + if (yysavedepth == nitems(yysavewords)) { fprintf(stderr, "%d: at maximum dictionary depth\n", yylineNum); return; diff --git a/sbin/ipf/libipf/facpri.c b/sbin/ipf/libipf/facpri.c index 9f66cedc7df5..9325a03c8dc3 100644 --- a/sbin/ipf/libipf/facpri.c +++ b/sbin/ipf/libipf/facpri.c @@ -10,7 +10,7 @@ #include #include #include -#include +#include #if !defined(__SVR4) && !defined(__svr4__) #include #endif @@ -76,7 +76,7 @@ fac_toname(int facpri) fac = facpri & LOG_FACMASK; j = fac >> 3; - if (j < (sizeof(facs)/sizeof(facs[0]))) { + if (j < nitems(facs)) { if (facs[j].value == fac) return (facs[j].name); } From nobody Mon Apr 29 04:27:28 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VSVfn27nnz5JBkQ; Mon, 29 Apr 2024 04:27: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VSVfm6MQ0z41Vl; Mon, 29 Apr 2024 04:27:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714364848; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ntqfUK6dFsivwWVOwy9eD3usXsQDSPzCgghLCtvxMZ0=; b=jTNcDadx5qcbMaSR4Th5SG+asChX6GOpw52ZPrFuqaDiA0u7FOhNaZabb+OIuCvDub32Kk 4BauZohKN9lIJpmCfUCZYJgBmoayWQd0QDIFY6SiPWaBM/8CoW3qZcMzEP86K9R9Oe71iP GXTMHCXovL1sKOuCh8gAWjlOsOmwo9a2Wzcw0x2R6hkBT141qlIW7I8MYiOQ56lmWTbqvT 3LKNxVBxhxWyCLVJpVsFxnwNEs0Xxl+hs8wJ9zomY3A/JijVbpF7M1X1xc98yzW/dQHp1L Ne1qiWs5oD4mW2Acv5G9J54OkOXpYzNzjxdVzWcn2/4sti1WxW4XSNWoCggWaw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714364848; a=rsa-sha256; cv=none; b=crr8l+xlmUnuu6LnANnjA31FJU9s/n/Xy4gsUXBjzrAFRnWBS6JTuxKuBCaZccTLd+V/tq F/lYjit2rABSqT1UYuU5SnhrHuUzMnsFmxp2Xn+5fYDNvwXRlCEkldC0ZvaOXadttT8Qtw kmXAZauizkxSrreGVZhAPzVnyIxCc90lGqqop3TIf88xA4m66zKHAFME0w6fOlvHwI43jN BtB5m9J0Wz5C503dgO0Xvz0idNsyezv99s0fPsg2SXnlZLMwer+JtznIgUwTVQTZeh22rc 2zN/3WWGwrKRpUrOmU0VROPss6B9ZjiwZFaKhiSsnMVQpInkijYKDOHjvzQERQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714364848; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ntqfUK6dFsivwWVOwy9eD3usXsQDSPzCgghLCtvxMZ0=; b=o0qAUdxAmJ2kT37AV4z5bu1BUrxMUpvKp2ChvQSbKCQsrX2zGT5HGBF8kBeECkrsLt8B/F MLxOdRG4+iSYE0Vqa5aTzNsschbpDJ/tkTc0LUaVwCyWMZcEi0tqm5JtePG7aw6eggypcA YpAALfgjqzXlG4qW3QmzlREJlDLLO3VWht6eao/RcQ6vLvKOQR6ZOOgS8xUzXAOkUFFa/J ZbEUrlic0XG7D7f6RG5A2jivueLnSfmHmqIpqYI+XD3b8bz01Ms3xrKsPjVm4AYte3MWC4 X+0I8u1PLXLaQTUPYGNzW3PV7XJ6B6F+S1pnjaAbe3nvafYKBp9QqDVEfXIWPA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VSVfm5bymztR9; Mon, 29 Apr 2024 04:27:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43T4RSjm045143; Mon, 29 Apr 2024 04:27:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43T4RSpI045140; Mon, 29 Apr 2024 04:27:28 GMT (envelope-from git) Date: Mon, 29 Apr 2024 04:27:28 GMT Message-Id: <202404290427.43T4RSpI045140@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: c3c816173d25 - main - ipfw: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0]) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: c3c816173d25fcb908a94c34b75fca98c5860f18 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=c3c816173d25fcb908a94c34b75fca98c5860f18 commit c3c816173d25fcb908a94c34b75fca98c5860f18 Author: Elyes Haouas AuthorDate: 2023-11-07 17:36:35 +0000 Commit: Warner Losh CommitDate: 2024-04-29 03:30:55 +0000 ipfw: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0]) Pull Request: https://github.com/freebsd/freebsd-src/pull/888 Signed-off-by: Elyes Haouas --- sbin/ipfw/dummynet.c | 4 ++-- sbin/ipfw/ipfw2.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sbin/ipfw/dummynet.c b/sbin/ipfw/dummynet.c index 9663e983b31a..6714b2af3124 100644 --- a/sbin/ipfw/dummynet.c +++ b/sbin/ipfw/dummynet.c @@ -22,7 +22,7 @@ #define NEW_AQM #include -#include +#include #include /* XXX there are several sysctl leftover here */ #include @@ -1401,7 +1401,7 @@ ipfw_config_pipe(int ac, char **av) */ if (p) p->bandwidth = -1; - for (j = 0; j < sizeof(fs->par)/sizeof(fs->par[0]); j++) + for (j = 0; j < nitems(fs->par); j++) fs->par[j] = -1; while (ac > 0) { double d; diff --git a/sbin/ipfw/ipfw2.c b/sbin/ipfw/ipfw2.c index 72927e336fa8..51eae7e8e246 100644 --- a/sbin/ipfw/ipfw2.c +++ b/sbin/ipfw/ipfw2.c @@ -4035,8 +4035,8 @@ compile_rule(char *av[], uint32_t *rbuf, int *rbufsize, struct tidx *tstate) rblen = *rbufsize / sizeof(uint32_t); rblen -= sizeof(struct ip_fw_rule) / sizeof(uint32_t); - ablen = sizeof(actbuf) / sizeof(actbuf[0]); - cblen = sizeof(cmdbuf) / sizeof(cmdbuf[0]); + ablen = nitems(actbuf); + cblen = nitems(cmdbuf); cblen -= F_INSN_SIZE(ipfw_insn_u32) + 1; #define CHECK_RBUFLEN(len) { CHECK_LENGTH(rblen, len); rblen -= len; } From nobody Mon Apr 29 04:27:32 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VSVfr4zqKz5JBvW; Mon, 29 Apr 2024 04: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VSVfr29RCz41dn; Mon, 29 Apr 2024 04: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=1714364852; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=T8qo+nIH7cJbOmrW1mvWMtnIlgZNXsPo7sCZVSTwZL4=; b=J+DuxbnWci3UUBKVZvEgTQRnpx69uYBkuUXszfKfKRstjZWxRNkOtEycnsJvCbBi0Murd0 whABl+Ue7LYfcPHGMbwZWH+3/EKl24d0Tf0eAIIqcJknt1eDvMV98thymWWNG/w2nPhawp TlneCfhHfHGCC33m77mz0UfReJSP/NMIV3mXQG++toafkjOwZo60B53iTz8c/mAQoKxtF7 Aehh3cnsvxtmQaryMofPkqmCmsS3bJGYeCMX8cS9FGK2z9DcohBP64Yr8MLoWdM3CGwl+e h3veK8moOCNkg9zfPJbu8JJSIk4arPJ3+Lhpg4+06lf5WmvaxYXcWxxfP9+jgQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714364852; a=rsa-sha256; cv=none; b=H4DT/a7TNYbRD9NutO8SFfWP5idqB7dP/f4rAK+CN8gGMKBn3q0Gnd6bflo4W1MbVUVkBE 3X6o9JXUlWnrbLW+cHOfzTzPfWTw9/tu4gThujV+eYV0G5GRLJmNGL2bhGkvDyjs5+oiW1 IOpG1KBclvK99hy9EjwTb1ZF7z56yoEKQ0pezacXBS40dIPceWDgCSCXKGJYAoagGtztAS BdC+pqkgmFKNFQ9uYdGjUDQkyDqyMV5xkuJw6ZrW+/7cAnd0cWpnCh/WcU0bEtGcpp8D15 +xnEg0XXNTkhCnxgdP7m6OQWe51JVX+oa4Nu1M36N1wm/llg50tgVp/VgflGOg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714364852; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=T8qo+nIH7cJbOmrW1mvWMtnIlgZNXsPo7sCZVSTwZL4=; b=Df74L7WvSBffRbVkc7te/d9vK0e7GYNc+04wokRInqAk9e6vVOEbyQgkgirLwwzTJkK7yL +zchPYKtn2ATbDBkWbbwGBuRE6BBglQVQk1EsG8OmiCjIKbOW7t2K59Az1sQKyngMgq7qs V15Ket1V10uN0K0MONggfR2MQRMnPEDE5Rlhd/fDQ1CQf/lIxcU57JssLkr/ZP8FrxQ/Jp KR9aZt3ewKPwlTBu0KTtbCJeeVzxVMGzucA173PKXA5qg25x4YINiPDBdGooUa5uQ8eqJD cyH+2dswhwxp83qmI1yuFxtGRxSOnAhIrAoMoDD9BHN8FPZcDMHHmxC3wkDJ8A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VSVfr1Qydzv15; Mon, 29 Apr 2024 04:27:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43T4RWI4045284; Mon, 29 Apr 2024 04:27:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43T4RWau045281; Mon, 29 Apr 2024 04:27:32 GMT (envelope-from git) Date: Mon, 29 Apr 2024 04:27:32 GMT Message-Id: <202404290427.43T4RWau045281@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: d94c991f3bcd - main - setkey: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0]) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: d94c991f3bcd31b7d001725152fc3a7685afe15b Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=d94c991f3bcd31b7d001725152fc3a7685afe15b commit d94c991f3bcd31b7d001725152fc3a7685afe15b Author: Elyes Haouas AuthorDate: 2023-11-07 17:38:15 +0000 Commit: Warner Losh CommitDate: 2024-04-29 04:21:09 +0000 setkey: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0]) Pull Request: https://github.com/freebsd/freebsd-src/pull/888 Signed-off-by: Elyes Haouas --- sbin/setkey/setkey.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/setkey/setkey.c b/sbin/setkey/setkey.c index d9b905ad845e..f7268d8f1e10 100644 --- a/sbin/setkey/setkey.c +++ b/sbin/setkey/setkey.c @@ -502,7 +502,7 @@ static const char *ipproto[] = { }; #define STR_OR_ID(x, tab) \ - (((x) < sizeof(tab)/sizeof(tab[0]) && tab[(x)]) ? tab[(x)] : numstr(x)) + (((x) < nitems(tab) && tab[(x)]) ? tab[(x)] : numstr(x)) const char * numstr(int x) From nobody Mon Apr 29 04:34:25 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VSVpp1b7Cz5JCfP; Mon, 29 Apr 2024 04:34: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VSVpp0zJhz47BL; Mon, 29 Apr 2024 04:34:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714365266; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tneGNMleiNf5tt32126Up3maClgEWG3Jrz64egE8YFQ=; b=aFxyxQrz/Z+KbGifTQnYuG3vVWRav8WXPrt5hWcfJott/iYhxYSu3kDTpsQSLnfXc1ga/z 5YYJziiVeDtbUEzeUT2kcaq7lZS7L9/m9OuPXaAUOx9K1IZXSi13N5o1taKNPboQgvm94F DIKeyNngsjg/bPx/Oo5Fd0cvXcZvAZ2xYGpVJXnvONELU4wowkho0L+eOySurp//lvPnFm UKquCbb34dxCWHaZvTQ1BCtoKJ6C5XIBEsC1JTAs3UDqkt9b77v0lsM5P/yvX5cVxo6SDw jsslealjcjTbGG+QshmVoSM5/s3A5uO5UU/9Bq1MmM1WgZdMkEtjmcDXc+inlA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714365266; a=rsa-sha256; cv=none; b=Bad/4t9EIpur4nNt0sDwDxQywm1d7LV+dJfsM9FX3HLeclaqCkxk1HnyqSeCNGkPVuRquA d6iErQNBewZOHChtQAyn8gtSLGhKtAf9JK4eRdVvT7D/CMc4pXH2+2Fo98yNGKmA1QxPx2 n4ur6AJUOQ0qDkb7maBtuEKqBPc+7o/n7nRuYXMmiAIfMbfZr/HZ3PUYqHGhY7DfcUbsTM 5k5+TGysQYMHvwCiqBTtjX96RBDCny177P4tHmD3uT6gZJxBOUT/UYGB5l3enQ3Pf4GtgR lyVtKbyUA8+31WtmrqbVpA+Bk0nEEo63XvlLBZ9esddE42v2ZgOspoXPFIw5XQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714365266; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tneGNMleiNf5tt32126Up3maClgEWG3Jrz64egE8YFQ=; b=KgO1F85Udbot9aTW5PqKauV77RDR8jGyyf/0rUYrJwG06EHoJqAtslKrO6x7uV2StYg4N1 MBJpE4S98UuaPBJG8+EeJCjiHjLVpA9CkHVs4qNbkJrrEuVcv0belfnp7Duw9itnKNyFkV 40m7IBAPvpqg6i1gSU9Tc1BczyBXAfUroY1oPeeZ5J1MKU/HD7u71LJFU1b2t+CKS0W1NI RPDaNIw/rWfvn7B4W4qXg+iWVOcRMp/nZyK1XR5/ZLe1/wwADuG8DR98X0egqn44OJAEgr ZwDl3Dlk6KoSHA+LFIdJuYTeTsZEQ2n3Ik3VnfxHCr1/D4rCYrXTiNq1eUD7tg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VSVpp0ZtpzvJ7; Mon, 29 Apr 2024 04:34:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43T4YPlb061438; Mon, 29 Apr 2024 04:34:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43T4YPHN061435; Mon, 29 Apr 2024 04:34:25 GMT (envelope-from git) Date: Mon, 29 Apr 2024 04:34:25 GMT Message-Id: <202404290434.43T4YPHN061435@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: 0c0a2110f196 - main - package: move authpf into the FreeBSD-pf package List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 0c0a2110f196011e083b6e392c6d6a0a1893eebb Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=0c0a2110f196011e083b6e392c6d6a0a1893eebb commit 0c0a2110f196011e083b6e392c6d6a0a1893eebb Author: Lexi Winter AuthorDate: 2024-04-29 04:31:02 +0000 Commit: Warner Losh CommitDate: 2024-04-29 04:33:02 +0000 package: move authpf into the FreeBSD-pf package Reviewed by: imp, manu Pull Request: https://github.com/freebsd/freebsd-src/pull/1198 --- usr.sbin/authpf/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/usr.sbin/authpf/Makefile b/usr.sbin/authpf/Makefile index aa6c6e1058a5..44cd1838af7f 100644 --- a/usr.sbin/authpf/Makefile +++ b/usr.sbin/authpf/Makefile @@ -1,6 +1,7 @@ .PATH: ${SRCTOP}/contrib/pf/authpf +PACKAGE=pf PROG= authpf MAN= authpf.8 BINOWN= root From nobody Mon Apr 29 04:34:27 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VSVpq2bdFz5JCdR; Mon, 29 Apr 2024 04:34: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VSVpq21Ccz47Dh; Mon, 29 Apr 2024 04:34:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714365267; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qE+ym7ssiXCh/ckK2nUzbMe0SLHFa0IBt6PRnNJyydU=; b=Mxu8873H9/279Atnznf9em4PvnAP4TZBvZbBsjFZVurnwnZdqMdXu0XBDnsEd2Oy/CnIm/ PohCJKYY9Pj0+S3R3AXd7yG0JwlRBXPS1L4DeW4hRlTQVE00JOHf2kK6rtvlLsIXbN336q 7rumT1TEnV5qqj7ymC52pfxLzrfaRVdC2GpBLcru8XE5oNjzKlY4U+dLzzJCpWg3k1vvQY F9C1o7A/K6Ql9UxvvwiAY14CY20pHV00Y6mxnq4+m4L4MqrLGvcQCPmA9Sy+T2J4bpleDF HwHsNbKGWHxcdNHI5G4j0gNTHpDmL6Tfb7iblKzehFSzZcCWISGqEAwLqzV6wQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714365267; a=rsa-sha256; cv=none; b=qX6p9UE8NCKh1RgGy8vIyih9vrQRY+qo4C+S8OTklrR/YeUvvCdMjlNmfGG/mFcEax7IaY 3qx2dnHT2/hSt0tJlcLTloMvcuNoQsN6+PXYfBdhdmy1r3vrBRsq1Ge1aUcqKXioXWi4us eh7kpciyT8lix2+EJlKGBKC9kNz8VT2WWqOMTQkFGfsa5z/qjkNs0QxZ0tTu091bKpbSBm DhrsQvydO39+nJTCR2FkOWzRlbC57kmWKDMxtdJPszFhzS8Q/9tqI+5GtFwMHZVP8zNqMs mc5UC7Xm1Perpbl7VPmID8pWy7lUIIUdnkDy2KBXGOk39l28UfCI/K/LUH8BHg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714365267; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qE+ym7ssiXCh/ckK2nUzbMe0SLHFa0IBt6PRnNJyydU=; b=IWAtJSE87tAYVp/49mwOfQQ+CunhDYIPmpfBwOvVkEosbcY7w3qb+aiDB2NNs2E0EkGbDL +mFn32wRfVuOBGHKNHtwnO5rCULk4ANky12fAR7ugQg8HPOBF0qNNF6iH6mRBB7wi4QIuP fpSQa7NyuRNpGHt9V5aD2HWU6wYQPa5fLUxHG0xkwF13OcGFXJ+KA3HDrq364u5vxJisdY wymLX7Pw+JDZXvVO0T29X6PumQ3ee+dxHOzZ4MdCpcCMje6Waf5s+P52d9uEeGczi/HjtC +fkBGo9LBjTGxQaoiJ7Cn8A8ML+ZkeO4c8lD0iohvBErWx+/nNl7OcvUJD0Lmg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VSVpq1dGHzvJ8; Mon, 29 Apr 2024 04:34:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43T4YRXR061489; Mon, 29 Apr 2024 04:34:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43T4YRDh061486; Mon, 29 Apr 2024 04:34:27 GMT (envelope-from git) Date: Mon, 29 Apr 2024 04:34:27 GMT Message-Id: <202404290434.43T4YRDh061486@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: 1b3c07bed63c - main - package: move OpenBSM auditing into its own package List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 1b3c07bed63c045cf75e18ff053443cabee2360f Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=1b3c07bed63c045cf75e18ff053443cabee2360f commit 1b3c07bed63c045cf75e18ff053443cabee2360f Author: Lexi Winter AuthorDate: 2024-04-24 17:54:44 +0000 Commit: Warner Losh CommitDate: 2024-04-29 04:33:06 +0000 package: move OpenBSM auditing into its own package Move auditing runtime (auditd, etc.) into the new FreeBSD-audit package. Also move the runtime OpenBSM manual pages from libbsm into auditd so they get installed with the right package. Add an UPDATING entry noting the new packages. Reviewed by: imp, manu Pull Request: https://github.com/freebsd/freebsd-src/pull/1197 --- UPDATING | 5 +++++ lib/libauditd/Makefile | 1 + lib/libbsm/Makefile | 6 ------ libexec/rc/rc.d/Makefile | 2 +- release/packages/Makefile.package | 2 ++ usr.sbin/audit/Makefile | 1 + usr.sbin/auditd/Makefile | 11 ++++++++++- usr.sbin/auditdistd/Makefile | 1 + usr.sbin/auditreduce/Makefile | 1 + usr.sbin/praudit/Makefile | 1 + 10 files changed, 23 insertions(+), 8 deletions(-) diff --git a/UPDATING b/UPDATING index 0c0134022861..98d8b58dcd20 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".) +20240428: + OpenBSM auditing runtime (auditd, etc.) has been moved into the new + package FreeBSD-audit. If you use OpenBSM auditing and pkgbase, you + should install FreeBSD-audit. + 20240424: cron, lpr, and ntpd have been moved from FreeBSD-utilities into their own packages. If you use pkgbase, you should install the relevant diff --git a/lib/libauditd/Makefile b/lib/libauditd/Makefile index 26da06489d05..76ffb70bbe25 100644 --- a/lib/libauditd/Makefile +++ b/lib/libauditd/Makefile @@ -5,6 +5,7 @@ OPENBSMDIR= ${SRCTOP}/contrib/openbsm _LIBAUDITDDIR= ${OPENBSMDIR}/libauditd _LIBBSMDIR= ${OPENBSMDIR}/libbsm +PACKAGE= audit LIB= auditd .PATH: ${_LIBAUDITDDIR} diff --git a/lib/libbsm/Makefile b/lib/libbsm/Makefile index 54af604eaa8e..67802eef62ac 100644 --- a/lib/libbsm/Makefile +++ b/lib/libbsm/Makefile @@ -60,12 +60,6 @@ MAN= libbsm.3 \ # they're not all libbsm parts. # MAN+= audit.2 \ - audit.log.5 \ - audit_class.5 \ - audit_control.5 \ - audit_event.5 \ - audit_user.5 \ - audit_warn.5 \ auditctl.2 \ auditon.2 \ getaudit.2 \ diff --git a/libexec/rc/rc.d/Makefile b/libexec/rc/rc.d/Makefile index 6e9cb7fc50ae..9a04400e2924 100644 --- a/libexec/rc/rc.d/Makefile +++ b/libexec/rc/rc.d/Makefile @@ -167,7 +167,7 @@ APMPACKAGE= apm CONFGROUPS+= AUDIT AUDIT+= auditd AUDIT+= auditdistd -AUDITPACKAGE= rc +AUDITPACKAGE= audit .endif .if ${MK_AUTOFS} != "no" diff --git a/release/packages/Makefile.package b/release/packages/Makefile.package index 2c0aa259737d..aed7746e690f 100644 --- a/release/packages/Makefile.package +++ b/release/packages/Makefile.package @@ -11,6 +11,8 @@ apm_COMMENT= APM Utilities apm_DESC= APM Utilities at_COMMENT= AT Utilities at_DESC= AT Utilities +audit_COMMENT= OpenBSM auditing utilities +audit_DESC= OpenBSM auditing utilities autofs_COMMENT= Autofs Utilities autofs_DESC= Autofs Utilities bhyve_COMMENT= Bhyve Utilities diff --git a/usr.sbin/audit/Makefile b/usr.sbin/audit/Makefile index 55ddfa4bc9a5..82b21081a97d 100644 --- a/usr.sbin/audit/Makefile +++ b/usr.sbin/audit/Makefile @@ -6,6 +6,7 @@ OPENBSMDIR=${SRCTOP}/contrib/openbsm CFLAGS+= -I${OPENBSMDIR} +PACKAGE=audit PROG= audit MAN= audit.8 diff --git a/usr.sbin/auditd/Makefile b/usr.sbin/auditd/Makefile index b13ff5355c4b..a381b5e7a60b 100644 --- a/usr.sbin/auditd/Makefile +++ b/usr.sbin/auditd/Makefile @@ -3,6 +3,7 @@ OPENBSMDIR=${SRCTOP}/contrib/openbsm .PATH: ${OPENBSMDIR}/bin/auditd +.PATH: ${OPENBSMDIR}/man CFLAGS+= -I${OPENBSMDIR} @@ -18,9 +19,17 @@ CONFSMODE_${OPENBSMETCDIR}/audit_user= 600 CONFS+= ${OPENBSMETCDIR}/audit_warn CONFSMODE_${OPENBSMETCDIR}/audit_warn= 500 CONFSDIR= /etc/security + +PACKAGE=audit PROG= auditd SRCS= auditd.c audit_warn.c auditd_fbsd.c -MAN= auditd.8 +MAN= auditd.8 \ + audit.log.5 \ + audit_class.5 \ + audit_control.5 \ + audit_event.5 \ + audit_user.5 \ + audit_warn.5 LIBADD= auditd bsm diff --git a/usr.sbin/auditdistd/Makefile b/usr.sbin/auditdistd/Makefile index 9bfa3c444922..8b3c7dd7f87c 100644 --- a/usr.sbin/auditdistd/Makefile +++ b/usr.sbin/auditdistd/Makefile @@ -13,6 +13,7 @@ CFLAGS+=-DOPENSSL_API_COMPAT=0x10100000L NO_WFORMAT= NO_WMISSING_VARIABLE_DECLARATIONS= +PACKAGE=audit PROG= auditdistd SRCS= auditdistd.c SRCS+= parse.y pjdlog.c diff --git a/usr.sbin/auditreduce/Makefile b/usr.sbin/auditreduce/Makefile index 66bc55af87a9..566b36712782 100644 --- a/usr.sbin/auditreduce/Makefile +++ b/usr.sbin/auditreduce/Makefile @@ -6,6 +6,7 @@ OPENBSMDIR=${SRCTOP}/contrib/openbsm CFLAGS+= -I${OPENBSMDIR} +PACKAGE=audit PROG= auditreduce MAN= auditreduce.1 diff --git a/usr.sbin/praudit/Makefile b/usr.sbin/praudit/Makefile index 2eb78dddf292..bb4c0fdf3258 100644 --- a/usr.sbin/praudit/Makefile +++ b/usr.sbin/praudit/Makefile @@ -8,6 +8,7 @@ OPENBSMDIR=${SRCTOP}/contrib/openbsm CFLAGS+= -I${OPENBSMDIR} +PACKAGE=audit PROG= praudit MAN= praudit.1 From nobody Mon Apr 29 04:34:24 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VSVpn1L0Sz5JCLV; Mon, 29 Apr 2024 04:34: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VSVpn0dVyz47GW; Mon, 29 Apr 2024 04:34:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714365265; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xOftiuJN206W48P4hNmVz6t8bp+fZekYShXLuq98jN8=; b=cbYeXp69TW9f5oOiOBKZNU6IbHk/v6Cen3l2bXJjZ8wVWL/QXAKdMvtzt/PafKRuy6rxvw 6qkQLsnHQkm52ge43H76EUQ8dVjGlSKMXbFFsq/VFOfv4xr8k3GAco6Ygtqx/a/eJLgpIv KvYwv90UUSsPm8NdcCvW7jumvjEy83P/nnJqyBus1/bwPUyRryAp3bJww9kQNIm27CED/K X4Tuk/8tkZICwinX72lpv6zHqnzFpi0+PlKXCEannXn67x2UHF7t2F/5hp11yaA7YGzxSd /P3OmojCWHjz64KhY5JzNH143RIFjuC7/HUuoIy7uk22BAeHRJ9q+15URNVo5g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714365265; a=rsa-sha256; cv=none; b=J87Ov4nHIRhot/wSmK5YL4gVRPiqBxWN7ZIEz3cXmQ6R+PeTJ81BaGSKZeCVsIDUbtj6fW EkPs/Pj779zUnk1Uz2E953+nAAfa+Ri3vHupoWhNx/zuPn4XvHegLonPz3jKWrp6ALK5BI rKdrbiA2z+izsXU43QEBuHFUGoctFBcSr5Tyl0YPs1DyZ5jjvLJJ4swmPNhRVfzLflFDb5 MqRjc5Y4sNIxvoKDwNQEofIYjU3uz+DJIu2FFVwAPGjh7Lp4QH+OfDR6NKz0XLAKE8ZYEl 8Tck4wUTo7Zog4O5ucpAVUEbob6TYzx03RCyF8ZCL8oBf/zxRN/CotbXnQVVUg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714365265; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xOftiuJN206W48P4hNmVz6t8bp+fZekYShXLuq98jN8=; b=sLge0J58A/bj9iyueieTh8kPQwL/hBdRoe39QO34owcTAUZcyg1QkPMUjYce0rye06oHC6 d1Zut3FsS22RkRIYTCk9aED/9vg9p1V1h22QFmsto1j2v5pKv1rT0UsxSypLk3V7U4vr/t AI0lJPCBPg9UTg3TO/xTfmjeT7Uh59U86lZuX06acMGKfFxKnFHfIpqOX/K0MTrNhGi79i 5An65urfGEAXnB6lSLpfSnIjwQd/4rJd+8qxY+zhRPFHs39N2NyknqL/S7s/8Jjg6VOlJz tYyv4INaKODvBUZ9rRbtRnPd0qmBQib2h38LZzG0uWOo6VyQjqGMCoUjpY5MSQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VSVpn06VhzvJ6; Mon, 29 Apr 2024 04:34:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43T4YOWQ061390; Mon, 29 Apr 2024 04:34:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43T4YOX3061387; Mon, 29 Apr 2024 04:34:24 GMT (envelope-from git) Date: Mon, 29 Apr 2024 04:34:24 GMT Message-Id: <202404290434.43T4YOX3061387@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: 6b1d152d892d - main - UPDATING: add entry for recent pkgbase changes List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 6b1d152d892d481986bd650e3806724718fe6970 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=6b1d152d892d481986bd650e3806724718fe6970 commit 6b1d152d892d481986bd650e3806724718fe6970 Author: Lexi Winter AuthorDate: 2024-04-29 04:28:49 +0000 Commit: Warner Losh CommitDate: 2024-04-29 04:32:55 +0000 UPDATING: add entry for recent pkgbase changes Reviewed by: imp, manu Pull Request: https://github.com/freebsd/freebsd-src/pull/1196 --- UPDATING | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/UPDATING b/UPDATING index aae30936a8b5..0c0134022861 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".) +20240424: + cron, lpr, and ntpd have been moved from FreeBSD-utilities into their + own packages. If you use pkgbase, you should install the relevant + packages: FreeBSD-cron, FreeBSD-lp, or FreeBSD-ntp. + 20240205: For dynamically linked programs, system calls are now made from libsys rather than libc. No change in linkage is required as From nobody Mon Apr 29 04:40:59 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VSVyM4xNXz5JD4G; Mon, 29 Apr 2024 04:40: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VSVyM4Flvz49FL; Mon, 29 Apr 2024 04:40:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714365659; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wLdKmdJQghIa2ToWPdnbmoq1v8YpYUwGdhpHXNyusx8=; b=R2EqaDsg3aDTJx4bMAP7yqB22lg39O1U/VeyPhjySHxX1PZ90ybunvY6OGkMDKz/82IMVJ PTGW2xU8pzW8aFq4EQDzlL9C66g5p8ipeRnI/zwJVZaFxU6KlNne+Q4i+Axyuk4JocQ2L1 5MV1o1lSszN5x37sOQdwsZW24YUxU7r0KwxQba74vDG1ETWlx6HKRIabFy0doiXhjqlWsQ q1cbpjl5ZEasxkCfxeydqS4xkCPkTVMArs3GdHofmT+8CXp+iCfLrB4FQ5nTLkhUgEuGcG tq+x15Xqx/hcJiQWmKfcXNsBpo5X4bHTklF0HD5MQKl2XWXLd9UfWwKMTgHOBA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714365659; a=rsa-sha256; cv=none; b=QJbGi1/A0NhBe4IVnNEbyjRIGZGEkcctCg9r8KzXK1T0V5qTRjvwJg+UxYFe/fc6mJSMm4 SvWjc/+FRwy+QBStoAP5Nj7NOUY4sSVWIsAGP68fJ4jMTCmoSU+xv//bdPlwHiHUFCxu6b zS7zBxOytWLaO+wTFR1wkWI5jwsX1emzfJCEx7psouOUVCAIumJ0wMQWx9bktGn7ofPxc1 7CpROY5i25PcMgoqg5lut9vaHkttUKYblOUcX2jGe85A4/W/iPnhPb3ucUdylNk5PpJ/dV d89FcqG1VvTjOp4poqqwU6NMDJvmrjDNyd3IqgIv9wQxEx5MpDGZpEcmXgixGw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714365659; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wLdKmdJQghIa2ToWPdnbmoq1v8YpYUwGdhpHXNyusx8=; b=OotyuMw+jvy9C17s96U/ePnuXLZeNx6kZOgf0EWft7kIwifp8eeSuARJtF8qRZlhCWFc3T 6Vj2T3YfV6wzfmI3OFONGLt1Gj7/0T2haaK0/b6gKHaQGHST9VFY0UjTSRmkO5n+wGQLgX XT81fK+1ao7RaDs8ljrJAX3qW1yXlnxizfY6KAGlFNBNPW2sUAL3lxCJuIO8c/YeVps1II Q+2deINSw0rAddRpOozhctoBNZ6KPC135JxredJKgJLlhZ0ZCKpVtz/haI2vIsLemXdj+X N1d7VYOetoLbDSvGYnlRfCabiwOqPA30vdxzV0TAcr/G5mpdDCn7mHMr9oepYw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VSVyM3qr6zvL2; Mon, 29 Apr 2024 04:40:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43T4excn072241; Mon, 29 Apr 2024 04:40:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43T4exw9072238; Mon, 29 Apr 2024 04:40:59 GMT (envelope-from git) Date: Mon, 29 Apr 2024 04:40:59 GMT Message-Id: <202404290440.43T4exw9072238@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: 78444b5ade65 - main - glabel: Add support for Linux swap List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 78444b5ade65568d817ecc3cfa5d66e05edf2b14 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=78444b5ade65568d817ecc3cfa5d66e05edf2b14 commit 78444b5ade65568d817ecc3cfa5d66e05edf2b14 Author: Ricardo Branco AuthorDate: 2024-04-29 04:38:15 +0000 Commit: Warner Losh CommitDate: 2024-04-29 04:39:47 +0000 glabel: Add support for Linux swap Reviewed by: imp, kib Pull Request: https://github.com/freebsd/freebsd-src/pull/1205 --- lib/geom/label/glabel.8 | 3 ++ sys/conf/files | 1 + sys/geom/label/g_label.c | 1 + sys/geom/label/g_label.h | 1 + sys/geom/label/g_label_swaplinux.c | 91 ++++++++++++++++++++++++++++++++++++ sys/modules/geom/geom_label/Makefile | 1 + 6 files changed, 98 insertions(+) diff --git a/lib/geom/label/glabel.8 b/lib/geom/label/glabel.8 index a133b4abff72..6b089172348f 100644 --- a/lib/geom/label/glabel.8 +++ b/lib/geom/label/glabel.8 @@ -115,6 +115,9 @@ EXT2FS (directory .It NTFS (directory .Pa /dev/ntfs/ ) . +.It +Swap Linux (directory +.Pa /dev/swaplinux/ ) . .El .Pp Support for partition metadata is implemented for: diff --git a/sys/conf/files b/sys/conf/files index ef0a56eb8b45..326260ffb1dc 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -3648,6 +3648,7 @@ geom/label/g_label_ntfs.c optional geom_label geom/label/g_label_ufs.c optional geom_label geom/label/g_label_gpt.c optional geom_label | geom_label_gpt geom/label/g_label_disk_ident.c optional geom_label +geom/label/g_label_swaplinux.c optional geom_label geom/linux_lvm/g_linux_lvm.c optional geom_linux_lvm geom/mirror/g_mirror.c optional geom_mirror geom/mirror/g_mirror_ctl.c optional geom_mirror diff --git a/sys/geom/label/g_label.c b/sys/geom/label/g_label.c index e20e5b50e80b..acb17d40914e 100644 --- a/sys/geom/label/g_label.c +++ b/sys/geom/label/g_label.c @@ -104,6 +104,7 @@ const struct g_label_desc *g_labels[] = { &g_label_ntfs, &g_label_disk_ident, &g_label_flashmap, + &g_label_swaplinux, #endif &g_label_generic, NULL diff --git a/sys/geom/label/g_label.h b/sys/geom/label/g_label.h index 69bfbf3910a1..0d8951f7c99d 100644 --- a/sys/geom/label/g_label.h +++ b/sys/geom/label/g_label.h @@ -78,6 +78,7 @@ extern struct g_label_desc g_label_gpt; extern struct g_label_desc g_label_gpt_uuid; extern struct g_label_desc g_label_disk_ident; extern struct g_label_desc g_label_flashmap; +extern struct g_label_desc g_label_swaplinux; extern void g_label_rtrim(char *label, size_t size); #endif /* _KERNEL */ diff --git a/sys/geom/label/g_label_swaplinux.c b/sys/geom/label/g_label_swaplinux.c new file mode 100644 index 000000000000..5994ad93fd6f --- /dev/null +++ b/sys/geom/label/g_label_swaplinux.c @@ -0,0 +1,91 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + */ + +#include +#include +#include +#include + +#include +#include +#include + +/* + * Taken from + * https://github.com/util-linux/util-linux/blob/master/include/swapheader.h + */ + +#define SWAP_VERSION 1 +#define SWAP_UUID_LENGTH 16 +#define SWAP_LABEL_LENGTH 16 +#define SWAP_SIGNATURE "SWAPSPACE2" +#define SWAP_SIGNATURE_SZ (sizeof(SWAP_SIGNATURE) - 1) + +struct swap_header_v1_2 { + char bootbits[1024]; /* Space for disklabel etc. */ + uint32_t version; + uint32_t last_page; + uint32_t nr_badpages; + unsigned char uuid[SWAP_UUID_LENGTH]; + char volume_name[SWAP_LABEL_LENGTH]; + uint32_t padding[117]; + uint32_t badpages[1]; +}; + +typedef union { + struct swap_header_v1_2 header; + struct { + uint8_t reserved[PAGE_SIZE - SWAP_SIGNATURE_SZ]; + char signature[SWAP_SIGNATURE_SZ]; + } tail; +} swhdr_t; + +#define sw_version header.version +#define sw_volume_name header.volume_name +#define sw_signature tail.signature + +static void +g_label_swaplinux_taste(struct g_consumer *cp, char *label, size_t size) +{ + struct g_provider *pp; + swhdr_t *hdr; + + g_topology_assert_not(); + pp = cp->provider; + label[0] = '\0'; + + KASSERT(pp->sectorsize != 0, ("Tasting a disk with 0 sectorsize")); + if ((PAGE_SIZE % pp->sectorsize) != 0) + return; + + hdr = (swhdr_t *)g_read_data(cp, 0, PAGE_SIZE, NULL); + if (hdr == NULL) + return; + + /* Check version and magic string */ + if (hdr->sw_version == SWAP_VERSION && + !memcmp(hdr->sw_signature, SWAP_SIGNATURE, SWAP_SIGNATURE_SZ)) + G_LABEL_DEBUG(1, "linux swap detected on %s.", pp->name); + else + goto exit_free; + + /* Check for volume label */ + if (hdr->sw_volume_name[0] == '\0') + goto exit_free; + + /* Terminate label */ + hdr->sw_volume_name[sizeof(hdr->sw_volume_name) - 1] = '\0'; + strlcpy(label, hdr->sw_volume_name, size); + +exit_free: + g_free(hdr); +} + +struct g_label_desc g_label_swaplinux = { + .ld_taste = g_label_swaplinux_taste, + .ld_dirprefix = "swaplinux/", + .ld_enabled = 1 +}; + +G_LABEL_INIT(swaplinux, g_label_swaplinux, "Create device nodes for Linux swap"); diff --git a/sys/modules/geom/geom_label/Makefile b/sys/modules/geom/geom_label/Makefile index 19e0ee446fa1..37ee312f849e 100644 --- a/sys/modules/geom/geom_label/Makefile +++ b/sys/modules/geom/geom_label/Makefile @@ -11,6 +11,7 @@ SRCS+= g_label_iso9660.c SRCS+= g_label_msdosfs.c SRCS+= g_label_ntfs.c SRCS+= g_label_ufs.c +SRCS+= g_label_swaplinux.c SRCS+= opt_geom.h SRCS+= vnode_if.h From nobody Mon Apr 29 04:48:53 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VSW7T3H74z5JDnM; Mon, 29 Apr 2024 04:48: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VSW7T2ZBGz4B82; Mon, 29 Apr 2024 04:48:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714366133; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KEgsUjrfiQhTj6Jnalp/3wLVF0SB8FXS8qjCt4If/Co=; b=lB0lNqfcPIcAg3Kt9VpLvHmICKAWBOyHt6hrX8IUHPYjd2iVDb2bpp8zWDP37acEFH4GCz jKQEX69qkqFJgynCUYbv6xOHVhUM4hIrZ4Fd0XqXtkNw9dNDdySqVPoeKBqttNRiHERqTw Pqz8Zo1LA7ktlPSF0NdLuCYTmvM0uAc2NyO7EZf1gNqfuiAVWyVNroxYpHWEAe15gbq+4I 0GGl3ETYpgyKY+PdvxBpbeBKKZV6uJRrZ9dPnjNEahfFV0gRRc+UVY/XSFwZ8CLlPFIRte A56MaoAQF7V6NFpVlWDrtvcq9Q1vjXVYWTSbYZEDWi3VRxY0uxGUfQNl84EgrA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714366133; a=rsa-sha256; cv=none; b=ppVp6NjTCcFcd55m+AFaHHj7CRZPI7DjTYszpsTSGuVWbOoQOjGXybFcC0hxfOwnj4N7EX elZ61UDRqXfzVQit1lTIJKLDL9ohXXW6cQtNxuvrogtxeeK1qLbW2bhtdcqmN1F9vPdGNk bCkyaWnC2cvJ9hxjusZN5EgOsUaK83W8141Ero2GUCC3tKCMO0w6N6QQBCEGCdWBs+LLwt PXZnAP2GcibR9FTwQe/x9QpfXaGAOcdSBiZ1A8MnsaZotL0DNKnKZTug2uyAJEjOF3kQwH h3SswI9ARZxbp/xpJjUHGKgAvaaKYGpQ+qzvYk30lruuDGuVsC7Jh87nG+lNcA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714366133; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KEgsUjrfiQhTj6Jnalp/3wLVF0SB8FXS8qjCt4If/Co=; b=kdinHnXCIp0Y6Ed51yuZYffLdNNJlE6nnfLirGhD5S32Cw9YM3eeZuwJyhFIgBgd+UyMoE nJX6rI+wRmywBIzCAmsXN7kV9Fw8XXeJ0bkkUgwrAfr4RvWoADlty35gCW8uAnDw7Ad187 VKeP4Sg+mF4/Ujs+/HlB9YEhGCOEMKndyt8iu3OMTxmhV2IK+s242mxFHFfhP6SKlvZA6n 137cMoZeqSQ6Nw1tptpvI2wqVgZrcMQbisi4hClcAyd57Yin9pzFRkrdPyv/B8QbO1YeTl AaaigClS8huZtEq0PpQgZucJC08yp8Ss5RxqZHFIiheCajyTM+U52B9x59AzlA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VSW7T1GbJzvjw; Mon, 29 Apr 2024 04:48:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43T4mrGI079195; Mon, 29 Apr 2024 04:48:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43T4mrnw079192; Mon, 29 Apr 2024 04:48:53 GMT (envelope-from git) Date: Mon, 29 Apr 2024 04:48:53 GMT Message-Id: <202404290448.43T4mrnw079192@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: d289382897e7 - main - rights.4: various corrections on capability rights List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: d289382897e7ded566a3aa10ae535235149c4056 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=d289382897e7ded566a3aa10ae535235149c4056 commit d289382897e7ded566a3aa10ae535235149c4056 Author: CismonX AuthorDate: 2024-04-29 04:48:26 +0000 Commit: Warner Losh CommitDate: 2024-04-29 04:48:31 +0000 rights.4: various corrections on capability rights - A file descriptor obtained from accept(2), accept4(2) and openat(2) is not always assigned all capability rights. Instead, it inherits capability rights from the "parent" socket/dir file descriptor. - getdents(2) and getdirentries(2) requires CAP_READ. - openat(2) with O_WRONLY|O_TRUNC does not require CAP_SEEK. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1207 --- lib/libsys/cap_rights_limit.2 | 12 +++++++----- share/man/man4/rights.4 | 21 +++++++++++++++------ 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/lib/libsys/cap_rights_limit.2 b/lib/libsys/cap_rights_limit.2 index eca30f55ea48..8372d07f6a5c 100644 --- a/lib/libsys/cap_rights_limit.2 +++ b/lib/libsys/cap_rights_limit.2 @@ -30,7 +30,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd March 9, 2023 +.Dd April 27, 2024 .Dt CAP_RIGHTS_LIMIT 2 .Os .Sh NAME @@ -44,20 +44,22 @@ .Fn cap_rights_limit "int fd" "const cap_rights_t *rights" .Sh DESCRIPTION When a file descriptor is created by a function such as -.Xr accept 2 , -.Xr accept4 2 , .Xr fhopen 2 , .Xr kqueue 2 , .Xr mq_open 2 , .Xr open 2 , -.Xr openat 2 , .Xr pdfork 2 , .Xr pipe 2 , .Xr shm_open 2 , .Xr socket 2 or .Xr socketpair 2 , -it is assigned all capability rights. +it is assigned all capability rights; for +.Xr accept 2 , +.Xr accept4 2 +or +.Xr openat 2 , +it inherits capability rights from the "parent" file descriptor. Those rights can be reduced (but never expanded) by using the .Fn cap_rights_limit system call. diff --git a/share/man/man4/rights.4 b/share/man/man4/rights.4 index 2d44a1060006..3e5e18fc65d8 100644 --- a/share/man/man4/rights.4 +++ b/share/man/man4/rights.4 @@ -30,7 +30,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd March 22, 2024 +.Dd April 27, 2024 .Dt RIGHTS 4 .Os .Sh NAME @@ -38,20 +38,22 @@ .Nd Capsicum capability rights for file descriptors .Sh DESCRIPTION When a file descriptor is created by a function such as -.Xr accept 2 , -.Xr accept4 2 , .Xr fhopen 2 , .Xr kqueue 2 , .Xr mq_open 2 , .Xr open 2 , -.Xr openat 2 , .Xr pdfork 2 , .Xr pipe 2 , .Xr shm_open 2 , .Xr socket 2 or .Xr socketpair 2 , -it is assigned all capability rights. +it is assigned all capability rights; for +.Xr accept 2 , +.Xr accept4 2 +or +.Xr openat 2 , +it inherits capability rights from the "parent" file descriptor. Those rights can be reduced (but never expanded) by using the .Xr cap_rights_limit 2 , .Xr cap_fcntls_limit 2 and @@ -501,7 +503,10 @@ with the is also required), .Xr preadv 2 .Dv ( CAP_SEEK -is also required) and related system calls. +is also required), +.Xr getdents 2 , +.Xr getdirentries 2 , +and related system calls. .It Dv CAP_RECV An alias to .Dv CAP_READ . @@ -611,6 +616,8 @@ with the .Dv O_WRONLY flag, but without the .Dv O_APPEND +or +.Dv O_TRUNC flag, .Dv CAP_SEEK is also required. @@ -657,6 +664,8 @@ is also required. .Xr fsync 2 , .Xr ftruncate 2 , .Xr futimes 2 , +.Xr getdents 2 , +.Xr getdirentries 2 , .Xr getpeername 2 , .Xr getsockname 2 , .Xr getsockopt 2 , From nobody Mon Apr 29 08:30:46 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VSc3V59nPz5JZDH; Mon, 29 Apr 2024 08:30: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VSc3V4f6lz4YH6; Mon, 29 Apr 2024 08:30:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714379446; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3n4Aja0E5hjsUMsGM7W2UXQ+u209Jg8+wuOpqKK7qkE=; b=vgmUkkTPfwo0sUCTTDVPdW2OZ5JS8pQxgQkEmfomP9BYItLV+QA1RMke2lU/2554MXn3jo xeUXERPFzT+LINAlMtTm9nNLSwGuwJfdWL+XzdWysCl5P4IIM4pLVH+TC1c8vSVxAdFsO1 aQsExylrGFChpy79uXR3IBhBqHt/MynmMtGMU9UrtdXOscBQCoh2+RnipJ7J0En4L9rcFC H6qyl/61B8Zmm71Wdqa08T7hcP65FqdexpDVMhQCkDCg8Ofo58Sj6jnkmwpas+4phocCa/ t2cf77XKKfOyBuNh8PsfJ5oQ5tkwXoerNyE5wQ/7PqU796+0WwNSSPGsan3Ghg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714379446; a=rsa-sha256; cv=none; b=Gju0ymJOCdsD8vtsOGweqqWpgcKkwV6kIlOXCyo6A1CrMsWKYWsbiuYsIOc+bxGjvEgwuN jZe/MBvG3USYNGL7m0aGY2SAkAyGRiHywuB7kDBmwjOIuB2W+1CIGi75OZkEgDIzRnXE5P D4WUzGmfiaD2A/TSRTwt60Tr7rAOc7OwpYgyWSyfPfb48qDnoL8uV/vQnrwrimrEu+6DBO /l3hKACY3gw3CEwRz+NmhIU9tmbbguS6i7buRwJgDypnSewXwwlImqtP8RWOXg8NAb1nIo ZZSV4y0HJkp9qgWiuE6xBitZyQfP1lkP4gc5cDOm7mClAbAVYBowf7tsspIUDg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714379446; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3n4Aja0E5hjsUMsGM7W2UXQ+u209Jg8+wuOpqKK7qkE=; b=nA2qcVgDgfq6lf2reDMHpJjaBjmsnryo9fLI/JfGcUXcvWGjoFB3R2U7IhCUV16LzKPMsP 97qGIYlGvv0jBXcO5OFoAkppV/VX9ZhJKobltJdzwxnXkn93q5BmXxTgylccfun9G+gleA X3JPs7FWCUGKmKBts7LUfAE1PRa8glfID/YNx955F5vT/Xf+WyBHkKNlKO/u0zsOQEQMJu 7atJII1GW0KtTuRjbrjoa45xNwcSDwIIZle4mV/inRbnk4peu7fNkpsk6t38z7aS304gg/ LUxJXZbuExGqNUQcmXL5BuBcnQF+qoU7i4LLgBXYl7NWMcklbKmUMb45wTYejw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VSc3V4FFFz11yY; Mon, 29 Apr 2024 08:30:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43T8UkoS060492; Mon, 29 Apr 2024 08:30:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43T8Ukpf060489; Mon, 29 Apr 2024 08:30:46 GMT (envelope-from git) Date: Mon, 29 Apr 2024 08:30:46 GMT Message-Id: <202404290830.43T8Ukpf060489@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Martin Matuska Subject: git: 13d826ff947d - main - libarchive: merge from vendor branch List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 13d826ff947d9026f98e317e7385b22abfc0eace Auto-Submitted: auto-generated The branch main has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=13d826ff947d9026f98e317e7385b22abfc0eace commit 13d826ff947d9026f98e317e7385b22abfc0eace Merge: d289382897e7 51c823ac2777 Author: Martin Matuska AuthorDate: 2024-04-29 08:15:04 +0000 Commit: Martin Matuska CommitDate: 2024-04-29 08:17:53 +0000 libarchive: merge from vendor branch Libarchive 3.7.4 + three fixes from master Security fixes: #2135 rar: Fix OOB in rar e8 filter (CVE-2024-26256) #2145 zip: Fix out of boundary access #2148 rar: Fix OOB in rar delta filter #2149 rar: Fix OOB in rar audio filter Important bugfixes: #2131 7zip: Limit amount of properties #2110 bsdtar: Fix error handling around strtol() usages #2116 passphrase: Never allow empty passwords #2124 rar: Fix "File CRC Error" when extracting specific rar4 archives #2123 xar: Avoid infinite link loop #2150 xar: Fix another infinite loop and expat error handling #2108 zip: Update AppleDouble support for directories #2071 zstd: Implement core detectiongit PR: 278588 (exp-run) MFC after: 1 day contrib/libarchive/NEWS | 2 + contrib/libarchive/README.md | 2 +- contrib/libarchive/cat/cmdline.c | 16 +++-- contrib/libarchive/cpio/cmdline.c | 16 +++-- contrib/libarchive/libarchive/archive.h | 6 +- contrib/libarchive/libarchive/archive_entry.h | 2 +- contrib/libarchive/libarchive/archive_entry_acl.3 | 2 +- contrib/libarchive/libarchive/archive_read_disk.3 | 4 +- .../libarchive/archive_read_support_format_7zip.c | 2 + .../libarchive/archive_read_support_format_all.c | 2 +- .../libarchive/archive_read_support_format_ar.c | 4 +- .../libarchive/archive_read_support_format_lha.c | 4 +- .../libarchive/archive_read_support_format_mtree.c | 8 +-- .../libarchive/archive_read_support_format_rar.c | 30 +++++++- .../libarchive/archive_read_support_format_warc.c | 10 ++- .../libarchive/archive_read_support_format_xar.c | 9 +++ .../libarchive/archive_read_support_format_zip.c | 15 +++- contrib/libarchive/libarchive/archive_util.c | 3 +- .../libarchive/archive_write_add_filter_zstd.c | 23 +++++- .../libarchive/archive_write_disk_posix.c | 3 +- .../libarchive/libarchive/archive_write_private.h | 2 +- .../libarchive/archive_write_set_format_gnutar.c | 2 +- .../libarchive/archive_write_set_passphrase.c | 35 ++++----- .../libarchive/libarchive/libarchive_internals.3 | 2 +- .../test/test_read_format_xar_doublelink.c | 55 ++++++++++++++ .../test/test_read_format_xar_doublelink.xar.uu | 12 ++++ .../libarchive/test/test_write_disk_appledouble.c | 84 ++++++++++++++++++++++ .../test/test_write_disk_appledouble_zip.zip.uu | 27 +++++++ contrib/libarchive/libarchive_fe/passphrase.c | 4 +- contrib/libarchive/tar/bsdtar.1 | 15 ++-- contrib/libarchive/tar/bsdtar.c | 63 ++++++++-------- contrib/libarchive/tar/cmdline.c | 16 +++-- contrib/libarchive/unzip/cmdline.c | 18 +++-- contrib/libarchive/unzip/test/test_I.c | 13 ++++ lib/libarchive/tests/Makefile | 3 + 35 files changed, 404 insertions(+), 110 deletions(-) diff --cc contrib/libarchive/README.md index 727ed49856b6,000000000000..933de6986425 mode 100644,000000..100644 --- a/contrib/libarchive/README.md +++ b/contrib/libarchive/README.md @@@ -1,244 -1,0 +1,244 @@@ +# Welcome to libarchive! + +The libarchive project develops a portable, efficient C library that +can read and write streaming archives in a variety of formats. It +also includes implementations of the common `tar`, `cpio`, and `zcat` +command-line tools that use the libarchive library. + +## Questions? Issues? + +* https://www.libarchive.org is the home for ongoing + libarchive development, including documentation, + and links to the libarchive mailing lists. +* To report an issue, use the issue tracker at + https://github.com/libarchive/libarchive/issues +* To submit an enhancement to libarchive, please + submit a pull request via GitHub: https://github.com/libarchive/libarchive/pulls + +## Contents of the Distribution + +This distribution bundle includes the following major components: + +* **libarchive**: a library for reading and writing streaming archives +* **tar**: the 'bsdtar' program is a full-featured 'tar' implementation built on libarchive +* **cpio**: the 'bsdcpio' program is a different interface to essentially the same functionality +* **cat**: the 'bsdcat' program is a simple replacement tool for zcat, bzcat, xzcat, and such +* **unzip**: the 'bsdunzip' program is a simple replacement tool for Info-ZIP's unzip +* **examples**: Some small example programs that you may find useful. +* **examples/minitar**: a compact sample demonstrating use of libarchive. +* **contrib**: Various items sent to me by third parties; please contact the authors with any questions. + +The top-level directory contains the following information files: + +* **NEWS** - highlights of recent changes +* **COPYING** - what you can do with this +* **INSTALL** - installation instructions +* **README** - this file +* **CMakeLists.txt** - input for "cmake" build tool, see INSTALL +* **configure** - configuration script, see INSTALL for details. If your copy of the source lacks a `configure` script, you can try to construct it by running the script in `build/autogen.sh` (or use `cmake`). + +The following files in the top-level directory are used by the 'configure' script: + +* `Makefile.am`, `aclocal.m4`, `configure.ac` - used to build this distribution, only needed by maintainers +* `Makefile.in`, `config.h.in` - templates used by configure script + +## Documentation + +In addition to the informational articles and documentation +in the online [libarchive Wiki](https://github.com/libarchive/libarchive/wiki), +the distribution also includes a number of manual pages: + + * bsdtar.1 explains the use of the bsdtar program + * bsdcpio.1 explains the use of the bsdcpio program + * bsdcat.1 explains the use of the bsdcat program + * libarchive.3 gives an overview of the library as a whole + * archive_read.3, archive_write.3, archive_write_disk.3, and + archive_read_disk.3 provide detailed calling sequences for the read + and write APIs + * archive_entry.3 details the "struct archive_entry" utility class + * archive_internals.3 provides some insight into libarchive's + internal structure and operation. + * libarchive-formats.5 documents the file formats supported by the library + * cpio.5, mtree.5, and tar.5 provide detailed information about these + popular archive formats, including hard-to-find details about + modern cpio and tar variants. + +The manual pages above are provided in the 'doc' directory in +a number of different formats. + +You should also read the copious comments in `archive.h` and the +source code for the sample programs for more details. Please let us +know about any errors or omissions you find. + +## Supported Formats + +Currently, the library automatically detects and reads the following formats: + + * Old V7 tar archives + * POSIX ustar + * GNU tar format (including GNU long filenames, long link names, and sparse files) + * Solaris 9 extended tar format (including ACLs) + * POSIX pax interchange format + * POSIX octet-oriented cpio + * SVR4 ASCII cpio + * Binary cpio (big-endian or little-endian) + * PWB binary cpio + * ISO9660 CD-ROM images (with optional Rockridge or Joliet extensions) + * ZIP archives (with uncompressed or "deflate" compressed entries, including support for encrypted Zip archives) + * ZIPX archives (with support for bzip2, ppmd8, lzma and xz compressed entries) + * GNU and BSD 'ar' archives + * 'mtree' format + * 7-Zip archives (including archives that use zstandard compression) + * Microsoft CAB format + * LHA and LZH archives + * RAR and RAR 5.0 archives (with some limitations due to RAR's proprietary status) + * XAR archives + +The library also detects and handles any of the following before evaluating the archive: + + * uuencoded files + * files with RPM wrapper + * gzip compression + * bzip2 compression + * compress/LZW compression + * lzma, lzip, and xz compression + * lz4 compression + * lzop compression + * zstandard compression + +The library can create archives in any of the following formats: + + * POSIX ustar + * POSIX pax interchange format + * "restricted" pax format, which will create ustar archives except for + entries that require pax extensions (for long filenames, ACLs, etc). + * Old GNU tar format + * Old V7 tar format + * POSIX octet-oriented cpio + * SVR4 "newc" cpio + * Binary cpio (little-endian) + * PWB binary cpio + * shar archives + * ZIP archives (with uncompressed or "deflate" compressed entries) + * GNU and BSD 'ar' archives + * 'mtree' format + * ISO9660 format + * 7-Zip archives + * XAR archives + +When creating archives, the result can be filtered with any of the following: + + * uuencode + * gzip compression + * bzip2 compression + * compress/LZW compression + * lzma, lzip, and xz compression + * lz4 compression + * lzop compression + * zstandard compression + +## Notes about the Library Design + +The following notes address many of the most common +questions we are asked about libarchive: + +* This is a heavily stream-oriented system. That means that + it is optimized to read or write the archive in a single + pass from beginning to end. For example, this allows + libarchive to process archives too large to store on disk + by processing them on-the-fly as they are read from or + written to a network or tape drive. This also makes + libarchive useful for tools that need to produce + archives on-the-fly (such as webservers that provide + archived contents of a users account). + +* In-place modification and random access to the contents + of an archive are not directly supported. For some formats, + this is not an issue: For example, tar.gz archives are not + designed for random access. In some other cases, libarchive + can re-open an archive and scan it from the beginning quickly + enough to provide the needed abilities even without true + random access. Of course, some applications do require true + random access; those applications should consider alternatives + to libarchive. + +* The library is designed to be extended with new compression and + archive formats. The only requirement is that the format be + readable or writable as a stream and that each archive entry be + independent. There are articles on the libarchive Wiki explaining + how to extend libarchive. + +* On read, compression and format are always detected automatically. + +* The same API is used for all formats; it should be very + easy for software using libarchive to transparently handle + any of libarchive's archiving formats. + +* Libarchive's automatic support for decompression can be used + without archiving by explicitly selecting the "raw" and "empty" + formats. + +* I've attempted to minimize static link pollution. If you don't + explicitly invoke a particular feature (such as support for a + particular compression or format), it won't get pulled in to + statically-linked programs. In particular, if you don't explicitly + enable a particular compression or decompression support, you won't + need to link against the corresponding compression or decompression + libraries. This also reduces the size of statically-linked + binaries in environments where that matters. + +* The library is generally _thread safe_ depending on the platform: + it does not define any global variables of its own. However, some + platforms do not provide fully thread-safe versions of key C library + functions. On those platforms, libarchive will use the non-thread-safe + functions. Patches to improve this are of great interest to us. + +* The function `archive_write_disk_header()` is _not_ thread safe on + POSIX machines and could lead to security issue resulting in world + writeable directories. Thus it must be mutexed by the calling code. + This is due to calling `umask(oldumask = umask(0))`, which sets the + umask for the whole process to 0 for a short time frame. + In case other thread calls the same function in parallel, it might + get interrupted by it and cause the executable to use umask=0 for the + remaining execution. - This will then lead to implicitely created directories to have 777 ++ This will then lead to implicitly created directories to have 777 + permissions without sticky bit. + +* In particular, libarchive's modules to read or write a directory + tree do use `chdir()` to optimize the directory traversals. This + can cause problems for programs that expect to do disk access from + multiple threads. Of course, those modules are completely + optional and you can use the rest of libarchive without them. + +* The library is _not_ thread aware, however. It does no locking + or thread management of any kind. If you create a libarchive + object and need to access it from multiple threads, you will + need to provide your own locking. + +* On read, the library accepts whatever blocks you hand it. + Your read callback is free to pass the library a byte at a time + or mmap the entire archive and give it to the library at once. + On write, the library always produces correctly-blocked output. + +* The object-style approach allows you to have multiple archive streams + open at once. bsdtar uses this in its "@archive" extension. + +* The archive itself is read/written using callback functions. + You can read an archive directly from an in-memory buffer or + write it to a socket, if you wish. There are some utility + functions to provide easy-to-use "open file," etc, capabilities. + +* The read/write APIs are designed to allow individual entries + to be read or written to any data source: You can create + a block of data in memory and add it to a tar archive without + first writing a temporary file. You can also read an entry from + an archive and write the data directly to a socket. If you want + to read/write entries to disk, there are convenience functions to + make this especially easy. + +* Note: The "pax interchange format" is a POSIX standard extended tar + format that should be used when the older _ustar_ format is not + appropriate. It has many advantages over other tar formats + (including the legacy GNU tar format) and is widely supported by + current tar implementations. + diff --cc contrib/libarchive/libarchive/test/test_read_format_xar_doublelink.c index 000000000000,78d6626a09bf..78d6626a09bf mode 000000,100644..100644 --- a/contrib/libarchive/libarchive/test/test_read_format_xar_doublelink.c +++ b/contrib/libarchive/libarchive/test/test_read_format_xar_doublelink.c diff --cc contrib/libarchive/libarchive/test/test_read_format_xar_doublelink.xar.uu index 000000000000,7aa638a86e7c..7aa638a86e7c mode 000000,100644..100644 --- a/contrib/libarchive/libarchive/test/test_read_format_xar_doublelink.xar.uu +++ b/contrib/libarchive/libarchive/test/test_read_format_xar_doublelink.xar.uu diff --cc contrib/libarchive/libarchive/test/test_write_disk_appledouble_zip.zip.uu index 000000000000,5ab67533d559..5ab67533d559 mode 000000,100644..100644 --- a/contrib/libarchive/libarchive/test/test_write_disk_appledouble_zip.zip.uu +++ b/contrib/libarchive/libarchive/test/test_write_disk_appledouble_zip.zip.uu diff --cc lib/libarchive/tests/Makefile index e14b37621e5c,000000000000..dc3767c319c3 mode 100644,000000..100644 --- a/lib/libarchive/tests/Makefile +++ b/lib/libarchive/tests/Makefile @@@ -1,686 -1,0 +1,689 @@@ +.include + +PACKAGE= tests + +WARNS?= 3 + +_LIBARCHIVEDIR= ${SRCTOP}/contrib/libarchive + +ATF_TESTS_SH+= functional_test + +TEST_METADATA.functional_test+= timeout="600" + +BINDIR= ${TESTSDIR} + +PROGS+= libarchive_test + +CFLAGS+= -I${.CURDIR} -I${.CURDIR:H} -I${.OBJDIR} +CFLAGS+= -I${_LIBARCHIVEDIR}/libarchive -I${_LIBARCHIVEDIR}/libarchive/test +CFLAGS+= -I${_LIBARCHIVEDIR}/test_utils + +CFLAGS.test_utils.c+= -Wno-cast-align + +# Uncomment to link against dmalloc +#LDADD+= -L/usr/local/lib -ldmalloc +#CFLAGS+= -I/usr/local/include -DUSE_DMALLOC + +.PATH: ${_LIBARCHIVEDIR}/libarchive/test +TESTS_SRCS= \ + test_acl_nfs4.c \ + test_acl_pax.c \ + test_acl_platform_nfs4.c \ + test_acl_platform_posix1e.c \ + test_acl_posix1e.c \ + test_acl_text.c \ + test_archive_api_feature.c \ + test_archive_clear_error.c \ + test_archive_cmdline.c \ + test_archive_digest.c \ + test_archive_getdate.c \ + test_archive_match_time.c \ + test_archive_match_owner.c \ + test_archive_match_path.c \ + test_archive_pathmatch.c \ + test_archive_read_add_passphrase.c \ + test_archive_read_close_twice.c \ + test_archive_read_close_twice_open_fd.c \ + test_archive_read_close_twice_open_filename.c \ + test_archive_read_multiple_data_objects.c \ + test_archive_read_next_header_empty.c \ + test_archive_read_next_header_raw.c \ + test_archive_read_open2.c \ + test_archive_read_set_filter_option.c \ + test_archive_read_set_format_option.c \ + test_archive_read_set_option.c \ + test_archive_read_set_options.c \ + test_archive_read_support.c \ + test_archive_set_error.c \ + test_archive_string.c \ + test_archive_string_conversion.c \ + test_archive_write_add_filter_by_name.c \ + test_archive_write_set_filter_option.c \ + test_archive_write_set_format_by_name.c \ + test_archive_write_set_format_filter_by_ext.c \ + test_archive_write_set_format_option.c \ + test_archive_write_set_option.c \ + test_archive_write_set_options.c \ + test_archive_write_set_passphrase.c \ + test_bad_fd.c \ + test_compat_bzip2.c \ + test_compat_cpio.c \ + test_compat_gtar.c \ + test_compat_gzip.c \ + test_compat_lz4.c \ + test_compat_lzip.c \ + test_compat_lzma.c \ + test_compat_lzop.c \ + test_compat_mac.c \ + test_compat_perl_archive_tar.c \ + test_compat_plexus_archiver_tar.c \ + test_compat_solaris_tar_acl.c \ + test_compat_solaris_pax_sparse.c \ + test_compat_star_acl.c \ + test_compat_tar_directory.c \ + test_compat_tar_hardlink.c \ + test_compat_uudecode.c \ + test_compat_uudecode_large.c \ + test_compat_xz.c \ + test_compat_zip.c \ + test_compat_zstd.c \ + test_empty_write.c \ + test_entry.c \ + test_entry_strmode.c \ + test_extattr_freebsd.c \ + test_filter_count.c \ + test_gnutar_filename_encoding.c \ + test_link_resolver.c \ + test_open_fd.c \ + test_open_failure.c \ + test_open_file.c \ + test_open_filename.c \ + test_pax_filename_encoding.c \ + test_pax_xattr_header.c \ + test_read_data_large.c \ + test_read_disk.c \ + test_read_disk_directory_traversals.c \ + test_read_disk_entry_from_file.c \ + test_read_extract.c \ + test_read_file_nonexistent.c \ + test_read_filter_compress.c \ + test_read_filter_grzip.c \ + test_read_filter_lrzip.c \ + test_read_filter_lzop.c \ + test_read_filter_lzop_multiple_parts.c \ + test_read_filter_program.c \ + test_read_filter_program_signature.c \ + test_read_filter_uudecode.c \ + test_read_filter_uudecode_raw.c \ + test_read_format_7zip.c \ + test_read_format_7zip_encryption_data.c \ + test_read_format_7zip_encryption_header.c \ + test_read_format_7zip_encryption_partially.c \ + test_read_format_7zip_malformed.c \ + test_read_format_7zip_packinfo_digests.c \ + test_read_format_ar.c \ + test_read_format_cab.c \ + test_read_format_cab_filename.c \ + test_read_format_cpio_afio.c \ + test_read_format_cpio_bin.c \ + test_read_format_cpio_bin_Z.c \ + test_read_format_cpio_bin_be.c \ + test_read_format_cpio_bin_bz2.c \ + test_read_format_cpio_bin_gz.c \ + test_read_format_cpio_bin_le.c \ + test_read_format_cpio_bin_lzip.c \ + test_read_format_cpio_bin_lzma.c \ + test_read_format_cpio_bin_xz.c \ + test_read_format_cpio_filename.c \ + test_read_format_cpio_odc.c \ + test_read_format_cpio_svr4_gzip.c \ + test_read_format_cpio_svr4c_Z.c \ + test_read_format_cpio_svr4_bzip2_rpm.c \ + test_read_format_cpio_svr4_gzip_rpm.c \ + test_read_format_empty.c \ + test_read_format_gtar_filename.c \ + test_read_format_gtar_gz.c \ + test_read_format_gtar_lzma.c \ + test_read_format_gtar_sparse.c \ + test_read_format_gtar_sparse_skip_entry.c \ + test_read_format_iso_Z.c \ + test_read_format_iso_multi_extent.c \ + test_read_format_iso_xorriso.c \ + test_read_format_isorr_rr_moved.c \ + test_read_format_isojoliet_bz2.c \ + test_read_format_isojoliet_long.c \ + test_read_format_isojoliet_rr.c \ + test_read_format_isojoliet_versioned.c \ + test_read_format_isorr_bz2.c \ + test_read_format_isorr_ce.c \ + test_read_format_isorr_new_bz2.c \ + test_read_format_isozisofs_bz2.c \ + test_read_format_lha.c \ + test_read_format_lha_bugfix_0.c \ + test_read_format_lha_filename.c \ + test_read_format_lha_filename_utf16.c \ + test_read_format_mtree.c \ + test_read_format_mtree_crash747.c \ + test_read_format_pax_bz2.c \ + test_read_format_rar.c \ + test_read_format_rar5.c \ + test_read_format_rar_encryption_data.c \ + test_read_format_rar_encryption_header.c \ + test_read_format_rar_encryption_partially.c \ + test_read_format_rar_filter.c \ + test_read_format_rar_invalid1.c \ + test_read_format_raw.c \ + test_read_format_tar.c \ + test_read_format_tar_concatenated.c \ + test_read_format_tar_empty_filename.c \ + test_read_format_tar_empty_pax.c \ + test_read_format_tar_empty_with_gnulabel.c \ + test_read_format_tar_filename.c \ + test_read_format_tar_invalid_pax_size.c \ + test_read_format_tbz.c \ + test_read_format_tgz.c \ + test_read_format_tlz.c \ + test_read_format_txz.c \ + test_read_format_tz.c \ + test_read_format_ustar_filename.c \ + test_read_format_warc.c \ + test_read_format_xar.c \ ++ test_read_format_xar_doublelink.c \ + test_read_format_zip.c \ + test_read_format_zip_7075_utf8_paths.c \ + test_read_format_zip_comment_stored.c \ + test_read_format_zip_encryption_data.c \ + test_read_format_zip_encryption_header.c \ + test_read_format_zip_encryption_partially.c \ + test_read_format_zip_extra_padding.c \ + test_read_format_zip_filename.c \ + test_read_format_zip_high_compression.c \ + test_read_format_zip_jar.c \ + test_read_format_zip_mac_metadata.c \ + test_read_format_zip_malformed.c \ + test_read_format_zip_msdos.c \ + test_read_format_zip_nested.c \ + test_read_format_zip_nofiletype.c \ + test_read_format_zip_padded.c \ + test_read_format_zip_sfx.c \ + test_read_format_zip_traditional_encryption_data.c \ + test_read_format_zip_winzip_aes.c \ + test_read_format_zip_winzip_aes_large.c \ + test_read_format_zip_with_invalid_traditional_eocd.c \ + test_read_format_zip_zip64.c \ + test_read_large.c \ + test_read_pax_xattr_rht_security_selinux.c \ + test_read_pax_xattr_schily.c \ + test_read_pax_truncated.c \ + test_read_position.c \ + test_read_set_format.c \ + test_read_too_many_filters.c \ + test_read_truncated.c \ + test_read_truncated_filter.c \ + test_short_writes.c \ + test_sparse_basic.c \ + test_tar_filenames.c \ + test_tar_large.c \ + test_warn_missing_hardlink_target.c \ + test_ustar_filenames.c \ + test_ustar_filename_encoding.c \ + test_write_disk.c \ + test_write_disk_appledouble.c \ + test_write_disk_failures.c \ + test_write_disk_fixup.c \ + test_write_disk_hardlink.c \ + test_write_disk_hfs_compression.c \ + test_write_disk_lookup.c \ + test_write_disk_mac_metadata.c \ + test_write_disk_no_hfs_compression.c \ + test_write_disk_perms.c \ + test_write_disk_secure.c \ + test_write_disk_secure744.c \ + test_write_disk_secure745.c \ + test_write_disk_secure746.c \ + test_write_disk_sparse.c \ + test_write_disk_symlink.c \ + test_write_disk_times.c \ + test_write_filter_b64encode.c \ + test_write_filter_bzip2.c \ + test_write_filter_compress.c \ + test_write_filter_gzip.c \ + test_write_filter_gzip_timestamp.c \ + test_write_filter_lrzip.c \ + test_write_filter_lz4.c \ + test_write_filter_lzip.c \ + test_write_filter_lzma.c \ + test_write_filter_lzop.c \ + test_write_filter_program.c \ + test_write_filter_uuencode.c \ + test_write_filter_xz.c \ + test_write_filter_zstd.c \ + test_write_format_7zip.c \ + test_write_format_7zip_empty.c \ + test_write_format_7zip_large.c \ + test_write_format_ar.c \ + test_write_format_cpio.c \ + test_write_format_cpio_empty.c \ + test_write_format_cpio_newc.c \ + test_write_format_cpio_odc.c \ + test_write_format_gnutar.c \ + test_write_format_gnutar_filenames.c \ + test_write_format_iso9660.c \ + test_write_format_iso9660_boot.c \ + test_write_format_iso9660_empty.c \ + test_write_format_iso9660_filename.c \ + test_write_format_iso9660_zisofs.c \ + test_write_format_mtree.c \ + test_write_format_mtree_absolute_path.c \ + test_write_format_mtree_classic.c \ + test_write_format_mtree_classic_indent.c \ + test_write_format_mtree_fflags.c \ + test_write_format_mtree_no_separator.c \ + test_write_format_mtree_quoted_filename.c \ + test_write_format_pax.c \ + test_write_format_raw.c \ + test_write_format_raw_b64.c \ + test_write_format_shar_empty.c \ + test_write_format_tar.c \ + test_write_format_tar_empty.c \ + test_write_format_tar_sparse.c \ + test_write_format_tar_ustar.c \ + test_write_format_tar_v7tar.c \ + test_write_format_warc.c \ + test_write_format_warc_empty.c \ + test_write_format_xar.c \ + test_write_format_xar_empty.c \ + test_write_format_zip.c \ + test_write_format_zip_compression_store.c \ + test_write_format_zip_empty.c \ + test_write_format_zip_empty_zip64.c \ + test_write_format_zip_entry_size_unset.c \ + test_write_format_zip_file.c \ + test_write_format_zip_file_zip64.c \ + test_write_format_zip_large.c \ + test_write_format_zip_zip64.c \ + test_write_format_zip64_stream.c \ + test_write_format_zip_stream.c \ + test_write_open_memory.c \ + test_write_read_format_zip.c \ + test_xattr_platform.c \ + test_zip_filename_encoding.c + +# Deterministic failures: +# Fails with `test_read_disk_directory_traversals.c:1094: File at has atime 886622, 1443306049 seconds ago` +BROKEN_TESTS+= test_read_disk_directory_traversals + +.if 0 +# test_fuzz.c is not a real test, but rather a simple fuzz-test using random(). +# Since this is not a regression/unit test, we don't include it by default. +# If you would still like to include it, comment out the `.if 0`. +TEST_SCRCS+= test_fuzz.c +${PACKAGE}FILES+= test_fuzz.cab.uu +${PACKAGE}FILES+= test_fuzz.lzh.uu +${PACKAGE}FILES+= test_fuzz_1.iso.Z.uu +# Non-deterministic failures: +# (Times out?) [and] crashes +BROKEN_TESTS+= test_fuzz_rar +.endif + +# https://bugs.freebsd.org/240683 +BROKEN_TESTS+= test_write_filter_zstd + +# Build the test program. +SRCS.libarchive_test= \ + ${TESTS_SRCS} \ + read_open_memory.c \ + list.h + +LIBADD.libarchive_test= archive + +.PATH: ${_LIBARCHIVEDIR}/test_utils +SRCS.libarchive_test+= test_main.c \ + test_utils.c + +# list.h is just a list of all tests, as indicated by DEFINE_TEST macro lines +list.h: ${TESTS_SRCS} Makefile + @(cd ${_LIBARCHIVEDIR}/libarchive/test && \ + grep -E -h ^DEFINE_TEST ${.ALLSRC:N*Makefile} | \ + egrep -v '${BROKEN_TESTS:tW:C/ /|/g}') > ${.TARGET}.tmp + @mv ${.TARGET}.tmp ${.TARGET} + +CLEANTESTS+= list.h list.h.tmp +${PACKAGE}FILES+= README +${PACKAGE}FILES+= test_acl_pax_posix1e.tar.uu +${PACKAGE}FILES+= test_acl_pax_nfs4.tar.uu +${PACKAGE}FILES+= test_archive_string_conversion.txt.Z.uu +${PACKAGE}FILES+= test_compat_bzip2_1.tbz.uu +${PACKAGE}FILES+= test_compat_bzip2_2.tbz.uu +${PACKAGE}FILES+= test_compat_cpio_1.cpio.uu +${PACKAGE}FILES+= test_compat_gtar_1.tar.uu +${PACKAGE}FILES+= test_compat_gtar_2.tar.uu +${PACKAGE}FILES+= test_compat_gzip_1.tgz.uu +${PACKAGE}FILES+= test_compat_gzip_2.tgz.uu +${PACKAGE}FILES+= test_compat_lz4_1.tar.lz4.uu +${PACKAGE}FILES+= test_compat_lz4_2.tar.lz4.uu +${PACKAGE}FILES+= test_compat_lz4_3.tar.lz4.uu +${PACKAGE}FILES+= test_compat_lz4_B4.tar.lz4.uu +${PACKAGE}FILES+= test_compat_lz4_B4BD.tar.lz4.uu +${PACKAGE}FILES+= test_compat_lz4_B4BDBX.tar.lz4.uu +${PACKAGE}FILES+= test_compat_lz4_B5.tar.lz4.uu +${PACKAGE}FILES+= test_compat_lz4_B5BD.tar.lz4.uu +${PACKAGE}FILES+= test_compat_lz4_B6.tar.lz4.uu +${PACKAGE}FILES+= test_compat_lz4_B6BD.tar.lz4.uu +${PACKAGE}FILES+= test_compat_lz4_B7.tar.lz4.uu +${PACKAGE}FILES+= test_compat_lz4_B7BD.tar.lz4.uu +${PACKAGE}FILES+= test_compat_lzip_1.tlz.uu +${PACKAGE}FILES+= test_compat_lzip_2.tlz.uu +${PACKAGE}FILES+= test_compat_lzip_3.lz.uu +${PACKAGE}FILES+= test_compat_lzip_4.tlz.uu +${PACKAGE}FILES+= test_compat_lzma_1.tlz.uu +${PACKAGE}FILES+= test_compat_lzma_2.tlz.uu +${PACKAGE}FILES+= test_compat_lzma_3.tlz.uu +${PACKAGE}FILES+= test_compat_lzop_1.tar.lzo.uu +${PACKAGE}FILES+= test_compat_lzop_2.tar.lzo.uu +${PACKAGE}FILES+= test_compat_lzop_3.tar.lzo.uu +${PACKAGE}FILES+= test_compat_mac-1.tar.Z.uu +${PACKAGE}FILES+= test_compat_mac-2.tar.Z.uu +${PACKAGE}FILES+= test_compat_perl_archive_tar.tar.uu +${PACKAGE}FILES+= test_compat_plexus_archiver_tar.tar.uu +${PACKAGE}FILES+= test_compat_solaris_pax_sparse_1.pax.Z.uu +${PACKAGE}FILES+= test_compat_solaris_pax_sparse_2.pax.Z.uu +${PACKAGE}FILES+= test_compat_solaris_tar_acl.tar.uu +${PACKAGE}FILES+= test_compat_star_acl_nfs4.tar.uu +${PACKAGE}FILES+= test_compat_star_acl_posix1e.tar.uu +${PACKAGE}FILES+= test_compat_tar_directory_1.tar.uu +${PACKAGE}FILES+= test_compat_tar_hardlink_1.tar.uu +${PACKAGE}FILES+= test_compat_uudecode_large.tar.Z.uu +${PACKAGE}FILES+= test_compat_xz_1.txz.uu +${PACKAGE}FILES+= test_compat_zip_1.zip.uu +${PACKAGE}FILES+= test_compat_zip_2.zip.uu +${PACKAGE}FILES+= test_compat_zip_3.zip.uu +${PACKAGE}FILES+= test_compat_zip_4.zip.uu +${PACKAGE}FILES+= test_compat_zip_5.zip.uu +${PACKAGE}FILES+= test_compat_zip_6.zip.uu +${PACKAGE}FILES+= test_compat_zip_7.xps.uu +${PACKAGE}FILES+= test_compat_zip_8.zip.uu +${PACKAGE}FILES+= test_compat_zstd_1.tar.zst.uu +${PACKAGE}FILES+= test_compat_zstd_2.tar.zst.uu +${PACKAGE}FILES+= test_pax_filename_encoding.tar.uu +${PACKAGE}FILES+= test_pax_xattr_header_all.tar.uu +${PACKAGE}FILES+= test_pax_xattr_header_libarchive.tar.uu +${PACKAGE}FILES+= test_pax_xattr_header_schily.tar.uu +${PACKAGE}FILES+= test_rar_multivolume_multiple_files.part1.rar.uu +${PACKAGE}FILES+= test_rar_multivolume_multiple_files.part2.rar.uu +${PACKAGE}FILES+= test_rar_multivolume_multiple_files.part3.rar.uu +${PACKAGE}FILES+= test_rar_multivolume_multiple_files.part4.rar.uu +${PACKAGE}FILES+= test_rar_multivolume_multiple_files.part5.rar.uu +${PACKAGE}FILES+= test_rar_multivolume_multiple_files.part6.rar.uu +${PACKAGE}FILES+= test_rar_multivolume_single_file.part1.rar.uu +${PACKAGE}FILES+= test_rar_multivolume_single_file.part2.rar.uu +${PACKAGE}FILES+= test_rar_multivolume_single_file.part3.rar.uu +${PACKAGE}FILES+= test_rar_multivolume_uncompressed_files.part01.rar.uu +${PACKAGE}FILES+= test_rar_multivolume_uncompressed_files.part02.rar.uu +${PACKAGE}FILES+= test_rar_multivolume_uncompressed_files.part03.rar.uu +${PACKAGE}FILES+= test_rar_multivolume_uncompressed_files.part04.rar.uu +${PACKAGE}FILES+= test_rar_multivolume_uncompressed_files.part05.rar.uu +${PACKAGE}FILES+= test_rar_multivolume_uncompressed_files.part06.rar.uu +${PACKAGE}FILES+= test_rar_multivolume_uncompressed_files.part07.rar.uu +${PACKAGE}FILES+= test_rar_multivolume_uncompressed_files.part08.rar.uu +${PACKAGE}FILES+= test_rar_multivolume_uncompressed_files.part09.rar.uu +${PACKAGE}FILES+= test_rar_multivolume_uncompressed_files.part10.rar.uu +${PACKAGE}FILES+= test_read_filter_grzip.tar.grz.uu +${PACKAGE}FILES+= test_read_filter_lrzip.tar.lrz.uu +${PACKAGE}FILES+= test_read_filter_lzop.tar.lzo.uu +${PACKAGE}FILES+= test_read_filter_lzop_multiple_parts.tar.lzo.uu +${PACKAGE}FILES+= test_read_filter_uudecode_base64_raw.uu +${PACKAGE}FILES+= test_read_filter_uudecode_raw.uu +${PACKAGE}FILES+= test_read_format_7zip_bcj2_bzip2.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_bcj2_copy_1.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_bcj2_copy_2.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_bcj2_copy_lzma.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_bcj2_deflate.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_deflate_arm64.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_bcj2_lzma1_1.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_bcj2_lzma1_2.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_bcj2_lzma2_1.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_bcj2_lzma2_2.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_bcj_bzip2.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_bcj_copy.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_bcj_deflate.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_bcj_lzma1.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_bcj_lzma2.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_bzip2.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_copy.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_copy_2.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_deflate.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_delta_lzma1.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_delta_lzma2.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_delta4_lzma1.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_delta4_lzma2.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_empty_archive.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_empty_file.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_encryption.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_encryption_header.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_encryption_partially.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_lzma1.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_lzma1_2.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_lzma1_lzma2.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_lzma2.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_lzma2_arm.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_lzma2_arm64.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_malformed.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_malformed2.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_packinfo_digests.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_ppmd.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_solid_zstd.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_symbolic_name.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_zstd.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_zstd_arm.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_zstd_bcj.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_zstd_nobcj.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_win_attrib.7z.uu +${PACKAGE}FILES+= test_read_format_ar.ar.uu +${PACKAGE}FILES+= test_read_format_cab_1.cab.uu +${PACKAGE}FILES+= test_read_format_cab_2.cab.uu +${PACKAGE}FILES+= test_read_format_cab_3.cab.uu +${PACKAGE}FILES+= test_read_format_cab_filename_cp932.cab.uu +${PACKAGE}FILES+= test_read_format_cpio_bin_be.cpio.uu +${PACKAGE}FILES+= test_read_format_cpio_bin_le.cpio.uu +${PACKAGE}FILES+= test_read_format_cpio_filename_cp866.cpio.uu +${PACKAGE}FILES+= test_read_format_cpio_filename_eucjp.cpio.uu +${PACKAGE}FILES+= test_read_format_cpio_filename_koi8r.cpio.uu +${PACKAGE}FILES+= test_read_format_cpio_filename_utf8_jp.cpio.uu +${PACKAGE}FILES+= test_read_format_cpio_filename_utf8_ru.cpio.uu +${PACKAGE}FILES+= test_read_format_cpio_svr4_bzip2_rpm.rpm.uu +${PACKAGE}FILES+= test_read_format_cpio_svr4_gzip_rpm.rpm.uu +${PACKAGE}FILES+= test_read_format_gtar_filename_cp866.tar.Z.uu +${PACKAGE}FILES+= test_read_format_gtar_filename_eucjp.tar.Z.uu +${PACKAGE}FILES+= test_read_format_gtar_filename_koi8r.tar.Z.uu +${PACKAGE}FILES+= test_read_format_gtar_sparse_1_13.tar.uu +${PACKAGE}FILES+= test_read_format_gtar_sparse_1_17.tar.uu +${PACKAGE}FILES+= test_read_format_gtar_sparse_1_17_posix00.tar.uu +${PACKAGE}FILES+= test_read_format_gtar_sparse_1_17_posix01.tar.uu +${PACKAGE}FILES+= test_read_format_gtar_sparse_1_17_posix10.tar.uu +${PACKAGE}FILES+= test_read_format_gtar_sparse_1_17_posix10_modified.tar.uu +${PACKAGE}FILES+= test_read_format_gtar_sparse_skip_entry.tar.Z.uu +${PACKAGE}FILES+= test_read_format_iso.iso.Z.uu +${PACKAGE}FILES+= test_read_format_iso_2.iso.Z.uu +${PACKAGE}FILES+= test_read_format_iso_joliet.iso.Z.uu +${PACKAGE}FILES+= test_read_format_iso_joliet_by_nero.iso.Z.uu +${PACKAGE}FILES+= test_read_format_iso_joliet_long.iso.Z.uu +${PACKAGE}FILES+= test_read_format_iso_joliet_rockridge.iso.Z.uu +${PACKAGE}FILES+= test_read_format_iso_multi_extent.iso.Z.uu +${PACKAGE}FILES+= test_read_format_iso_rockridge.iso.Z.uu +${PACKAGE}FILES+= test_read_format_iso_rockridge_ce.iso.Z.uu +${PACKAGE}FILES+= test_read_format_iso_rockridge_new.iso.Z.uu +${PACKAGE}FILES+= test_read_format_iso_rockridge_rr_moved.iso.Z.uu +${PACKAGE}FILES+= test_read_format_iso_xorriso.iso.Z.uu +${PACKAGE}FILES+= test_read_format_iso_zisofs.iso.Z.uu +${PACKAGE}FILES+= test_read_format_lha_bugfix_0.lzh.uu +${PACKAGE}FILES+= test_read_format_lha_filename_cp932.lzh.uu +${PACKAGE}FILES+= test_read_format_lha_filename_utf16.lzh.uu +${PACKAGE}FILES+= test_read_format_lha_header0.lzh.uu +${PACKAGE}FILES+= test_read_format_lha_header1.lzh.uu +${PACKAGE}FILES+= test_read_format_lha_header2.lzh.uu +${PACKAGE}FILES+= test_read_format_lha_header3.lzh.uu +${PACKAGE}FILES+= test_read_format_lha_lh0.lzh.uu +${PACKAGE}FILES+= test_read_format_lha_lh6.lzh.uu +${PACKAGE}FILES+= test_read_format_lha_lh7.lzh.uu +${PACKAGE}FILES+= test_read_format_lha_withjunk.lzh.uu +${PACKAGE}FILES+= test_read_format_mtree.mtree.uu +${PACKAGE}FILES+= test_read_format_mtree_crash747.mtree.bz2.uu +${PACKAGE}FILES+= test_read_format_mtree_nomagic.mtree.uu +${PACKAGE}FILES+= test_read_format_mtree_nomagic2.mtree.uu +${PACKAGE}FILES+= test_read_format_mtree_nomagic3.mtree.uu +${PACKAGE}FILES+= test_read_format_mtree_noprint.mtree.uu +${PACKAGE}FILES+= test_read_format_rar.rar.uu +${PACKAGE}FILES+= test_read_format_rar_binary_data.rar.uu +${PACKAGE}FILES+= test_read_format_rar_compress_best.rar.uu +${PACKAGE}FILES+= test_read_format_rar_compress_normal.rar.uu +${PACKAGE}FILES+= test_read_format_rar_encryption_data.rar.uu +${PACKAGE}FILES+= test_read_format_rar_encryption_header.rar.uu +${PACKAGE}FILES+= test_read_format_rar_encryption_partially.rar.uu +${PACKAGE}FILES+= test_read_format_rar_filter.rar.uu +${PACKAGE}FILES+= test_read_format_rar_invalid1.rar.uu +${PACKAGE}FILES+= test_read_format_rar_multi_lzss_blocks.rar.uu +${PACKAGE}FILES+= test_read_format_rar_multivolume.part0001.rar.uu +${PACKAGE}FILES+= test_read_format_rar_multivolume.part0002.rar.uu +${PACKAGE}FILES+= test_read_format_rar_multivolume.part0003.rar.uu +${PACKAGE}FILES+= test_read_format_rar_multivolume.part0004.rar.uu +${PACKAGE}FILES+= test_read_format_rar_noeof.rar.uu +${PACKAGE}FILES+= test_read_format_rar_ppmd_lzss_conversion.rar.uu +${PACKAGE}FILES+= test_read_format_rar_ppmd_use_after_free.rar.uu +${PACKAGE}FILES+= test_read_format_rar_ppmd_use_after_free2.rar.uu +${PACKAGE}FILES+= test_read_format_rar_sfx.exe.uu +${PACKAGE}FILES+= test_read_format_rar_subblock.rar.uu +${PACKAGE}FILES+= test_read_format_rar_unicode.rar.uu +${PACKAGE}FILES+= test_read_format_rar_windows.rar.uu +${PACKAGE}FILES+= test_read_format_rar5_arm.rar.uu +${PACKAGE}FILES+= test_read_format_rar5_arm_filter_on_window_boundary.rar.uu +${PACKAGE}FILES+= test_read_format_rar5_bad_window_sz_in_mltarc_file.rar.uu +${PACKAGE}FILES+= test_read_format_rar5_blake2.rar.uu +${PACKAGE}FILES+= test_read_format_rar5_block_size_is_too_small.rar.uu +${PACKAGE}FILES+= test_read_format_rar5_compressed.rar.uu +${PACKAGE}FILES+= test_read_format_rar5_decode_number_out_of_bounds_read.rar.uu +${PACKAGE}FILES+= test_read_format_rar5_different_solid_window_size.rar.uu +${PACKAGE}FILES+= test_read_format_rar5_different_window_size.rar.uu +${PACKAGE}FILES+= test_read_format_rar5_different_winsize_on_merge.rar.uu +${PACKAGE}FILES+= test_read_format_rar5_distance_overflow.rar.uu +${PACKAGE}FILES+= test_read_format_rar5_extra_field_version.rar.uu +${PACKAGE}FILES+= test_read_format_rar5_fileattr.rar.uu +${PACKAGE}FILES+= test_read_format_rar5_hardlink.rar.uu +${PACKAGE}FILES+= test_read_format_rar5_invalid_dict_reference.rar.uu +${PACKAGE}FILES+= test_read_format_rar5_leftshift1.rar.uu +${PACKAGE}FILES+= test_read_format_rar5_leftshift2.rar.uu +${PACKAGE}FILES+= test_read_format_rar5_multiarchive.part01.rar.uu +${PACKAGE}FILES+= test_read_format_rar5_multiarchive.part02.rar.uu +${PACKAGE}FILES+= test_read_format_rar5_multiarchive.part03.rar.uu +${PACKAGE}FILES+= test_read_format_rar5_multiarchive.part04.rar.uu +${PACKAGE}FILES+= test_read_format_rar5_multiarchive.part05.rar.uu +${PACKAGE}FILES+= test_read_format_rar5_multiarchive.part06.rar.uu +${PACKAGE}FILES+= test_read_format_rar5_multiarchive.part07.rar.uu +${PACKAGE}FILES+= test_read_format_rar5_multiarchive.part08.rar.uu +${PACKAGE}FILES+= test_read_format_rar5_multiarchive_solid.part01.rar.uu +${PACKAGE}FILES+= test_read_format_rar5_multiarchive_solid.part02.rar.uu +${PACKAGE}FILES+= test_read_format_rar5_multiarchive_solid.part03.rar.uu +${PACKAGE}FILES+= test_read_format_rar5_multiarchive_solid.part04.rar.uu +${PACKAGE}FILES+= test_read_format_rar5_multiple_files.rar.uu +${PACKAGE}FILES+= test_read_format_rar5_multiple_files_solid.rar.uu +${PACKAGE}FILES+= test_read_format_rar5_nonempty_dir_stream.rar.uu +${PACKAGE}FILES+= test_read_format_rar5_owner.rar.uu +${PACKAGE}FILES+= test_read_format_rar5_readtables_overflow.rar.uu +${PACKAGE}FILES+= test_read_format_rar5_sfx.exe.uu +${PACKAGE}FILES+= test_read_format_rar5_solid.rar.uu +${PACKAGE}FILES+= test_read_format_rar5_stored.rar.uu +${PACKAGE}FILES+= test_read_format_rar5_stored_manyfiles.rar.uu +${PACKAGE}FILES+= test_read_format_rar5_symlink.rar.uu +${PACKAGE}FILES+= test_read_format_rar5_truncated_huff.rar.uu +${PACKAGE}FILES+= test_read_format_rar5_unicode.rar.uu +${PACKAGE}FILES+= test_read_format_rar5_win32.rar.uu +${PACKAGE}FILES+= test_read_format_rar5_window_buf_and_size_desync.rar.uu +${PACKAGE}FILES+= test_read_format_raw.bufr.uu +${PACKAGE}FILES+= test_read_format_raw.data.Z.uu +${PACKAGE}FILES+= test_read_format_raw.data.gz.uu +${PACKAGE}FILES+= test_read_format_raw.data.uu +${PACKAGE}FILES+= test_read_format_tar_concatenated.tar.uu +${PACKAGE}FILES+= test_read_format_tar_empty_filename.tar.uu +${PACKAGE}FILES+= test_read_format_tar_empty_with_gnulabel.tar.uu +${PACKAGE}FILES+= test_read_format_tar_empty_pax.tar.Z.uu +${PACKAGE}FILES+= test_read_format_tar_filename_koi8r.tar.Z.uu +${PACKAGE}FILES+= test_read_format_tar_invalid_pax_size.tar.uu +${PACKAGE}FILES+= test_read_format_ustar_filename_cp866.tar.Z.uu +${PACKAGE}FILES+= test_read_format_ustar_filename_eucjp.tar.Z.uu +${PACKAGE}FILES+= test_read_format_ustar_filename_koi8r.tar.Z.uu +${PACKAGE}FILES+= test_read_format_warc.warc.uu ++${PACKAGE}FILES+= test_read_format_xar_doublelink.xar.uu +${PACKAGE}FILES+= test_read_format_zip.zip.uu +${PACKAGE}FILES+= test_read_format_zip_7075_utf8_paths.zip.uu +${PACKAGE}FILES+= test_read_format_zip_7z_deflate.zip.uu +${PACKAGE}FILES+= test_read_format_zip_7z_lzma.zip.uu +${PACKAGE}FILES+= test_read_format_zip_bz2_hang.zip.uu +${PACKAGE}FILES+= test_read_format_zip_bzip2.zipx.uu +${PACKAGE}FILES+= test_read_format_zip_bzip2_multi.zipx.uu +${PACKAGE}FILES+= test_read_format_zip_comment_stored_1.zip.uu +${PACKAGE}FILES+= test_read_format_zip_comment_stored_2.zip.uu +${PACKAGE}FILES+= test_read_format_zip_encryption_data.zip.uu +${PACKAGE}FILES+= test_read_format_zip_encryption_header.zip.uu +${PACKAGE}FILES+= test_read_format_zip_encryption_partially.zip.uu +${PACKAGE}FILES+= test_read_format_zip_extra_padding.zip.uu +${PACKAGE}FILES+= test_read_format_zip_filename_cp866.zip.uu +${PACKAGE}FILES+= test_read_format_zip_filename_cp932.zip.uu +${PACKAGE}FILES+= test_read_format_zip_filename_koi8r.zip.uu +${PACKAGE}FILES+= test_read_format_zip_filename_utf8_jp.zip.uu +${PACKAGE}FILES+= test_read_format_zip_filename_utf8_ru.zip.uu +${PACKAGE}FILES+= test_read_format_zip_filename_utf8_ru2.zip.uu +${PACKAGE}FILES+= test_read_format_zip_high_compression.zip.uu +${PACKAGE}FILES+= test_read_format_zip_jar.jar.uu +${PACKAGE}FILES+= test_read_format_zip_length_at_end.zip.uu +${PACKAGE}FILES+= test_read_format_zip_lzma_alone_leak.zipx.uu +${PACKAGE}FILES+= test_read_format_zip_lzma.zipx.uu +${PACKAGE}FILES+= test_read_format_zip_lzma_multi.zipx.uu +${PACKAGE}FILES+= test_read_format_zip_lzma_stream_end.zipx.uu +${PACKAGE}FILES+= test_read_format_zip_mac_metadata.zip.uu +${PACKAGE}FILES+= test_read_format_zip_malformed1.zip.uu *** 46 LINES SKIPPED *** From nobody Mon Apr 29 10:11:43 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VSfHz59Twz5J0ND; Mon, 29 Apr 2024 10:11: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VSfHz4fkjz4j9V; Mon, 29 Apr 2024 10:11:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714385503; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dCHnr1z7+grLqH/JC3A0ZRgQjE21sqB+KeSqZs/1yMA=; b=Gtq5y60mnx5JOM9qYNjFoY/nwq/enIw95x61LY+cED5HnMPyqO3GG/R8pRW/QZVTcmIwb+ erP4Hul/W3zYaJ4OsBawFQdugmo1/Kn70g8bb5pmC7TmR85cbGqcGL5CsdOXRENDASLneK 3TbxO4FWVCsLbjtgVj4XGx+pQwUYdjk11hWSD91/T2Xh2P8AyNa3Wpkllz0ESEeewimLL/ QM5M8mGgNzDWZzXQ0jwtRgAfEgSaB6f3Rq67XH04RLR7+WtyJWTPbT1b0xG3LpI4GkDli2 eK1TskTUfG5g5AdLfNr/LxPFJglCFdwQ65ax+24SJjA45swc35XaFgRKE1VKIw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714385503; a=rsa-sha256; cv=none; b=pbpxNZt6Az+pnaIjocbJhfhB4NufkT/Fj45ZsemR4yYMlbkViCB4C7UEDVUhyF0g36T5br 4UtE1BSAC7S8KQSLSA+RGJBIwVfITmJ+hvHUq0VJ3p56LfjddDxJKHhatgc/on7VCcCGM5 IWD3PQHv0cZFKQvLLY0bV6DBsaplxYY75jCzfGkuXgUv2QIenrn9X1dgETjTN5yQni99EL /VikIbmA4zbHEDB4NIf/+31v87/OYNm/6ZXyY10+bgr2XyTv5GlJyPfhAdQ9H0o26peU8f 11GD5BHqXrgNVk+XQnea+pUQ+X0TVGLlL51GMDrAzWi7jtJM4+PuN7gwAbiXdw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714385503; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dCHnr1z7+grLqH/JC3A0ZRgQjE21sqB+KeSqZs/1yMA=; b=U9AmPBxEDcOJisdgBnEApjaxXHvRlIbjcPTABUy0CmpKXQPpE8y2WIImqnMvjLhbKp+J63 XmIG0IHdG6z9ZMLPPDelK7f3/7dBGwuIIZ6im1w/pTyHPW0wkvjR0gpPYZxi+3hmDTiuqX v7bdAbRckgW2JzNgDvMaSH5eWf0HIWz/6QsVDj5Qaf/2lis1jHlePIDpmiQKTaHoEmlfaY czkcuCk3R6Lhgq1GP4Ikt1Y3Oe+97b6ybmeSIU30yzYEt2GwOoPoYBndDnJXo5/ayMHIbI ut0eftHhEgGcMV0cOMIzT4iDZLTk7m/nfE1ds/pE9T8yRdIdbKghMDQsn/RiQg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VSfHz4GCBz14lL; Mon, 29 Apr 2024 10:11:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43TABh35033002; Mon, 29 Apr 2024 10:11:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43TABh0Z032999; Mon, 29 Apr 2024 10:11:43 GMT (envelope-from git) Date: Mon, 29 Apr 2024 10:11:43 GMT Message-Id: <202404291011.43TABh0Z032999@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: c28253ecde33 - main - libulog: Make sure ut_line, ut_user, ut_host are terminated. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: c28253ecde333c9908b7160664805acc3a92e2b0 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=c28253ecde333c9908b7160664805acc3a92e2b0 commit c28253ecde333c9908b7160664805acc3a92e2b0 Author: Dag-Erling Smørgrav AuthorDate: 2024-04-29 10:11:12 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-04-29 10:11:37 +0000 libulog: Make sure ut_line, ut_user, ut_host are terminated. MFC after: 3 days Reviewed by: bapt Differential Revision: https://reviews.freebsd.org/D45004 --- lib/libulog/ulog_login.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/libulog/ulog_login.c b/lib/libulog/ulog_login.c index c51c56a31f4a..103543458485 100644 --- a/lib/libulog/ulog_login.c +++ b/lib/libulog/ulog_login.c @@ -49,7 +49,7 @@ ulog_fill(struct utmpx *utx, const char *line) utx->ut_pid = getpid(); gettimeofday(&utx->ut_tv, NULL); - strncpy(utx->ut_line, line, sizeof utx->ut_line); + strlcpy(utx->ut_line, line, sizeof utx->ut_line); SHA1_Init(&c); SHA1_Update(&c, "libulog", 7); @@ -66,9 +66,9 @@ ulog_login(const char *line, const char *user, const char *host) ulog_fill(&utx, line); utx.ut_type = USER_PROCESS; - strncpy(utx.ut_user, user, sizeof utx.ut_user); + strlcpy(utx.ut_user, user, sizeof utx.ut_user); if (host != NULL) - strncpy(utx.ut_host, host, sizeof utx.ut_host); + strlcpy(utx.ut_host, host, sizeof utx.ut_host); pututxline(&utx); } From nobody Mon Apr 29 10:30:09 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VSfjF47B9z5J2MJ; Mon, 29 Apr 2024 10:30: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VSfjF3Z1Gz4ktD; Mon, 29 Apr 2024 10:30:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714386609; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AX8aUhsrQBCcrXDAUDZlKW6TAJkH+SquYqhc5BtbLDs=; b=fWkCG5rT3McwIVNB+cXNAlE8bun/xgZt6oR9lvpYXjjSeGSKnzQ+pze7yetbaKUaX5uks7 Z0IXqU3r5y3FbpJmP4PKD1l3wupUY57Xf8nbMSnLFFjaAhxitK3RnXOzBP+d9oejetd/DC kV2Dt+WjWPBTw1UB2jl8tg49BH9MBh1MBZEYqkS6JyKUReOrCCB/KhJpRO3IqMN+s+lqM1 p6SOsOZ93hQjpvF7W0QfXjz2S6D+1UM/SkBMXRvEZMYeNZMlk6g+GI/KHolyr8OGwcKaU6 ysL6x7Z04ntkhNaSKE+gzdWllH2ZTa59k+/ndPJIUOIFe7rxPtzQeHM0YoGM+A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714386609; a=rsa-sha256; cv=none; b=XTWOKPmLFYwpJ7vvB7f1LQRk0OfcwwEF6PqEu4tqO/dSdWqZo6qAAQxnhTFUBBA7fsDUwm t4vjjudWl8H/5nDxJoi2Exb3IGzxR7YqZHq1Drx1bfHrW+qASjfcdC1lkdAWIZoxn3vpOB QVLuijXg/7qppUE5h6PMBFSbrx+8E2uPYV81WeUzLA+qFoCfHskxOHI0zdEX4mWfsOCWcf w2IuC9dVVAc+MK5s4nwdFw9xuWgEubygsfvKuXVSk5J5UL2wjaDOIA9rtkcLDis9uOmjGJ 4bS82T2d45XvbGtpeY02auub/H7HeFpnwROANnU1IT6uXyoAuoT5qFCAKzFueQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714386609; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AX8aUhsrQBCcrXDAUDZlKW6TAJkH+SquYqhc5BtbLDs=; b=DXwUIQfcgDQYqEv2WWLHLt+CphO/F+b/FdGiSICjyE0qogozz3RKE1eBizO5P03pFLUfyk /FxFesesX1hYPA9I27ltcdBuONpbU8H3AVsQ6df4H526+3l+DvI2I1/sck53WxpAETbaC0 2GAoHghMlbjZgxSkg6b4LPB61jGxKXjrior1+MY6FVFdxWdtaRNjWPyIrsZp3pDnmTpYgx yE7WAF9IPY2niooySHnAujsG4fd8HGpblTiJL5MUisQMbxzqNj3SDBPmoIhbhoWLyjGVzX Y8D6D9jOyzDmQ64MYWiDAraljmkczg7kZii3uCNdwukqx85Pa3PbgmG/8nAGIQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VSfjF32sdz14w9; Mon, 29 Apr 2024 10:30:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43TAU90l058240; Mon, 29 Apr 2024 10:30:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43TAU9QQ058234; Mon, 29 Apr 2024 10:30:09 GMT (envelope-from git) Date: Mon, 29 Apr 2024 10:30:09 GMT Message-Id: <202404291030.43TAU9QQ058234@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: 9e8618276fad - main - adduser: Really fix a syntax error List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 9e8618276fada5c68cc64676fba2ae2abd0544f5 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=9e8618276fada5c68cc64676fba2ae2abd0544f5 commit 9e8618276fada5c68cc64676fba2ae2abd0544f5 Author: Dag-Erling Smørgrav AuthorDate: 2024-04-29 10:29:35 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-04-29 10:29:35 +0000 adduser: Really fix a syntax error Fixes: 5cafc38f1129 Differential Revision: https://reviews.freebsd.org/D44871 --- usr.sbin/adduser/adduser.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usr.sbin/adduser/adduser.sh b/usr.sbin/adduser/adduser.sh index 9739b2e589fa..e9027b6b7876 100644 --- a/usr.sbin/adduser/adduser.sh +++ b/usr.sbin/adduser/adduser.sh @@ -477,7 +477,8 @@ get_zfs_home() { # check if zfs kernel module is loaded before attempting to run zfs to # prevent loading the kernel module on systems that don't use ZFS - if ! "$KLDSTATCMD" -q -m zfs || Zcreate="no"; then + if ! "$KLDSTATCMD" -q -m zfs; then + Zcreate="no" return fi if ! _prefix=$(${ZFSCMD} list -Ho name "${homeprefix}" 2>/dev/null) || From nobody Mon Apr 29 14:18:13 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VSlmP3Dmsz5JQfh; Mon, 29 Apr 2024 14:18: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VSlmP2PwBz4Fym; Mon, 29 Apr 2024 14:18:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714400293; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5XE6PnocBMZyXiGUZEJpx+jXkn/ngqfsqbGMRjWaEUw=; b=UHS27KAxvvOMx2nyNxt751LiECcwOOOdLVgx1lKWfFDEMoHXmdTmaTSp+7CWKL5BBWripz 5vH5Rvd5GF7kCk2ByOTPPJ9y0UaFI7pqaipX7ZxYO9s1gj4dNO/Vq9c1Ltarf1qJOszH7q Niw0kvmcHxzApmhkryA2ExiQNZ5FDZqrGPE5+U5Ttutt/uKhcWsqBv2LWTZ8ZrIsmxQ8pa W+WVbyWN6WB0JbSff/lewSCdAlqb0CbrRAQNSBANxySpUHWM+nG8otYlNtETvy53SSje/0 h38jcX7UQnhPxmrUne3sthZiEZvWhGLCm8LCf7Z5RFmzw+2m9HdVkQdYMuzTAg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714400293; a=rsa-sha256; cv=none; b=FNeRGwZvmfmBuWKPZcAD+/NCMY2D52V7NBDgrumRIrEIGMf4hTzJWP2Cxkfei63KE1TC49 YJiLW1K2dw/AzCUpXeRftJR+DCpq57YQLREkrB1ZJOelcH3tQyKMkI3bifInn5HD0Yu2LU wrlnkUdKFXbf9/rsENHDhY91c5G779820esrfmq6j1zuvph2EZHa/1VrIA2S5oiGoo3TYN acuNFcMOdTy+aJ1p7iJCYNFOsdXUsr4ra9/vR06VNdv6joTkp2L8L119ViZ0QrD8y/kK21 F7E4LfTktIG2dud8SAkM9Iab8NntuUKIw+WKIoTFhiZPzTdaQOv3iYnkOhBg5A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714400293; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5XE6PnocBMZyXiGUZEJpx+jXkn/ngqfsqbGMRjWaEUw=; b=TBGPUHeQHbjV+jd7BKDPZGotp254jcNwsi/Bojkc+xQ8ItI89xH8t+yDGViq5r6bVb/io9 3iPOCqf9FO63/y2+qLCmuYDG7WoJowAfLFgaJG2qOP+6i1CUpvtDP0ofi0TIpH5ylWdy/X tBMWPSgWnY8POKdAuuWPEq3jI7MN/+HMN/1em84BD9nbeM2A1minftzC/hqgYdtGwSkttt Acuoo/qf1EBIiee+omEfqgXtEGN6yaiE4k9SlQsQXZ8OnqV/BvKsaQRuvgzERyknhLtZ6F AzF5F4X1jd5OUBrNHKnbOzp5jcnJe7FEPUIMure/vR2d3rLzdurh8TdyyqjGtg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VSlmP20yYz1Bj1; Mon, 29 Apr 2024 14:18:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43TEIDvB046948; Mon, 29 Apr 2024 14:18:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43TEIDUx046945; Mon, 29 Apr 2024 14:18:13 GMT (envelope-from git) Date: Mon, 29 Apr 2024 14:18:13 GMT Message-Id: <202404291418.43TEIDUx046945@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: 390e44988aea - main - bhyve: Fix handling of -r List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 390e44988aeaa824a9ea4f0e352f9a252093c170 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=390e44988aeaa824a9ea4f0e352f9a252093c170 commit 390e44988aeaa824a9ea4f0e352f9a252093c170 Author: Mark Johnston AuthorDate: 2024-04-29 14:13:50 +0000 Commit: Mark Johnston CommitDate: 2024-04-29 14:13:50 +0000 bhyve: Fix handling of -r Just make "restore_file" a global variable so that it can be set by the MD option handler. Reviewed by: corvink Reported by: bdrewery Fixes: 981f9f7495bb ("bhyve: Push option parsing down into bhyverun_machdep.c") Differential Revision: https://reviews.freebsd.org/D44974 --- usr.sbin/bhyve/bhyverun.c | 7 ++++--- usr.sbin/bhyve/bhyverun.h | 4 ++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/usr.sbin/bhyve/bhyverun.c b/usr.sbin/bhyve/bhyverun.c index 1c3b810efb02..d199c32cc54b 100644 --- a/usr.sbin/bhyve/bhyverun.c +++ b/usr.sbin/bhyve/bhyverun.c @@ -100,6 +100,10 @@ uint16_t cpu_cores, cpu_sockets, cpu_threads; int raw_stdio = 0; +#ifdef BHYVE_SNAPSHOT +char *restore_file; +#endif + static const int BSP = 0; static cpuset_t cpumask; @@ -656,10 +660,7 @@ main(int argc, char *argv[]) size_t memsize; const char *value, *vmname; #ifdef BHYVE_SNAPSHOT - char *restore_file; struct restore_state rstate; - - restore_file = NULL; #endif bhyve_init_config(); diff --git a/usr.sbin/bhyve/bhyverun.h b/usr.sbin/bhyve/bhyverun.h index e6ff90e5daa0..005de6dc5410 100644 --- a/usr.sbin/bhyve/bhyverun.h +++ b/usr.sbin/bhyve/bhyverun.h @@ -37,6 +37,10 @@ extern int guest_ncpus; extern uint16_t cpu_cores, cpu_sockets, cpu_threads; +#ifdef BHYVE_SNAPSHOT +extern char *restore_file; +#endif + struct vcpu; struct vmctx; struct vm_run; From nobody Mon Apr 29 14:21:42 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VSlrR1XZSz5JQpm; Mon, 29 Apr 2024 14:21: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VSlrQ6k8Fz4GT6; Mon, 29 Apr 2024 14:21:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714400502; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kRe/i9WnTO4F9lLkbkZSxN32KroFdHPNUk8oMmc4J+A=; b=e35PljwU+Kia/Lyr9VKH99g19UPNPkZx2Qugle5Qnhb7AilXrf5HjsM1vG+lVZBu7TTlE0 DipW0ioBoPX6RSlXpLB3jcONaWZ+m+Hyky0d8hKHpORN1lLGVMu6GZu9sdzfh8NBnLR3Xs /cB0jpjosgsZ2E/EEeehI7kt2LzOfPvfh1oW25ZbYSTFXAmDWebCVe+TedetnFkJHI93+8 Dae5iiD45ibcfdswr2dObEwJbDTYwtnaimFulVFq+p4oG6MEsEFd779mr7E8OYNYsaWcOl oKI7cR0idzv/oHl8m+iYqhrgryCETuiwJZG2t03fZVOgMA76qrJZv02+qab76w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714400502; a=rsa-sha256; cv=none; b=eB2ihFwXnM9c84CzSI0QtYhu+BRWeGmxklJ34+1BGVceyyO400FgRsjwEMUTsWZJSvPsph /XwWfnaUT3vxRg/LJqwvJ7GsX6t4j5ce4LFPF2CAZXrBsHHt+Tmzbc5AA0qYxny4Q7Qfqc LZAbUBbHGv9uKiL3v4uHxA5a9/u5KREyy3gNF51AvBTsvTvkl7DzHVH6dBS1ep/jOPwwOE ZYtBRvLkF7/GcB6CaGcnSAbuOtIVmIvAwO0248+/ucSAceRjGeIE6mzGC1uVnHgZ3CsSiT 6SKfaRf9eC3KEsYWXyPeYYqvFYXPGQXa8aH1xpLFfFTB4z5PaVvCI88WKAqaNw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714400502; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kRe/i9WnTO4F9lLkbkZSxN32KroFdHPNUk8oMmc4J+A=; b=kjMq2yIh79SG6xKSebam4N1KZnofNOOn2h9e7RbW486P4F5LJlmKuYrLQNqc61/PNJ0HK6 U+Q7HEG87rxigTSjTI/Pfh48o/6z+EuZ+K4hNGNVeLYhd1bfEIu0CiRIMaZQXprtIcUgbv qgDlGNzOwubC5BXNxYpSEGmrn75yyYkOYNbYYvyLSYY6Tp8JMuD0v8WNVKPAe3wXF+lOgW NCpTE7RSHNCGs1TTb/iMeGz7udz9s18Yg0cntNyj+p/ZtIlUoOqKaNhIavo5pcOuLxSg4m 8O1kHE4qPHG8Zt6yGp96FSmVK/4DuYl0d/I9DyUMF72LhF1y9IdZ6cP/ue+wtg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VSlrQ62Syz1BZN; Mon, 29 Apr 2024 14:21:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43TELgti059151; Mon, 29 Apr 2024 14:21:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43TELgki059148; Mon, 29 Apr 2024 14:21:42 GMT (envelope-from git) Date: Mon, 29 Apr 2024 14:21:42 GMT Message-Id: <202404291421.43TELgki059148@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: 1ee7a8fa58c3 - main - arm64/vmm: Handle VM_EXITCODE_SUSPENDED List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1ee7a8fa58c3fe7161683f2a7d2e37dc5c672b46 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=1ee7a8fa58c3fe7161683f2a7d2e37dc5c672b46 commit 1ee7a8fa58c3fe7161683f2a7d2e37dc5c672b46 Author: Mark Johnston AuthorDate: 2024-04-29 14:19:27 +0000 Commit: Mark Johnston CommitDate: 2024-04-29 14:19:27 +0000 arm64/vmm: Handle VM_EXITCODE_SUSPENDED This is required for bhyve reboot to work. In particular, unless we suspend vcpu threads here, vm_reinit() will fail with EBUSY. The implementation is copied from amd64; in the not-too-distant future the amd64 and arm64 copies of vmm.c and vmm_dev.c will be merged, so for now it's useful to minimize diffs between amd64 and arm64. Reviewed by: corvink, andrew MFC after: 2 weeks Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D44934 --- sys/arm64/vmm/vmm.c | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/sys/arm64/vmm/vmm.c b/sys/arm64/vmm/vmm.c index 2685e5869b4f..a2cc63448f19 100644 --- a/sys/arm64/vmm/vmm.c +++ b/sys/arm64/vmm/vmm.c @@ -1716,6 +1716,54 @@ vm_handle_paging(struct vcpu *vcpu, bool *retu) return (0); } +static int +vm_handle_suspend(struct vcpu *vcpu, bool *retu) +{ + struct vm *vm = vcpu->vm; + int error, i; + struct thread *td; + + error = 0; + td = curthread; + + CPU_SET_ATOMIC(vcpu->vcpuid, &vm->suspended_cpus); + + /* + * Wait until all 'active_cpus' have suspended themselves. + * + * Since a VM may be suspended at any time including when one or + * more vcpus are doing a rendezvous we need to call the rendezvous + * handler while we are waiting to prevent a deadlock. + */ + vcpu_lock(vcpu); + while (error == 0) { + if (CPU_CMP(&vm->suspended_cpus, &vm->active_cpus) == 0) + break; + + vcpu_require_state_locked(vcpu, VCPU_SLEEPING); + msleep_spin(vcpu, &vcpu->mtx, "vmsusp", hz); + vcpu_require_state_locked(vcpu, VCPU_FROZEN); + if (td_ast_pending(td, TDA_SUSPEND)) { + vcpu_unlock(vcpu); + error = thread_check_susp(td, false); + vcpu_lock(vcpu); + } + } + vcpu_unlock(vcpu); + + /* + * Wakeup the other sleeping vcpus and return to userspace. + */ + for (i = 0; i < vm->maxcpus; i++) { + if (CPU_ISSET(i, &vm->suspended_cpus)) { + vcpu_notify_event(vm_vcpu(vm, i)); + } + } + + *retu = true; + return (error); +} + int vm_run(struct vcpu *vcpu) { @@ -1788,6 +1836,11 @@ restart: error = vm_handle_paging(vcpu, &retu); break; + case VM_EXITCODE_SUSPENDED: + vcpu->nextpc = vme->pc; + error = vm_handle_suspend(vcpu, &retu); + break; + default: /* Handle in userland */ vcpu->nextpc = vme->pc; From nobody Mon Apr 29 14:22:51 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VSlsm1kJpz5JR0b; Mon, 29 Apr 2024 14:22: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VSlsm0xC5z4Gy4; Mon, 29 Apr 2024 14:22:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714400572; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+zZhuPnttFn4IivtQSqjghico5z2OVapxk/lpwiUOMQ=; b=E5EjiUTo30+CtWGlM5SN8YR0omg96e5S9zZXohCRzV0D1jnhq+1vhnTrhqKEMSlDOWXemQ soGRvAVqNlpRC1QbbG5r+R2ZuUcKzccs+iPVycGg9+wyMnRt87oqWKVysE3zouaoy2/cKZ ajUz1n//vBHmcjMGBCD2Ou+ToRYJCzyzNeNtBMxHuZgqaPK2/EVk/dqXn5TPStFtEj+eK6 rlOKAC6eGISOxD1cG+OFORCIas4ye3x9QHgQnO48PGSlvwjh4NbEEvaxUHkNKqnD8DhOU1 8AWjS8sEhzAuOnN26kDgZBRqmRwSLAFLIMuAZZnrVmElB34uwaR7rYWHsci0cA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714400572; a=rsa-sha256; cv=none; b=TbeDPMw3X1nvhfycE/giOk5meKrHMOuZq/NMjffF4XkIldu+rT1iUuAN8DfigxsuxF6S5U VWA7dxQgGUXcWXIJW4WQsw++zXP8MZTOXYkWi8ISlXlcmWFO6Zdsm1ptsafAzfGl8N+97I DTPWen99pCIukz5W3JpilCEiQ3GuHVV0inFYYnsOOdwYZcM79l3tSweLt/NvwK/c3wdcbl Mfu0tjXn0tky/QcF3VrbxRZ5r0U9fy0UQvbuvIv8ENb/IVuqbXL0jBvWghsyDsEE2n1pFH jGWUsmicCxobyeyilC0dJGBfJHZVBualynjDO9lu5XkVMlj1KaMtzYnv3gH5qw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714400572; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+zZhuPnttFn4IivtQSqjghico5z2OVapxk/lpwiUOMQ=; b=pB14mqjrn1ei4OfgSCwxgCS4SNfcP1dD1pWtOY2oYQt59Y0ULoRgg5UG3z1nHa4x6lLy94 NWPDMXGH0F/Z0kXq0GiYsqMc2OJhPjYK1zC79yeWUF9JQ4VcLpHRyx1FZLh364GrsgD5Jr ys/4gPMO0JT6/smn8Pe55g1GdvKzukMv2us9loS2+TxOhwxKEnomoAmuvfHkeMOhv5j1rG esb9axB80qTpwjrDScraLxEb10pop32CEVu2ewmcX7cD8VYVcO/vupW5lVINbxk0LlW/Zy KvzYpwh/B7RK8xWRBTqDguDVKSKgV25TTcyUIyDkAGpc0gVgThTxOxR5W6SKvg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VSlsm0XY8z1BwF; Mon, 29 Apr 2024 14:22:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43TEMpDt062957; Mon, 29 Apr 2024 14:22:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43TEMpJZ062954; Mon, 29 Apr 2024 14:22:51 GMT (envelope-from git) Date: Mon, 29 Apr 2024 14:22:51 GMT Message-Id: <202404291422.43TEMpJZ062954@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: b2b8fa1a64af - main - Add libxo support to du List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: b2b8fa1a64af81e940d7b3ab71fd4c583b4abe0f Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=b2b8fa1a64af81e940d7b3ab71fd4c583b4abe0f commit b2b8fa1a64af81e940d7b3ab71fd4c583b4abe0f Author: Nathan Huff AuthorDate: 2024-04-29 04:59:18 +0000 Commit: Warner Losh CommitDate: 2024-04-29 14:22:39 +0000 Add libxo support to du Convert du to use libxo enabling structured output. [[ minor style fixes by imp ]] Signed-off-by: Nathan Huff Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1145 --- usr.bin/du/Makefile | 2 +- usr.bin/du/du.1 | 12 ++++++++++- usr.bin/du/du.c | 57 ++++++++++++++++++++++++++++++++++------------------- 3 files changed, 49 insertions(+), 22 deletions(-) diff --git a/usr.bin/du/Makefile b/usr.bin/du/Makefile index 38f638a04de6..7fb61d0423df 100644 --- a/usr.bin/du/Makefile +++ b/usr.bin/du/Makefile @@ -3,7 +3,7 @@ PACKAGE= runtime PROG= du -LIBADD= util +LIBADD= xo util HAS_TESTS= SUBDIR.${MK_TESTS}+= tests diff --git a/usr.bin/du/du.1 b/usr.bin/du/du.1 index 931ca137ee9b..568fded38073 100644 --- a/usr.bin/du/du.1 +++ b/usr.bin/du/du.1 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd August 1, 2019 +.Dd April 29, 2024 .Dt DU 1 .Os .Sh NAME @@ -33,6 +33,7 @@ .Nd display disk usage statistics .Sh SYNOPSIS .Nm +.Op Fl -libxo .Op Fl Aclnx .Op Fl H | L | P .Op Fl g | h | k | m @@ -52,6 +53,13 @@ the current directory is displayed. .Pp The options are as follows: .Bl -tag -width indent +.It Fl -libxo +Generate output via +.Xr libxo 3 +in a selection of different human and machine readable formats. +See +.Xr xo_parse_args 3 +for details on command line arguments. .It Fl A Display the apparent size instead of the disk usage. This can be helpful when operating on compressed volumes or sparse files. @@ -216,6 +224,8 @@ Also display a grand total at the end: .Xr df 1 , .Xr chflags 2 , .Xr fts 3 , +.Xr libxo 3 , +.Xr xo_parse_args 3 , .Xr symlink 7 , .Xr quot 8 .Sh STANDARDS diff --git a/usr.bin/du/du.c b/usr.bin/du/du.c index cda2470ccca9..96ad7c037dfd 100644 --- a/usr.bin/du/du.c +++ b/usr.bin/du/du.c @@ -48,6 +48,7 @@ #include #include #include +#include #define SI_OPT (CHAR_MAX + 1) @@ -62,7 +63,7 @@ struct ignentry { static int linkchk(FTSENT *); static void usage(void); -static void prthumanval(int64_t); +static void prthumanval(const char *, int64_t); static void ignoreadd(const char *); static void ignoreclean(void); static int ignorep(FTSENT *); @@ -107,6 +108,10 @@ main(int argc, char *argv[]) depth = INT_MAX; SLIST_INIT(&ignores); + argc = xo_parse_args(argc, argv); + if (argc < 0) + exit(EX_USAGE); + while ((ch = getopt_long(argc, argv, "+AB:HI:LPasd:cghklmnrt:x", long_options, NULL)) != -1) switch (ch) { @@ -117,7 +122,7 @@ main(int argc, char *argv[]) errno = 0; cblocksize = atoi(optarg); if (errno == ERANGE || cblocksize <= 0) { - warnx("invalid argument to option B: %s", + xo_warnx("invalid argument to option B: %s", optarg); usage(); } @@ -147,7 +152,7 @@ main(int argc, char *argv[]) errno = 0; depth = atoi(optarg); if (errno == ERANGE || depth < 0) { - warnx("invalid argument to option d: %s", + xo_warnx("invalid argument to option d: %s", optarg); usage(); } @@ -181,7 +186,7 @@ main(int argc, char *argv[]) case 't' : if (expand_number(optarg, &threshold) != 0 || threshold == 0) { - warnx("invalid threshold: %s", optarg); + xo_warnx("invalid threshold: %s", optarg); usage(); } else if (threshold < 0) threshold_sign = -1; @@ -254,6 +259,8 @@ main(int argc, char *argv[]) if ((fts = fts_open(argv, ftsoptions, NULL)) == NULL) err(1, "fts_open"); + xo_open_container("disk-usage-information"); + xo_open_list("paths"); while (errno = 0, (p = fts_read(fts)) != NULL) { switch (p->fts_info) { case FTS_D: /* Ignore. */ @@ -273,15 +280,18 @@ main(int argc, char *argv[]) if (p->fts_level <= depth && threshold <= threshold_sign * howmany(p->fts_bignum * cblocksize, blocksize)) { + xo_open_instance("paths"); if (hflag > 0) { - prthumanval(p->fts_bignum); - (void)printf("\t%s\n", p->fts_path); + prthumanval("{:blocks/%4s}", + p->fts_bignum); + xo_emit("\t{:path/%s}\n", p->fts_path); } else { - (void)printf("%jd\t%s\n", + xo_emit("{:blocks/%jd}\t{:path/%s}\n", (intmax_t)howmany(p->fts_bignum * cblocksize, blocksize), p->fts_path); } + xo_close_instance("paths"); } if (info) { info = 0; @@ -293,7 +303,7 @@ main(int argc, char *argv[]) case FTS_DNR: /* Warn, continue. */ case FTS_ERR: case FTS_NS: - warnx("%s: %s", p->fts_path, strerror(p->fts_errno)); + xo_warnx("%s: %s", p->fts_path, strerror(p->fts_errno)); rval = 1; break; default: @@ -309,36 +319,43 @@ main(int argc, char *argv[]) howmany(p->fts_statp->st_blocks, cblocksize); if (aflag || p->fts_level == 0) { + xo_open_instance("paths"); if (hflag > 0) { - prthumanval(curblocks); - (void)printf("\t%s\n", p->fts_path); + prthumanval("{:blocks/%4s}", curblocks); + xo_emit("\t{:path/%s}\n", p->fts_path); } else { - (void)printf("%jd\t%s\n", + xo_emit("{:blocks/%jd}\t{:path/%s}\n", (intmax_t)howmany(curblocks * cblocksize, blocksize), p->fts_path); } + xo_close_instance("paths"); } p->fts_parent->fts_bignum += curblocks; } savednumber = p->fts_parent->fts_bignum; } + xo_close_list("paths"); if (errno) - err(1, "fts_read"); + xo_err(1, "fts_read"); if (cflag) { if (hflag > 0) { - prthumanval(savednumber); - (void)printf("\ttotal\n"); + prthumanval("{:total-blocks/%4s}\ttotal\n", + savednumber); } else { - (void)printf("%jd\ttotal\n", (intmax_t)howmany( + xo_emit("{:total-blocks/%jd}\ttotal\n", + (intmax_t)howmany( savednumber * cblocksize, blocksize)); } } ignoreclean(); + xo_close_container("disk-usage-information"); + if (xo_finish() < 0) + xo_err(1, "stdout"); exit(rval); } @@ -392,7 +409,7 @@ linkchk(FTSENT *p) if (new_buckets == NULL) { stop_allocating = 1; - warnx("No more memory for tracking hard links"); + xo_warnx("No more memory for tracking hard links"); } else { for (i = 0; i < number_buckets; i++) { while (buckets[i] != NULL) { @@ -458,7 +475,7 @@ linkchk(FTSENT *p) le = malloc(sizeof(struct links_entry)); if (le == NULL) { stop_allocating = 1; - warnx("No more memory for tracking hard links"); + xo_warnx("No more memory for tracking hard links"); return (0); } le->dev = st->st_dev; @@ -474,7 +491,7 @@ linkchk(FTSENT *p) } static void -prthumanval(int64_t bytes) +prthumanval(const char *fmt, int64_t bytes) { char buf[5]; int flags; @@ -488,13 +505,13 @@ prthumanval(int64_t bytes) humanize_number(buf, sizeof(buf), bytes, "", HN_AUTOSCALE, flags); - (void)printf("%4s", buf); + xo_emit(fmt, buf); } static void usage(void) { - (void)fprintf(stderr, + xo_error( "usage: du [-Aclnx] [-H | -L | -P] [-g | -h | -k | -m] " "[-a | -s | -d depth] [-B blocksize] [-I mask] " "[-t threshold] [file ...]\n"); From nobody Mon Apr 29 14:22:53 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VSlsn2zCJz5JRGn; Mon, 29 Apr 2024 14:22: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VSlsn1rPFz4HBH; Mon, 29 Apr 2024 14:22:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714400573; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jhTbN/R5fl4nLsFcI3OlRkPUoESO/BadvcS7f+JjsA0=; b=FUMTZ6wPOjH5+X1RB6Z483o+p0nmV1bdLheH9oaM/pvMOuVBY3lbzIjQGcGIKryjUTIgFk Z1kVrxvITMknsWWlcb/gTpH7gR3YGKx5T2rvz8MOnPy003EYW75CzAt3djFsUUjpuHWC9q MDpFMEgztWIqN+qMpqMQAMpctyhCojBdUOPQm+bVZlLXpHasCA9TgO4FBMWGHC8rshGLN7 MhHLGlsjeqdaJiU5a6Ogbttwm9AHvUS2r5lR7eZo3Lth8Cwd4sn+zuLYF8+xqcp54Fwlb3 7RgZlO7+DU6nUY9O/+J1iYLW6kI8IBcOllK2yCcs4C2Zs0/tpzoRju0FQe3rfA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714400573; a=rsa-sha256; cv=none; b=fF3fqRPkDOnjRDlXW1BIFSieWMH1dwXUbL/HdQ5dSBbeAENEs11yUXimcfNOp5CwmPps8G mzsFluwsIv3x5JxeBjNrs0IRxh3/stsb0lYV7VxjLo/5IDUvOFTMQIlO/MqYmBpNETgicH udf4K6Eg5Vd8D7B4fGY2vtl+sobeSbhRASjUrgzHYv4d3ePs+b83zJimy54mHkMJZ3MH7Q oy4MoD0r2zfwXqE+WTNouU1UiZy0+wJgICPS3V9Y5Zns7ZGOrrTDfRlDsG3Q0HI4S6U1Fp QZ5IcDt9hcBeu2OOB3xU9KwoEaVUOXUH4a+2XEJ3wC9kcL+E0WJbtrBgG6DRfA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714400573; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jhTbN/R5fl4nLsFcI3OlRkPUoESO/BadvcS7f+JjsA0=; b=dswfL2b1HS5QldH/xtwYtFYmeaq2z0xNT+RiKt8sSBMuVZssTwNdTH1aLqBLHJUvvDk0T+ TeNVtLjScwVD/mxJtrBszqWXa9RV1kL/b7IA/NQaCGKHjbTD5oQ7gviPYD43FuXKM+d+Id YunI+O+1K6+HNaMfv4rwfiIZlr1+KTkkk2r5bzZ69pW9LShv3cUVgR520q4kyQYduiED+v vIdZWm/SV6qp0XLuNXzxbXx6kYpRCfpsenaBVFs/gPhsiuW71O4u9yH6yV83oUES3alz4X JAeBaok/YR2eW+qa6WBQrsD2cFY1ldzNeez+ABEdZGmU3Y56PCYJ9G4PJo9kEg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VSlsn1SNvz1C3S; Mon, 29 Apr 2024 14:22:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43TEMrFN063000; Mon, 29 Apr 2024 14:22:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43TEMrcE062997; Mon, 29 Apr 2024 14:22:53 GMT (envelope-from git) Date: Mon, 29 Apr 2024 14:22:53 GMT Message-Id: <202404291422.43TEMrcE062997@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: 702766d09a37 - main - services.5: describe better List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 702766d09a37534298676092712864151ab308bd Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=702766d09a37534298676092712864151ab308bd commit 702766d09a37534298676092712864151ab308bd Author: Alexander Ziaee AuthorDate: 2024-04-29 14:00:01 +0000 Commit: Warner Losh CommitDate: 2024-04-29 14:22:39 +0000 services.5: describe better Use a more specific description for this man page, and add SDPX tag while here. Reviewed by: imp, meena Signed-off-by: Alexander Ziaee Pull Request: https://github.com/freebsd/freebsd-src/pull/1194 --- share/man/man5/services.5 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/share/man/man5/services.5 b/share/man/man5/services.5 index 7a94ae4e4f1c..e7f65cb929fd 100644 --- a/share/man/man5/services.5 +++ b/share/man/man5/services.5 @@ -1,3 +1,6 @@ +.\"- +.\" SPDX-License-Identifier: BSD-3-Clause +.\" .\" Copyright (c) 1983, 1991, 1993 .\" The Regents of the University of California. All rights reserved. .\" @@ -25,12 +28,12 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd April 4, 2010 +.Dd April 29, 2024 .Dt SERVICES 5 .Os .Sh NAME .Nm services -.Nd service name data base +.Nd internet service name and port number data base .Sh DESCRIPTION The .Nm From nobody Mon Apr 29 14:30:10 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VSm2B5c31z5JRNd; Mon, 29 Apr 2024 14:30: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VSm2B4pqGz4HtD; Mon, 29 Apr 2024 14:30:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714401010; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=L363En/oHn0btDoMoqttFwm7vbYzRSShQVnpGIvnEZE=; b=XdiQ1xvN1iRz9iFJEUa+HksoRPMmqezLpMiRIGHY697N4O2FHc+BJCfsTdjGJZX9TUV5Z5 XaWpMmGI2FjbdqVUer6c8n66X114grMMJfiX2FxZ1MxKonQ8AholnHf7PEG5QnhyGFqlaH 1ez/jYe5QfDoBoNwRh0Da6Krat+pPw6YGc5titWi76oLd6Ffie8eMjZ420MNayViM989bX lsY8Yv2Coa1MJomJDFpG+4rv5RsF+cmnbcVwBxm05T3xmhUnQTDgnhG+9P1l2hznfe6I19 mg4RzUSBBuXzNrCV7+lQi9fs8MOoIpgbRG8dXPRJaPm9rxUmwC2G0cgUX2Aq5A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714401010; a=rsa-sha256; cv=none; b=KToY4LZ5oxJJaOqRLZyBthtUZgjx9yIUz7FLKbOpbObbzfEbHVAXyB3HCfG0kpxx4YQNTo +tsJC2AAzX0gTFfmhuQFpoMojZJK6+8U0N2m10jnM4bTuHYbW4qtXFXPgZYyfJ8QpHd7+0 QZmNblA7wpeC+KB5LadlwA/cZ6ka95caEY0Q0i+dQ013UT2cGqoLiY9Zyn1M2TszbmVU5i WG8sHA+iR8ME3RYjbVnvQOnTt0/NH422nkLC1uPRsT/G4vM1QpSGnwQvVwU99muHRoTprY oMwgE+pnfTe+g8Nmz6jvbptfz4Tpox3Wtp25mDnanlh5qw2RTAH8EUXxQUQhaw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714401010; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=L363En/oHn0btDoMoqttFwm7vbYzRSShQVnpGIvnEZE=; b=On1LyEU8zg+WLdYpZfDezF4dF0MYrp6DPq4pZV0ikV5iLAi2RZ+MGG1/B9SXFtt07rPP3d VZy7wB+USrRUHLBbVwPmXH5y5n74jVI0QTwQ5UGsqHBkGwp6df1LVXjEV4q92rlrYYgeAe Wa41qkQSlbvjSjQHN8Ew7plfBS45fB0eNyaWRQSiSLhjuLcCwI63Ez/YHmKBmFtKpgDO05 rtB5W1CgStP+NvI2if9esnN/UVVnHG5yvYbbkzX+O5EslxtXjeJMQq5U9xEXyS4IcypWOt s8DmkX8l1xkpJNmz+NubF/kmQ2WRNJc6r4rywrGAXsUlQ6NVjGjtO11+VB1rgg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VSm2B4HKyz1BwG; Mon, 29 Apr 2024 14:30:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43TEUAt1068377; Mon, 29 Apr 2024 14:30:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43TEUA8o068370; Mon, 29 Apr 2024 14:30:10 GMT (envelope-from git) Date: Mon, 29 Apr 2024 14:30:10 GMT Message-Id: <202404291430.43TEUA8o068370@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: 2ef5a8624a15 - main - package: FreeBSD-periodic should depend on FreeBSD-cron List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 2ef5a8624a15a9c0240d626ca232cb9d26c514f5 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=2ef5a8624a15a9c0240d626ca232cb9d26c514f5 commit 2ef5a8624a15a9c0240d626ca232cb9d26c514f5 Author: Lexi Winter AuthorDate: 2024-04-29 14:29:13 +0000 Commit: Warner Losh CommitDate: 2024-04-29 14:29:20 +0000 package: FreeBSD-periodic should depend on FreeBSD-cron Reported by: des Reviewed by: imp, des Pull Request: https://github.com/freebsd/freebsd-src/pull/1204 --- release/packages/generate-ucl.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/release/packages/generate-ucl.sh b/release/packages/generate-ucl.sh index c7147a97a868..6549e201e022 100755 --- a/release/packages/generate-ucl.sh +++ b/release/packages/generate-ucl.sh @@ -40,6 +40,9 @@ main() { clang) pkgdeps="lld libcompiler_rt-dev" ;; + periodic) + pkgdeps="cron" + ;; # -dev packages that have no corresponding non-dev package # as a dependency. From nobody Mon Apr 29 14:31:59 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VSm4H45hNz5JRTs; Mon, 29 Apr 2024 14:31: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VSm4H3dz3z4JYP; Mon, 29 Apr 2024 14:31:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714401119; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LEFMm6V1s+b/MTzSGvzdcA1aD0i6nz1gVtoaLuV4Tnc=; b=Nqz6XEFAs6jzYua1PMSHg7Xgryb8tpJeIdGFeR0Y3879yc3oEsFdUL/ol8XgzuyaAeloOO gNqeIbecive32vzOT5ofekoOxAmHh+NrZAHqAseuNoU10ThJfYsfbMVzfF4+07lIg7/uG9 hSb3beUV4jvlbB1gZxC7F7X2GkvFaL0o2ZotqKG9DIBS4eZngCfboogvBlQfTTI7ZhyHBt CQK3dkHrPM737TeTig/f9DWroCnB/i3YREqjPMjyw5GfClBd7ixxWXsNX9FEugEcmV/hRo 8nB+YIZ4Q/6tPzJRGMARvgk8n2lProhbXYNqQRIOMdOzByUx3BAKTDfVc4ElhQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714401119; a=rsa-sha256; cv=none; b=yp1WmrfEA99rbRbn1AKpl3IkMmPPV8/ea4uLw4RCn0lWU9oLlUMbookeCBl6O6o42fKJg0 Ll7rqIVLng7vv/dcWzScrX8TZ/R1AnlhJbUzkGZA6zTOy6j0YxgOPvhiA6e2K3FBaMnyae ie/bsrocIa6oZ+8wRT2CJWusrkdlsd8pj1uYXrMoV93dOppcbrCcvhobQ5uuBh+IobtoZ5 7c6lO9jNorDemUgvoQKtXgeAXfvMfRAjfeIWnRgjfkhbZkxifKLrgBsQB/VLwVGPS+7G6d Pka4YdFTx4zLNl5iYS602CTL5RFto/mNUXTtfbomQ35qgnRQNRUyXubgJ+PjsA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714401119; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LEFMm6V1s+b/MTzSGvzdcA1aD0i6nz1gVtoaLuV4Tnc=; b=uEuXYV4ctxiHiKYiLRYZsw1eltfherYx8eBza+6IATL7pgBr6JJZ5OFNVYX7lnFSJgRu5n yAGrwwH1eRzdDCzQ0Ino5J1gyYCfLQYIT9pyUqp19YY4hmsFqsj0JA5V5255X4wKeTEaKf u7+rS3l2MDIZOpcku4u9MRTKXqQtibyjvcF6ficKVXy9ORXm9+mfaR5eC7LszIXGada9SH GL+7szWUsCf9mq1/VPMOWF1rb/7I1YQI/cmMK1F6oXHDgh7gBNGQFnMoyPrT02HverbhGn t17fs63vpdQIL6vfGsDxdwko39l4Tp7rNAPowUKqroK3B7gVisOthAiHdVAnvw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VSm4H3FHdz1C8C; Mon, 29 Apr 2024 14:31:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43TEVxl7075902; Mon, 29 Apr 2024 14:31:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43TEVxD7075899; Mon, 29 Apr 2024 14:31:59 GMT (envelope-from git) Date: Mon, 29 Apr 2024 14:31:59 GMT Message-Id: <202404291431.43TEVxD7075899@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: e05b6502f9ca - main - package: fix dependency generation List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: e05b6502f9ca36860236644884f12eff8e3243c4 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=e05b6502f9ca36860236644884f12eff8e3243c4 commit e05b6502f9ca36860236644884f12eff8e3243c4 Author: Lexi Winter AuthorDate: 2024-04-29 14:30:46 +0000 Commit: Warner Losh CommitDate: 2024-04-29 14:31:36 +0000 package: fix dependency generation A bug in release/packages/generate-ucl.sh causes package dependencies (other than shlib depends) to not be generated correctly, meaning packages are missing their dependencies. generate-ucl.sh creates the UCL file by: 1. copying ${uclsource} (template.ucl) to ${uclfile} 2. appending dependencies to ${uclfile} 3. calling generate-ucl.lua on ${uclsource} to create ${uclfile} This breaks because the dependencies added in step 2 are overwritten in step 3. Fix this by calling generate-ucl.lua with ${uclfile} as both the input and output file, so anything we added to ${uclfile} is preserved. Reviewed by: des, imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1203 --- release/packages/generate-ucl.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/packages/generate-ucl.sh b/release/packages/generate-ucl.sh index 6549e201e022..27adddad96c0 100755 --- a/release/packages/generate-ucl.sh +++ b/release/packages/generate-ucl.sh @@ -156,7 +156,7 @@ EOF PKG_WWW "${PKG_WWW}" \ PKG_MAINTAINER "${PKG_MAINTAINER}" \ UCLFILES "${srctree}/release/packages/" \ - ${uclsource} ${uclfile} + ${uclfile} ${uclfile} return 0 } From nobody Mon Apr 29 14:36:47 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VSm9r1yTvz5JS6d; Mon, 29 Apr 2024 14:36: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VSm9r1VSvz4KZh; Mon, 29 Apr 2024 14:36:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714401408; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fb1SGxmTrpQZtKuFqrdfmB/84BtQVrqGHbbH8PZ5Xdw=; b=rEka1D2SFZ+SXSAf9nYdguSI/Y8YyiJuiqT1DLC+17DQ3OkEiOJY6fAll/TpWjgWwT5iyz 9mWJYcUKaCwyGlXz1zMyDS67q8Cm4u7i4o4zNk40EdhQ02OuvBgxoL9QpsqNoYRLD7x+HL VlioepRi6gqBoNmcmRW9kKGBLKaMX8gXK6YL4VxIp9JLJg33G9opBMW7s7yHLtwMCv5NoL NEFLTFkAt/3A2pjXUffQG1C4+6G9mYoBJPjmRdKyd8OrSFfQ5sAk0M6x818dHtLi6ZPzCA 92FpInnJEy/zV8/KaMdMmioa8yu4Hys2SPD21QznCr7BbmazZN5/UpbhEhoyJA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714401408; a=rsa-sha256; cv=none; b=nMXWXC6tinjwHNxhR1To9I12+r/HsZM1/VlxuaLE41hpPY8gOaDo8mjCQfckGfxWBulUof SGj6FrZvimMkiOa98RD0MT9AiAovvkWxlqCRH5/lg84xQ1EQMpZ90BdI9d+E8WZqkYR0hq aOfzSvWZ+1eN+lQ7Y2StxwA4ugbYRcKMAVR1bBMxQuyTGUyeeZGZLAdkgY5UqZymXF8i2Y aTtQ8u9r8tBEmsekG/JH+4sqy6LYjfVpEFwHVPDu9dQ4yNzx9NsFVsSg7TJzr4n/yR0xIy yOkPZbm5NHGOs3Z1LOtHc4RpwXvBfGJgW7CGphRHa2VBq7PxO/nqEE6Q4CdHrA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714401408; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fb1SGxmTrpQZtKuFqrdfmB/84BtQVrqGHbbH8PZ5Xdw=; b=rEDNHonSOZhRX5uj/b6rZhhbDcwIV/gj/wYm91gstwuPXKgCVbv6iA5JGG8hoVk+Uwy4Ig RBcrtdJWBrUAjifm1h+wQFOUHUshb3MttNnlkf7sPYQrKk0lF0k5ikekcNiO1jLYCDVAef eAQ8QlWh7dJ/0EDNtbAJ6w2c3BoxuKlJgSZrUOOMaQAI3+QW/7RX6p1Xz5iGLkSsMIbeTE VVycWX8xYDRznYlVGAGCLace4bFrhO6HHtSKTpAsBuyZhgeULYESV+9uIc/qZjiUz3FSGo Ufv3LkfdewJNYXN567F5yPYiRg3DeVySmOCRWthdh+tbNJBUrVIYJErt+sxcYQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VSm9r0wtcz1C3y; Mon, 29 Apr 2024 14:36:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43TEal6o080560; Mon, 29 Apr 2024 14:36:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43TEal4S080557; Mon, 29 Apr 2024 14:36:47 GMT (envelope-from git) Date: Mon, 29 Apr 2024 14:36:47 GMT Message-Id: <202404291436.43TEal4S080557@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: a3f7176523e8 - main - libpfctl: fix incorrect pcounters array size List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: a3f7176523e8611b259cefd7431c01e24f446db7 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=a3f7176523e8611b259cefd7431c01e24f446db7 commit a3f7176523e8611b259cefd7431c01e24f446db7 Author: Kristof Provost AuthorDate: 2024-04-26 14:07:38 +0000 Commit: Kristof Provost CommitDate: 2024-04-29 14:32:23 +0000 libpfctl: fix incorrect pcounters array size The array is 2 x 2 x 2, not 2 x 2 x 3. Sponsored by: Rubicon Communications, LLC ("Netgate") MFC after: 2 weeks --- lib/libpfctl/libpfctl.c | 2 +- lib/libpfctl/libpfctl.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libpfctl/libpfctl.c b/lib/libpfctl/libpfctl.c index 076cfd3400e6..b42afc542273 100644 --- a/lib/libpfctl/libpfctl.c +++ b/lib/libpfctl/libpfctl.c @@ -325,7 +325,7 @@ pfctl_get_status(int dev) _pfctl_get_status_counters(nvlist_get_nvlist(nvl, "scounters"), &status->scounters); - pf_nvuint_64_array(nvl, "pcounters", 2 * 2 * 3, + pf_nvuint_64_array(nvl, "pcounters", 2 * 2 * 2, (uint64_t *)status->pcounters, NULL); pf_nvuint_64_array(nvl, "bcounters", 2 * 2, (uint64_t *)status->bcounters, NULL); diff --git a/lib/libpfctl/libpfctl.h b/lib/libpfctl/libpfctl.h index 4e06981a79c7..bdb4bfae4be1 100644 --- a/lib/libpfctl/libpfctl.h +++ b/lib/libpfctl/libpfctl.h @@ -62,7 +62,7 @@ struct pfctl_status { struct pfctl_status_counters lcounters; struct pfctl_status_counters fcounters; struct pfctl_status_counters scounters; - uint64_t pcounters[2][2][3]; + uint64_t pcounters[2][2][2]; uint64_t bcounters[2][2]; }; From nobody Mon Apr 29 14:36:49 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VSm9s3FD4z5JS1x; Mon, 29 Apr 2024 14:36: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VSm9s20R3z4KS9; Mon, 29 Apr 2024 14:36:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714401409; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VsolLw7qz2Y79HtmK/U7O3/uEcumROuwhvp1uwd3oG4=; b=Kx9QpZ2zLqGDQTNz5cvz5Q59LuK51EZ7iNopJtXm+ixEE2Au/QVX3JcpQ3kBu3aD8/ThHT BFEPOPzfGzoVMgdvhlSmVXuji0GB2+aR5oUQskEnS9vd1CE8xSVWtlhs6/Dq1nCljRSnRS DB5CsZEtVCarB/nydbwrSbcslHHwb3kLoIix5QEzrW8H7J4kfeIRoZ8M2ud6wYPfDsaIyT VKH990bTCOc5a2F+aiYS5lUd3tcrTHYYLpEOa8rR4N2iDJwzeCKok1N9KTdYsl/KeZY9d0 jIq4U3P0cpbSIgqSKGfTldXkoG6LfJ/3xy2dbPOGaAIszrBm7t7gMUqzJAR97A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714401409; a=rsa-sha256; cv=none; b=PRF7XymhozEIpmUAWaEiDcxr+wCnWQVTwMeN2prL+bVTP7XpvHusrEuwJX28Ll9J9To3VC DXE90KowZQvCl4ioiAXynLa2L2wq8Q2XxmgJqnY9CPTIxQNT2PvXEzMNJVVg0A2g1enWZM t5NPGdh25jwZ8TKzPjz3Nx3bQwoqQozxeOV+GyQNPzKGSqw0nsaR8adrowAcoOsiCjUHAC agiT/nRa66PacQRtVRv7nThPJoLjSjirAYkBF4yPNJ6ghZbO7NZt75c99QFxZmcL1EX2SV rzUekMKBthL2V7ATNG2RHoJu6s38XW7W6M0untjhGy61gQ9IcCa8Lh1mP6ZJwQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714401409; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VsolLw7qz2Y79HtmK/U7O3/uEcumROuwhvp1uwd3oG4=; b=ltSz78uE7DUb1qHaMxcKCHJGhHf3/xSeqVHaZOQtYmWkOkur28JkQ0AHMJEtAR7makoU1E YDHmpRfafIAhwNXns+WHzdIuGPFVL13shC3g+0foxk/d6xxCpWTOQaVD7UMhybrCymoLZy ahUN/dizc4l86Cp+94avXQp9AQjI7HxhAxpQA3iwiEPJTba2NN1eYP47wB6l81yUk8GxZ4 1Mo2Rcw/Mmn6hsWQxJIIG/aZ7omWU25VpJlfuRcX1q2eYB2LNtza4pOrEhSkXq/eGQNq93 Y8k+rG0C+aEVc73fEwhIWNkb8KVMMiwsF+EFJAaE1lloSQzqp0wR+niLuOUb6A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VSm9s1PhRz1CL7; Mon, 29 Apr 2024 14:36:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43TEanlY080607; Mon, 29 Apr 2024 14:36:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43TEan1U080604; Mon, 29 Apr 2024 14:36:49 GMT (envelope-from git) Date: Mon, 29 Apr 2024 14:36:49 GMT Message-Id: <202404291436.43TEan1U080604@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: 044243fcc9b4 - main - libpfctl: allow access to the fd List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 044243fcc9b4c639cf5655e37b98478bcb312590 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=044243fcc9b4c639cf5655e37b98478bcb312590 commit 044243fcc9b4c639cf5655e37b98478bcb312590 Author: Kristof Provost AuthorDate: 2024-04-24 06:40:05 +0000 Commit: Kristof Provost CommitDate: 2024-04-29 14:32:23 +0000 libpfctl: allow access to the fd pfctl_open() opens both /dev/pf and a netlink socket. Allow access to the /dev/ pf fd via pfctl_fd(). This means that libpfctl users no longer have to open /dev/pf themselves for any calls that are not yet available in libpfctl. Sponsored by: Rubicon Communications, LLC ("Netgate") MFC after: 2 weeks --- contrib/pf/authpf/authpf.c | 20 +++++++++----------- contrib/pf/ftp-proxy/filter.c | 23 ++++++++++------------- contrib/pf/tftp-proxy/filter.c | 25 ++++++++++--------------- lib/libpfctl/libpfctl.c | 6 ++++++ lib/libpfctl/libpfctl.h | 1 + 5 files changed, 36 insertions(+), 39 deletions(-) diff --git a/contrib/pf/authpf/authpf.c b/contrib/pf/authpf/authpf.c index 81dbcb747f5f..fcf9812cdcca 100644 --- a/contrib/pf/authpf/authpf.c +++ b/contrib/pf/authpf/authpf.c @@ -56,7 +56,6 @@ static int change_filter(int, const char *, const char *); static int change_table(int, const char *); static void authpf_kill_states(void); -int dev; /* pf device */ struct pfctl_handle *pfh; char anchorname[PF_ANCHOR_NAME_SIZE] = "authpf"; char rulesetname[MAXPATHLEN - PF_ANCHOR_NAME_SIZE - 2]; @@ -135,9 +134,8 @@ main(void) exit(1); } /* open the pf device */ - dev = open(PATH_DEVFILE, O_RDWR); pfh = pfctl_open(PATH_DEVFILE); - if (dev == -1 || pfh == NULL) { + if (pfh == NULL) { syslog(LOG_ERR, "cannot open packet filter device (%m)"); goto die; } @@ -648,7 +646,7 @@ remove_stale_rulesets(void) memset(&prs, 0, sizeof(prs)); strlcpy(prs.path, anchorname, sizeof(prs.path)); - if (ioctl(dev, DIOCGETRULESETS, &prs)) { + if (ioctl(pfctl_fd(pfh), DIOCGETRULESETS, &prs)) { if (errno == EINVAL) return (0); else @@ -661,7 +659,7 @@ remove_stale_rulesets(void) pid_t pid; prs.nr = nr - 1; - if (ioctl(dev, DIOCGETRULESET, &prs)) + if (ioctl(pfctl_fd(pfh), DIOCGETRULESET, &prs)) return (1); errno = 0; if ((t = strchr(prs.name, '(')) == NULL) @@ -705,8 +703,8 @@ recursive_ruleset_purge(char *an, char *rs) snprintf(t_e[i].anchor, sizeof(t_e[i].anchor), "%s/%s", an, rs); } t_e[PF_RULESET_MAX].rs_num = PF_RULESET_TABLE; - if ((ioctl(dev, DIOCXBEGIN, t) || - ioctl(dev, DIOCXCOMMIT, t)) && + if ((ioctl(pfctl_fd(pfh), DIOCXBEGIN, t) || + ioctl(pfctl_fd(pfh), DIOCXCOMMIT, t)) && errno != EINVAL) goto cleanup; @@ -714,7 +712,7 @@ recursive_ruleset_purge(char *an, char *rs) if ((prs = calloc(1, sizeof(struct pfioc_ruleset))) == NULL) goto no_mem; snprintf(prs->path, sizeof(prs->path), "%s/%s", an, rs); - if (ioctl(dev, DIOCGETRULESETS, prs)) { + if (ioctl(pfctl_fd(pfh), DIOCGETRULESETS, prs)) { if (errno != EINVAL) goto cleanup; errno = 0; @@ -723,7 +721,7 @@ recursive_ruleset_purge(char *an, char *rs) while (nr) { prs->nr = 0; - if (ioctl(dev, DIOCGETRULESET, prs)) + if (ioctl(pfctl_fd(pfh), DIOCGETRULESET, prs)) goto cleanup; if (recursive_ruleset_purge(prs->path, prs->name)) @@ -769,7 +767,7 @@ change_filter(int add, const char *l_user, const char *ip_src) if (asprintf(&rsn, "%s/%s", anchorname, rulesetname) == -1) goto no_mem; - if (asprintf(&fdpath, "/dev/fd/%d", dev) == -1) + if (asprintf(&fdpath, "/dev/fd/%d", pfctl_fd(pfh)) == -1) goto no_mem; if (asprintf(&ipstr, "user_ip=%s", ip_src) == -1) goto no_mem; @@ -868,7 +866,7 @@ change_table(int add, const char *ip_src) return (-1); } - if (ioctl(dev, add ? DIOCRADDADDRS : DIOCRDELADDRS, &io) && + if (ioctl(pfctl_fd(pfh), add ? DIOCRADDADDRS : DIOCRDELADDRS, &io) && errno != ESRCH) { syslog(LOG_ERR, "cannot %s %s from table %s: %s", add ? "add" : "remove", ip_src, tablename, diff --git a/contrib/pf/ftp-proxy/filter.c b/contrib/pf/ftp-proxy/filter.c index 612e35c4ac6e..3bad5feb4be4 100644 --- a/contrib/pf/ftp-proxy/filter.c +++ b/contrib/pf/ftp-proxy/filter.c @@ -57,7 +57,7 @@ static uint32_t pfticket; static uint32_t pfpool_ticket; static struct pfioc_trans pft; static struct pfioc_trans_e pfte[TRANS_SIZE]; -static int dev, rule_log; +static int rule_log; static struct pfctl_handle *pfh = NULL; static const char *qname, *tagname; @@ -104,7 +104,7 @@ add_nat(u_int32_t id, struct sockaddr *src, struct sockaddr *dst, &satosin6(nat)->sin6_addr.s6_addr, 16); memset(&pfp.addr.addr.v.a.mask.addr8, 255, 16); } - if (ioctl(dev, DIOCADDADDR, &pfp) == -1) + if (ioctl(pfctl_fd(pfh), DIOCADDADDR, &pfp) == -1) return (-1); pfrule.rpool.proxy_port[0] = nat_range_low; @@ -138,7 +138,7 @@ add_rdr(u_int32_t id, struct sockaddr *src, struct sockaddr *dst, &satosin6(rdr)->sin6_addr.s6_addr, 16); memset(&pfp.addr.addr.v.a.mask.addr8, 255, 16); } - if (ioctl(dev, DIOCADDADDR, &pfp) == -1) + if (ioctl(pfctl_fd(pfh), DIOCADDADDR, &pfp) == -1) return (-1); pfrule.rpool.proxy_port[0] = rdr_port; @@ -152,7 +152,7 @@ add_rdr(u_int32_t id, struct sockaddr *src, struct sockaddr *dst, int do_commit(void) { - if (ioctl(dev, DIOCXCOMMIT, &pft) == -1) + if (ioctl(pfctl_fd(pfh), DIOCXCOMMIT, &pft) == -1) return (-1); return (0); @@ -161,7 +161,7 @@ do_commit(void) int do_rollback(void) { - if (ioctl(dev, DIOCXROLLBACK, &pft) == -1) + if (ioctl(pfctl_fd(pfh), DIOCXROLLBACK, &pft) == -1) return (-1); return (0); @@ -180,13 +180,10 @@ init_filter(const char *opt_qname, const char *opt_tagname, int opt_verbose) else if (opt_verbose == 2) rule_log = PF_LOG_ALL; - dev = open("/dev/pf", O_RDWR); - if (dev == -1) - err(1, "open /dev/pf"); pfh = pfctl_open(PF_DEVICE); if (pfh == NULL) err(1, "pfctl_open"); - status = pfctl_get_status(dev); + status = pfctl_get_status(pfctl_fd(pfh)); if (status == NULL) err(1, "DIOCGETSTATUS"); if (!status->running) @@ -227,7 +224,7 @@ prepare_commit(u_int32_t id) } } - if (ioctl(dev, DIOCXBEGIN, &pft) == -1) + if (ioctl(pfctl_fd(pfh), DIOCXBEGIN, &pft) == -1) return (-1); return (0); @@ -266,7 +263,7 @@ prepare_rule(u_int32_t id, int rs_num, struct sockaddr *src, errno = EINVAL; return (-1); } - if (ioctl(dev, DIOCBEGINADDRS, &pfp) == -1) + if (ioctl(pfctl_fd(pfh), DIOCBEGINADDRS, &pfp) == -1) return (-1); pfpool_ticket = pfp.ticket; @@ -366,7 +363,7 @@ server_lookup4(struct sockaddr_in *client, struct sockaddr_in *proxy, pnl.sport = client->sin_port; pnl.dport = proxy->sin_port; - if (ioctl(dev, DIOCNATLOOK, &pnl) == -1) + if (ioctl(pfctl_fd(pfh), DIOCNATLOOK, &pnl) == -1) return (-1); memset(server, 0, sizeof(struct sockaddr_in)); @@ -394,7 +391,7 @@ server_lookup6(struct sockaddr_in6 *client, struct sockaddr_in6 *proxy, pnl.sport = client->sin6_port; pnl.dport = proxy->sin6_port; - if (ioctl(dev, DIOCNATLOOK, &pnl) == -1) + if (ioctl(pfctl_fd(pfh), DIOCNATLOOK, &pnl) == -1) return (-1); memset(server, 0, sizeof(struct sockaddr_in6)); diff --git a/contrib/pf/tftp-proxy/filter.c b/contrib/pf/tftp-proxy/filter.c index f372ddd0aeae..b69247caf04f 100644 --- a/contrib/pf/tftp-proxy/filter.c +++ b/contrib/pf/tftp-proxy/filter.c @@ -61,7 +61,7 @@ static char pfanchor[PF_ANCHOR_NAME_SIZE]; static char pfanchor_call[PF_ANCHOR_NAME_SIZE]; static struct pfioc_trans pft; static struct pfioc_trans_e pfte[TRANS_SIZE]; -static int dev, rule_log; +static int rule_log; static struct pfctl_handle *pfh = NULL; static char *qname; @@ -108,7 +108,7 @@ add_nat(u_int32_t id, struct sockaddr *src, struct sockaddr *dst, &satosin6(nat)->sin6_addr.s6_addr, 16); memset(&pfp.addr.addr.v.a.mask.addr8, 255, 16); } - if (ioctl(dev, DIOCADDADDR, &pfp) == -1) + if (ioctl(pfctl_fd(pfh), DIOCADDADDR, &pfp) == -1) return (-1); pfrule.rpool.proxy_port[0] = nat_range_low; @@ -142,7 +142,7 @@ add_rdr(u_int32_t id, struct sockaddr *src, struct sockaddr *dst, &satosin6(rdr)->sin6_addr.s6_addr, 16); memset(&pfp.addr.addr.v.a.mask.addr8, 255, 16); } - if (ioctl(dev, DIOCADDADDR, &pfp) == -1) + if (ioctl(pfctl_fd(pfh), DIOCADDADDR, &pfp) == -1) return (-1); pfrule.rpool.proxy_port[0] = rdr_port; @@ -156,7 +156,7 @@ add_rdr(u_int32_t id, struct sockaddr *src, struct sockaddr *dst, int do_commit(void) { - if (ioctl(dev, DIOCXCOMMIT, &pft) == -1) + if (ioctl(pfctl_fd(pfh), DIOCXCOMMIT, &pft) == -1) return (-1); return (0); @@ -165,7 +165,7 @@ do_commit(void) int do_rollback(void) { - if (ioctl(dev, DIOCXROLLBACK, &pft) == -1) + if (ioctl(pfctl_fd(pfh), DIOCXROLLBACK, &pft) == -1) return (-1); return (0); @@ -183,17 +183,12 @@ init_filter(char *opt_qname, int opt_verbose) else if (opt_verbose == 2) rule_log = PF_LOG_ALL; - dev = open("/dev/pf", O_RDWR); - if (dev == -1) { - syslog(LOG_ERR, "can't open /dev/pf"); - exit(1); - } pfh = pfctl_open(PF_DEVICE); if (pfh == NULL) { syslog(LOG_ERR, "can't pfctl_open()"); exit(1); } - status = pfctl_get_status(dev); + status = pfctl_get_status(pfctl_fd(pfh)); if (status == NULL) { syslog(LOG_ERR, "DIOCGETSTATUS"); exit(1); @@ -238,7 +233,7 @@ prepare_commit(u_int32_t id) } } - if (ioctl(dev, DIOCXBEGIN, &pft) == -1) + if (ioctl(pfctl_fd(pfh), DIOCXBEGIN, &pft) == -1) return (-1); return (0); @@ -277,7 +272,7 @@ prepare_rule(u_int32_t id, int rs_num, struct sockaddr *src, errno = EINVAL; return (-1); } - if (ioctl(dev, DIOCBEGINADDRS, &pfp) == -1) + if (ioctl(pfctl_fd(pfh), DIOCBEGINADDRS, &pfp) == -1) return (-1); pfpool_ticket = pfp.ticket; @@ -379,7 +374,7 @@ server_lookup4(struct sockaddr_in *client, struct sockaddr_in *proxy, pnl.sport = client->sin_port; pnl.dport = proxy->sin_port; - if (ioctl(dev, DIOCNATLOOK, &pnl) == -1) + if (ioctl(pfctl_fd(pfh), DIOCNATLOOK, &pnl) == -1) return (-1); memset(server, 0, sizeof(struct sockaddr_in)); @@ -407,7 +402,7 @@ server_lookup6(struct sockaddr_in6 *client, struct sockaddr_in6 *proxy, pnl.sport = client->sin6_port; pnl.dport = proxy->sin6_port; - if (ioctl(dev, DIOCNATLOOK, &pnl) == -1) + if (ioctl(pfctl_fd(pfh), DIOCNATLOOK, &pnl) == -1) return (-1); memset(server, 0, sizeof(struct sockaddr_in6)); diff --git a/lib/libpfctl/libpfctl.c b/lib/libpfctl/libpfctl.c index b42afc542273..5b9500980996 100644 --- a/lib/libpfctl/libpfctl.c +++ b/lib/libpfctl/libpfctl.c @@ -102,6 +102,12 @@ pfctl_close(struct pfctl_handle *h) free(h); } +int +pfctl_fd(struct pfctl_handle *h) +{ + return (h->fd); +} + static int pfctl_do_ioctl(int dev, uint cmd, size_t size, nvlist_t **nvl) { diff --git a/lib/libpfctl/libpfctl.h b/lib/libpfctl/libpfctl.h index bdb4bfae4be1..a290fa45501a 100644 --- a/lib/libpfctl/libpfctl.h +++ b/lib/libpfctl/libpfctl.h @@ -390,6 +390,7 @@ struct pfctl_syncookies { struct pfctl_handle; struct pfctl_handle *pfctl_open(const char *pf_device); void pfctl_close(struct pfctl_handle *); +int pfctl_fd(struct pfctl_handle *); int pfctl_startstop(struct pfctl_handle *h, int start); struct pfctl_status* pfctl_get_status(int dev); From nobody Mon Apr 29 14:36:50 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VSm9t42lzz5JS20; Mon, 29 Apr 2024 14:36: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VSm9t3PT9z4KPx; Mon, 29 Apr 2024 14:36:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714401410; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rTnTtzHZagH82wUOAk5lGaVGnDJaZYIXKqV+AD6ZpCs=; b=UAbAuNoEyXn/CfVlrJw8wA9a5Ywkj/6ygtfA13QzpxAhl+v63B1MJ9Ay2LKSC03bGUw+CA icF+8SAyzqrd/cOJIqC0R4Cnxd19jtN5H3tesIBXkDbnibbhY+WRSataGuJJVUjhX9sujp YUQERZN4MuE7zazfbumPs0o9vy8SueMpoOjjQf+FsvAfaoBUAOTiEPjsXJ916xwREyDSSR GiU8llYu9V3zWEf3HjPDTRG9qe0wM0aMhXX8wjIyTDjl6o6ayJwW2MiTtwNAYGz4Iks8nN c5061xR+XHvQwXVLJwcVf33kO5wWYquuXG3PsoCkBrQX/jGHkQBn7GGO6T/xcA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714401410; a=rsa-sha256; cv=none; b=KG1nkgDsIVozy7Nzrk2ryO/P/T8YPFT80qsBjXbazM0iPKdBqZOFsc8JryCHCm9DKHoI8+ xSbhMrP7vmV2zTd+rej1KSTKpL7vcIxJ9HxeKBG8WxdbHg9UzFFWl2RAmJWZ2X58JQwEv2 xofPeei/zLLZYu+J8DU/inM6LKiKm8C58KgsrjIc9B1xr/3x5Rgd1Baw1il+4CbOr3NDFZ SoNx9Rfmjf2Ck45AUstmYeBRbAz14vT1nkBJxkOqONVcVxJHXCmIfVK3GkFscnGbG7JjFU 0sqR6icRBkA+vdrI8OPl45YXvyu1gjkaFVgUm1vuIi7MXNWEQS6C0bu7HvzXkg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714401410; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rTnTtzHZagH82wUOAk5lGaVGnDJaZYIXKqV+AD6ZpCs=; b=sJ1L4e89hXiF9Ki0DbuzCWDrhnTMxlXNEmEUNXod+02kJyQhvXlrQzBopN/ruAfGGLATRG AgYbPSWy6mQtf7HTpjTw8QCs7sp++ffW9AwBYCQSYgJxhLHLV+fL4JaWszmNYqejnyjf3S d9yvSPp5HIVlB/KCkIBuB6v+6RZntMuvvEp50QShtqcqO+/p6JnhFg0dSuLAE23YdFLtKf W66pUWitG7dCcM0sIvFaetv45Mw5XV2IzprePA7Ih+xBiPHdY8GVZzm9/JYvzpRSubULxi sAe+SrvZBrEvZUaKdSMNarNTh29LIcekBA6r1kYxr3hVsesaZ3NhBso3WIP9uA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VSm9t2W3Xz1Bkb; Mon, 29 Apr 2024 14:36:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43TEao29080649; Mon, 29 Apr 2024 14:36:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43TEaoh6080646; Mon, 29 Apr 2024 14:36:50 GMT (envelope-from git) Date: Mon, 29 Apr 2024 14:36:50 GMT Message-Id: <202404291436.43TEaoh6080646@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: 5824df8d991c - main - pf: convert DIOCGETSTATUS to netlink List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 5824df8d991c32def616c51994161e60e5b78948 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=5824df8d991c32def616c51994161e60e5b78948 commit 5824df8d991c32def616c51994161e60e5b78948 Author: Kristof Provost AuthorDate: 2024-03-23 06:31:51 +0000 Commit: Kristof Provost CommitDate: 2024-04-29 14:32:23 +0000 pf: convert DIOCGETSTATUS to netlink Introduce pfctl_get_status_h() because we need the pfctl_handle. In this variant use netlink to obtain the information. Sponsored by: Rubicon Communications, LLC ("Netgate") --- contrib/pf/ftp-proxy/filter.c | 2 +- contrib/pf/tftp-proxy/filter.c | 2 +- lib/libpfctl/libpfctl.c | 147 ++++++++++++++++++++++++++++++ lib/libpfctl/libpfctl.h | 1 + sbin/pfctl/pfctl.c | 4 +- sys/netlink/netlink_message_writer.h | 6 ++ sys/netlink/netlink_snl.h | 11 +++ sys/netpfil/pf/pf_nl.c | 114 ++++++++++++++++++++++- sys/netpfil/pf/pf_nl.h | 29 ++++++ usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c | 35 +++---- 10 files changed, 329 insertions(+), 22 deletions(-) diff --git a/contrib/pf/ftp-proxy/filter.c b/contrib/pf/ftp-proxy/filter.c index 3bad5feb4be4..7893be97f9b2 100644 --- a/contrib/pf/ftp-proxy/filter.c +++ b/contrib/pf/ftp-proxy/filter.c @@ -183,7 +183,7 @@ init_filter(const char *opt_qname, const char *opt_tagname, int opt_verbose) pfh = pfctl_open(PF_DEVICE); if (pfh == NULL) err(1, "pfctl_open"); - status = pfctl_get_status(pfctl_fd(pfh)); + status = pfctl_get_status_h(pfh); if (status == NULL) err(1, "DIOCGETSTATUS"); if (!status->running) diff --git a/contrib/pf/tftp-proxy/filter.c b/contrib/pf/tftp-proxy/filter.c index b69247caf04f..1e6d54303996 100644 --- a/contrib/pf/tftp-proxy/filter.c +++ b/contrib/pf/tftp-proxy/filter.c @@ -188,7 +188,7 @@ init_filter(char *opt_qname, int opt_verbose) syslog(LOG_ERR, "can't pfctl_open()"); exit(1); } - status = pfctl_get_status(pfctl_fd(pfh)); + status = pfctl_get_status_h(pfh); if (status == NULL) { syslog(LOG_ERR, "DIOCGETSTATUS"); exit(1); diff --git a/lib/libpfctl/libpfctl.c b/lib/libpfctl/libpfctl.c index 5b9500980996..6da3b6969107 100644 --- a/lib/libpfctl/libpfctl.c +++ b/lib/libpfctl/libpfctl.c @@ -287,6 +287,153 @@ _pfctl_get_status_counters(const nvlist_t *nvl, } } +#define _OUT(_field) offsetof(struct pfctl_status_counter, _field) +static const struct snl_attr_parser ap_counter[] = { + { .type = PF_C_COUNTER, .off = _OUT(counter), .cb = snl_attr_get_uint64 }, + { .type = PF_C_NAME, .off = _OUT(name), .cb = snl_attr_get_string }, + { .type = PF_C_ID, .off = _OUT(id), .cb = snl_attr_get_uint32 }, +}; +SNL_DECLARE_ATTR_PARSER(counter_parser, ap_counter); +#undef _OUT + +static bool +snl_attr_get_counters(struct snl_state *ss, struct nlattr *nla, + const void *arg __unused, void *target) +{ + struct pfctl_status_counter counter = {}; + struct pfctl_status_counter *c; + bool error; + + error = snl_parse_header(ss, NLA_DATA(nla), NLA_DATA_LEN(nla), &counter_parser, &counter); + if (! error) + return (error); + + c = malloc(sizeof(*c)); + if (c == NULL) + return (false); + + c->id = counter.id; + c->counter = counter.counter; + c->name = strdup(counter.name); + + TAILQ_INSERT_TAIL((struct pfctl_status_counters *)target, c, entry); + + return (error); +} + +struct snl_uint64_array { + uint64_t *array; + size_t count; + size_t max; +}; +static bool +snl_attr_get_uint64_element(struct snl_state *ss, struct nlattr *nla, + const void *arg, void *target) +{ + bool error; + uint64_t value; + struct snl_uint64_array *t = (struct snl_uint64_array *)target; + + if (t->count >= t->max) + return (false); + + error = snl_attr_get_uint64(ss, nla, arg, &value); + if (! error) + return (error); + + t->array[t->count++] = value; + + return (true); +} + +static const struct snl_attr_parser ap_array[] = { + { .cb = snl_attr_get_uint64_element }, +}; +SNL_DECLARE_ATTR_PARSER(array_parser, ap_array); +static bool +snl_attr_get_uint64_array(struct snl_state *ss, struct nlattr *nla, + const void *arg, void *target) +{ + struct snl_uint64_array a = { + .array = target, + .count = 0, + .max = (size_t)arg, + }; + bool error; + + error = snl_parse_header(ss, NLA_DATA(nla), NLA_DATA_LEN(nla), &array_parser, &a); + if (! error) + return (error); + + return (true); +} + +#define _OUT(_field) offsetof(struct pfctl_status, _field) +static const struct snl_attr_parser ap_getstatus[] = { + { .type = PF_GS_IFNAME, .off = _OUT(ifname), .arg_u32 = IFNAMSIZ, .cb = snl_attr_copy_string }, + { .type = PF_GS_RUNNING, .off = _OUT(running), .cb = snl_attr_get_bool }, + { .type = PF_GS_SINCE, .off = _OUT(since), .cb = snl_attr_get_uint32 }, + { .type = PF_GS_DEBUG, .off = _OUT(debug), .cb = snl_attr_get_uint32 }, + { .type = PF_GS_HOSTID, .off = _OUT(hostid), .cb = snl_attr_get_uint32 }, + { .type = PF_GS_STATES, .off = _OUT(states), .cb = snl_attr_get_uint32 }, + { .type = PF_GS_SRC_NODES, .off = _OUT(src_nodes), .cb = snl_attr_get_uint32 }, + { .type = PF_GS_REASSEMBLE, .off = _OUT(reass), .cb = snl_attr_get_uint32 }, + { .type = PF_GS_SYNCOOKIES_ACTIVE, .off = _OUT(syncookies_active), .cb = snl_attr_get_uint32 }, + { .type = PF_GS_COUNTERS, .off = _OUT(counters), .cb = snl_attr_get_counters }, + { .type = PF_GS_LCOUNTERS, .off = _OUT(lcounters), .cb = snl_attr_get_counters }, + { .type = PF_GS_FCOUNTERS, .off = _OUT(fcounters), .cb = snl_attr_get_counters }, + { .type = PF_GS_SCOUNTERS, .off = _OUT(scounters), .cb = snl_attr_get_counters }, + { .type = PF_GS_CHKSUM, .off = _OUT(pf_chksum), .arg_u32 = PF_MD5_DIGEST_LENGTH, .cb = snl_attr_get_bytes }, + { .type = PF_GS_BCOUNTERS, .off = _OUT(bcounters), .arg_u32 = 2 * 2, .cb = snl_attr_get_uint64_array }, + { .type = PF_GS_PCOUNTERS, .off = _OUT(pcounters), .arg_u32 = 2 * 2 * 2, .cb = snl_attr_get_uint64_array }, +}; +static struct snl_field_parser fp_getstatus[] = {}; +SNL_DECLARE_PARSER(getstatus_parser, struct genlmsghdr, fp_getstatus, ap_getstatus); +#undef _OUT + +struct pfctl_status * +pfctl_get_status_h(struct pfctl_handle *h __unused) +{ + struct pfctl_status *status; + struct snl_errmsg_data e = {}; + struct nlmsghdr *hdr; + struct snl_writer nw; + uint32_t seq_id; + int family_id; + + family_id = snl_get_genl_family(&h->ss, PFNL_FAMILY_NAME); + if (family_id == 0) + return (NULL); + + snl_init_writer(&h->ss, &nw); + hdr = snl_create_genl_msg_request(&nw, family_id, PFNL_CMD_GET_STATUS); + hdr->nlmsg_flags |= NLM_F_DUMP; + + hdr = snl_finalize_msg(&nw); + if (hdr == NULL) { + return (NULL); + } + + seq_id = hdr->nlmsg_seq; + if (! snl_send_message(&h->ss, hdr)) + return (NULL); + + status = calloc(1, sizeof(*status)); + if (status == NULL) + return (NULL); + TAILQ_INIT(&status->counters); + TAILQ_INIT(&status->lcounters); + TAILQ_INIT(&status->fcounters); + TAILQ_INIT(&status->scounters); + + while ((hdr = snl_read_reply_multi(&h->ss, seq_id, &e)) != NULL) { + if (! snl_parse_nlmsg(&h->ss, hdr, &getstatus_parser, status)) + continue; + } + + return (status); +} + struct pfctl_status * pfctl_get_status(int dev) { diff --git a/lib/libpfctl/libpfctl.h b/lib/libpfctl/libpfctl.h index a290fa45501a..2937a36a8a47 100644 --- a/lib/libpfctl/libpfctl.h +++ b/lib/libpfctl/libpfctl.h @@ -393,6 +393,7 @@ void pfctl_close(struct pfctl_handle *); int pfctl_fd(struct pfctl_handle *); int pfctl_startstop(struct pfctl_handle *h, int start); +struct pfctl_status* pfctl_get_status_h(struct pfctl_handle *h); struct pfctl_status* pfctl_get_status(int dev); uint64_t pfctl_status_counter(struct pfctl_status *status, int id); uint64_t pfctl_status_lcounter(struct pfctl_status *status, int id); diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c index 8d59871701f8..17901b04a130 100644 --- a/sbin/pfctl/pfctl.c +++ b/sbin/pfctl/pfctl.c @@ -1578,7 +1578,7 @@ pfctl_show_status(int dev, int opts) struct pfctl_status *status; struct pfctl_syncookies cookies; - if ((status = pfctl_get_status(dev)) == NULL) { + if ((status = pfctl_get_status_h(pfh)) == NULL) { warn("DIOCGETSTATUS"); return (-1); } @@ -1600,7 +1600,7 @@ pfctl_show_running(int dev) struct pfctl_status *status; int running; - if ((status = pfctl_get_status(dev)) == NULL) { + if ((status = pfctl_get_status_h(pfh)) == NULL) { warn("DIOCGETSTATUS"); return (-1); } diff --git a/sys/netlink/netlink_message_writer.h b/sys/netlink/netlink_message_writer.h index 28f3fb78018c..cb771cf93e53 100644 --- a/sys/netlink/netlink_message_writer.h +++ b/sys/netlink/netlink_message_writer.h @@ -225,6 +225,12 @@ nlattr_add_raw(struct nl_writer *nw, const struct nlattr *nla_src) return (nlattr_add(nw, nla_src->nla_type, attr_len, (const void *)(nla_src + 1))); } +static inline bool +nlattr_add_bool(struct nl_writer *nw, int attrtype, bool value) +{ + return (nlattr_add(nw, attrtype, sizeof(bool), &value)); +} + static inline bool nlattr_add_u8(struct nl_writer *nw, int attrtype, uint8_t value) { diff --git a/sys/netlink/netlink_snl.h b/sys/netlink/netlink_snl.h index 6553a391a8f5..7550800bb0f7 100644 --- a/sys/netlink/netlink_snl.h +++ b/sys/netlink/netlink_snl.h @@ -537,6 +537,17 @@ snl_attr_get_bytes(struct snl_state *ss __unused, struct nlattr *nla, const void return (true); } +static inline bool +snl_attr_get_bool(struct snl_state *ss __unused, struct nlattr *nla, + const void *arg __unused, void *target) +{ + if (NLA_DATA_LEN(nla) == sizeof(bool)) { + *((bool *)target) = *((const bool *)NLA_DATA_CONST(nla)); + return (true); + } + return (false); +} + static inline bool snl_attr_get_uint8(struct snl_state *ss __unused, struct nlattr *nla, const void *arg __unused, void *target) diff --git a/sys/netpfil/pf/pf_nl.c b/sys/netpfil/pf/pf_nl.c index 5f33e49b4a2e..307e1ca1689d 100644 --- a/sys/netpfil/pf/pf_nl.c +++ b/sys/netpfil/pf/pf_nl.c @@ -1109,6 +1109,111 @@ pf_handle_set_statusif(struct nlmsghdr *hdr, struct nl_pstate *npt) return (0); } +static bool +nlattr_add_counters(struct nl_writer *nw, int attr, size_t number, char **names, + counter_u64_t *counters) +{ + for (int i = 0; i < number; i++) { + int off = nlattr_add_nested(nw, attr); + nlattr_add_u32(nw, PF_C_ID, i); + nlattr_add_string(nw, PF_C_NAME, names[i]); + nlattr_add_u64(nw, PF_C_COUNTER, counter_u64_fetch(counters[i])); + nlattr_set_len(nw, off); + } + + return (true); +} + +static bool +nlattr_add_fcounters(struct nl_writer *nw, int attr, size_t number, char **names, + struct pf_counter_u64 *counters) +{ + for (int i = 0; i < number; i++) { + int off = nlattr_add_nested(nw, attr); + nlattr_add_u32(nw, PF_C_ID, i); + nlattr_add_string(nw, PF_C_NAME, names[i]); + nlattr_add_u64(nw, PF_C_COUNTER, pf_counter_u64_fetch(&counters[i])); + nlattr_set_len(nw, off); + } + + return (true); +} + +static bool +nlattr_add_u64_array(struct nl_writer *nw, int attr, size_t number, uint64_t *array) +{ + int off = nlattr_add_nested(nw, attr); + + for (size_t i = 0; i < number; i++) + nlattr_add_u64(nw, 0, array[i]); + + nlattr_set_len(nw, off); + + return (true); +} + +static int +pf_handle_get_status(struct nlmsghdr *hdr, struct nl_pstate *npt) +{ + struct pf_status s; + struct nl_writer *nw = npt->nw; + struct genlmsghdr *ghdr_new; + char *pf_reasons[PFRES_MAX+1] = PFRES_NAMES; + char *pf_lcounter[KLCNT_MAX+1] = KLCNT_NAMES; + char *pf_fcounter[FCNT_MAX+1] = FCNT_NAMES; + int error; + + PF_RULES_RLOCK_TRACKER; + + if (!nlmsg_reply(nw, hdr, sizeof(struct genlmsghdr))) + return (ENOMEM); + + ghdr_new = nlmsg_reserve_object(nw, struct genlmsghdr); + ghdr_new->cmd = PFNL_CMD_GET_STATUS; + ghdr_new->version = 0; + ghdr_new->reserved = 0; + + PF_RULES_RLOCK(); + + nlattr_add_string(nw, PF_GS_IFNAME, V_pf_status.ifname); + nlattr_add_bool(nw, PF_GS_RUNNING, V_pf_status.running); + nlattr_add_u32(nw, PF_GS_SINCE, V_pf_status.since); + nlattr_add_u32(nw, PF_GS_DEBUG, V_pf_status.debug); + nlattr_add_u32(nw, PF_GS_HOSTID, ntohl(V_pf_status.hostid)); + nlattr_add_u32(nw, PF_GS_STATES, V_pf_status.states); + nlattr_add_u32(nw, PF_GS_SRC_NODES, V_pf_status.src_nodes); + nlattr_add_u32(nw, PF_GS_REASSEMBLE, V_pf_status.reass); + nlattr_add_u32(nw, PF_GS_SYNCOOKIES_ACTIVE, V_pf_status.syncookies_active); + + nlattr_add_counters(nw, PF_GS_COUNTERS, PFRES_MAX, pf_reasons, + V_pf_status.counters); + nlattr_add_counters(nw, PF_GS_LCOUNTERS, KLCNT_MAX, pf_lcounter, + V_pf_status.lcounters); + nlattr_add_fcounters(nw, PF_GS_FCOUNTERS, FCNT_MAX, pf_fcounter, + V_pf_status.fcounters); + nlattr_add_counters(nw, PF_GS_SCOUNTERS, SCNT_MAX, pf_fcounter, + V_pf_status.scounters); + + pfi_update_status(V_pf_status.ifname, &s); + nlattr_add_u64_array(nw, PF_GS_BCOUNTERS, 2 * 2, (uint64_t *)s.bcounters); + nlattr_add_u64_array(nw, PF_GS_PCOUNTERS, 2 * 2 * 2, (uint64_t *)s.pcounters); + + nlattr_add(nw, PF_GS_CHKSUM, PF_MD5_DIGEST_LENGTH, V_pf_status.pf_chksum); + + PF_RULES_RUNLOCK(); + + if (!nlmsg_end(nw)) { + error = ENOMEM; + goto out; + } + + return (0); + +out: + nlmsg_abort(nw); + return (error); +} + static const struct nlhdr_parser *all_parsers[] = { &state_parser, &addrule_parser, @@ -1189,7 +1294,14 @@ static const struct genl_cmd pf_cmds[] = { .cmd_cb = pf_handle_set_statusif, .cmd_flags = GENL_CMD_CAP_DO | GENL_CMD_CAP_HASPOL, .cmd_priv = PRIV_NETINET_PF, - } + }, + { + .cmd_num = PFNL_CMD_GET_STATUS, + .cmd_name = "GETSTATUS", + .cmd_cb = pf_handle_get_status, + .cmd_flags = GENL_CMD_CAP_DUMP | GENL_CMD_CAP_HASPOL, + .cmd_priv = PRIV_NETINET_PF, + }, }; void diff --git a/sys/netpfil/pf/pf_nl.h b/sys/netpfil/pf/pf_nl.h index c44e331722b7..e486e9781b2e 100644 --- a/sys/netpfil/pf/pf_nl.h +++ b/sys/netpfil/pf/pf_nl.h @@ -46,6 +46,7 @@ enum { PFNL_CMD_CLRSTATES = 8, PFNL_CMD_KILLSTATES = 9, PFNL_CMD_SET_STATUSIF = 10, + PFNL_CMD_GET_STATUS = 11, __PFNL_CMD_MAX, }; #define PFNL_CMD_MAX (__PFNL_CMD_MAX -1) @@ -286,6 +287,34 @@ enum pf_set_statusif_types_t { PF_SS_UNSPEC, PF_SS_IFNAME = 1, /* string */ }; + +enum pf_counter_types_t { + PF_C_UNSPEC, + PF_C_COUNTER = 1, /* u64 */ + PF_C_NAME = 2, /* string */ + PF_C_ID = 3, /* u32 */ +}; + +enum pf_get_status_types_t { + PF_GS_UNSPEC, + PF_GS_IFNAME = 1, /* string */ + PF_GS_RUNNING = 2, /* bool */ + PF_GS_SINCE = 3, /* u32 */ + PF_GS_DEBUG = 4, /* u32 */ + PF_GS_HOSTID = 5, /* u32 */ + PF_GS_STATES = 6, /* u32 */ + PF_GS_SRC_NODES = 7, /* u32 */ + PF_GS_REASSEMBLE = 8, /* u32 */ + PF_GS_SYNCOOKIES_ACTIVE = 9, /* bool */ + PF_GS_COUNTERS = 10, /* nested, */ + PF_GS_LCOUNTERS = 11, /* nested, */ + PF_GS_FCOUNTERS = 12, /* nested, */ + PF_GS_SCOUNTERS = 13, /* nested, */ + PF_GS_CHKSUM = 14, /* byte array */ + PF_GS_PCOUNTERS = 15, /* u64 array */ + PF_GS_BCOUNTERS = 16, /* u64 array */ +}; + #ifdef _KERNEL void pf_nl_register(void); diff --git a/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c b/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c index bb064dd549d2..e618683845be 100644 --- a/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c +++ b/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c @@ -50,7 +50,7 @@ struct lmodule *module; -static int dev = -1; +static struct pfctl_handle *pfh; static int started; static uint64_t pf_tick; @@ -341,7 +341,7 @@ pf_limits(struct snmp_context __unused *ctx, struct snmp_value *val, return (SNMP_ERR_NOSUCHNAME); } - if (ioctl(dev, DIOCGETLIMIT, &pl)) { + if (ioctl(pfctl_fd(pfh), DIOCGETLIMIT, &pl)) { syslog(LOG_ERR, "pf_limits(): ioctl(): %s", strerror(errno)); return (SNMP_ERR_GENERR); @@ -431,7 +431,7 @@ pf_timeouts(struct snmp_context __unused *ctx, struct snmp_value *val, return (SNMP_ERR_NOSUCHNAME); } - if (ioctl(dev, DIOCGETTIMEOUT, &pt)) { + if (ioctl(pfctl_fd(pfh), DIOCGETTIMEOUT, &pt)) { syslog(LOG_ERR, "pf_timeouts(): ioctl(): %s", strerror(errno)); return (SNMP_ERR_GENERR); @@ -1174,7 +1174,7 @@ pfi_refresh(void) io.pfiio_size = numifs; io.pfiio_buffer = p; - if (ioctl(dev, DIOCIGETIFACES, &io)) { + if (ioctl(pfctl_fd(pfh), DIOCIGETIFACES, &io)) { syslog(LOG_ERR, "pfi_refresh(): ioctl(): %s", strerror(errno)); goto err2; @@ -1231,7 +1231,7 @@ pfq_refresh(void) bzero(&pa, sizeof(pa)); pa.version = PFIOC_ALTQ_VERSION; - if (ioctl(dev, DIOCGETALTQS, &pa)) { + if (ioctl(pfctl_fd(pfh), DIOCGETALTQS, &pa)) { syslog(LOG_ERR, "pfq_refresh: ioctl(DIOCGETALTQS): %s", strerror(errno)); return (-1); @@ -1251,7 +1251,7 @@ pfq_refresh(void) pa.ticket = ticket; pa.nr = i; - if (ioctl(dev, DIOCGETALTQ, &pa)) { + if (ioctl(pfctl_fd(pfh), DIOCGETALTQ, &pa)) { syslog(LOG_ERR, "pfq_refresh(): " "ioctl(DIOCGETALTQ): %s", strerror(errno)); @@ -1287,7 +1287,7 @@ pfs_refresh(void) return (0); pfctl_free_status(pfs); - pfs = pfctl_get_status(dev); + pfs = pfctl_get_status_h(pfh); if (pfs == NULL) { syslog(LOG_ERR, "pfs_refresh(): ioctl(): %s", @@ -1329,7 +1329,7 @@ pft_refresh(void) io.pfrio_size = numtbls; io.pfrio_buffer = t; - if (ioctl(dev, DIOCRGETTSTATS, &io)) { + if (ioctl(pfctl_fd(pfh), DIOCRGETTSTATS, &io)) { syslog(LOG_ERR, "pft_refresh(): ioctl(): %s", strerror(errno)); goto err2; @@ -1396,7 +1396,7 @@ pfa_table_addrs(u_int sidx, struct pfr_table *pt) io.pfrio_buffer = t; io.pfrio_esize = sizeof(struct pfr_astats); - if (ioctl(dev, DIOCRGETASTATS, &io)) { + if (ioctl(pfctl_fd(pfh), DIOCRGETASTATS, &io)) { syslog(LOG_ERR, "pfa_table_addrs(): ioctl() on %s: %s", pt->pfrt_name, strerror(errno)); numaddrs = -1; @@ -1464,7 +1464,7 @@ pfa_refresh(void) io.pfrio_size = numtbls; io.pfrio_buffer = pt; - if (ioctl(dev, DIOCRGETTABLES, &io)) { + if (ioctl(pfctl_fd(pfh), DIOCRGETTABLES, &io)) { syslog(LOG_ERR, "pfa_refresh(): ioctl(): %s", strerror(errno)); goto err2; @@ -1519,14 +1519,14 @@ pfl_scan_ruleset(const char *path) struct pfl_entry *e; u_int32_t nr, i; - if (pfctl_get_rules_info(dev, &rules, PF_PASS, path)) { + if (pfctl_get_rules_info(pfctl_fd(pfh), &rules, PF_PASS, path)) { syslog(LOG_ERR, "pfl_scan_ruleset: ioctl(DIOCGETRULES): %s", strerror(errno)); goto err; } for (nr = rules.nr, i = 0; i < nr; i++) { - if (pfctl_get_rule(dev, i, rules.ticket, path, + if (pfctl_get_rule(pfctl_fd(pfh), i, rules.ticket, path, PF_PASS, &rule, anchor_call)) { syslog(LOG_ERR, "pfl_scan_ruleset: ioctl(DIOCGETRULE):" " %s", strerror(errno)); @@ -1572,7 +1572,7 @@ pfl_walk_rulesets(const char *path) bzero(&prs, sizeof(prs)); strlcpy(prs.path, path, sizeof(prs.path)); - if (ioctl(dev, DIOCGETRULESETS, &prs)) { + if (ioctl(pfctl_fd(pfh), DIOCGETRULESETS, &prs)) { syslog(LOG_ERR, "pfl_walk_rulesets: ioctl(DIOCGETRULESETS): %s", strerror(errno)); goto err; @@ -1580,7 +1580,7 @@ pfl_walk_rulesets(const char *path) for (nr = prs.nr, i = 0; i < nr; i++) { prs.nr = i; - if (ioctl(dev, DIOCGETRULESET, &prs)) { + if (ioctl(pfctl_fd(pfh), DIOCGETRULESET, &prs)) { syslog(LOG_ERR, "pfl_walk_rulesets: ioctl(DIOCGETRULESET):" " %s", strerror(errno)); goto err; @@ -1671,13 +1671,13 @@ pf_init(struct lmodule *mod, int __unused argc, char __unused *argv[]) { module = mod; - if ((dev = open("/dev/pf", O_RDONLY)) == -1) { + if ((pfh = pfctl_open(PF_DEVICE)) == NULL) { syslog(LOG_ERR, "pf_init(): open(): %s\n", strerror(errno)); return (-1); } - if ((altq_enabled = altq_is_enabled(dev)) == -1) { + if ((altq_enabled = altq_is_enabled(pfctl_fd(pfh))) == -1) { syslog(LOG_ERR, "pf_init(): altq test failed"); return (-1); } @@ -1756,7 +1756,8 @@ pf_fini(void) pfctl_free_status(pfs); pfs = NULL; - close(dev); + pfctl_close(pfh); + return (0); } From nobody Mon Apr 29 14:37:37 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VSmBn4CSKz5JSRY; Mon, 29 Apr 2024 14:37: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VSmBn3d7rz4LGg; Mon, 29 Apr 2024 14:37:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714401457; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Z+AlEKgZ7NWywdMo2FneL7NIDAaV1D6JaI9enB0XBG4=; b=HDCtiltY5C34GKG0xLGq3Ji0AMdZEOkfve8IWpVqvloyo7pxnoJw7IZ5RvbP5R8Xr95pfm Pk0q57XQoDkyK8PYRrYNMp98YUzlwzEkjrFt1nKfBc4RQ40Dsym469knAeeAbPKHW/5rMJ K8gIf44DdXsoyVKJkX4divlMnaZ+9o6m2aB4sUh+QA1YyTsbMLpRnZryFKiY5Vy7DB60sn nBU7J0iq2mxPZChh4au/vpkjiXm5Wc6ZfPmKUY/8++z1bHMu8ZjPz1Up7OlUqIm1Wq/JcD wxlXfxX1jJjhmmSR1Q0OMyYgso4oO8awkm/JYiQdUfnCD5XA5tYqsBNtKMwyrg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714401457; a=rsa-sha256; cv=none; b=dv+k9MaDjrF9a8Xd5KtWXnNIaPs31iZUZVq2jGyVU1Mplt+22Pc2Bpbj42KFZ0LDzx2yJK 41Zn3OKKF4EboKXKq9Y6cE0ZCMCq+mZlHl0YWtADDp4XHRDvjqSPYVpP83GtwwI5MBACft VgIbpMiUtXLjuZ2rc23SrC4PSlnHXPK/lu+YqB6DS38p0lJeuWdmal6OOUaePrHcI/0M1K +MzIPu8Jv/K+UuJsPBgiFh35lHTs6E6yLx7VAnXNu0tdzN38h/b3CXdqZIYhKNOaZ6UZU/ fpxwxOUXTZErQnif7gz0FXcFjDuJYRWpYJKcWuxfGmYAOtCAubcyHrcNdm86Fw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714401457; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Z+AlEKgZ7NWywdMo2FneL7NIDAaV1D6JaI9enB0XBG4=; b=TI1g0rSYqIaEPGwmMJZtg6bmcrnJrVBMjcqNdoHQZBqMhE8aiqeYyYqp8EnI0edYNhUG/R x0VKMCPWd5Xdh2CACjo6AK+IX0mUt5g+VewWDRG8W+MKeBgUAtXfyxKNenfHFUzfsovZnl rGThKyKh/9Xo8eLMEID4VqH4v83ARkrnntEbh6h6PSOX2mxB/FDJ9RQY7CovuZSRWBMHZa NkNHcjTo6MqKco9xCooQ7pFRvL03JOMVzNY3rtojHGnxrAcPWFYAQnCe6Jpbw7emvQj7Oy joRAwnk4BkCIkx1ffTOyC5AduI4Tr735eqdBU7tBCShIep4jrDgZIQio9XOddA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VSmBn3Cc4z1Bkc; Mon, 29 Apr 2024 14:37:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43TEbbtn080925; Mon, 29 Apr 2024 14:37:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43TEbbJS080922; Mon, 29 Apr 2024 14:37:37 GMT (envelope-from git) Date: Mon, 29 Apr 2024 14:37:37 GMT Message-Id: <202404291437.43TEbbJS080922@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: 86fbb05da1ae - main - ctl: Fix CTL GET EVENT STATUS NOTIFICATION valid bits List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 86fbb05da1aed64eb9b09d7f3b2cd72048c959c1 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=86fbb05da1aed64eb9b09d7f3b2cd72048c959c1 commit 86fbb05da1aed64eb9b09d7f3b2cd72048c959c1 Author: HP van Braam AuthorDate: 2024-04-29 14:34:46 +0000 Commit: Warner Losh CommitDate: 2024-04-29 14:37:30 +0000 ctl: Fix CTL GET EVENT STATUS NOTIFICATION valid bits Linux as an initiator periodically sends the following to SCSI cdrom devices: 4a 01 00 00 10 00 00 00 08 00 According to the ctl_cmd_entry for this command this is invalid which leads to a lot of failed SCSI commands. The mask in this commit is based off of an early draft of the mmc standard, https://www.t10.org/ftp/t10/document.97/97-108r0.pdf, as well as subsequent standards (mmc2 through mmc6). This solves the issue with Linux initiators. Signed-off-by: HP van Braam Reviewed by: imp, mav Pull Request: https://github.com/freebsd/freebsd-src/pull/1201 --- sys/cam/ctl/ctl_cmd_table.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/cam/ctl/ctl_cmd_table.c b/sys/cam/ctl/ctl_cmd_table.c index a62c5e8c1e81..28d937edd7dc 100644 --- a/sys/cam/ctl/ctl_cmd_table.c +++ b/sys/cam/ctl/ctl_cmd_table.c @@ -1228,7 +1228,7 @@ const struct ctl_cmd_entry ctl_cmd_table[256] = CTL_CMD_FLAG_ALLOW_ON_PR_RESV | CTL_FLAG_DATA_IN, CTL_LUN_PAT_NONE, - 10, {0x02, 0x01, 0, 0, 0, 0xff, 0xff, 0xff, 0x07}}, + 10, {0xe1, 0, 0, 0x7e, 0, 0, 0xff, 0xff, 0x07}}, /* 4B PAUSE/RESUME */ {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, From nobody Mon Apr 29 16:15:58 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VSpNH1lQbz5JcKC; Mon, 29 Apr 2024 16:15: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VSpNH11cSz4VVb; Mon, 29 Apr 2024 16:15:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714407359; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RMWfuDaHhrJBxQI51rDbtwXxp1s9DgNoj5KjYz/OEmE=; b=mF8HPN/fpKsfMVdhj7m38mx5RgeqCg8U4XVDKWXeb3bqrdJw9XrqdpxMTyXv7CYIm3HxPy tRrd9RO1OYdUlYMe6mRVW/IQ7lm3BkYKCxPah+CmL3dL6AAIRy/krPOhD1g5tQgrs6rvTd jGaAm5pCYXNa35l5KYRMnkJkLvgr3+YkToI/4p7rQmSnw3TEE1V6ntX4XlMVtpOuvrVF7B rSyAJ+0vrIfyY8sVX3itBh9GEGJ/dkJKscUIfO9mURi/5WVztlLtEZoL1Hhc60cU/gsIgS WlWgMTbxQWpKUxgJvafjSoDCbCmWRDTqmsSbzrGiQhxBgpaqvIp9LCiAFyHkxA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714407359; a=rsa-sha256; cv=none; b=yuLmfLZRpqrouETl8JrqKmvp8Ho5HkPkVkhjVQZls3YOf/oIb65Ho64VtYokeh1re1hTdL uwPER+M7xl9G5tXOAlI0/WkwoXiheFUNKzGSdHLu+UKKLT72fFV9TrpdjZMQQFTPhepkpz rmA//4BbH1xBW95tuDWqEHF6Owg0qfPEzdV+I7h1IiftIcYk0191QNhyajTyq84p1tU3VW MgcPRB0C97T1g6c1KwTPAL+zFgUGpv9kAYRl8Y29we4ryVfp0oEUW0VpSnkomSgdsf1nW9 xxINHZbUv6FOHa30GCVvVWXjtzqkp7vQDwsfOdjK3RnFGTJv9VNVE9Y8c4L8DQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714407359; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RMWfuDaHhrJBxQI51rDbtwXxp1s9DgNoj5KjYz/OEmE=; b=ZuEtTTJ8gOjv9NQ62CIR0Ms1W36ViX2nqK2fyyjLSL8gr/yPWK4Z1jU8EXzTHttRFdFDj1 pvz9YbN9ZrOYhP8Oab3LK/YHioPxZkVr8iXePulZYGE7MGmo1eBk7Bc6rv6WG6KcEBOS1j m6ImpzcN1PxDMN9NJpitWJaD51Nm0iPHjvglCKsPAOxDhVjuT35zkrK3rLc19DE6LfwcDs yNTNJY1tGzQazNTz0tq7y43pMlOolMNF2+6Xtw+eqG2dJf1XN0t1QniEAY9xoSVWEKauLM t1RFwMvZhSImLG/Is57XXR82pTUYz24edIvrE11q9bOdIBBWVGB9L8POWDwURQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VSpNH0Vgxz1FZ0; Mon, 29 Apr 2024 16:15:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43TGFw6I050259; Mon, 29 Apr 2024 16:15:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43TGFwqe050256; Mon, 29 Apr 2024 16:15:58 GMT (envelope-from git) Date: Mon, 29 Apr 2024 16:15:58 GMT Message-Id: <202404291615.43TGFwqe050256@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: 221d459fbc67 - main - pflow: handle unattached states List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 221d459fbc67e0c0565d6c6ea52fe8bbc5466fc7 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=221d459fbc67e0c0565d6c6ea52fe8bbc5466fc7 commit 221d459fbc67e0c0565d6c6ea52fe8bbc5466fc7 Author: Kristof Provost AuthorDate: 2024-04-29 09:51:17 +0000 Commit: Kristof Provost CommitDate: 2024-04-29 16:13:19 +0000 pflow: handle unattached states It's possible for states to be cleaned up (through pf_detach_state()) that have not been fully attached. For example if there's an ID conflict during pf_state_insert(). pflow exports states from pf_detach_state(), so it can get called on such states, but did not account for this and could end up dereferencing a NULL state key. Check for this in export_pflow() and do not export unattached states. See also: https://redmine.pfsense.org/issues/15446 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pflow.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/netpfil/pf/pflow.c b/sys/netpfil/pf/pflow.c index f3dba7687d05..a437f0259af5 100644 --- a/sys/netpfil/pf/pflow.c +++ b/sys/netpfil/pf/pflow.c @@ -750,6 +750,10 @@ export_pflow(const struct pf_kstate *st) NET_EPOCH_ASSERT(); + /* e.g. if pf_state_key_attach() fails. */ + if (st->key[PF_SK_STACK] == NULL || st->key[PF_SK_WIRE] == NULL) + return; + sk = st->key[st->direction == PF_IN ? PF_SK_WIRE : PF_SK_STACK]; CK_LIST_FOREACH(sc, &V_pflowif_list, sc_next) { From nobody Mon Apr 29 21:02:27 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VSy1N6Kbjz5Jvyd; Mon, 29 Apr 2024 22:00: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VSy1N5FCtz4nLh; Mon, 29 Apr 2024 22:00:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714428008; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3IsPWF+eR+tWYg/+Fh6Nqch42M3zDa+XKmfSABbpH8A=; b=RFBWL2MShkhwZ46rn/n6AiJE3upcc25vbEVUkm1OnQwnY+TJ591eZ6fgQmz933I9VXDON/ bRorfUqP3fs2xxTMvZbm/xUlzaCtPYdFUwPAZa79kNhY+I5jkg7DnZAysluIJ+gGFUFuUG mHTO0IcwKEK2tw99MkECDWUN5JRktqXPe73VRF1137AXEcG9C5JBCVVxkIKLwAY4MAF/vY 60M1M36lVM+7FpI2+5KcGsbTdOH8gsKz5IDqFv9tUHNDA40djP+ETTO3G153BRNTuyhwSQ 5FH6tP2IgqBhulKP/fj5npmH/NlMXzO3EPeIn0/4P1gPuulk6PbwKVQcjRtv7A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714428008; a=rsa-sha256; cv=none; b=L6uNd6igsHWPgYkQhkInE0JhWFOrJQ8TQGhejPBnvNLNO+qaWbZZxGiByDgdAtritjpNjQ QjfSJpe39n9Xay7bBrqz18gOENBgO/NnIr9W/mcvehXsSEZ5za4siGNzl162fcfir8H+4P J9kknCbrG3DX0XKuFxFszZ4Gpv3hEkAbyDrCQ1J6d5zKPFXG4HSj+VE9CQ5UtVpeC76UAu SeRiT+wzeY4p+86v+w5UGmzUyuEh94kSkeR1DuaUvCsot7oSil7ePwfBLvicDqcFD6Tl+5 eOjj3GmmWoini4D3a1map6Xeov7Hr8Vsei/IpAOByb+AnZUIZZo0eYeHRYy+Yw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714428008; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3IsPWF+eR+tWYg/+Fh6Nqch42M3zDa+XKmfSABbpH8A=; b=wRb5wmS21+d8MGsPcAtQvzhvm7SuD5z+a7WIZDMjLokGIZQkeKSpMqPMV0Fz0G9U79zsnt 1l99kWiW7Sfm+4bKKqFG1mwjtzWI8wOUx0KQEI5isDtCbpcTKYLv+DY/OElxJFGRHoI+G8 5wUIcmavlv9mRWCMRAGqSxVetGzpacXnTI4WJZXohmZIs8fNhwFOwlbsywOsrxYfuCKz+r rSgnqnwKUJ2m9xhzPf+mfhqJ+sZANDSIJ+2fcVxBjDAUBOZex1Oc9RSKRsv7IQJoon+cS3 Azi2jQv49A+y6dJJMf40aVffq9eni5FlbKD7M+TLcv/khGELHCigWfXWyzq/MA== Received: from gitrepo.freebsd.org (unknown [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VSxgf19s6z1KGD; Mon, 29 Apr 2024 21:44:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43TL2RjA040879; Mon, 29 Apr 2024 21:02:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43TL2Raw040876; Mon, 29 Apr 2024 21:02:27 GMT (envelope-from git) Date: Mon, 29 Apr 2024 21:02:27 GMT Message-Id: <202404292102.43TL2Raw040876@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Navdeep Parhar Subject: git: 2965ae591441 - main - cxgbe(4): Shared code update to deal with partial failure in query_params. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2965ae59144177eb3570721295da9cbc447f1105 Auto-Submitted: auto-generated The branch main has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=2965ae59144177eb3570721295da9cbc447f1105 commit 2965ae59144177eb3570721295da9cbc447f1105 Author: Navdeep Parhar AuthorDate: 2024-02-14 01:28:53 +0000 Commit: Navdeep Parhar CommitDate: 2024-04-29 20:51:41 +0000 cxgbe(4): Shared code update to deal with partial failure in query_params. Obtained from: Chelsio Communications MFC after: 1 week Sponsored by: Chelsio Communications --- sys/dev/cxgbe/common/t4_hw.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/sys/dev/cxgbe/common/t4_hw.c b/sys/dev/cxgbe/common/t4_hw.c index bb2ed5e4d820..360d44847004 100644 --- a/sys/dev/cxgbe/common/t4_hw.c +++ b/sys/dev/cxgbe/common/t4_hw.c @@ -7740,9 +7740,18 @@ int t4_query_params_rw(struct adapter *adap, unsigned int mbox, unsigned int pf, } ret = t4_wr_mbox(adap, mbox, &c, sizeof(c), &c); - if (ret == 0) - for (i = 0, p = &c.param[0].val; i < nparams; i++, p += 2) - *val++ = be32_to_cpu(*p); + + /* + * We always copy back the results, even if there's an error. We'll + * get an error if any of the parameters was unknown to the Firmware, + * but there will be results for the others ... (Older Firmware + * stopped at the first unknown parameter; newer Firmware processes + * them all and flags the unknown parameters with a return value of + * ~0UL.) + */ + for (i = 0, p = &c.param[0].val; i < nparams; i++, p += 2) + *val++ = be32_to_cpu(*p); + return ret; } From nobody Mon Apr 29 20:49:02 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VSy1N66ygz5Jvyc; Mon, 29 Apr 2024 22:00: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VSy1N4RnJz4ncK; Mon, 29 Apr 2024 22:00:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714428008; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jSQZc/ipKUCioWHpGhCkfYRjDkp7pjXqU06ghhx0jo0=; b=RR6UISY6v2riLrAua7KcpNXVHGRHk/04DcvSKEyw2kZkNOdeagjZN37tXq87fN8RjBS6re ksA6QXmOhUZCXBq2kINE/0ct/yHRXgs+LXym2hWKMrGIvF0gj8IHkuPf1A4ZkGyvxnVofX 7NnwagIjeP/pGaBtkE3UBAYv7gBrXUsRUglvcBlRTNYlZClNbgG91zzZbaPYU4oegIgDCM CZrm9Ygyo2aXxaVkjMHYxThm74WwriJAnt0vxBAGVoZQBFePcU8cLXo3Jse4A7uc3UVam8 huOsVIri0rMqHsZly6L0YpSXQ/Ibx65jMM7tE9sZqbOZe8Kkd1ElhHbX4vu6oA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714428008; a=rsa-sha256; cv=none; b=jn9GEzZVPwo5JlNZ3ReVQwQLKKeqjYKsLNBBpzv1ZiMAFkGVqcL65TLOD9YV8Lc+YhG2Xx diS4sfFtSzXCS6ysgKr+mYOq3+diA3a7cqSUk7zL2wZosPKkEKI+RAmQ0MmCDehKjBTlq3 XSw2axryB5+Y+mKCCY/1MK29MVfu6VZzHqUItORtHBQrHEEMUMXzQro/Y36HmBic9lQpex CIL9mnSxjS9uj800bEe+1c/QKvGuV4qWPWQRY7t7H6uk1sk3dcGFwemTLt5BpVoZiuCeBL xoGgnkVitlzlhZEnp6Z6wkpakgj95AbHZxFAvoJVmPxfXx2cL9mOHAlxVL4MJQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714428008; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jSQZc/ipKUCioWHpGhCkfYRjDkp7pjXqU06ghhx0jo0=; b=fxCP4de8mBw0FJkzqncGmKzuU0bMEu59qUT6OMGLm6ASi28COIptYRh+A0JUChMj1+x+Vg +hJBYSW/QzSpo1yy4x0j61lqc4BeJ7d1eqQ8FwxrEBl2Xx736G9nXffcRIzTSbUQCxoyvx KtabdpHPVEfV/+JlQRo8ikjoEPbqged6I4BGBCDJ3GgAZhgFp/WhCo2Qq2MNTXCGRIxeuF KkTe8/IYQi9gQKgiG+GeQ3Ye0bm/7Owv/k2I1RQBkWvuB5Q5ruuYK8ocasSbsUUZptm9Om Tf9xdmj9s12dFrsvIvn6ZCndlErwdiFNzQkFTBHWI/0IUJh9+PZoI/zRHEApCQ== Received: from gitrepo.freebsd.org (unknown [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VSxgf1CBCz1KGF; Mon, 29 Apr 2024 21:44:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43TKn2KD008026; Mon, 29 Apr 2024 20:49:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43TKn2QW008023; Mon, 29 Apr 2024 20:49:02 GMT (envelope-from git) Date: Mon, 29 Apr 2024 20:49:02 GMT Message-Id: <202404292049.43TKn2QW008023@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Navdeep Parhar Subject: git: 43f6f0848804 - main - cxgbe(4): Reword the comment explaining the atid/cookie split. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 43f6f08488046788b0ad66e9a5119f36e5de71ab Auto-Submitted: auto-generated The branch main has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=43f6f08488046788b0ad66e9a5119f36e5de71ab commit 43f6f08488046788b0ad66e9a5119f36e5de71ab Author: Navdeep Parhar AuthorDate: 2023-04-01 23:07:36 +0000 Commit: Navdeep Parhar CommitDate: 2024-04-29 20:40:40 +0000 cxgbe(4): Reword the comment explaining the atid/cookie split. Avoid a magic constant while here. No functional change intended. MFC after: 1 week Sponsored by: Chelsio Communications --- sys/dev/cxgbe/offload.h | 6 +++--- sys/dev/cxgbe/t4_main.c | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/sys/dev/cxgbe/offload.h b/sys/dev/cxgbe/offload.h index 688c4b592180..a8b243b764c8 100644 --- a/sys/dev/cxgbe/offload.h +++ b/sys/dev/cxgbe/offload.h @@ -67,10 +67,10 @@ struct stid_region { }; /* - * Max # of ATIDs. The absolute HW max is 14b (enough for 16K) but we reserve - * the upper 3b for use as a cookie to demux the reply. + * Max # of ATIDs. The absolute HW max is larger than this but we reserve a few + * of the upper bits for use as a cookie to demux the reply. */ -#define MAX_ATIDS 2048U +#define MAX_ATIDS (M_TID_TID + 1) union aopen_entry { void *data; diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 7bdce5faf7af..16b3ac7dd6ff 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -3905,6 +3905,9 @@ rw_via_memwin(struct adapter *sc, int idx, uint32_t addr, uint32_t *val, return (0); } +CTASSERT(M_TID_COOKIE == M_COOKIE); +CTASSERT(MAX_ATIDS <= (M_TID_TID + 1)); + static void t4_init_atid_table(struct adapter *sc) { From nobody Mon Apr 29 18:35:49 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VSy1Q34W2z5Jw4B; Mon, 29 Apr 2024 22:00: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VSy1P5pgcz4nhs; Mon, 29 Apr 2024 22:00:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714428009; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yF3wiBjMwoh2gVYuVWnuaFWd46Lb+wT4ACDu0sQRsF8=; b=dlSQ3bSz2ZE5yYi748cGNhj5KLpctRcNj8pHKQJriw+q4H/e7TxOmPyflCw/5k2nU6Ul65 CsUukWkm3141q28NsGVTf7fbrSonKgPDY6I/E9Sf/5DFEEk9tGDUEiFhNaMaS6QXco+2SE kM1owRLTwRRCrlz1qmuRlvuoduUjThdOkggJMqPqZyRXzqzRLPPoVwkWGpf60bMXfuwTcX p3fWn0eLJtmNVlS1svc5P3P1On+yRjmsOW9CwC6+XxHNohF4j2icGFaPNcRPPg4+J75QjI 5C0mCGcIrJq9+FYEBIUOJf8rSzDzRu4W7EMz2itbrOYtgZRJG3YHbgO1CTjMFQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714428009; a=rsa-sha256; cv=none; b=YrcBbitaJotbJKqP9MET0trCaMnQKnoudVoXoTqyTXHQEMPqVrMGHERClTyK9sSo4qAuBz lJ7YrpT+HmZwg/Em95sUk7r2U61crBLSpm4zLx8m9lTgRqdFyNn2TN+X0TzzntFwEBc7Fe Yy8cwtkT3IXGDbOk0fzDliRYyynVUOnLVEVcE1Zebl0toJxvfi5hAfBngRXyd6LgXEfvnl ZihnDi7FsBlCb8c9+GdjWyvHujg6Am35Cq9byvoBcbyF3/Onby0mDtOT5jmTCBfggStQEU CC51fCzmJa1wBORZbUoBNfOcPcQjhAtlfEGqGf5reDoatd7QR5hSkX59d4+CMg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714428009; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yF3wiBjMwoh2gVYuVWnuaFWd46Lb+wT4ACDu0sQRsF8=; b=UQIwerZX1T1GvkRAPCcpQmZyxRk8Y9WQmm6mcrNyzGKO5QHpNA7oIiHJpz6GuDaeqXjGuE Be7a5mvf8EiylzHAN0CB0k3dUj4XlsKlZQIRog/JwY/G31C7px98fx8JiHeFKAsefrfJND R2m74iOb2xnH4FdtP4k39NxVSDf+g+49n2v2avUm/fMnjinv60LgWmSC0BcbHq6hcXlQCf rj8t8rqJH680wNWTzTGriX8axBz0TRQY/5j21Oqx6uWk9MrojF3K+rm7L12gsBaQn9b98y y7K9syf62O6s1wh+Hn8/Y2sIDhLVCiKIoWwy+Sw0ErDuonPvRFHocrF0Hup6MA== Received: from gitrepo.freebsd.org (unknown [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VSxgf2Nm2z1KLy; Mon, 29 Apr 2024 21:44:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43TIZn5U086602; Mon, 29 Apr 2024 18:35:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43TIZnWx086599; Mon, 29 Apr 2024 18:35:49 GMT (envelope-from git) Date: Mon, 29 Apr 2024 18:35:49 GMT Message-Id: <202404291835.43TIZnWx086599@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Navdeep Parhar Subject: git: f76effed14b2 - main - cxgbe(4): Remove tx_modq lookup table. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f76effed14b25bfa0c47b10f6d8a076104c48d94 Auto-Submitted: auto-generated The branch main has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=f76effed14b25bfa0c47b10f6d8a076104c48d94 commit f76effed14b25bfa0c47b10f6d8a076104c48d94 Author: Navdeep Parhar AuthorDate: 2024-03-29 05:49:32 +0000 Commit: Navdeep Parhar CommitDate: 2024-04-29 18:26:49 +0000 cxgbe(4): Remove tx_modq lookup table. The driver always uses the same modulation queue as the channel and the table is unnecessary. MFC after: 1 week Sponsored by: Chelsio Communications --- sys/dev/cxgbe/common/common.h | 4 +++- sys/dev/cxgbe/common/t4_hw.c | 5 ----- sys/dev/cxgbe/crypto/t6_kern_tls.c | 4 ++-- sys/dev/cxgbe/tom/t4_tom.c | 2 +- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/sys/dev/cxgbe/common/common.h b/sys/dev/cxgbe/common/common.h index 0861e3df4bee..a9a609d5c995 100644 --- a/sys/dev/cxgbe/common/common.h +++ b/sys/dev/cxgbe/common/common.h @@ -252,7 +252,6 @@ struct tp_params { unsigned int tre; /* log2 of core clocks per TP tick */ unsigned int dack_re; /* DACK timer resolution */ unsigned int la_mask; /* what events are recorded by TP LA */ - unsigned short tx_modq[MAX_NCHAN]; /* channel to modulation queue map */ uint16_t filter_mode; uint16_t filter_mask; /* Used by TOE and hashfilters */ @@ -273,6 +272,9 @@ struct tp_params { int8_t frag_shift; }; +/* Use same modulation queue as the tx channel. */ +#define TX_MODQ(tx_chan) (tx_chan) + struct vpd_params { unsigned int cclk; u8 ec[EC_LEN + 1]; diff --git a/sys/dev/cxgbe/common/t4_hw.c b/sys/dev/cxgbe/common/t4_hw.c index c18243e4b681..25eefa57b29f 100644 --- a/sys/dev/cxgbe/common/t4_hw.c +++ b/sys/dev/cxgbe/common/t4_hw.c @@ -9800,7 +9800,6 @@ read_filter_mode_and_ingress_config(struct adapter *adap) */ int t4_init_tp_params(struct adapter *adap) { - int chan; u32 tx_len, rx_len, r, v; struct tp_params *tpp = &adap->params.tp; @@ -9808,10 +9807,6 @@ int t4_init_tp_params(struct adapter *adap) tpp->tre = G_TIMERRESOLUTION(v); tpp->dack_re = G_DELAYEDACKRESOLUTION(v); - /* MODQ_REQ_MAP defaults to setting queues 0-3 to chan 0-3 */ - for (chan = 0; chan < MAX_NCHAN; chan++) - tpp->tx_modq[chan] = chan; - read_filter_mode_and_ingress_config(adap); if (chip_id(adap) > CHELSIO_T5) { diff --git a/sys/dev/cxgbe/crypto/t6_kern_tls.c b/sys/dev/cxgbe/crypto/t6_kern_tls.c index a9fc70c8f7d7..f374de5241f6 100644 --- a/sys/dev/cxgbe/crypto/t6_kern_tls.c +++ b/sys/dev/cxgbe/crypto/t6_kern_tls.c @@ -170,7 +170,7 @@ mk_ktls_act_open_req(struct adapter *sc, struct vi_info *vi, struct inpcb *inp, options |= F_NON_OFFLOAD; cpl->opt0 = htobe64(options); - options = V_TX_QUEUE(sc->params.tp.tx_modq[vi->pi->tx_chan]); + options = V_TX_QUEUE(TX_MODQ(vi->pi->tx_chan)); if (tp->t_flags & TF_REQ_TSTMP) options |= F_TSTAMPS_EN; cpl->opt2 = htobe32(options); @@ -205,7 +205,7 @@ mk_ktls_act_open_req6(struct adapter *sc, struct vi_info *vi, options |= F_NON_OFFLOAD; cpl->opt0 = htobe64(options); - options = V_TX_QUEUE(sc->params.tp.tx_modq[vi->pi->tx_chan]); + options = V_TX_QUEUE(TX_MODQ(vi->pi->tx_chan)); if (tp->t_flags & TF_REQ_TSTMP) options |= F_TSTAMPS_EN; cpl->opt2 = htobe32(options); diff --git a/sys/dev/cxgbe/tom/t4_tom.c b/sys/dev/cxgbe/tom/t4_tom.c index 4d4400512ef5..b2d0b85e4832 100644 --- a/sys/dev/cxgbe/tom/t4_tom.c +++ b/sys/dev/cxgbe/tom/t4_tom.c @@ -1202,7 +1202,7 @@ calc_options2(struct vi_info *vi, struct conn_params *cp) /* XXX: F_RX_CHANNEL for multiple rx c-chan support goes here. */ - opt2 |= V_TX_QUEUE(sc->params.tp.tx_modq[pi->tx_chan]); + opt2 |= V_TX_QUEUE(TX_MODQ(pi->tx_chan)); opt2 |= V_PACE(0); opt2 |= F_RSS_QUEUE_VALID; opt2 |= V_RSS_QUEUE(sc->sge.ofld_rxq[cp->rxq_idx].iq.abs_id); From nobody Mon Apr 29 19:32:50 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VSy1b6nswz5Jvnr; Mon, 29 Apr 2024 22:00: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VSy1b4Lkbz4p8S; Mon, 29 Apr 2024 22:00:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714428019; h=from:from:reply-to:subject:subject: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+H3kfCFU4w9EJoBLoG3B6mSv0fXNtJ0nsCJgGmpOnk=; b=IpFmKDocnhhWVHmYYYjNGhREBGo7EIZuSQc0ubF3EZYHIM0rgxk8QKLVKZhaighQsWsuOJ PuhK5DzetZ5/ejuSfQ+SuXJHoxnnM5auGW/HLRviATeacBZPkRVBvw2BapQyN0FlaCDY6O k/ygg1ASSXqxqGxfZ3l0z4SPRAorGcNkNrhI0iVYYx5BCkJCr3fjNDV6/Qbnz+017yWkXl n0Jwa4cwe9cHy6jrq90KsUFPv45ZTZ/Krq0gAVFYv8VsccRId7tb6N6YuTTkB48uUqAUQE EHgciqARGl1sD/UYX8GGp615rgFYJWgJ2AjMQMEBreKI2rYxisBXHa1pl/wMYA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714428019; a=rsa-sha256; cv=none; b=txUJtas7lG4lIsJx3gO+5em3iMUisRZaPQhYXlpWrwjwhFKJEOcbHXrl44cmgng6OjpJyS wvYsFbW635PbYHVCukT1AHh/YqBuz8pmDYIIe5qZCwyNXOae6Gy3Qo+/HaqayY2ylLKtms iE4FBmvQJ+xHvC97SAwk/xoBF5wEcMFuCtWKvdQ9sugnyKHqR2B7e0u253lCeOD9RLPWX2 QwPAeHemtvsbmkqe+Ri7NCLR4jL7F+mHg9Pv5ZvxFDAId9nAxfGcbaQZPTaOLClEkcKfks oTAegj4HgVoaIGh6hTRPwY7PKMu2Xx8gHxWvGln6LSw6cTns2IxYK0o9dvGf4g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714428019; h=from:from:reply-to:subject:subject: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+H3kfCFU4w9EJoBLoG3B6mSv0fXNtJ0nsCJgGmpOnk=; b=S/ceSoPK495OfU3SgeFCblv87nCMbmWpXG4zqGihROfCOOBWmg1KBcdEoHVCxy+HX8+fkZ Bp9jSpgPb5G1q4ZGooyYHC6OgP09YPLxtV4uTjGH6l5xlrlAnFT2402yodoC6491lSV1UH wezfTcAdrosYpf5mJKszCE+PpEZAVau/OcHjQ0Y8ySe6f7rvJh8s+7mnAVADI+6Jj5U+Wr QWuUx+HDw3Mw/Lvzoe5spfv/HEkHElvomlV7gIuDtthjNmemMeuZuB0ZFy780FOjU97VB9 VZWSWsDE4+73d9gJTaEfGA8gc6yY297fjyTDTrfY2UAXutkNsSUZqB8AJegnxA== Received: from gitrepo.freebsd.org (unknown [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VSxgf1wsBz1KDY; Mon, 29 Apr 2024 21:44:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43TJWoFF087137; Mon, 29 Apr 2024 19:32:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43TJWoHZ087134; Mon, 29 Apr 2024 19:32:50 GMT (envelope-from git) Date: Mon, 29 Apr 2024 19:32:50 GMT Message-Id: <202404291932.43TJWoHZ087134@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Navdeep Parhar Subject: git: b59c5d97edf1 - main - cxgbe(4): Add a helper function to locate MPS/MAC registers. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b59c5d97edf17525405d95b1f5746c4a79a9c7c4 Auto-Submitted: auto-generated The branch main has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=b59c5d97edf17525405d95b1f5746c4a79a9c7c4 commit b59c5d97edf17525405d95b1f5746c4a79a9c7c4 Author: Navdeep Parhar AuthorDate: 2024-04-25 05:24:49 +0000 Commit: Navdeep Parhar CommitDate: 2024-04-29 19:14:36 +0000 cxgbe(4): Add a helper function to locate MPS/MAC registers. These register blocks are at different locations in different chips. MFC after: 1 week Sponsored by: Chelsio Communications --- sys/dev/cxgbe/common/common.h | 1 + sys/dev/cxgbe/common/t4_hw.c | 37 +++++++++++++++++-------------------- sys/dev/cxgbe/t4_main.c | 14 +++++--------- 3 files changed, 23 insertions(+), 29 deletions(-) diff --git a/sys/dev/cxgbe/common/common.h b/sys/dev/cxgbe/common/common.h index a9a609d5c995..79bb6276f4c7 100644 --- a/sys/dev/cxgbe/common/common.h +++ b/sys/dev/cxgbe/common/common.h @@ -722,6 +722,7 @@ int t4_set_vf_mac(struct adapter *adapter, unsigned int pf, unsigned int vf, unsigned int t4_get_regs_len(struct adapter *adapter); void t4_get_regs(struct adapter *adap, u8 *buf, size_t buf_size); +u32 t4_port_reg(struct adapter *adap, u8 port, u32 reg); const char *t4_get_port_type_description(enum fw_port_type port_type); void t4_get_port_stats(struct adapter *adap, int idx, struct port_stats *p); void t4_get_port_stats_offset(struct adapter *adap, int idx, diff --git a/sys/dev/cxgbe/common/t4_hw.c b/sys/dev/cxgbe/common/t4_hw.c index 25eefa57b29f..4ca87727ca59 100644 --- a/sys/dev/cxgbe/common/t4_hw.c +++ b/sys/dev/cxgbe/common/t4_hw.c @@ -243,18 +243,21 @@ struct port_tx_state { uint64_t tx_frames; }; +u32 +t4_port_reg(struct adapter *adap, u8 port, u32 reg) +{ + if (chip_id(adap) > CHELSIO_T4) + return T5_PORT_REG(port, reg); + return PORT_REG(port, reg); +} + static void read_tx_state_one(struct adapter *sc, int i, struct port_tx_state *tx_state) { uint32_t rx_pause_reg, tx_frames_reg; - if (is_t4(sc)) { - tx_frames_reg = PORT_REG(i, A_MPS_PORT_STAT_TX_PORT_FRAMES_L); - rx_pause_reg = PORT_REG(i, A_MPS_PORT_STAT_RX_PORT_PAUSE_L); - } else { - tx_frames_reg = T5_PORT_REG(i, A_MPS_PORT_STAT_TX_PORT_FRAMES_L); - rx_pause_reg = T5_PORT_REG(i, A_MPS_PORT_STAT_RX_PORT_PAUSE_L); - } + rx_pause_reg = t4_port_reg(sc, i, A_MPS_PORT_STAT_RX_PORT_PAUSE_L); + tx_frames_reg = t4_port_reg(sc, i, A_MPS_PORT_STAT_TX_PORT_FRAMES_L); tx_state->rx_pause = t4_read_reg64(sc, rx_pause_reg); tx_state->tx_frames = t4_read_reg64(sc, tx_frames_reg); @@ -281,10 +284,7 @@ check_tx_state(struct adapter *sc, struct port_tx_state *tx_state) tx_frames = tx_state[i].tx_frames; read_tx_state_one(sc, i, &tx_state[i]); /* update */ - if (is_t4(sc)) - port_ctl_reg = PORT_REG(i, A_MPS_PORT_CTL); - else - port_ctl_reg = T5_PORT_REG(i, A_MPS_PORT_CTL); + port_ctl_reg = t4_port_reg(sc, i, A_MPS_PORT_CTL); if (t4_read_reg(sc, port_ctl_reg) & F_PORTTXEN && rx_pause != tx_state[i].rx_pause && tx_frames == tx_state[i].tx_frames) { @@ -6952,8 +6952,7 @@ void t4_get_port_stats(struct adapter *adap, int idx, struct port_stats *p) #define GET_STAT(name) \ t4_read_reg64(adap, \ - (is_t4(adap) ? PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_##name##_L) : \ - T5_PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_##name##_L))) + t4_port_reg(adap, pi->tx_chan, A_MPS_PORT_STAT_##name##_L)); #define GET_STAT_COM(name) t4_read_reg64(adap, A_MPS_STAT_##name##_L) p->tx_pause = GET_STAT(TX_PORT_PAUSE); @@ -7054,9 +7053,7 @@ void t4_get_lb_stats(struct adapter *adap, int idx, struct lb_port_stats *p) #define GET_STAT(name) \ t4_read_reg64(adap, \ - (is_t4(adap) ? \ - PORT_REG(idx, A_MPS_PORT_STAT_LB_PORT_##name##_L) : \ - T5_PORT_REG(idx, A_MPS_PORT_STAT_LB_PORT_##name##_L))) + t4_port_reg(adap, idx, A_MPS_PORT_STAT_LB_PORT_##name##_L)) #define GET_STAT_COM(name) t4_read_reg64(adap, A_MPS_STAT_##name##_L) p->octets = GET_STAT(BYTES); @@ -9436,16 +9433,16 @@ int t4_shutdown_adapter(struct adapter *adapter) t4_write_reg(adapter, A_DBG_GPIO_EN, 0xffff0000); for_each_port(adapter, port) { u32 a_port_cfg = is_t4(adapter) ? - PORT_REG(port, A_XGMAC_PORT_CFG) : - T5_PORT_REG(port, A_MAC_PORT_CFG); + t4_port_reg(adapter, port, A_XGMAC_PORT_CFG) : + t4_port_reg(adapter, port, A_MAC_PORT_CFG); t4_write_reg(adapter, a_port_cfg, t4_read_reg(adapter, a_port_cfg) & ~V_SIGNAL_DET(1)); if (!bt) { u32 hss_cfg0 = is_t4(adapter) ? - PORT_REG(port, A_XGMAC_PORT_HSS_CFG0) : - T5_PORT_REG(port, A_MAC_PORT_HSS_CFG0); + t4_port_reg(adapter, port, A_XGMAC_PORT_HSS_CFG0) : + t4_port_reg(adapter, port, A_MAC_PORT_HSS_CFG0); t4_set_reg_field(adapter, hss_cfg0, F_HSSPDWNPLLB | F_HSSPDWNPLLA | F_HSSPLLBYPB | F_HSSPLLBYPA, F_HSSPDWNPLLB | F_HSSPDWNPLLA | F_HSSPLLBYPB | diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 6cb434295b42..5c2e1fd232c2 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -1402,13 +1402,10 @@ t4_attach(device_t dev) * depends on the link settings which will be known when the * link comes up. */ - if (is_t6(sc)) { + if (is_t6(sc)) pi->fcs_reg = -1; - } else if (is_t4(sc)) { - pi->fcs_reg = PORT_REG(pi->tx_chan, - A_MPS_PORT_STAT_RX_PORT_CRC_ERROR_L); - } else { - pi->fcs_reg = T5_PORT_REG(pi->tx_chan, + else { + pi->fcs_reg = t4_port_reg(sc, pi->tx_chan, A_MPS_PORT_STAT_RX_PORT_CRC_ERROR_L); } pi->fcs_base = 0; @@ -8020,9 +8017,8 @@ cxgbe_sysctls(struct port_info *pi) #define T4_REGSTAT(name, stat, desc) \ SYSCTL_ADD_OID(ctx, children, OID_AUTO, #name, \ - CTLTYPE_U64 | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, \ - (is_t4(sc) ? PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_##stat##_L) : \ - T5_PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_##stat##_L)), \ + CTLTYPE_U64 | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, \ + t4_port_reg(sc, pi->tx_chan, A_MPS_PORT_STAT_##stat##_L), \ sysctl_handle_t4_reg64, "QU", desc) /* We get these from port_stats and they may be stale by up to 1s */ From nobody Mon Apr 29 20:32:35 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VSy1f0r2cz5JvtS; Mon, 29 Apr 2024 22: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VSy1d1zBMz4p77; Mon, 29 Apr 2024 22:00:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714428021; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MHxsFUb7/Vlte12O/5pFTHwRVPPBIU1K+3l7svzo3pw=; b=GfmvZguCMtqCzUuSI3nCpr5EMxylX9zgyxOAiMnbaUOiONkTDWWYtEem4pjXxKST5ajJ0V +fgtip7F/Y2Wt2BjRv2fVdVlR1pOlRvLmAW0/g3hhGnFMh2l9idv6kZLWKe2M47iytFUeg 0IioA19QFzW4130EQYdA1XApU3C1JRekD9fKDr3avqLksjV3xn5cMHBHRGRTItEpwVx4tn YWm21zih9xg5+y2O/2Emm6lNvTN6oY7Sjrqk7zadsuQLwA2LE6M6lllmQ4MD4U5jPFtFu2 XRr8jGUeXnINZ7Jd7JVvDkHWeJ8WwYAGYM1/R55TXAw4LT5LHUcF5MDgA9OiUw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714428021; a=rsa-sha256; cv=none; b=V9rSulm0cNkLjKtzh+LmbdaEqjlz4uUuLnV8m8laRVnZkCgKqT+eKOnFYL+n9EL4zLC5/F v6V58hvUZ0whf1rWdvAByzl1dmUvUyk6OsERiJspKHj+vWMRsZnrzhB1L7o32L55coLn+Y 968iMfF+I4iU7ixU/Fffv4qXSM7E1ZnB4r20Md8M1+M7X1XHErcQnuBLeerFQPCP9Nac7g X487rYI18tSJa5hV6A5PrcrjtETd6jlDotzYITSLMO+cdyUV+XsblUaKiiPSnxyZARja1R Do1CmM6REa9p3ulVJn+0wpAxI/BrWFYqHpR1EV9aZ2pb4rilU8zzZDg7PxQZhg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714428021; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MHxsFUb7/Vlte12O/5pFTHwRVPPBIU1K+3l7svzo3pw=; b=OfqFraWA/E3EvhYzDqY06DUwrJtB4gWQSCCedur4XsaUTspLdJKpGf91bEtF3YlfcT26Jd uGVkkio8orMZWnQUySF0QhHrZi4jQFfA7gD4971yNLF/aU/02VdAjDex2+M9y+dqIAeVRK 7qhtfuMVzhlpt6Q4SAUvcQyeulfMZeBMPmpI7NK8mr3BiHJ7mGvY1NPWThkfSu5BH/Ft8k DktUeACceQM4F7HXHX5gmWRlSMpqKH8q0yfMfORCMOmjvnpDE5x8k1+qqIY5mDJGP+NeG6 r9d25I1RSA2MLXfKnRpFFoFjOTSXxX3M9uNoHFtB8Hup691PZnTGX8FREb1tWQ== Received: from gitrepo.freebsd.org (unknown [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VSxgf1f4Fz1KJQ; Mon, 29 Apr 2024 21:44:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43TKWaVS090416; Mon, 29 Apr 2024 20:32:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43TKWZXR090413; Mon, 29 Apr 2024 20:32:35 GMT (envelope-from git) Date: Mon, 29 Apr 2024 20:32:35 GMT Message-Id: <202404292032.43TKWZXR090413@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Navdeep Parhar Subject: git: f0ee6112eb61 - main - cxgbe(4): Add missing description for a port type. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f0ee6112eb61a5130acedd20d9827627c0975fba Auto-Submitted: auto-generated The branch main has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=f0ee6112eb61a5130acedd20d9827627c0975fba commit f0ee6112eb61a5130acedd20d9827627c0975fba Author: Navdeep Parhar AuthorDate: 2024-04-29 20:27:48 +0000 Commit: Navdeep Parhar CommitDate: 2024-04-29 20:27:48 +0000 cxgbe(4): Add missing description for a port type. MFC after: 1 week Sponsored by: Chelsio Communications --- sys/dev/cxgbe/common/t4_hw.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/dev/cxgbe/common/t4_hw.c b/sys/dev/cxgbe/common/t4_hw.c index e3d5cf814e4d..bb2ed5e4d820 100644 --- a/sys/dev/cxgbe/common/t4_hw.c +++ b/sys/dev/cxgbe/common/t4_hw.c @@ -6814,6 +6814,7 @@ const char *t4_get_port_type_description(enum fw_port_type port_type) "CR2_QSFP", "SFP28", "KR_SFP28", + "KR_XLAUI", }; if (port_type < ARRAY_SIZE(port_type_description)) From nobody Mon Apr 29 19:45:48 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VSy1d6yLHz5Jvwf; Mon, 29 Apr 2024 22:00: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VSy1d1MrSz4p96; Mon, 29 Apr 2024 22:00:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714428021; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Fl4c/LiCosVWawtK+6PHEwJ0yR0E3IL7hmXw2u4YIlk=; b=ywwVbiqaElKCaQJRCNaCttIn2WXJPBuxzi2xcBQwPjyh3BaYZ1KWfNmV6EIlj6UA0JxWH+ F2irAGFH3E93lJxgDoDAHimHOUjknFdrzNW6REVyHbXYTF/wA7+Jvdd5ZuGqR6Nr71FzTY yrJVGDdt2W5ov9T3MwpuEBFMdMDPBlg3MF+kgYdgo+vW6Mxqf34wjlT7BjyzjS5sT+q7VV qWh+0KfFV2BJj+9Na3CxYQTI36Vh1hVWeBtPYGOHor+3IplpRvoYKGl5S3+IktITlS2ol8 AoWleQKQt6xTYOXZHAbGINeo3Z3dtj/6gd/6Y1fsRlrsi1luGBEay9N1MPRqbA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714428021; a=rsa-sha256; cv=none; b=xouLKYeegSwVaWUB3u+8gfDPfCJWdRilR5HrsUubmTTwgnQWLHmfefeOIdRURDQe6bEV5L RHmWNem1jXEPNByHNPiFmw8kCoNvUkYQCkVp1UJ0rlrvIQpLDV10x6FJ29LuH3TqeHuog8 hJwW+SMpiaRJFNN4Nnj7UlcAf3v3FJM8ooVjRrWZZgXWNVm0HMGxh0HbHSLRbA6Graucwl TYRyrCUm0r0JVcG6p+ODuP/M7RABu45D7bEMHhCraX6PmTNJBnbCc1q32NOm28XOFpTwcd LePv3AYepZS9mVX2E3R+uF7rHFVBhNFzgzmoI6gMJUSBAhw/z1B4HX9iecVlIQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714428021; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Fl4c/LiCosVWawtK+6PHEwJ0yR0E3IL7hmXw2u4YIlk=; b=o5W/2GFtdGvmofZ2A2vlfPk/+s+t9rnQPe7QsAAv+1B9OYZDx5BIClNjbfMK9K9YCnIBT0 IY/8VsIjQLSBGjwliSiqrfnUcyUg174xM1cuJAMfDU2VZzsoC+pYP1NxKQd6rVLm8YeYAe 3xDDsMorfE03AyprNoHW35D5uZeuUAHPwPfbtktkVSofBwQEvvae7/UPFWhRkcQ3pybRFD KYJH0BFrgHGwF1h4OBSwKeCeAZP3fqTxBt7gy1MQ6NOoj1SB7jI8SsmkiVERc23w9kKhPE oOC1kgRVX0ysHdy0cByLrM2IVGScxs08Xahy/I6BUjaL8d2dXL0qCQIO+lSUrA== Received: from gitrepo.freebsd.org (unknown [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VSxgf1rdsz1KJX; Mon, 29 Apr 2024 21:44:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43TJjmSF004495; Mon, 29 Apr 2024 19:45:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43TJjm88004492; Mon, 29 Apr 2024 19:45:48 GMT (envelope-from git) Date: Mon, 29 Apr 2024 19:45:48 GMT Message-Id: <202404291945.43TJjm88004492@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Navdeep Parhar Subject: git: 1c7f9c8b4673 - main - cxgbe(4): Retire t4_intr_clear. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1c7f9c8b4673abf3723be09afed4443261e0d186 Auto-Submitted: auto-generated The branch main has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=1c7f9c8b4673abf3723be09afed4443261e0d186 commit 1c7f9c8b4673abf3723be09afed4443261e0d186 Author: Navdeep Parhar AuthorDate: 2024-04-26 00:39:55 +0000 Commit: Navdeep Parhar CommitDate: 2024-04-29 19:34:51 +0000 cxgbe(4): Retire t4_intr_clear. The firmware clears the interrupts already and it has a better idea of exactly what to clear for which generation of the ASIC. There is no need for the driver to get involved. MFC after: 1 week Sponsored by: Chelsio Communications --- sys/dev/cxgbe/common/common.h | 1 - sys/dev/cxgbe/common/t4_hw.c | 93 ------------------------------------------- sys/dev/cxgbe/t4_main.c | 2 - 3 files changed, 96 deletions(-) diff --git a/sys/dev/cxgbe/common/common.h b/sys/dev/cxgbe/common/common.h index 79bb6276f4c7..f91d4ebf7334 100644 --- a/sys/dev/cxgbe/common/common.h +++ b/sys/dev/cxgbe/common/common.h @@ -618,7 +618,6 @@ struct fw_filter_wr; void t4_intr_enable(struct adapter *adapter); void t4_intr_disable(struct adapter *adapter); -void t4_intr_clear(struct adapter *adapter); bool t4_slow_intr_handler(struct adapter *adapter, bool verbose); int t4_hash_mac_addr(const u8 *addr); diff --git a/sys/dev/cxgbe/common/t4_hw.c b/sys/dev/cxgbe/common/t4_hw.c index 4ca87727ca59..e3d5cf814e4d 100644 --- a/sys/dev/cxgbe/common/t4_hw.c +++ b/sys/dev/cxgbe/common/t4_hw.c @@ -5454,99 +5454,6 @@ void t4_intr_disable(struct adapter *adap) t4_set_reg_field(adap, A_PL_INT_MAP0, 1 << adap->pf, 0); } -/** - * t4_intr_clear - clear all interrupts - * @adap: the adapter whose interrupts should be cleared - * - * Clears all interrupts. The caller must be a PCI function managing - * global interrupts. - */ -void t4_intr_clear(struct adapter *adap) -{ - static const u32 cause_reg[] = { - A_CIM_HOST_INT_CAUSE, - A_CIM_HOST_UPACC_INT_CAUSE, - MYPF_REG(A_CIM_PF_HOST_INT_CAUSE), - A_CPL_INTR_CAUSE, - EDC_REG(A_EDC_INT_CAUSE, 0), EDC_REG(A_EDC_INT_CAUSE, 1), - A_LE_DB_INT_CAUSE, - A_MA_INT_WRAP_STATUS, - A_MA_PARITY_ERROR_STATUS1, - A_MA_INT_CAUSE, - A_MPS_CLS_INT_CAUSE, - A_MPS_RX_PERR_INT_CAUSE, - A_MPS_STAT_PERR_INT_CAUSE_RX_FIFO, - A_MPS_STAT_PERR_INT_CAUSE_SRAM, - A_MPS_TRC_INT_CAUSE, - A_MPS_TX_INT_CAUSE, - A_MPS_STAT_PERR_INT_CAUSE_TX_FIFO, - A_NCSI_INT_CAUSE, - A_PCIE_INT_CAUSE, - A_PCIE_NONFAT_ERR, - A_PL_PL_INT_CAUSE, - A_PM_RX_INT_CAUSE, - A_PM_TX_INT_CAUSE, - A_SGE_INT_CAUSE1, - A_SGE_INT_CAUSE2, - A_SGE_INT_CAUSE3, - A_SGE_INT_CAUSE4, - A_SMB_INT_CAUSE, - A_TP_INT_CAUSE, - A_ULP_RX_INT_CAUSE, - A_ULP_RX_INT_CAUSE_2, - A_ULP_TX_INT_CAUSE, - A_ULP_TX_INT_CAUSE_2, - - MYPF_REG(A_PL_PF_INT_CAUSE), - }; - int i; - const int nchan = adap->chip_params->nchan; - - for (i = 0; i < ARRAY_SIZE(cause_reg); i++) - t4_write_reg(adap, cause_reg[i], 0xffffffff); - - if (is_t4(adap)) { - t4_write_reg(adap, A_PCIE_CORE_UTL_SYSTEM_BUS_AGENT_STATUS, - 0xffffffff); - t4_write_reg(adap, A_PCIE_CORE_UTL_PCI_EXPRESS_PORT_STATUS, - 0xffffffff); - t4_write_reg(adap, A_MC_INT_CAUSE, 0xffffffff); - for (i = 0; i < nchan; i++) { - t4_write_reg(adap, PORT_REG(i, A_XGMAC_PORT_INT_CAUSE), - 0xffffffff); - } - } - if (chip_id(adap) >= CHELSIO_T5) { - t4_write_reg(adap, A_MA_PARITY_ERROR_STATUS2, 0xffffffff); - t4_write_reg(adap, A_MPS_STAT_PERR_INT_CAUSE_SRAM1, 0xffffffff); - t4_write_reg(adap, A_SGE_INT_CAUSE5, 0xffffffff); - t4_write_reg(adap, A_MC_P_INT_CAUSE, 0xffffffff); - if (is_t5(adap)) { - t4_write_reg(adap, MC_REG(A_MC_P_INT_CAUSE, 1), - 0xffffffff); - } - for (i = 0; i < nchan; i++) { - t4_write_reg(adap, T5_PORT_REG(i, - A_MAC_PORT_PERR_INT_CAUSE), 0xffffffff); - if (chip_id(adap) > CHELSIO_T5) { - t4_write_reg(adap, T5_PORT_REG(i, - A_MAC_PORT_PERR_INT_CAUSE_100G), - 0xffffffff); - } - t4_write_reg(adap, T5_PORT_REG(i, A_MAC_PORT_INT_CAUSE), - 0xffffffff); - } - } - if (chip_id(adap) >= CHELSIO_T6) { - t4_write_reg(adap, A_SGE_INT_CAUSE6, 0xffffffff); - } - - t4_write_reg(adap, A_MPS_INT_CAUSE, is_t4(adap) ? 0 : 0xffffffff); - t4_write_reg(adap, A_PL_PERR_CAUSE, 0xffffffff); - t4_write_reg(adap, A_PL_INT_CAUSE, 0xffffffff); - (void) t4_read_reg(adap, A_PL_INT_CAUSE); /* flush */ -} - /** * hash_mac_addr - return the hash value of a MAC address * @addr: the 48-bit Ethernet MAC address diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 5c2e1fd232c2..7bdce5faf7af 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -1333,7 +1333,6 @@ t4_attach(device_t dev) rc = partition_resources(sc); if (rc != 0) goto done; /* error message displayed already */ - t4_intr_clear(sc); } rc = get_params__post_init(sc); @@ -2289,7 +2288,6 @@ t4_resume(device_t dev) rc = partition_resources(sc); if (rc != 0) goto done; /* error message displayed already */ - t4_intr_clear(sc); } rc = get_params__post_init(sc); From nobody Tue Apr 30 00:55:04 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VT1vD2hdLz5HkrZ; Tue, 30 Apr 2024 00:55: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VT1vD1sCpz4QRX; Tue, 30 Apr 2024 00:55:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714438504; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Al9suI4tA4kYSM+4hvOIohsP/uoeSvftmsSwrEdx/Fc=; b=fuQ03mT7AFJwGgEWE/v6NX0VsTmyH8SZV/cKRoZAvKn/ZGEU1N6XLh/omvSqscEIV31KGa nmzQCUfQLITp4dmzMTCpQ5dmMVNXrLDwG9t4Lx/CupI/MVWciBvlkmznkBsLZDzz8vpTgL 6CIySSS8AFjQOQA722Yw6cSchwG0joOLlkQ1+76YVvhnZYlD9cxKE0baYj1VxslfJok6Zn BQtQELakyhdrbWZb9mUQS0mKPcofFQ9phpcklUxci17nR5hbjJyWij8RaJTey6/1moIHbz o9KcC0laNqT5m7xeHZHv/5OMif7DLLNR+Ok+5ad6ogIOYwcdTUahQqL5JuWqWQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714438504; a=rsa-sha256; cv=none; b=VsRr2UMtAdKS87VmNuPkTUTFgTX/t+C981y6lvzBVSQIL08GPQFtLyU/17l4C6LNmxGkmS Pkof3e6bkmaRn5bE2RAVJU+alOU3zZIhkCOGr/COhBRhTlo3GR8IduwhCRhH6Ru8qt/zyO F6TJnnUOvqa07xasiebydR6bNgoyGbK1FvH4b+PR0uj3uwbY5z/S4+DOMvr4/4jZRLSHYw TePMf3+OPIOB0g5r1I/qeo980m3KYDon0SqfV6WR1qKGKa3HscqEU77P85Cl5xwIBeMVkF 50hykX+D2bhdWSP2wM6bI2A9ZdUs+nshrxhtSyXNHFQDC2ftrvSaSoA3h+tUTA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714438504; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Al9suI4tA4kYSM+4hvOIohsP/uoeSvftmsSwrEdx/Fc=; b=p99YSFEaPD/vNXmqatvr/SiKHkM4oV+uJLB5un5y9EMUtPlY58PzXyOJLO3UHf9F7w0SLD Z/cGau7JZzAQEWscSs48dyrhyj3cOxl22oT0k/nzaolKUtNRs1mXFDxR+r7v9v+VVQP2BT 3qmBBibIrlXAqHZ5CbgMuoobORD8laiKPOft3D8Isk3Bvl7J0YwRdyI4b3rhn3+q0KbZAn yM3eYNQBQBSbM4B73TXHLtqtxHmQavFS91BIRzp77clqM2ZROAh+wfH7owqZE9Snwqj2G2 spB2RoyI+e7ca7vqlBhUZm/rkxKm0ssxI0bZLRnNM0YeZARP1OeipJBs3ds0Fg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VT1vD1SGyz1SVR; Tue, 30 Apr 2024 00:55:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43U0t4fA030784; Tue, 30 Apr 2024 00:55:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43U0t4BI030781; Tue, 30 Apr 2024 00:55:04 GMT (envelope-from git) Date: Tue, 30 Apr 2024 00:55:04 GMT Message-Id: <202404300055.43U0t4BI030781@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: d1cd0cc32b53 - main - rtld: add direct-exec option -o List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: d1cd0cc32b53c09e72e33116b94a5b0b9781a183 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=d1cd0cc32b53c09e72e33116b94a5b0b9781a183 commit d1cd0cc32b53c09e72e33116b94a5b0b9781a183 Author: Konstantin Belousov AuthorDate: 2024-04-28 03:19:39 +0000 Commit: Konstantin Belousov CommitDate: 2024-04-30 00:16:05 +0000 rtld: add direct-exec option -o allowing to set any known LD_ parameter for the current rtld invocation, but without polluting the activated' binary environment. In other words, the set parameter is not exported into the environment. Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D44988 --- libexec/rtld-elf/rtld.1 | 20 +++++++++++++++++++- libexec/rtld-elf/rtld.c | 30 ++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 1 deletion(-) diff --git a/libexec/rtld-elf/rtld.1 b/libexec/rtld-elf/rtld.1 index a152dd444bd7..0f1e8f68b10a 100644 --- a/libexec/rtld-elf/rtld.1 +++ b/libexec/rtld-elf/rtld.1 @@ -26,7 +26,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 October 29, 2023 +.Dd April 28, 2024 .Dt RTLD 1 .Os .Sh NAME @@ -352,6 +352,7 @@ The syntax of the direct invocation is .Op Fl b Ar exe .Op Fl d .Op Fl f Ar fd +.Op Fl o Ar OPT=NAME .Op Fl p .Op Fl u .Op Fl v @@ -387,6 +388,23 @@ If this option is specified, is only used to provide the .Va argv[0] value to the program. +.It Fl o Ar OPT=VALUE +Set the +.Ar OPT +configuration variable to the value +.Ar VALUE . +The possible variable names are listed above as +.Ev LD_ +prefixed environment variables, but here are referenced without the +.Ev LD_ +prefix. +A configuration variable set this way does not leak into +the activated image's environment. +.Pp +The option can be repeated as many times as needed to set +all configuration parameters. +The parameters set using this option have priority over +the same parameters assigned via environment. .It Fl p If the .Pa image_path diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index a46cbe4e59c8..f5a2eeb37f10 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -6157,6 +6157,35 @@ parse_args(char* argv[], int argc, bool *use_pathp, int *fdp, *fdp = fd; seen_f = true; break; + } else if (opt == 'o') { + struct ld_env_var_desc *l; + char *n, *v; + u_int ll; + + if (j != arglen - 1) { + _rtld_error("Invalid options: %s", arg); + rtld_die(); + } + i++; + n = argv[i]; + v = strchr(n, '='); + if (v == NULL) { + _rtld_error("No '=' in -o parameter"); + rtld_die(); + } + for (ll = 0; ll < nitems(ld_env_vars); ll++) { + l = &ld_env_vars[ll]; + if (v - n == (ptrdiff_t)strlen(l->n) && + strncmp(n, l->n, v - n) == 0) { + l->val = v + 1; + break; + } + } + if (ll == nitems(ld_env_vars)) { + _rtld_error("Unknown LD_ option %s", + n); + rtld_die(); + } } else if (opt == 'p') { *use_pathp = true; } else if (opt == 'u') { @@ -6240,6 +6269,7 @@ print_usage(const char *argv0) " -b Execute instead of , arg0 is \n" " -d Ignore lack of exec permissions for the binary\n" " -f Execute instead of searching for \n" + " -o = Set LD_ to , without polluting env\n" " -p Search in PATH for named binary\n" " -u Ignore LD_ environment variables\n" " -v Display identification information\n" From nobody Tue Apr 30 00:55:05 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VT1vF4p8bz5HkQ8; Tue, 30 Apr 2024 00:55: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VT1vF2rVfz4QTW; Tue, 30 Apr 2024 00:55:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714438505; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lbjgztLBhRJy5F23L30uSHt3Daw79nv5VWfSWxRQks8=; b=hHrUNepB66PaMPQBK9i/g+MIrDDRIWT/aPkhcRy3XWwUVynDmMuDD19DxRInH3+F41c9XN 6euCzTYJoFzD0jB7RwVgkHxxKH+sk8KZnLrM9/6zaB/45/umLizgyYm5/Z9OyrasXU6Y6d uODV9pXatPUF2mKrXoSTmzIl5OV6RYh0zv5ixZui0hm5d92kjjaLwamqf09dN9FnKPPJ8L /JUBREh/NOlzrqsbMulKFhjLsBIk6BPeSlBuGdAST9t6vklja9k8m0tCetwYwZhfuqvWfi leaAjsqvYQhczOj2w4eJK6wO1HuBt+inwG/8Epn8NgrhKyULI/Y6DPzaROSPZg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714438505; a=rsa-sha256; cv=none; b=q6JZ3x5gi5tHbsgspRsvfxhiw32p2x52JflASaJWVu+dNpTDOQrn39PRmfCahj88XxamI1 zqgSuOweP3YdGBExxlmxE7LDxuM6slKmBPr/SL+UxbTLDiCv6fJIF/wbv1TKuLSqqQs9tP wyHJyd9umjC9XqQo1JlAMFSEQHjrV/ZLBbbQO+g5iYenlok9UklkGSU82b1plQs2U9aofY 50Z/tX2sLoPzo9LxKwk3SIEdti90Wn8ZVG1MtnVIjRmtye8RZmWN5MZVQ3ffIM7PdeWyi/ u77yIRXtyFnmIweIIWq8I16StGcbRkt6t2M0DaIi0hGJwvW+27fLvL4aWr9BEg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714438505; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lbjgztLBhRJy5F23L30uSHt3Daw79nv5VWfSWxRQks8=; b=pJ1ZRNFn3Sss98UwfcvyMyNcd2ceSWT0boYgyTaWZwHxomEX0hIin+O/ETMMdbuUkbRy6C j5V7JnEe3DkBEqbmrUQAb7J6ZhlN0OoB2p+w0JhIfwBBP6R+KXSd352HJ5FHzHOhJXBALF 03ydWkiD5NwX6L/a7zXkgeNGUezP1X2ALrZ4w6gKg2G3oD1l+d44NzhrsbT3vo3z0kMz0F lJTwQ7LjymaHgOXo3Dvqq3WvHtzFKiq6BR6rOHxqpgeU5Ptz5DqyUAlkpoteyuEU2BKs+M HNja50/1uioyKS1WAZJLJrshkf0itZznzXr8ZlGMs74hvWYpsGnK61P1ZmBjTQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VT1vF2RfBzDkb; Tue, 30 Apr 2024 00:55:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43U0t5x2030844; Tue, 30 Apr 2024 00:55:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43U0t55g030841; Tue, 30 Apr 2024 00:55:05 GMT (envelope-from git) Date: Tue, 30 Apr 2024 00:55:05 GMT Message-Id: <202404300055.43U0t55g030841@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: ef2694f368ce - main - rtld direct exec: make -u behavior match the description List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: ef2694f368cee5957ee44b0298da88ff8360d561 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=ef2694f368cee5957ee44b0298da88ff8360d561 commit ef2694f368cee5957ee44b0298da88ff8360d561 Author: Konstantin Belousov AuthorDate: 2024-04-28 20:57:54 +0000 Commit: Konstantin Belousov CommitDate: 2024-04-30 00:26:49 +0000 rtld direct exec: make -u behavior match the description Instead of only ignoring insecure env vars, clear them all. Reviewed by: emaste, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D44999 --- libexec/rtld-elf/rtld.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index f5a2eeb37f10..5743bbdd6f61 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -6189,7 +6189,10 @@ parse_args(char* argv[], int argc, bool *use_pathp, int *fdp, } else if (opt == 'p') { *use_pathp = true; } else if (opt == 'u') { - trust = false; + u_int ll; + + for (ll = 0; ll < nitems(ld_env_vars); ll++) + ld_env_vars[ll].val = NULL; } else if (opt == 'v') { machine[0] = '\0'; mib[0] = CTL_HW; From nobody Tue Apr 30 00:55:06 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VT1vG54rBz5HkWf; Tue, 30 Apr 2024 00:55: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VT1vG3r9Pz4QWk; Tue, 30 Apr 2024 00:55:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714438506; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NvEwLQaJhrWwOMsCQSCJ5RiHtiZVI25ows5Apb2ecmo=; b=cnfDqQiyAM1I5r1xarZZ+QFez02aJ2fr2GakZUve4nF5m2piqN5HNgySvC/aG+TqON+AMR GHTqtoB/yOvsR9UQ+oBRUkQ5CPz1qKNExJBBZr8wgJvkDjpiO9hoxlvLdVY/ynE3Nb/oPv tGoMg8w+2JcD/XeoE6Vkje3dx3HjKXp+mtgAJxzUtnvwBI13hf8SygHoyPvjTv4vb9T1zP mNkcJ/wgpwQut3q+uF0r4/VYD+4NVkZOi4Y10Eyu4A2RHwKAEoxbYk+GvcQyDKHqM0PQ++ /2t5AaBjayozCmw4ZYakZghZLCk++l0zmz53oXjIkcorXWci34+RJPX0vE5JZQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714438506; a=rsa-sha256; cv=none; b=LTtFFcp+/asT8xvMGC+urLcNGalINzVDRpJin9DnGLb0TwkuvRKwn/Ukfw2LOy4mMPV5y7 7n8YPPFsj7qOHQn2rJwaR4MIgezmg1ZIoSmn8zLN1FqlIiri+dWBbf16TM6y99jBNuD0Lr szpQNnZSYXWj8juvJ8WzlaKqapUrAvrHmrKnWgSXkDMbRYQLYih3b35WVmV4JC2QfWIyNZ o1/gxIvu53RFeCNYu5NqGS5RiBkE5P/pIyUxHxTWz2wvo4ONGTyGh7W/TP3HJE4AT/ntrV UMsPZuDvskrrey7wYlNRVwwFYZoDcZBk99d/mvfhrF3VfAJaV4ktAXIZntWX/Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714438506; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NvEwLQaJhrWwOMsCQSCJ5RiHtiZVI25ows5Apb2ecmo=; b=Zmberw8XjB96txDAHPv5y0MsGgqCr/QfcwKHusdk/doMOr054ixOH9RCXu8kaFkLNhJMiK cgzSYH5cug+zdwSW8FpQddv6z0CCSEAN8Xyj7JMbysUsURrjgPEUY/5JScIJ38pQkaRBKN TyuwdHcKn9wCKqHv0jebtXtdfSOYKvSgb23xUu4SR+HmEeIKA6XPlNgUeANUuoX79DdlzV +jBW64q4Jf2Md9VZYV0lUa2L09KyciaxT4Vuuv1/oLNpgtwxEXk/ll4TKEjdZRIHAVLB0L N/mqQ7jW41JdpdXnvLkXf5YCEx6jsZATWhZgvKE78nIgK6jZsJW1vU+5bQiRUA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VT1vG3Rgrz1SK8; Tue, 30 Apr 2024 00:55:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43U0t6gW030893; Tue, 30 Apr 2024 00:55:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43U0t66Y030890; Tue, 30 Apr 2024 00:55:06 GMT (envelope-from git) Date: Tue, 30 Apr 2024 00:55:06 GMT Message-Id: <202404300055.43U0t66Y030890@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: 6a7819e43f93 - main - rtld.1: clarify interaction between -u and -o List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 6a7819e43f938992304472054c83f4a6602a9e19 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=6a7819e43f938992304472054c83f4a6602a9e19 commit 6a7819e43f938992304472054c83f4a6602a9e19 Author: Konstantin Belousov AuthorDate: 2024-04-28 21:45:12 +0000 Commit: Konstantin Belousov CommitDate: 2024-04-30 00:26:55 +0000 rtld.1: clarify interaction between -u and -o Sponsored by: The FreeBSD Foundation MFC after: 1 week --- libexec/rtld-elf/rtld.1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libexec/rtld-elf/rtld.1 b/libexec/rtld-elf/rtld.1 index 0f1e8f68b10a..4cc5b639c89a 100644 --- a/libexec/rtld-elf/rtld.1 +++ b/libexec/rtld-elf/rtld.1 @@ -418,7 +418,9 @@ to find the binary to execute. .It Fl u Ignore all .Ev LD_ -environment variables that otherwise affect the dynamic +environment variables and previous command line +.Fl o +options that otherwise affect the dynamic linker behavior. .It Fl v Display information about this run-time linker binary, then exit. From nobody Tue Apr 30 05:59:23 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VT8fM2NLLz5JGrM; Tue, 30 Apr 2024 05:59: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VT8fM1l4Tz53PJ; Tue, 30 Apr 2024 05:59:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714456763; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=H8TyFBaGJ8YOEBJOjvg1u/PH7umU2X5s/Jo7DboPZ9c=; b=r2ExfY665o7H4WGPwIvqLNYXffuuSntcZt4S50BX5XOBtU0qfXcHHPJsh/UhAYj2QZ4acu AH9+VAfSPzrE5S4ysZ4lUpQnVmyByNmh6mdCOGt+2C7ouZ1VPio+E/PsImmrM3Q76pbwC1 zqfLNRZBJil4EgS/fhhx/WXz8cw3F0Xgy16W54Zw8nXFzxRZmXA30fOBMQ/svmbegTUfJd m9FoBmq7DvZuX6hpCR40xmD+jjEABHRJzgxP73wDag+AEq8HNOi5fYhk/e2NoiTbAb168D i+u9MtoYeg7BeEC/051povA+ijfvgTf3NZjC0OTon70YJM1E8SzX44vvh6zhnA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714456763; a=rsa-sha256; cv=none; b=q8nPQx2zIsWTWoRL3eTdth/3L+iKsj9ZeW8B2wC+s68BBlHPeHHlKcQxrNes9wt+QWi9w6 jywUWYCoIBImx9lZVHq771rWF2/gOLH3Ex7xJW741/HJ0cRigqkO17f7+nSxcoEDjVtl6X M2iWUF7GCkIc7add0ChfCdqIfzERYnW3dqAa+7gN2zE+OvUCy6u3zc0hs1OpJ3j/c+rSRq aFdeJj5Y1v+u+NQO0eyGtAamEHqJA0Lum8pEovu9yM+vehgN1an59sJJ6lBCcSNS4kOcY+ iwuyVWRw3VmClNHdzy8Q8bekn7xwmaw5wbXZkNoBRgBx1nE3lOA1SxSf9cCsbQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714456763; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=H8TyFBaGJ8YOEBJOjvg1u/PH7umU2X5s/Jo7DboPZ9c=; b=jNLyFWM4CqND1mINFyT9lyxmfDF4YbfVYNijGsIwbsaud4/wG/iOv+i3f7421A9mQLFHPP lmlT3PIWuKqLPRzSqr8vXZejF0FrD0fbmNHz2sKr28yydEdX/vrBed2BcWUo/649MeXYfS sDGhP+GKjbbwHjV2vb2X5H9AhgoXdB23d0f4WVRxTt8wKx1TrHGV+9Q5m7u6YyZZSrPTIU 2LHBQjVOPsDsBY9Wy/wiMDtQ4m8k5ciMSRlr8LEmNi7W6TMBOYB1attb/9xKrpjRKrOwwt 2Q4kJ5p7jq2PzUkks8258qXR43jtUQBF9a0hN8wjfP8oPqbDYWAiUyQe2NYpcw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VT8fM1Lr5zNhd; Tue, 30 Apr 2024 05:59:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43U5xNH3037886; Tue, 30 Apr 2024 05:59:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43U5xNMm037883; Tue, 30 Apr 2024 05:59:23 GMT (envelope-from git) Date: Tue, 30 Apr 2024 05:59:23 GMT Message-Id: <202404300559.43U5xNMm037883@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: 7f84bb34a1d1 - main - linuxkpi: hdmi: Split the module declaration to a new file List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7f84bb34a1d191949ec519a01c0c574f5e827c88 Auto-Submitted: auto-generated The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=7f84bb34a1d191949ec519a01c0c574f5e827c88 commit 7f84bb34a1d191949ec519a01c0c574f5e827c88 Author: Emmanuel Vadot AuthorDate: 2024-04-24 07:59:20 +0000 Commit: Emmanuel Vadot CommitDate: 2024-04-30 05:41:48 +0000 linuxkpi: hdmi: Split the module declaration to a new file In order to have a proper linuxkpi_video kmod, move the module declaration to a new file as linuxkpi_video will also include linux_hdmi.c Differential Revision: https://reviews.freebsd.org/D44926 Reviewed by: bz, emaste, wulf Sponsored by: Beckhoff Automation GmbH & Co. KG --- sys/compat/linuxkpi/common/src/linux_hdmi.c | 10 ---------- sys/compat/linuxkpi/common/src/linuxkpi_hdmikmod.c | 7 +++++++ sys/modules/linuxkpi_hdmi/Makefile | 1 + 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_hdmi.c b/sys/compat/linuxkpi/common/src/linux_hdmi.c index ec4ac7568c7c..947be761dfa4 100644 --- a/sys/compat/linuxkpi/common/src/linux_hdmi.c +++ b/sys/compat/linuxkpi/common/src/linux_hdmi.c @@ -21,12 +21,6 @@ * DEALINGS IN THE SOFTWARE. */ -#ifdef __FreeBSD__ - -#include -#include -#endif - #include #include #include @@ -1915,7 +1909,3 @@ int hdmi_infoframe_unpack(union hdmi_infoframe *frame, return ret; } EXPORT_SYMBOL(hdmi_infoframe_unpack); - - -MODULE_VERSION(linuxkpi_hdmi, 1); -MODULE_DEPEND(linuxkpi_hdmi, linuxkpi, 1, 1, 1); diff --git a/sys/compat/linuxkpi/common/src/linuxkpi_hdmikmod.c b/sys/compat/linuxkpi/common/src/linuxkpi_hdmikmod.c new file mode 100644 index 000000000000..b0d4c013a6f3 --- /dev/null +++ b/sys/compat/linuxkpi/common/src/linuxkpi_hdmikmod.c @@ -0,0 +1,7 @@ +/* Public domain. */ + +#include +#include + +MODULE_VERSION(linuxkpi_hdmi, 1); +MODULE_DEPEND(linuxkpi_hdmi, linuxkpi, 1, 1, 1); diff --git a/sys/modules/linuxkpi_hdmi/Makefile b/sys/modules/linuxkpi_hdmi/Makefile index ef843c726dac..dc19c0afeebc 100644 --- a/sys/modules/linuxkpi_hdmi/Makefile +++ b/sys/modules/linuxkpi_hdmi/Makefile @@ -2,6 +2,7 @@ KMOD= linuxkpi_hdmi SRCS= linux_hdmi.c \ + linuxkpi_hdmikmod.c SRCS+= ${LINUXKPI_GENSRCS} From nobody Tue Apr 30 05:59:24 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VT8fN30tcz5JGjR; Tue, 30 Apr 2024 05:59: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VT8fN248fz530q; Tue, 30 Apr 2024 05:59:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714456764; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gavZRPczbTEdHP8/rAue7iUSEn0hG5Pt+ET8fPzsvhM=; b=l/Ij3XAj02fBEz4/dbQqiGxvV6Q8R4UY0SHf1V2ZjSSqke4u7R8qHDQJsp0E2uqm9rsiNG FXUmKcid8KHK77e4NKGLjZOlfkP2iZ2mYCqklBcazp7l+rkG9Z9w0Oj1gDc1AEDQ44Aa8h zgJhIu09vUJ/PN4oN/WYYvpJuCgx+00cJVO479mtfP3g4DaO3jWmBJXsBzTLoT2AJFhuk5 cLVcDlM1HKUgycN2vKORUvZw12yxczndmFG9M7HoWL0LmHPab9ISmETZ7ulVi3wGRfluOp Bark0584DwjxdyYLw3aspRoRdRxFJGIiD0PQPSwI+KPAJ8mYf9XOUviBH//Sog== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714456764; a=rsa-sha256; cv=none; b=JNOgTQmiIAPOjFWik9DnRt+bf0z5Zo4JcTegiRlj8T6Lk5letNnTFQi/lIzYodVSwziU25 nOq8LfFSpurbo60U79Eur4hObpGXzEK1XymirGaBcdScT5y/bxiX43XdKkQcrwrguXj6gj cO409/7sCliogZ30191F/UCt7gOA0T0YxLLOQv+FogNMp1EKv1Xu0xNIgefbK27hpcP0qs qpLTedEN9EItjH9nzvTkjx/Z9FEHfgZE/6ikF/d3XiKBXUKoyeFWne2yZFZKMP4cDhWWZz /eh5mavrqu3D3j2hN1uphi030ke/M0NaHGjOS+1BY/BZjTz0OL+cmy1L+nBbkw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714456764; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gavZRPczbTEdHP8/rAue7iUSEn0hG5Pt+ET8fPzsvhM=; b=NUh/HZdUnb1u8LcNaNrBHnXP8mkwlLbz6KT7ZJISnwTy/ex5sta7aaivTTgQkRR8/5U7sJ xSYhmhWGYEX2Oa4z5VE4k7q4EdjiCwfePBEIyB5CsZCz/nn7s5H4mqVjXaSs29GS8EGI6V anaEx57saUhCsWGxDGIJ9i8oXw1b8uHUxoBuFp/XGAl1by643QWyM7c9QG9y9VwGPAFiht HOu3NJNSolcB+LgD4WHF6MKQwOk/ggkxYOCAi7KPmNbmghJLwyU/Wp24q8HiQYErOcjZ6u M1SarGsUJFcLUB0SUm+q/8J3OihM4agWO5w8vYYcizUquYDK1I5mdTqmXheggg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VT8fN1dyvzNQn; Tue, 30 Apr 2024 05:59:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43U5xO56037925; Tue, 30 Apr 2024 05:59:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43U5xOXg037922; Tue, 30 Apr 2024 05:59:24 GMT (envelope-from git) Date: Tue, 30 Apr 2024 05:59:24 GMT Message-Id: <202404300559.43U5xOXg037922@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: 11d79c4756b7 - main - linuxkpi: Add linuxkpi_video module List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 11d79c4756b7c85faf7c4a268c301a41ce0887b9 Auto-Submitted: auto-generated The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=11d79c4756b7c85faf7c4a268c301a41ce0887b9 commit 11d79c4756b7c85faf7c4a268c301a41ce0887b9 Author: Emmanuel Vadot AuthorDate: 2024-04-24 08:14:36 +0000 Commit: Emmanuel Vadot CommitDate: 2024-04-30 05:42:31 +0000 linuxkpi: Add linuxkpi_video module This contain the hdmi code and the aperture code like in linux. Differential Revision: https://reviews.freebsd.org/D44925 Reviewed by: bz Obtained from: drm-kmod Sponsored by: Beckhoff Automation GmbH & Co. KG --- .../linuxkpi/common/include/linux/aperture.h | 58 ++++ sys/compat/linuxkpi/common/src/linux_aperture.c | 365 +++++++++++++++++++++ .../linuxkpi/common/src/linuxkpi_videokmod.c | 7 + sys/modules/Makefile | 1 + sys/modules/linuxkpi_video/Makefile | 15 + 5 files changed, 446 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/aperture.h b/sys/compat/linuxkpi/common/include/linux/aperture.h new file mode 100644 index 000000000000..e0387ed0225d --- /dev/null +++ b/sys/compat/linuxkpi/common/include/linux/aperture.h @@ -0,0 +1,58 @@ +/* SPDX-License-Identifier: MIT */ + +#ifndef _LINUX_APERTURE_H_ +#define _LINUX_APERTURE_H_ + +#include + +#define CONFIG_APERTURE_HELPERS + +struct pci_dev; +struct platform_device; + +#if defined(CONFIG_APERTURE_HELPERS) +int devm_aperture_acquire_for_platform_device(struct platform_device *pdev, + resource_size_t base, + resource_size_t size); + +int aperture_remove_conflicting_devices(resource_size_t base, resource_size_t size, + bool primary, const char *name); + +int aperture_remove_conflicting_pci_devices(struct pci_dev *pdev, const char *name); +#else +static inline int devm_aperture_acquire_for_platform_device(struct platform_device *pdev, + resource_size_t base, + resource_size_t size) +{ + return 0; +} + +static inline int aperture_remove_conflicting_devices(resource_size_t base, resource_size_t size, + bool primary, const char *name) +{ + return 0; +} + +static inline int aperture_remove_conflicting_pci_devices(struct pci_dev *pdev, const char *name) +{ + return 0; +} +#endif + +/** + * aperture_remove_all_conflicting_devices - remove all existing framebuffers + * @primary: also kick vga16fb if present; only relevant for VGA devices + * @name: a descriptive name of the requesting driver + * + * This function removes all graphics device drivers. Use this function on systems + * that can have their framebuffer located anywhere in memory. + * + * Returns: + * 0 on success, or a negative errno code otherwise + */ +static inline int aperture_remove_all_conflicting_devices(bool primary, const char *name) +{ + return aperture_remove_conflicting_devices(0, (resource_size_t)-1, primary, name); +} + +#endif diff --git a/sys/compat/linuxkpi/common/src/linux_aperture.c b/sys/compat/linuxkpi/common/src/linux_aperture.c new file mode 100644 index 000000000000..15a56839fa9c --- /dev/null +++ b/sys/compat/linuxkpi/common/src/linux_aperture.c @@ -0,0 +1,365 @@ +// SPDX-License-Identifier: MIT + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include