From owner-dev-commits-src-branches@freebsd.org Mon May 31 00:44:26 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C107263B287; Mon, 31 May 2021 00:44:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ftc4V4qfQz4nhS; Mon, 31 May 2021 00:44:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 83FC726AEE; Mon, 31 May 2021 00:44:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 14V0iQPL052547; Mon, 31 May 2021 00:44:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 14V0iQGT052546; Mon, 31 May 2021 00:44:26 GMT (envelope-from git) Date: Mon, 31 May 2021 00:44:26 GMT Message-Id: <202105310044.14V0iQGT052546@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kirk McKusick Subject: git: 57d877348b2c - stable/13 - Fix handling of embedded symbolic links (and history lesson). MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 57d877348b2cb53a502a1bd305f973105f064a58 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 May 2021 00:44:26 -0000 The branch stable/13 has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=57d877348b2cb53a502a1bd305f973105f064a58 commit 57d877348b2cb53a502a1bd305f973105f064a58 Author: Kirk McKusick AuthorDate: 2021-05-17 00:02:42 +0000 Commit: Kirk McKusick CommitDate: 2021-05-31 00:40:44 +0000 Fix handling of embedded symbolic links (and history lesson). Sponsored by: Netflix (cherry picked from commit 9a2fac6ba65fbd14d37ccedbc2aec27a190128ea) --- sys/kern/vfs_subr.c | 3 ++- sys/sys/mount.h | 2 +- sys/ufs/ffs/ffs_inode.c | 4 +--- sys/ufs/ufs/ufs_vnops.c | 4 +--- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index ee570f216b40..ba02d0600a6e 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -4403,7 +4403,8 @@ DB_SHOW_COMMAND(mount, db_show_mount) mp->mnt_lazyvnodelistsize); db_printf(" mnt_writeopcount = %d (with %d in the struct)\n", vfs_mount_fetch_counter(mp, MNT_COUNT_WRITEOPCOUNT), mp->mnt_writeopcount); - db_printf(" mnt_maxsymlinklen = %d\n", mp->mnt_maxsymlinklen); + db_printf(" mnt_maxsymlinklen = %jd\n", + (uintmax_t)mp->mnt_maxsymlinklen); db_printf(" mnt_iosize_max = %d\n", mp->mnt_iosize_max); db_printf(" mnt_hashseed = %u\n", mp->mnt_hashseed); db_printf(" mnt_lockref = %d (with %d in the struct)\n", diff --git a/sys/sys/mount.h b/sys/sys/mount.h index 8b5712d19215..ae12c9fc8197 100644 --- a/sys/sys/mount.h +++ b/sys/sys/mount.h @@ -222,7 +222,7 @@ struct mount { int mnt_writeopcount; /* (i) write syscalls pending */ struct vfsoptlist *mnt_opt; /* current mount options */ struct vfsoptlist *mnt_optnew; /* new options passed to fs */ - int mnt_maxsymlinklen; /* max size of short symlink */ + uint64_t mnt_maxsymlinklen; /* max size of short symlink */ struct statfs mnt_stat; /* cache of filesystem stats */ struct ucred *mnt_cred; /* credentials of mounter */ void * mnt_data; /* private data */ diff --git a/sys/ufs/ffs/ffs_inode.c b/sys/ufs/ffs/ffs_inode.c index 3df7bf8e8596..7bb532e7d26c 100644 --- a/sys/ufs/ffs/ffs_inode.c +++ b/sys/ufs/ffs/ffs_inode.c @@ -329,9 +329,7 @@ ffs_truncate(vp, length, flags, cred) } if ((flags & IO_NORMAL) == 0) return (0); - if (vp->v_type == VLNK && - (ip->i_size < vp->v_mount->mnt_maxsymlinklen || - datablocks == 0)) { + if (vp->v_type == VLNK && ip->i_size < vp->v_mount->mnt_maxsymlinklen) { #ifdef INVARIANTS if (length != 0) panic("ffs_truncate: partial truncate of symlink"); diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index 301c583291d1..70bf1a1d9036 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -2458,10 +2458,8 @@ ufs_readlink(ap) doff_t isize; isize = ip->i_size; - if ((isize < vp->v_mount->mnt_maxsymlinklen) || - DIP(ip, i_blocks) == 0) { /* XXX - for old fastlink support */ + if (isize < vp->v_mount->mnt_maxsymlinklen) return (uiomove(SHORTLINK(ip), isize, ap->a_uio)); - } return (VOP_READ(vp, ap->a_uio, 0, ap->a_cred)); } From owner-dev-commits-src-branches@freebsd.org Mon May 31 00:45:32 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DFBAD63B198; Mon, 31 May 2021 00:45: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 4Ftc5m5z9Hz4ncQ; Mon, 31 May 2021 00:45:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B352526B38; Mon, 31 May 2021 00:45:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 14V0jWnS052748; Mon, 31 May 2021 00:45:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 14V0jWGF052747; Mon, 31 May 2021 00:45:32 GMT (envelope-from git) Date: Mon, 31 May 2021 00:45:32 GMT Message-Id: <202105310045.14V0jWGF052747@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 5f7ceb78f58f - stable/13 - ktls.h: Guard includes behind _KERNEL MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5f7ceb78f58f5de60a40b4d31102db3e67414cdb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 May 2021 00:45:33 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=5f7ceb78f58f5de60a40b4d31102db3e67414cdb commit 5f7ceb78f58f5de60a40b4d31102db3e67414cdb Author: Mark Johnston AuthorDate: 2021-05-22 16:12:19 +0000 Commit: Mark Johnston CommitDate: 2021-05-31 00:45:19 +0000 ktls.h: Guard includes behind _KERNEL These are not needed when including ktls.h to get sockopt definitions. Reviewed by: gallatin, jhb Sponsored by: The FreeBSD Foundation (cherry picked from commit 5c7ef43e9625528da93b308a97aab0858f7eaec6) --- sys/sys/ktls.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/sys/ktls.h b/sys/sys/ktls.h index 8d591888466c..2f15cce3fc55 100644 --- a/sys/sys/ktls.h +++ b/sys/sys/ktls.h @@ -29,8 +29,10 @@ #ifndef _SYS_KTLS_H_ #define _SYS_KTLS_H_ +#ifdef _KERNEL #include #include +#endif struct tls_record_layer { uint8_t tls_type; From owner-dev-commits-src-branches@freebsd.org Mon May 31 00:53:04 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BE6FF63B1D7; Mon, 31 May 2021 00:53: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 4FtcGS4yh4z4ntx; Mon, 31 May 2021 00:53:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 927CD26775; Mon, 31 May 2021 00:53:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 14V0r4LX065460; Mon, 31 May 2021 00:53:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 14V0r453065459; Mon, 31 May 2021 00:53:04 GMT (envelope-from git) Date: Mon, 31 May 2021 00:53:04 GMT Message-Id: <202105310053.14V0r453065459@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kirk McKusick Subject: git: f9738ecc4115 - stable/12 - Fix handling of embedded symbolic links MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: f9738ecc411548be9a8f67c5d33839c6e886b8b3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 May 2021 00:53:04 -0000 The branch stable/12 has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=f9738ecc411548be9a8f67c5d33839c6e886b8b3 commit f9738ecc411548be9a8f67c5d33839c6e886b8b3 Author: Kirk McKusick AuthorDate: 2021-05-17 00:02:42 +0000 Commit: Kirk McKusick CommitDate: 2021-05-31 00:54:42 +0000 Fix handling of embedded symbolic links Sponsored by: Netflix (cherry picked from commit 9a2fac6ba65fbd14d37ccedbc2aec27a190128ea) --- sys/kern/vfs_subr.c | 3 ++- sys/sys/mount.h | 2 +- sys/ufs/ffs/ffs_inode.c | 4 +--- sys/ufs/ufs/ufs_vnops.c | 4 +--- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 601f159d0c67..15ea8a1275c9 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -3859,7 +3859,8 @@ DB_SHOW_COMMAND(mount, db_show_mount) db_printf(" mnt_activevnodelistsize = %d\n", mp->mnt_activevnodelistsize); db_printf(" mnt_writeopcount = %d\n", mp->mnt_writeopcount); - db_printf(" mnt_maxsymlinklen = %d\n", mp->mnt_maxsymlinklen); + db_printf(" mnt_maxsymlinklen = %jd\n", + (uintmax_t)mp->mnt_maxsymlinklen); db_printf(" mnt_iosize_max = %d\n", mp->mnt_iosize_max); db_printf(" mnt_hashseed = %u\n", mp->mnt_hashseed); db_printf(" mnt_lockref = %d\n", mp->mnt_lockref); diff --git a/sys/sys/mount.h b/sys/sys/mount.h index f1a42cb3d29b..d3a3b6fa0558 100644 --- a/sys/sys/mount.h +++ b/sys/sys/mount.h @@ -209,7 +209,7 @@ struct mount { uint64_t mnt_flag; /* (i) flags shared with user */ struct vfsoptlist *mnt_opt; /* current mount options */ struct vfsoptlist *mnt_optnew; /* new options passed to fs */ - int mnt_maxsymlinklen; /* max size of short symlink */ + uint64_t mnt_maxsymlinklen; /* max size of short symlink */ struct statfs mnt_stat; /* cache of filesystem stats */ struct ucred *mnt_cred; /* credentials of mounter */ void * mnt_data; /* private data */ diff --git a/sys/ufs/ffs/ffs_inode.c b/sys/ufs/ffs/ffs_inode.c index 8fbe02cd572b..d0fa00cfaf6e 100644 --- a/sys/ufs/ffs/ffs_inode.c +++ b/sys/ufs/ffs/ffs_inode.c @@ -302,9 +302,7 @@ ffs_truncate(vp, length, flags, cred) } if ((flags & IO_NORMAL) == 0) return (0); - if (vp->v_type == VLNK && - (ip->i_size < vp->v_mount->mnt_maxsymlinklen || - datablocks == 0)) { + if (vp->v_type == VLNK && ip->i_size < vp->v_mount->mnt_maxsymlinklen) { #ifdef INVARIANTS if (length != 0) panic("ffs_truncate: partial truncate of symlink"); diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index eee8004bb029..0174e0baebb6 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -2279,10 +2279,8 @@ ufs_readlink(ap) doff_t isize; isize = ip->i_size; - if ((isize < vp->v_mount->mnt_maxsymlinklen) || - DIP(ip, i_blocks) == 0) { /* XXX - for old fastlink support */ + if (isize < vp->v_mount->mnt_maxsymlinklen) return (uiomove(SHORTLINK(ip), isize, ap->a_uio)); - } return (VOP_READ(vp, ap->a_uio, 0, ap->a_cred)); } From owner-dev-commits-src-branches@freebsd.org Mon May 31 03:37:17 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2843363D81F; Mon, 31 May 2021 03:37:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ftgvw6xqYz3Gwx; Mon, 31 May 2021 03:37:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D75ECD6E; Mon, 31 May 2021 03:37:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 14V3bGgF078690; Mon, 31 May 2021 03:37:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 14V3bGvg078689; Mon, 31 May 2021 03:37:16 GMT (envelope-from git) Date: Mon, 31 May 2021 03:37:16 GMT Message-Id: <202105310337.14V3bGvg078689@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 4a4a174959ce - stable/13 - NFSv4 server: Re-establish the delegation recall timeout MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4a4a174959ce4ab35ecdf282b84f608fbf6d609e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 May 2021 03:37:17 -0000 The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=4a4a174959ce4ab35ecdf282b84f608fbf6d609e commit 4a4a174959ce4ab35ecdf282b84f608fbf6d609e Author: Rick Macklem AuthorDate: 2021-05-16 23:40:01 +0000 Commit: Rick Macklem CommitDate: 2021-05-31 03:34:03 +0000 NFSv4 server: Re-establish the delegation recall timeout Commit 7a606f280a3e allowed the server to do retries of CB_RECALL callbacks every couple of seconds. This was needed to allow the Linux client to re-establish the back channel. However this patch broke the delegation timeout check, such that it would just keep retrying CB_RECALLS. If the client has crashed or been network patitioned from the server, this continues until the client TCP reconnects to the server and re-establishes the back channel. This patch modifies the code such that it still times out the delegation recall after some minutes, so that the server will allow the conflicting client request once the delegation times out. This patch only affects the NFSv4 server when delegations are enabled and a NFSv4 client that holds a delegation has crashed or been network partitioned from the server for at least several minutes when a delegation needs to be recalled. (cherry picked from commit 46269d66ed02598c86756d81a7d7b27ec0f0c5cd) --- sys/fs/nfsserver/nfs_nfsdstate.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/fs/nfsserver/nfs_nfsdstate.c b/sys/fs/nfsserver/nfs_nfsdstate.c index 3aebddad0962..c16d5b8afdc8 100644 --- a/sys/fs/nfsserver/nfs_nfsdstate.c +++ b/sys/fs/nfsserver/nfs_nfsdstate.c @@ -5292,8 +5292,9 @@ nfsrv_delegconflict(struct nfsstate *stp, int *haslockp, NFSPROC_T *p, * - check to see if the delegation has expired * - if so, get the v4root lock and then expire it */ - if ((stp->ls_flags & NFSLCK_DELEGRECALL) == 0 || stp->ls_lastrecall < - time_uptime) { + if ((stp->ls_flags & NFSLCK_DELEGRECALL) == 0 || (stp->ls_lastrecall < + NFSD_MONOSEC && clp->lc_expiry >= NFSD_MONOSEC && + stp->ls_delegtime >= NFSD_MONOSEC)) { /* * - do a recall callback, since not yet done * For now, never allow truncate to be set. To use From owner-dev-commits-src-branches@freebsd.org Mon May 31 03:42:41 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A9CB763DC3D; Mon, 31 May 2021 03:42:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fth294KKKz3HCy; Mon, 31 May 2021 03:42:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7BD9C11A2; Mon, 31 May 2021 03:42:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 14V3gfPt091257; Mon, 31 May 2021 03:42:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 14V3gfma091256; Mon, 31 May 2021 03:42:41 GMT (envelope-from git) Date: Mon, 31 May 2021 03:42:41 GMT Message-Id: <202105310342.14V3gfma091256@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 645f01722694 - stable/12 - NFSv4 server: Re-establish the delegation recall timeout MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 645f01722694a0594c67cbf96ee10928b6676f67 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 May 2021 03:42:41 -0000 The branch stable/12 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=645f01722694a0594c67cbf96ee10928b6676f67 commit 645f01722694a0594c67cbf96ee10928b6676f67 Author: Rick Macklem AuthorDate: 2021-05-16 23:40:01 +0000 Commit: Rick Macklem CommitDate: 2021-05-31 03:39:36 +0000 NFSv4 server: Re-establish the delegation recall timeout Commit 7a606f280a3e allowed the server to do retries of CB_RECALL callbacks every couple of seconds. This was needed to allow the Linux client to re-establish the back channel. However this patch broke the delegation timeout check, such that it would just keep retrying CB_RECALLS. If the client has crashed or been network patitioned from the server, this continues until the client TCP reconnects to the server and re-establishes the back channel. This patch modifies the code such that it still times out the delegation recall after some minutes, so that the server will allow the conflicting client request once the delegation times out. This patch only affects the NFSv4 server when delegations are enabled and a NFSv4 client that holds a delegation has crashed or been network partitioned from the server for at least several minutes when a delegation needs to be recalled. (cherry picked from commit 46269d66ed02598c86756d81a7d7b27ec0f0c5cd) --- sys/fs/nfsserver/nfs_nfsdstate.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/fs/nfsserver/nfs_nfsdstate.c b/sys/fs/nfsserver/nfs_nfsdstate.c index 9171891478c1..abd4099a7ee2 100644 --- a/sys/fs/nfsserver/nfs_nfsdstate.c +++ b/sys/fs/nfsserver/nfs_nfsdstate.c @@ -5279,8 +5279,9 @@ nfsrv_delegconflict(struct nfsstate *stp, int *haslockp, NFSPROC_T *p, * - check to see if the delegation has expired * - if so, get the v4root lock and then expire it */ - if ((stp->ls_flags & NFSLCK_DELEGRECALL) == 0 || stp->ls_lastrecall < - time_uptime) { + if ((stp->ls_flags & NFSLCK_DELEGRECALL) == 0 || (stp->ls_lastrecall < + NFSD_MONOSEC && clp->lc_expiry >= NFSD_MONOSEC && + stp->ls_delegtime >= NFSD_MONOSEC)) { /* * - do a recall callback, since not yet done * For now, never allow truncate to be set. To use From owner-dev-commits-src-branches@freebsd.org Mon May 31 08:56:30 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8E9D4642A1B; Mon, 31 May 2021 08:56: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 4Ftq0G3V5qz4S4b; Mon, 31 May 2021 08:56:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5BB7D5707; Mon, 31 May 2021 08:56:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 14V8uUll003351; Mon, 31 May 2021 08:56:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 14V8uUt7003350; Mon, 31 May 2021 08:56:30 GMT (envelope-from git) Date: Mon, 31 May 2021 08:56:30 GMT Message-Id: <202105310856.14V8uUt7003350@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Richard Scheffenegger Subject: git: 9eed9e5c2dd1 - stable/13 - tcp: Use local CC data only in the correct context MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rscheff X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 9eed9e5c2dd1c59ef28b9abaa076959562a91a04 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 May 2021 08:56:30 -0000 The branch stable/13 has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=9eed9e5c2dd1c59ef28b9abaa076959562a91a04 commit 9eed9e5c2dd1c59ef28b9abaa076959562a91a04 Author: Richard Scheffenegger AuthorDate: 2021-05-26 17:45:06 +0000 Commit: Richard Scheffenegger CommitDate: 2021-05-31 06:56:34 +0000 tcp: Use local CC data only in the correct context Most CC algos do use local data, and when calling newreno_cong_signal from there, the latter misinterprets the data as its own struct, leading to incorrect behavior. Reported by: chengc_netapp.com Reviewed By: chengc_netapp.com, tuexen, #transport MFC after: 3 days Sponsored By: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D30470 (cherry picked from commit c358f1857f0c749ad166fb9e9bef04f4033f3a72) --- sys/netinet/cc/cc_newreno.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/sys/netinet/cc/cc_newreno.c b/sys/netinet/cc/cc_newreno.c index 84f8b6a5eb1a..a924acb0b8d6 100644 --- a/sys/netinet/cc/cc_newreno.c +++ b/sys/netinet/cc/cc_newreno.c @@ -238,7 +238,12 @@ newreno_cong_signal(struct cc_var *ccv, uint32_t type) cwin = CCV(ccv, snd_cwnd); mss = tcp_maxseg(ccv->ccvc.tcp); - nreno = ccv->cc_data; + /* + * Other TCP congestion controls use newreno_cong_signal(), but + * with their own private cc_data. Make sure the cc_data is used + * correctly. + */ + nreno = (CC_ALGO(ccv->ccvc.tcp) == &newreno_cc_algo) ? ccv->cc_data : NULL; beta = (nreno == NULL) ? V_newreno_beta : nreno->beta; beta_ecn = (nreno == NULL) ? V_newreno_beta_ecn : nreno->beta_ecn; if (V_cc_do_abe && type == CC_ECN) @@ -328,6 +333,9 @@ newreno_ctl_output(struct cc_var *ccv, struct sockopt *sopt, void *buf) if (sopt->sopt_valsize != sizeof(struct cc_newreno_opts)) return (EMSGSIZE); + if (CC_ALGO(ccv->ccvc.tcp) != &newreno_cc_algo) + return (ENOPROTOOPT); + nreno = ccv->cc_data; opt = buf; From owner-dev-commits-src-branches@freebsd.org Mon May 31 08:56:56 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CD4BF642C13; Mon, 31 May 2021 08:56:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ftq0m55F9z4SDy; Mon, 31 May 2021 08:56:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 98433558D; Mon, 31 May 2021 08:56:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 14V8uujq003508; Mon, 31 May 2021 08:56:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 14V8uu56003507; Mon, 31 May 2021 08:56:56 GMT (envelope-from git) Date: Mon, 31 May 2021 08:56:56 GMT Message-Id: <202105310856.14V8uu56003507@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Richard Scheffenegger Subject: git: 11417329c930 - stable/12 - tcp: Use local CC data only in the correct context MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rscheff X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 11417329c930adbed6297cd76f18c2b4ae7f5120 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 May 2021 08:56:56 -0000 The branch stable/12 has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=11417329c930adbed6297cd76f18c2b4ae7f5120 commit 11417329c930adbed6297cd76f18c2b4ae7f5120 Author: Richard Scheffenegger AuthorDate: 2021-05-26 17:45:06 +0000 Commit: Richard Scheffenegger CommitDate: 2021-05-31 06:58:34 +0000 tcp: Use local CC data only in the correct context Most CC algos do use local data, and when calling newreno_cong_signal from there, the latter misinterprets the data as its own struct, leading to incorrect behavior. Reported by: chengc_netapp.com Reviewed By: chengc_netapp.com, tuexen, #transport MFC after: 3 days Sponsored By: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D30470 (cherry picked from commit c358f1857f0c749ad166fb9e9bef04f4033f3a72) --- sys/netinet/cc/cc_newreno.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/sys/netinet/cc/cc_newreno.c b/sys/netinet/cc/cc_newreno.c index 2379ae64e684..acc4fcfcda22 100644 --- a/sys/netinet/cc/cc_newreno.c +++ b/sys/netinet/cc/cc_newreno.c @@ -242,7 +242,12 @@ newreno_cong_signal(struct cc_var *ccv, uint32_t type) cwin = CCV(ccv, snd_cwnd); mss = tcp_maxseg(ccv->ccvc.tcp); - nreno = ccv->cc_data; + /* + * Other TCP congestion controls use newreno_cong_signal(), but + * with their own private cc_data. Make sure the cc_data is used + * correctly. + */ + nreno = (CC_ALGO(ccv->ccvc.tcp) == &newreno_cc_algo) ? ccv->cc_data : NULL; beta = (nreno == NULL) ? V_newreno_beta : nreno->beta; beta_ecn = (nreno == NULL) ? V_newreno_beta_ecn : nreno->beta_ecn; if (V_cc_do_abe && type == CC_ECN) @@ -332,6 +337,9 @@ newreno_ctl_output(struct cc_var *ccv, struct sockopt *sopt, void *buf) if (sopt->sopt_valsize != sizeof(struct cc_newreno_opts)) return (EMSGSIZE); + if (CC_ALGO(ccv->ccvc.tcp) != &newreno_cc_algo) + return (ENOPROTOOPT); + nreno = ccv->cc_data; opt = buf; From owner-dev-commits-src-branches@freebsd.org Tue Jun 1 00:03:16 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 31B3D6339D4; Tue, 1 Jun 2021 00:03: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 4FvC6X0yPfz3hVn; Tue, 1 Jun 2021 00:03:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 08353196C5; Tue, 1 Jun 2021 00:03:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15103Fwj019711; Tue, 1 Jun 2021 00:03:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15103Fmg019710; Tue, 1 Jun 2021 00:03:15 GMT (envelope-from git) Date: Tue, 1 Jun 2021 00:03:15 GMT Message-Id: <202106010003.15103Fmg019710@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 40b64abff4ea - stable/13 - Move mnt_maxsymlinklen into appropriate fs mount data structures MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 40b64abff4eaa1e06b4434ab422f67561aabf469 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jun 2021 00:03:16 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=40b64abff4eaa1e06b4434ab422f67561aabf469 commit 40b64abff4eaa1e06b4434ab422f67561aabf469 Author: Konstantin Belousov AuthorDate: 2021-05-18 01:42:03 +0000 Commit: Konstantin Belousov CommitDate: 2021-05-31 23:48:16 +0000 Move mnt_maxsymlinklen into appropriate fs mount data structures For MFC, mnt_maxsymlinklen was replaced by padding of type u_int, to restore KBI after 57d877348b2c. (cherry picked from commit f784da883fd5a744fcaf4ccfc550ca497ea5d7a6) --- sys/fs/cd9660/cd9660_vfsops.c | 1 - sys/fs/ext2fs/ext2_inode.c | 2 +- sys/fs/ext2fs/ext2_vfsops.c | 2 +- sys/fs/ext2fs/ext2_vnops.c | 7 ++++--- sys/fs/ext2fs/ext2fs.h | 1 + sys/kern/vfs_subr.c | 2 -- sys/sys/mount.h | 2 +- sys/ufs/ffs/ffs_inode.c | 2 +- sys/ufs/ffs/ffs_vfsops.c | 4 ++-- sys/ufs/ffs/ffs_vnops.c | 2 +- sys/ufs/ufs/ufs_dirhash.c | 1 - sys/ufs/ufs/ufs_lookup.c | 8 ++------ sys/ufs/ufs/ufs_vnops.c | 14 +++++++------- sys/ufs/ufs/ufsmount.h | 5 +++++ 14 files changed, 26 insertions(+), 27 deletions(-) diff --git a/sys/fs/cd9660/cd9660_vfsops.c b/sys/fs/cd9660/cd9660_vfsops.c index 21d3c3e13a8f..5d475bec93b8 100644 --- a/sys/fs/cd9660/cd9660_vfsops.c +++ b/sys/fs/cd9660/cd9660_vfsops.c @@ -378,7 +378,6 @@ iso_mountfs(devvp, mp) mp->mnt_data = isomp; mp->mnt_stat.f_fsid.val[0] = dev2udev(dev); mp->mnt_stat.f_fsid.val[1] = mp->mnt_vfc->vfc_typenum; - mp->mnt_maxsymlinklen = 0; MNT_ILOCK(mp); if (isverified) mp->mnt_flag |= MNT_VERIFIED; diff --git a/sys/fs/ext2fs/ext2_inode.c b/sys/fs/ext2fs/ext2_inode.c index 1e7584ebaa66..090caf783a3b 100644 --- a/sys/fs/ext2fs/ext2_inode.c +++ b/sys/fs/ext2fs/ext2_inode.c @@ -562,7 +562,7 @@ ext2_truncate(struct vnode *vp, off_t length, int flags, struct ucred *cred, ip = VTOI(vp); if (vp->v_type == VLNK && - ip->i_size < vp->v_mount->mnt_maxsymlinklen) { + ip->i_size < VFSTOEXT2(vp->v_mount)->um_e2fs->e2fs_maxsymlinklen) { #ifdef INVARIANTS if (length != 0) panic("ext2_truncate: partial truncate of symlink"); diff --git a/sys/fs/ext2fs/ext2_vfsops.c b/sys/fs/ext2fs/ext2_vfsops.c index a64e28186769..3da8ca6331bc 100644 --- a/sys/fs/ext2fs/ext2_vfsops.c +++ b/sys/fs/ext2fs/ext2_vfsops.c @@ -924,6 +924,7 @@ ext2_mountfs(struct vnode *devvp, struct mount *mp) */ e2fs_maxcontig = MAX(1, maxphys / ump->um_e2fs->e2fs_bsize); ump->um_e2fs->e2fs_contigsumsize = MIN(e2fs_maxcontig, EXT2_MAXCONTIG); + ump->um_e2fs->e2fs_maxsymlinklen = EXT2_MAXSYMLINKLEN; if (ump->um_e2fs->e2fs_contigsumsize > 0) { size = ump->um_e2fs->e2fs_gcount * sizeof(int32_t); ump->um_e2fs->e2fs_maxcluster = malloc(size, M_EXT2MNT, M_WAITOK); @@ -957,7 +958,6 @@ ext2_mountfs(struct vnode *devvp, struct mount *mp) mp->mnt_data = ump; mp->mnt_stat.f_fsid.val[0] = dev2udev(dev); mp->mnt_stat.f_fsid.val[1] = mp->mnt_vfc->vfc_typenum; - mp->mnt_maxsymlinklen = EXT2_MAXSYMLINKLEN; MNT_ILOCK(mp); mp->mnt_flag |= MNT_LOCAL; MNT_IUNLOCK(mp); diff --git a/sys/fs/ext2fs/ext2_vnops.c b/sys/fs/ext2fs/ext2_vnops.c index e52db1416890..d26044e11929 100644 --- a/sys/fs/ext2fs/ext2_vnops.c +++ b/sys/fs/ext2fs/ext2_vnops.c @@ -1521,7 +1521,7 @@ ext2_symlink(struct vop_symlink_args *ap) return (error); vp = *vpp; len = strlen(ap->a_target); - if (len < vp->v_mount->mnt_maxsymlinklen) { + if (len < VFSTOEXT2(vp->v_mount)->um_e2fs->e2fs_maxsymlinklen) { ip = VTOI(vp); bcopy(ap->a_target, (char *)ip->i_shortlink, len); ip->i_size = len; @@ -1546,7 +1546,7 @@ ext2_readlink(struct vop_readlink_args *ap) int isize; isize = ip->i_size; - if (isize < vp->v_mount->mnt_maxsymlinklen) { + if (isize < VFSTOEXT2(vp->v_mount)->um_e2fs->e2fs_maxsymlinklen) { uiomove((char *)ip->i_shortlink, isize, ap->a_uio); return (0); } @@ -2063,7 +2063,8 @@ ext2_read(struct vop_read_args *ap) panic("%s: mode", "ext2_read"); if (vp->v_type == VLNK) { - if ((int)ip->i_size < vp->v_mount->mnt_maxsymlinklen) + if ((int)ip->i_size < + VFSTOEXT2(vp->v_mount)->um_e2fs->e2fs_maxsymlinklen) panic("%s: short symlink", "ext2_read"); } else if (vp->v_type != VREG && vp->v_type != VDIR) panic("%s: type %d", "ext2_read", vp->v_type); diff --git a/sys/fs/ext2fs/ext2fs.h b/sys/fs/ext2fs/ext2fs.h index 81ff6838f16f..f43ebcfebb92 100644 --- a/sys/fs/ext2fs/ext2fs.h +++ b/sys/fs/ext2fs/ext2fs.h @@ -184,6 +184,7 @@ struct m_ext2fs { struct csum *e2fs_clustersum; /* cluster summary in each cyl group */ int32_t e2fs_uhash; /* 3 if hash should be signed, 0 if not */ uint32_t e2fs_csum_seed; /* sb checksum seed */ + uint64_t e2fs_maxsymlinklen; /* max size of short symlink */ }; /* cluster summary information */ diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index ba02d0600a6e..5de58f979e97 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -4403,8 +4403,6 @@ DB_SHOW_COMMAND(mount, db_show_mount) mp->mnt_lazyvnodelistsize); db_printf(" mnt_writeopcount = %d (with %d in the struct)\n", vfs_mount_fetch_counter(mp, MNT_COUNT_WRITEOPCOUNT), mp->mnt_writeopcount); - db_printf(" mnt_maxsymlinklen = %jd\n", - (uintmax_t)mp->mnt_maxsymlinklen); db_printf(" mnt_iosize_max = %d\n", mp->mnt_iosize_max); db_printf(" mnt_hashseed = %u\n", mp->mnt_hashseed); db_printf(" mnt_lockref = %d (with %d in the struct)\n", diff --git a/sys/sys/mount.h b/sys/sys/mount.h index ae12c9fc8197..cd0d0071aa1b 100644 --- a/sys/sys/mount.h +++ b/sys/sys/mount.h @@ -222,7 +222,7 @@ struct mount { int mnt_writeopcount; /* (i) write syscalls pending */ struct vfsoptlist *mnt_opt; /* current mount options */ struct vfsoptlist *mnt_optnew; /* new options passed to fs */ - uint64_t mnt_maxsymlinklen; /* max size of short symlink */ + u_int mnt_pad0; /* was mnt_maxsymlinklen */ struct statfs mnt_stat; /* cache of filesystem stats */ struct ucred *mnt_cred; /* credentials of mounter */ void * mnt_data; /* private data */ diff --git a/sys/ufs/ffs/ffs_inode.c b/sys/ufs/ffs/ffs_inode.c index 7bb532e7d26c..12ab3ca0a5e1 100644 --- a/sys/ufs/ffs/ffs_inode.c +++ b/sys/ufs/ffs/ffs_inode.c @@ -329,7 +329,7 @@ ffs_truncate(vp, length, flags, cred) } if ((flags & IO_NORMAL) == 0) return (0); - if (vp->v_type == VLNK && ip->i_size < vp->v_mount->mnt_maxsymlinklen) { + if (vp->v_type == VLNK && ip->i_size < ump->um_maxsymlinklen) { #ifdef INVARIANTS if (length != 0) panic("ffs_truncate: partial truncate of symlink"); diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index 540dd02c9631..c8073874a85f 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -908,7 +908,7 @@ ffs_reload(struct mount *mp, struct thread *td, int flags) sblockloc = fs->fs_sblockloc; bcopy(newfs, fs, (u_int)fs->fs_sbsize); brelse(bp); - mp->mnt_maxsymlinklen = fs->fs_maxsymlinklen; + ump->um_maxsymlinklen = fs->fs_maxsymlinklen; ffs_oldfscompat_read(fs, VFSTOUFS(mp), sblockloc); UFS_LOCK(ump); if (fs->fs_pendingblocks != 0 || fs->fs_pendinginodes != 0) { @@ -1168,7 +1168,7 @@ ffs_mountfs(odevvp, mp, td) vfs_rel(nmp); vfs_getnewfsid(mp); } - mp->mnt_maxsymlinklen = fs->fs_maxsymlinklen; + ump->um_maxsymlinklen = fs->fs_maxsymlinklen; MNT_ILOCK(mp); mp->mnt_flag |= MNT_LOCAL; MNT_IUNLOCK(mp); diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c index 4e4e0b78fe4d..e834a6b4f50a 100644 --- a/sys/ufs/ffs/ffs_vnops.c +++ b/sys/ufs/ffs/ffs_vnops.c @@ -675,7 +675,7 @@ ffs_read(ap) panic("ffs_read: mode"); if (vp->v_type == VLNK) { - if ((int)ip->i_size < vp->v_mount->mnt_maxsymlinklen) + if ((int)ip->i_size < VFSTOUFS(vp->v_mount)->um_maxsymlinklen) panic("ffs_read: short symlink"); } else if (vp->v_type != VREG && vp->v_type != VDIR) panic("ffs_read: type %d", vp->v_type); diff --git a/sys/ufs/ufs/ufs_dirhash.c b/sys/ufs/ufs/ufs_dirhash.c index d1e1bed0bde4..8981ffdfc269 100644 --- a/sys/ufs/ufs/ufs_dirhash.c +++ b/sys/ufs/ufs/ufs_dirhash.c @@ -65,7 +65,6 @@ __FBSDID("$FreeBSD$"); #define WRAPINCR(val, limit) (((val) + 1 == (limit)) ? 0 : ((val) + 1)) #define WRAPDECR(val, limit) (((val) == 0) ? ((limit) - 1) : ((val) - 1)) -#define OFSFMT(vp) ((vp)->v_mount->mnt_maxsymlinklen <= 0) #define BLKFREE2IDX(n) ((n) > DH_NFSTATS ? DH_NFSTATS : (n)) static MALLOC_DEFINE(M_DIRHASH, "ufs_dirhash", "UFS directory hash tables"); diff --git a/sys/ufs/ufs/ufs_lookup.c b/sys/ufs/ufs/ufs_lookup.c index 0509185c4663..b7bf4eb6c86c 100644 --- a/sys/ufs/ufs/ufs_lookup.c +++ b/sys/ufs/ufs/ufs_lookup.c @@ -76,9 +76,6 @@ static int dirchk = 0; SYSCTL_INT(_debug, OID_AUTO, dircheck, CTLFLAG_RW, &dirchk, 0, ""); -/* true if old FS format...*/ -#define OFSFMT(vp) ((vp)->v_mount->mnt_maxsymlinklen <= 0) - static int ufs_delete_denied(struct vnode *vdp, struct vnode *tdp, struct ucred *cred, struct thread *td) @@ -440,8 +437,7 @@ foundentry: * reclen in ndp->ni_ufs area, and release * directory buffer. */ - if (vdp->v_mount->mnt_maxsymlinklen > 0 && - ep->d_type == DT_WHT) { + if (!OFSFMT(vdp) && ep->d_type == DT_WHT) { slotstatus = FOUND; slotoffset = i_offset; slotsize = ep->d_reclen; @@ -854,7 +850,7 @@ ufs_makedirentry(ip, cnp, newdirp) bcopy(cnp->cn_nameptr, newdirp->d_name, namelen); - if (ITOV(ip)->v_mount->mnt_maxsymlinklen > 0) + if (!OFSFMT(ITOV(ip))) newdirp->d_type = IFTODT(ip->i_mode); else { newdirp->d_type = 0; diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index 70bf1a1d9036..ef288a32e815 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -1155,7 +1155,7 @@ ufs_whiteout(ap) switch (ap->a_flags) { case LOOKUP: /* 4.4 format directories support whiteout operations */ - if (dvp->v_mount->mnt_maxsymlinklen > 0) + if (!OFSFMT(dvp)) return (0); return (EOPNOTSUPP); @@ -1164,7 +1164,7 @@ ufs_whiteout(ap) #ifdef INVARIANTS if ((cnp->cn_flags & SAVENAME) == 0) panic("ufs_whiteout: missing name"); - if (dvp->v_mount->mnt_maxsymlinklen <= 0) + if (OFSFMT(dvp)) panic("ufs_whiteout: old format filesystem"); #endif @@ -1178,7 +1178,7 @@ ufs_whiteout(ap) case DELETE: /* remove an existing directory whiteout */ #ifdef INVARIANTS - if (dvp->v_mount->mnt_maxsymlinklen <= 0) + if (OFSFMT(dvp)) panic("ufs_whiteout: old format filesystem"); #endif @@ -2083,7 +2083,7 @@ ufs_mkdir(ap) /* * Initialize directory with "." and ".." from static template. */ - if (dvp->v_mount->mnt_maxsymlinklen > 0) + if (!OFSFMT(dvp)) dtp = &mastertemplate; else dtp = (struct dirtemplate *)&omastertemplate; @@ -2287,7 +2287,7 @@ ufs_symlink(ap) return (error); vp = *vpp; len = strlen(ap->a_target); - if (len < vp->v_mount->mnt_maxsymlinklen) { + if (len < VFSTOUFS(vp->v_mount)->um_maxsymlinklen) { ip = VTOI(vp); bcopy(ap->a_target, SHORTLINK(ip), len); ip->i_size = len; @@ -2377,7 +2377,7 @@ ufs_readdir(ap) } #if BYTE_ORDER == LITTLE_ENDIAN /* Old filesystem format. */ - if (vp->v_mount->mnt_maxsymlinklen <= 0) { + if (OFSFMT(vp)) { dstdp.d_namlen = dp->d_type; dstdp.d_type = dp->d_namlen; } else @@ -2458,7 +2458,7 @@ ufs_readlink(ap) doff_t isize; isize = ip->i_size; - if (isize < vp->v_mount->mnt_maxsymlinklen) + if (isize < VFSTOUFS(vp->v_mount)->um_maxsymlinklen) return (uiomove(SHORTLINK(ip), isize, ap->a_uio)); return (VOP_READ(vp, ap->a_uio, 0, ap->a_cred)); } diff --git a/sys/ufs/ufs/ufsmount.h b/sys/ufs/ufs/ufsmount.h index 57e163c11d77..e5f9c93da373 100644 --- a/sys/ufs/ufs/ufsmount.h +++ b/sys/ufs/ufs/ufsmount.h @@ -97,6 +97,8 @@ struct ufsmount { u_long um_nindir; /* (c) indirect ptrs per blk */ u_long um_bptrtodb; /* (c) indir disk block ptr */ u_long um_seqinc; /* (c) inc between seq blocks */ + uint64_t um_maxsymlinklen; /* (c) max size of short + symlink */ struct mtx um_lock; /* (c) Protects ufsmount & fs */ pid_t um_fsckpid; /* (u) PID can do fsck sysctl */ struct mount_softdeps *um_softdep; /* (c) softdep mgmt structure */ @@ -192,4 +194,7 @@ struct ufsmount { #define is_sequential(ump, a, b) ((b) == (a) + ump->um_seqinc) #endif /* _KERNEL */ +/* true if old FS format...*/ +#define OFSFMT(vp) (VFSTOUFS((vp)->v_mount)->um_maxsymlinklen <= 0) + #endif From owner-dev-commits-src-branches@freebsd.org Tue Jun 1 00:50:45 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0F8276347A1; Tue, 1 Jun 2021 00:50:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FvD9J7475z3jx9; Tue, 1 Jun 2021 00:50:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DAEEC1A404; Tue, 1 Jun 2021 00:50:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1510oiKt082944; Tue, 1 Jun 2021 00:50:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1510oikZ082943; Tue, 1 Jun 2021 00:50:44 GMT (envelope-from git) Date: Tue, 1 Jun 2021 00:50:44 GMT Message-Id: <202106010050.1510oikZ082943@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: b2955191736a - stable/13 - sys_process.c: extract ptrace_unsuspend() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b2955191736a73de74f465a23cf2d203102f0bd6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jun 2021 00:50:45 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b2955191736a73de74f465a23cf2d203102f0bd6 commit b2955191736a73de74f465a23cf2d203102f0bd6 Author: Konstantin Belousov AuthorDate: 2021-05-18 16:25:50 +0000 Commit: Konstantin Belousov CommitDate: 2021-06-01 00:38:53 +0000 sys_process.c: extract ptrace_unsuspend() (cherry picked from commit d7a7ea5be60753c140a39ec6fa30e5ca4014dbb5) --- sys/kern/sys_process.c | 20 ++++++++++++++------ sys/sys/ptrace.h | 3 +++ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c index bc38a8ee585d..2515a9cf1e4f 100644 --- a/sys/kern/sys_process.c +++ b/sys/kern/sys_process.c @@ -610,6 +610,19 @@ proc_set_traced(struct proc *p, bool stop) p->p_ptevents = PTRACE_DEFAULT; } +void +ptrace_unsuspend(struct proc *p) +{ + PROC_LOCK_ASSERT(p, MA_OWNED); + + PROC_SLOCK(p); + p->p_flag &= ~(P_STOPPED_TRACE | P_STOPPED_SIG | P_WAITED); + thread_unsuspend(p); + PROC_SUNLOCK(p); + itimer_proc_continue(p); + kqtimer_proc_continue(p); +} + static int proc_can_ptrace(struct thread *td, struct proc *p) { @@ -1164,12 +1177,7 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data) * suspended, use PT_SUSPEND to suspend it before * continuing the process. */ - PROC_SLOCK(p); - p->p_flag &= ~(P_STOPPED_TRACE | P_STOPPED_SIG | P_WAITED); - thread_unsuspend(p); - PROC_SUNLOCK(p); - itimer_proc_continue(p); - kqtimer_proc_continue(p); + ptrace_unsuspend(p); break; case PT_WRITE_I: diff --git a/sys/sys/ptrace.h b/sys/sys/ptrace.h index 06f01a04fd9d..1e7c1c71056b 100644 --- a/sys/sys/ptrace.h +++ b/sys/sys/ptrace.h @@ -240,6 +240,9 @@ int proc_write_fpregs32(struct thread *_td, struct fpreg32 *_fpreg32); int proc_read_dbregs32(struct thread *_td, struct dbreg32 *_dbreg32); int proc_write_dbregs32(struct thread *_td, struct dbreg32 *_dbreg32); #endif + +void ptrace_unsuspend(struct proc *p); + #else /* !_KERNEL */ #include From owner-dev-commits-src-branches@freebsd.org Tue Jun 1 00:50:46 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3597A6346DA; Tue, 1 Jun 2021 00:50: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 4FvD9L0t9pz3jv4; Tue, 1 Jun 2021 00:50:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 054A41A0D3; Tue, 1 Jun 2021 00:50:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1510ojDO082965; Tue, 1 Jun 2021 00:50:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1510oj9r082964; Tue, 1 Jun 2021 00:50:45 GMT (envelope-from git) Date: Tue, 1 Jun 2021 00:50:45 GMT Message-Id: <202106010050.1510oj9r082964@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 9c74a2068109 - stable/13 - ptrace: add an option to not kill debuggees on debugger exit MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 9c74a2068109b8a4b2dd0d98fb1ff0ebe48aa3a3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jun 2021 00:50:46 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=9c74a2068109b8a4b2dd0d98fb1ff0ebe48aa3a3 commit 9c74a2068109b8a4b2dd0d98fb1ff0ebe48aa3a3 Author: Konstantin Belousov AuthorDate: 2021-05-18 16:26:22 +0000 Commit: Konstantin Belousov CommitDate: 2021-06-01 00:38:54 +0000 ptrace: add an option to not kill debuggees on debugger exit (cherry picked from commit fd3ac06f452f47332e2f6fec8347579265c96104) --- lib/libc/sys/ptrace.2 | 27 ++++++++++++++++++++++++++- sys/kern/kern_exit.c | 24 ++++++++++++++++++++---- 2 files changed, 46 insertions(+), 5 deletions(-) diff --git a/lib/libc/sys/ptrace.2 b/lib/libc/sys/ptrace.2 index 6148e6d333d5..43ec2b76bbfd 100644 --- a/lib/libc/sys/ptrace.2 +++ b/lib/libc/sys/ptrace.2 @@ -2,7 +2,7 @@ .\" $NetBSD: ptrace.2,v 1.2 1995/02/27 12:35:37 cgd Exp $ .\" .\" This file is in the public domain. -.Dd April 10, 2021 +.Dd May 20, 2021 .Dt PTRACE 2 .Os .Sh NAME @@ -99,6 +99,30 @@ will report a signal. All other additional signal stops use .Dv SIGTRAP . +.Sh DETACH AND TERMINATION +.Pp +Normally, exiting tracing process should wait for all pending +debugging events and then detach from all alive traced processes +before exiting using +.Dv PT_DETACH +request. +If tracing process exits without detaching, for instance due to abnormal +termination, the destiny of the traced children processes is determined +by the +.Dv kern.kill_on_debugger_exit +sysctl control. +.Pp +If the control is set to the default value 1, such traced processes +are terminated. +If set to zero, kernel implicitly detaches traced processes. +Traced processes are un-stopped if needed, and then continue the execution +without tracing. +Kernel drops any +.Dv SIGTRAP +signals queued to the traced children, which could be either generated by +not yet consumed debug events, or sent by other means, the later should +not be done anyway. +.Sh TRACING EVENTS .Pp Each traced process has a tracing event mask. An event in the traced process only reports a @@ -216,6 +240,7 @@ includes only .Dv PTRACE_EXEC events. All other event flags are disabled. +.Sh PTRACE REQUESTS .Pp The .Fa request diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c index e1b40a171345..cb5996982a3a 100644 --- a/sys/kern/kern_exit.c +++ b/sys/kern/kern_exit.c @@ -66,6 +66,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include /* for acct_process() function prototype */ @@ -99,6 +100,11 @@ dtrace_execexit_func_t dtrace_fasttrap_exit; SDT_PROVIDER_DECLARE(proc); SDT_PROBE_DEFINE1(proc, , , exit, "int"); +static int kern_kill_on_dbg_exit = 1; +SYSCTL_INT(_kern, OID_AUTO, kill_on_debugger_exit, CTLFLAG_RWTUN, + &kern_kill_on_dbg_exit, 0, + "Kill ptraced processes when debugger exits"); + struct proc * proc_realparent(struct proc *child) { @@ -504,8 +510,9 @@ exit1(struct thread *td, int rval, int signo) } } else { /* - * Traced processes are killed since their existence - * means someone is screwing up. + * Traced processes are killed by default + * since their existence means someone is + * screwing up. */ t = proc_realparent(q); if (t == p) { @@ -522,14 +529,23 @@ exit1(struct thread *td, int rval, int signo) * orphan link for q now while q is locked. */ proc_clear_orphan(q); - q->p_flag &= ~(P_TRACED | P_STOPPED_TRACE); + q->p_flag &= ~P_TRACED; q->p_flag2 &= ~P2_PTRACE_FSTP; q->p_ptevents = 0; + p->p_xthread = NULL; FOREACH_THREAD_IN_PROC(q, tdt) { tdt->td_dbgflags &= ~(TDB_SUSPEND | TDB_XSIG | TDB_FSTP); + tdt->td_xsig = 0; + } + if (kern_kill_on_dbg_exit) { + q->p_flag &= ~P_STOPPED_TRACE; + kern_psignal(q, SIGKILL); + } else if ((q->p_flag & (P_STOPPED_TRACE | + P_STOPPED_SIG)) != 0) { + sigqueue_delete_proc(q, SIGTRAP); + ptrace_unsuspend(q); } - kern_psignal(q, SIGKILL); } PROC_UNLOCK(q); if (ksi != NULL) From owner-dev-commits-src-branches@freebsd.org Tue Jun 1 00:54:38 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 25A08634AAE; Tue, 1 Jun 2021 00:54:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FvDFp0Xl0z3kQq; Tue, 1 Jun 2021 00:54:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EEDF11A0F9; Tue, 1 Jun 2021 00:54:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1510sbL7084939; Tue, 1 Jun 2021 00:54:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1510sbg8084938; Tue, 1 Jun 2021 00:54:37 GMT (envelope-from git) Date: Tue, 1 Jun 2021 00:54:37 GMT Message-Id: <202106010054.1510sbg8084938@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: 6b6758888f42 - stable/13 - taskqueue: Add missing comma to TASKQUEUE_FAST_DEFINE_THREAD MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6b6758888f42f078217a39ca2aa816427eaf3967 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jun 2021 00:54:38 -0000 The branch stable/13 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=6b6758888f42f078217a39ca2aa816427eaf3967 commit 6b6758888f42f078217a39ca2aa816427eaf3967 Author: Colin Percival AuthorDate: 2021-05-25 03:37:55 +0000 Commit: Colin Percival CommitDate: 2021-06-01 00:54:08 +0000 taskqueue: Add missing comma to TASKQUEUE_FAST_DEFINE_THREAD Add missing comma to TASKQUEUE_FAST_DEFINE_THREAD arguments to prevent compilation errors. Submitted by: ashafer_badland.io (cherry picked from commit 27f09959d5f507465cc7f202c1b34987f0cdee55) --- sys/sys/taskqueue.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/taskqueue.h b/sys/sys/taskqueue.h index f0cc00af986e..7e59187e0114 100644 --- a/sys/sys/taskqueue.h +++ b/sys/sys/taskqueue.h @@ -191,7 +191,7 @@ SYSINIT(taskqueue_##name, SI_SUB_TASKQ, SI_ORDER_SECOND, \ struct __hack #define TASKQUEUE_FAST_DEFINE_THREAD(name) \ TASKQUEUE_FAST_DEFINE(name, taskqueue_thread_enqueue, \ - &taskqueue_##name, taskqueue_start_threads(&taskqueue_##name \ + &taskqueue_##name, taskqueue_start_threads(&taskqueue_##name, \ 1, PWAIT, "%s taskq", #name)) /* From owner-dev-commits-src-branches@freebsd.org Tue Jun 1 00:55:44 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A9A82634CA7; Tue, 1 Jun 2021 00:55:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FvDH44NpTz3k9C; Tue, 1 Jun 2021 00:55:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7E8421A41E; Tue, 1 Jun 2021 00:55:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1510tinP085151; Tue, 1 Jun 2021 00:55:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1510tivr085150; Tue, 1 Jun 2021 00:55:44 GMT (envelope-from git) Date: Tue, 1 Jun 2021 00:55:44 GMT Message-Id: <202106010055.1510tivr085150@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: fb790567cc9a - stable/12 - taskqueue: Add missing comma to TASKQUEUE_FAST_DEFINE_THREAD MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: fb790567cc9a05d6661109e161c4d01cd5006ca2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jun 2021 00:55:44 -0000 The branch stable/12 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=fb790567cc9a05d6661109e161c4d01cd5006ca2 commit fb790567cc9a05d6661109e161c4d01cd5006ca2 Author: Colin Percival AuthorDate: 2021-05-25 03:37:55 +0000 Commit: Colin Percival CommitDate: 2021-06-01 00:55:32 +0000 taskqueue: Add missing comma to TASKQUEUE_FAST_DEFINE_THREAD Add missing comma to TASKQUEUE_FAST_DEFINE_THREAD arguments to prevent compilation errors. Submitted by: ashafer_badland.io (cherry picked from commit 27f09959d5f507465cc7f202c1b34987f0cdee55) --- sys/sys/taskqueue.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/taskqueue.h b/sys/sys/taskqueue.h index 3f7ff1f529a7..44ef15bb100f 100644 --- a/sys/sys/taskqueue.h +++ b/sys/sys/taskqueue.h @@ -186,7 +186,7 @@ SYSINIT(taskqueue_##name, SI_SUB_TASKQ, SI_ORDER_SECOND, \ struct __hack #define TASKQUEUE_FAST_DEFINE_THREAD(name) \ TASKQUEUE_FAST_DEFINE(name, taskqueue_thread_enqueue, \ - &taskqueue_##name, taskqueue_start_threads(&taskqueue_##name \ + &taskqueue_##name, taskqueue_start_threads(&taskqueue_##name, \ 1, PWAIT, "%s taskq", #name)) /* From owner-dev-commits-src-branches@freebsd.org Tue Jun 1 00:57:02 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A271B634DE3; Tue, 1 Jun 2021 00:57:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FvDJZ4D1dz3k9Q; Tue, 1 Jun 2021 00:57:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 78F311A605; Tue, 1 Jun 2021 00:57:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1510v2Cl085360; Tue, 1 Jun 2021 00:57:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1510v2Vg085359; Tue, 1 Jun 2021 00:57:02 GMT (envelope-from git) Date: Tue, 1 Jun 2021 00:57:02 GMT Message-Id: <202106010057.1510v2Vg085359@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: 3a5f854f458d - stable/11 - taskqueue: Add missing comma to TASKQUEUE_FAST_DEFINE_THREAD MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/stable/11 X-Git-Reftype: branch X-Git-Commit: 3a5f854f458d4daeb2abdeb9077aa67058e93ea6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jun 2021 00:57:02 -0000 The branch stable/11 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=3a5f854f458d4daeb2abdeb9077aa67058e93ea6 commit 3a5f854f458d4daeb2abdeb9077aa67058e93ea6 Author: Colin Percival AuthorDate: 2021-05-25 03:37:55 +0000 Commit: Colin Percival CommitDate: 2021-06-01 00:56:48 +0000 taskqueue: Add missing comma to TASKQUEUE_FAST_DEFINE_THREAD Add missing comma to TASKQUEUE_FAST_DEFINE_THREAD arguments to prevent compilation errors. Submitted by: ashafer_badland.io (cherry picked from commit 27f09959d5f507465cc7f202c1b34987f0cdee55) --- sys/sys/taskqueue.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/taskqueue.h b/sys/sys/taskqueue.h index 9aff621206d6..641a252672cb 100644 --- a/sys/sys/taskqueue.h +++ b/sys/sys/taskqueue.h @@ -181,7 +181,7 @@ SYSINIT(taskqueue_##name, SI_SUB_TASKQ, SI_ORDER_SECOND, \ struct __hack #define TASKQUEUE_FAST_DEFINE_THREAD(name) \ TASKQUEUE_FAST_DEFINE(name, taskqueue_thread_enqueue, \ - &taskqueue_##name, taskqueue_start_threads(&taskqueue_##name \ + &taskqueue_##name, taskqueue_start_threads(&taskqueue_##name, \ 1, PWAIT, "%s taskq", #name)) /* From owner-dev-commits-src-branches@freebsd.org Tue Jun 1 01:32:18 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0F28E636BF5; Tue, 1 Jun 2021 01:32:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FvF5F74Qnz3npp; Tue, 1 Jun 2021 01:32:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DB1021AA37; Tue, 1 Jun 2021 01:32:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1511WHjM038562; Tue, 1 Jun 2021 01:32:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1511WH8V038561; Tue, 1 Jun 2021 01:32:17 GMT (envelope-from git) Date: Tue, 1 Jun 2021 01:32:17 GMT Message-Id: <202106010132.1511WH8V038561@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 4ce25ce4776f - stable/13 - nfsd: Reduce the callback timeout to 800msec MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4ce25ce4776fd4b4d62aaa11beee69d74192612e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jun 2021 01:32:18 -0000 The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=4ce25ce4776fd4b4d62aaa11beee69d74192612e commit 4ce25ce4776fd4b4d62aaa11beee69d74192612e Author: Rick Macklem AuthorDate: 2021-05-18 23:17:58 +0000 Commit: Rick Macklem CommitDate: 2021-06-01 01:29:03 +0000 nfsd: Reduce the callback timeout to 800msec Recent discussion on the nfsv4@ietf.org mailing list confirmed that an NFSv4 server should reply to an RPC in less than 1second. If an NFSv4 RPC requires a delegation be recalled, the server will attempt a CB_RECALL callback. If the client is not responsive, the RPC reply will be delayed until the callback times out. Without this patch, the timeout is set to 4 seconds (set in ticks, but used as seconds), resulting in the RPC reply taking over 4sec. This patch redefines the constant as being in milliseconds and it implements that for a value of 800msec, to ensure the RPC reply is sent in less than 1second. This patch only affects mounts from clients when delegations are enabled on the server and the client is unresponsive to callbacks. (cherry picked from commit fc0dc94029df8150301b925bda690b20d9d0bcbf) --- sys/fs/nfs/nfs.h | 2 +- sys/fs/nfs/nfs_commonkrpc.c | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/sys/fs/nfs/nfs.h b/sys/fs/nfs/nfs.h index 44b6042a2ce7..272b8dbfee22 100644 --- a/sys/fs/nfs/nfs.h +++ b/sys/fs/nfs/nfs.h @@ -50,7 +50,7 @@ #define NFS_MAXRCVTIMEO 60 /* 1 minute in seconds */ #define NFS_MINIDEMTIMEO (5 * NFS_HZ) /* Min timeout for non-idempotent ops*/ #define NFS_MAXREXMIT 100 /* Stop counting after this many */ -#define NFSV4_CALLBACKTIMEO (2 * NFS_HZ) /* Timeout in ticks */ +#define NFSV4_CALLBACKTIMEO 800 /* Timeout in msec */ #define NFSV4_CALLBACKRETRY 5 /* Number of retries before failure */ #define NFSV4_SLOTS 64 /* Number of slots, fore channel */ #define NFSV4_CBSLOTS 8 /* Number of slots, back channel */ diff --git a/sys/fs/nfs/nfs_commonkrpc.c b/sys/fs/nfs/nfs_commonkrpc.c index 49c68da45a69..04ef04955ce0 100644 --- a/sys/fs/nfs/nfs_commonkrpc.c +++ b/sys/fs/nfs/nfs_commonkrpc.c @@ -767,11 +767,13 @@ tryagain: * use the same xid. */ if (nmp == NULL) { - timo.tv_usec = 0; - if (clp == NULL) + if (clp == NULL) { timo.tv_sec = NFSV4_UPCALLTIMEO; - else - timo.tv_sec = NFSV4_CALLBACKTIMEO; + timo.tv_usec = 0; + } else { + timo.tv_sec = NFSV4_CALLBACKTIMEO / 1000; + timo.tv_usec = NFSV4_CALLBACKTIMEO * 1000; + } } else { if (nrp->nr_sotype != SOCK_DGRAM) { timo.tv_usec = 0; From owner-dev-commits-src-branches@freebsd.org Tue Jun 1 01:37:59 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C2130636E94; Tue, 1 Jun 2021 01:37: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 4FvFCq54wwz3p2P; Tue, 1 Jun 2021 01:37:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 96A911AB55; Tue, 1 Jun 2021 01:37:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1511bxq4039085; Tue, 1 Jun 2021 01:37:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1511bxgA039084; Tue, 1 Jun 2021 01:37:59 GMT (envelope-from git) Date: Tue, 1 Jun 2021 01:37:59 GMT Message-Id: <202106010137.1511bxgA039084@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 628d207646a8 - stable/13 - nfsd: Add support for CLAIM_DELEG_CUR_FH to the NFSv4.1/4.2 Open MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 628d207646a8f243f9dfd34770487bad0b7a06ef Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jun 2021 01:37:59 -0000 The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=628d207646a8f243f9dfd34770487bad0b7a06ef commit 628d207646a8f243f9dfd34770487bad0b7a06ef Author: Rick Macklem AuthorDate: 2021-05-18 22:53:54 +0000 Commit: Rick Macklem CommitDate: 2021-06-01 01:34:47 +0000 nfsd: Add support for CLAIM_DELEG_CUR_FH to the NFSv4.1/4.2 Open The Linux NFSv4.1/4.2 client now uses the CLAIM_DELEG_CUR_FH variant of the Open operation when delegations are recalled and the client has a local open of the file. This patch adds support for this variant of Open to the NFSv4.1/4.2 server. This patch only affects mounts from Linux clients when delegations are enabled on the server. (cherry picked from commit b3d4c70dc60f1913f2363751b905b562c39ca126) --- sys/fs/nfsserver/nfs_nfsdserv.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/fs/nfsserver/nfs_nfsdserv.c b/sys/fs/nfsserver/nfs_nfsdserv.c index 8aa39e5018d9..5d6cac23b722 100644 --- a/sys/fs/nfsserver/nfs_nfsdserv.c +++ b/sys/fs/nfsserver/nfs_nfsdserv.c @@ -2981,7 +2981,8 @@ nfsrvd_open(struct nfsrv_descript *nd, __unused int isdgram, */ NFSM_DISSECT(tl, u_int32_t *, NFSX_UNSIGNED); claim = fxdr_unsigned(int, *tl); - if (claim == NFSV4OPEN_CLAIMDELEGATECUR) { + if (claim == NFSV4OPEN_CLAIMDELEGATECUR || claim == + NFSV4OPEN_CLAIMDELEGATECURFH) { NFSM_DISSECT(tl, u_int32_t *, NFSX_STATEID); stateid.seqid = fxdr_unsigned(u_int32_t, *tl++); NFSBCOPY((caddr_t)tl,(caddr_t)stateid.other,NFSX_STATEIDOTHER); @@ -3056,7 +3057,7 @@ nfsrvd_open(struct nfsrv_descript *nd, __unused int isdgram, &exclusive_flag, &nva, cverf, create, aclp, &attrbits, nd->nd_cred, exp, &vp); } else if (claim == NFSV4OPEN_CLAIMPREVIOUS || claim == - NFSV4OPEN_CLAIMFH) { + NFSV4OPEN_CLAIMFH || claim == NFSV4OPEN_CLAIMDELEGATECURFH) { if (claim == NFSV4OPEN_CLAIMPREVIOUS) { NFSM_DISSECT(tl, u_int32_t *, NFSX_UNSIGNED); i = fxdr_unsigned(int, *tl); @@ -3074,7 +3075,6 @@ nfsrvd_open(struct nfsrv_descript *nd, __unused int isdgram, } stp->ls_flags |= NFSLCK_RECLAIM; } else { - /* CLAIM_NULL_FH */ if (nd->nd_repstat == 0 && create == NFSV4OPEN_CREATE) nd->nd_repstat = NFSERR_INVAL; } From owner-dev-commits-src-branches@freebsd.org Tue Jun 1 01:42:25 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 833246369DB; Tue, 1 Jun 2021 01:42:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FvFJx3Kd4z3pM4; Tue, 1 Jun 2021 01:42:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5A71E1AF9C; Tue, 1 Jun 2021 01:42:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1511gPku051787; Tue, 1 Jun 2021 01:42:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1511gPZ6051786; Tue, 1 Jun 2021 01:42:25 GMT (envelope-from git) Date: Tue, 1 Jun 2021 01:42:25 GMT Message-Id: <202106010142.1511gPZ6051786@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: a604806bf73f - stable/12 - nfsd: Reduce the callback timeout to 800msec MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: a604806bf73fdac21485bcb14ac6d56cb66b5210 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jun 2021 01:42:25 -0000 The branch stable/12 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=a604806bf73fdac21485bcb14ac6d56cb66b5210 commit a604806bf73fdac21485bcb14ac6d56cb66b5210 Author: Rick Macklem AuthorDate: 2021-05-18 23:17:58 +0000 Commit: Rick Macklem CommitDate: 2021-06-01 01:39:27 +0000 nfsd: Reduce the callback timeout to 800msec Recent discussion on the nfsv4@ietf.org mailing list confirmed that an NFSv4 server should reply to an RPC in less than 1second. If an NFSv4 RPC requires a delegation be recalled, the server will attempt a CB_RECALL callback. If the client is not responsive, the RPC reply will be delayed until the callback times out. Without this patch, the timeout is set to 4 seconds (set in ticks, but used as seconds), resulting in the RPC reply taking over 4sec. This patch redefines the constant as being in milliseconds and it implements that for a value of 800msec, to ensure the RPC reply is sent in less than 1second. This patch only affects mounts from clients when delegations are enabled on the server and the client is unresponsive to callbacks. (cherry picked from commit fc0dc94029df8150301b925bda690b20d9d0bcbf) --- sys/fs/nfs/nfs.h | 2 +- sys/fs/nfs/nfs_commonkrpc.c | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/sys/fs/nfs/nfs.h b/sys/fs/nfs/nfs.h index c6fb59fa6b64..de35f40f40d0 100644 --- a/sys/fs/nfs/nfs.h +++ b/sys/fs/nfs/nfs.h @@ -50,7 +50,7 @@ #define NFS_MAXRCVTIMEO 60 /* 1 minute in seconds */ #define NFS_MINIDEMTIMEO (5 * NFS_HZ) /* Min timeout for non-idempotent ops*/ #define NFS_MAXREXMIT 100 /* Stop counting after this many */ -#define NFSV4_CALLBACKTIMEO (2 * NFS_HZ) /* Timeout in ticks */ +#define NFSV4_CALLBACKTIMEO 800 /* Timeout in msec */ #define NFSV4_CALLBACKRETRY 5 /* Number of retries before failure */ #define NFSV4_SLOTS 64 /* Number of slots, fore channel */ #define NFSV4_CBSLOTS 8 /* Number of slots, back channel */ diff --git a/sys/fs/nfs/nfs_commonkrpc.c b/sys/fs/nfs/nfs_commonkrpc.c index b6fe49b8e470..d583b1c80c3c 100644 --- a/sys/fs/nfs/nfs_commonkrpc.c +++ b/sys/fs/nfs/nfs_commonkrpc.c @@ -762,11 +762,13 @@ tryagain: * use the same xid. */ if (nmp == NULL) { - timo.tv_usec = 0; - if (clp == NULL) + if (clp == NULL) { timo.tv_sec = NFSV4_UPCALLTIMEO; - else - timo.tv_sec = NFSV4_CALLBACKTIMEO; + timo.tv_usec = 0; + } else { + timo.tv_sec = NFSV4_CALLBACKTIMEO / 1000; + timo.tv_usec = NFSV4_CALLBACKTIMEO * 1000; + } } else { if (nrp->nr_sotype != SOCK_DGRAM) { timo.tv_usec = 0; From owner-dev-commits-src-branches@freebsd.org Tue Jun 1 01:44:08 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5E7AB636FE2; Tue, 1 Jun 2021 01:44: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 4FvFLw27xTz3p1H; Tue, 1 Jun 2021 01:44:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 31D3D1ACAA; Tue, 1 Jun 2021 01:44:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1511i8Mb052014; Tue, 1 Jun 2021 01:44:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1511i8rY052013; Tue, 1 Jun 2021 01:44:08 GMT (envelope-from git) Date: Tue, 1 Jun 2021 01:44:08 GMT Message-Id: <202106010144.1511i8rY052013@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 2f6ce1167391 - stable/12 - nfsd: Add support for CLAIM_DELEG_CUR_FH to the NFSv4.1/4.2 Open MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 2f6ce1167391e8b1883bccc98f60b129fec4a9e3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jun 2021 01:44:08 -0000 The branch stable/12 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=2f6ce1167391e8b1883bccc98f60b129fec4a9e3 commit 2f6ce1167391e8b1883bccc98f60b129fec4a9e3 Author: Rick Macklem AuthorDate: 2021-05-18 22:53:54 +0000 Commit: Rick Macklem CommitDate: 2021-06-01 01:41:08 +0000 nfsd: Add support for CLAIM_DELEG_CUR_FH to the NFSv4.1/4.2 Open The Linux NFSv4.1/4.2 client now uses the CLAIM_DELEG_CUR_FH variant of the Open operation when delegations are recalled and the client has a local open of the file. This patch adds support for this variant of Open to the NFSv4.1/4.2 server. This patch only affects mounts from Linux clients when delegations are enabled on the server. (cherry picked from commit b3d4c70dc60f1913f2363751b905b562c39ca126) --- sys/fs/nfsserver/nfs_nfsdserv.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/fs/nfsserver/nfs_nfsdserv.c b/sys/fs/nfsserver/nfs_nfsdserv.c index f667b1f88e86..4aa009b345fe 100644 --- a/sys/fs/nfsserver/nfs_nfsdserv.c +++ b/sys/fs/nfsserver/nfs_nfsdserv.c @@ -2913,7 +2913,8 @@ nfsrvd_open(struct nfsrv_descript *nd, __unused int isdgram, */ NFSM_DISSECT(tl, u_int32_t *, NFSX_UNSIGNED); claim = fxdr_unsigned(int, *tl); - if (claim == NFSV4OPEN_CLAIMDELEGATECUR) { + if (claim == NFSV4OPEN_CLAIMDELEGATECUR || claim == + NFSV4OPEN_CLAIMDELEGATECURFH) { NFSM_DISSECT(tl, u_int32_t *, NFSX_STATEID); stateid.seqid = fxdr_unsigned(u_int32_t, *tl++); NFSBCOPY((caddr_t)tl,(caddr_t)stateid.other,NFSX_STATEIDOTHER); @@ -2988,7 +2989,7 @@ nfsrvd_open(struct nfsrv_descript *nd, __unused int isdgram, &exclusive_flag, &nva, cverf, create, aclp, &attrbits, nd->nd_cred, p, exp, &vp); } else if (claim == NFSV4OPEN_CLAIMPREVIOUS || claim == - NFSV4OPEN_CLAIMFH) { + NFSV4OPEN_CLAIMFH || claim == NFSV4OPEN_CLAIMDELEGATECURFH) { if (claim == NFSV4OPEN_CLAIMPREVIOUS) { NFSM_DISSECT(tl, u_int32_t *, NFSX_UNSIGNED); i = fxdr_unsigned(int, *tl); @@ -3006,7 +3007,6 @@ nfsrvd_open(struct nfsrv_descript *nd, __unused int isdgram, } stp->ls_flags |= NFSLCK_RECLAIM; } else { - /* CLAIM_NULL_FH */ if (nd->nd_repstat == 0 && create == NFSV4OPEN_CREATE) nd->nd_repstat = NFSERR_INVAL; } From owner-dev-commits-src-branches@freebsd.org Tue Jun 1 05:34:34 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E64FC641AF6; Tue, 1 Jun 2021 05:34:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FvLSp4S05z3HxW; Tue, 1 Jun 2021 05:34:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8115E1E207; Tue, 1 Jun 2021 05:34:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1515YYQo057710; Tue, 1 Jun 2021 05:34:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1515YY87057709; Tue, 1 Jun 2021 05:34:34 GMT (envelope-from git) Date: Tue, 1 Jun 2021 05:34:34 GMT Message-Id: <202106010534.1515YY87057709@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: e303e19dfc0d - stable/12 - DRIVER_MODULE(9): Correct the SYNOPSIS of EARLY_DRIVER_MODULE() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: e303e19dfc0d2fd94301f213e8f7be1dcf597dc2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jun 2021 05:34:35 -0000 The branch stable/12 has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=e303e19dfc0d2fd94301f213e8f7be1dcf597dc2 commit e303e19dfc0d2fd94301f213e8f7be1dcf597dc2 Author: J.R. Oldroyd AuthorDate: 2021-05-24 14:54:45 +0000 Commit: Gordon Bergling CommitDate: 2021-06-01 05:34:07 +0000 DRIVER_MODULE(9): Correct the SYNOPSIS of EARLY_DRIVER_MODULE() The man page SYNOPSIS for EARLY_DRIVER_MODULE() shows that it has an "enum sysinit_elem_order order" argument. The actual macro in sys/bus.h does not have an order argument. PR: 256103 Reported by: J.R. Oldroyd Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D30411 (cherry picked from commit 3fdd5c1e49cbc0a77935eb34e3561c6021b93650) --- share/man/man9/DRIVER_MODULE.9 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/man/man9/DRIVER_MODULE.9 b/share/man/man9/DRIVER_MODULE.9 index 8792e8930424..5d5927fba1e8 100644 --- a/share/man/man9/DRIVER_MODULE.9 +++ b/share/man/man9/DRIVER_MODULE.9 @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 12, 2018 +.Dd May 24, 2021 .Dt DRIVER_MODULE 9 .Os .Sh NAME @@ -44,7 +44,7 @@ .In sys/module.h .Fn DRIVER_MODULE name busname "driver_t driver" "devclass_t devclass" "modeventhand_t evh" "void *arg" .Fn DRIVER_MODULE_ORDERED name busname "driver_t driver" "devclass_t devclass" "modeventhand_t evh" "void *arg" "int order" -.Fn EARLY_DRIVER_MODULE name busname "driver_t driver" "devclass_t devclass" "modeventhand_t evh" "void *arg" "enum sysinit_elem_order order" "int pass" +.Fn EARLY_DRIVER_MODULE name busname "driver_t driver" "devclass_t devclass" "modeventhand_t evh" "void *arg" "int pass" .Fn EARLY_DRIVER_MODULE_ORDERED name busname "driver_t driver" "devclass_t devclass" "modeventhand_t evh" "void *arg" "enum sysinit_elem_order order" "int pass" .Sh DESCRIPTION The From owner-dev-commits-src-branches@freebsd.org Tue Jun 1 05:33:30 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9C4206417FE; Tue, 1 Jun 2021 05:33: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 4FvLRZ43ckz3Hpc; Tue, 1 Jun 2021 05:33:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 738231E029; Tue, 1 Jun 2021 05:33:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1515XUkh057506; Tue, 1 Jun 2021 05:33:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1515XUdR057505; Tue, 1 Jun 2021 05:33:30 GMT (envelope-from git) Date: Tue, 1 Jun 2021 05:33:30 GMT Message-Id: <202106010533.1515XUdR057505@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: fe0ff38bf157 - stable/13 - DRIVER_MODULE(9): Correct the SYNOPSIS of EARLY_DRIVER_MODULE() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: fe0ff38bf1570936a7155d6dbae97aaaba3b667f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jun 2021 05:33:30 -0000 The branch stable/13 has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=fe0ff38bf1570936a7155d6dbae97aaaba3b667f commit fe0ff38bf1570936a7155d6dbae97aaaba3b667f Author: J.R. Oldroyd AuthorDate: 2021-05-24 14:54:45 +0000 Commit: Gordon Bergling CommitDate: 2021-06-01 05:32:48 +0000 DRIVER_MODULE(9): Correct the SYNOPSIS of EARLY_DRIVER_MODULE() The man page SYNOPSIS for EARLY_DRIVER_MODULE() shows that it has an "enum sysinit_elem_order order" argument. The actual macro in sys/bus.h does not have an order argument. PR: 256103 Reported by: J.R. Oldroyd Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D30411 (cherry picked from commit 3fdd5c1e49cbc0a77935eb34e3561c6021b93650) --- share/man/man9/DRIVER_MODULE.9 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/man/man9/DRIVER_MODULE.9 b/share/man/man9/DRIVER_MODULE.9 index 8792e8930424..5d5927fba1e8 100644 --- a/share/man/man9/DRIVER_MODULE.9 +++ b/share/man/man9/DRIVER_MODULE.9 @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 12, 2018 +.Dd May 24, 2021 .Dt DRIVER_MODULE 9 .Os .Sh NAME @@ -44,7 +44,7 @@ .In sys/module.h .Fn DRIVER_MODULE name busname "driver_t driver" "devclass_t devclass" "modeventhand_t evh" "void *arg" .Fn DRIVER_MODULE_ORDERED name busname "driver_t driver" "devclass_t devclass" "modeventhand_t evh" "void *arg" "int order" -.Fn EARLY_DRIVER_MODULE name busname "driver_t driver" "devclass_t devclass" "modeventhand_t evh" "void *arg" "enum sysinit_elem_order order" "int pass" +.Fn EARLY_DRIVER_MODULE name busname "driver_t driver" "devclass_t devclass" "modeventhand_t evh" "void *arg" "int pass" .Fn EARLY_DRIVER_MODULE_ORDERED name busname "driver_t driver" "devclass_t devclass" "modeventhand_t evh" "void *arg" "enum sysinit_elem_order order" "int pass" .Sh DESCRIPTION The From owner-dev-commits-src-branches@freebsd.org Tue Jun 1 10:02:29 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1DDE664FBFB; Tue, 1 Jun 2021 10:02: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 4FvSPx0L8lz4cpJ; Tue, 1 Jun 2021 10:02:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E7EE321D50; Tue, 1 Jun 2021 10:02:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 151A2SW7019070; Tue, 1 Jun 2021 10:02:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 151A2SgJ019069; Tue, 1 Jun 2021 10:02:28 GMT (envelope-from git) Date: Tue, 1 Jun 2021 10:02:28 GMT Message-Id: <202106011002.151A2SgJ019069@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: 9394c3fcdbd7 - stable/13 - run(4): add support for ASUS USB-N14 wireless adaptor. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 9394c3fcdbd7707e55c677cef9a3d029f7da5189 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jun 2021 10:02:29 -0000 The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=9394c3fcdbd7707e55c677cef9a3d029f7da5189 commit 9394c3fcdbd7707e55c677cef9a3d029f7da5189 Author: Dmitry Chagin AuthorDate: 2021-05-22 10:52:12 +0000 Commit: Dmitry Chagin CommitDate: 2021-06-01 10:01:53 +0000 run(4): add support for ASUS USB-N14 wireless adaptor. PR: 255759 Submitted by: john.lmurdoch at gmail.com (cherry picked from commit d6fd321ef60d43dce9f437187c94a7de2b91ab69) --- sys/dev/usb/usbdevs | 1 + sys/dev/usb/wlan/if_run.c | 1 + 2 files changed, 2 insertions(+) diff --git a/sys/dev/usb/usbdevs b/sys/dev/usb/usbdevs index 6012f6484d52..c2a1a9ff31e6 100644 --- a/sys/dev/usb/usbdevs +++ b/sys/dev/usb/usbdevs @@ -1266,6 +1266,7 @@ product ASUS USBN66 0x17ad USB-N66 product ASUS USBN10NANO 0x17ba USB-N10 Nano product ASUS USBAC51 0x17d1 USB-AC51 product ASUS USBAC56 0x17d2 USB-AC56 +product ASUS USBN14 0x17e8 USB-N14 product ASUS A730W 0x4202 ASUS MyPal A730W product ASUS P535 0x420f ASUS P535 PDA product ASUS GMSC 0x422f ASUS Generic Mass Storage diff --git a/sys/dev/usb/wlan/if_run.c b/sys/dev/usb/wlan/if_run.c index dbbdc9bdcbd2..c7f0ae40f666 100644 --- a/sys/dev/usb/wlan/if_run.c +++ b/sys/dev/usb/wlan/if_run.c @@ -173,6 +173,7 @@ static const STRUCT_USB_HOST_ID run_devs[] = { RUN_DEV(ASUS, RT3070_1), RUN_DEV(ASUS, USBN66), RUN_DEV(ASUS, USB_N53), + RUN_DEV(ASUS, USBN14), RUN_DEV(ASUS2, USBN11), RUN_DEV(AZUREWAVE, RT2870_1), RUN_DEV(AZUREWAVE, RT2870_2), From owner-dev-commits-src-branches@freebsd.org Tue Jun 1 10:06:00 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7218D6504A3; Tue, 1 Jun 2021 10:06:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FvSV02lJQz4cpw; Tue, 1 Jun 2021 10:06:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 41ED621D57; Tue, 1 Jun 2021 10:06:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 151A60Mi019411; Tue, 1 Jun 2021 10:06:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 151A60Jk019410; Tue, 1 Jun 2021 10:06:00 GMT (envelope-from git) Date: Tue, 1 Jun 2021 10:06:00 GMT Message-Id: <202106011006.151A60Jk019410@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: b10d52e54915 - stable/13 - run(4): fix manual after d6fd321ef60d43dce9f437187c94a7de2b91ab69. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b10d52e549154d5cf52531c5c6f2994d548e282c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jun 2021 10:06:00 -0000 The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=b10d52e549154d5cf52531c5c6f2994d548e282c commit b10d52e549154d5cf52531c5c6f2994d548e282c Author: Dmitry Chagin AuthorDate: 2021-05-23 13:35:31 +0000 Commit: Dmitry Chagin CommitDate: 2021-06-01 10:05:41 +0000 run(4): fix manual after d6fd321ef60d43dce9f437187c94a7de2b91ab69. PR: 255759 (cherry picked from commit 43f5d5bf01fdf821e8037272c636a9be18323e00) --- share/man/man4/run.4 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/share/man/man4/run.4 b/share/man/man4/run.4 index b95a346f9697..ad314ff67011 100644 --- a/share/man/man4/run.4 +++ b/share/man/man4/run.4 @@ -16,7 +16,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 16, 2020 +.Dd May 23, 2021 .Dt RUN 4 .Os .Sh NAME @@ -125,6 +125,7 @@ driver supports the following wireless adapters: .It Airlink101 AWLL6090 .It ASUS USB-N11 .It ASUS USB-N13 ver. A1 +.It ASUS USB-N14 .It ASUS USB-N66 .It ASUS WL-160N .It Belkin F5D8051 ver 3000 From owner-dev-commits-src-branches@freebsd.org Tue Jun 1 10:07:34 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DBDDF650784; Tue, 1 Jun 2021 10:07:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FvSWp5Sxdz4d45; Tue, 1 Jun 2021 10:07:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A330F21CC0; Tue, 1 Jun 2021 10:07:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 151A7Y60019636; Tue, 1 Jun 2021 10:07:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 151A7Yc8019635; Tue, 1 Jun 2021 10:07:34 GMT (envelope-from git) Date: Tue, 1 Jun 2021 10:07:34 GMT Message-Id: <202106011007.151A7Yc8019635@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: 6c423a0fbc2e - stable/12 - run(4): add support for ASUS USB-N14 wireless adaptor. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 6c423a0fbc2ead8489c12c4c09d67cb7c09d7afe Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jun 2021 10:07:34 -0000 The branch stable/12 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=6c423a0fbc2ead8489c12c4c09d67cb7c09d7afe commit 6c423a0fbc2ead8489c12c4c09d67cb7c09d7afe Author: Dmitry Chagin AuthorDate: 2021-05-22 10:52:12 +0000 Commit: Dmitry Chagin CommitDate: 2021-06-01 10:03:56 +0000 run(4): add support for ASUS USB-N14 wireless adaptor. PR: 255759 Submitted by: john.lmurdoch at gmail.com (cherry picked from commit d6fd321ef60d43dce9f437187c94a7de2b91ab69) --- sys/dev/usb/usbdevs | 1 + sys/dev/usb/wlan/if_run.c | 1 + 2 files changed, 2 insertions(+) diff --git a/sys/dev/usb/usbdevs b/sys/dev/usb/usbdevs index 84508657b6ef..db08e8e71d4b 100644 --- a/sys/dev/usb/usbdevs +++ b/sys/dev/usb/usbdevs @@ -1267,6 +1267,7 @@ product ASUS USBN66 0x17ad USB-N66 product ASUS USBN10NANO 0x17ba USB-N10 Nano product ASUS USBAC51 0x17d1 USB-AC51 product ASUS USBAC56 0x17d2 USB-AC56 +product ASUS USBN14 0x17e8 USB-N14 product ASUS A730W 0x4202 ASUS MyPal A730W product ASUS P535 0x420f ASUS P535 PDA product ASUS GMSC 0x422f ASUS Generic Mass Storage diff --git a/sys/dev/usb/wlan/if_run.c b/sys/dev/usb/wlan/if_run.c index 9eb261274b62..edee3eaa863b 100644 --- a/sys/dev/usb/wlan/if_run.c +++ b/sys/dev/usb/wlan/if_run.c @@ -171,6 +171,7 @@ static const STRUCT_USB_HOST_ID run_devs[] = { RUN_DEV(ASUS, RT3070_1), RUN_DEV(ASUS, USBN66), RUN_DEV(ASUS, USB_N53), + RUN_DEV(ASUS, USBN14), RUN_DEV(ASUS2, USBN11), RUN_DEV(AZUREWAVE, RT2870_1), RUN_DEV(AZUREWAVE, RT2870_2), From owner-dev-commits-src-branches@freebsd.org Tue Jun 1 10:07:35 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DB9DD6504BE; Tue, 1 Jun 2021 10:07:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FvSWq5ldZz4cqB; Tue, 1 Jun 2021 10:07:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AD321215E5; Tue, 1 Jun 2021 10:07:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 151A7ZNE019657; Tue, 1 Jun 2021 10:07:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 151A7ZEs019656; Tue, 1 Jun 2021 10:07:35 GMT (envelope-from git) Date: Tue, 1 Jun 2021 10:07:35 GMT Message-Id: <202106011007.151A7ZEs019656@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: 434ffdacd556 - stable/12 - run(4): fix manual after d6fd321ef60d43dce9f437187c94a7de2b91ab69. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 434ffdacd556645f059b8025b19a0339b54fc373 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jun 2021 10:07:35 -0000 The branch stable/12 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=434ffdacd556645f059b8025b19a0339b54fc373 commit 434ffdacd556645f059b8025b19a0339b54fc373 Author: Dmitry Chagin AuthorDate: 2021-05-23 13:35:31 +0000 Commit: Dmitry Chagin CommitDate: 2021-06-01 10:07:16 +0000 run(4): fix manual after d6fd321ef60d43dce9f437187c94a7de2b91ab69. PR: 255759 (cherry picked from commit 43f5d5bf01fdf821e8037272c636a9be18323e00) --- share/man/man4/run.4 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/share/man/man4/run.4 b/share/man/man4/run.4 index b95a346f9697..ad314ff67011 100644 --- a/share/man/man4/run.4 +++ b/share/man/man4/run.4 @@ -16,7 +16,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 16, 2020 +.Dd May 23, 2021 .Dt RUN 4 .Os .Sh NAME @@ -125,6 +125,7 @@ driver supports the following wireless adapters: .It Airlink101 AWLL6090 .It ASUS USB-N11 .It ASUS USB-N13 ver. A1 +.It ASUS USB-N14 .It ASUS USB-N66 .It ASUS WL-160N .It Belkin F5D8051 ver 3000 From owner-dev-commits-src-branches@freebsd.org Tue Jun 1 10:36:00 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 321D26509BA; Tue, 1 Jun 2021 10:36:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FvT8c0fhwz4gdL; Tue, 1 Jun 2021 10:36:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F2BD82230C; Tue, 1 Jun 2021 10:35:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 151AZxCR058750; Tue, 1 Jun 2021 10:35:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 151AZxI7058749; Tue, 1 Jun 2021 10:35:59 GMT (envelope-from git) Date: Tue, 1 Jun 2021 10:35:59 GMT Message-Id: <202106011035.151AZxI7058749@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: =?utf-8?B?U3RlZmFuIEXDn2Vy?= Subject: git: d5e31f13593e - stable/13 - contrib/bc: update to version 4.0.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: se X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d5e31f13593e53bcd1378441080517cd43895619 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jun 2021 10:36:00 -0000 The branch stable/13 has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=d5e31f13593e53bcd1378441080517cd43895619 commit d5e31f13593e53bcd1378441080517cd43895619 Author: Stefan Eßer AuthorDate: 2021-04-29 12:29:04 +0000 Commit: Stefan Eßer CommitDate: 2021-06-01 10:35:28 +0000 contrib/bc: update to version 4.0.1 This update adds a flush() of the output buffer to the bc print command. (cherry picked from commit 8ea9013512494c9f035afa1ffa1e199b44c7904f) Synch index of contrib/bc with what is in workdir after cloning. From a workdir perspective this should be a no-op. See also: https://lists.freebsd.org/pipermail/freebsd-current/2021-April/079569.html (cherry picked from commit a0358e3d5184950b4316f105eb292cbafdea208b) --- contrib/bc/.gitattributes | 3 + contrib/bc/.gitignore | 4 + contrib/bc/NEWS.md | 5 + contrib/bc/README.md | 4 + contrib/bc/bc.vcxproj | 554 ++++++++++++++++++++--------------------- contrib/bc/bc.vcxproj.filters | 362 +++++++++++++-------------- contrib/bc/bcl.vcxproj | 320 ++++++++++++------------ contrib/bc/bcl.vcxproj.filters | 190 +++++++------- contrib/bc/include/version.h | 2 +- contrib/bc/src/program.c | 1 + 10 files changed, 731 insertions(+), 714 deletions(-) diff --git a/contrib/bc/.gitattributes b/contrib/bc/.gitattributes new file mode 100644 index 000000000000..22d6e60bce68 --- /dev/null +++ b/contrib/bc/.gitattributes @@ -0,0 +1,3 @@ +*.vcxproj eol=crlf +*.vcxproj.filters eol=crlf +*.sln eol= crlf diff --git a/contrib/bc/.gitignore b/contrib/bc/.gitignore index 5c2bbae866c0..b131d5813764 100644 --- a/contrib/bc/.gitignore +++ b/contrib/bc/.gitignore @@ -68,3 +68,7 @@ core.* cscope*.out tags + +*.vcxproj.user +Debug/* +Release/* diff --git a/contrib/bc/NEWS.md b/contrib/bc/NEWS.md index 011cb9138912..c66e7b164c8a 100644 --- a/contrib/bc/NEWS.md +++ b/contrib/bc/NEWS.md @@ -1,5 +1,10 @@ # News +## 4.0.1 + +This is a production release that only adds one thing: flushing output when it +is printed with a print statement. + ## 4.0.0 This is a production release with many fixes, a new command-line option, and a diff --git a/contrib/bc/README.md b/contrib/bc/README.md index 852c8956a73d..f0dcecf15bde 100644 --- a/contrib/bc/README.md +++ b/contrib/bc/README.md @@ -19,6 +19,10 @@ functionality is unnecessary. For more information, see the `dc`'s full manual. +This `bc` also provides `bc`'s math as a library with C bindings, called `bcl`. + +For more information, see the full manual for `bcl`. + This `bc` is Free and Open Source Software (FOSS). It is offered under the BSD 2-clause License. Full license text may be found in the [`LICENSE.md`][4] file. diff --git a/contrib/bc/bc.vcxproj b/contrib/bc/bc.vcxproj index ba0a7f6f1dd6..2dbbd558618f 100644 --- a/contrib/bc/bc.vcxproj +++ b/contrib/bc/bc.vcxproj @@ -1,278 +1,278 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 16.0 - {D5086CFE-052C-4742-B005-E05DB983BBA2} - Win32Proj - - - - Application - true - v142 - - - Application - false - v142 - - - Application - true - v142 - - - Application - false - v142 - - - - - - - - - - - - - - - - - - - - - Building strgen - CL /Fo:$(Configuration)\$(ProjectName)\ /Fe:$(Configuration)\$(ProjectName)\strgen.exe gen\strgen.c - gen\strgen.c - $(Configuration)\$(ProjectName)\strgen.exe - - - Generating $(Configuration)\$(ProjectName)/lib.c - START $(Configuration)\$(ProjectName)/strgen gen\lib.bc $(Configuration)\$(ProjectName)/lib.c bc_lib bc_lib_name BC_ENABLED 1 - $(Configuration)\$(ProjectName)\strgen.exe;gen\lib.bc - $(Configuration)\$(ProjectName)\lib.c - - - Generating $(Configuration)\$(ProjectName)/lib2.c - START $(Configuration)\$(ProjectName)/strgen gen\lib2.bc $(Configuration)\$(ProjectName)/lib2.c bc_lib2 bc_lib2_name BC_ENABLED 1 - $(Configuration)\$(ProjectName)\strgen.exe;gen\lib2.bc - $(Configuration)\$(ProjectName)\lib2.c - - - Generating $(Configuration)\$(ProjectName)/bc_help.c - START $(Configuration)\$(ProjectName)/strgen gen\bc_help.txt $(Configuration)\$(ProjectName)\bc_help.c bc_help "" BC_ENABLED - $(Configuration)\$(ProjectName)\strgen.exe;gen\bc_help.txt - $(Configuration)\$(ProjectName)\bc_help.c - - - Generating $(Configuration)\$(ProjectName)/dc_help.c - START $(Configuration)\$(ProjectName)/strgen gen\dc_help.txt $(Configuration)\$(ProjectName)\dc_help.c dc_help "" DC_ENABLED - $(Configuration)\$(ProjectName)\strgen.exe;gen\dc_help.txt - $(Configuration)\$(ProjectName)\dc_help.c - - - - ClCompile - - - - true - $(SolutionDir)\$(Configuration)\$(ProjectName)\ - $(SolutionDir)\$(Configuration)\$(ProjectName)\ - - - false - $(SolutionDir)\$(Configuration)\$(ProjectName)\ - $(SolutionDir)\$(Configuration)\$(ProjectName)\ - - - true - $(SolutionDir)\$(Configuration)\$(ProjectName)\ - $(SolutionDir)\$(Configuration)\$(ProjectName)\ - - - false - $(SolutionDir)\$(Configuration)\$(ProjectName)\ - $(SolutionDir)\$(Configuration)\$(ProjectName)\ - - - - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions);BC_ENABLED=1;DC_ENABLED=1;BC_ENABLE_EXTRA_MATH=1;BC_ENABLE_HISTORY=0;BC_ENABLE_NLS=0;BC_ENABLE_PROMPT=1;BC_DEBUG_CODE=0;BC_ENABLE_LIBRARY=0;EXECSUFFIX=.exe;BUILD_TYPE=HN - $(SolutionDir)\include;%(AdditionalIncludeDirectories) - MultiThreadedDebugDLL - Level3 - ProgramDatabase - Disabled - false - /W3 %(AdditionalOptions) - - - MachineX86 - true - Console - kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;bcrypt.lib;ucrt.lib;%(AdditionalDependencies) - - - copy /b "$(SolutionDir)\$(Configuration)\$(ProjectName)\bc.exe" "$(SolutionDir)\$(Configuration)\$(ProjectName)\dc.exe" - - - Copying bc to dc... - - - - - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions);BC_ENABLED=1;DC_ENABLED=1;BC_ENABLE_EXTRA_MATH=1;BC_ENABLE_HISTORY=0;BC_ENABLE_NLS=0;BC_ENABLE_PROMPT=1;BC_DEBUG_CODE=0;BC_ENABLE_LIBRARY=0;EXECSUFFIX=.exe;BUILD_TYPE=HN - $(SolutionDir)\include;%(AdditionalIncludeDirectories) - MultiThreadedDLL - Level3 - ProgramDatabase - MaxSpeed - false - /W3 %(AdditionalOptions) - - - MachineX86 - false - Console - kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;bcrypt.lib;ucrt.lib;%(AdditionalDependencies) - true - true - - - copy /b "$(SolutionDir)\$(Configuration)\$(ProjectName)\bc.exe" "$(SolutionDir)\$(Configuration)\$(ProjectName)\dc.exe" - - - Copying bc to dc... - - - - - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions);BC_ENABLED=1;DC_ENABLED=1;BC_ENABLE_EXTRA_MATH=1;BC_ENABLE_HISTORY=0;BC_ENABLE_NLS=0;BC_ENABLE_PROMPT=1;BC_DEBUG_CODE=0;BC_ENABLE_LIBRARY=0;EXECSUFFIX=.exe;BUILD_TYPE=HN - $(SolutionDir)\include;%(AdditionalIncludeDirectories) - MultiThreadedDebugDLL - Level3 - ProgramDatabase - Disabled - false - /W3 %(AdditionalOptions) - - - MachineX64 - true - Console - kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;bcrypt.lib;ucrt.lib;%(AdditionalDependencies) - - - copy /b "$(SolutionDir)\$(Configuration)\$(ProjectName)\bc.exe" "$(SolutionDir)\$(Configuration)\$(ProjectName)\dc.exe" - - - Copying bc to dc... - - - - - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions);BC_ENABLED=1;DC_ENABLED=1;BC_ENABLE_EXTRA_MATH=1;BC_ENABLE_HISTORY=0;BC_ENABLE_NLS=0;BC_ENABLE_PROMPT=1;BC_DEBUG_CODE=0;BC_ENABLE_LIBRARY=0;EXECSUFFIX=.exe;BUILD_TYPE=HN - $(SolutionDir)\include;%(AdditionalIncludeDirectories) - MultiThreadedDLL - Level3 - ProgramDatabase - MaxSpeed - false - /W3 %(AdditionalOptions) - Default - - - MachineX64 - false - Console - kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;bcrypt.lib;ucrt.lib;%(AdditionalDependencies) - - - copy /b "$(SolutionDir)\$(Configuration)\$(ProjectName)\bc.exe" "$(SolutionDir)\$(Configuration)\$(ProjectName)\dc.exe" - - - Copying bc to dc... - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 16.0 + {D5086CFE-052C-4742-B005-E05DB983BBA2} + Win32Proj + + + + Application + true + v142 + + + Application + false + v142 + + + Application + true + v142 + + + Application + false + v142 + + + + + + + + + + + + + + + + + + + + + Building strgen + CL /Fo:$(Configuration)\$(ProjectName)\ /Fe:$(Configuration)\$(ProjectName)\strgen.exe gen\strgen.c + gen\strgen.c + $(Configuration)\$(ProjectName)\strgen.exe + + + Generating $(Configuration)\$(ProjectName)/lib.c + START $(Configuration)\$(ProjectName)/strgen gen\lib.bc $(Configuration)\$(ProjectName)/lib.c bc_lib bc_lib_name BC_ENABLED 1 + $(Configuration)\$(ProjectName)\strgen.exe;gen\lib.bc + $(Configuration)\$(ProjectName)\lib.c + + + Generating $(Configuration)\$(ProjectName)/lib2.c + START $(Configuration)\$(ProjectName)/strgen gen\lib2.bc $(Configuration)\$(ProjectName)/lib2.c bc_lib2 bc_lib2_name BC_ENABLED 1 + $(Configuration)\$(ProjectName)\strgen.exe;gen\lib2.bc + $(Configuration)\$(ProjectName)\lib2.c + + + Generating $(Configuration)\$(ProjectName)/bc_help.c + START $(Configuration)\$(ProjectName)/strgen gen\bc_help.txt $(Configuration)\$(ProjectName)\bc_help.c bc_help "" BC_ENABLED + $(Configuration)\$(ProjectName)\strgen.exe;gen\bc_help.txt + $(Configuration)\$(ProjectName)\bc_help.c + + + Generating $(Configuration)\$(ProjectName)/dc_help.c + START $(Configuration)\$(ProjectName)/strgen gen\dc_help.txt $(Configuration)\$(ProjectName)\dc_help.c dc_help "" DC_ENABLED + $(Configuration)\$(ProjectName)\strgen.exe;gen\dc_help.txt + $(Configuration)\$(ProjectName)\dc_help.c + + + + ClCompile + + + + true + $(SolutionDir)\$(Configuration)\$(ProjectName)\ + $(SolutionDir)\$(Configuration)\$(ProjectName)\ + + + false + $(SolutionDir)\$(Configuration)\$(ProjectName)\ + $(SolutionDir)\$(Configuration)\$(ProjectName)\ + + + true + $(SolutionDir)\$(Configuration)\$(ProjectName)\ + $(SolutionDir)\$(Configuration)\$(ProjectName)\ + + + false + $(SolutionDir)\$(Configuration)\$(ProjectName)\ + $(SolutionDir)\$(Configuration)\$(ProjectName)\ + + + + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions);BC_ENABLED=1;DC_ENABLED=1;BC_ENABLE_EXTRA_MATH=1;BC_ENABLE_HISTORY=0;BC_ENABLE_NLS=0;BC_ENABLE_PROMPT=1;BC_DEBUG_CODE=0;BC_ENABLE_LIBRARY=0;EXECSUFFIX=.exe;BUILD_TYPE=HN + $(SolutionDir)\include;%(AdditionalIncludeDirectories) + MultiThreadedDebugDLL + Level3 + ProgramDatabase + Disabled + false + /W3 %(AdditionalOptions) + + + MachineX86 + true + Console + kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;bcrypt.lib;ucrt.lib;%(AdditionalDependencies) + + + copy /b "$(SolutionDir)\$(Configuration)\$(ProjectName)\bc.exe" "$(SolutionDir)\$(Configuration)\$(ProjectName)\dc.exe" + + + Copying bc to dc... + + + + + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions);BC_ENABLED=1;DC_ENABLED=1;BC_ENABLE_EXTRA_MATH=1;BC_ENABLE_HISTORY=0;BC_ENABLE_NLS=0;BC_ENABLE_PROMPT=1;BC_DEBUG_CODE=0;BC_ENABLE_LIBRARY=0;EXECSUFFIX=.exe;BUILD_TYPE=HN + $(SolutionDir)\include;%(AdditionalIncludeDirectories) + MultiThreadedDLL + Level3 + ProgramDatabase + MaxSpeed + false + /W3 %(AdditionalOptions) + + + MachineX86 + false + Console + kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;bcrypt.lib;ucrt.lib;%(AdditionalDependencies) + true + true + + + copy /b "$(SolutionDir)\$(Configuration)\$(ProjectName)\bc.exe" "$(SolutionDir)\$(Configuration)\$(ProjectName)\dc.exe" + + + Copying bc to dc... + + + + + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions);BC_ENABLED=1;DC_ENABLED=1;BC_ENABLE_EXTRA_MATH=1;BC_ENABLE_HISTORY=0;BC_ENABLE_NLS=0;BC_ENABLE_PROMPT=1;BC_DEBUG_CODE=0;BC_ENABLE_LIBRARY=0;EXECSUFFIX=.exe;BUILD_TYPE=HN + $(SolutionDir)\include;%(AdditionalIncludeDirectories) + MultiThreadedDebugDLL + Level3 + ProgramDatabase + Disabled + false + /W3 %(AdditionalOptions) + + + MachineX64 + true + Console + kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;bcrypt.lib;ucrt.lib;%(AdditionalDependencies) + + + copy /b "$(SolutionDir)\$(Configuration)\$(ProjectName)\bc.exe" "$(SolutionDir)\$(Configuration)\$(ProjectName)\dc.exe" + + + Copying bc to dc... + + + + + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions);BC_ENABLED=1;DC_ENABLED=1;BC_ENABLE_EXTRA_MATH=1;BC_ENABLE_HISTORY=0;BC_ENABLE_NLS=0;BC_ENABLE_PROMPT=1;BC_DEBUG_CODE=0;BC_ENABLE_LIBRARY=0;EXECSUFFIX=.exe;BUILD_TYPE=HN + $(SolutionDir)\include;%(AdditionalIncludeDirectories) + MultiThreadedDLL + Level3 + ProgramDatabase + MaxSpeed + false + /W3 %(AdditionalOptions) + Default + + + MachineX64 + false + Console + kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;bcrypt.lib;ucrt.lib;%(AdditionalDependencies) + + + copy /b "$(SolutionDir)\$(Configuration)\$(ProjectName)\bc.exe" "$(SolutionDir)\$(Configuration)\$(ProjectName)\dc.exe" + + + Copying bc to dc... + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/contrib/bc/bc.vcxproj.filters b/contrib/bc/bc.vcxproj.filters index bc72b60519e9..141ecb808d08 100644 --- a/contrib/bc/bc.vcxproj.filters +++ b/contrib/bc/bc.vcxproj.filters @@ -1,182 +1,182 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - - - Source Files - - - - - - - - - - - - - Resource Files - - - Resource Files - - - - - Resource Files - - - Resource Files - - + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + *** 579 LINES SKIPPED *** From owner-dev-commits-src-branches@freebsd.org Tue Jun 1 10:39:21 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 98FE86506FC; Tue, 1 Jun 2021 10:39: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 4FvTDT3JRzz4grm; Tue, 1 Jun 2021 10:39:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 55A0D22384; Tue, 1 Jun 2021 10:39:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 151AdLBN059100; Tue, 1 Jun 2021 10:39:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 151AdLim059099; Tue, 1 Jun 2021 10:39:21 GMT (envelope-from git) Date: Tue, 1 Jun 2021 10:39:21 GMT Message-Id: <202106011039.151AdLim059099@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: =?utf-8?B?U3RlZmFuIEXDn2Vy?= Subject: git: 3d5f931a771c - stable/13 - contrib/bc: update to version 4.0.2 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: se X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3d5f931a771ce8937c0572a4fc11bf7a09323125 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jun 2021 10:39:21 -0000 The branch stable/13 has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=3d5f931a771ce8937c0572a4fc11bf7a09323125 commit 3d5f931a771ce8937c0572a4fc11bf7a09323125 Author: Stefan Eßer AuthorDate: 2021-05-12 05:49:19 +0000 Commit: Stefan Eßer CommitDate: 2021-06-01 10:38:43 +0000 contrib/bc: update to version 4.0.2 Merge commit '2858419a0ee2b8f5827de72c00618bcd69ebc5fc' This update fixes the initialization of "scale" to 20 if started with -l and the initial statement leads to an error (e.g. contains a syntax error). Scale was initialized to 0 in that case. Another change is the support of job control in interactive mode with line editing enabled. The control characters have been interpreted as editing commands only, prior to this version. (cherry picked from commit 8c39e25220bb88cd027d0c3b0fe86e52f6abd150) --- contrib/bc/NEWS.md | 9 +++++++++ contrib/bc/include/history.h | 1 + contrib/bc/include/version.h | 2 +- contrib/bc/src/history.c | 5 ++++- contrib/bc/src/vm.c | 2 ++ contrib/bc/tests/other.sh | 5 ++--- 6 files changed, 19 insertions(+), 5 deletions(-) diff --git a/contrib/bc/NEWS.md b/contrib/bc/NEWS.md index c66e7b164c8a..c78bddd27e76 100644 --- a/contrib/bc/NEWS.md +++ b/contrib/bc/NEWS.md @@ -1,5 +1,14 @@ # News +## 4.0.2 + +This is a production release that fixes two bugs: + +1. If no files are used and the first statement on `stdin` is invalid, `scale` + would not be set to `20` even if `-l` was used. +2. When using history, `bc` failed to respond properly to `SIGSTOP` and + `SIGTSTP`. + ## 4.0.1 This is a production release that only adds one thing: flushing output when it diff --git a/contrib/bc/include/history.h b/contrib/bc/include/history.h index 469785a118a9..444a2a107ac5 100644 --- a/contrib/bc/include/history.h +++ b/contrib/bc/include/history.h @@ -165,6 +165,7 @@ typedef enum BcHistoryAction { BC_ACTION_ENTER = 13, BC_ACTION_CTRL_N = 14, BC_ACTION_CTRL_P = 16, + BC_ACTION_CTRL_S = 19, BC_ACTION_CTRL_T = 20, BC_ACTION_CTRL_U = 21, BC_ACTION_CTRL_W = 23, diff --git a/contrib/bc/include/version.h b/contrib/bc/include/version.h index ab4823bd7c2a..42eb3a11d2c0 100644 --- a/contrib/bc/include/version.h +++ b/contrib/bc/include/version.h @@ -36,6 +36,6 @@ #ifndef BC_VERSION_H #define BC_VERSION_H -#define VERSION 4.0.1 +#define VERSION 4.0.2 #endif // BC_VERSION_H diff --git a/contrib/bc/src/history.c b/contrib/bc/src/history.c index c0d54fe35234..317d9193036c 100644 --- a/contrib/bc/src/history.c +++ b/contrib/bc/src/history.c @@ -1281,8 +1281,11 @@ static BcStatus bc_history_edit(BcHistory *h, const char *prompt) { default: { - if (c >= BC_ACTION_CTRL_A && c <= BC_ACTION_CTRL_Z) + if (c >= BC_ACTION_CTRL_A && c <= BC_ACTION_CTRL_Z) { bc_history_printCtrl(h, c); + if (c == BC_ACTION_CTRL_Z) raise(SIGTSTP); + if (c == BC_ACTION_CTRL_S) raise(SIGSTOP); + } else bc_history_edit_insert(h, cbuf, nread); break; } diff --git a/contrib/bc/src/vm.c b/contrib/bc/src/vm.c index e7ee8d35ba54..d01c8fd6860f 100644 --- a/contrib/bc/src/vm.c +++ b/contrib/bc/src/vm.c @@ -835,6 +835,8 @@ static void bc_vm_exec(void) { #if BC_ENABLE_EXTRA_MATH if (!BC_IS_POSIX) bc_vm_load(bc_lib2_name, bc_lib2); #endif // BC_ENABLE_EXTRA_MATH + + bc_program_exec(&vm.prog); } #endif // BC_ENABLED diff --git a/contrib/bc/tests/other.sh b/contrib/bc/tests/other.sh index d2ef4f6d0694..e13891fcad89 100755 --- a/contrib/bc/tests/other.sh +++ b/contrib/bc/tests/other.sh @@ -138,7 +138,7 @@ else set +e - printf 'three\n' | head -c3 > /dev/null + printf 'three\n' | cut -c1-3 > /dev/null err=$? if [ "$err" -eq 0 ]; then @@ -156,8 +156,7 @@ else printf '4 April 2021\n' > "$easter_res" - "$testdir/dc/scripts/easter.sh" "$exe" 2021 | head -c12 > "$easter_out" - printf '\n' >> "$easter_out" + "$testdir/dc/scripts/easter.sh" "$exe" 2021 | cut -c1-12 > "$easter_out" err="$?" checktest "$d" "$err" "Easter script" "$easter_res" "$easter_out" From owner-dev-commits-src-branches@freebsd.org Tue Jun 1 14:55:12 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 37983655F80; Tue, 1 Jun 2021 14:55: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 4FvZvh13Cxz3NTf; Tue, 1 Jun 2021 14:55:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0C1A425734; Tue, 1 Jun 2021 14:55:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 151EtCQd003958; Tue, 1 Jun 2021 14:55:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 151EtCNC003955; Tue, 1 Jun 2021 14:55:12 GMT (envelope-from git) Date: Tue, 1 Jun 2021 14:55:12 GMT Message-Id: <202106011455.151EtCNC003955@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: ae23d302479c - stable/13 - pf: Move nvlist conversion functions to pf_nv MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ae23d302479c5276e4e0a36e6ba1e882dc6e9899 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jun 2021 14:55:12 -0000 The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=ae23d302479c5276e4e0a36e6ba1e882dc6e9899 commit ae23d302479c5276e4e0a36e6ba1e882dc6e9899 Author: Kristof Provost AuthorDate: 2021-05-18 07:24:50 +0000 Commit: Kristof Provost CommitDate: 2021-06-01 14:29:50 +0000 pf: Move nvlist conversion functions to pf_nv Separate the conversion functions (between kernel structs and nvlists) to pf_nv. This reduces the size of pf_ioctl.c, which is already quite large and complex, a good bit. It also keeps all the fairly straightforward conversion code together. MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D30359 (cherry picked from commit 3032c353882aa70a461ef251b8aa6c59a0829ec5) --- sys/netpfil/pf/pf_ioctl.c | 866 +--------------------------------------------- sys/netpfil/pf/pf_nv.c | 851 +++++++++++++++++++++++++++++++++++++++++++++ sys/netpfil/pf/pf_nv.h | 42 ++- 3 files changed, 888 insertions(+), 871 deletions(-) diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index ea4924e2dd41..af89ddf80daf 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -276,14 +276,6 @@ pflog_packet_t *pflog_packet_ptr = NULL; extern u_long pf_ioctl_maxcount; -#define ERROUT_FUNCTION(target, x) \ - do { \ - error = (x); \ - SDT_PROBE3(pf, ioctl, function, error, __func__, error, \ - __LINE__); \ - goto target; \ - } while (0) - static void pfattach_vnet(void) { @@ -1666,648 +1658,6 @@ pf_krule_to_rule(const struct pf_krule *krule, struct pf_rule *rule) rule->u_src_nodes = counter_u64_fetch(krule->src_nodes); } -static int -pf_check_rule_addr(const struct pf_rule_addr *addr) -{ - - switch (addr->addr.type) { - case PF_ADDR_ADDRMASK: - case PF_ADDR_NOROUTE: - case PF_ADDR_DYNIFTL: - case PF_ADDR_TABLE: - case PF_ADDR_URPFFAILED: - case PF_ADDR_RANGE: - break; - default: - return (EINVAL); - } - - if (addr->addr.p.dyn != NULL) { - return (EINVAL); - } - - return (0); -} - -static int -pf_nvaddr_to_addr(const nvlist_t *nvl, struct pf_addr *paddr) -{ - return (pf_nvbinary(nvl, "addr", paddr, sizeof(*paddr))); -} - -static nvlist_t * -pf_addr_to_nvaddr(const struct pf_addr *paddr) -{ - nvlist_t *nvl; - - nvl = nvlist_create(0); - if (nvl == NULL) - return (NULL); - - nvlist_add_binary(nvl, "addr", paddr, sizeof(*paddr)); - - return (nvl); -} - -static int -pf_nvmape_to_mape(const nvlist_t *nvl, struct pf_mape_portset *mape) -{ - int error = 0; - - bzero(mape, sizeof(*mape)); - PFNV_CHK(pf_nvuint8(nvl, "offset", &mape->offset)); - PFNV_CHK(pf_nvuint8(nvl, "psidlen", &mape->psidlen)); - PFNV_CHK(pf_nvuint16(nvl, "psid", &mape->psid)); - -errout: - return (error); -} - -static nvlist_t * -pf_mape_to_nvmape(const struct pf_mape_portset *mape) -{ - nvlist_t *nvl; - - nvl = nvlist_create(0); - if (nvl == NULL) - return (NULL); - - nvlist_add_number(nvl, "offset", mape->offset); - nvlist_add_number(nvl, "psidlen", mape->psidlen); - nvlist_add_number(nvl, "psid", mape->psid); - - return (nvl); -} - -static int -pf_nvpool_to_pool(const nvlist_t *nvl, struct pf_kpool *kpool) -{ - int error = 0; - - bzero(kpool, sizeof(*kpool)); - - PFNV_CHK(pf_nvbinary(nvl, "key", &kpool->key, sizeof(kpool->key))); - - if (nvlist_exists_nvlist(nvl, "counter")) { - PFNV_CHK(pf_nvaddr_to_addr(nvlist_get_nvlist(nvl, "counter"), - &kpool->counter)); - } - - PFNV_CHK(pf_nvint(nvl, "tblidx", &kpool->tblidx)); - PFNV_CHK(pf_nvuint16_array(nvl, "proxy_port", kpool->proxy_port, 2, - NULL)); - PFNV_CHK(pf_nvuint8(nvl, "opts", &kpool->opts)); - - if (nvlist_exists_nvlist(nvl, "mape")) { - PFNV_CHK(pf_nvmape_to_mape(nvlist_get_nvlist(nvl, "mape"), - &kpool->mape)); - } - -errout: - return (error); -} - -static nvlist_t * -pf_pool_to_nvpool(const struct pf_kpool *pool) -{ - nvlist_t *nvl; - nvlist_t *tmp; - - nvl = nvlist_create(0); - if (nvl == NULL) - return (NULL); - - nvlist_add_binary(nvl, "key", &pool->key, sizeof(pool->key)); - tmp = pf_addr_to_nvaddr(&pool->counter); - if (tmp == NULL) - goto error; - nvlist_add_nvlist(nvl, "counter", tmp); - nvlist_destroy(tmp); - - nvlist_add_number(nvl, "tblidx", pool->tblidx); - pf_uint16_array_nv(nvl, "proxy_port", pool->proxy_port, 2); - nvlist_add_number(nvl, "opts", pool->opts); - - tmp = pf_mape_to_nvmape(&pool->mape); - if (tmp == NULL) - goto error; - nvlist_add_nvlist(nvl, "mape", tmp); - nvlist_destroy(tmp); - - return (nvl); - -error: - nvlist_destroy(nvl); - return (NULL); -} - -static int -pf_nvaddr_wrap_to_addr_wrap(const nvlist_t *nvl, struct pf_addr_wrap *addr) -{ - int error = 0; - - bzero(addr, sizeof(*addr)); - - PFNV_CHK(pf_nvuint8(nvl, "type", &addr->type)); - PFNV_CHK(pf_nvuint8(nvl, "iflags", &addr->iflags)); - if (addr->type == PF_ADDR_DYNIFTL) - PFNV_CHK(pf_nvstring(nvl, "ifname", addr->v.ifname, - sizeof(addr->v.ifname))); - if (addr->type == PF_ADDR_TABLE) - PFNV_CHK(pf_nvstring(nvl, "tblname", addr->v.tblname, - sizeof(addr->v.tblname))); - - if (! nvlist_exists_nvlist(nvl, "addr")) - return (EINVAL); - PFNV_CHK(pf_nvaddr_to_addr(nvlist_get_nvlist(nvl, "addr"), - &addr->v.a.addr)); - - if (! nvlist_exists_nvlist(nvl, "mask")) - return (EINVAL); - PFNV_CHK(pf_nvaddr_to_addr(nvlist_get_nvlist(nvl, "mask"), - &addr->v.a.mask)); - - switch (addr->type) { - case PF_ADDR_DYNIFTL: - case PF_ADDR_TABLE: - case PF_ADDR_RANGE: - case PF_ADDR_ADDRMASK: - case PF_ADDR_NOROUTE: - case PF_ADDR_URPFFAILED: - break; - default: - return (EINVAL); - } - -errout: - return (error); -} - -static nvlist_t * -pf_addr_wrap_to_nvaddr_wrap(const struct pf_addr_wrap *addr) -{ - nvlist_t *nvl; - nvlist_t *tmp; - - nvl = nvlist_create(0); - if (nvl == NULL) - return (NULL); - - nvlist_add_number(nvl, "type", addr->type); - nvlist_add_number(nvl, "iflags", addr->iflags); - if (addr->type == PF_ADDR_DYNIFTL) - nvlist_add_string(nvl, "ifname", addr->v.ifname); - if (addr->type == PF_ADDR_TABLE) - nvlist_add_string(nvl, "tblname", addr->v.tblname); - - tmp = pf_addr_to_nvaddr(&addr->v.a.addr); - if (tmp == NULL) - goto error; - nvlist_add_nvlist(nvl, "addr", tmp); - nvlist_destroy(tmp); - tmp = pf_addr_to_nvaddr(&addr->v.a.mask); - if (tmp == NULL) - goto error; - nvlist_add_nvlist(nvl, "mask", tmp); - nvlist_destroy(tmp); - - return (nvl); - -error: - nvlist_destroy(nvl); - return (NULL); -} - -static int -pf_validate_op(uint8_t op) -{ - switch (op) { - case PF_OP_NONE: - case PF_OP_IRG: - case PF_OP_EQ: - case PF_OP_NE: - case PF_OP_LT: - case PF_OP_LE: - case PF_OP_GT: - case PF_OP_GE: - case PF_OP_XRG: - case PF_OP_RRG: - break; - default: - return (EINVAL); - } - - return (0); -} - -static int -pf_nvrule_addr_to_rule_addr(const nvlist_t *nvl, struct pf_rule_addr *addr) -{ - int error = 0; - - if (! nvlist_exists_nvlist(nvl, "addr")) - return (EINVAL); - - PFNV_CHK(pf_nvaddr_wrap_to_addr_wrap(nvlist_get_nvlist(nvl, "addr"), - &addr->addr)); - PFNV_CHK(pf_nvuint16_array(nvl, "port", addr->port, 2, NULL)); - PFNV_CHK(pf_nvuint8(nvl, "neg", &addr->neg)); - PFNV_CHK(pf_nvuint8(nvl, "port_op", &addr->port_op)); - - PFNV_CHK(pf_validate_op(addr->port_op)); - -errout: - return (error); -} - -static nvlist_t * -pf_rule_addr_to_nvrule_addr(const struct pf_rule_addr *addr) -{ - nvlist_t *nvl; - nvlist_t *tmp; - - nvl = nvlist_create(0); - if (nvl == NULL) - return (NULL); - - tmp = pf_addr_wrap_to_nvaddr_wrap(&addr->addr); - if (tmp == NULL) - goto error; - nvlist_add_nvlist(nvl, "addr", tmp); - nvlist_destroy(tmp); - pf_uint16_array_nv(nvl, "port", addr->port, 2); - nvlist_add_number(nvl, "neg", addr->neg); - nvlist_add_number(nvl, "port_op", addr->port_op); - - return (nvl); - -error: - nvlist_destroy(nvl); - return (NULL); -} - -static int -pf_nvrule_uid_to_rule_uid(const nvlist_t *nvl, struct pf_rule_uid *uid) -{ - int error = 0; - - bzero(uid, sizeof(*uid)); - - PFNV_CHK(pf_nvuint32_array(nvl, "uid", uid->uid, 2, NULL)); - PFNV_CHK(pf_nvuint8(nvl, "op", &uid->op)); - - PFNV_CHK(pf_validate_op(uid->op)); - -errout: - return (error); -} - -static nvlist_t * -pf_rule_uid_to_nvrule_uid(const struct pf_rule_uid *uid) -{ - nvlist_t *nvl; - - nvl = nvlist_create(0); - if (nvl == NULL) - return (NULL); - - pf_uint32_array_nv(nvl, "uid", uid->uid, 2); - nvlist_add_number(nvl, "op", uid->op); - - return (nvl); -} - -static int -pf_nvrule_gid_to_rule_gid(const nvlist_t *nvl, struct pf_rule_gid *gid) -{ - /* Cheat a little. These stucts are the same, other than the name of - * the first field. */ - return (pf_nvrule_uid_to_rule_uid(nvl, (struct pf_rule_uid *)gid)); -} - -static int -pf_nvrule_to_krule(const nvlist_t *nvl, struct pf_krule **prule) -{ - struct pf_krule *rule; - int error = 0; - -#define ERROUT(x) ERROUT_FUNCTION(errout, x) - - rule = malloc(sizeof(*rule), M_PFRULE, M_WAITOK | M_ZERO); - - PFNV_CHK(pf_nvuint32(nvl, "nr", &rule->nr)); - - if (! nvlist_exists_nvlist(nvl, "src")) - ERROUT(EINVAL); - - error = pf_nvrule_addr_to_rule_addr(nvlist_get_nvlist(nvl, "src"), - &rule->src); - if (error != 0) - ERROUT(error); - - if (! nvlist_exists_nvlist(nvl, "dst")) - ERROUT(EINVAL); - - PFNV_CHK(pf_nvrule_addr_to_rule_addr(nvlist_get_nvlist(nvl, "dst"), - &rule->dst)); - - if (nvlist_exists_string(nvl, "label")) { - PFNV_CHK(pf_nvstring(nvl, "label", rule->label[0], - sizeof(rule->label[0]))); - } else if (nvlist_exists_string_array(nvl, "labels")) { - const char *const *strs; - size_t items; - int ret; - - strs = nvlist_get_string_array(nvl, "labels", &items); - if (items > PF_RULE_MAX_LABEL_COUNT) - ERROUT(E2BIG); - - for (size_t i = 0; i < items; i++) { - ret = strlcpy(rule->label[i], strs[i], - sizeof(rule->label[0])); - if (ret >= sizeof(rule->label[0])) - ERROUT(E2BIG); - } - } - - PFNV_CHK(pf_nvstring(nvl, "ifname", rule->ifname, - sizeof(rule->ifname))); - PFNV_CHK(pf_nvstring(nvl, "qname", rule->qname, sizeof(rule->qname))); - PFNV_CHK(pf_nvstring(nvl, "pqname", rule->pqname, - sizeof(rule->pqname))); - PFNV_CHK(pf_nvstring(nvl, "tagname", rule->tagname, - sizeof(rule->tagname))); - PFNV_CHK(pf_nvstring(nvl, "match_tagname", rule->match_tagname, - sizeof(rule->match_tagname))); - PFNV_CHK(pf_nvstring(nvl, "overload_tblname", rule->overload_tblname, - sizeof(rule->overload_tblname))); - - if (! nvlist_exists_nvlist(nvl, "rpool")) - ERROUT(EINVAL); - PFNV_CHK(pf_nvpool_to_pool(nvlist_get_nvlist(nvl, "rpool"), - &rule->rpool)); - - PFNV_CHK(pf_nvuint32(nvl, "os_fingerprint", &rule->os_fingerprint)); - - PFNV_CHK(pf_nvint(nvl, "rtableid", &rule->rtableid)); - PFNV_CHK(pf_nvuint32_array(nvl, "timeout", rule->timeout, PFTM_MAX, NULL)); - PFNV_CHK(pf_nvuint32(nvl, "max_states", &rule->max_states)); - PFNV_CHK(pf_nvuint32(nvl, "max_src_nodes", &rule->max_src_nodes)); - PFNV_CHK(pf_nvuint32(nvl, "max_src_states", &rule->max_src_states)); - PFNV_CHK(pf_nvuint32(nvl, "max_src_conn", &rule->max_src_conn)); - PFNV_CHK(pf_nvuint32(nvl, "max_src_conn_rate.limit", - &rule->max_src_conn_rate.limit)); - PFNV_CHK(pf_nvuint32(nvl, "max_src_conn_rate.seconds", - &rule->max_src_conn_rate.seconds)); - PFNV_CHK(pf_nvuint32(nvl, "prob", &rule->prob)); - PFNV_CHK(pf_nvuint32(nvl, "cuid", &rule->cuid)); - PFNV_CHK(pf_nvuint32(nvl, "cpid", &rule->cpid)); - - PFNV_CHK(pf_nvuint16(nvl, "return_icmp", &rule->return_icmp)); - PFNV_CHK(pf_nvuint16(nvl, "return_icmp6", &rule->return_icmp6)); - - PFNV_CHK(pf_nvuint16(nvl, "max_mss", &rule->max_mss)); - PFNV_CHK(pf_nvuint16(nvl, "scrub_flags", &rule->scrub_flags)); - - if (! nvlist_exists_nvlist(nvl, "uid")) - ERROUT(EINVAL); - PFNV_CHK(pf_nvrule_uid_to_rule_uid(nvlist_get_nvlist(nvl, "uid"), - &rule->uid)); - - if (! nvlist_exists_nvlist(nvl, "gid")) - ERROUT(EINVAL); - PFNV_CHK(pf_nvrule_gid_to_rule_gid(nvlist_get_nvlist(nvl, "gid"), - &rule->gid)); - - PFNV_CHK(pf_nvuint32(nvl, "rule_flag", &rule->rule_flag)); - PFNV_CHK(pf_nvuint8(nvl, "action", &rule->action)); - PFNV_CHK(pf_nvuint8(nvl, "direction", &rule->direction)); - PFNV_CHK(pf_nvuint8(nvl, "log", &rule->log)); - PFNV_CHK(pf_nvuint8(nvl, "logif", &rule->logif)); - PFNV_CHK(pf_nvuint8(nvl, "quick", &rule->quick)); - PFNV_CHK(pf_nvuint8(nvl, "ifnot", &rule->ifnot)); - PFNV_CHK(pf_nvuint8(nvl, "match_tag_not", &rule->match_tag_not)); - PFNV_CHK(pf_nvuint8(nvl, "natpass", &rule->natpass)); - - PFNV_CHK(pf_nvuint8(nvl, "keep_state", &rule->keep_state)); - PFNV_CHK(pf_nvuint8(nvl, "af", &rule->af)); - PFNV_CHK(pf_nvuint8(nvl, "proto", &rule->proto)); - PFNV_CHK(pf_nvuint8(nvl, "type", &rule->type)); - PFNV_CHK(pf_nvuint8(nvl, "code", &rule->code)); - PFNV_CHK(pf_nvuint8(nvl, "flags", &rule->flags)); - PFNV_CHK(pf_nvuint8(nvl, "flagset", &rule->flagset)); - PFNV_CHK(pf_nvuint8(nvl, "min_ttl", &rule->min_ttl)); - PFNV_CHK(pf_nvuint8(nvl, "allow_opts", &rule->allow_opts)); - PFNV_CHK(pf_nvuint8(nvl, "rt", &rule->rt)); - PFNV_CHK(pf_nvuint8(nvl, "return_ttl", &rule->return_ttl)); - PFNV_CHK(pf_nvuint8(nvl, "tos", &rule->tos)); - PFNV_CHK(pf_nvuint8(nvl, "set_tos", &rule->set_tos)); - PFNV_CHK(pf_nvuint8(nvl, "anchor_relative", &rule->anchor_relative)); - PFNV_CHK(pf_nvuint8(nvl, "anchor_wildcard", &rule->anchor_wildcard)); - - PFNV_CHK(pf_nvuint8(nvl, "flush", &rule->flush)); - PFNV_CHK(pf_nvuint8(nvl, "prio", &rule->prio)); - - PFNV_CHK(pf_nvuint8_array(nvl, "set_prio", &rule->prio, 2, NULL)); - - if (nvlist_exists_nvlist(nvl, "divert")) { - const nvlist_t *nvldivert = nvlist_get_nvlist(nvl, "divert"); - - if (! nvlist_exists_nvlist(nvldivert, "addr")) - ERROUT(EINVAL); - PFNV_CHK(pf_nvaddr_to_addr(nvlist_get_nvlist(nvldivert, "addr"), - &rule->divert.addr)); - PFNV_CHK(pf_nvuint16(nvldivert, "port", &rule->divert.port)); - } - - /* Validation */ -#ifndef INET - if (rule->af == AF_INET) - ERROUT(EAFNOSUPPORT); -#endif /* INET */ -#ifndef INET6 - if (rule->af == AF_INET6) - ERROUT(EAFNOSUPPORT); -#endif /* INET6 */ - - PFNV_CHK(pf_check_rule_addr(&rule->src)); - PFNV_CHK(pf_check_rule_addr(&rule->dst)); - - *prule = rule; - - return (0); - -#undef ERROUT -errout: - pf_krule_free(rule); - *prule = NULL; - - return (error); -} - -static nvlist_t * -pf_divert_to_nvdivert(const struct pf_krule *rule) -{ - nvlist_t *nvl; - nvlist_t *tmp; - - nvl = nvlist_create(0); - if (nvl == NULL) - return (NULL); - - tmp = pf_addr_to_nvaddr(&rule->divert.addr); - if (tmp == NULL) - goto error; - nvlist_add_nvlist(nvl, "addr", tmp); - nvlist_destroy(tmp); - nvlist_add_number(nvl, "port", rule->divert.port); - - return (nvl); - -error: - nvlist_destroy(nvl); - return (NULL); -} - -static nvlist_t * -pf_krule_to_nvrule(const struct pf_krule *rule) -{ - nvlist_t *nvl, *tmp; - - nvl = nvlist_create(0); - if (nvl == NULL) - return (nvl); - - nvlist_add_number(nvl, "nr", rule->nr); - tmp = pf_rule_addr_to_nvrule_addr(&rule->src); - if (tmp == NULL) - goto error; - nvlist_add_nvlist(nvl, "src", tmp); - nvlist_destroy(tmp); - tmp = pf_rule_addr_to_nvrule_addr(&rule->dst); - if (tmp == NULL) - goto error; - nvlist_add_nvlist(nvl, "dst", tmp); - nvlist_destroy(tmp); - - for (int i = 0; i < PF_SKIP_COUNT; i++) { - nvlist_append_number_array(nvl, "skip", - rule->skip[i].ptr ? rule->skip[i].ptr->nr : -1); - } - - for (int i = 0; i < PF_RULE_MAX_LABEL_COUNT; i++) { - nvlist_append_string_array(nvl, "labels", rule->label[i]); - } - nvlist_add_string(nvl, "label", rule->label[0]); - nvlist_add_string(nvl, "ifname", rule->ifname); - nvlist_add_string(nvl, "qname", rule->qname); - nvlist_add_string(nvl, "pqname", rule->pqname); - nvlist_add_string(nvl, "tagname", rule->tagname); - nvlist_add_string(nvl, "match_tagname", rule->match_tagname); - nvlist_add_string(nvl, "overload_tblname", rule->overload_tblname); - - tmp = pf_pool_to_nvpool(&rule->rpool); - if (tmp == NULL) - goto error; - nvlist_add_nvlist(nvl, "rpool", tmp); - nvlist_destroy(tmp); - - nvlist_add_number(nvl, "evaluations", - counter_u64_fetch(rule->evaluations)); - for (int i = 0; i < 2; i++) { - nvlist_append_number_array(nvl, "packets", - counter_u64_fetch(rule->packets[i])); - nvlist_append_number_array(nvl, "bytes", - counter_u64_fetch(rule->bytes[i])); - } - - nvlist_add_number(nvl, "os_fingerprint", rule->os_fingerprint); - - nvlist_add_number(nvl, "rtableid", rule->rtableid); - pf_uint32_array_nv(nvl, "timeout", rule->timeout, PFTM_MAX); - nvlist_add_number(nvl, "max_states", rule->max_states); - nvlist_add_number(nvl, "max_src_nodes", rule->max_src_nodes); - nvlist_add_number(nvl, "max_src_states", rule->max_src_states); - nvlist_add_number(nvl, "max_src_conn", rule->max_src_conn); - nvlist_add_number(nvl, "max_src_conn_rate.limit", - rule->max_src_conn_rate.limit); - nvlist_add_number(nvl, "max_src_conn_rate.seconds", - rule->max_src_conn_rate.seconds); - nvlist_add_number(nvl, "qid", rule->qid); - nvlist_add_number(nvl, "pqid", rule->pqid); - nvlist_add_number(nvl, "prob", rule->prob); - nvlist_add_number(nvl, "cuid", rule->cuid); - nvlist_add_number(nvl, "cpid", rule->cpid); - - nvlist_add_number(nvl, "states_cur", - counter_u64_fetch(rule->states_cur)); - nvlist_add_number(nvl, "states_tot", - counter_u64_fetch(rule->states_tot)); - nvlist_add_number(nvl, "src_nodes", - counter_u64_fetch(rule->src_nodes)); - - nvlist_add_number(nvl, "return_icmp", rule->return_icmp); - nvlist_add_number(nvl, "return_icmp6", rule->return_icmp6); - - nvlist_add_number(nvl, "max_mss", rule->max_mss); - nvlist_add_number(nvl, "scrub_flags", rule->scrub_flags); - - tmp = pf_rule_uid_to_nvrule_uid(&rule->uid); - if (tmp == NULL) - goto error; - nvlist_add_nvlist(nvl, "uid", tmp); - nvlist_destroy(tmp); - tmp = pf_rule_uid_to_nvrule_uid((const struct pf_rule_uid *)&rule->gid); - if (tmp == NULL) - goto error; - nvlist_add_nvlist(nvl, "gid", tmp); - nvlist_destroy(tmp); - - nvlist_add_number(nvl, "rule_flag", rule->rule_flag); - nvlist_add_number(nvl, "action", rule->action); - nvlist_add_number(nvl, "direction", rule->direction); - nvlist_add_number(nvl, "log", rule->log); - nvlist_add_number(nvl, "logif", rule->logif); - nvlist_add_number(nvl, "quick", rule->quick); - nvlist_add_number(nvl, "ifnot", rule->ifnot); - nvlist_add_number(nvl, "match_tag_not", rule->match_tag_not); - nvlist_add_number(nvl, "natpass", rule->natpass); - - nvlist_add_number(nvl, "keep_state", rule->keep_state); - nvlist_add_number(nvl, "af", rule->af); - nvlist_add_number(nvl, "proto", rule->proto); - nvlist_add_number(nvl, "type", rule->type); - nvlist_add_number(nvl, "code", rule->code); - nvlist_add_number(nvl, "flags", rule->flags); - nvlist_add_number(nvl, "flagset", rule->flagset); - nvlist_add_number(nvl, "min_ttl", rule->min_ttl); - nvlist_add_number(nvl, "allow_opts", rule->allow_opts); - nvlist_add_number(nvl, "rt", rule->rt); - nvlist_add_number(nvl, "return_ttl", rule->return_ttl); - nvlist_add_number(nvl, "tos", rule->tos); - nvlist_add_number(nvl, "set_tos", rule->set_tos); - nvlist_add_number(nvl, "anchor_relative", rule->anchor_relative); - nvlist_add_number(nvl, "anchor_wildcard", rule->anchor_wildcard); - - nvlist_add_number(nvl, "flush", rule->flush); - nvlist_add_number(nvl, "prio", rule->prio); - - pf_uint8_array_nv(nvl, "set_prio", &rule->prio, 2); - - tmp = pf_divert_to_nvdivert(rule); - if (tmp == NULL) - goto error; - nvlist_add_nvlist(nvl, "divert", tmp); - nvlist_destroy(tmp); - - return (nvl); - -error: - nvlist_destroy(nvl); - return (NULL); -} - static int pf_rule_to_krule(const struct pf_rule *rule, struct pf_krule *krule) { @@ -2571,219 +1921,6 @@ pf_state_kill_to_kstate_kill(const struct pfioc_state_kill *psk, return (0); } -static int -pf_nvstate_cmp_to_state_cmp(const nvlist_t *nvl, struct pf_state_cmp *cmp) -{ - int error = 0; - - bzero(cmp, sizeof(*cmp)); - - PFNV_CHK(pf_nvuint64(nvl, "id", &cmp->id)); - PFNV_CHK(pf_nvuint32(nvl, "creatorid", &cmp->creatorid)); - PFNV_CHK(pf_nvuint8(nvl, "direction", &cmp->direction)); - -errout: - return (error); -} - -static int -pf_nvstate_kill_to_kstate_kill(const nvlist_t *nvl, - struct pf_kstate_kill *kill) -{ - int error = 0; - - bzero(kill, sizeof(*kill)); - - if (! nvlist_exists_nvlist(nvl, "cmp")) - return (EINVAL); - - PFNV_CHK(pf_nvstate_cmp_to_state_cmp(nvlist_get_nvlist(nvl, "cmp"), - &kill->psk_pfcmp)); - PFNV_CHK(pf_nvuint8(nvl, "af", &kill->psk_af)); - PFNV_CHK(pf_nvint(nvl, "proto", &kill->psk_proto)); - - if (! nvlist_exists_nvlist(nvl, "src")) - return (EINVAL); - PFNV_CHK(pf_nvrule_addr_to_rule_addr(nvlist_get_nvlist(nvl, "src"), - &kill->psk_src)); - if (! nvlist_exists_nvlist(nvl, "dst")) - return (EINVAL); - PFNV_CHK(pf_nvrule_addr_to_rule_addr(nvlist_get_nvlist(nvl, "dst"), - &kill->psk_dst)); - if (nvlist_exists_nvlist(nvl, "rt_addr")) { - PFNV_CHK(pf_nvrule_addr_to_rule_addr( - nvlist_get_nvlist(nvl, "rt_addr"), &kill->psk_rt_addr)); - } - - PFNV_CHK(pf_nvstring(nvl, "ifname", kill->psk_ifname, - sizeof(kill->psk_ifname))); - PFNV_CHK(pf_nvstring(nvl, "label", kill->psk_label, - sizeof(kill->psk_label))); - if (nvlist_exists_bool(nvl, "kill_match")) - kill->psk_kill_match = nvlist_get_bool(nvl, "kill_match"); - -errout: - return (error); -} - -static nvlist_t * -pf_state_key_to_nvstate_key(const struct pf_state_key *key) -{ - nvlist_t *nvl, *tmp; - - nvl = nvlist_create(0); - if (nvl == NULL) - return (NULL); - - for (int i = 0; i < 2; i++) { - tmp = pf_addr_to_nvaddr(&key->addr[i]); - if (tmp == NULL) - goto errout; - nvlist_append_nvlist_array(nvl, "addr", tmp); - nvlist_append_number_array(nvl, "port", key->port[i]); - } - nvlist_add_number(nvl, "af", key->af); - nvlist_add_number(nvl, "proto", key->proto); - - return (nvl); - -errout: - nvlist_destroy(nvl); - return (NULL); -} - -static nvlist_t * -pf_state_scrub_to_nvstate_scrub(const struct pf_state_scrub *scrub) -{ - nvlist_t *nvl; - - nvl = nvlist_create(0); - if (nvl == NULL) - return (NULL); - - nvlist_add_bool(nvl, "timestamp", scrub->pfss_flags & PFSS_TIMESTAMP); - nvlist_add_number(nvl, "ttl", scrub->pfss_ttl); - nvlist_add_number(nvl, "ts_mod", scrub->pfss_ts_mod); - - return (nvl); -} - -static nvlist_t * -pf_state_peer_to_nvstate_peer(const struct pf_state_peer *peer) -{ - nvlist_t *nvl, *tmp; - - nvl = nvlist_create(0); - if (nvl == NULL) - return (NULL); - - if (peer->scrub) { - tmp = pf_state_scrub_to_nvstate_scrub(peer->scrub); - if (tmp == NULL) - goto errout; - nvlist_add_nvlist(nvl, "scrub", tmp); - nvlist_destroy(tmp); - } - - nvlist_add_number(nvl, "seqlo", peer->seqlo); - nvlist_add_number(nvl, "seqhi", peer->seqhi); - nvlist_add_number(nvl, "seqdiff", peer->seqdiff); - nvlist_add_number(nvl, "max_win", peer->max_win); - nvlist_add_number(nvl, "mss", peer->mss); - nvlist_add_number(nvl, "state", peer->state); - nvlist_add_number(nvl, "wscale", peer->wscale); - - return (nvl); - -errout: - nvlist_destroy(nvl); - return (NULL); -} - - -static nvlist_t * -pf_state_to_nvstate(const struct pf_state *s) -{ - nvlist_t *nvl, *tmp; - uint32_t expire, flags = 0; - - nvl = nvlist_create(0); - if (nvl == NULL) - return (NULL); - - nvlist_add_number(nvl, "id", s->id); - nvlist_add_string(nvl, "ifname", s->kif->pfik_name); - nvlist_add_string(nvl, "orig_ifname", s->orig_kif->pfik_name); - - tmp = pf_state_key_to_nvstate_key(s->key[PF_SK_STACK]); - if (tmp == NULL) - goto errout; - nvlist_add_nvlist(nvl, "stack_key", tmp); - nvlist_destroy(tmp); - - tmp = pf_state_key_to_nvstate_key(s->key[PF_SK_WIRE]); - if (tmp == NULL) - goto errout; - nvlist_add_nvlist(nvl, "wire_key", tmp); - nvlist_destroy(tmp); - - tmp = pf_state_peer_to_nvstate_peer(&s->src); - if (tmp == NULL) - goto errout; - nvlist_add_nvlist(nvl, "src", tmp); - nvlist_destroy(tmp); - - tmp = pf_state_peer_to_nvstate_peer(&s->dst); - if (tmp == NULL) - goto errout; - nvlist_add_nvlist(nvl, "dst", tmp); - nvlist_destroy(tmp); - - tmp = pf_addr_to_nvaddr(&s->rt_addr); - if (tmp == NULL) - goto errout; - nvlist_add_nvlist(nvl, "rt_addr", tmp); - nvlist_destroy(tmp); - - nvlist_add_number(nvl, "rule", s->rule.ptr ? s->rule.ptr->nr : -1); - nvlist_add_number(nvl, "anchor", - s->anchor.ptr ? s->anchor.ptr->nr : -1); - nvlist_add_number(nvl, "nat_rule", - s->nat_rule.ptr ? s->nat_rule.ptr->nr : -1); - nvlist_add_number(nvl, "creation", s->creation); - - expire = pf_state_expires(s); - if (expire <= time_uptime) - expire = 0; - else - expire = expire - time_uptime; - nvlist_add_number(nvl, "expire", expire); - - for (int i = 0; i < 2; i++) { - nvlist_append_number_array(nvl, "packets", - counter_u64_fetch(s->packets[i])); - nvlist_append_number_array(nvl, "bytes", - counter_u64_fetch(s->bytes[i])); - } - - nvlist_add_number(nvl, "creatorid", s->creatorid); - nvlist_add_number(nvl, "direction", s->direction); - nvlist_add_number(nvl, "log", s->log); - nvlist_add_number(nvl, "state_flags", s->state_flags); - nvlist_add_number(nvl, "timeout", s->timeout); - if (s->src_node) - flags |= PFSYNC_FLAG_SRCNODE; - if (s->nat_src_node) - flags |= PFSYNC_FLAG_NATSRCNODE; - nvlist_add_number(nvl, "sync_flags", flags); - - return (nvl); - -errout: - nvlist_destroy(nvl); - return (NULL); -} - static int pf_ioctl_addrule(struct pf_krule *rule, uint32_t ticket, uint32_t pool_ticket, const char *anchor, const char *anchor_call, @@ -3139,8 +2276,9 @@ pfioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags, struct thread *td if (! nvlist_exists_nvlist(nvl, "rule")) ERROUT(EINVAL); + rule = malloc(sizeof(*rule), M_PFRULE, M_WAITOK | M_ZERO); error = pf_nvrule_to_krule(nvlist_get_nvlist(nvl, "rule"), - &rule); + rule); if (error) ERROUT(error); diff --git a/sys/netpfil/pf/pf_nv.c b/sys/netpfil/pf/pf_nv.c index 1fdb52e5fad0..863259dbf9aa 100644 --- a/sys/netpfil/pf/pf_nv.c +++ b/sys/netpfil/pf/pf_nv.c @@ -28,9 +28,13 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_inet.h" +#include "opt_inet6.h" + #include #include #include +#include #include #include @@ -137,3 +141,850 @@ pf_nvstring(const nvlist_t *nvl, const char *name, char *str, size_t maxlen) return (0); } + +static int +pf_nvaddr_to_addr(const nvlist_t *nvl, struct pf_addr *paddr) +{ + return (pf_nvbinary(nvl, "addr", paddr, sizeof(*paddr))); +} + +static nvlist_t * +pf_addr_to_nvaddr(const struct pf_addr *paddr) +{ + nvlist_t *nvl; + + nvl = nvlist_create(0); + if (nvl == NULL) + return (NULL); + + nvlist_add_binary(nvl, "addr", paddr, sizeof(*paddr)); + + return (nvl); +} + +static int +pf_nvmape_to_mape(const nvlist_t *nvl, struct pf_mape_portset *mape) +{ + int error = 0; + + bzero(mape, sizeof(*mape)); + PFNV_CHK(pf_nvuint8(nvl, "offset", &mape->offset)); + PFNV_CHK(pf_nvuint8(nvl, "psidlen", &mape->psidlen)); + PFNV_CHK(pf_nvuint16(nvl, "psid", &mape->psid)); + +errout: + return (error); +} + +static nvlist_t * +pf_mape_to_nvmape(const struct pf_mape_portset *mape) +{ *** 869 LINES SKIPPED *** From owner-dev-commits-src-branches@freebsd.org Tue Jun 1 14:55:12 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 791CC655F82; Tue, 1 Jun 2021 14:55: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 4FvZvh32G6z3NL9; Tue, 1 Jun 2021 14:55:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 50FFE256E0; Tue, 1 Jun 2021 14:55:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 151EtCZi004017; Tue, 1 Jun 2021 14:55:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 151EtCC2004016; Tue, 1 Jun 2021 14:55:12 GMT (envelope-from git) Date: Tue, 1 Jun 2021 14:55:12 GMT Message-Id: <202106011455.151EtCC2004016@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: db3515d03dda - stable/12 - pf: Move nvlist conversion functions to pf_nv MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: db3515d03dda585d6147fbd1cb502c0b040a2a9d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jun 2021 14:55:12 -0000 The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=db3515d03dda585d6147fbd1cb502c0b040a2a9d commit db3515d03dda585d6147fbd1cb502c0b040a2a9d Author: Kristof Provost AuthorDate: 2021-05-18 07:24:50 +0000 Commit: Kristof Provost CommitDate: 2021-06-01 14:30:48 +0000 pf: Move nvlist conversion functions to pf_nv Separate the conversion functions (between kernel structs and nvlists) to pf_nv. This reduces the size of pf_ioctl.c, which is already quite large and complex, a good bit. It also keeps all the fairly straightforward conversion code together. MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D30359 (cherry picked from commit 3032c353882aa70a461ef251b8aa6c59a0829ec5) --- sys/netpfil/pf/pf_ioctl.c | 866 +--------------------------------------------- sys/netpfil/pf/pf_nv.c | 851 +++++++++++++++++++++++++++++++++++++++++++++ sys/netpfil/pf/pf_nv.h | 42 ++- 3 files changed, 888 insertions(+), 871 deletions(-) diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index 7f72d95e3c84..148a8a56f624 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -276,14 +276,6 @@ pflog_packet_t *pflog_packet_ptr = NULL; extern u_long pf_ioctl_maxcount; -#define ERROUT_FUNCTION(target, x) \ - do { \ - error = (x); \ - SDT_PROBE3(pf, ioctl, function, error, __func__, error, \ - __LINE__); \ - goto target; \ - } while (0) - static void pfattach_vnet(void) { @@ -1667,648 +1659,6 @@ pf_krule_to_rule(const struct pf_krule *krule, struct pf_rule *rule) rule->u_src_nodes = counter_u64_fetch(krule->src_nodes); } -static int -pf_check_rule_addr(const struct pf_rule_addr *addr) -{ - - switch (addr->addr.type) { - case PF_ADDR_ADDRMASK: - case PF_ADDR_NOROUTE: - case PF_ADDR_DYNIFTL: - case PF_ADDR_TABLE: - case PF_ADDR_URPFFAILED: - case PF_ADDR_RANGE: - break; - default: - return (EINVAL); - } - - if (addr->addr.p.dyn != NULL) { - return (EINVAL); - } - - return (0); -} - -static int -pf_nvaddr_to_addr(const nvlist_t *nvl, struct pf_addr *paddr) -{ - return (pf_nvbinary(nvl, "addr", paddr, sizeof(*paddr))); -} - -static nvlist_t * -pf_addr_to_nvaddr(const struct pf_addr *paddr) -{ - nvlist_t *nvl; - - nvl = nvlist_create(0); - if (nvl == NULL) - return (NULL); - - nvlist_add_binary(nvl, "addr", paddr, sizeof(*paddr)); - - return (nvl); -} - -static int -pf_nvmape_to_mape(const nvlist_t *nvl, struct pf_mape_portset *mape) -{ - int error = 0; - - bzero(mape, sizeof(*mape)); - PFNV_CHK(pf_nvuint8(nvl, "offset", &mape->offset)); - PFNV_CHK(pf_nvuint8(nvl, "psidlen", &mape->psidlen)); - PFNV_CHK(pf_nvuint16(nvl, "psid", &mape->psid)); - -errout: - return (error); -} - -static nvlist_t * -pf_mape_to_nvmape(const struct pf_mape_portset *mape) -{ - nvlist_t *nvl; - - nvl = nvlist_create(0); - if (nvl == NULL) - return (NULL); - - nvlist_add_number(nvl, "offset", mape->offset); - nvlist_add_number(nvl, "psidlen", mape->psidlen); - nvlist_add_number(nvl, "psid", mape->psid); - - return (nvl); -} - -static int -pf_nvpool_to_pool(const nvlist_t *nvl, struct pf_kpool *kpool) -{ - int error = 0; - - bzero(kpool, sizeof(*kpool)); - - PFNV_CHK(pf_nvbinary(nvl, "key", &kpool->key, sizeof(kpool->key))); - - if (nvlist_exists_nvlist(nvl, "counter")) { - PFNV_CHK(pf_nvaddr_to_addr(nvlist_get_nvlist(nvl, "counter"), - &kpool->counter)); - } - - PFNV_CHK(pf_nvint(nvl, "tblidx", &kpool->tblidx)); - PFNV_CHK(pf_nvuint16_array(nvl, "proxy_port", kpool->proxy_port, 2, - NULL)); - PFNV_CHK(pf_nvuint8(nvl, "opts", &kpool->opts)); - - if (nvlist_exists_nvlist(nvl, "mape")) { - PFNV_CHK(pf_nvmape_to_mape(nvlist_get_nvlist(nvl, "mape"), - &kpool->mape)); - } - -errout: - return (error); -} - -static nvlist_t * -pf_pool_to_nvpool(const struct pf_kpool *pool) -{ - nvlist_t *nvl; - nvlist_t *tmp; - - nvl = nvlist_create(0); - if (nvl == NULL) - return (NULL); - - nvlist_add_binary(nvl, "key", &pool->key, sizeof(pool->key)); - tmp = pf_addr_to_nvaddr(&pool->counter); - if (tmp == NULL) - goto error; - nvlist_add_nvlist(nvl, "counter", tmp); - nvlist_destroy(tmp); - - nvlist_add_number(nvl, "tblidx", pool->tblidx); - pf_uint16_array_nv(nvl, "proxy_port", pool->proxy_port, 2); - nvlist_add_number(nvl, "opts", pool->opts); - - tmp = pf_mape_to_nvmape(&pool->mape); - if (tmp == NULL) - goto error; - nvlist_add_nvlist(nvl, "mape", tmp); - nvlist_destroy(tmp); - - return (nvl); - -error: - nvlist_destroy(nvl); - return (NULL); -} - -static int -pf_nvaddr_wrap_to_addr_wrap(const nvlist_t *nvl, struct pf_addr_wrap *addr) -{ - int error = 0; - - bzero(addr, sizeof(*addr)); - - PFNV_CHK(pf_nvuint8(nvl, "type", &addr->type)); - PFNV_CHK(pf_nvuint8(nvl, "iflags", &addr->iflags)); - if (addr->type == PF_ADDR_DYNIFTL) - PFNV_CHK(pf_nvstring(nvl, "ifname", addr->v.ifname, - sizeof(addr->v.ifname))); - if (addr->type == PF_ADDR_TABLE) - PFNV_CHK(pf_nvstring(nvl, "tblname", addr->v.tblname, - sizeof(addr->v.tblname))); - - if (! nvlist_exists_nvlist(nvl, "addr")) - return (EINVAL); - PFNV_CHK(pf_nvaddr_to_addr(nvlist_get_nvlist(nvl, "addr"), - &addr->v.a.addr)); - - if (! nvlist_exists_nvlist(nvl, "mask")) - return (EINVAL); - PFNV_CHK(pf_nvaddr_to_addr(nvlist_get_nvlist(nvl, "mask"), - &addr->v.a.mask)); - - switch (addr->type) { - case PF_ADDR_DYNIFTL: - case PF_ADDR_TABLE: - case PF_ADDR_RANGE: - case PF_ADDR_ADDRMASK: - case PF_ADDR_NOROUTE: - case PF_ADDR_URPFFAILED: - break; - default: - return (EINVAL); - } - -errout: - return (error); -} - -static nvlist_t * -pf_addr_wrap_to_nvaddr_wrap(const struct pf_addr_wrap *addr) -{ - nvlist_t *nvl; - nvlist_t *tmp; - - nvl = nvlist_create(0); - if (nvl == NULL) - return (NULL); - - nvlist_add_number(nvl, "type", addr->type); - nvlist_add_number(nvl, "iflags", addr->iflags); - if (addr->type == PF_ADDR_DYNIFTL) - nvlist_add_string(nvl, "ifname", addr->v.ifname); - if (addr->type == PF_ADDR_TABLE) - nvlist_add_string(nvl, "tblname", addr->v.tblname); - - tmp = pf_addr_to_nvaddr(&addr->v.a.addr); - if (tmp == NULL) - goto error; - nvlist_add_nvlist(nvl, "addr", tmp); - nvlist_destroy(tmp); - tmp = pf_addr_to_nvaddr(&addr->v.a.mask); - if (tmp == NULL) - goto error; - nvlist_add_nvlist(nvl, "mask", tmp); - nvlist_destroy(tmp); - - return (nvl); - -error: - nvlist_destroy(nvl); - return (NULL); -} - -static int -pf_validate_op(uint8_t op) -{ - switch (op) { - case PF_OP_NONE: - case PF_OP_IRG: - case PF_OP_EQ: - case PF_OP_NE: - case PF_OP_LT: - case PF_OP_LE: - case PF_OP_GT: - case PF_OP_GE: - case PF_OP_XRG: - case PF_OP_RRG: - break; - default: - return (EINVAL); - } - - return (0); -} - -static int -pf_nvrule_addr_to_rule_addr(const nvlist_t *nvl, struct pf_rule_addr *addr) -{ - int error = 0; - - if (! nvlist_exists_nvlist(nvl, "addr")) - return (EINVAL); - - PFNV_CHK(pf_nvaddr_wrap_to_addr_wrap(nvlist_get_nvlist(nvl, "addr"), - &addr->addr)); - PFNV_CHK(pf_nvuint16_array(nvl, "port", addr->port, 2, NULL)); - PFNV_CHK(pf_nvuint8(nvl, "neg", &addr->neg)); - PFNV_CHK(pf_nvuint8(nvl, "port_op", &addr->port_op)); - - PFNV_CHK(pf_validate_op(addr->port_op)); - -errout: - return (error); -} - -static nvlist_t * -pf_rule_addr_to_nvrule_addr(const struct pf_rule_addr *addr) -{ - nvlist_t *nvl; - nvlist_t *tmp; - - nvl = nvlist_create(0); - if (nvl == NULL) - return (NULL); - - tmp = pf_addr_wrap_to_nvaddr_wrap(&addr->addr); - if (tmp == NULL) - goto error; - nvlist_add_nvlist(nvl, "addr", tmp); - nvlist_destroy(tmp); - pf_uint16_array_nv(nvl, "port", addr->port, 2); - nvlist_add_number(nvl, "neg", addr->neg); - nvlist_add_number(nvl, "port_op", addr->port_op); - - return (nvl); - -error: - nvlist_destroy(nvl); - return (NULL); -} - -static int -pf_nvrule_uid_to_rule_uid(const nvlist_t *nvl, struct pf_rule_uid *uid) -{ - int error = 0; - - bzero(uid, sizeof(*uid)); - - PFNV_CHK(pf_nvuint32_array(nvl, "uid", uid->uid, 2, NULL)); - PFNV_CHK(pf_nvuint8(nvl, "op", &uid->op)); - - PFNV_CHK(pf_validate_op(uid->op)); - -errout: - return (error); -} - -static nvlist_t * -pf_rule_uid_to_nvrule_uid(const struct pf_rule_uid *uid) -{ - nvlist_t *nvl; - - nvl = nvlist_create(0); - if (nvl == NULL) - return (NULL); - - pf_uint32_array_nv(nvl, "uid", uid->uid, 2); - nvlist_add_number(nvl, "op", uid->op); - - return (nvl); -} - -static int -pf_nvrule_gid_to_rule_gid(const nvlist_t *nvl, struct pf_rule_gid *gid) -{ - /* Cheat a little. These stucts are the same, other than the name of - * the first field. */ - return (pf_nvrule_uid_to_rule_uid(nvl, (struct pf_rule_uid *)gid)); -} - -static int -pf_nvrule_to_krule(const nvlist_t *nvl, struct pf_krule **prule) -{ - struct pf_krule *rule; - int error = 0; - -#define ERROUT(x) ERROUT_FUNCTION(errout, x) - - rule = malloc(sizeof(*rule), M_PFRULE, M_WAITOK | M_ZERO); - - PFNV_CHK(pf_nvuint32(nvl, "nr", &rule->nr)); - - if (! nvlist_exists_nvlist(nvl, "src")) - ERROUT(EINVAL); - - error = pf_nvrule_addr_to_rule_addr(nvlist_get_nvlist(nvl, "src"), - &rule->src); - if (error != 0) - ERROUT(error); - - if (! nvlist_exists_nvlist(nvl, "dst")) - ERROUT(EINVAL); - - PFNV_CHK(pf_nvrule_addr_to_rule_addr(nvlist_get_nvlist(nvl, "dst"), - &rule->dst)); - - if (nvlist_exists_string(nvl, "label")) { - PFNV_CHK(pf_nvstring(nvl, "label", rule->label[0], - sizeof(rule->label[0]))); - } else if (nvlist_exists_string_array(nvl, "labels")) { - const char *const *strs; - size_t items; - int ret; - - strs = nvlist_get_string_array(nvl, "labels", &items); - if (items > PF_RULE_MAX_LABEL_COUNT) - ERROUT(E2BIG); - - for (size_t i = 0; i < items; i++) { - ret = strlcpy(rule->label[i], strs[i], - sizeof(rule->label[0])); - if (ret >= sizeof(rule->label[0])) - ERROUT(E2BIG); - } - } - - PFNV_CHK(pf_nvstring(nvl, "ifname", rule->ifname, - sizeof(rule->ifname))); - PFNV_CHK(pf_nvstring(nvl, "qname", rule->qname, sizeof(rule->qname))); - PFNV_CHK(pf_nvstring(nvl, "pqname", rule->pqname, - sizeof(rule->pqname))); - PFNV_CHK(pf_nvstring(nvl, "tagname", rule->tagname, - sizeof(rule->tagname))); - PFNV_CHK(pf_nvstring(nvl, "match_tagname", rule->match_tagname, - sizeof(rule->match_tagname))); - PFNV_CHK(pf_nvstring(nvl, "overload_tblname", rule->overload_tblname, - sizeof(rule->overload_tblname))); - - if (! nvlist_exists_nvlist(nvl, "rpool")) - ERROUT(EINVAL); - PFNV_CHK(pf_nvpool_to_pool(nvlist_get_nvlist(nvl, "rpool"), - &rule->rpool)); - - PFNV_CHK(pf_nvuint32(nvl, "os_fingerprint", &rule->os_fingerprint)); - - PFNV_CHK(pf_nvint(nvl, "rtableid", &rule->rtableid)); - PFNV_CHK(pf_nvuint32_array(nvl, "timeout", rule->timeout, PFTM_MAX, NULL)); - PFNV_CHK(pf_nvuint32(nvl, "max_states", &rule->max_states)); - PFNV_CHK(pf_nvuint32(nvl, "max_src_nodes", &rule->max_src_nodes)); - PFNV_CHK(pf_nvuint32(nvl, "max_src_states", &rule->max_src_states)); - PFNV_CHK(pf_nvuint32(nvl, "max_src_conn", &rule->max_src_conn)); - PFNV_CHK(pf_nvuint32(nvl, "max_src_conn_rate.limit", - &rule->max_src_conn_rate.limit)); - PFNV_CHK(pf_nvuint32(nvl, "max_src_conn_rate.seconds", - &rule->max_src_conn_rate.seconds)); - PFNV_CHK(pf_nvuint32(nvl, "prob", &rule->prob)); - PFNV_CHK(pf_nvuint32(nvl, "cuid", &rule->cuid)); - PFNV_CHK(pf_nvuint32(nvl, "cpid", &rule->cpid)); - - PFNV_CHK(pf_nvuint16(nvl, "return_icmp", &rule->return_icmp)); - PFNV_CHK(pf_nvuint16(nvl, "return_icmp6", &rule->return_icmp6)); - - PFNV_CHK(pf_nvuint16(nvl, "max_mss", &rule->max_mss)); - PFNV_CHK(pf_nvuint16(nvl, "scrub_flags", &rule->scrub_flags)); - - if (! nvlist_exists_nvlist(nvl, "uid")) - ERROUT(EINVAL); - PFNV_CHK(pf_nvrule_uid_to_rule_uid(nvlist_get_nvlist(nvl, "uid"), - &rule->uid)); - - if (! nvlist_exists_nvlist(nvl, "gid")) - ERROUT(EINVAL); - PFNV_CHK(pf_nvrule_gid_to_rule_gid(nvlist_get_nvlist(nvl, "gid"), - &rule->gid)); - - PFNV_CHK(pf_nvuint32(nvl, "rule_flag", &rule->rule_flag)); - PFNV_CHK(pf_nvuint8(nvl, "action", &rule->action)); - PFNV_CHK(pf_nvuint8(nvl, "direction", &rule->direction)); - PFNV_CHK(pf_nvuint8(nvl, "log", &rule->log)); - PFNV_CHK(pf_nvuint8(nvl, "logif", &rule->logif)); - PFNV_CHK(pf_nvuint8(nvl, "quick", &rule->quick)); - PFNV_CHK(pf_nvuint8(nvl, "ifnot", &rule->ifnot)); - PFNV_CHK(pf_nvuint8(nvl, "match_tag_not", &rule->match_tag_not)); - PFNV_CHK(pf_nvuint8(nvl, "natpass", &rule->natpass)); - - PFNV_CHK(pf_nvuint8(nvl, "keep_state", &rule->keep_state)); - PFNV_CHK(pf_nvuint8(nvl, "af", &rule->af)); - PFNV_CHK(pf_nvuint8(nvl, "proto", &rule->proto)); - PFNV_CHK(pf_nvuint8(nvl, "type", &rule->type)); - PFNV_CHK(pf_nvuint8(nvl, "code", &rule->code)); - PFNV_CHK(pf_nvuint8(nvl, "flags", &rule->flags)); - PFNV_CHK(pf_nvuint8(nvl, "flagset", &rule->flagset)); - PFNV_CHK(pf_nvuint8(nvl, "min_ttl", &rule->min_ttl)); - PFNV_CHK(pf_nvuint8(nvl, "allow_opts", &rule->allow_opts)); - PFNV_CHK(pf_nvuint8(nvl, "rt", &rule->rt)); - PFNV_CHK(pf_nvuint8(nvl, "return_ttl", &rule->return_ttl)); - PFNV_CHK(pf_nvuint8(nvl, "tos", &rule->tos)); - PFNV_CHK(pf_nvuint8(nvl, "set_tos", &rule->set_tos)); - PFNV_CHK(pf_nvuint8(nvl, "anchor_relative", &rule->anchor_relative)); - PFNV_CHK(pf_nvuint8(nvl, "anchor_wildcard", &rule->anchor_wildcard)); - - PFNV_CHK(pf_nvuint8(nvl, "flush", &rule->flush)); - PFNV_CHK(pf_nvuint8(nvl, "prio", &rule->prio)); - - PFNV_CHK(pf_nvuint8_array(nvl, "set_prio", &rule->prio, 2, NULL)); - - if (nvlist_exists_nvlist(nvl, "divert")) { - const nvlist_t *nvldivert = nvlist_get_nvlist(nvl, "divert"); - - if (! nvlist_exists_nvlist(nvldivert, "addr")) - ERROUT(EINVAL); - PFNV_CHK(pf_nvaddr_to_addr(nvlist_get_nvlist(nvldivert, "addr"), - &rule->divert.addr)); - PFNV_CHK(pf_nvuint16(nvldivert, "port", &rule->divert.port)); - } - - /* Validation */ -#ifndef INET - if (rule->af == AF_INET) - ERROUT(EAFNOSUPPORT); -#endif /* INET */ -#ifndef INET6 - if (rule->af == AF_INET6) - ERROUT(EAFNOSUPPORT); -#endif /* INET6 */ - - PFNV_CHK(pf_check_rule_addr(&rule->src)); - PFNV_CHK(pf_check_rule_addr(&rule->dst)); - - *prule = rule; - - return (0); - -#undef ERROUT -errout: - pf_krule_free(rule); - *prule = NULL; - - return (error); -} - -static nvlist_t * -pf_divert_to_nvdivert(const struct pf_krule *rule) -{ - nvlist_t *nvl; - nvlist_t *tmp; - - nvl = nvlist_create(0); - if (nvl == NULL) - return (NULL); - - tmp = pf_addr_to_nvaddr(&rule->divert.addr); - if (tmp == NULL) - goto error; - nvlist_add_nvlist(nvl, "addr", tmp); - nvlist_destroy(tmp); - nvlist_add_number(nvl, "port", rule->divert.port); - - return (nvl); - -error: - nvlist_destroy(nvl); - return (NULL); -} - -static nvlist_t * -pf_krule_to_nvrule(const struct pf_krule *rule) -{ - nvlist_t *nvl, *tmp; - - nvl = nvlist_create(0); - if (nvl == NULL) - return (nvl); - - nvlist_add_number(nvl, "nr", rule->nr); - tmp = pf_rule_addr_to_nvrule_addr(&rule->src); - if (tmp == NULL) - goto error; - nvlist_add_nvlist(nvl, "src", tmp); - nvlist_destroy(tmp); - tmp = pf_rule_addr_to_nvrule_addr(&rule->dst); - if (tmp == NULL) - goto error; - nvlist_add_nvlist(nvl, "dst", tmp); - nvlist_destroy(tmp); - - for (int i = 0; i < PF_SKIP_COUNT; i++) { - nvlist_append_number_array(nvl, "skip", - rule->skip[i].ptr ? rule->skip[i].ptr->nr : -1); - } - - for (int i = 0; i < PF_RULE_MAX_LABEL_COUNT; i++) { - nvlist_append_string_array(nvl, "labels", rule->label[i]); - } - nvlist_add_string(nvl, "label", rule->label[0]); - nvlist_add_string(nvl, "ifname", rule->ifname); - nvlist_add_string(nvl, "qname", rule->qname); - nvlist_add_string(nvl, "pqname", rule->pqname); - nvlist_add_string(nvl, "tagname", rule->tagname); - nvlist_add_string(nvl, "match_tagname", rule->match_tagname); - nvlist_add_string(nvl, "overload_tblname", rule->overload_tblname); - - tmp = pf_pool_to_nvpool(&rule->rpool); - if (tmp == NULL) - goto error; - nvlist_add_nvlist(nvl, "rpool", tmp); - nvlist_destroy(tmp); - - nvlist_add_number(nvl, "evaluations", - counter_u64_fetch(rule->evaluations)); - for (int i = 0; i < 2; i++) { - nvlist_append_number_array(nvl, "packets", - counter_u64_fetch(rule->packets[i])); - nvlist_append_number_array(nvl, "bytes", - counter_u64_fetch(rule->bytes[i])); - } - - nvlist_add_number(nvl, "os_fingerprint", rule->os_fingerprint); - - nvlist_add_number(nvl, "rtableid", rule->rtableid); - pf_uint32_array_nv(nvl, "timeout", rule->timeout, PFTM_MAX); - nvlist_add_number(nvl, "max_states", rule->max_states); - nvlist_add_number(nvl, "max_src_nodes", rule->max_src_nodes); - nvlist_add_number(nvl, "max_src_states", rule->max_src_states); - nvlist_add_number(nvl, "max_src_conn", rule->max_src_conn); - nvlist_add_number(nvl, "max_src_conn_rate.limit", - rule->max_src_conn_rate.limit); - nvlist_add_number(nvl, "max_src_conn_rate.seconds", - rule->max_src_conn_rate.seconds); - nvlist_add_number(nvl, "qid", rule->qid); - nvlist_add_number(nvl, "pqid", rule->pqid); - nvlist_add_number(nvl, "prob", rule->prob); - nvlist_add_number(nvl, "cuid", rule->cuid); - nvlist_add_number(nvl, "cpid", rule->cpid); - - nvlist_add_number(nvl, "states_cur", - counter_u64_fetch(rule->states_cur)); - nvlist_add_number(nvl, "states_tot", - counter_u64_fetch(rule->states_tot)); - nvlist_add_number(nvl, "src_nodes", - counter_u64_fetch(rule->src_nodes)); - - nvlist_add_number(nvl, "return_icmp", rule->return_icmp); - nvlist_add_number(nvl, "return_icmp6", rule->return_icmp6); - - nvlist_add_number(nvl, "max_mss", rule->max_mss); - nvlist_add_number(nvl, "scrub_flags", rule->scrub_flags); - - tmp = pf_rule_uid_to_nvrule_uid(&rule->uid); - if (tmp == NULL) - goto error; - nvlist_add_nvlist(nvl, "uid", tmp); - nvlist_destroy(tmp); - tmp = pf_rule_uid_to_nvrule_uid((const struct pf_rule_uid *)&rule->gid); - if (tmp == NULL) - goto error; - nvlist_add_nvlist(nvl, "gid", tmp); - nvlist_destroy(tmp); - - nvlist_add_number(nvl, "rule_flag", rule->rule_flag); - nvlist_add_number(nvl, "action", rule->action); - nvlist_add_number(nvl, "direction", rule->direction); - nvlist_add_number(nvl, "log", rule->log); - nvlist_add_number(nvl, "logif", rule->logif); - nvlist_add_number(nvl, "quick", rule->quick); - nvlist_add_number(nvl, "ifnot", rule->ifnot); - nvlist_add_number(nvl, "match_tag_not", rule->match_tag_not); - nvlist_add_number(nvl, "natpass", rule->natpass); - - nvlist_add_number(nvl, "keep_state", rule->keep_state); - nvlist_add_number(nvl, "af", rule->af); - nvlist_add_number(nvl, "proto", rule->proto); - nvlist_add_number(nvl, "type", rule->type); - nvlist_add_number(nvl, "code", rule->code); - nvlist_add_number(nvl, "flags", rule->flags); - nvlist_add_number(nvl, "flagset", rule->flagset); - nvlist_add_number(nvl, "min_ttl", rule->min_ttl); - nvlist_add_number(nvl, "allow_opts", rule->allow_opts); - nvlist_add_number(nvl, "rt", rule->rt); - nvlist_add_number(nvl, "return_ttl", rule->return_ttl); - nvlist_add_number(nvl, "tos", rule->tos); - nvlist_add_number(nvl, "set_tos", rule->set_tos); - nvlist_add_number(nvl, "anchor_relative", rule->anchor_relative); - nvlist_add_number(nvl, "anchor_wildcard", rule->anchor_wildcard); - - nvlist_add_number(nvl, "flush", rule->flush); - nvlist_add_number(nvl, "prio", rule->prio); - - pf_uint8_array_nv(nvl, "set_prio", &rule->prio, 2); - - tmp = pf_divert_to_nvdivert(rule); - if (tmp == NULL) - goto error; - nvlist_add_nvlist(nvl, "divert", tmp); - nvlist_destroy(tmp); - - return (nvl); - -error: - nvlist_destroy(nvl); - return (NULL); -} - static int pf_rule_to_krule(const struct pf_rule *rule, struct pf_krule *krule) { @@ -2572,219 +1922,6 @@ pf_state_kill_to_kstate_kill(const struct pfioc_state_kill *psk, return (0); } -static int -pf_nvstate_cmp_to_state_cmp(const nvlist_t *nvl, struct pf_state_cmp *cmp) -{ - int error = 0; - - bzero(cmp, sizeof(*cmp)); - - PFNV_CHK(pf_nvuint64(nvl, "id", &cmp->id)); - PFNV_CHK(pf_nvuint32(nvl, "creatorid", &cmp->creatorid)); - PFNV_CHK(pf_nvuint8(nvl, "direction", &cmp->direction)); - -errout: - return (error); -} - -static int -pf_nvstate_kill_to_kstate_kill(const nvlist_t *nvl, - struct pf_kstate_kill *kill) -{ - int error = 0; - - bzero(kill, sizeof(*kill)); - - if (! nvlist_exists_nvlist(nvl, "cmp")) - return (EINVAL); - - PFNV_CHK(pf_nvstate_cmp_to_state_cmp(nvlist_get_nvlist(nvl, "cmp"), - &kill->psk_pfcmp)); - PFNV_CHK(pf_nvuint8(nvl, "af", &kill->psk_af)); - PFNV_CHK(pf_nvint(nvl, "proto", &kill->psk_proto)); - - if (! nvlist_exists_nvlist(nvl, "src")) - return (EINVAL); - PFNV_CHK(pf_nvrule_addr_to_rule_addr(nvlist_get_nvlist(nvl, "src"), - &kill->psk_src)); - if (! nvlist_exists_nvlist(nvl, "dst")) - return (EINVAL); - PFNV_CHK(pf_nvrule_addr_to_rule_addr(nvlist_get_nvlist(nvl, "dst"), - &kill->psk_dst)); - if (nvlist_exists_nvlist(nvl, "rt_addr")) { - PFNV_CHK(pf_nvrule_addr_to_rule_addr( - nvlist_get_nvlist(nvl, "rt_addr"), &kill->psk_rt_addr)); - } - - PFNV_CHK(pf_nvstring(nvl, "ifname", kill->psk_ifname, - sizeof(kill->psk_ifname))); - PFNV_CHK(pf_nvstring(nvl, "label", kill->psk_label, - sizeof(kill->psk_label))); - if (nvlist_exists_bool(nvl, "kill_match")) - kill->psk_kill_match = nvlist_get_bool(nvl, "kill_match"); - -errout: - return (error); -} - -static nvlist_t * -pf_state_key_to_nvstate_key(const struct pf_state_key *key) -{ - nvlist_t *nvl, *tmp; - - nvl = nvlist_create(0); - if (nvl == NULL) - return (NULL); - - for (int i = 0; i < 2; i++) { - tmp = pf_addr_to_nvaddr(&key->addr[i]); - if (tmp == NULL) - goto errout; - nvlist_append_nvlist_array(nvl, "addr", tmp); - nvlist_append_number_array(nvl, "port", key->port[i]); - } - nvlist_add_number(nvl, "af", key->af); - nvlist_add_number(nvl, "proto", key->proto); - - return (nvl); - -errout: - nvlist_destroy(nvl); - return (NULL); -} - -static nvlist_t * -pf_state_scrub_to_nvstate_scrub(const struct pf_state_scrub *scrub) -{ - nvlist_t *nvl; - - nvl = nvlist_create(0); - if (nvl == NULL) - return (NULL); - - nvlist_add_bool(nvl, "timestamp", scrub->pfss_flags & PFSS_TIMESTAMP); - nvlist_add_number(nvl, "ttl", scrub->pfss_ttl); - nvlist_add_number(nvl, "ts_mod", scrub->pfss_ts_mod); - - return (nvl); -} - -static nvlist_t * -pf_state_peer_to_nvstate_peer(const struct pf_state_peer *peer) -{ - nvlist_t *nvl, *tmp; - - nvl = nvlist_create(0); - if (nvl == NULL) - return (NULL); - - if (peer->scrub) { - tmp = pf_state_scrub_to_nvstate_scrub(peer->scrub); - if (tmp == NULL) - goto errout; - nvlist_add_nvlist(nvl, "scrub", tmp); - nvlist_destroy(tmp); - } - - nvlist_add_number(nvl, "seqlo", peer->seqlo); - nvlist_add_number(nvl, "seqhi", peer->seqhi); - nvlist_add_number(nvl, "seqdiff", peer->seqdiff); - nvlist_add_number(nvl, "max_win", peer->max_win); - nvlist_add_number(nvl, "mss", peer->mss); - nvlist_add_number(nvl, "state", peer->state); - nvlist_add_number(nvl, "wscale", peer->wscale); - - return (nvl); - -errout: - nvlist_destroy(nvl); - return (NULL); -} - - -static nvlist_t * -pf_state_to_nvstate(const struct pf_state *s) -{ - nvlist_t *nvl, *tmp; - uint32_t expire, flags = 0; - - nvl = nvlist_create(0); - if (nvl == NULL) - return (NULL); - - nvlist_add_number(nvl, "id", s->id); - nvlist_add_string(nvl, "ifname", s->kif->pfik_name); - nvlist_add_string(nvl, "orig_ifname", s->orig_kif->pfik_name); - - tmp = pf_state_key_to_nvstate_key(s->key[PF_SK_STACK]); - if (tmp == NULL) - goto errout; - nvlist_add_nvlist(nvl, "stack_key", tmp); - nvlist_destroy(tmp); - - tmp = pf_state_key_to_nvstate_key(s->key[PF_SK_WIRE]); - if (tmp == NULL) - goto errout; - nvlist_add_nvlist(nvl, "wire_key", tmp); - nvlist_destroy(tmp); - - tmp = pf_state_peer_to_nvstate_peer(&s->src); - if (tmp == NULL) - goto errout; - nvlist_add_nvlist(nvl, "src", tmp); - nvlist_destroy(tmp); - - tmp = pf_state_peer_to_nvstate_peer(&s->dst); - if (tmp == NULL) - goto errout; - nvlist_add_nvlist(nvl, "dst", tmp); - nvlist_destroy(tmp); - - tmp = pf_addr_to_nvaddr(&s->rt_addr); - if (tmp == NULL) - goto errout; - nvlist_add_nvlist(nvl, "rt_addr", tmp); - nvlist_destroy(tmp); - - nvlist_add_number(nvl, "rule", s->rule.ptr ? s->rule.ptr->nr : -1); - nvlist_add_number(nvl, "anchor", - s->anchor.ptr ? s->anchor.ptr->nr : -1); - nvlist_add_number(nvl, "nat_rule", - s->nat_rule.ptr ? s->nat_rule.ptr->nr : -1); - nvlist_add_number(nvl, "creation", s->creation); - - expire = pf_state_expires(s); - if (expire <= time_uptime) - expire = 0; - else - expire = expire - time_uptime; - nvlist_add_number(nvl, "expire", expire); - - for (int i = 0; i < 2; i++) { - nvlist_append_number_array(nvl, "packets", - counter_u64_fetch(s->packets[i])); - nvlist_append_number_array(nvl, "bytes", - counter_u64_fetch(s->bytes[i])); - } - - nvlist_add_number(nvl, "creatorid", s->creatorid); - nvlist_add_number(nvl, "direction", s->direction); - nvlist_add_number(nvl, "log", s->log); - nvlist_add_number(nvl, "state_flags", s->state_flags); - nvlist_add_number(nvl, "timeout", s->timeout); - if (s->src_node) - flags |= PFSYNC_FLAG_SRCNODE; - if (s->nat_src_node) - flags |= PFSYNC_FLAG_NATSRCNODE; - nvlist_add_number(nvl, "sync_flags", flags); - - return (nvl); - -errout: - nvlist_destroy(nvl); - return (NULL); -} - static int pf_ioctl_addrule(struct pf_krule *rule, uint32_t ticket, uint32_t pool_ticket, const char *anchor, const char *anchor_call, @@ -3150,8 +2287,9 @@ pfioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags, struct thread *td if (! nvlist_exists_nvlist(nvl, "rule")) ERROUT(EINVAL); + rule = malloc(sizeof(*rule), M_PFRULE, M_WAITOK | M_ZERO); error = pf_nvrule_to_krule(nvlist_get_nvlist(nvl, "rule"), - &rule); + rule); if (error) ERROUT(error); diff --git a/sys/netpfil/pf/pf_nv.c b/sys/netpfil/pf/pf_nv.c index 1fdb52e5fad0..863259dbf9aa 100644 --- a/sys/netpfil/pf/pf_nv.c +++ b/sys/netpfil/pf/pf_nv.c @@ -28,9 +28,13 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_inet.h" +#include "opt_inet6.h" + #include #include #include +#include #include #include @@ -137,3 +141,850 @@ pf_nvstring(const nvlist_t *nvl, const char *name, char *str, size_t maxlen) return (0); } + +static int +pf_nvaddr_to_addr(const nvlist_t *nvl, struct pf_addr *paddr) +{ + return (pf_nvbinary(nvl, "addr", paddr, sizeof(*paddr))); +} + +static nvlist_t * +pf_addr_to_nvaddr(const struct pf_addr *paddr) +{ + nvlist_t *nvl; + + nvl = nvlist_create(0); + if (nvl == NULL) + return (NULL); + + nvlist_add_binary(nvl, "addr", paddr, sizeof(*paddr)); + + return (nvl); +} + +static int +pf_nvmape_to_mape(const nvlist_t *nvl, struct pf_mape_portset *mape) +{ + int error = 0; + + bzero(mape, sizeof(*mape)); + PFNV_CHK(pf_nvuint8(nvl, "offset", &mape->offset)); + PFNV_CHK(pf_nvuint8(nvl, "psidlen", &mape->psidlen)); + PFNV_CHK(pf_nvuint16(nvl, "psid", &mape->psid)); + +errout: + return (error); +} + +static nvlist_t * +pf_mape_to_nvmape(const struct pf_mape_portset *mape) +{ *** 869 LINES SKIPPED *** From owner-dev-commits-src-branches@freebsd.org Tue Jun 1 20:36:32 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4864A65D15F; Tue, 1 Jun 2021 20:36: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 4FvkTX1SHfz4hP2; Tue, 1 Jun 2021 20:36:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1976A220F; Tue, 1 Jun 2021 20:36:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 151KaWR7057350; Tue, 1 Jun 2021 20:36:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 151KaWgY057349; Tue, 1 Jun 2021 20:36:32 GMT (envelope-from git) Date: Tue, 1 Jun 2021 20:36:32 GMT Message-Id: <202106012036.151KaWgY057349@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: b74cdf1eceae - releng/13.0 - Add UPDATING entries and bump version 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: b74cdf1eceaecc9e3e533cd7f544e3eb297509c6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jun 2021 20:36:32 -0000 The branch releng/13.0 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=b74cdf1eceaecc9e3e533cd7f544e3eb297509c6 commit b74cdf1eceaecc9e3e533cd7f544e3eb297509c6 Author: Mark Johnston AuthorDate: 2021-06-01 20:28:18 +0000 Commit: Mark Johnston CommitDate: 2021-06-01 20:28:18 +0000 Add UPDATING entries and bump version Approved by: so --- UPDATING | 5 +++++ sys/conf/newvers.sh | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/UPDATING b/UPDATING index fe5eef74243c..87e4818e3ae7 100644 --- a/UPDATING +++ b/UPDATING @@ -11,6 +11,11 @@ handbook: Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before running portupgrade. +20210601: + 13.0-RELEASE-p2 FreeBSD-EN-21:17.libradius + + Incorrect validation in rad_get_attr(3) [FreeBSD-EN-21:17.libradius] + 20210526: 13.0-RELEASE-p1 FreeBSD-EN-21:12.divert FreeBSD-EN-21:13.mpt diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index e763d92f274c..e09ee0afdaec 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -54,7 +54,7 @@ TYPE="FreeBSD" REVISION="13.0" -BRANCH="RELEASE-p1" +BRANCH="RELEASE-p2" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-dev-commits-src-branches@freebsd.org Tue Jun 1 20:36:31 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 258FE65CFE8; Tue, 1 Jun 2021 20:36: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 4FvkTW0TX7z4hG1; Tue, 1 Jun 2021 20:36:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EC64E1978; Tue, 1 Jun 2021 20:36:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 151KaUGJ057329; Tue, 1 Jun 2021 20:36:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 151KaUP4057328; Tue, 1 Jun 2021 20:36:30 GMT (envelope-from git) Date: Tue, 1 Jun 2021 20:36:30 GMT Message-Id: <202106012036.151KaUP4057328@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 8acc450613c3 - releng/13.0 - libradius: Fix attribute length validation in rad_get_attr(3) 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 8acc450613c31d7cb7997eeca995369109cc7742 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jun 2021 20:36:31 -0000 The branch releng/13.0 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=8acc450613c31d7cb7997eeca995369109cc7742 commit 8acc450613c31d7cb7997eeca995369109cc7742 Author: Mark Johnston AuthorDate: 2021-05-28 14:41:43 +0000 Commit: Mark Johnston CommitDate: 2021-06-01 20:26:32 +0000 libradius: Fix attribute length validation in rad_get_attr(3) The length of the attribute header needs to be excluded when comparing the attribute length against the length of the packet. Otherwise, validation may incorrectly fail when fetching the final attribute in a message. Approved by: so Security: FreeBSD-EN-21:17.libradius Fixes: 8d5c78130 ("libradius: Fix input validation bugs") Reported by: Peter Eriksson Tested by: Peter Eriksson Sponsored by: The FreeBSD Foundation (cherry picked from commit 6bb5699d2b59491097bc21ffa3c097cdd4853f89) (cherry picked from commit f9972532343bb1eb101bf7afef2966972eea3b5e) --- lib/libradius/radlib.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/libradius/radlib.c b/lib/libradius/radlib.c index 18aee8b53024..4d21887c4ee2 100644 --- a/lib/libradius/radlib.c +++ b/lib/libradius/radlib.c @@ -964,7 +964,12 @@ rad_get_attr(struct rad_handle *h, const void **value, size_t *lenp) } type = h->in[h->in_pos++]; len = h->in[h->in_pos++]; - if (len < 2 || h->in_pos + len > h->in_len) { + if (len < 2) { + generr(h, "Malformed attribute in response"); + return -1; + } + len -= 2; + if (h->in_pos + len > h->in_len) { generr(h, "Malformed attribute in response"); return -1; } From owner-dev-commits-src-branches@freebsd.org Tue Jun 1 20:36:35 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8885065D317; Tue, 1 Jun 2021 20:36:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FvkTb2pJhz4hCQ; Tue, 1 Jun 2021 20:36:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4605A1FE2; Tue, 1 Jun 2021 20:36:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 151KaZDd057477; Tue, 1 Jun 2021 20:36:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 151KaZUi057476; Tue, 1 Jun 2021 20:36:35 GMT (envelope-from git) Date: Tue, 1 Jun 2021 20:36:35 GMT Message-Id: <202106012036.151KaZUi057476@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: a946f99873fc - releng/12.2 - libradius: Fix attribute length validation in rad_get_attr(3) 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/releng/12.2 X-Git-Reftype: branch X-Git-Commit: a946f99873fc09ad30ae0cc9c9ad01e39466fa5f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jun 2021 20:36:35 -0000 The branch releng/12.2 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=a946f99873fc09ad30ae0cc9c9ad01e39466fa5f commit a946f99873fc09ad30ae0cc9c9ad01e39466fa5f Author: Mark Johnston AuthorDate: 2021-05-28 14:41:43 +0000 Commit: Mark Johnston CommitDate: 2021-06-01 20:30:41 +0000 libradius: Fix attribute length validation in rad_get_attr(3) The length of the attribute header needs to be excluded when comparing the attribute length against the length of the packet. Otherwise, validation may incorrectly fail when fetching the final attribute in a message. Approved by: so Security: FreeBSD-EN-21:17.libradius Fixes: 8d5c78130 ("libradius: Fix input validation bugs") Reported by: Peter Eriksson Tested by: Peter Eriksson Sponsored by: The FreeBSD Foundation (cherry picked from commit 6bb5699d2b59491097bc21ffa3c097cdd4853f89) (cherry picked from commit f9972532343bb1eb101bf7afef2966972eea3b5e) --- lib/libradius/radlib.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/libradius/radlib.c b/lib/libradius/radlib.c index a70c8c62a9e7..c9711d2e6296 100644 --- a/lib/libradius/radlib.c +++ b/lib/libradius/radlib.c @@ -964,7 +964,12 @@ rad_get_attr(struct rad_handle *h, const void **value, size_t *lenp) } type = h->in[h->in_pos++]; len = h->in[h->in_pos++]; - if (len < 2 || h->in_pos + len > h->in_len) { + if (len < 2) { + generr(h, "Malformed attribute in response"); + return -1; + } + len -= 2; + if (h->in_pos + len > h->in_len) { generr(h, "Malformed attribute in response"); return -1; } From owner-dev-commits-src-branches@freebsd.org Tue Jun 1 20:36:36 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CD40F65D0C3; Tue, 1 Jun 2021 20:36:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FvkTc49m7z4h56; Tue, 1 Jun 2021 20:36:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6EC601FE3; Tue, 1 Jun 2021 20:36:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 151KaaNZ057498; Tue, 1 Jun 2021 20:36:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 151KaaFE057497; Tue, 1 Jun 2021 20:36:36 GMT (envelope-from git) Date: Tue, 1 Jun 2021 20:36:36 GMT Message-Id: <202106012036.151KaaFE057497@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 6e927d10c587 - releng/12.2 - Add UPDATING entries and bump version 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/releng/12.2 X-Git-Reftype: branch X-Git-Commit: 6e927d10c5871fa2c1e77d6bf01646523a317de7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jun 2021 20:36:36 -0000 The branch releng/12.2 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=6e927d10c5871fa2c1e77d6bf01646523a317de7 commit 6e927d10c5871fa2c1e77d6bf01646523a317de7 Author: Mark Johnston AuthorDate: 2021-06-01 20:32:27 +0000 Commit: Mark Johnston CommitDate: 2021-06-01 20:32:35 +0000 Add UPDATING entries and bump version Approved by: so --- UPDATING | 4 ++++ sys/conf/newvers.sh | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/UPDATING b/UPDATING index d4d236cb8395..f2a49d9dc59b 100644 --- a/UPDATING +++ b/UPDATING @@ -16,6 +16,10 @@ from older versions of FreeBSD, try WITHOUT_CLANG and WITH_GCC to bootstrap to the tip of head, and then rebuild without this option. The bootstrap process from older version of current across the gcc/clang cutover is a bit fragile. +20210601: p8 FreeBSD-EN-21:17.libradius + + Incorrect validation in rad_get_attr(3) [FreeBSD-EN-21:17.libradius] + 20210526: p7 FreeBSD-EN-21:11.aesni FreeBSD-EN-21:14.pms FreeBSD-SA-21:11.smap diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index db48e3ee749b..87d2af8c7f4f 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -49,7 +49,7 @@ TYPE="FreeBSD" REVISION="12.2" -BRANCH="RELEASE-p7" +BRANCH="RELEASE-p8" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-dev-commits-src-branches@freebsd.org Tue Jun 1 20:36:55 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4206A65D499; Tue, 1 Jun 2021 20:36:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FvkTz10VKz4hTv; Tue, 1 Jun 2021 20:36:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0A2651D4E; Tue, 1 Jun 2021 20:36:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 151KasH0057684; Tue, 1 Jun 2021 20:36:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 151KaspX057683; Tue, 1 Jun 2021 20:36:54 GMT (envelope-from git) Date: Tue, 1 Jun 2021 20:36:54 GMT Message-Id: <202106012036.151KaspX057683@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 4e2e151b2099 - releng/11.4 - libradius: Fix attribute length validation in rad_get_attr(3) 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/releng/11.4 X-Git-Reftype: branch X-Git-Commit: 4e2e151b2099f3815ef1d170efc727c4b7cec98c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jun 2021 20:36:55 -0000 The branch releng/11.4 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=4e2e151b2099f3815ef1d170efc727c4b7cec98c commit 4e2e151b2099f3815ef1d170efc727c4b7cec98c Author: Mark Johnston AuthorDate: 2021-05-28 14:41:43 +0000 Commit: Mark Johnston CommitDate: 2021-06-01 20:32:50 +0000 libradius: Fix attribute length validation in rad_get_attr(3) The length of the attribute header needs to be excluded when comparing the attribute length against the length of the packet. Otherwise, validation may incorrectly fail when fetching the final attribute in a message. Approved by: so Security: FreeBSD-EN-21:17.libradius Fixes: 8d5c78130 ("libradius: Fix input validation bugs") Reported by: Peter Eriksson Tested by: Peter Eriksson Sponsored by: The FreeBSD Foundation (cherry picked from commit 6bb5699d2b59491097bc21ffa3c097cdd4853f89) (cherry picked from commit f9972532343bb1eb101bf7afef2966972eea3b5e) --- lib/libradius/radlib.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/libradius/radlib.c b/lib/libradius/radlib.c index acca95da6f66..e679b95089b0 100644 --- a/lib/libradius/radlib.c +++ b/lib/libradius/radlib.c @@ -949,7 +949,12 @@ rad_get_attr(struct rad_handle *h, const void **value, size_t *lenp) } type = h->in[h->in_pos++]; len = h->in[h->in_pos++]; - if (len < 2 || h->in_pos + len > h->in_len) { + if (len < 2) { + generr(h, "Malformed attribute in response"); + return -1; + } + len -= 2; + if (h->in_pos + len > h->in_len) { generr(h, "Malformed attribute in response"); return -1; } From owner-dev-commits-src-branches@freebsd.org Tue Jun 1 20:36:56 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8158265D4A3; Tue, 1 Jun 2021 20:36:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FvkV02635z4hN4; Tue, 1 Jun 2021 20:36:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2691C2210; Tue, 1 Jun 2021 20:36:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 151KauMe057705; Tue, 1 Jun 2021 20:36:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 151KauP0057704; Tue, 1 Jun 2021 20:36:56 GMT (envelope-from git) Date: Tue, 1 Jun 2021 20:36:56 GMT Message-Id: <202106012036.151KauP0057704@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 53de482ad419 - releng/11.4 - Add UPDATING entries and bump version 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/releng/11.4 X-Git-Reftype: branch X-Git-Commit: 53de482ad419a777e3353fcc91865badf4ec062c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jun 2021 20:36:56 -0000 The branch releng/11.4 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=53de482ad419a777e3353fcc91865badf4ec062c commit 53de482ad419a777e3353fcc91865badf4ec062c Author: Mark Johnston AuthorDate: 2021-06-01 20:33:37 +0000 Commit: Mark Johnston CommitDate: 2021-06-01 20:36:48 +0000 Add UPDATING entries and bump version Approved by: so --- UPDATING | 4 ++++ sys/conf/newvers.sh | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/UPDATING b/UPDATING index a3b23454db4b..8a9f819405fa 100644 --- a/UPDATING +++ b/UPDATING @@ -16,6 +16,10 @@ from older versions of FreeBSD, try WITHOUT_CLANG and WITH_GCC to bootstrap to the tip of head, and then rebuild without this option. The bootstrap process from older version of current across the gcc/clang cutover is a bit fragile. +20210601: p11 FreeBSD-EN-21:17.libradius + + Incorrect validation in rad_get_attr(3) [FreeBSD-EN-21:17.libradius] + 20210526: p10 FreeBSD-SA-21:12.libradius Missing message validation in libradius(3) [FreeBSD-SA-21:12.libradius] diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index c01f16587f3c..360ee0de08ab 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -44,7 +44,7 @@ TYPE="FreeBSD" REVISION="11.4" -BRANCH="RELEASE-p10" +BRANCH="RELEASE-p11" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-dev-commits-src-branches@freebsd.org Wed Jun 2 02:09:30 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DCAB163770A; Wed, 2 Jun 2021 02:09: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 4Fvssk5fxSz3Jc4; Wed, 2 Jun 2021 02:09:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A5DB9636B; Wed, 2 Jun 2021 02:09:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15229U7l094123; Wed, 2 Jun 2021 02:09:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15229Uhg094122; Wed, 2 Jun 2021 02:09:30 GMT (envelope-from git) Date: Wed, 2 Jun 2021 02:09:30 GMT Message-Id: <202106020209.15229Uhg094122@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 5ceb90aa667a - stable/13 - elfctl: avoid touching file if no change made MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5ceb90aa667afbd0941f045073d54aea35d40f1b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jun 2021 02:09:30 -0000 The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=5ceb90aa667afbd0941f045073d54aea35d40f1b commit 5ceb90aa667afbd0941f045073d54aea35d40f1b Author: Ed Maste AuthorDate: 2021-05-25 18:25:18 +0000 Commit: Ed Maste CommitDate: 2021-06-02 02:08:54 +0000 elfctl: avoid touching file if no change made Suggested by: brooks Reviewed by: brooks, markj MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D30452 (cherry picked from commit 3f2508b7f3855102abed99b846e30e728ba3d04d) --- usr.bin/elfctl/elfctl.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/usr.bin/elfctl/elfctl.c b/usr.bin/elfctl/elfctl.c index bcdd1be394a9..04719b487613 100644 --- a/usr.bin/elfctl/elfctl.c +++ b/usr.bin/elfctl/elfctl.c @@ -288,7 +288,7 @@ convert_to_feature_val(char *feature_str, uint32_t *feature_val) static bool edit_file_features(Elf *elf, int phcount, int fd, char *val) { - uint32_t features; + uint32_t features, prev_features; uint64_t off; if (!get_file_features(elf, phcount, fd, &features, &off)) { @@ -296,8 +296,12 @@ edit_file_features(Elf *elf, int phcount, int fd, char *val) return (false); } + prev_features = features; if (!convert_to_feature_val(val, &features)) return (false); + /* Avoid touching file if no change. */ + if (features == prev_features) + return (true); if (lseek(fd, off, SEEK_SET) == -1 || write(fd, &features, sizeof(features)) < From owner-dev-commits-src-branches@freebsd.org Wed Jun 2 03:40:10 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AD6E96386D0; Wed, 2 Jun 2021 03:40: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 4FvvtL4YZbz3Q4R; Wed, 2 Jun 2021 03:40:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 81A7278E7; Wed, 2 Jun 2021 03:40:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1523eAaq017491; Wed, 2 Jun 2021 03:40:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1523eAmi017488; Wed, 2 Jun 2021 03:40:10 GMT (envelope-from git) Date: Wed, 2 Jun 2021 03:40:10 GMT Message-Id: <202106020340.1523eAmi017488@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: 6ee59ffb5ba1 - stable/13 - Fix packet cbs/ebs conversion. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6ee59ffb5ba17e737bd9c58940f2d68e0e496091 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jun 2021 03:40:10 -0000 The branch stable/13 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=6ee59ffb5ba17e737bd9c58940f2d68e0e496091 commit 6ee59ffb5ba17e737bd9c58940f2d68e0e496091 Author: Alexander Motin AuthorDate: 2021-05-19 15:00:21 +0000 Commit: Alexander Motin CommitDate: 2021-06-02 03:40:05 +0000 Fix packet cbs/ebs conversion. Each packet is counted as 128 bytes by the code, not 125. Not sure what I was thinking about here 14 years ago. May be just a typo. Reported by: Dmitry Luhtionov MFC after: 2 weeks (cherry picked from commit 4a6830761c6552bfe2c118a73a5a461694cb84c7) --- sys/netgraph/ng_car.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/netgraph/ng_car.c b/sys/netgraph/ng_car.c index 9474e2467439..ec61a3565ec9 100644 --- a/sys/netgraph/ng_car.c +++ b/sys/netgraph/ng_car.c @@ -491,14 +491,14 @@ ng_car_rcvmsg(node_p node, item_p item, hook_p lasthook) if (bconf->downstream.opt & NG_CAR_COUNT_PACKETS) { bconf->downstream.cir *= 1024; bconf->downstream.pir *= 1024; - bconf->downstream.cbs *= 125; - bconf->downstream.ebs *= 125; + bconf->downstream.cbs *= 128; + bconf->downstream.ebs *= 128; } if (bconf->upstream.opt & NG_CAR_COUNT_PACKETS) { bconf->upstream.cir *= 1024; bconf->upstream.pir *= 1024; - bconf->upstream.cbs *= 125; - bconf->upstream.ebs *= 125; + bconf->upstream.cbs *= 128; + bconf->upstream.ebs *= 128; } if ((bconf->downstream.cir > 1000000000) || (bconf->downstream.pir > 1000000000) || From owner-dev-commits-src-branches@freebsd.org Wed Jun 2 03:40:58 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8A450638673; Wed, 2 Jun 2021 03:40:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FvvvG3ZNCz3QL1; Wed, 2 Jun 2021 03:40:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6378775F2; Wed, 2 Jun 2021 03:40:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1523ewHj023432; Wed, 2 Jun 2021 03:40:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1523ew0P023431; Wed, 2 Jun 2021 03:40:58 GMT (envelope-from git) Date: Wed, 2 Jun 2021 03:40:58 GMT Message-Id: <202106020340.1523ew0P023431@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: 52e8b0627784 - stable/12 - Fix packet cbs/ebs conversion. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 52e8b06277847d9332d3678c01f185a3cce3ec28 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jun 2021 03:40:58 -0000 The branch stable/12 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=52e8b06277847d9332d3678c01f185a3cce3ec28 commit 52e8b06277847d9332d3678c01f185a3cce3ec28 Author: Alexander Motin AuthorDate: 2021-05-19 15:00:21 +0000 Commit: Alexander Motin CommitDate: 2021-06-02 03:40:50 +0000 Fix packet cbs/ebs conversion. Each packet is counted as 128 bytes by the code, not 125. Not sure what I was thinking about here 14 years ago. May be just a typo. Reported by: Dmitry Luhtionov MFC after: 2 weeks (cherry picked from commit 4a6830761c6552bfe2c118a73a5a461694cb84c7) --- sys/netgraph/ng_car.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/netgraph/ng_car.c b/sys/netgraph/ng_car.c index d3ac2b7042a4..6c814870e65d 100644 --- a/sys/netgraph/ng_car.c +++ b/sys/netgraph/ng_car.c @@ -492,14 +492,14 @@ ng_car_rcvmsg(node_p node, item_p item, hook_p lasthook) if (bconf->downstream.opt & NG_CAR_COUNT_PACKETS) { bconf->downstream.cir *= 1024; bconf->downstream.pir *= 1024; - bconf->downstream.cbs *= 125; - bconf->downstream.ebs *= 125; + bconf->downstream.cbs *= 128; + bconf->downstream.ebs *= 128; } if (bconf->upstream.opt & NG_CAR_COUNT_PACKETS) { bconf->upstream.cir *= 1024; bconf->upstream.pir *= 1024; - bconf->upstream.cbs *= 125; - bconf->upstream.ebs *= 125; + bconf->upstream.cbs *= 128; + bconf->upstream.ebs *= 128; } if ((bconf->downstream.cir > 1000000000) || (bconf->downstream.pir > 1000000000) || From owner-dev-commits-src-branches@freebsd.org Wed Jun 2 05:35:45 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A1E1163A44A; Wed, 2 Jun 2021 05:35:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FvyRj4BpKz3q59; Wed, 2 Jun 2021 05:35:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 73B78118C3; Wed, 2 Jun 2021 05:35:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1525ZjHY072617; Wed, 2 Jun 2021 05:35:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1525Zjr5072616; Wed, 2 Jun 2021 05:35:45 GMT (envelope-from git) Date: Wed, 2 Jun 2021 05:35:45 GMT Message-Id: <202106020535.1525Zjr5072616@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: 49a331807eea - stable/13 - tcsh: cleanup source tree to reduce diff size. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 49a331807eea443db87b54c0f6935be68aa7fe82 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jun 2021 05:35:45 -0000 The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=49a331807eea443db87b54c0f6935be68aa7fe82 commit 49a331807eea443db87b54c0f6935be68aa7fe82 Author: Dmitry Chagin AuthorDate: 2021-05-19 21:08:25 +0000 Commit: Dmitry Chagin CommitDate: 2021-06-02 05:33:03 +0000 tcsh: cleanup source tree to reduce diff size. Remove makefiles, configure files and unused at build time files to reduce the diff size. Otherwise the diff contains a lot of unnecessary lines what makes reviewing and merging proccess so hard, especially for re@. (cherry picked from commit 6190ff6104aed4cd753019325a252c4d66495b5e) --- contrib/tcsh/FREEBSD-Xlist | 15 + contrib/tcsh/Imakefile | 631 --- contrib/tcsh/MAKEDIFFS | 40 - contrib/tcsh/MAKESHAR | 120 - contrib/tcsh/Makefile.ADMIN | 24 - contrib/tcsh/Makefile.in | 782 ---- contrib/tcsh/Makefile.std | 630 --- contrib/tcsh/Makefile.vms | 592 --- contrib/tcsh/config.guess | 1438 ------- contrib/tcsh/config.h.in | 275 -- contrib/tcsh/config.rpath | 571 --- contrib/tcsh/config.sub | 1788 --------- contrib/tcsh/configure | 8842 ------------------------------------------- contrib/tcsh/imake.config | 63 - contrib/tcsh/install-sh | 520 --- contrib/tcsh/svn | 32 - 16 files changed, 15 insertions(+), 16348 deletions(-) diff --git a/contrib/tcsh/FREEBSD-Xlist b/contrib/tcsh/FREEBSD-Xlist index b6e5636aa567..49621ab36f0f 100644 --- a/contrib/tcsh/FREEBSD-Xlist +++ b/contrib/tcsh/FREEBSD-Xlist @@ -1,5 +1,20 @@ $FreeBSD$ */BUGS +*/Imakefile +*/MAKEDIFFS +*/MAKESHAR +*/Makefile.ADMIN +*/Makefile.in +*/Makefile.std +*/Makefile.vms +*/config.guess +*/config.h.in +*/config.rpath +*/config.sub +*/configure +*/imake.config +*/install-sh +*/svn */config/a* */config/bs2000 */config/bsd diff --git a/contrib/tcsh/Imakefile b/contrib/tcsh/Imakefile deleted file mode 100644 index bd1b43b1a24e..000000000000 --- a/contrib/tcsh/Imakefile +++ /dev/null @@ -1,631 +0,0 @@ -XCOMM -XCOMM Imakefile for tcsh 6.12 -XCOMM Marc Horowitz, MIT SIPB -XCOMM - -#ifdef DestDir -#undef DestDir -#endif -#ifdef ManSuffix -#undef ManSuffix -#endif - -/* All config options go in a separate file. */ - -#include "imake.config" - -#ifndef HasGcc -# define HasGcc 0 -#endif - -#ifndef HasGcc2 -# define HasGcc2 0 -#endif - -/* This is a giant conditional block. It should be set up right for -platforms which are in here, but it may need to be changed for new -ones. Please send in your fixes and additions! */ - -/**** tcsh configuration defines ****/ - -/* specific platforms */ - -#ifndef ConfigH -# ifdef UltrixArchitecture -# define ConfigH ultrix -# endif - -# ifdef UxpArchitecture -# define ConfigH sysv4 -# endif - -# if defined(LinuxArchitecture) || defined(GNUArchitecture) -# define ConfigH linux -# endif - -# ifdef AlphaArchitecture -# if !defined(LinuxArchitecture) && !defined(GNUArchitecture) -# define ConfigH decosf1 -# endif -# if !HasGcc -# define MyCflags -std1 -Olimit 2000 -# else -# define NoCombineRegs -# endif -# endif - -# if defined(VaxArchitecture) && !defined(UltrixArchitecture) -# define ConfigH bsd -# endif - -# ifdef NeXTArchitecture -# define ConfigH mach -# endif - -# if defined(SunArchitecture) -# if (OSMajorVersion == 3) -# define ConfigH sunos35 -# else -# if (OSMajorVersion == 4) -# if (OSMinorVersion == 0) -# define ConfigH sunos40 -# else /* OSMinorVersion == 1 */ -# if (OSTeenyVersion == 3) -# define ConfigH sunos413 -# else /* OsTeenyVersion in [0,1,2] */ -# define ConfigH sunos41 -# endif -# endif -# define NoCombineRegs -# else /* OSMajorVersion == 5 */ -# if (OSMinorVersion < 3) -# if (OSMinorVersion < 2) -# define ConfigH sol2 -# else -# define ConfigH sol22 -# endif -# else -# if (OSMinorVersion < 4) -# define ConfigH sol23 -# else -# if (OSMinorVersion < 6) -# define ConfigH sol24 -# else -# if (OSMinorVersion < 9) -# define ConfigH sol26 -# else -# define ConfigH sol29 -# endif -# endif -# endif -# endif -# define NoCombineRegs -# endif -# endif -# endif - -# ifdef HPArchitecture -/* For some stupid reason makedepend on HP requires this */ -DEPENDFLAGS = -o.o -# if (OSMajorVersion >= 8) -# define ConfigH hpux8 -# else -# define ConfigH hpux7 -# endif -# endif - -# ifdef CrayArchitecture -# define ConfigH cray -# endif - -# ifdef SGIArchitecture -# define ConfigH irix -# define UseLibBSD -# if (OSMajorVersion < 5) -# ifdef you_are_using_yp -# define UseSunLib -# endif -# if !HasGCC -# define MyStdc -D__STDC__ -# if SGICompilerMajorVersion < 4 -CCOPTIONS=-float # We don't want -cckr and -prototypes -# endif -# endif -# endif -# if (OSMajorVersion == 6) -# if (OSMinorVersion >= 2) -# undef UseLibBSD -# define ConfigH irix62 -# endif -# endif -# endif - -# ifdef IBMArchitecture -# undef UseLibBSD -# if (SystemV == YES) -# define ConfigH aix -# if OSMajorVersion < 3 -# if OSMinorVersion < 2 -# define UseLibBSD -# endif -# endif -# else -# define ConfigH bsd -# define AOSArchitecture -# endif -# endif - - -#ifdef AOSArchitecture -#define MyStdc -U__STDC__ -#endif - -# if defined(MipsBsdArchitecture) || defined(MipsSysvArchitecture) -# define ConfigH mips -# endif - -# ifdef DguxArchitecture -# define ConfigH dgux -# endif - -# ifdef ConvexArchitecture -# define ConfigH convex -# endif - -# if defined(SQNTArchitecture) || defined(SequentArchitecture) -# define ConfigH sequent -# endif - -# ifdef MacIIArchitecture -# define ConfigH mac2 -# endif - -# ifdef MinixArchitecture -/* Maybe conditional on MACH? */ -SYSSRCS=mi.termios.c mi.wait.h mi.varargs.h -SYSOBJS=mi.termios.${SUF} -EXTF=ma.setp.c vms.termcap.c -# else -/* Maybe conditional on MACH? */ -SYSSRCS=ma.setp.c -SYSOBJS=ma.setp.${SUF} -EXTF=mi.termios.c mi.wait.h mi.varargs.h vms.termcap.c -# endif - -# ifdef i386Isc -# if IscVersion != 202 -# define ConfigH isc -# define UseLibCposix -# else -# define ConfigH isc202 -# endif -# endif /* i386Isc */ - -# ifdef OpenBSDArchitecture -# define ConfigH bsd4.4 -# endif /* OpenBsdArchitecture */ - -# ifdef NetBSDArchitecture -# define ConfigH bsd4.4 -# endif /* NetBsdArchitecture */ - -# ifdef FreeBSDArchitecture -# define ConfigH bsd4.4 -# endif /* FreeBsdArchitecture */ - -# ifdef MidnightBSDArchitecture -# define ConfigH bsd4.4 -# endif /* MidnightBsdArchitecture */ - -# ifdef i386SVR4Architecture -# define ConfigH sysv4 -# ifdef DELL -# define NoCombineRegs -# endif -# endif - -#endif /* !ConfigH */ - -/* generic os's */ - -#ifndef ConfigH - -#if (SystemV == YES) -#define ConfigH sysv3 -#else -/* why this as a default? Why not? */ -#define ConfigH bsd -#endif - -#endif /* !ConfigH */ - -/**** libraries ****/ - -#if (SystemV == NO) || defined(HPArchitecture) || \ - defined(SQNTArchitecture) || defined(SequentArchitecture) || \ - defined(MacIIArchitecture) || defined(UseLibTermcap) -LIBTERMCAP = -ltermcap -#else -LIBTERMCAP = -#endif - -#if defined(SQNTArchitecture) || defined(SequentArchitecture) -LIBSQNT=-lsocket -linet -lnsl -lseq -#endif - -/* This may not be good enough - I don't have access to enough systems -to really test it. */ -#if (SystemV == YES) || defined(UseLibCurses) && !defined(HPArchitecture) -LIBCURSES = -lcurses -#else -LIBCURSES = -#endif - -#if defined(UseLibNet) -LIBNET = -lnet -#else -LIBNET = -#endif - -#if defined(UseLibSocket) -LIBSOCKET = -lsocket -#else -LIBSOCKET = -#endif - -#if defined(UseLibBSD) -LIBBSD = -lbsd -#else -LIBBSD = -#endif - -#if (defined(SGIArchitecture) && \ - (OSMajorVersion == 3) && (OSMinorVersion == 3)) || \ - defined(UseLibC_S) -LIBC_S = -lc_s -#else -LIBC_S = -#endif - -#if defined(UseLibSun) -LIBSUN = -lsun -#else -LIBSUN = -#endif - -#if defined(UseLibCposix) -LIBCPOSIX = -lcposix -#else -LIBCPOSIX = -#endif - -#if defined(UseLibInet) -LIBINET = -linet -#else -LIBINET = -#endif - -#if defined(UseLibDir) -LIBDIRECT = -ldir -#else -LIBDIRECT = -#endif - -#if defined(UseLibX) -LIBX = -lx -#else -LIBX = -#endif - -#if defined(UseLibIntl) -LIBINTL = -lintl -#else -LIBINTL = -#endif - -#if (HasLibCrypt == YES) -LIBCRYPT = -lcrypt -#else -LIBCRYPT = -#endif - -#if defined(MacIIArchitecture) || defined(UseLibPosix) -LIBPOSIX = -lposix -#else -LIBPOSIX = -#endif - -#if defined(ATTArchitecture) || defined(UseLibDirent) -LIBDIRECTENT = -ldirent -#else -LIBDIRECTENT = -#endif - -/* The order here is significant. Although nothing uses all of these, -some platforms which use more than one do care about the order. */ - -SYSLIBS = $(LIBPOSIX) $(LIBDIRECTENT) $(LIBTERMCAP) $(LIBCURSES) \ - $(LIBNET) $(LIBINTL) $(LIBSOCKET) $(LIBSUN) $(LIBBSD) $(LIBCPOSIX) \ - $(LIBINET) $(LIBDIRECT) $(LIBX) $(LIBC_S) $(LIBSQNT) $(LIBCRYPT) - -/* Past here, nothing should need to be changed to compile on a different -platform, unless you have a really weird architecture. */ - -#ifdef MyCC -CC = MyCC -#else -# if HasGcc -# if HasGcc2 -CC = gcc -# else -# ifdef NoCombineRegs -CC = gcc -finline-functions -fstrength-reduce -# else -CC = gcc -fcombine-regs -finline-functions -fstrength-reduce -# endif -# endif -# else -CC = cc -# endif -#endif - -#ifdef HESIOD -HESLIB = -L/usr/athena/lib -lhesiod -/* it seems to me that the -I shouldn't be necessary, but there seems -to be a bug in the Imake stuff, so here it is. */ -HESDEF = -DHESIOD -I/usr/athena/include -#else -HESLIB = -HESDEF = -#endif - -#ifdef AFS -#ifndef AFSDIR -AFSDIR = /usr/afsws -#endif -#ifdef AFS33 -#define AFS33LIB -laudit -#else -#define AFS33LIB -#endif -/* Auxilliary libs needed for AFS */ -/* Both HPUX and Solaris need the BSD libraries. We need -lc before - * the bsd library to avoid using any more of it than is necessary. - */ -#if defined(HPArchitecture) -#define AFSAUXLIB -lc -lBSD -/* This is probably a kludge, but so is imake. */ -#else -#if defined(SunArchitecture) && (OSMajorVersion == 5) -#define AFSAUXLIB -lsocket -lnsl -lc -lucb -#else -#define AFSAUXLIB -#endif -#endif /* AFSAUXLIB */ -AFSLIB = -L$(AFSDIR)/lib -L$(AFSDIR)/lib/afs -lkauth -lprot -lubik\ - -lauth -lrxkad -lsys -ldes -lrx -llwp -lcom_err\ - $(AFSDIR)/lib/afs/util.a AFS33LIB AFSAUXLIB -AFSDEF = -DAFS -I$(AFSDIR)/include -#else -AFSLIB = -AFSDEF = -#endif - -/* This is encore specific, but I don't know what encore's #define is, -and it shouldn't hurt to have it here, so here it is */ -PARALLEL=12 # Make the multi-max run fast. - -#ifndef TcshTop -#define TcshTop /usr/local -#endif -TCSHTOP = TcshTop - -#ifndef ManSuffix -#define ManSuffix 1 -#endif -MANSUFFIX = ManSuffix - -#ifdef TcshPath -PATH_TCSHELL = TcshPath -TCSHPATH = -D_PATH_TCSHELL='"$(PATH_TCSHELL)"' -#else -TCSHPATH = -#endif - -#ifdef DestBin -TCSH_BINDIR = DestBin -#else -TCSH_BINDIR = $(TCSHTOP)/bin -#endif -#ifdef DestMan -TCSH_MANDIR = DestMan -#else -TCSH_MANDIR = $(TCSHTOP)/man/man$(MANSUFFIX) -#endif - -LOCALLIBS = - -#ifndef MyCflags -#define MyCflags -#endif - -#ifndef MyDefines -#define MyDefines -#endif - -#ifndef MyIncludes -#define MyIncludes -#endif - -#ifndef MyStdc -#define MyStdc -#endif - -#ifdef CDebugFlags -CDEBUGFLAGS = CDebugFlags -#else -# if HasGcc2 -CDEBUGFLAGS = -O2 -# else -CDEBUGFLAGS = -O -# endif -#endif - - -#ifdef HostType -HOSTTYPE=HostType -HTDEF = -DHOSTTYPE='"$(HOSTTYPE)"' -#else -HTDEF = -#endif - -DEFINES = $(TCSHPATH) $(HESDEF) $(AFSDEF) $(HTDEF) MyDefines MyCflags MyStdc -INCLUDES = -I. MyIncludes -#ifdef MyLibs -LDLIBS = MyLibs -#endif - -SUF = o -VERSION = 6.12 - -SHSRCS= sh.c sh.dir.c sh.dol.c sh.err.c sh.exec.c \ - sh.char.c sh.exp.c sh.file.c sh.func.c \ - sh.glob.c sh.hist.c sh.init.c sh.lex.c \ - sh.misc.c sh.parse.c sh.print.c sh.proc.c \ - sh.sem.c sh.set.c sh.time.c dotlock.c dotlock.h glob.c \ - sh.char.h sh.dir.h sh.proc.h sh.h \ - sh.decls.h glob.h ${SYSSRCS} -SHOBJS= sh.${SUF} sh.dir.${SUF} sh.dol.${SUF} sh.err.${SUF} sh.exec.${SUF} \ - sh.char.${SUF} sh.exp.${SUF} sh.file.${SUF} sh.func.${SUF} \ - sh.glob.${SUF} sh.hist.${SUF} sh.init.${SUF} sh.lex.${SUF} \ - sh.misc.${SUF} sh.parse.${SUF} sh.print.${SUF} sh.proc.${SUF} \ - sh.sem.${SUF} sh.set.${SUF} sh.time.${SUF} dotlock.${SUF} glob.${SUF} \ - ${SYSOBJS} - -TWSRCS= tw.decls.h tw.h tw.help.c tw.init.c tw.parse.c tw.spell.c \ - tw.comp.c tw.color.c -TWOBJS= tw.help.${SUF} tw.init.${SUF} tw.parse.${SUF} tw.spell.${SUF} \ - tw.comp.${SUF} tw.color.${SUF} - -EDSRCS= ed.chared.c ed.decls.h ed.defns.c ed.h ed.init.c ed.inputl.c \ - ed.refresh.c ed.screen.c ed.xmap.c ed.term.c ed.term.h -EDOBJS= ed.chared.${SUF} ed.refresh.${SUF} ed.screen.${SUF} ed.init.${SUF} \ - ed.inputl.${SUF} ed.defns.${SUF} ed.xmap.${SUF} ed.term.${SUF} - -TCSRCS= tc.alloc.c tc.bind.c tc.const.c tc.decls.h tc.disc.c \ - tc.func.c tc.nls.c tc.nls.h tc.os.c tc.os.h tc.printf.c tc.prompt.c \ - tc.disc.${SUF} tc.func.${SUF} tc.nls.${SUF} tc.os.${SUF} \ - tc.printf.${SUF} tc.sched.c tc.sig.c tc.sig.h tc.str.c sh.types.h \ - tc.vers.c tc.wait.h tc.who.c tc.h -TCOBJS= tc.alloc.${SUF} tc.bind.${SUF} tc.const.${SUF} tc.defs.${SUF} \ - tc.disc.${SUF} tc.func.${SUF} tc.os.${SUF} tc.printf.${SUF} \ - tc.prompt.${SUF} tc.sched.${SUF} tc.sig.${SUF} tc.str.${SUF} \ - tc.vers.${SUF} tc.who.${SUF} - -MISCF = Makefile.std BUILDING Fixes MAKEDIFFS MAKESHAR NewThings README.md \ - FAQ WishList config_f.h eight-bit.me glob.3 patchlevel.h pathnames.h \ - tcsh.man Ported src.desc Imakefile imake.config complete.tcsh \ - Makefile.vms termcap.vms snames.h host.defs gethost.c tcsh.man2html \ - Makefile.in configure.ac Makefile.win32 aclocal.m4 dot.login dot.tcshrc -CONFSRCS=config/[a-z]* - - -SRCS = $(SHSRCS) $(TWSRCS) $(EDSRCS) $(TCSRCS) -OBJS = $(SHOBJS) $(TWOBJS) $(EDOBJS) $(TCOBJS) - -ALLSRCS= $(MISCF) $(SRCS) $(EXTF) - -AllTarget(tcsh) - -ed.defns.h: config.h ed.defns.c - @rm -f $@ - @echo '/* Do not edit this file, make creates it. */' > $@ - @echo '#ifndef _h_ed_defns' >> $@ - @echo '#define _h_ed_defns' >> $@ - egrep '[FV]_' ed.defns.c | egrep '^#define' >> $@ - @echo '#endif /* _h_ed_defns */' >> $@ - -sh.err.h: config.h sh.err.c - @rm -f $@ - @echo '/* Do not edit this file, make creates it. */' > $@ - @echo '#ifndef _h_sh_err' >> $@ - @echo '#define _h_sh_err' >> $@ - egrep 'ERR_' sh.err.c | egrep '^#define' >> $@ - @echo '#endif /* _h_sh_err */' >> $@ - -tc.const.h: config.h tc.const.c - @rm -f $@ - @echo '/* Do not edit this file, make creates it. */' > $@ - @echo '#ifndef _h_tc_const' >> $@ - @echo '#define _h_tc_const' >> $@ - ${CC} -E $(INCLUDES) ${DEFINES} -D_h_tc_const tc.const.c | \ - grep 'Char STR' | \ - sed -e 's/Char \([a-zA-Z0-9_]*\)\[\].*/extern Char \1[];/' | \ - sort >> $@ - @echo '#endif /* _h_tc_const */' >> $@ - -config.h: config_f.h - cp config/ConfigH config.h - -$(OBJS): sh.err.h tc.const.h ed.defns.h - -tar.Z: - rm -f tcsh-${VERSION}.tar.Z - rm -rf tcsh-${VERSION} - mkdir tcsh-${VERSION} tcsh-${VERSION}/config - cp ${ALLSRCS} tcsh-${VERSION} - cp ${CONFSRCS} tcsh-${VERSION}/config - tar cf - nls/Makefile nls/?*/set?* | (cd tcsh-${VERSION}; tar xpf -) - tar cvf - tcsh-${VERSION} | compress > tcsh-${VERSION}.tar.Z - rm -rf tcsh-${VERSION} - -tar.gz: - rm -f tcsh-${VERSION}.tar.gz - rm -rf tcsh-${VERSION} - mkdir tcsh-${VERSION} tcsh-${VERSION}/config - cp ${ALLSRCS} tcsh-${VERSION} - cp ${CONFSRCS} tcsh-${VERSION}/config - tar cf - nls/Makefile nls/?*/set?* | (cd tcsh-${VERSION}; tar xpf -) - tar cvf - tcsh-${VERSION} | gzip > tcsh-${VERSION}.tar.gz - rm -rf tcsh-${VERSION} - -shar: - rm -f tcsh-*.shar - rm -rf tcsh-${VERSION} - mkdir tcsh-${VERSION} tcsh-${VERSION}/config - cp ${ALLSRCS} tcsh-${VERSION} - cp ${CONFSRCS} tcsh-${VERSION}/config - tar cf - nls/Makefile nls/?*/set?* | (cd tcsh-${VERSION}; tar xpf -) - MAKESHAR -v -n tcsh-${VERSION} tcsh-${VERSION} \ - tcsh-${VERSION}/?* tcsh-${VERSION}/config/?* \ - tcsh-${VERSION}/?*/set?* - rm -rf tcsh-${VERSION} - -catalogs: - @(cd nls; make catalogs) - -world: - $(MAKE) clean ; $(MAKE) depend ; $(MAKE) tcsh ; $(MAKE) install - -clean:: - rm -f ed.defns.h sh.err.h tc.const.h config.h tc.defs.* - rm -f tcsh.*.m tcsh.*.cat - -depend:: config.h ed.defns.h sh.err.h tc.const.h $(SRCS) tc.defs.c - -tc.defs.${SUF}: tc.defs.c sh.h - -tc.defs.c: gethost host.defs - @rm -f $@ - @echo "/* Do not edit this file, make creates it */" > $@ - ./gethost host.defs >> $@ - -ALIB=$(HESLIB) $(AFSLIB) $(SYSLIBS) -AINC=ed.defns.h sh.err.h tc.const.h sh.h - -NormalProgramTarget(tcsh, $(OBJS), $(AINC), $(LOCALLIBS), $(ALIB)) -NormalProgramTarget(gethost, gethost.${SUF}, $(AINC), $(LOCALLIBS), $(ALIB)) - -InstallProgram(tcsh,$(TCSH_BINDIR)) -InstallManPage(tcsh,$(TCSH_MANDIR)) -DependTarget() diff --git a/contrib/tcsh/MAKEDIFFS b/contrib/tcsh/MAKEDIFFS deleted file mode 100755 index be0e5b242668..000000000000 --- a/contrib/tcsh/MAKEDIFFS +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/sh -# -# MAKEDIFFS.sh: Make context diffs for the csh sources -# -XINUDIR=/usr/share/src/mtXinu/bin/csh -BSDDIR=/usr/share/src/mtXinu/BSD/bin/csh -TAHOEDIR=/usr/share/src/mtXinu/TAHOE/bin/csh -RENODIR=/usr/share/src/mtXinu/RENO/bin/csh -TCSHDIR=`pwd` -case "x$1" in -xxinu) - CSHDIR=$XINUDIR;; -xbsd) - CSHDIR=$BSDDIR;; -xtahoe) - CSHDIR=$TAHOEDIR;; -xreno) - CSHDIR=$RENODIR;; -x*) - echo "Usage: `basename $0` [bsd|tahoe|xinu|reno]";exit 1;; -esac -DIFF1='sh.c sh.char.c sh.dir.c sh.dol.c sh.err.c sh.exec.c sh.exp.c sh.file.c' -DIFF2='sh.func.c sh.glob.c sh.hist.c sh.init.c sh.lex.c sh.misc.c sh.parse.c sh.print.c' -DIFF3='sh.proc.c sh.sem.c sh.set.c sh.time.c sh.char.h sh.dir.h sh.h sh.local.h sh.proc.h' - -for i in $DIFF1 -do - diff -c $CSHDIR/$i $TCSHDIR/$i -done > DIFFS.1 - -for i in $DIFF2 -do - diff -c $CSHDIR/$i $TCSHDIR/$i -done > DIFFS.2 - -for i in $DIFF3 -do - diff -c $CSHDIR/$i $TCSHDIR/$i -done > DIFFS.3 -exit 0 diff --git a/contrib/tcsh/MAKESHAR b/contrib/tcsh/MAKESHAR deleted file mode 100755 index 48c73b7c74ab..000000000000 --- a/contrib/tcsh/MAKESHAR +++ /dev/null @@ -1,120 +0,0 @@ -#!/bin/sh -# -# MAKESHAR.sh: Make a shar file for the sources -# - -AWK=/usr/bin/nawk # Must be nawk or gawk cause of 2D arrays -WC=/usr/ucb/wc -GREP=/usr/bin/egrep -SORT=/usr/bin/sort -SH=/bin/sh - -dirs= -name=kit -files= -verbose=0 -size=45000 - -for i -do - case $i in - -n) - name=;; - -v) - verbose=1;; - -d) - SH=/bin/cat;; - -s) - size=$1;; - *) - if [ -z "$name" ] - then - name=$i - elif [ -d $i ] - then - dirs="$dirs $i" - elif [ -f $i ] - then - files="$files $i" - else - echo "$0: File `$i' not found." 1>&2 - exit 1 - fi;; - esac -done - -if [ \( -z "$files" \) -a \( -z "$dirs" \) ] -then - echo "Usage: $0 [-n name] [-s size] [-vd] ." 1>&2 - exit 1 -fi - -$WC $files | $GREP -v total | $SORT +2 | $AWK ' - BEGIN { - i = 0; - seq = 1; - size = 0; - name = 1; - used = 2; - verbose='"$verbose"'; - tty = "/dev/tty"; - maxsize = '"$size"'; - dirs = "'"$dirs"'"; - }; - { - a[i, size] = $3; - a[i, name] = $4; - a[i, used] = 0; - i++; - }; - END { - for (maxi = i--; i >= 0; i--) { - idx = 0; - if (a[i, used] == 0) { - if (verbose && a[i, size] > maxsize) - printf("Warning: File %s is %d > %d\n", - a[i, name], a[i, size], maxsize) > tty; - s = a[i, size]; - a[i, used] = 1; - kit[seq, idx++] = i; - j = 0; - while (j < maxi) { - # Find the greatest file we can add - j = maxi; - for (k = 0; k < maxi; k++) - if (a[k, used] == 0 && a[k, size] + s < maxsize) - j = k; - if (j < maxi) { - s += a[j, size]; - a[j, used] = 1; - kit[seq, idx++] = j; - } - } - sizes[seq] = s; - kit[seq++, idx] = -1; - } - } - for (i = 1; i < seq; i++) { - printf("shar -n%d -e%d %s ", i, seq - 1, dirs); - if (verbose) { - printf("%3d of %3d: ", i, seq - 1) > tty; - len = 12; - } - for (j = 0; kit[i, j] != -1; j++) { - s = a[kit[i, j], name]; - if (verbose) { - clen = length(s) + 1; - len += clen; - if (len > 70) { - printf("\n ") > tty; - len = 12 + clen; - } - printf("%s ", s) > tty; - } - printf("%s ", s); - } - printf("> '"$name"'-%d.shar;", i); - if (verbose) - printf("= %5d\n", sizes[i]) > tty; - } - }' | $SH diff --git a/contrib/tcsh/Makefile.ADMIN b/contrib/tcsh/Makefile.ADMIN deleted file mode 100644 index 5ad3bb8fb3c5..000000000000 --- a/contrib/tcsh/Makefile.ADMIN +++ /dev/null @@ -1,24 +0,0 @@ -# -# Makefile.ADMIN -# -# Maintenance tasks -# -# You can refetch files from the website, then run "git diff" to -# sanity check any changes before committing. -# - -LYNX= lynx -dump -nolist -TRIM= expand | sed -e 's/^ *$$//' | cat -s -WEB= https://www.tcsh.org - -PAGES= FAQ - -all: ${PAGES} - -.for i in ${PAGES} -$i: force - ${LYNX} ${WEB}/${i:tl}/ | ${TRIM} > ${.TARGET} -.endfor - -.DUMMY: force -force: diff --git a/contrib/tcsh/Makefile.in b/contrib/tcsh/Makefile.in deleted file mode 100644 index c6b5f2554cc0..000000000000 --- a/contrib/tcsh/Makefile.in +++ /dev/null @@ -1,782 +0,0 @@ -# -# C Shell with process control; VM/UNIX VAX Makefile -# Bill Joy UC Berkeley; Jim Kulp IIASA, Austria -# -# With an input editor, command completion, etc. and ported to all sorts of -# things; Paul Placeway, CIS Dept., Ohio State University -# -SHELL=/bin/sh -ENVCMD=/usr/bin/env -VERSION=@PACKAGE_VERSION@ -BUILD=tcsh$(EXEEXT) -VPATH=@srcdir@ -srcdir=@srcdir@ - -################################################################ -## CFLAGS. For various -D things, see config.h -################################################################ -# -# These are the default suffixes from .c to .o and -c to get there -# but to use the global optimizer on the mips boxes, see below -# -SUF=o -CF=-c - -CPPFLAGS=-I. -I$(srcdir) - -LFLAGS= -# hpux lint -#LFLAGS= -Zn10000 - - -# This is set by autoconf: -CFLAGS = @CFLAGS@ -# debug: -#CFLAGS= -g -# production: -#CFLAGS= -O -# Broken optimizers.... -#CFLAGS= - -#CFLAGS= -g -pg -DPROF -#CFLAGS= -O -pg -DPROF - -# gcc 1.00-1.37 -#CFLAGS= -O -finline-functions -fstrength-reduce - -# gcc 1.37-1.40 -#CFLAGS= -O -fcombine-regs -finline-functions -fstrength-reduce -# add -msoft-float for 68881 machines. - -# gcc 2.0 -# On the sparc, don't use -O2; it breaks setjmp() and vfork() -#CFLAGS= -O - -# gcc-2.1+ -#CFLAGS= -O2 - -# lucid c on suns -#CFLAGS= -O5 - -# gcc 2.1 on linux -#CFLAGS= -O6 -fomit-frame-pointer - -# HP/UX 8.0, 9.0 -#CFLAGS= +O3 -Aa - -# Ultrix 4.2a -#CFLAGS= -O -Olimit 2000 - -# Intel Paragon OSF/1 with PGI compilers -#CFLAGS= -O -Mnodebug -Mnoperfmon - -# DEC Alpha OSF/1 -## Normal Optimization -#CFLAGS= -O2 -Olimit 2000 -## Full Optimization - may not work -#CFLAGS= -O3 -Olimit 2000 -#CF=-j -#SUF=u -#.SUFFIXES: .u *** 15513 LINES SKIPPED *** From owner-dev-commits-src-branches@freebsd.org Wed Jun 2 05:35:46 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B87F563AD3D; Wed, 2 Jun 2021 05:35: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 4FvyRk4rZDz3qBn; Wed, 2 Jun 2021 05:35:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8DA30116D3; Wed, 2 Jun 2021 05:35:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1525ZkqF072638; Wed, 2 Jun 2021 05:35:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1525Zkku072637; Wed, 2 Jun 2021 05:35:46 GMT (envelope-from git) Date: Wed, 2 Jun 2021 05:35:46 GMT Message-Id: <202106020535.1525Zkku072637@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: 4d9a3cac70ba - stable/13 - tcsh: update to version 6.22.04. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4d9a3cac70baf51a6737210fd2e52a854641370d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jun 2021 05:35:46 -0000 The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=4d9a3cac70baf51a6737210fd2e52a854641370d commit 4d9a3cac70baf51a6737210fd2e52a854641370d Author: Dmitry Chagin AuthorDate: 2021-05-19 21:12:27 +0000 Commit: Dmitry Chagin CommitDate: 2021-06-02 05:33:36 +0000 tcsh: update to version 6.22.04. Merge commit '174d8b60324d7e8754709f7155e13ca95220b48c' into main. (cherry picked from commit 6560ac57ce879857203bc456cdc3849808dc0700) --- contrib/tcsh/Fixes | 1 + contrib/tcsh/ed.chared.c | 98 ++++++++++++++++---------------- contrib/tcsh/ed.defns.c | 10 ++-- contrib/tcsh/ed.h | 10 +++- contrib/tcsh/ed.init.c | 48 ++++++++-------- contrib/tcsh/ed.inputl.c | 20 +++---- contrib/tcsh/ed.refresh.c | 16 +++--- contrib/tcsh/ed.screen.c | 18 +++--- contrib/tcsh/ed.term.c | 34 ++++++------ contrib/tcsh/ed.term.h | 6 +- contrib/tcsh/ed.xmap.c | 10 ++-- contrib/tcsh/gethost.c | 8 +-- contrib/tcsh/glob.c | 18 +++--- contrib/tcsh/glob.h | 2 +- contrib/tcsh/ma.setp.c | 4 +- contrib/tcsh/mi.termios.c | 2 +- contrib/tcsh/mi.wait.h | 2 +- contrib/tcsh/patchlevel.h | 4 +- contrib/tcsh/sh.c | 100 ++++++++++++++++----------------- contrib/tcsh/sh.char.c | 136 ++++++++++++++++++++++----------------------- contrib/tcsh/sh.char.h | 2 +- contrib/tcsh/sh.decls.h | 14 ++--- contrib/tcsh/sh.dir.c | 44 +++++++-------- contrib/tcsh/sh.dol.c | 10 ++-- contrib/tcsh/sh.err.c | 2 +- contrib/tcsh/sh.exec.c | 10 ++-- contrib/tcsh/sh.exp.c | 44 +++++++-------- contrib/tcsh/sh.file.c | 2 +- contrib/tcsh/sh.func.c | 84 ++++++++++++++-------------- contrib/tcsh/sh.glob.c | 18 +++--- contrib/tcsh/sh.h | 36 ++++++------ contrib/tcsh/sh.hist.c | 46 +++++++++------ contrib/tcsh/sh.init.c | 12 ++-- contrib/tcsh/sh.lex.c | 16 +++--- contrib/tcsh/sh.misc.c | 6 +- contrib/tcsh/sh.parse.c | 1 + contrib/tcsh/sh.print.c | 6 +- contrib/tcsh/sh.proc.c | 28 +++++----- contrib/tcsh/sh.sem.c | 22 ++++---- contrib/tcsh/sh.set.c | 16 +++--- contrib/tcsh/sh.time.c | 6 +- contrib/tcsh/sh.types.h | 36 ++++++------ contrib/tcsh/tc.alloc.c | 18 +++--- contrib/tcsh/tc.bind.c | 4 +- contrib/tcsh/tc.const.c | 20 +++---- contrib/tcsh/tc.decls.h | 4 +- contrib/tcsh/tc.func.c | 32 +++++------ contrib/tcsh/tc.os.c | 52 ++++++++--------- contrib/tcsh/tc.os.h | 22 ++++---- contrib/tcsh/tc.printf.c | 4 +- contrib/tcsh/tc.prompt.c | 10 ++-- contrib/tcsh/tc.str.c | 8 +-- contrib/tcsh/tc.vers.c | 22 ++++---- contrib/tcsh/tc.who.c | 8 +-- contrib/tcsh/tcsh.man | 4 +- contrib/tcsh/tw.color.c | 6 +- contrib/tcsh/tw.comp.c | 14 ++--- contrib/tcsh/tw.h | 2 +- contrib/tcsh/tw.init.c | 18 +++--- contrib/tcsh/tw.parse.c | 48 ++++++++-------- contrib/tcsh/vms.termcap.c | 2 +- 61 files changed, 663 insertions(+), 643 deletions(-) diff --git a/contrib/tcsh/Fixes b/contrib/tcsh/Fixes index e539c8241a86..76fdede0c4b7 100644 --- a/contrib/tcsh/Fixes +++ b/contrib/tcsh/Fixes @@ -1,3 +1,4 @@ + 15. V6.22.04 - 20210426 14. Don't crash with 'bindkey "^0" clear-screen' (Karl Jeacle) 13. Fix $x:q:h and $x:q:t return the whole string for strings not containing / 12. V6.22.03 - 20201118 diff --git a/contrib/tcsh/ed.chared.c b/contrib/tcsh/ed.chared.c index 2b4a63c8ca6e..2a8689713399 100644 --- a/contrib/tcsh/ed.chared.c +++ b/contrib/tcsh/ed.chared.c @@ -51,7 +51,7 @@ hello world # echo "h # echo "hello - + The former problem could be solved with minor modifications of c_preword() and c_endword(). The latter, however, required a significant rewrite of c_preword(), since quoted strings must be parsed from start to end to @@ -207,9 +207,9 @@ c_delafter(int num) } #ifdef notdef else { - /* + /* * XXX: We don't want to do that. In emacs mode overwrite should be - * sticky. I am not sure how that affects vi mode + * sticky. I am not sure how that affects vi mode */ inputmode = MODE_INSERT; } @@ -269,7 +269,7 @@ c_preword(Char *p, Char *low, int n, Char *delim) new = c_endword(prev-1, p, 1, delim); /* Skip to next non-word char */ new++; /* Step away from end of word */ while (new <= p) { /* Skip trailing non-word chars */ - if (!Strchr(delim, *new) || new > prev && new[-1] == (Char)'\\') + if (!Strchr(delim, *new) || (new > prev && new[-1] == (Char)'\\')) break; new++; } @@ -314,12 +314,12 @@ c_prev_word(Char *p, Char *low, int n) if (!VImode) { while (n--) { - while ((p >= low) && !isword(*p)) + while ((p >= low) && !isword(*p)) p--; - while ((p >= low) && isword(*p)) + while ((p >= low) && isword(*p)) p--; } - + /* cp now points to one character before the word */ p++; if (p < low) @@ -327,7 +327,7 @@ c_prev_word(Char *p, Char *low, int n) /* cp now points where we want it */ return(p); } - + while (n--) { int c_class; @@ -359,9 +359,9 @@ c_next_word(Char *p, Char *high, int n) { if (!VImode) { while (n--) { - while ((p < high) && !isword(*p)) + while ((p < high) && !isword(*p)) p++; - while ((p < high) && isword(*p)) + while ((p < high) && isword(*p)) p++; } if (p > high) @@ -399,9 +399,9 @@ static Char * c_nexword(Char *p, Char *high, int n) { while (n--) { - while ((p < high) && !Isspace(*p)) + while ((p < high) && !Isspace(*p)) p++; - while ((p < high) && Isspace(*p)) + while ((p < high) && Isspace(*p)) p++; } @@ -507,7 +507,7 @@ excl_sw: * Search for a space, tab, or colon. See if we have a number (as * in !1234:xyz). Remember the number. */ - for (i = 0, all_dig = 1; + for (i = 0, all_dig = 1; *q != ' ' && *q != '\t' && *q != ':' && q < Cursor; q++) { /* * PWP: !-4 is a valid history argument too, therefore the test @@ -739,7 +739,7 @@ c_substitute(void) * Start p out one character before the cursor. Move it backwards looking * for white space, the beginning of the line, or a history character. */ - for (p = Cursor - 1; + for (p = Cursor - 1; p > InputBuf && *p != ' ' && *p != '\t' && *p && *p != HIST; --p) continue; @@ -765,14 +765,14 @@ c_delfini(void) /* Finish up delete action */ ActionFlag = TCSHOP_NOP; - if (ActionPos == 0) + if (ActionPos == 0) return; UndoAction = TCSHOP_INSERT; if (Cursor > ActionPos) { Size = (int) (Cursor-ActionPos); - c_delbefore(Size); + c_delbefore(Size); RefCursor(); } else if (Cursor < ActionPos) { @@ -1016,7 +1016,7 @@ GetHistLine(void) if (LastChar < InputBuf) LastChar = InputBuf; } - + #ifdef KSHVI if (VImode) Cursor = InputBuf; @@ -1082,7 +1082,7 @@ e_inc_search(int dir) } done = redo = 0; *LastChar++ = '\n'; - for (cp = newdir == F_UP_SEARCH_HIST ? STRbck : STRfwd; + for (cp = newdir == F_UP_SEARCH_HIST ? STRbck : STRfwd; *cp; *LastChar++ = *cp++) continue; *LastChar++ = pchar; @@ -1128,7 +1128,7 @@ e_inc_search(int dir) case F_DELPREV: if (patbuf.len > 1) done++; - else + else SoundBeep(); break; @@ -1162,7 +1162,7 @@ e_inc_search(int dir) break; } break; - + default: /* Terminate and execute cmd */ endcmd[0] = ch; PushMacro(endcmd); @@ -1253,7 +1253,7 @@ e_inc_search(int dir) } if (done || ret != CC_NORM) return(ret); - + } } @@ -1359,7 +1359,7 @@ v_search(int dir) cleanup_until(&tmpbuf); LastCmd = (KEYCMD) dir; /* avoid c_hsetpat */ Cursor = LastChar = InputBuf; - if ((dir == F_UP_SEARCH_HIST ? e_up_search_hist(0) : + if ((dir == F_UP_SEARCH_HIST ? e_up_search_hist(0) : e_down_search_hist(0)) == CC_ERROR) { Refresh(); return(CC_ERROR); @@ -1472,7 +1472,7 @@ e_insert(Char c) else { if (inputmode != MODE_INSERT) { int i; - for (i = 0; i < Argument; i++) + for (i = 0; i < Argument; i++) UndoBuf[UndoSize++] = Cursor[i]; UndoBuf[UndoSize] = '\0'; @@ -1948,7 +1948,7 @@ e_down_search_hist(Char c) #ifdef SDEBUG xprintf("Comparing with \"%S\"\n", hl); #endif - if ((Strncmp(hl, InputBuf, (size_t) (LastChar - InputBuf)) || + if ((Strncmp(hl, InputBuf, (size_t) (LastChar - InputBuf)) || hl[LastChar-InputBuf]) && c_hmatch(hl)) found = h; if (!HistLit) @@ -2392,14 +2392,14 @@ e_delwordprev(Char c) * Changed the names of some of the ^D family of editor functions to * correspond to what they actually do and created new e_delnext_list * for completeness. - * + * * Old names: New names: - * + * * delete-char delete-char-or-eof * F_DELNEXT F_DELNEXT_EOF * e_delnext e_delnext_eof * edelnxt edelnxteof - * delete-char-or-eof delete-char + * delete-char-or-eof delete-char * F_DELNEXT_EOF F_DELNEXT * e_delnext_eof e_delnext * edelnxteof edelnxt @@ -2445,13 +2445,13 @@ e_delnext_eof(Char c) USE(c); if (Cursor == LastChar) {/* if I'm at the end */ if (!VImode) { - if (Cursor == InputBuf) { + if (Cursor == InputBuf) { /* if I'm also at the beginning */ so_write(STReof, 4);/* then do a EOF */ flush(); return(CC_EOF); } - else + else return(CC_ERROR); } else { @@ -2574,8 +2574,8 @@ e_tobeg(Char c) Cursor = InputBuf; if (VImode) { - while (Isspace(*Cursor)) /* We want FIRST non space character */ - Cursor++; + while (Isspace(*Cursor)) /* We want FIRST non space character */ + Cursor++; if (ActionFlag & TCSHOP_DELETE) { c_delfini(); return(CC_REFRESH); @@ -2761,7 +2761,7 @@ e_wordback(Char c) Cursor = c_prev_word(Cursor, InputBuf, Argument); /* bounds check */ - if (VImode) + if (VImode) if (ActionFlag & TCSHOP_DELETE) { c_delfini(); return(CC_REFRESH); @@ -2892,9 +2892,9 @@ v_csearch_back(Char ch, int count, int tflag) cp = Cursor; while (count--) { - if (*cp == ch) + if (*cp == ch) cp--; - while (cp > InputBuf && *cp != ch) + while (cp > InputBuf && *cp != ch) cp--; } @@ -2923,9 +2923,9 @@ v_csearch_fwd(Char ch, int count, int tflag) cp = Cursor; while (count--) { - if (*cp == ch) + if (*cp == ch) cp++; - while (cp < LastChar && *cp != ch) + while (cp < LastChar && *cp != ch) cp++; } @@ -2955,21 +2955,21 @@ v_action(int c) if (ActionFlag == TCSHOP_DELETE) { ActionFlag = TCSHOP_NOP; ActionPos = 0; - + UndoSize = 0; kp = UndoBuf; for (cp = InputBuf; cp < LastChar; cp++) { *kp++ = *cp; UndoSize++; } - + UndoAction = TCSHOP_INSERT; UndoPtr = InputBuf; LastChar = InputBuf; Cursor = InputBuf; if (c & TCSHOP_INSERT) c_alternativ_key_map(0); - + return(CC_REFRESH); } #ifdef notdef @@ -3359,7 +3359,7 @@ e_cleardisp(Char c) /*ARGSUSED*/ CCRETVAL e_tty_int(Char c) -{ +{ USE(c); #if defined(_MINIX) || defined(WINNT_NATIVE) /* SAK PATCH: erase all of current line, start again */ @@ -3398,9 +3398,9 @@ e_stuff_char(Char c) if (was_raw) (void) Rawmode(); return(e_redisp(c)); -#else /* !TIOCSTI */ +#else /* !TIOCSTI */ return(CC_ERROR); -#endif /* !TIOCSTI */ +#endif /* !TIOCSTI */ } /*ARGSUSED*/ @@ -3538,7 +3538,7 @@ e_copyprev(Char c) oldc = Cursor; /* does a bounds check */ - cp = c_prev_word(Cursor, InputBuf, Argument); + cp = c_prev_word(Cursor, InputBuf, Argument); c_insert((int)(oldc - cp)); for (dp = oldc; cp < oldc && dp < LastChar; cp++) @@ -3569,7 +3569,7 @@ e_load_average(Char c) * Here we pass &c to the ioctl because some os's (NetBSD) expect it * there even if they don't use it. (lukem@netbsd.org) */ - if (ioctl(SHIN, TIOCSTAT, (ioctl_t) &c) < 0) + if (ioctl(SHIN, TIOCSTAT, (ioctl_t) &c) < 0) #endif xprintf("%s", CGETS(5, 1, "Load average unavailable\n")); return(CC_REFRESH); @@ -3707,7 +3707,7 @@ v_rchar_fwd(Char c) if (srch_char == 0) return CC_ERROR; - return srch_dir == CHAR_FWD ? v_csearch_fwd(srch_char, Argument, 0) : + return srch_dir == CHAR_FWD ? v_csearch_fwd(srch_char, Argument, 0) : v_csearch_back(srch_char, Argument, 0); } @@ -3719,7 +3719,7 @@ v_rchar_back(Char c) if (srch_char == 0) return CC_ERROR; - return srch_dir == CHAR_BACK ? v_csearch_fwd(srch_char, Argument, 0) : + return srch_dir == CHAR_BACK ? v_csearch_fwd(srch_char, Argument, 0) : v_csearch_back(srch_char, Argument, 0); } @@ -3747,7 +3747,7 @@ v_undo(Char c) LastChar -= UndoSize; Cursor = UndoPtr; - + UndoAction = TCSHOP_INSERT; break; @@ -3816,12 +3816,12 @@ v_rsrch_back(Char c) { USE(c); if (patbuf.len == 0) return(CC_ERROR); - return(v_repeat_srch(searchdir == F_UP_SEARCH_HIST ? + return(v_repeat_srch(searchdir == F_UP_SEARCH_HIST ? F_DOWN_SEARCH_HIST : F_UP_SEARCH_HIST)); } #ifndef WINNT_NATIVE -/* Since ed.defns.h is generated from ed.defns.c, these empty +/* Since ed.defns.h is generated from ed.defns.c, these empty functions will keep the F_NUM_FNS consistent */ CCRETVAL diff --git a/contrib/tcsh/ed.defns.c b/contrib/tcsh/ed.defns.c index 02ae764510af..f4030b530f6d 100644 --- a/contrib/tcsh/ed.defns.c +++ b/contrib/tcsh/ed.defns.c @@ -245,7 +245,7 @@ PFCmd CcFuncTbl[] = { /* table of available commands */ #define F_PATH_NORM 103 e_delnext_eof, /* added by mtk@ari.ncl.omron.co.jp (920818) */ #define F_DELNEXT_EOF 104 - e_stuff_char, + e_stuff_char, #define F_STUFF_CHAR 105 e_complete_all, #define F_COMPLETE_ALL 106 @@ -899,8 +899,8 @@ KEYCMD CcViCmdMap[] = { F_UNASSIGNED, /* ) */ F_EXPAND_GLOB, /* * */ F_DOWN_HIST, /* + */ - V_RCHAR_BACK, /* , */ - F_UP_HIST, /* - */ + V_RCHAR_BACK, /* , */ + F_UP_HIST, /* - */ F_UNASSIGNED, /* . */ V_DSH_META, /* / */ V_ZERO, /* 0 */ @@ -1416,13 +1416,13 @@ editinit(void) f++; f->name = "normalize-path"; f->func = F_PATH_NORM; - f->desc = CSAVS(3, 53, + f->desc = CSAVS(3, 53, "Expand pathnames, eliminating leading .'s and ..'s"); f++; f->name = "normalize-command"; f->func = F_COMMAND_NORM; - f->desc = CSAVS(3, 54, + f->desc = CSAVS(3, 54, "Expand commands to the resulting pathname or alias"); f++; diff --git a/contrib/tcsh/ed.h b/contrib/tcsh/ed.h index 60d061a80bda..50990dee92b6 100644 --- a/contrib/tcsh/ed.h +++ b/contrib/tcsh/ed.h @@ -219,7 +219,7 @@ EXTERN char T_HasMeta; /* true if we have a meta key */ # define M_CHAR 2 # define M_NN 3 #endif /* TERMIO */ -typedef struct { +typedef struct { const char *t_name; unsigned int t_setmask; unsigned int t_clrmask; @@ -247,8 +247,12 @@ extern int tgetflag (const char *); extern int tgetnum (const char *); extern char *tgoto (const char *, int, int); extern void tputs (const char *, int, void (*)(int)); -# define PUTPURE ((void (*)(int)) putpure) -# define PUTRAW ((void (*)(int)) putraw) +static __inline void PUTPURE(int c) { + (void)putpure(c); +} +static __inline void PUTRAW(int c) { + (void)putraw(c); +} #endif #endif /* _h_ed */ diff --git a/contrib/tcsh/ed.init.c b/contrib/tcsh/ed.init.c index f90028499f53..4781f15a5ea5 100644 --- a/contrib/tcsh/ed.init.c +++ b/contrib/tcsh/ed.init.c @@ -41,7 +41,7 @@ int Tty_raw_mode = 0; /* Last tty change was to raw mode */ int MacroLvl = -1; /* pointer to current macro nesting level; */ /* (-1 == none) */ static int Tty_quote_mode = 0; /* Last tty change was to quote mode */ -static unsigned char vdisable; /* The value of _POSIX_VDISABLE from +static unsigned char vdisable; /* The value of _POSIX_VDISABLE from * pathconf(2) */ int Tty_eight_bit = -1; /* does the tty handle eight bits */ @@ -56,8 +56,8 @@ static ttydata_t extty, edtty, tstty; #define uc unsigned char static unsigned char ttychars[NN_IO][C_NCC] = { { - (uc)CINTR, (uc)CQUIT, (uc)CERASE, (uc)CKILL, - (uc)CEOF, (uc)CEOL, (uc)CEOL2, (uc)CSWTCH, + (uc)CINTR, (uc)CQUIT, (uc)CERASE, (uc)CKILL, + (uc)CEOF, (uc)CEOL, (uc)CEOL2, (uc)CSWTCH, (uc)CDSWTCH, (uc)CERASE2, (uc)CSTART, (uc)CSTOP, (uc)CWERASE, (uc)CSUSP, (uc)CDSUSP, (uc)CREPRINT, (uc)CDISCARD, (uc)CLNEXT, (uc)CSTATUS, (uc)CPAGE, @@ -65,15 +65,15 @@ static unsigned char ttychars[NN_IO][C_NCC] = { (uc)CTIME }, { - CINTR, CQUIT, CERASE, CKILL, - _POSIX_VDISABLE, _POSIX_VDISABLE, _POSIX_VDISABLE, _POSIX_VDISABLE, - _POSIX_VDISABLE, CERASE2, CSTART, CSTOP, - _POSIX_VDISABLE, _POSIX_VDISABLE, _POSIX_VDISABLE, _POSIX_VDISABLE, - CDISCARD, _POSIX_VDISABLE, _POSIX_VDISABLE, _POSIX_VDISABLE, + CINTR, CQUIT, CERASE, CKILL, + _POSIX_VDISABLE, _POSIX_VDISABLE, _POSIX_VDISABLE, _POSIX_VDISABLE, + _POSIX_VDISABLE, CERASE2, CSTART, CSTOP, + _POSIX_VDISABLE, _POSIX_VDISABLE, _POSIX_VDISABLE, _POSIX_VDISABLE, + CDISCARD, _POSIX_VDISABLE, _POSIX_VDISABLE, _POSIX_VDISABLE, _POSIX_VDISABLE, _POSIX_VDISABLE, _POSIX_VDISABLE, 1, 0 }, - { + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -136,7 +136,7 @@ ed_set_tty_eight_bit(void) Tty_eight_bit = tty_geteightbit(&extty); } - + int ed_Setup(int rst) { @@ -148,12 +148,12 @@ ed_Setup(int rst) #if defined(POSIX) && defined(_PC_VDISABLE) && !defined(BSD4_4) && \ !defined(WINNT_NATIVE) - { + { long pcret; if ((pcret = fpathconf(SHTTY, _PC_VDISABLE)) == -1L) vdisable = (unsigned char) _POSIX_VDISABLE; - else + else vdisable = (unsigned char) pcret; if (vdisable != (unsigned char) _POSIX_VDISABLE && rst != 0) for (rst = 0; rst < C_NCC; rst++) { @@ -166,7 +166,7 @@ ed_Setup(int rst) #else /* ! POSIX || !_PC_VDISABLE || BSD4_4 || WINNT_NATIVE */ vdisable = (unsigned char) _POSIX_VDISABLE; #endif /* POSIX && _PC_VDISABLE && !BSD4_4 && !WINNT_NATIVE */ - + if ((imode = adrof(STRinputmode)) != NULL && imode->vec != NULL) { if (!Strcmp(*(imode->vec), STRinsert)) inputmode = MODE_INSERT; @@ -236,11 +236,11 @@ ed_Setup(int rst) /* * Don't affect CMIN and CTIME for the editor mode */ - for (rst = 0; rst < C_NCC - 2; rst++) + for (rst = 0; rst < C_NCC - 2; rst++) if (ttychars[TS_IO][rst] != vdisable && ttychars[ED_IO][rst] != vdisable) ttychars[ED_IO][rst] = ttychars[TS_IO][rst]; - for (rst = 0; rst < C_NCC; rst++) + for (rst = 0; rst < C_NCC; rst++) if (ttychars[TS_IO][rst] != vdisable && ttychars[EX_IO][rst] != vdisable) ttychars[EX_IO][rst] = ttychars[TS_IO][rst]; @@ -303,7 +303,7 @@ ed_Init(void) #ifdef DEBUG_EDIT CheckMaps(); /* do a little error checking on key maps */ -#endif +#endif if (ed_Setup(0) == -1) return; @@ -355,7 +355,7 @@ ed_Init(void) #endif /* WINNT_NATIVE */ } -/* +/* * Check and re-init the line. set the terminal into 1 char at a time mode. */ int @@ -416,12 +416,12 @@ Rawmode(void) if (tty_cooked_mode(&tstty)) { /* - * re-test for some things here (like maybe the user typed + * re-test for some things here (like maybe the user typed * "stty -tabs" */ if (tty_gettabs(&tstty) == 0) T_Tabs = 0; - else + else T_Tabs = CanWeTab(); # if defined(POSIX) || defined(TERMIO) @@ -466,7 +466,7 @@ Rawmode(void) if (T_Tabs) /* order of &= and |= is important to XTABS */ extty.d_t.sg_flags &= ~XTABS; - else + else extty.d_t.sg_flags |= XTABS; extty.d_lb = tstty.d_lb; @@ -475,13 +475,13 @@ Rawmode(void) edtty.d_t.sg_flags = extty.d_t.sg_flags; if (T_Tabs) { /* order of &= and |= is important to XTABS */ - edtty.d_t.sg_flags &= + edtty.d_t.sg_flags &= ~(ttylist[ED_IO][M_CONTROL].t_clrmask|XTABS); edtty.d_t.sg_flags |= ttylist[ED_IO][M_CONTROL].t_setmask; } else { edtty.d_t.sg_flags &= ~ttylist[ED_IO][M_CONTROL].t_clrmask; - edtty.d_t.sg_flags |= + edtty.d_t.sg_flags |= (ttylist[ED_IO][M_CONTROL].t_setmask|XTABS); } @@ -503,7 +503,7 @@ Rawmode(void) for (i = 0; i < C_NCC; i++) if (ttychars[TS_IO][i] != ttychars[EX_IO][i]) break; - + if (i != C_NCC || didsetty) { didsetty = 0; /* @@ -605,7 +605,7 @@ Load_input_line(void) #ifdef SUNOS4 long chrs = 0; #else /* !SUNOS4 */ - /* + /* * *Everyone* else has an int, but SunOS wants long! * This breaks where int != long (alpha) */ diff --git a/contrib/tcsh/ed.inputl.c b/contrib/tcsh/ed.inputl.c index 8d4c341631b0..35f21a4e95a8 100644 --- a/contrib/tcsh/ed.inputl.c +++ b/contrib/tcsh/ed.inputl.c @@ -114,7 +114,7 @@ Inputl(void) # ifdef SUNOS4 long chrs = 0; # else /* !SUNOS4 */ - /* + /* * *Everyone* else has an int, but SunOS wants long! * This breaks where int != long (alpha) */ @@ -384,7 +384,7 @@ Inputl(void) } if (InputBuf[curlen] && rotate) { newlen = (int) (LastChar - InputBuf); - for (idx = (int) (Cursor - InputBuf); + for (idx = (int) (Cursor - InputBuf); idx <= newlen; idx++) InputBuf[idx - newlen + curlen] = InputBuf[idx]; @@ -439,13 +439,13 @@ Inputl(void) else SoundBeep(); /* - * Addition by David C Lawrence : If an - * attempted completion is ambiguous, list the choices. - * (PWP: this is the best feature addition to tcsh I have + * Addition by David C Lawrence : If an + * attempted completion is ambiguous, list the choices. + * (PWP: this is the best feature addition to tcsh I have * seen in many months.) */ - if (autol && autol->vec != NULL && - (Strcmp(*(autol->vec), STRambiguous) != 0 || + if (autol && autol->vec != NULL && + (Strcmp(*(autol->vec), STRambiguous) != 0 || expnum == Cursor - InputBuf)) { if (adrof(STRhighlight) && MarkIsSet) { /* clear highlighting before showing completions */ @@ -477,7 +477,7 @@ Inputl(void) case CC_LIST_ALL: if (InputBuf[curlen] && rotate) { newlen = (int) (LastChar - InputBuf); - for (idx = (int) (Cursor - InputBuf); + for (idx = (int) (Cursor - InputBuf); idx <= newlen; idx++) InputBuf[idx - newlen + curlen] = InputBuf[idx]; @@ -667,7 +667,7 @@ RunCommand(Char *str) int GetCmdChar(Char ch) { -#ifndef WINNT_NATIVE // We use more than 256 for various extended keys +#ifndef WINNT_NATIVE // We use more than 256 for various extended keys wint_t c = ch & CHAR; #else wint_t c = ch; @@ -725,7 +725,7 @@ GetNextCommand(KEYCMD *cmdnum, Char *ch) break; } } - if (!AltKeyMap) + if (!AltKeyMap) CurrentKeyMap = CcKeyMap; } *cmdnum = cmd; diff --git a/contrib/tcsh/ed.refresh.c b/contrib/tcsh/ed.refresh.c index 3619e1144bf6..c1f1cfb0b16f 100644 --- a/contrib/tcsh/ed.refresh.c +++ b/contrib/tcsh/ed.refresh.c @@ -76,7 +76,7 @@ dprintstr(char *str, const Char *f, const Char *t) #endif /* DEBUG_UPDATE */ /* reprintf(): - * Print to $DEBUGTTY, so that we can test editing on one pty, and + * Print to $DEBUGTTY, so that we can test editing on one pty, and * print debugging stuff on another. Don't interrupt the shell while * debugging cause you'll mangle up the file descriptors! */ @@ -461,7 +461,7 @@ GotoBottom(void) MoveToLine(OldvcV); } -#endif +#endif void PastBottom(void) @@ -602,7 +602,7 @@ update_line(Char *old, Char *new, int cur_line) */ o = Strend(o); - /* + /* * Remove any trailing blanks off of the end, being careful not to * back up past the beginning. */ @@ -628,7 +628,7 @@ update_line(Char *old, Char *new, int cur_line) } ne = n; *ne = (Char) 0; - + /* * if no diff, continue to next line of redraw */ @@ -824,14 +824,14 @@ update_line(Char *old, Char *new, int cur_line) /* * at this point we have something like this: - * + * * /old /ofd /osb /ose /ols /oe * v.....................v v..................v v........v * eddie> Oh, my fredded gruntle-buggy is to me, as foo var lurgid as * eddie> Oh, my fredded quiux buggy is to me, as gruntle-lurgid as - * ^.....................^ ^..................^ ^........^ + * ^.....................^ ^..................^ ^........^ * \new \nfd \nsb \nse \nls \ne - * + * * fx is the difference in length between the the chars between nfd and * nsb, and the chars between ofd and osb, and is thus the number of * characters to delete if < 0 (new is shorter than old, as above), @@ -1040,7 +1040,7 @@ update_line(Char *old, Char *new, int cur_line) #ifdef DEBUG_UPDATE reprintf("with stuff to keep at end\r\n"); #endif /* DEBUG_UPDATE */ - /* + /* * We have to recalculate fx here because we set it * to zero above as a flag saying that we hadn't done * an early first insert. diff --git a/contrib/tcsh/ed.screen.c b/contrib/tcsh/ed.screen.c index e8b351fe800d..4c5339b2c307 100644 --- a/contrib/tcsh/ed.screen.c +++ b/contrib/tcsh/ed.screen.c @@ -135,7 +135,7 @@ static const struct { #define T_fs 12 #define T_ho 13 #define T_ic 14 -#define T_im 15 +#define T_im 15 #define T_ip 16 #define T_kd 17 #define T_kh 18 @@ -477,7 +477,7 @@ SetTC(char *what, char *how) break; if (tv->name != NULL) { - if (tv == &tval[T_pt] || tv == &tval[T_km] || + if (tv == &tval[T_pt] || tv == &tval[T_km] || tv == &tval[T_am] || tv == &tval[T_xn]) { if (strcmp(how, "yes") == 0) tv->val = 1; @@ -491,7 +491,7 @@ SetTC(char *what, char *how) T_HasMeta = Val(T_km); T_Margin = Val(T_am) ? MARGIN_AUTO : 0; T_Margin |= Val(T_xn) ? MARGIN_MAGIC : 0; - if (tv == &tval[T_am] || tv == &tval[T_xn]) + if (tv == &tval[T_am] || tv == &tval[T_xn]) ChangeSize(Val(T_li), Val(T_co)); return; } @@ -593,7 +593,7 @@ EchoTC(Char **v) goto end_flush; } - /* + /* * Try to use our local definition first */ scap = NULL; @@ -894,8 +894,8 @@ BindArrowKeys(void) /* * Assign the arrow keys only if: * - * 1. They are multi-character arrow keys and the user - * has not re-assigned the leading character, or + * 1. They are multi-character arrow keys and the user + * has not re-assigned the leading character, or * has re-assigned the leading character to be F_XKEY * 2. They are single arrow keys pointing to an unassigned key. */ @@ -1012,7 +1012,7 @@ CanWeTab(void) /* move to line (first line == 0) as efficiently as possible; */ void -MoveToLine(int where) +MoveToLine(int where) { int del; @@ -1048,7 +1048,7 @@ MoveToLine(int where) del = 0; } else { - for ( ; del > 0; del--) + for ( ; del > 0; del--) (void) putraw('\n'); CursorH = 0; /* because the \n will become \r\n */ } @@ -1415,7 +1415,7 @@ GetTermCaps(void) ptr = getenv("TERM"); #ifdef apollo - /* + /* * If we are on a pad, we pretend that we are dumb. Otherwise the termcap * library will put us in a weird screen mode, thinking that we are going * to use curses diff --git a/contrib/tcsh/ed.term.c b/contrib/tcsh/ed.term.c index b0bea10ab1d6..04aefd05bd78 100644 --- a/contrib/tcsh/ed.term.c +++ b/contrib/tcsh/ed.term.c @@ -35,7 +35,7 @@ #include "ed.h" int didsetty = 0; -ttyperm_t ttylist = { +ttyperm_t ttylist = { { #if defined(POSIX) || defined(TERMIO) { "iflag:", ICRNL, (INLCR|IGNCR) }, @@ -64,7 +64,7 @@ ttyperm_t ttylist = { { "chars:", (C_SH(C_MIN)|C_SH(C_TIME)|C_SH(C_SWTCH)|C_SH(C_DSWTCH)| C_SH(C_WERASE)|C_SH(C_REPRINT)|C_SH(C_SUSP)|C_SH(C_DSUSP)| C_SH(C_EOF)|C_SH(C_EOL)|C_SH(C_DISCARD)|C_SH(C_PGOFF)| - C_SH(C_KILL2)|C_SH(C_PAGE)|C_SH(C_STATUS)|C_SH(C_LNEXT)), + C_SH(C_KILL2)|C_SH(C_PAGE)|C_SH(C_STATUS)|C_SH(C_LNEXT)), 0 } }, { @@ -317,7 +317,7 @@ static const struct tcshmodes { # endif /* LCASE */ # ifdef ECHO { "echo", ECHO, M_CONTROL }, -# endif /* ECHO */ +# endif /* ECHO */ # ifdef CRMOD { "crmod", CRMOD, M_CONTROL }, # endif /* CRMOD */ @@ -432,7 +432,7 @@ static const struct tcshmodes { # endif /* LCRTKIL */ # ifdef LPASS8 { "lpass8", LPASS8, M_LOCAL }, -# endif /* LPASS8 */ +# endif /* LPASS8 */ # ifdef LCTLECH { "lctlech",LCTLECH,M_LOCAL }, # endif /* LCTLECH */ @@ -510,7 +510,7 @@ static const struct tcshmodes { # if defined(VPGOFF) || defined(TIOCGPAGE) { "pgoff", C_SH(C_PGOFF), M_CHAR }, # endif /* VPGOFF */ -# if defined(VKILL2) +# if defined(VKILL2) { "kill2", C_SH(C_KILL2), M_CHAR }, # endif /* VKILL2 */ # if defined(VBRK) || defined(TIOCGETC) @@ -528,7 +528,7 @@ static const struct tcshmodes { /* * If EAGAIN and/or EWOULDBLOCK are defined, we can't just return -1 in all * situations where ioctl() does. - * + * * On AIX 4.1.5 (and presumably some other versions and OSes), as you * perform the manual test suite in the README, if you 'bg' vi immediately * after suspending it, all is well, but if you wait a few seconds, @@ -537,7 +537,7 @@ static const struct tcshmodes { * 0, causing bgetc() to return -1, causing readc() to set doneinp to 1, * causing process() to break out of the main loop, causing tcsh to exit * prematurely. - * + * * If ioctl()'s errno is EAGAIN/EWOULDBLOCK ("Resource temporarily * unavailable"), apparently the tty is being messed with by the OS and we * need to try again. In my testing, ioctl() was never called more than @@ -595,7 +595,7 @@ dosetty(Char **v, struct command *t) cleanup_push(cmdname, xfree); setname(cmdname); - while (v && *v && v[0][0] == '-' && v[0][2] == '\0') + while (v && *v && v[0][0] == '-' && v[0][2] == '\0') switch (v[0][1]) { case 'a': *** 3800 LINES SKIPPED *** From owner-dev-commits-src-branches@freebsd.org Wed Jun 2 05:38:44 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BEFBF63AE04; Wed, 2 Jun 2021 05:38:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FvyW8515dz3q9B; Wed, 2 Jun 2021 05:38:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8FA0A11857; Wed, 2 Jun 2021 05:38:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1525cimG072949; Wed, 2 Jun 2021 05:38:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1525ciu8072948; Wed, 2 Jun 2021 05:38:44 GMT (envelope-from git) Date: Wed, 2 Jun 2021 05:38:44 GMT Message-Id: <202106020538.1525ciu8072948@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: 5d111c4e2d37 - stable/12 - tcsh: cleanup source tree to reduce diff size. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 5d111c4e2d37dd220f747ab37a3fea3792e4b8e6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jun 2021 05:38:44 -0000 The branch stable/12 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=5d111c4e2d37dd220f747ab37a3fea3792e4b8e6 commit 5d111c4e2d37dd220f747ab37a3fea3792e4b8e6 Author: Dmitry Chagin AuthorDate: 2021-05-19 21:08:25 +0000 Commit: Dmitry Chagin CommitDate: 2021-06-02 05:37:33 +0000 tcsh: cleanup source tree to reduce diff size. Remove makefiles, configure files and unused at build time files to reduce the diff size. Otherwise the diff contains a lot of unnecessary lines what makes reviewing and merging proccess so hard, especially for re@. (cherry picked from commit 6190ff6104aed4cd753019325a252c4d66495b5e) --- contrib/tcsh/FREEBSD-Xlist | 15 + contrib/tcsh/Imakefile | 631 --- contrib/tcsh/MAKEDIFFS | 40 - contrib/tcsh/MAKESHAR | 120 - contrib/tcsh/Makefile.ADMIN | 24 - contrib/tcsh/Makefile.in | 782 ---- contrib/tcsh/Makefile.std | 630 --- contrib/tcsh/Makefile.vms | 592 --- contrib/tcsh/config.guess | 1438 ------- contrib/tcsh/config.h.in | 275 -- contrib/tcsh/config.rpath | 571 --- contrib/tcsh/config.sub | 1788 --------- contrib/tcsh/configure | 8842 ------------------------------------------- contrib/tcsh/imake.config | 63 - contrib/tcsh/install-sh | 520 --- contrib/tcsh/svn | 32 - 16 files changed, 15 insertions(+), 16348 deletions(-) diff --git a/contrib/tcsh/FREEBSD-Xlist b/contrib/tcsh/FREEBSD-Xlist index b6e5636aa567..49621ab36f0f 100644 --- a/contrib/tcsh/FREEBSD-Xlist +++ b/contrib/tcsh/FREEBSD-Xlist @@ -1,5 +1,20 @@ $FreeBSD$ */BUGS +*/Imakefile +*/MAKEDIFFS +*/MAKESHAR +*/Makefile.ADMIN +*/Makefile.in +*/Makefile.std +*/Makefile.vms +*/config.guess +*/config.h.in +*/config.rpath +*/config.sub +*/configure +*/imake.config +*/install-sh +*/svn */config/a* */config/bs2000 */config/bsd diff --git a/contrib/tcsh/Imakefile b/contrib/tcsh/Imakefile deleted file mode 100644 index bd1b43b1a24e..000000000000 --- a/contrib/tcsh/Imakefile +++ /dev/null @@ -1,631 +0,0 @@ -XCOMM -XCOMM Imakefile for tcsh 6.12 -XCOMM Marc Horowitz, MIT SIPB -XCOMM - -#ifdef DestDir -#undef DestDir -#endif -#ifdef ManSuffix -#undef ManSuffix -#endif - -/* All config options go in a separate file. */ - -#include "imake.config" - -#ifndef HasGcc -# define HasGcc 0 -#endif - -#ifndef HasGcc2 -# define HasGcc2 0 -#endif - -/* This is a giant conditional block. It should be set up right for -platforms which are in here, but it may need to be changed for new -ones. Please send in your fixes and additions! */ - -/**** tcsh configuration defines ****/ - -/* specific platforms */ - -#ifndef ConfigH -# ifdef UltrixArchitecture -# define ConfigH ultrix -# endif - -# ifdef UxpArchitecture -# define ConfigH sysv4 -# endif - -# if defined(LinuxArchitecture) || defined(GNUArchitecture) -# define ConfigH linux -# endif - -# ifdef AlphaArchitecture -# if !defined(LinuxArchitecture) && !defined(GNUArchitecture) -# define ConfigH decosf1 -# endif -# if !HasGcc -# define MyCflags -std1 -Olimit 2000 -# else -# define NoCombineRegs -# endif -# endif - -# if defined(VaxArchitecture) && !defined(UltrixArchitecture) -# define ConfigH bsd -# endif - -# ifdef NeXTArchitecture -# define ConfigH mach -# endif - -# if defined(SunArchitecture) -# if (OSMajorVersion == 3) -# define ConfigH sunos35 -# else -# if (OSMajorVersion == 4) -# if (OSMinorVersion == 0) -# define ConfigH sunos40 -# else /* OSMinorVersion == 1 */ -# if (OSTeenyVersion == 3) -# define ConfigH sunos413 -# else /* OsTeenyVersion in [0,1,2] */ -# define ConfigH sunos41 -# endif -# endif -# define NoCombineRegs -# else /* OSMajorVersion == 5 */ -# if (OSMinorVersion < 3) -# if (OSMinorVersion < 2) -# define ConfigH sol2 -# else -# define ConfigH sol22 -# endif -# else -# if (OSMinorVersion < 4) -# define ConfigH sol23 -# else -# if (OSMinorVersion < 6) -# define ConfigH sol24 -# else -# if (OSMinorVersion < 9) -# define ConfigH sol26 -# else -# define ConfigH sol29 -# endif -# endif -# endif -# endif -# define NoCombineRegs -# endif -# endif -# endif - -# ifdef HPArchitecture -/* For some stupid reason makedepend on HP requires this */ -DEPENDFLAGS = -o.o -# if (OSMajorVersion >= 8) -# define ConfigH hpux8 -# else -# define ConfigH hpux7 -# endif -# endif - -# ifdef CrayArchitecture -# define ConfigH cray -# endif - -# ifdef SGIArchitecture -# define ConfigH irix -# define UseLibBSD -# if (OSMajorVersion < 5) -# ifdef you_are_using_yp -# define UseSunLib -# endif -# if !HasGCC -# define MyStdc -D__STDC__ -# if SGICompilerMajorVersion < 4 -CCOPTIONS=-float # We don't want -cckr and -prototypes -# endif -# endif -# endif -# if (OSMajorVersion == 6) -# if (OSMinorVersion >= 2) -# undef UseLibBSD -# define ConfigH irix62 -# endif -# endif -# endif - -# ifdef IBMArchitecture -# undef UseLibBSD -# if (SystemV == YES) -# define ConfigH aix -# if OSMajorVersion < 3 -# if OSMinorVersion < 2 -# define UseLibBSD -# endif -# endif -# else -# define ConfigH bsd -# define AOSArchitecture -# endif -# endif - - -#ifdef AOSArchitecture -#define MyStdc -U__STDC__ -#endif - -# if defined(MipsBsdArchitecture) || defined(MipsSysvArchitecture) -# define ConfigH mips -# endif - -# ifdef DguxArchitecture -# define ConfigH dgux -# endif - -# ifdef ConvexArchitecture -# define ConfigH convex -# endif - -# if defined(SQNTArchitecture) || defined(SequentArchitecture) -# define ConfigH sequent -# endif - -# ifdef MacIIArchitecture -# define ConfigH mac2 -# endif - -# ifdef MinixArchitecture -/* Maybe conditional on MACH? */ -SYSSRCS=mi.termios.c mi.wait.h mi.varargs.h -SYSOBJS=mi.termios.${SUF} -EXTF=ma.setp.c vms.termcap.c -# else -/* Maybe conditional on MACH? */ -SYSSRCS=ma.setp.c -SYSOBJS=ma.setp.${SUF} -EXTF=mi.termios.c mi.wait.h mi.varargs.h vms.termcap.c -# endif - -# ifdef i386Isc -# if IscVersion != 202 -# define ConfigH isc -# define UseLibCposix -# else -# define ConfigH isc202 -# endif -# endif /* i386Isc */ - -# ifdef OpenBSDArchitecture -# define ConfigH bsd4.4 -# endif /* OpenBsdArchitecture */ - -# ifdef NetBSDArchitecture -# define ConfigH bsd4.4 -# endif /* NetBsdArchitecture */ - -# ifdef FreeBSDArchitecture -# define ConfigH bsd4.4 -# endif /* FreeBsdArchitecture */ - -# ifdef MidnightBSDArchitecture -# define ConfigH bsd4.4 -# endif /* MidnightBsdArchitecture */ - -# ifdef i386SVR4Architecture -# define ConfigH sysv4 -# ifdef DELL -# define NoCombineRegs -# endif -# endif - -#endif /* !ConfigH */ - -/* generic os's */ - -#ifndef ConfigH - -#if (SystemV == YES) -#define ConfigH sysv3 -#else -/* why this as a default? Why not? */ -#define ConfigH bsd -#endif - -#endif /* !ConfigH */ - -/**** libraries ****/ - -#if (SystemV == NO) || defined(HPArchitecture) || \ - defined(SQNTArchitecture) || defined(SequentArchitecture) || \ - defined(MacIIArchitecture) || defined(UseLibTermcap) -LIBTERMCAP = -ltermcap -#else -LIBTERMCAP = -#endif - -#if defined(SQNTArchitecture) || defined(SequentArchitecture) -LIBSQNT=-lsocket -linet -lnsl -lseq -#endif - -/* This may not be good enough - I don't have access to enough systems -to really test it. */ -#if (SystemV == YES) || defined(UseLibCurses) && !defined(HPArchitecture) -LIBCURSES = -lcurses -#else -LIBCURSES = -#endif - -#if defined(UseLibNet) -LIBNET = -lnet -#else -LIBNET = -#endif - -#if defined(UseLibSocket) -LIBSOCKET = -lsocket -#else -LIBSOCKET = -#endif - -#if defined(UseLibBSD) -LIBBSD = -lbsd -#else -LIBBSD = -#endif - -#if (defined(SGIArchitecture) && \ - (OSMajorVersion == 3) && (OSMinorVersion == 3)) || \ - defined(UseLibC_S) -LIBC_S = -lc_s -#else -LIBC_S = -#endif - -#if defined(UseLibSun) -LIBSUN = -lsun -#else -LIBSUN = -#endif - -#if defined(UseLibCposix) -LIBCPOSIX = -lcposix -#else -LIBCPOSIX = -#endif - -#if defined(UseLibInet) -LIBINET = -linet -#else -LIBINET = -#endif - -#if defined(UseLibDir) -LIBDIRECT = -ldir -#else -LIBDIRECT = -#endif - -#if defined(UseLibX) -LIBX = -lx -#else -LIBX = -#endif - -#if defined(UseLibIntl) -LIBINTL = -lintl -#else -LIBINTL = -#endif - -#if (HasLibCrypt == YES) -LIBCRYPT = -lcrypt -#else -LIBCRYPT = -#endif - -#if defined(MacIIArchitecture) || defined(UseLibPosix) -LIBPOSIX = -lposix -#else -LIBPOSIX = -#endif - -#if defined(ATTArchitecture) || defined(UseLibDirent) -LIBDIRECTENT = -ldirent -#else -LIBDIRECTENT = -#endif - -/* The order here is significant. Although nothing uses all of these, -some platforms which use more than one do care about the order. */ - -SYSLIBS = $(LIBPOSIX) $(LIBDIRECTENT) $(LIBTERMCAP) $(LIBCURSES) \ - $(LIBNET) $(LIBINTL) $(LIBSOCKET) $(LIBSUN) $(LIBBSD) $(LIBCPOSIX) \ - $(LIBINET) $(LIBDIRECT) $(LIBX) $(LIBC_S) $(LIBSQNT) $(LIBCRYPT) - -/* Past here, nothing should need to be changed to compile on a different -platform, unless you have a really weird architecture. */ - -#ifdef MyCC -CC = MyCC -#else -# if HasGcc -# if HasGcc2 -CC = gcc -# else -# ifdef NoCombineRegs -CC = gcc -finline-functions -fstrength-reduce -# else -CC = gcc -fcombine-regs -finline-functions -fstrength-reduce -# endif -# endif -# else -CC = cc -# endif -#endif - -#ifdef HESIOD -HESLIB = -L/usr/athena/lib -lhesiod -/* it seems to me that the -I shouldn't be necessary, but there seems -to be a bug in the Imake stuff, so here it is. */ -HESDEF = -DHESIOD -I/usr/athena/include -#else -HESLIB = -HESDEF = -#endif - -#ifdef AFS -#ifndef AFSDIR -AFSDIR = /usr/afsws -#endif -#ifdef AFS33 -#define AFS33LIB -laudit -#else -#define AFS33LIB -#endif -/* Auxilliary libs needed for AFS */ -/* Both HPUX and Solaris need the BSD libraries. We need -lc before - * the bsd library to avoid using any more of it than is necessary. - */ -#if defined(HPArchitecture) -#define AFSAUXLIB -lc -lBSD -/* This is probably a kludge, but so is imake. */ -#else -#if defined(SunArchitecture) && (OSMajorVersion == 5) -#define AFSAUXLIB -lsocket -lnsl -lc -lucb -#else -#define AFSAUXLIB -#endif -#endif /* AFSAUXLIB */ -AFSLIB = -L$(AFSDIR)/lib -L$(AFSDIR)/lib/afs -lkauth -lprot -lubik\ - -lauth -lrxkad -lsys -ldes -lrx -llwp -lcom_err\ - $(AFSDIR)/lib/afs/util.a AFS33LIB AFSAUXLIB -AFSDEF = -DAFS -I$(AFSDIR)/include -#else -AFSLIB = -AFSDEF = -#endif - -/* This is encore specific, but I don't know what encore's #define is, -and it shouldn't hurt to have it here, so here it is */ -PARALLEL=12 # Make the multi-max run fast. - -#ifndef TcshTop -#define TcshTop /usr/local -#endif -TCSHTOP = TcshTop - -#ifndef ManSuffix -#define ManSuffix 1 -#endif -MANSUFFIX = ManSuffix - -#ifdef TcshPath -PATH_TCSHELL = TcshPath -TCSHPATH = -D_PATH_TCSHELL='"$(PATH_TCSHELL)"' -#else -TCSHPATH = -#endif - -#ifdef DestBin -TCSH_BINDIR = DestBin -#else -TCSH_BINDIR = $(TCSHTOP)/bin -#endif -#ifdef DestMan -TCSH_MANDIR = DestMan -#else -TCSH_MANDIR = $(TCSHTOP)/man/man$(MANSUFFIX) -#endif - -LOCALLIBS = - -#ifndef MyCflags -#define MyCflags -#endif - -#ifndef MyDefines -#define MyDefines -#endif - -#ifndef MyIncludes -#define MyIncludes -#endif - -#ifndef MyStdc -#define MyStdc -#endif - -#ifdef CDebugFlags -CDEBUGFLAGS = CDebugFlags -#else -# if HasGcc2 -CDEBUGFLAGS = -O2 -# else -CDEBUGFLAGS = -O -# endif -#endif - - -#ifdef HostType -HOSTTYPE=HostType -HTDEF = -DHOSTTYPE='"$(HOSTTYPE)"' -#else -HTDEF = -#endif - -DEFINES = $(TCSHPATH) $(HESDEF) $(AFSDEF) $(HTDEF) MyDefines MyCflags MyStdc -INCLUDES = -I. MyIncludes -#ifdef MyLibs -LDLIBS = MyLibs -#endif - -SUF = o -VERSION = 6.12 - -SHSRCS= sh.c sh.dir.c sh.dol.c sh.err.c sh.exec.c \ - sh.char.c sh.exp.c sh.file.c sh.func.c \ - sh.glob.c sh.hist.c sh.init.c sh.lex.c \ - sh.misc.c sh.parse.c sh.print.c sh.proc.c \ - sh.sem.c sh.set.c sh.time.c dotlock.c dotlock.h glob.c \ - sh.char.h sh.dir.h sh.proc.h sh.h \ - sh.decls.h glob.h ${SYSSRCS} -SHOBJS= sh.${SUF} sh.dir.${SUF} sh.dol.${SUF} sh.err.${SUF} sh.exec.${SUF} \ - sh.char.${SUF} sh.exp.${SUF} sh.file.${SUF} sh.func.${SUF} \ - sh.glob.${SUF} sh.hist.${SUF} sh.init.${SUF} sh.lex.${SUF} \ - sh.misc.${SUF} sh.parse.${SUF} sh.print.${SUF} sh.proc.${SUF} \ - sh.sem.${SUF} sh.set.${SUF} sh.time.${SUF} dotlock.${SUF} glob.${SUF} \ - ${SYSOBJS} - -TWSRCS= tw.decls.h tw.h tw.help.c tw.init.c tw.parse.c tw.spell.c \ - tw.comp.c tw.color.c -TWOBJS= tw.help.${SUF} tw.init.${SUF} tw.parse.${SUF} tw.spell.${SUF} \ - tw.comp.${SUF} tw.color.${SUF} - -EDSRCS= ed.chared.c ed.decls.h ed.defns.c ed.h ed.init.c ed.inputl.c \ - ed.refresh.c ed.screen.c ed.xmap.c ed.term.c ed.term.h -EDOBJS= ed.chared.${SUF} ed.refresh.${SUF} ed.screen.${SUF} ed.init.${SUF} \ - ed.inputl.${SUF} ed.defns.${SUF} ed.xmap.${SUF} ed.term.${SUF} - -TCSRCS= tc.alloc.c tc.bind.c tc.const.c tc.decls.h tc.disc.c \ - tc.func.c tc.nls.c tc.nls.h tc.os.c tc.os.h tc.printf.c tc.prompt.c \ - tc.disc.${SUF} tc.func.${SUF} tc.nls.${SUF} tc.os.${SUF} \ - tc.printf.${SUF} tc.sched.c tc.sig.c tc.sig.h tc.str.c sh.types.h \ - tc.vers.c tc.wait.h tc.who.c tc.h -TCOBJS= tc.alloc.${SUF} tc.bind.${SUF} tc.const.${SUF} tc.defs.${SUF} \ - tc.disc.${SUF} tc.func.${SUF} tc.os.${SUF} tc.printf.${SUF} \ - tc.prompt.${SUF} tc.sched.${SUF} tc.sig.${SUF} tc.str.${SUF} \ - tc.vers.${SUF} tc.who.${SUF} - -MISCF = Makefile.std BUILDING Fixes MAKEDIFFS MAKESHAR NewThings README.md \ - FAQ WishList config_f.h eight-bit.me glob.3 patchlevel.h pathnames.h \ - tcsh.man Ported src.desc Imakefile imake.config complete.tcsh \ - Makefile.vms termcap.vms snames.h host.defs gethost.c tcsh.man2html \ - Makefile.in configure.ac Makefile.win32 aclocal.m4 dot.login dot.tcshrc -CONFSRCS=config/[a-z]* - - -SRCS = $(SHSRCS) $(TWSRCS) $(EDSRCS) $(TCSRCS) -OBJS = $(SHOBJS) $(TWOBJS) $(EDOBJS) $(TCOBJS) - -ALLSRCS= $(MISCF) $(SRCS) $(EXTF) - -AllTarget(tcsh) - -ed.defns.h: config.h ed.defns.c - @rm -f $@ - @echo '/* Do not edit this file, make creates it. */' > $@ - @echo '#ifndef _h_ed_defns' >> $@ - @echo '#define _h_ed_defns' >> $@ - egrep '[FV]_' ed.defns.c | egrep '^#define' >> $@ - @echo '#endif /* _h_ed_defns */' >> $@ - -sh.err.h: config.h sh.err.c - @rm -f $@ - @echo '/* Do not edit this file, make creates it. */' > $@ - @echo '#ifndef _h_sh_err' >> $@ - @echo '#define _h_sh_err' >> $@ - egrep 'ERR_' sh.err.c | egrep '^#define' >> $@ - @echo '#endif /* _h_sh_err */' >> $@ - -tc.const.h: config.h tc.const.c - @rm -f $@ - @echo '/* Do not edit this file, make creates it. */' > $@ - @echo '#ifndef _h_tc_const' >> $@ - @echo '#define _h_tc_const' >> $@ - ${CC} -E $(INCLUDES) ${DEFINES} -D_h_tc_const tc.const.c | \ - grep 'Char STR' | \ - sed -e 's/Char \([a-zA-Z0-9_]*\)\[\].*/extern Char \1[];/' | \ - sort >> $@ - @echo '#endif /* _h_tc_const */' >> $@ - -config.h: config_f.h - cp config/ConfigH config.h - -$(OBJS): sh.err.h tc.const.h ed.defns.h - -tar.Z: - rm -f tcsh-${VERSION}.tar.Z - rm -rf tcsh-${VERSION} - mkdir tcsh-${VERSION} tcsh-${VERSION}/config - cp ${ALLSRCS} tcsh-${VERSION} - cp ${CONFSRCS} tcsh-${VERSION}/config - tar cf - nls/Makefile nls/?*/set?* | (cd tcsh-${VERSION}; tar xpf -) - tar cvf - tcsh-${VERSION} | compress > tcsh-${VERSION}.tar.Z - rm -rf tcsh-${VERSION} - -tar.gz: - rm -f tcsh-${VERSION}.tar.gz - rm -rf tcsh-${VERSION} - mkdir tcsh-${VERSION} tcsh-${VERSION}/config - cp ${ALLSRCS} tcsh-${VERSION} - cp ${CONFSRCS} tcsh-${VERSION}/config - tar cf - nls/Makefile nls/?*/set?* | (cd tcsh-${VERSION}; tar xpf -) - tar cvf - tcsh-${VERSION} | gzip > tcsh-${VERSION}.tar.gz - rm -rf tcsh-${VERSION} - -shar: - rm -f tcsh-*.shar - rm -rf tcsh-${VERSION} - mkdir tcsh-${VERSION} tcsh-${VERSION}/config - cp ${ALLSRCS} tcsh-${VERSION} - cp ${CONFSRCS} tcsh-${VERSION}/config - tar cf - nls/Makefile nls/?*/set?* | (cd tcsh-${VERSION}; tar xpf -) - MAKESHAR -v -n tcsh-${VERSION} tcsh-${VERSION} \ - tcsh-${VERSION}/?* tcsh-${VERSION}/config/?* \ - tcsh-${VERSION}/?*/set?* - rm -rf tcsh-${VERSION} - -catalogs: - @(cd nls; make catalogs) - -world: - $(MAKE) clean ; $(MAKE) depend ; $(MAKE) tcsh ; $(MAKE) install - -clean:: - rm -f ed.defns.h sh.err.h tc.const.h config.h tc.defs.* - rm -f tcsh.*.m tcsh.*.cat - -depend:: config.h ed.defns.h sh.err.h tc.const.h $(SRCS) tc.defs.c - -tc.defs.${SUF}: tc.defs.c sh.h - -tc.defs.c: gethost host.defs - @rm -f $@ - @echo "/* Do not edit this file, make creates it */" > $@ - ./gethost host.defs >> $@ - -ALIB=$(HESLIB) $(AFSLIB) $(SYSLIBS) -AINC=ed.defns.h sh.err.h tc.const.h sh.h - -NormalProgramTarget(tcsh, $(OBJS), $(AINC), $(LOCALLIBS), $(ALIB)) -NormalProgramTarget(gethost, gethost.${SUF}, $(AINC), $(LOCALLIBS), $(ALIB)) - -InstallProgram(tcsh,$(TCSH_BINDIR)) -InstallManPage(tcsh,$(TCSH_MANDIR)) -DependTarget() diff --git a/contrib/tcsh/MAKEDIFFS b/contrib/tcsh/MAKEDIFFS deleted file mode 100755 index be0e5b242668..000000000000 --- a/contrib/tcsh/MAKEDIFFS +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/sh -# -# MAKEDIFFS.sh: Make context diffs for the csh sources -# -XINUDIR=/usr/share/src/mtXinu/bin/csh -BSDDIR=/usr/share/src/mtXinu/BSD/bin/csh -TAHOEDIR=/usr/share/src/mtXinu/TAHOE/bin/csh -RENODIR=/usr/share/src/mtXinu/RENO/bin/csh -TCSHDIR=`pwd` -case "x$1" in -xxinu) - CSHDIR=$XINUDIR;; -xbsd) - CSHDIR=$BSDDIR;; -xtahoe) - CSHDIR=$TAHOEDIR;; -xreno) - CSHDIR=$RENODIR;; -x*) - echo "Usage: `basename $0` [bsd|tahoe|xinu|reno]";exit 1;; -esac -DIFF1='sh.c sh.char.c sh.dir.c sh.dol.c sh.err.c sh.exec.c sh.exp.c sh.file.c' -DIFF2='sh.func.c sh.glob.c sh.hist.c sh.init.c sh.lex.c sh.misc.c sh.parse.c sh.print.c' -DIFF3='sh.proc.c sh.sem.c sh.set.c sh.time.c sh.char.h sh.dir.h sh.h sh.local.h sh.proc.h' - -for i in $DIFF1 -do - diff -c $CSHDIR/$i $TCSHDIR/$i -done > DIFFS.1 - -for i in $DIFF2 -do - diff -c $CSHDIR/$i $TCSHDIR/$i -done > DIFFS.2 - -for i in $DIFF3 -do - diff -c $CSHDIR/$i $TCSHDIR/$i -done > DIFFS.3 -exit 0 diff --git a/contrib/tcsh/MAKESHAR b/contrib/tcsh/MAKESHAR deleted file mode 100755 index 48c73b7c74ab..000000000000 --- a/contrib/tcsh/MAKESHAR +++ /dev/null @@ -1,120 +0,0 @@ -#!/bin/sh -# -# MAKESHAR.sh: Make a shar file for the sources -# - -AWK=/usr/bin/nawk # Must be nawk or gawk cause of 2D arrays -WC=/usr/ucb/wc -GREP=/usr/bin/egrep -SORT=/usr/bin/sort -SH=/bin/sh - -dirs= -name=kit -files= -verbose=0 -size=45000 - -for i -do - case $i in - -n) - name=;; - -v) - verbose=1;; - -d) - SH=/bin/cat;; - -s) - size=$1;; - *) - if [ -z "$name" ] - then - name=$i - elif [ -d $i ] - then - dirs="$dirs $i" - elif [ -f $i ] - then - files="$files $i" - else - echo "$0: File `$i' not found." 1>&2 - exit 1 - fi;; - esac -done - -if [ \( -z "$files" \) -a \( -z "$dirs" \) ] -then - echo "Usage: $0 [-n name] [-s size] [-vd] ." 1>&2 - exit 1 -fi - -$WC $files | $GREP -v total | $SORT +2 | $AWK ' - BEGIN { - i = 0; - seq = 1; - size = 0; - name = 1; - used = 2; - verbose='"$verbose"'; - tty = "/dev/tty"; - maxsize = '"$size"'; - dirs = "'"$dirs"'"; - }; - { - a[i, size] = $3; - a[i, name] = $4; - a[i, used] = 0; - i++; - }; - END { - for (maxi = i--; i >= 0; i--) { - idx = 0; - if (a[i, used] == 0) { - if (verbose && a[i, size] > maxsize) - printf("Warning: File %s is %d > %d\n", - a[i, name], a[i, size], maxsize) > tty; - s = a[i, size]; - a[i, used] = 1; - kit[seq, idx++] = i; - j = 0; - while (j < maxi) { - # Find the greatest file we can add - j = maxi; - for (k = 0; k < maxi; k++) - if (a[k, used] == 0 && a[k, size] + s < maxsize) - j = k; - if (j < maxi) { - s += a[j, size]; - a[j, used] = 1; - kit[seq, idx++] = j; - } - } - sizes[seq] = s; - kit[seq++, idx] = -1; - } - } - for (i = 1; i < seq; i++) { - printf("shar -n%d -e%d %s ", i, seq - 1, dirs); - if (verbose) { - printf("%3d of %3d: ", i, seq - 1) > tty; - len = 12; - } - for (j = 0; kit[i, j] != -1; j++) { - s = a[kit[i, j], name]; - if (verbose) { - clen = length(s) + 1; - len += clen; - if (len > 70) { - printf("\n ") > tty; - len = 12 + clen; - } - printf("%s ", s) > tty; - } - printf("%s ", s); - } - printf("> '"$name"'-%d.shar;", i); - if (verbose) - printf("= %5d\n", sizes[i]) > tty; - } - }' | $SH diff --git a/contrib/tcsh/Makefile.ADMIN b/contrib/tcsh/Makefile.ADMIN deleted file mode 100644 index 5ad3bb8fb3c5..000000000000 --- a/contrib/tcsh/Makefile.ADMIN +++ /dev/null @@ -1,24 +0,0 @@ -# -# Makefile.ADMIN -# -# Maintenance tasks -# -# You can refetch files from the website, then run "git diff" to -# sanity check any changes before committing. -# - -LYNX= lynx -dump -nolist -TRIM= expand | sed -e 's/^ *$$//' | cat -s -WEB= https://www.tcsh.org - -PAGES= FAQ - -all: ${PAGES} - -.for i in ${PAGES} -$i: force - ${LYNX} ${WEB}/${i:tl}/ | ${TRIM} > ${.TARGET} -.endfor - -.DUMMY: force -force: diff --git a/contrib/tcsh/Makefile.in b/contrib/tcsh/Makefile.in deleted file mode 100644 index c6b5f2554cc0..000000000000 --- a/contrib/tcsh/Makefile.in +++ /dev/null @@ -1,782 +0,0 @@ -# -# C Shell with process control; VM/UNIX VAX Makefile -# Bill Joy UC Berkeley; Jim Kulp IIASA, Austria -# -# With an input editor, command completion, etc. and ported to all sorts of -# things; Paul Placeway, CIS Dept., Ohio State University -# -SHELL=/bin/sh -ENVCMD=/usr/bin/env -VERSION=@PACKAGE_VERSION@ -BUILD=tcsh$(EXEEXT) -VPATH=@srcdir@ -srcdir=@srcdir@ - -################################################################ -## CFLAGS. For various -D things, see config.h -################################################################ -# -# These are the default suffixes from .c to .o and -c to get there -# but to use the global optimizer on the mips boxes, see below -# -SUF=o -CF=-c - -CPPFLAGS=-I. -I$(srcdir) - -LFLAGS= -# hpux lint -#LFLAGS= -Zn10000 - - -# This is set by autoconf: -CFLAGS = @CFLAGS@ -# debug: -#CFLAGS= -g -# production: -#CFLAGS= -O -# Broken optimizers.... -#CFLAGS= - -#CFLAGS= -g -pg -DPROF -#CFLAGS= -O -pg -DPROF - -# gcc 1.00-1.37 -#CFLAGS= -O -finline-functions -fstrength-reduce - -# gcc 1.37-1.40 -#CFLAGS= -O -fcombine-regs -finline-functions -fstrength-reduce -# add -msoft-float for 68881 machines. - -# gcc 2.0 -# On the sparc, don't use -O2; it breaks setjmp() and vfork() -#CFLAGS= -O - -# gcc-2.1+ -#CFLAGS= -O2 - -# lucid c on suns -#CFLAGS= -O5 - -# gcc 2.1 on linux -#CFLAGS= -O6 -fomit-frame-pointer - -# HP/UX 8.0, 9.0 -#CFLAGS= +O3 -Aa - -# Ultrix 4.2a -#CFLAGS= -O -Olimit 2000 - -# Intel Paragon OSF/1 with PGI compilers -#CFLAGS= -O -Mnodebug -Mnoperfmon - -# DEC Alpha OSF/1 -## Normal Optimization -#CFLAGS= -O2 -Olimit 2000 -## Full Optimization - may not work -#CFLAGS= -O3 -Olimit 2000 -#CF=-j -#SUF=u -#.SUFFIXES: .u *** 15513 LINES SKIPPED *** From owner-dev-commits-src-branches@freebsd.org Wed Jun 2 05:38:45 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CECB763AE06; Wed, 2 Jun 2021 05:38:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FvyW95P8lz3qJ2; Wed, 2 Jun 2021 05:38:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A282110FF0; Wed, 2 Jun 2021 05:38:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1525cjFH072970; Wed, 2 Jun 2021 05:38:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1525cj93072969; Wed, 2 Jun 2021 05:38:45 GMT (envelope-from git) Date: Wed, 2 Jun 2021 05:38:45 GMT Message-Id: <202106020538.1525cj93072969@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: fae149a0891f - stable/12 - tcsh: update to version 6.22.04. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: fae149a0891fa1c9637a79fed1fea8a8b566c9d0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jun 2021 05:38:46 -0000 The branch stable/12 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=fae149a0891fa1c9637a79fed1fea8a8b566c9d0 commit fae149a0891fa1c9637a79fed1fea8a8b566c9d0 Author: Dmitry Chagin AuthorDate: 2021-05-19 21:12:27 +0000 Commit: Dmitry Chagin CommitDate: 2021-06-02 05:38:24 +0000 tcsh: update to version 6.22.04. Merge commit '174d8b60324d7e8754709f7155e13ca95220b48c' into main. (cherry picked from commit 6560ac57ce879857203bc456cdc3849808dc0700) --- contrib/tcsh/Fixes | 1 + contrib/tcsh/ed.chared.c | 98 ++++++++++++++++---------------- contrib/tcsh/ed.defns.c | 10 ++-- contrib/tcsh/ed.h | 10 +++- contrib/tcsh/ed.init.c | 48 ++++++++-------- contrib/tcsh/ed.inputl.c | 20 +++---- contrib/tcsh/ed.refresh.c | 16 +++--- contrib/tcsh/ed.screen.c | 18 +++--- contrib/tcsh/ed.term.c | 34 ++++++------ contrib/tcsh/ed.term.h | 6 +- contrib/tcsh/ed.xmap.c | 10 ++-- contrib/tcsh/gethost.c | 8 +-- contrib/tcsh/glob.c | 18 +++--- contrib/tcsh/glob.h | 2 +- contrib/tcsh/ma.setp.c | 4 +- contrib/tcsh/mi.termios.c | 2 +- contrib/tcsh/mi.wait.h | 2 +- contrib/tcsh/patchlevel.h | 4 +- contrib/tcsh/sh.c | 100 ++++++++++++++++----------------- contrib/tcsh/sh.char.c | 136 ++++++++++++++++++++++----------------------- contrib/tcsh/sh.char.h | 2 +- contrib/tcsh/sh.decls.h | 14 ++--- contrib/tcsh/sh.dir.c | 44 +++++++-------- contrib/tcsh/sh.dol.c | 10 ++-- contrib/tcsh/sh.err.c | 2 +- contrib/tcsh/sh.exec.c | 10 ++-- contrib/tcsh/sh.exp.c | 44 +++++++-------- contrib/tcsh/sh.file.c | 2 +- contrib/tcsh/sh.func.c | 84 ++++++++++++++-------------- contrib/tcsh/sh.glob.c | 18 +++--- contrib/tcsh/sh.h | 36 ++++++------ contrib/tcsh/sh.hist.c | 46 +++++++++------ contrib/tcsh/sh.init.c | 12 ++-- contrib/tcsh/sh.lex.c | 16 +++--- contrib/tcsh/sh.misc.c | 6 +- contrib/tcsh/sh.parse.c | 1 + contrib/tcsh/sh.print.c | 6 +- contrib/tcsh/sh.proc.c | 28 +++++----- contrib/tcsh/sh.sem.c | 22 ++++---- contrib/tcsh/sh.set.c | 16 +++--- contrib/tcsh/sh.time.c | 6 +- contrib/tcsh/sh.types.h | 36 ++++++------ contrib/tcsh/tc.alloc.c | 18 +++--- contrib/tcsh/tc.bind.c | 4 +- contrib/tcsh/tc.const.c | 20 +++---- contrib/tcsh/tc.decls.h | 4 +- contrib/tcsh/tc.func.c | 32 +++++------ contrib/tcsh/tc.os.c | 52 ++++++++--------- contrib/tcsh/tc.os.h | 22 ++++---- contrib/tcsh/tc.printf.c | 4 +- contrib/tcsh/tc.prompt.c | 10 ++-- contrib/tcsh/tc.str.c | 8 +-- contrib/tcsh/tc.vers.c | 22 ++++---- contrib/tcsh/tc.who.c | 8 +-- contrib/tcsh/tcsh.man | 4 +- contrib/tcsh/tw.color.c | 6 +- contrib/tcsh/tw.comp.c | 14 ++--- contrib/tcsh/tw.h | 2 +- contrib/tcsh/tw.init.c | 18 +++--- contrib/tcsh/tw.parse.c | 48 ++++++++-------- contrib/tcsh/vms.termcap.c | 2 +- 61 files changed, 663 insertions(+), 643 deletions(-) diff --git a/contrib/tcsh/Fixes b/contrib/tcsh/Fixes index e539c8241a86..76fdede0c4b7 100644 --- a/contrib/tcsh/Fixes +++ b/contrib/tcsh/Fixes @@ -1,3 +1,4 @@ + 15. V6.22.04 - 20210426 14. Don't crash with 'bindkey "^0" clear-screen' (Karl Jeacle) 13. Fix $x:q:h and $x:q:t return the whole string for strings not containing / 12. V6.22.03 - 20201118 diff --git a/contrib/tcsh/ed.chared.c b/contrib/tcsh/ed.chared.c index 2b4a63c8ca6e..2a8689713399 100644 --- a/contrib/tcsh/ed.chared.c +++ b/contrib/tcsh/ed.chared.c @@ -51,7 +51,7 @@ hello world # echo "h # echo "hello - + The former problem could be solved with minor modifications of c_preword() and c_endword(). The latter, however, required a significant rewrite of c_preword(), since quoted strings must be parsed from start to end to @@ -207,9 +207,9 @@ c_delafter(int num) } #ifdef notdef else { - /* + /* * XXX: We don't want to do that. In emacs mode overwrite should be - * sticky. I am not sure how that affects vi mode + * sticky. I am not sure how that affects vi mode */ inputmode = MODE_INSERT; } @@ -269,7 +269,7 @@ c_preword(Char *p, Char *low, int n, Char *delim) new = c_endword(prev-1, p, 1, delim); /* Skip to next non-word char */ new++; /* Step away from end of word */ while (new <= p) { /* Skip trailing non-word chars */ - if (!Strchr(delim, *new) || new > prev && new[-1] == (Char)'\\') + if (!Strchr(delim, *new) || (new > prev && new[-1] == (Char)'\\')) break; new++; } @@ -314,12 +314,12 @@ c_prev_word(Char *p, Char *low, int n) if (!VImode) { while (n--) { - while ((p >= low) && !isword(*p)) + while ((p >= low) && !isword(*p)) p--; - while ((p >= low) && isword(*p)) + while ((p >= low) && isword(*p)) p--; } - + /* cp now points to one character before the word */ p++; if (p < low) @@ -327,7 +327,7 @@ c_prev_word(Char *p, Char *low, int n) /* cp now points where we want it */ return(p); } - + while (n--) { int c_class; @@ -359,9 +359,9 @@ c_next_word(Char *p, Char *high, int n) { if (!VImode) { while (n--) { - while ((p < high) && !isword(*p)) + while ((p < high) && !isword(*p)) p++; - while ((p < high) && isword(*p)) + while ((p < high) && isword(*p)) p++; } if (p > high) @@ -399,9 +399,9 @@ static Char * c_nexword(Char *p, Char *high, int n) { while (n--) { - while ((p < high) && !Isspace(*p)) + while ((p < high) && !Isspace(*p)) p++; - while ((p < high) && Isspace(*p)) + while ((p < high) && Isspace(*p)) p++; } @@ -507,7 +507,7 @@ excl_sw: * Search for a space, tab, or colon. See if we have a number (as * in !1234:xyz). Remember the number. */ - for (i = 0, all_dig = 1; + for (i = 0, all_dig = 1; *q != ' ' && *q != '\t' && *q != ':' && q < Cursor; q++) { /* * PWP: !-4 is a valid history argument too, therefore the test @@ -739,7 +739,7 @@ c_substitute(void) * Start p out one character before the cursor. Move it backwards looking * for white space, the beginning of the line, or a history character. */ - for (p = Cursor - 1; + for (p = Cursor - 1; p > InputBuf && *p != ' ' && *p != '\t' && *p && *p != HIST; --p) continue; @@ -765,14 +765,14 @@ c_delfini(void) /* Finish up delete action */ ActionFlag = TCSHOP_NOP; - if (ActionPos == 0) + if (ActionPos == 0) return; UndoAction = TCSHOP_INSERT; if (Cursor > ActionPos) { Size = (int) (Cursor-ActionPos); - c_delbefore(Size); + c_delbefore(Size); RefCursor(); } else if (Cursor < ActionPos) { @@ -1016,7 +1016,7 @@ GetHistLine(void) if (LastChar < InputBuf) LastChar = InputBuf; } - + #ifdef KSHVI if (VImode) Cursor = InputBuf; @@ -1082,7 +1082,7 @@ e_inc_search(int dir) } done = redo = 0; *LastChar++ = '\n'; - for (cp = newdir == F_UP_SEARCH_HIST ? STRbck : STRfwd; + for (cp = newdir == F_UP_SEARCH_HIST ? STRbck : STRfwd; *cp; *LastChar++ = *cp++) continue; *LastChar++ = pchar; @@ -1128,7 +1128,7 @@ e_inc_search(int dir) case F_DELPREV: if (patbuf.len > 1) done++; - else + else SoundBeep(); break; @@ -1162,7 +1162,7 @@ e_inc_search(int dir) break; } break; - + default: /* Terminate and execute cmd */ endcmd[0] = ch; PushMacro(endcmd); @@ -1253,7 +1253,7 @@ e_inc_search(int dir) } if (done || ret != CC_NORM) return(ret); - + } } @@ -1359,7 +1359,7 @@ v_search(int dir) cleanup_until(&tmpbuf); LastCmd = (KEYCMD) dir; /* avoid c_hsetpat */ Cursor = LastChar = InputBuf; - if ((dir == F_UP_SEARCH_HIST ? e_up_search_hist(0) : + if ((dir == F_UP_SEARCH_HIST ? e_up_search_hist(0) : e_down_search_hist(0)) == CC_ERROR) { Refresh(); return(CC_ERROR); @@ -1472,7 +1472,7 @@ e_insert(Char c) else { if (inputmode != MODE_INSERT) { int i; - for (i = 0; i < Argument; i++) + for (i = 0; i < Argument; i++) UndoBuf[UndoSize++] = Cursor[i]; UndoBuf[UndoSize] = '\0'; @@ -1948,7 +1948,7 @@ e_down_search_hist(Char c) #ifdef SDEBUG xprintf("Comparing with \"%S\"\n", hl); #endif - if ((Strncmp(hl, InputBuf, (size_t) (LastChar - InputBuf)) || + if ((Strncmp(hl, InputBuf, (size_t) (LastChar - InputBuf)) || hl[LastChar-InputBuf]) && c_hmatch(hl)) found = h; if (!HistLit) @@ -2392,14 +2392,14 @@ e_delwordprev(Char c) * Changed the names of some of the ^D family of editor functions to * correspond to what they actually do and created new e_delnext_list * for completeness. - * + * * Old names: New names: - * + * * delete-char delete-char-or-eof * F_DELNEXT F_DELNEXT_EOF * e_delnext e_delnext_eof * edelnxt edelnxteof - * delete-char-or-eof delete-char + * delete-char-or-eof delete-char * F_DELNEXT_EOF F_DELNEXT * e_delnext_eof e_delnext * edelnxteof edelnxt @@ -2445,13 +2445,13 @@ e_delnext_eof(Char c) USE(c); if (Cursor == LastChar) {/* if I'm at the end */ if (!VImode) { - if (Cursor == InputBuf) { + if (Cursor == InputBuf) { /* if I'm also at the beginning */ so_write(STReof, 4);/* then do a EOF */ flush(); return(CC_EOF); } - else + else return(CC_ERROR); } else { @@ -2574,8 +2574,8 @@ e_tobeg(Char c) Cursor = InputBuf; if (VImode) { - while (Isspace(*Cursor)) /* We want FIRST non space character */ - Cursor++; + while (Isspace(*Cursor)) /* We want FIRST non space character */ + Cursor++; if (ActionFlag & TCSHOP_DELETE) { c_delfini(); return(CC_REFRESH); @@ -2761,7 +2761,7 @@ e_wordback(Char c) Cursor = c_prev_word(Cursor, InputBuf, Argument); /* bounds check */ - if (VImode) + if (VImode) if (ActionFlag & TCSHOP_DELETE) { c_delfini(); return(CC_REFRESH); @@ -2892,9 +2892,9 @@ v_csearch_back(Char ch, int count, int tflag) cp = Cursor; while (count--) { - if (*cp == ch) + if (*cp == ch) cp--; - while (cp > InputBuf && *cp != ch) + while (cp > InputBuf && *cp != ch) cp--; } @@ -2923,9 +2923,9 @@ v_csearch_fwd(Char ch, int count, int tflag) cp = Cursor; while (count--) { - if (*cp == ch) + if (*cp == ch) cp++; - while (cp < LastChar && *cp != ch) + while (cp < LastChar && *cp != ch) cp++; } @@ -2955,21 +2955,21 @@ v_action(int c) if (ActionFlag == TCSHOP_DELETE) { ActionFlag = TCSHOP_NOP; ActionPos = 0; - + UndoSize = 0; kp = UndoBuf; for (cp = InputBuf; cp < LastChar; cp++) { *kp++ = *cp; UndoSize++; } - + UndoAction = TCSHOP_INSERT; UndoPtr = InputBuf; LastChar = InputBuf; Cursor = InputBuf; if (c & TCSHOP_INSERT) c_alternativ_key_map(0); - + return(CC_REFRESH); } #ifdef notdef @@ -3359,7 +3359,7 @@ e_cleardisp(Char c) /*ARGSUSED*/ CCRETVAL e_tty_int(Char c) -{ +{ USE(c); #if defined(_MINIX) || defined(WINNT_NATIVE) /* SAK PATCH: erase all of current line, start again */ @@ -3398,9 +3398,9 @@ e_stuff_char(Char c) if (was_raw) (void) Rawmode(); return(e_redisp(c)); -#else /* !TIOCSTI */ +#else /* !TIOCSTI */ return(CC_ERROR); -#endif /* !TIOCSTI */ +#endif /* !TIOCSTI */ } /*ARGSUSED*/ @@ -3538,7 +3538,7 @@ e_copyprev(Char c) oldc = Cursor; /* does a bounds check */ - cp = c_prev_word(Cursor, InputBuf, Argument); + cp = c_prev_word(Cursor, InputBuf, Argument); c_insert((int)(oldc - cp)); for (dp = oldc; cp < oldc && dp < LastChar; cp++) @@ -3569,7 +3569,7 @@ e_load_average(Char c) * Here we pass &c to the ioctl because some os's (NetBSD) expect it * there even if they don't use it. (lukem@netbsd.org) */ - if (ioctl(SHIN, TIOCSTAT, (ioctl_t) &c) < 0) + if (ioctl(SHIN, TIOCSTAT, (ioctl_t) &c) < 0) #endif xprintf("%s", CGETS(5, 1, "Load average unavailable\n")); return(CC_REFRESH); @@ -3707,7 +3707,7 @@ v_rchar_fwd(Char c) if (srch_char == 0) return CC_ERROR; - return srch_dir == CHAR_FWD ? v_csearch_fwd(srch_char, Argument, 0) : + return srch_dir == CHAR_FWD ? v_csearch_fwd(srch_char, Argument, 0) : v_csearch_back(srch_char, Argument, 0); } @@ -3719,7 +3719,7 @@ v_rchar_back(Char c) if (srch_char == 0) return CC_ERROR; - return srch_dir == CHAR_BACK ? v_csearch_fwd(srch_char, Argument, 0) : + return srch_dir == CHAR_BACK ? v_csearch_fwd(srch_char, Argument, 0) : v_csearch_back(srch_char, Argument, 0); } @@ -3747,7 +3747,7 @@ v_undo(Char c) LastChar -= UndoSize; Cursor = UndoPtr; - + UndoAction = TCSHOP_INSERT; break; @@ -3816,12 +3816,12 @@ v_rsrch_back(Char c) { USE(c); if (patbuf.len == 0) return(CC_ERROR); - return(v_repeat_srch(searchdir == F_UP_SEARCH_HIST ? + return(v_repeat_srch(searchdir == F_UP_SEARCH_HIST ? F_DOWN_SEARCH_HIST : F_UP_SEARCH_HIST)); } #ifndef WINNT_NATIVE -/* Since ed.defns.h is generated from ed.defns.c, these empty +/* Since ed.defns.h is generated from ed.defns.c, these empty functions will keep the F_NUM_FNS consistent */ CCRETVAL diff --git a/contrib/tcsh/ed.defns.c b/contrib/tcsh/ed.defns.c index 02ae764510af..f4030b530f6d 100644 --- a/contrib/tcsh/ed.defns.c +++ b/contrib/tcsh/ed.defns.c @@ -245,7 +245,7 @@ PFCmd CcFuncTbl[] = { /* table of available commands */ #define F_PATH_NORM 103 e_delnext_eof, /* added by mtk@ari.ncl.omron.co.jp (920818) */ #define F_DELNEXT_EOF 104 - e_stuff_char, + e_stuff_char, #define F_STUFF_CHAR 105 e_complete_all, #define F_COMPLETE_ALL 106 @@ -899,8 +899,8 @@ KEYCMD CcViCmdMap[] = { F_UNASSIGNED, /* ) */ F_EXPAND_GLOB, /* * */ F_DOWN_HIST, /* + */ - V_RCHAR_BACK, /* , */ - F_UP_HIST, /* - */ + V_RCHAR_BACK, /* , */ + F_UP_HIST, /* - */ F_UNASSIGNED, /* . */ V_DSH_META, /* / */ V_ZERO, /* 0 */ @@ -1416,13 +1416,13 @@ editinit(void) f++; f->name = "normalize-path"; f->func = F_PATH_NORM; - f->desc = CSAVS(3, 53, + f->desc = CSAVS(3, 53, "Expand pathnames, eliminating leading .'s and ..'s"); f++; f->name = "normalize-command"; f->func = F_COMMAND_NORM; - f->desc = CSAVS(3, 54, + f->desc = CSAVS(3, 54, "Expand commands to the resulting pathname or alias"); f++; diff --git a/contrib/tcsh/ed.h b/contrib/tcsh/ed.h index 60d061a80bda..50990dee92b6 100644 --- a/contrib/tcsh/ed.h +++ b/contrib/tcsh/ed.h @@ -219,7 +219,7 @@ EXTERN char T_HasMeta; /* true if we have a meta key */ # define M_CHAR 2 # define M_NN 3 #endif /* TERMIO */ -typedef struct { +typedef struct { const char *t_name; unsigned int t_setmask; unsigned int t_clrmask; @@ -247,8 +247,12 @@ extern int tgetflag (const char *); extern int tgetnum (const char *); extern char *tgoto (const char *, int, int); extern void tputs (const char *, int, void (*)(int)); -# define PUTPURE ((void (*)(int)) putpure) -# define PUTRAW ((void (*)(int)) putraw) +static __inline void PUTPURE(int c) { + (void)putpure(c); +} +static __inline void PUTRAW(int c) { + (void)putraw(c); +} #endif #endif /* _h_ed */ diff --git a/contrib/tcsh/ed.init.c b/contrib/tcsh/ed.init.c index f90028499f53..4781f15a5ea5 100644 --- a/contrib/tcsh/ed.init.c +++ b/contrib/tcsh/ed.init.c @@ -41,7 +41,7 @@ int Tty_raw_mode = 0; /* Last tty change was to raw mode */ int MacroLvl = -1; /* pointer to current macro nesting level; */ /* (-1 == none) */ static int Tty_quote_mode = 0; /* Last tty change was to quote mode */ -static unsigned char vdisable; /* The value of _POSIX_VDISABLE from +static unsigned char vdisable; /* The value of _POSIX_VDISABLE from * pathconf(2) */ int Tty_eight_bit = -1; /* does the tty handle eight bits */ @@ -56,8 +56,8 @@ static ttydata_t extty, edtty, tstty; #define uc unsigned char static unsigned char ttychars[NN_IO][C_NCC] = { { - (uc)CINTR, (uc)CQUIT, (uc)CERASE, (uc)CKILL, - (uc)CEOF, (uc)CEOL, (uc)CEOL2, (uc)CSWTCH, + (uc)CINTR, (uc)CQUIT, (uc)CERASE, (uc)CKILL, + (uc)CEOF, (uc)CEOL, (uc)CEOL2, (uc)CSWTCH, (uc)CDSWTCH, (uc)CERASE2, (uc)CSTART, (uc)CSTOP, (uc)CWERASE, (uc)CSUSP, (uc)CDSUSP, (uc)CREPRINT, (uc)CDISCARD, (uc)CLNEXT, (uc)CSTATUS, (uc)CPAGE, @@ -65,15 +65,15 @@ static unsigned char ttychars[NN_IO][C_NCC] = { (uc)CTIME }, { - CINTR, CQUIT, CERASE, CKILL, - _POSIX_VDISABLE, _POSIX_VDISABLE, _POSIX_VDISABLE, _POSIX_VDISABLE, - _POSIX_VDISABLE, CERASE2, CSTART, CSTOP, - _POSIX_VDISABLE, _POSIX_VDISABLE, _POSIX_VDISABLE, _POSIX_VDISABLE, - CDISCARD, _POSIX_VDISABLE, _POSIX_VDISABLE, _POSIX_VDISABLE, + CINTR, CQUIT, CERASE, CKILL, + _POSIX_VDISABLE, _POSIX_VDISABLE, _POSIX_VDISABLE, _POSIX_VDISABLE, + _POSIX_VDISABLE, CERASE2, CSTART, CSTOP, + _POSIX_VDISABLE, _POSIX_VDISABLE, _POSIX_VDISABLE, _POSIX_VDISABLE, + CDISCARD, _POSIX_VDISABLE, _POSIX_VDISABLE, _POSIX_VDISABLE, _POSIX_VDISABLE, _POSIX_VDISABLE, _POSIX_VDISABLE, 1, 0 }, - { + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -136,7 +136,7 @@ ed_set_tty_eight_bit(void) Tty_eight_bit = tty_geteightbit(&extty); } - + int ed_Setup(int rst) { @@ -148,12 +148,12 @@ ed_Setup(int rst) #if defined(POSIX) && defined(_PC_VDISABLE) && !defined(BSD4_4) && \ !defined(WINNT_NATIVE) - { + { long pcret; if ((pcret = fpathconf(SHTTY, _PC_VDISABLE)) == -1L) vdisable = (unsigned char) _POSIX_VDISABLE; - else + else vdisable = (unsigned char) pcret; if (vdisable != (unsigned char) _POSIX_VDISABLE && rst != 0) for (rst = 0; rst < C_NCC; rst++) { @@ -166,7 +166,7 @@ ed_Setup(int rst) #else /* ! POSIX || !_PC_VDISABLE || BSD4_4 || WINNT_NATIVE */ vdisable = (unsigned char) _POSIX_VDISABLE; #endif /* POSIX && _PC_VDISABLE && !BSD4_4 && !WINNT_NATIVE */ - + if ((imode = adrof(STRinputmode)) != NULL && imode->vec != NULL) { if (!Strcmp(*(imode->vec), STRinsert)) inputmode = MODE_INSERT; @@ -236,11 +236,11 @@ ed_Setup(int rst) /* * Don't affect CMIN and CTIME for the editor mode */ - for (rst = 0; rst < C_NCC - 2; rst++) + for (rst = 0; rst < C_NCC - 2; rst++) if (ttychars[TS_IO][rst] != vdisable && ttychars[ED_IO][rst] != vdisable) ttychars[ED_IO][rst] = ttychars[TS_IO][rst]; - for (rst = 0; rst < C_NCC; rst++) + for (rst = 0; rst < C_NCC; rst++) if (ttychars[TS_IO][rst] != vdisable && ttychars[EX_IO][rst] != vdisable) ttychars[EX_IO][rst] = ttychars[TS_IO][rst]; @@ -303,7 +303,7 @@ ed_Init(void) #ifdef DEBUG_EDIT CheckMaps(); /* do a little error checking on key maps */ -#endif +#endif if (ed_Setup(0) == -1) return; @@ -355,7 +355,7 @@ ed_Init(void) #endif /* WINNT_NATIVE */ } -/* +/* * Check and re-init the line. set the terminal into 1 char at a time mode. */ int @@ -416,12 +416,12 @@ Rawmode(void) if (tty_cooked_mode(&tstty)) { /* - * re-test for some things here (like maybe the user typed + * re-test for some things here (like maybe the user typed * "stty -tabs" */ if (tty_gettabs(&tstty) == 0) T_Tabs = 0; - else + else T_Tabs = CanWeTab(); # if defined(POSIX) || defined(TERMIO) @@ -466,7 +466,7 @@ Rawmode(void) if (T_Tabs) /* order of &= and |= is important to XTABS */ extty.d_t.sg_flags &= ~XTABS; - else + else extty.d_t.sg_flags |= XTABS; extty.d_lb = tstty.d_lb; @@ -475,13 +475,13 @@ Rawmode(void) edtty.d_t.sg_flags = extty.d_t.sg_flags; if (T_Tabs) { /* order of &= and |= is important to XTABS */ - edtty.d_t.sg_flags &= + edtty.d_t.sg_flags &= ~(ttylist[ED_IO][M_CONTROL].t_clrmask|XTABS); edtty.d_t.sg_flags |= ttylist[ED_IO][M_CONTROL].t_setmask; } else { edtty.d_t.sg_flags &= ~ttylist[ED_IO][M_CONTROL].t_clrmask; - edtty.d_t.sg_flags |= + edtty.d_t.sg_flags |= (ttylist[ED_IO][M_CONTROL].t_setmask|XTABS); } @@ -503,7 +503,7 @@ Rawmode(void) for (i = 0; i < C_NCC; i++) if (ttychars[TS_IO][i] != ttychars[EX_IO][i]) break; - + if (i != C_NCC || didsetty) { didsetty = 0; /* @@ -605,7 +605,7 @@ Load_input_line(void) #ifdef SUNOS4 long chrs = 0; #else /* !SUNOS4 */ - /* + /* * *Everyone* else has an int, but SunOS wants long! * This breaks where int != long (alpha) */ diff --git a/contrib/tcsh/ed.inputl.c b/contrib/tcsh/ed.inputl.c index 8d4c341631b0..35f21a4e95a8 100644 --- a/contrib/tcsh/ed.inputl.c +++ b/contrib/tcsh/ed.inputl.c @@ -114,7 +114,7 @@ Inputl(void) # ifdef SUNOS4 long chrs = 0; # else /* !SUNOS4 */ - /* + /* * *Everyone* else has an int, but SunOS wants long! * This breaks where int != long (alpha) */ @@ -384,7 +384,7 @@ Inputl(void) } if (InputBuf[curlen] && rotate) { newlen = (int) (LastChar - InputBuf); - for (idx = (int) (Cursor - InputBuf); + for (idx = (int) (Cursor - InputBuf); idx <= newlen; idx++) InputBuf[idx - newlen + curlen] = InputBuf[idx]; @@ -439,13 +439,13 @@ Inputl(void) else SoundBeep(); /* - * Addition by David C Lawrence : If an - * attempted completion is ambiguous, list the choices. - * (PWP: this is the best feature addition to tcsh I have + * Addition by David C Lawrence : If an + * attempted completion is ambiguous, list the choices. + * (PWP: this is the best feature addition to tcsh I have * seen in many months.) */ - if (autol && autol->vec != NULL && - (Strcmp(*(autol->vec), STRambiguous) != 0 || + if (autol && autol->vec != NULL && + (Strcmp(*(autol->vec), STRambiguous) != 0 || expnum == Cursor - InputBuf)) { if (adrof(STRhighlight) && MarkIsSet) { /* clear highlighting before showing completions */ @@ -477,7 +477,7 @@ Inputl(void) case CC_LIST_ALL: if (InputBuf[curlen] && rotate) { newlen = (int) (LastChar - InputBuf); - for (idx = (int) (Cursor - InputBuf); + for (idx = (int) (Cursor - InputBuf); idx <= newlen; idx++) InputBuf[idx - newlen + curlen] = InputBuf[idx]; @@ -667,7 +667,7 @@ RunCommand(Char *str) int GetCmdChar(Char ch) { -#ifndef WINNT_NATIVE // We use more than 256 for various extended keys +#ifndef WINNT_NATIVE // We use more than 256 for various extended keys wint_t c = ch & CHAR; #else wint_t c = ch; @@ -725,7 +725,7 @@ GetNextCommand(KEYCMD *cmdnum, Char *ch) break; } } - if (!AltKeyMap) + if (!AltKeyMap) CurrentKeyMap = CcKeyMap; } *cmdnum = cmd; diff --git a/contrib/tcsh/ed.refresh.c b/contrib/tcsh/ed.refresh.c index 3619e1144bf6..c1f1cfb0b16f 100644 --- a/contrib/tcsh/ed.refresh.c +++ b/contrib/tcsh/ed.refresh.c @@ -76,7 +76,7 @@ dprintstr(char *str, const Char *f, const Char *t) #endif /* DEBUG_UPDATE */ /* reprintf(): - * Print to $DEBUGTTY, so that we can test editing on one pty, and + * Print to $DEBUGTTY, so that we can test editing on one pty, and * print debugging stuff on another. Don't interrupt the shell while * debugging cause you'll mangle up the file descriptors! */ @@ -461,7 +461,7 @@ GotoBottom(void) MoveToLine(OldvcV); } -#endif +#endif void PastBottom(void) @@ -602,7 +602,7 @@ update_line(Char *old, Char *new, int cur_line) */ o = Strend(o); - /* + /* * Remove any trailing blanks off of the end, being careful not to * back up past the beginning. */ @@ -628,7 +628,7 @@ update_line(Char *old, Char *new, int cur_line) } ne = n; *ne = (Char) 0; - + /* * if no diff, continue to next line of redraw */ @@ -824,14 +824,14 @@ update_line(Char *old, Char *new, int cur_line) /* * at this point we have something like this: - * + * * /old /ofd /osb /ose /ols /oe * v.....................v v..................v v........v * eddie> Oh, my fredded gruntle-buggy is to me, as foo var lurgid as * eddie> Oh, my fredded quiux buggy is to me, as gruntle-lurgid as - * ^.....................^ ^..................^ ^........^ + * ^.....................^ ^..................^ ^........^ * \new \nfd \nsb \nse \nls \ne - * + * * fx is the difference in length between the the chars between nfd and * nsb, and the chars between ofd and osb, and is thus the number of * characters to delete if < 0 (new is shorter than old, as above), @@ -1040,7 +1040,7 @@ update_line(Char *old, Char *new, int cur_line) #ifdef DEBUG_UPDATE reprintf("with stuff to keep at end\r\n"); #endif /* DEBUG_UPDATE */ - /* + /* * We have to recalculate fx here because we set it * to zero above as a flag saying that we hadn't done * an early first insert. diff --git a/contrib/tcsh/ed.screen.c b/contrib/tcsh/ed.screen.c index e8b351fe800d..4c5339b2c307 100644 --- a/contrib/tcsh/ed.screen.c +++ b/contrib/tcsh/ed.screen.c @@ -135,7 +135,7 @@ static const struct { #define T_fs 12 #define T_ho 13 #define T_ic 14 -#define T_im 15 +#define T_im 15 #define T_ip 16 #define T_kd 17 #define T_kh 18 @@ -477,7 +477,7 @@ SetTC(char *what, char *how) break; if (tv->name != NULL) { - if (tv == &tval[T_pt] || tv == &tval[T_km] || + if (tv == &tval[T_pt] || tv == &tval[T_km] || tv == &tval[T_am] || tv == &tval[T_xn]) { if (strcmp(how, "yes") == 0) tv->val = 1; @@ -491,7 +491,7 @@ SetTC(char *what, char *how) T_HasMeta = Val(T_km); T_Margin = Val(T_am) ? MARGIN_AUTO : 0; T_Margin |= Val(T_xn) ? MARGIN_MAGIC : 0; - if (tv == &tval[T_am] || tv == &tval[T_xn]) + if (tv == &tval[T_am] || tv == &tval[T_xn]) ChangeSize(Val(T_li), Val(T_co)); return; } @@ -593,7 +593,7 @@ EchoTC(Char **v) goto end_flush; } - /* + /* * Try to use our local definition first */ scap = NULL; @@ -894,8 +894,8 @@ BindArrowKeys(void) /* * Assign the arrow keys only if: * - * 1. They are multi-character arrow keys and the user - * has not re-assigned the leading character, or + * 1. They are multi-character arrow keys and the user + * has not re-assigned the leading character, or * has re-assigned the leading character to be F_XKEY * 2. They are single arrow keys pointing to an unassigned key. */ @@ -1012,7 +1012,7 @@ CanWeTab(void) /* move to line (first line == 0) as efficiently as possible; */ void -MoveToLine(int where) +MoveToLine(int where) { int del; @@ -1048,7 +1048,7 @@ MoveToLine(int where) del = 0; } else { - for ( ; del > 0; del--) + for ( ; del > 0; del--) (void) putraw('\n'); CursorH = 0; /* because the \n will become \r\n */ } @@ -1415,7 +1415,7 @@ GetTermCaps(void) ptr = getenv("TERM"); #ifdef apollo - /* + /* * If we are on a pad, we pretend that we are dumb. Otherwise the termcap * library will put us in a weird screen mode, thinking that we are going * to use curses diff --git a/contrib/tcsh/ed.term.c b/contrib/tcsh/ed.term.c index b0bea10ab1d6..04aefd05bd78 100644 --- a/contrib/tcsh/ed.term.c +++ b/contrib/tcsh/ed.term.c @@ -35,7 +35,7 @@ #include "ed.h" int didsetty = 0; -ttyperm_t ttylist = { +ttyperm_t ttylist = { { #if defined(POSIX) || defined(TERMIO) { "iflag:", ICRNL, (INLCR|IGNCR) }, @@ -64,7 +64,7 @@ ttyperm_t ttylist = { { "chars:", (C_SH(C_MIN)|C_SH(C_TIME)|C_SH(C_SWTCH)|C_SH(C_DSWTCH)| C_SH(C_WERASE)|C_SH(C_REPRINT)|C_SH(C_SUSP)|C_SH(C_DSUSP)| C_SH(C_EOF)|C_SH(C_EOL)|C_SH(C_DISCARD)|C_SH(C_PGOFF)| - C_SH(C_KILL2)|C_SH(C_PAGE)|C_SH(C_STATUS)|C_SH(C_LNEXT)), + C_SH(C_KILL2)|C_SH(C_PAGE)|C_SH(C_STATUS)|C_SH(C_LNEXT)), 0 } }, { @@ -317,7 +317,7 @@ static const struct tcshmodes { # endif /* LCASE */ # ifdef ECHO { "echo", ECHO, M_CONTROL }, -# endif /* ECHO */ +# endif /* ECHO */ # ifdef CRMOD { "crmod", CRMOD, M_CONTROL }, # endif /* CRMOD */ @@ -432,7 +432,7 @@ static const struct tcshmodes { # endif /* LCRTKIL */ # ifdef LPASS8 { "lpass8", LPASS8, M_LOCAL }, -# endif /* LPASS8 */ +# endif /* LPASS8 */ # ifdef LCTLECH { "lctlech",LCTLECH,M_LOCAL }, # endif /* LCTLECH */ @@ -510,7 +510,7 @@ static const struct tcshmodes { # if defined(VPGOFF) || defined(TIOCGPAGE) { "pgoff", C_SH(C_PGOFF), M_CHAR }, # endif /* VPGOFF */ -# if defined(VKILL2) +# if defined(VKILL2) { "kill2", C_SH(C_KILL2), M_CHAR }, # endif /* VKILL2 */ # if defined(VBRK) || defined(TIOCGETC) @@ -528,7 +528,7 @@ static const struct tcshmodes { /* * If EAGAIN and/or EWOULDBLOCK are defined, we can't just return -1 in all * situations where ioctl() does. - * + * * On AIX 4.1.5 (and presumably some other versions and OSes), as you * perform the manual test suite in the README, if you 'bg' vi immediately * after suspending it, all is well, but if you wait a few seconds, @@ -537,7 +537,7 @@ static const struct tcshmodes { * 0, causing bgetc() to return -1, causing readc() to set doneinp to 1, * causing process() to break out of the main loop, causing tcsh to exit * prematurely. - * + * * If ioctl()'s errno is EAGAIN/EWOULDBLOCK ("Resource temporarily * unavailable"), apparently the tty is being messed with by the OS and we * need to try again. In my testing, ioctl() was never called more than @@ -595,7 +595,7 @@ dosetty(Char **v, struct command *t) cleanup_push(cmdname, xfree); setname(cmdname); - while (v && *v && v[0][0] == '-' && v[0][2] == '\0') + while (v && *v && v[0][0] == '-' && v[0][2] == '\0') switch (v[0][1]) { case 'a': *** 3800 LINES SKIPPED *** From owner-dev-commits-src-branches@freebsd.org Wed Jun 2 06:26:39 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DBC3563BBBE; Wed, 2 Jun 2021 06:26: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 4FvzZR5q3cz3tQq; Wed, 2 Jun 2021 06:26:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AFEDD1223E; Wed, 2 Jun 2021 06:26:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1526Qdjl039508; Wed, 2 Jun 2021 06:26:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1526QdsV039507; Wed, 2 Jun 2021 06:26:39 GMT (envelope-from git) Date: Wed, 2 Jun 2021 06:26:39 GMT Message-Id: <202106020626.1526QdsV039507@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: 849fdb8d7d4c - stable/13 - iwn(4): Remove duplicate device entry MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 849fdb8d7d4cd0b3a9ea0fd6277fc82282da591b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jun 2021 06:26:39 -0000 The branch stable/13 has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=849fdb8d7d4cd0b3a9ea0fd6277fc82282da591b commit 849fdb8d7d4cd0b3a9ea0fd6277fc82282da591b Author: Gordon Bergling AuthorDate: 2021-05-30 13:40:33 +0000 Commit: Gordon Bergling CommitDate: 2021-06-02 06:26:22 +0000 iwn(4): Remove duplicate device entry 'Intel Centrino Wireless-N 6250' is listed twice in the description section of the manual page. PR: 256257 Reported by: Daniel Cervus (cherry picked from commit 66e2a5803b0f80fff3bb8e3659ae7411ef94cc35) --- share/man/man4/iwn.4 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/share/man/man4/iwn.4 b/share/man/man4/iwn.4 index b333aacae5fd..6e9b774bb13d 100644 --- a/share/man/man4/iwn.4 +++ b/share/man/man4/iwn.4 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 30, 2014 +.Dd May 30, 2021 .Dt IWN 4 .Os .Sh NAME @@ -111,7 +111,6 @@ driver provides support for: .It Intel Centrino Wireless-N 6150 .It Intel Centrino Wireless-N 6200 .It Intel Centrino Wireless-N 6250 -.It Intel Centrino Wireless-N 6250 .It Intel Centrino Wireless-N + WiMAX 6150 .It Intel Ultimate N WiFi Link 5300 .It Intel Wireless WiFi Link 4965 From owner-dev-commits-src-branches@freebsd.org Wed Jun 2 06:27:07 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0C4DB63B9E3; Wed, 2 Jun 2021 06:27:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FvzZy6z9Rz3tR7; Wed, 2 Jun 2021 06:27:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D78E6122AF; Wed, 2 Jun 2021 06:27:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1526R68u039657; Wed, 2 Jun 2021 06:27:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1526R6AS039656; Wed, 2 Jun 2021 06:27:06 GMT (envelope-from git) Date: Wed, 2 Jun 2021 06:27:06 GMT Message-Id: <202106020627.1526R6AS039656@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: 999b023cc786 - stable/12 - iwn(4): Remove duplicate device entry MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 999b023cc786f3b62e2f1d3b3eec7b993890e521 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jun 2021 06:27:07 -0000 The branch stable/12 has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=999b023cc786f3b62e2f1d3b3eec7b993890e521 commit 999b023cc786f3b62e2f1d3b3eec7b993890e521 Author: Gordon Bergling AuthorDate: 2021-05-30 13:40:33 +0000 Commit: Gordon Bergling CommitDate: 2021-06-02 06:26:50 +0000 iwn(4): Remove duplicate device entry 'Intel Centrino Wireless-N 6250' is listed twice in the description section of the manual page. PR: 256257 Reported by: Daniel Cervus (cherry picked from commit 66e2a5803b0f80fff3bb8e3659ae7411ef94cc35) --- share/man/man4/iwn.4 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/share/man/man4/iwn.4 b/share/man/man4/iwn.4 index b333aacae5fd..6e9b774bb13d 100644 --- a/share/man/man4/iwn.4 +++ b/share/man/man4/iwn.4 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 30, 2014 +.Dd May 30, 2021 .Dt IWN 4 .Os .Sh NAME @@ -111,7 +111,6 @@ driver provides support for: .It Intel Centrino Wireless-N 6150 .It Intel Centrino Wireless-N 6200 .It Intel Centrino Wireless-N 6250 -.It Intel Centrino Wireless-N 6250 .It Intel Centrino Wireless-N + WiMAX 6150 .It Intel Ultimate N WiFi Link 5300 .It Intel Wireless WiFi Link 4965 From owner-dev-commits-src-branches@freebsd.org Wed Jun 2 09:35:45 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 69DC763F382; Wed, 2 Jun 2021 09:35:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fw3md2CLSz4jxc; Wed, 2 Jun 2021 09:35:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 32ED4145FC; Wed, 2 Jun 2021 09:35:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1529Zj55093426; Wed, 2 Jun 2021 09:35:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1529ZjQT093425; Wed, 2 Jun 2021 09:35:45 GMT (envelope-from git) Date: Wed, 2 Jun 2021 09:35:45 GMT Message-Id: <202106020935.1529ZjQT093425@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Lutz Donnerhacke Subject: git: 488f39f355ab - stable/13 - tests/libalias: Test LibAliasIn and redirection MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: donner X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 488f39f355abcdbfc1a5c694f521397fe737cd2c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jun 2021 09:35:45 -0000 The branch stable/13 has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=488f39f355abcdbfc1a5c694f521397fe737cd2c commit 488f39f355abcdbfc1a5c694f521397fe737cd2c Author: Lutz Donnerhacke AuthorDate: 2021-05-23 12:43:00 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-06-02 09:35:09 +0000 tests/libalias: Test LibAliasIn and redirection Rework the tests to check the correct layer in a single test. Factor out tests for reuse in other modules. Extend the test suite for libalias(3) to incoming connections. Test the various types of redirections. gettimeofday(3) is almost as expensive as the calls to libalias. So the call frequency for this call is reduced by a factor of 1000 in order to neglect it's influence. Using NAT entries became more realistic: A communication of a random length of up to 150 packets (10% outgoing, 90% incoming) is applied for each entry. Add port forwardings to the performance tests. This will cause random incoming packets to match the random port forwardings opends beforehand. After a long test run, a lot of ressouces have been allocated. Measure the time tot free them. Reviewed by: kp (partially) Differential Revision: https://reviews.freebsd.org/D30412 Differential Revision: https://reviews.freebsd.org/D30408 Differential Revision: https://reviews.freebsd.org/D30405 Differential Revision: https://reviews.freebsd.org/D30443 (cherry picked from commit f1462ab0512c1a0e59f03a7a145df2889bed2997) (cherry picked from commit 755bab6d55e6e2df168f352f3e2fbdea87002ed8) (cherry picked from commit 6e87898a2c7e99937656a0c12d03333a43a10c5e) (cherry picked from commit d62e1ecba07b2acee37e019778087f0f55d977d1) (cherry picked from commit 5434ebd256a08e452dec376c1488abdf7ff02af8) Fix various bugs: (cherry picked from commit ccac04cae538a625cbce224e4005360fa85e1b9d) (cherry picked from commit 7b8696bf128754712a24ba98ce2d88eed2ee68dc) (cherry picked from commit fef99da69f983566de3cb8ad4a1b8decc31348ce) (cherry picked from commit f4c460dacdda5c6e1896a0c51d6096c4f3417b32) --- tests/sys/netinet/libalias/2_natout.c | 200 +++++------------- tests/sys/netinet/libalias/3_natin.c | 381 ++++++++++++++++++++++++++++++++++ tests/sys/netinet/libalias/Makefile | 2 + tests/sys/netinet/libalias/perf.c | 213 +++++++++++++------ tests/sys/netinet/libalias/util.c | 14 +- tests/sys/netinet/libalias/util.h | 77 ++++++- 6 files changed, 669 insertions(+), 218 deletions(-) diff --git a/tests/sys/netinet/libalias/2_natout.c b/tests/sys/netinet/libalias/2_natout.c index 5b3e9a906bf5..2b6da8f597ed 100644 --- a/tests/sys/netinet/libalias/2_natout.c +++ b/tests/sys/netinet/libalias/2_natout.c @@ -38,63 +38,6 @@ #include "util.h" -/* common ip ranges */ -static struct in_addr masq = { htonl(0x01020304) }; -static struct in_addr pub = { htonl(0x0102dead) }; -static struct in_addr prv1 = { htonl(0x0a00dead) }; -static struct in_addr prv2 = { htonl(0xac10dead) }; -static struct in_addr prv3 = { htonl(0xc0a8dead) }; -static struct in_addr cgn = { htonl(0x6440dead) }; -static struct in_addr ext = { htonl(0x12345678) }; - -#define NAT_CHECK(pip, src, msq) do { \ - int res; \ - int len = ntohs(pip->ip_len); \ - struct in_addr dst = pip->ip_dst; \ - pip->ip_src = src; \ - res = LibAliasOut(la, pip, len); \ - ATF_CHECK_MSG(res == PKT_ALIAS_OK, \ - ">%d< not met PKT_ALIAS_OK", res); \ - ATF_CHECK(addr_eq(msq, pip->ip_src)); \ - ATF_CHECK(addr_eq(dst, pip->ip_dst)); \ -} while(0) - -#define NAT_FAIL(pip, src, dst) do { \ - int res; \ - int len = ntohs(pip->ip_len); \ - pip->ip_src = src; \ - pip->ip_dst = dst; \ - res = LibAliasOut(la, pip, len); \ - ATF_CHECK_MSG(res != PKT_ALIAS_OK), \ - ">%d< not met !PKT_ALIAS_OK", res); \ - ATF_CHECK(addr_eq(src, pip->ip_src)); \ - ATF_CHECK(addr_eq(dst, pip->ip_dst)); \ -} while(0) - -#define UNNAT_CHECK(pip, src, dst, rel) do { \ - int res; \ - int len = ntohs(pip->ip_len); \ - pip->ip_src = src; \ - pip->ip_dst = dst; \ - res = LibAliasIn(la, pip, len); \ - ATF_CHECK_MSG(res == PKT_ALIAS_OK, \ - ">%d< not met PKT_ALIAS_OK", res); \ - ATF_CHECK(addr_eq(src, pip->ip_src)); \ - ATF_CHECK(addr_eq(rel, pip->ip_dst)); \ -} while(0) - -#define UNNAT_FAIL(pip, src, dst) do { \ - int res; \ - int len = ntohs(pip->ip_len); \ - pip->ip_src = src; \ - pip->ip_dst = dst; \ - res = LibAliasIn(la, pip, len); \ - ATF_CHECK_MSG(res != PKT_ALIAS_OK, \ - ">%d< not met !PKT_ALIAS_OK", res); \ - ATF_CHECK(addr_eq(src, pip->ip_src)); \ - ATF_CHECK(addr_eq(dst, pip->ip_dst)); \ -} while(0) - ATF_TC_WITHOUT_HEAD(1_simplemasq); ATF_TC_BODY(1_simplemasq, dummy) { @@ -105,12 +48,12 @@ ATF_TC_BODY(1_simplemasq, dummy) LibAliasSetAddress(la, masq); LibAliasSetMode(la, 0, ~0); - pip = ip_packet(prv1, ext, 254, 64); - NAT_CHECK(pip, prv1, masq); - NAT_CHECK(pip, prv2, masq); - NAT_CHECK(pip, prv3, masq); - NAT_CHECK(pip, cgn, masq); - NAT_CHECK(pip, pub, masq); + pip = ip_packet(254, 64); + NAT_CHECK(pip, prv1, ext, masq); + NAT_CHECK(pip, prv2, ext, masq); + NAT_CHECK(pip, prv3, ext, masq); + NAT_CHECK(pip, cgn, ext, masq); + NAT_CHECK(pip, pub, ext, masq); free(pip); LibAliasUninit(la); @@ -126,12 +69,12 @@ ATF_TC_BODY(2_unregistered, dummy) LibAliasSetAddress(la, masq); LibAliasSetMode(la, PKT_ALIAS_UNREGISTERED_ONLY, ~0); - pip = ip_packet(prv1, ext, 254, 64); - NAT_CHECK(pip, prv1, masq); - NAT_CHECK(pip, prv2, masq); - NAT_CHECK(pip, prv3, masq); - NAT_CHECK(pip, cgn, cgn); - NAT_CHECK(pip, pub, pub); + pip = ip_packet(254, 64); + NAT_CHECK(pip, prv1, ext, masq); + NAT_CHECK(pip, prv2, ext, masq); + NAT_CHECK(pip, prv3, ext, masq); + NAT_CHECK(pip, cgn, ext, cgn); + NAT_CHECK(pip, pub, ext, pub); /* * State is only for new connections @@ -139,11 +82,11 @@ ATF_TC_BODY(2_unregistered, dummy) * the mode setting should be ignored */ LibAliasSetMode(la, 0, PKT_ALIAS_UNREGISTERED_ONLY); - NAT_CHECK(pip, prv1, masq); - NAT_CHECK(pip, prv2, masq); - NAT_CHECK(pip, prv3, masq); - NAT_CHECK(pip, cgn, cgn); - NAT_CHECK(pip, pub, pub); + NAT_CHECK(pip, prv1, ext, masq); + NAT_CHECK(pip, prv2, ext, masq); + NAT_CHECK(pip, prv3, ext, masq); + NAT_CHECK(pip, cgn, ext, cgn); + NAT_CHECK(pip, pub, ext, pub); free(pip); LibAliasUninit(la); @@ -159,12 +102,12 @@ ATF_TC_BODY(3_cgn, dummy) LibAliasSetAddress(la, masq); LibAliasSetMode(la, PKT_ALIAS_UNREGISTERED_CGN, ~0); - pip = ip_packet(prv1, ext, 254, 64); - NAT_CHECK(pip, prv1, masq); - NAT_CHECK(pip, prv2, masq); - NAT_CHECK(pip, prv3, masq); - NAT_CHECK(pip, cgn, masq); - NAT_CHECK(pip, pub, pub); + pip = ip_packet(254, 64); + NAT_CHECK(pip, prv1, ext, masq); + NAT_CHECK(pip, prv2, ext, masq); + NAT_CHECK(pip, prv3, ext, masq); + NAT_CHECK(pip, cgn, ext, masq); + NAT_CHECK(pip, pub, ext, pub); /* * State is only for new connections @@ -172,11 +115,11 @@ ATF_TC_BODY(3_cgn, dummy) * the mode setting should be ignored */ LibAliasSetMode(la, 0, PKT_ALIAS_UNREGISTERED_CGN); - NAT_CHECK(pip, prv1, masq); - NAT_CHECK(pip, prv2, masq); - NAT_CHECK(pip, prv3, masq); - NAT_CHECK(pip, cgn, masq); - NAT_CHECK(pip, pub, pub); + NAT_CHECK(pip, prv1, ext, masq); + NAT_CHECK(pip, prv2, ext, masq); + NAT_CHECK(pip, prv3, ext, masq); + NAT_CHECK(pip, cgn, ext, masq); + NAT_CHECK(pip, pub, ext, pub); free(pip); LibAliasUninit(la); @@ -197,41 +140,27 @@ ATF_TC_BODY(4_udp, dummy) LibAliasSetMode(la, 0, ~0); /* Query from prv1 */ - po = ip_packet(prv1, ext, 0, 64); - uo = set_udp(po, sport, dport); - NAT_CHECK(po, prv1, masq); - ATF_CHECK(uo->uh_dport == htons(dport)); - ATF_CHECK(addr_eq(po->ip_dst, ext)); + po = ip_packet(0, 64); + UDP_NAT_CHECK(po, uo, prv1, sport, ext, dport, masq); aport = ntohs(uo->uh_sport); /* should use a different external port */ ATF_CHECK(aport != sport); /* Response */ - pi = ip_packet(po->ip_dst, po->ip_src, 0, 64); - ui = set_udp(pi, ntohs(uo->uh_dport), ntohs(uo->uh_sport)); - UNNAT_CHECK(pi, ext, masq, prv1); - ATF_CHECK(ui->uh_sport == htons(dport)); - ATF_CHECK(ui->uh_dport == htons(sport)); + pi = ip_packet(0, 64); + UDP_UNNAT_CHECK(pi, ui, ext, dport, masq, aport, prv1, sport); /* Query from different source with same ports */ - uo = set_udp(po, sport, dport); - NAT_CHECK(po, prv2, masq); - ATF_CHECK(uo->uh_dport == htons(dport)); - ATF_CHECK(addr_eq(po->ip_dst, ext)); + UDP_NAT_CHECK(po, uo, prv2, sport, ext, dport, masq); /* should use a different external port */ ATF_CHECK(uo->uh_sport != htons(aport)); /* Response to prv2 */ ui->uh_dport = uo->uh_sport; - UNNAT_CHECK(pi, ext, masq, prv2); - ATF_CHECK(ui->uh_sport == htons(dport)); - ATF_CHECK(ui->uh_dport == htons(sport)); + UDP_UNNAT_CHECK(pi, ui, ext, dport, masq, htons(uo->uh_sport), prv2, sport); /* Response to prv1 again */ - ui->uh_dport = htons(aport); - UNNAT_CHECK(pi, ext, masq, prv1); - ATF_CHECK(ui->uh_sport == htons(dport)); - ATF_CHECK(ui->uh_dport == htons(sport)); + UDP_UNNAT_CHECK(pi, ui, ext, dport, masq, aport, prv1, sport); free(pi); free(po); @@ -253,20 +182,14 @@ ATF_TC_BODY(5_sameport, dummy) LibAliasSetMode(la, PKT_ALIAS_SAME_PORTS, ~0); /* Query from prv1 */ - p = ip_packet(prv1, ext, 0, 64); - u = set_udp(p, sport, dport); - NAT_CHECK(p, prv1, masq); - ATF_CHECK(u->uh_dport == htons(dport)); - ATF_CHECK(addr_eq(p->ip_dst, ext)); + p = ip_packet(0, 64); + UDP_NAT_CHECK(p, u, prv1, sport, ext, dport, masq); aport = ntohs(u->uh_sport); /* should use the same external port */ ATF_CHECK(aport == sport); /* Query from different source with same ports */ - u = set_udp(p, sport, dport); - NAT_CHECK(p, prv2, masq); - ATF_CHECK(u->uh_dport == htons(dport)); - ATF_CHECK(addr_eq(p->ip_dst, ext)); + UDP_NAT_CHECK(p, u, prv2, sport, ext, dport, masq); /* should use a different external port */ ATF_CHECK(u->uh_sport != htons(aport)); @@ -291,43 +214,30 @@ ATF_TC_BODY(6_cleartable, dummy) LibAliasSetMode(la, PKT_ALIAS_DENY_INCOMING, PKT_ALIAS_DENY_INCOMING); /* Query from prv1 */ - po = ip_packet(prv1, ext, 0, 64); - uo = set_udp(po, sport, dport); - NAT_CHECK(po, prv1, masq); - ATF_CHECK(uo->uh_dport == htons(dport)); - ATF_CHECK(addr_eq(po->ip_dst, ext)); + po = ip_packet(0, 64); + UDP_NAT_CHECK(po, uo, prv1, sport, ext, dport, masq); aport = ntohs(uo->uh_sport); /* should use the same external port */ ATF_CHECK(aport == sport); /* Response */ - pi = ip_packet(po->ip_dst, po->ip_src, 0, 64); - ui = set_udp(pi, ntohs(uo->uh_dport), ntohs(uo->uh_sport)); - UNNAT_CHECK(pi, ext, masq, prv1); - ATF_CHECK(ui->uh_sport == htons(dport)); - ATF_CHECK(ui->uh_dport == htons(sport)); + pi = ip_packet(0, 64); + UDP_UNNAT_CHECK(po, uo, ext, dport, masq, aport, prv1, sport); /* clear table by keeping the address */ LibAliasSetAddress(la, ext); LibAliasSetAddress(la, masq); /* Response to prv1 again -> DENY_INCOMING */ - ui->uh_dport = htons(aport); - UNNAT_FAIL(pi, ext, masq); + UDP_UNNAT_FAIL(pi, ui, ext, dport, masq, aport); /* Query from different source with same ports */ - uo = set_udp(po, sport, dport); - NAT_CHECK(po, prv2, masq); - ATF_CHECK(uo->uh_dport == htons(dport)); - ATF_CHECK(addr_eq(po->ip_dst, ext)); + UDP_NAT_CHECK(po, uo, prv2, sport, ext, dport, masq); /* should use the same external port, because it's free */ ATF_CHECK(uo->uh_sport == htons(aport)); /* Response to prv2 */ - ui->uh_dport = uo->uh_sport; - UNNAT_CHECK(pi, ext, masq, prv2); - ATF_CHECK(ui->uh_sport == htons(dport)); - ATF_CHECK(ui->uh_dport == htons(sport)); + UDP_UNNAT_CHECK(po, uo, ext, dport, masq, htons(uo->uh_sport), prv2, sport); free(pi); free(po); @@ -351,8 +261,7 @@ ATF_TC_BODY(7_stress, dummy) ATF_REQUIRE(la != NULL); LibAliasSetAddress(la, masq); - p = ip_packet(prv1, ext, 0, 64); - u = set_udp(p, 0, 0); + p = ip_packet(0, 64); batch = calloc(batch_size, sizeof(*batch)); ATF_REQUIRE(batch != NULL); @@ -374,21 +283,20 @@ ATF_TC_BODY(7_stress, dummy) } for (i = 0; i < batch_size; i++) { - p->ip_dst = batch[i].dst; - u = set_udp(p, batch[i].sport, batch[i].dport); - NAT_CHECK(p, batch[i].src, masq); - ATF_CHECK(u->uh_dport == htons(batch[i].dport)); - ATF_CHECK(addr_eq(p->ip_dst, batch[i].dst)); + UDP_NAT_CHECK(p, u, + batch[i].src, batch[i].sport, + batch[i].dst, batch[i].dport, + masq); batch[i].aport = htons(u->uh_sport); } qsort(batch, batch_size, sizeof(*batch), randcmp); for (i = 0; i < batch_size; i++) { - u = set_udp(p, batch[i].dport, batch[i].aport); - UNNAT_CHECK(p, batch[i].dst, masq, batch[i].src); - ATF_CHECK(u->uh_dport == htons(batch[i].sport)); - ATF_CHECK(u->uh_sport == htons(batch[i].dport)); + UDP_UNNAT_CHECK(p, u, + batch[i].dst, batch[i].dport, + masq, batch[i].aport, + batch[i].src, batch[i].sport); } } diff --git a/tests/sys/netinet/libalias/3_natin.c b/tests/sys/netinet/libalias/3_natin.c new file mode 100644 index 000000000000..e8e5257e4baa --- /dev/null +++ b/tests/sys/netinet/libalias/3_natin.c @@ -0,0 +1,381 @@ +/* + * SPDX-License-Identifier: BSD-3-Clause + * + * Copyright 2021 Lutz Donnerhacke + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND + * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED + * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR + * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF + * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#include +#include +#include +#include + +#include "util.h" + +ATF_TC_WITHOUT_HEAD(1_portforward); +ATF_TC_BODY(1_portforward, dummy) +{ + struct libalias *la = LibAliasInit(NULL); + struct alias_link *pf1, *pf2, *pf3, *pf4; + struct ip *p; + struct udphdr *u; + + ATF_REQUIRE(la != NULL); + LibAliasSetAddress(la, masq); + LibAliasSetMode(la, PKT_ALIAS_RESET_ON_ADDR_CHANGE, ~0); + LibAliasSetMode(la, PKT_ALIAS_DENY_INCOMING, PKT_ALIAS_DENY_INCOMING); + + /* + * Fully specified + */ + pf1 = LibAliasRedirectPort(la, prv1, ntohs(0x1234), ext, ntohs(0x5678), masq, ntohs(0xabcd), IPPROTO_UDP); + ATF_REQUIRE(pf1 != NULL); + + p = ip_packet(0, 64); + UDP_UNNAT_CHECK(p, u, ext, 0x5678, masq, 0xabcd, prv1, 0x1234); + /* try again */ + UDP_UNNAT_CHECK(p, u, ext, 0x5678, masq, 0xabcd, prv1, 0x1234); + /* different source */ + UDP_UNNAT_FAIL(p, u, pub, 0x5678, masq, 0xabcd); + UDP_UNNAT_FAIL(p, u, ext, 0xdead, masq, 0xabcd); + + /* clear table by keeping the address */ + LibAliasSetAddress(la, ext); + LibAliasSetAddress(la, masq); + + /* delete and try again */ + LibAliasRedirectDelete(la, pf1); + UDP_UNNAT_FAIL(p, u, ext, 0x5678, masq, 0xabcd); + + /* + * Any external port + */ + pf2 = LibAliasRedirectPort(la, prv2, ntohs(0x1234), ext, ntohs(0), masq, ntohs(0xabcd), IPPROTO_UDP); + ATF_REQUIRE(pf2 != NULL); + + UDP_UNNAT_CHECK(p, u, ext, 0x5678, masq, 0xabcd, prv2, 0x1234); + /* try again */ + UDP_UNNAT_CHECK(p, u, ext, 0x5678, masq, 0xabcd, prv2, 0x1234); + /* different source */ + UDP_UNNAT_FAIL(p, u, pub, 0x5678, masq, 0xabcd); + UDP_UNNAT_CHECK(p, u, ext, 0xdead, masq, 0xabcd, prv2, 0x1234); + + /* clear table by keeping the address */ + LibAliasSetAddress(la, ext); + LibAliasSetAddress(la, masq); + + /* delete and try again */ + LibAliasRedirectDelete(la, pf2); + UDP_UNNAT_FAIL(p, u, ext, 0x5678, masq, 0xabcd); + + /* + * Any external host + */ + pf3 = LibAliasRedirectPort(la, prv3, ntohs(0x1234), ANY_ADDR, ntohs(0x5678), masq, ntohs(0xabcd), IPPROTO_UDP); + ATF_REQUIRE(pf3 != NULL); + + UDP_UNNAT_CHECK(p, u, ext, 0x5678, masq, 0xabcd, prv3, 0x1234); + /* try again */ + UDP_UNNAT_CHECK(p, u, ext, 0x5678, masq, 0xabcd, prv3, 0x1234); + /* different source */ + UDP_UNNAT_CHECK(p, u, pub, 0x5678, masq, 0xabcd, prv3, 0x1234); + UDP_UNNAT_FAIL(p, u, ext, 0xdead, masq, 0xabcd); + + /* clear table by keeping the address */ + LibAliasSetAddress(la, ext); + LibAliasSetAddress(la, masq); + + /* delete and try again */ + LibAliasRedirectDelete(la, pf2); + UDP_UNNAT_FAIL(p, u, ext, 0x5678, masq, 0xabcd); + + /* + * Any external host, any port + */ + pf4 = LibAliasRedirectPort(la, cgn, ntohs(0x1234), ANY_ADDR, ntohs(0), masq, ntohs(0xabcd), IPPROTO_UDP); + ATF_REQUIRE(pf4 != NULL); + + UDP_UNNAT_CHECK(p, u, ext, 0x5678, masq, 0xabcd, cgn, 0x1234); + /* try again */ + UDP_UNNAT_CHECK(p, u, ext, 0x5678, masq, 0xabcd, cgn, 0x1234); + /* different source */ + UDP_UNNAT_CHECK(p, u, pub, 0x5678, masq, 0xabcd, cgn, 0x1234); + UDP_UNNAT_CHECK(p, u, ext, 0xdead, masq, 0xabcd, cgn, 0x1234); + + /* clear table by keeping the address */ + LibAliasSetAddress(la, ext); + LibAliasSetAddress(la, masq); + + /* delete and try again */ + LibAliasRedirectDelete(la, pf2); + UDP_UNNAT_FAIL(p, u, ext, 0x5678, masq, 0xabcd); + + free(p); + LibAliasUninit(la); +} + +ATF_TC_WITHOUT_HEAD(2_portoverlap); +ATF_TC_BODY(2_portoverlap, dummy) +{ + struct libalias *la = LibAliasInit(NULL); + struct alias_link *pf1, *pf2, *pf3, *pf4; + struct ip *p; + struct udphdr *u; + + ATF_REQUIRE(la != NULL); + LibAliasSetAddress(la, masq); + LibAliasSetMode(la, PKT_ALIAS_RESET_ON_ADDR_CHANGE, ~0); + LibAliasSetMode(la, PKT_ALIAS_DENY_INCOMING, PKT_ALIAS_DENY_INCOMING); + + /* + * Fully specified + */ + pf1 = LibAliasRedirectPort(la, prv2, ntohs(0x1234), ext, ntohs(0x5678), masq, ntohs(0xabcd), IPPROTO_UDP); + ATF_REQUIRE(pf1 != NULL); + + p = ip_packet(0, 64); + UDP_UNNAT_CHECK(p, u, ext, 0x5678, masq, 0xabcd, prv2, 0x1234); + + /* clear table by keeping the address */ + LibAliasSetAddress(la, ext); + LibAliasSetAddress(la, masq); + + /* + * Fully specified (override) + */ + pf1 = LibAliasRedirectPort(la, prv1, ntohs(0x1234), ext, ntohs(0x5678), masq, ntohs(0xabcd), IPPROTO_UDP); + ATF_REQUIRE(pf1 != NULL); + + UDP_UNNAT_CHECK(p, u, ext, 0x5678, masq, 0xabcd, prv1, 0x1234); + + /* clear table by keeping the address */ + LibAliasSetAddress(la, ext); + LibAliasSetAddress(la, masq); + + /* + * Any external port + */ + pf2 = LibAliasRedirectPort(la, prv2, ntohs(0x1234), ext, ntohs(0), masq, ntohs(0xabcd), IPPROTO_UDP); + ATF_REQUIRE(pf2 != NULL); + + UDP_UNNAT_CHECK(p, u, ext, 0x5679, masq, 0xabcd, prv2, 0x1234); + /* more specific rule wins */ + UDP_UNNAT_CHECK(p, u, ext, 0x5678, masq, 0xabcd, prv1, 0x1234); + + /* clear table by keeping the address */ + LibAliasSetAddress(la, ext); + LibAliasSetAddress(la, masq); + + /* + * Any external host + */ + pf3 = LibAliasRedirectPort(la, prv3, ntohs(0x1234), ANY_ADDR, ntohs(0x5678), masq, ntohs(0xabcd), IPPROTO_UDP); + ATF_REQUIRE(pf3 != NULL); + + UDP_UNNAT_CHECK(p, u, pub, 0x5678, masq, 0xabcd, prv3, 0x1234); + /* more specific rule wins */ + UDP_UNNAT_CHECK(p, u, ext, 0x5679, masq, 0xabcd, prv2, 0x1234); + UDP_UNNAT_CHECK(p, u, ext, 0x5678, masq, 0xabcd, prv1, 0x1234); + + /* clear table by keeping the address */ + LibAliasSetAddress(la, ext); + LibAliasSetAddress(la, masq); + + /* + * Any external host, any port + */ + pf4 = LibAliasRedirectPort(la, cgn, ntohs(0x1234), ANY_ADDR, ntohs(0), masq, ntohs(0xabcd), IPPROTO_UDP); + ATF_REQUIRE(pf4 != NULL); + + UDP_UNNAT_CHECK(p, u, prv1, 0x5679, masq, 0xabcd, cgn, 0x1234); + /* more specific rule wins */ + UDP_UNNAT_CHECK(p, u, pub, 0x5678, masq, 0xabcd, prv3, 0x1234); + UDP_UNNAT_CHECK(p, u, ext, 0x5679, masq, 0xabcd, prv2, 0x1234); + UDP_UNNAT_CHECK(p, u, ext, 0x5678, masq, 0xabcd, prv1, 0x1234); + + free(p); + LibAliasUninit(la); +} + +ATF_TC_WITHOUT_HEAD(3_redirectany); +ATF_TC_BODY(3_redirectany, dummy) +{ + struct libalias *la = LibAliasInit(NULL); + struct alias_link *pf; + struct ip *p; + struct udphdr *u; + + ATF_REQUIRE(la != NULL); + LibAliasSetMode(la, PKT_ALIAS_DENY_INCOMING, ~0); + p = ip_packet(0, 64); + + pf = LibAliasRedirectPort(la, prv1, ntohs(0x1234), ANY_ADDR, 0, ANY_ADDR, ntohs(0xabcd), IPPROTO_UDP); + ATF_REQUIRE(pf != NULL); + + LibAliasSetAddress(la, masq); + UDP_UNNAT_CHECK(p, u, ext, 0x5678, masq, 0xabcd, prv1, 0x1234); + UDP_UNNAT_FAIL(p, u, pub, 0x5678, pub, 0xabcd); + + LibAliasSetAddress(la, pub); + UDP_UNNAT_CHECK(p, u, pub, 0x5679, pub, 0xabcd, prv1, 0x1234); + UDP_UNNAT_FAIL(p, u, ext, 0x5679, masq, 0xabcd); + + free(p); + LibAliasUninit(la); +} + +ATF_TC_WITHOUT_HEAD(4_redirectaddr); +ATF_TC_BODY(4_redirectaddr, dummy) +{ + struct libalias *la = LibAliasInit(NULL); + struct alias_link *pf1, *pf2; + struct ip *p; + + ATF_REQUIRE(la != NULL); + LibAliasSetAddress(la, masq); + pf1 = LibAliasRedirectAddr(la, prv1, pub); + ATF_REQUIRE(pf1 != NULL); + + p = ip_packet(254, 64); + UNNAT_CHECK(p, ext, pub, prv1); + UNNAT_CHECK(p, ext, masq, masq); + + pf2 = LibAliasRedirectAddr(la, prv2, pub); + ATF_REQUIRE(pf2 != NULL); + UNNAT_CHECK(p, ext, pub, prv1); + p->ip_p = 253; /* new flows */ + UNNAT_CHECK(p, ext, pub, prv2); + UNNAT_CHECK(p, ext, masq, masq); + + p->ip_p = 252; /* new flows */ + NAT_CHECK(p, prv1, ext, pub); + NAT_CHECK(p, prv2, ext, pub); + NAT_CHECK(p, prv3, ext, masq); + + LibAliasSetMode(la, PKT_ALIAS_DENY_INCOMING, ~0); + p->ip_p = 251; /* new flows */ + UNNAT_FAIL(p, ext, pub); + UNNAT_FAIL(p, ext, masq); + + /* unhide older version */ + LibAliasRedirectDelete(la, pf2); + LibAliasSetMode(la, 0, ~0); + p->ip_p = 250; /* new flows */ + UNNAT_CHECK(p, ext, pub, prv1); + + p->ip_p = 249; /* new flows */ + NAT_CHECK(p, prv1, ext, pub); + NAT_CHECK(p, prv2, ext, masq); + NAT_CHECK(p, prv3, ext, masq); + + free(p); + LibAliasUninit(la); +} + +ATF_TC_WITHOUT_HEAD(5_lsnat); +ATF_TC_BODY(5_lsnat, dummy) +{ + struct libalias *la = LibAliasInit(NULL); + struct alias_link *pf; + struct ip *p; + struct udphdr *u; + + ATF_REQUIRE(la != NULL); + LibAliasSetMode(la, 0, ~0); + p = ip_packet(0, 64); + + pf = LibAliasRedirectPort(la, cgn, ntohs(0xdead), ANY_ADDR, 0, masq, ntohs(0xabcd), IPPROTO_UDP); + ATF_REQUIRE(pf != NULL); + + ATF_REQUIRE(0 == LibAliasAddServer(la, pf, prv1, ntohs(0x1234))); + ATF_REQUIRE(0 == LibAliasAddServer(la, pf, prv2, ntohs(0x2345))); + ATF_REQUIRE(0 == LibAliasAddServer(la, pf, prv3, ntohs(0x3456))); + + UDP_UNNAT_CHECK(p, u, ext, 0x5678, masq, 0xabcd, prv3, 0x3456); + UDP_UNNAT_CHECK(p, u, ext, 0x5679, masq, 0xabcd, prv2, 0x2345); + UDP_UNNAT_CHECK(p, u, ext, 0x567a, masq, 0xabcd, prv1, 0x1234); + UDP_UNNAT_CHECK(p, u, ext, 0x567b, masq, 0xabcd, prv3, 0x3456); + UDP_UNNAT_CHECK(p, u, ext, 0x567c, masq, 0xabcd, prv2, 0x2345); + UDP_UNNAT_CHECK(p, u, ext, 0x567d, masq, 0xabcd, prv1, 0x1234); + + free(p); + LibAliasUninit(la); +} + +ATF_TC_WITHOUT_HEAD(6_oneshot); +ATF_TC_BODY(6_oneshot, dummy) +{ + struct libalias *la = LibAliasInit(NULL); + struct alias_link *pf; + struct ip *p; + struct udphdr *u; + + ATF_REQUIRE(la != NULL); + LibAliasSetMode(la, 0, ~0); + LibAliasSetMode(la, PKT_ALIAS_RESET_ON_ADDR_CHANGE, ~0); + LibAliasSetMode(la, PKT_ALIAS_DENY_INCOMING, PKT_ALIAS_DENY_INCOMING); + + pf = LibAliasRedirectPort(la, prv1, ntohs(0x1234), ANY_ADDR, 0, masq, ntohs(0xabcd), IPPROTO_UDP); + ATF_REQUIRE(pf != NULL); + /* only for fully specified links */ + ATF_CHECK(-1 == LibAliasRedirectDynamic(la, pf)); + LibAliasRedirectDelete(la, pf); + + pf = LibAliasRedirectPort(la, prv1, ntohs(0x1234), ext, ntohs(0x5678), masq, ntohs(0xabcd), IPPROTO_UDP); + ATF_REQUIRE(pf != NULL); + ATF_CHECK(0 == LibAliasRedirectDynamic(la, pf)); + + p = ip_packet(0, 64); + UDP_UNNAT_CHECK(p, u, ext, 0x5678, masq, 0xabcd, prv1, 0x1234); + + /* clear table by keeping the address */ + LibAliasSetAddress(la, ext); + LibAliasSetAddress(la, masq); + + /* does not work anymore */ + UDP_UNNAT_FAIL(p, u, ext, 0x5678, masq, 0xabcd); + + free(p); + LibAliasUninit(la); +} + +ATF_TP_ADD_TCS(natin) +{ + /* Use "dd if=/dev/random bs=2 count=1 | od -x" to reproduce */ + srand(0xe859); + + ATF_TP_ADD_TC(natin, 1_portforward); + ATF_TP_ADD_TC(natin, 2_portoverlap); + ATF_TP_ADD_TC(natin, 3_redirectany); + ATF_TP_ADD_TC(natin, 4_redirectaddr); + ATF_TP_ADD_TC(natin, 5_lsnat); + ATF_TP_ADD_TC(natin, 6_oneshot); + + return atf_no_error(); +} diff --git a/tests/sys/netinet/libalias/Makefile b/tests/sys/netinet/libalias/Makefile index 6ee2fc0e0e1f..e5ed88f52fcd 100644 --- a/tests/sys/netinet/libalias/Makefile +++ b/tests/sys/netinet/libalias/Makefile @@ -7,6 +7,7 @@ BINDIR= ${TESTSDIR} ATF_TESTS_C+= 1_instance \ 2_natout \ + 3_natin \ PROGS+= perf @@ -14,6 +15,7 @@ LIBADD+= alias SRCS.1_instance=1_instance.c util.c SRCS.2_natout= 2_natout.c util.c +SRCS.3_natin= 3_natin.c util.c SRCS.perf= perf.c util.c .include diff --git a/tests/sys/netinet/libalias/perf.c b/tests/sys/netinet/libalias/perf.c index 365b8f2e9fcc..f238846bdb16 100644 --- a/tests/sys/netinet/libalias/perf.c +++ b/tests/sys/netinet/libalias/perf.c @@ -38,10 +38,7 @@ #include "util.h" #include -/* common ip ranges */ -static struct in_addr masq = { htonl(0x01020304) }; -static struct in_addr prv = { htonl(0x0a000000) }; -static struct in_addr ext = { htonl(0x12000000) }; +static void usage(void); #define timevalcmp(tv, uv, cmp) \ (((tv).tv_sec == (uv).tv_sec) \ @@ -52,10 +49,24 @@ static struct in_addr ext = { htonl(0x12000000) }; (((n).tv_sec - (o).tv_sec)*1000000l + \ ((n).tv_usec - (o).tv_usec)) +#define check_timeout() do { \ + if (check_timeout_cnt++ > 1000) { \ + check_timeout_cnt = 0; \ + gettimeofday(&now, NULL); \ + if (timevalcmp(now, timeout, >=)) \ + goto out; \ + } } while(0) + +static void +usage(void) { + printf("Usage: perf [max_seconds [batch_size [random_size [attack_size [redir_size]]]]]\n"); + exit(1); +} + int main(int argc, char ** argv) { struct libalias *la; - struct timeval timeout; + struct timeval timeout, now, start; struct ip *p; struct udphdr *u; struct { @@ -64,34 +75,59 @@ int main(int argc, char ** argv) } *batch; struct { unsigned long ok, fail; - } nat, unnat, random, attack; - int max_seconds, batch_size, random_size, attack_length, round, cnt; - - if(argc != 5 || - 0 > (max_seconds = atoi(argv[1])) || - 0 >= (batch_size = atoi(argv[2])) || - 0 >= (random_size = atoi(argv[3])) || - 0 >= (attack_length = atoi(argv[4]))) { - printf("Usage: %s max_seconds batch_size random_size attack_length\n", argv[0]); - return 1; + } nat, usenat, unnat, random, attack; + int i, round, check_timeout_cnt = 0; + int max_seconds = 90, batch_size = 2000, + random_size = 1000, attack_size = 1000, + redir_size = 2000; + + if (argc >= 2) { + char * end; + + max_seconds = strtol(argv[1], &end, 10); + if (max_seconds < 2 || end[0] != '\0') + usage(); } + if (argc > 2 && (batch_size = atoi(argv[2])) < 0) usage(); + if (argc > 3 && (random_size = atoi(argv[3])) < 0) usage(); + if (argc > 4 && (attack_size = atoi(argv[4])) < 0) usage(); + if (argc > 5 && (redir_size = atoi(argv[5])) < 0) usage(); + + printf("Running perfomance test with parameters:\n"); + printf(" Maximum Runtime (max_seconds) = %d\n", max_seconds); + printf(" Amount of valid connections (batch_size) = %d\n", batch_size); + printf(" Amount of random, incoming packets (batch_size) = %d\n", random_size); + printf(" Repeat count of a random, incoming packet (attack_size) = %d\n", attack_size); + printf(" Amount of open port forwardings (redir_size) = %d\n", redir_size); + printf("\n"); + if (NULL == (la = LibAliasInit(NULL))) { perror("LibAliasInit"); return -1; } bzero(&nat, sizeof(nat)); + bzero(&usenat, sizeof(usenat)); bzero(&unnat, sizeof(unnat)); bzero(&random, sizeof(random)); bzero(&attack, sizeof(attack)); LibAliasSetAddress(la, masq); - LibAliasSetMode(la, PKT_ALIAS_DENY_INCOMING, PKT_ALIAS_DENY_INCOMING); + LibAliasSetMode(la, PKT_ALIAS_SAME_PORTS | PKT_ALIAS_DENY_INCOMING, ~0); - prv.s_addr &= htonl(0xffff0000); + prv1.s_addr &= htonl(0xffff0000); ext.s_addr &= htonl(0xffff0000); - p = ip_packet(prv, ext, 0, 64); + for (i = 0; i < redir_size; i++) { + int aport = htons(rand_range(1000, 2000)); + int sport = htons(rand_range(1000, 2000)); + + prv2.s_addr &= htonl(0xffff0000); + prv2.s_addr |= rand_range(0, 0xffff); + LibAliasRedirectPort(la, prv2, sport, ANY_ADDR, 0, masq, aport, IPPROTO_UDP); + } + + p = ip_packet(0, 64); u = set_udp(p, 0, 0); if (NULL == (batch = calloc(batch_size, sizeof(*batch)))) { @@ -102,17 +138,16 @@ int main(int argc, char ** argv) gettimeofday(&timeout, NULL); timeout.tv_sec += max_seconds; - printf("RND SECND NAT RND ATT UNA\n"); + printf("RND SECOND newNAT RANDOM ATTACK useNAT\n"); for (round = 0; ; round++) { - int i, res; - struct timeval now, start; + int res, cnt; printf("%3d ", round+1); gettimeofday(&start, NULL); - printf("%5.1f ", max_seconds - timevaldiff(timeout, start)/1000000.0f); + printf("%6.1f ", max_seconds - timevaldiff(timeout, start)/1000000.0f); for (cnt = i = 0; i < batch_size; i++, cnt++) { - batch[i].src.s_addr = prv.s_addr | htonl(rand_range(0, 0xffff)); + batch[i].src.s_addr = prv1.s_addr | htonl(rand_range(0, 0xffff)); batch[i].dst.s_addr = ext.s_addr | htonl(rand_range(0, 0xffff)); batch[i].sport = rand_range(1000, 60000); batch[i].dport = rand_range(1000, 60000); @@ -132,12 +167,13 @@ int main(int argc, char ** argv) else nat.fail++; - gettimeofday(&now, NULL); - if(timevalcmp(now, timeout, >=)) - goto out; + check_timeout(); } + gettimeofday(&now, NULL); if (cnt > 0) - printf("%3.0f ", timevaldiff(now, start) / cnt); + printf("%6.2f ", timevaldiff(now, start) / cnt); + else + printf("------ "); start = now; for (cnt = i = 0; i < random_size; i++, cnt++) { @@ -153,19 +189,20 @@ int main(int argc, char ** argv) else random.fail++; - gettimeofday(&now, NULL); - if(timevalcmp(now, timeout, >=)) - goto out; + check_timeout(); } + gettimeofday(&now, NULL); if (cnt > 0) - printf("%3.0f ", timevaldiff(now, start) / cnt); + printf("%6.2f ", timevaldiff(now, start) / cnt); + else + printf("------ "); start = now; p->ip_src.s_addr = ext.s_addr & htonl(0xfff00000); p->ip_src.s_addr |= htonl(rand_range(0, 0xffff)); p->ip_dst = masq; u = set_udp(p, rand_range(1, 0xffff), rand_range(1, 0xffff)); - for (cnt = i = 0; i < attack_length; i++, cnt++) { + for (cnt = i = 0; i < attack_size; i++, cnt++) { res = LibAliasIn(la, p, 64); if (res == PKT_ALIAS_OK) @@ -173,59 +210,99 @@ int main(int argc, char ** argv) else attack.fail++; - gettimeofday(&now, NULL); - if(timevalcmp(now, timeout, >=)) - goto out; + check_timeout(); } + gettimeofday(&now, NULL); if (cnt > 0) - printf("%3.0f ", timevaldiff(now, start) / cnt); + printf("%6.2f ", timevaldiff(now, start) / cnt); + else + printf("------ "); qsort(batch, batch_size, sizeof(*batch), randcmp); gettimeofday(&start, NULL); *** 251 LINES SKIPPED *** From owner-dev-commits-src-branches@freebsd.org Wed Jun 2 09:37:52 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2C71863F4CA; Wed, 2 Jun 2021 09:37: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 4Fw3q40dHVz4jdy; Wed, 2 Jun 2021 09:37:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F166514A23; Wed, 2 Jun 2021 09:37:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1529bp7X093674; Wed, 2 Jun 2021 09:37:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1529bpdS093673; Wed, 2 Jun 2021 09:37:51 GMT (envelope-from git) Date: Wed, 2 Jun 2021 09:37:51 GMT Message-Id: <202106020937.1529bpdS093673@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Lutz Donnerhacke Subject: git: 19888502bf39 - stable/12 - tests/libalias: Test LibAliasIn and redirection MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: donner X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 19888502bf39ca46450546954f1563e62f6c4159 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jun 2021 09:37:52 -0000 The branch stable/12 has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=19888502bf39ca46450546954f1563e62f6c4159 commit 19888502bf39ca46450546954f1563e62f6c4159 Author: Lutz Donnerhacke AuthorDate: 2021-05-23 12:43:00 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-06-02 09:37:13 +0000 tests/libalias: Test LibAliasIn and redirection Rework the tests to check the correct layer in a single test. Factor out tests for reuse in other modules. Extend the test suite for libalias(3) to incoming connections. Test the various types of redirections. gettimeofday(3) is almost as expensive as the calls to libalias. So the call frequency for this call is reduced by a factor of 1000 in order to neglect it's influence. Using NAT entries became more realistic: A communication of a random length of up to 150 packets (10% outgoing, 90% incoming) is applied for each entry. Add port forwardings to the performance tests. This will cause random incoming packets to match the random port forwardings opends beforehand. After a long test run, a lot of ressouces have been allocated. Measure the time tot free them. Reviewed by: kp (partially) Differential Revision: https://reviews.freebsd.org/D30412 Differential Revision: https://reviews.freebsd.org/D30408 Differential Revision: https://reviews.freebsd.org/D30405 Differential Revision: https://reviews.freebsd.org/D30443 (cherry picked from commit f1462ab0512c1a0e59f03a7a145df2889bed2997) (cherry picked from commit 755bab6d55e6e2df168f352f3e2fbdea87002ed8) (cherry picked from commit 6e87898a2c7e99937656a0c12d03333a43a10c5e) (cherry picked from commit d62e1ecba07b2acee37e019778087f0f55d977d1) (cherry picked from commit 5434ebd256a08e452dec376c1488abdf7ff02af8) Fix various bugs: (cherry picked from commit ccac04cae538a625cbce224e4005360fa85e1b9d) (cherry picked from commit 7b8696bf128754712a24ba98ce2d88eed2ee68dc) (cherry picked from commit fef99da69f983566de3cb8ad4a1b8decc31348ce) (cherry picked from commit f4c460dacdda5c6e1896a0c51d6096c4f3417b32) --- tests/sys/netinet/libalias/2_natout.c | 200 +++++------------- tests/sys/netinet/libalias/3_natin.c | 381 ++++++++++++++++++++++++++++++++++ tests/sys/netinet/libalias/Makefile | 2 + tests/sys/netinet/libalias/perf.c | 213 +++++++++++++------ tests/sys/netinet/libalias/util.c | 14 +- tests/sys/netinet/libalias/util.h | 77 ++++++- 6 files changed, 669 insertions(+), 218 deletions(-) diff --git a/tests/sys/netinet/libalias/2_natout.c b/tests/sys/netinet/libalias/2_natout.c index 5b3e9a906bf5..2b6da8f597ed 100644 --- a/tests/sys/netinet/libalias/2_natout.c +++ b/tests/sys/netinet/libalias/2_natout.c @@ -38,63 +38,6 @@ #include "util.h" -/* common ip ranges */ -static struct in_addr masq = { htonl(0x01020304) }; -static struct in_addr pub = { htonl(0x0102dead) }; -static struct in_addr prv1 = { htonl(0x0a00dead) }; -static struct in_addr prv2 = { htonl(0xac10dead) }; -static struct in_addr prv3 = { htonl(0xc0a8dead) }; -static struct in_addr cgn = { htonl(0x6440dead) }; -static struct in_addr ext = { htonl(0x12345678) }; - -#define NAT_CHECK(pip, src, msq) do { \ - int res; \ - int len = ntohs(pip->ip_len); \ - struct in_addr dst = pip->ip_dst; \ - pip->ip_src = src; \ - res = LibAliasOut(la, pip, len); \ - ATF_CHECK_MSG(res == PKT_ALIAS_OK, \ - ">%d< not met PKT_ALIAS_OK", res); \ - ATF_CHECK(addr_eq(msq, pip->ip_src)); \ - ATF_CHECK(addr_eq(dst, pip->ip_dst)); \ -} while(0) - -#define NAT_FAIL(pip, src, dst) do { \ - int res; \ - int len = ntohs(pip->ip_len); \ - pip->ip_src = src; \ - pip->ip_dst = dst; \ - res = LibAliasOut(la, pip, len); \ - ATF_CHECK_MSG(res != PKT_ALIAS_OK), \ - ">%d< not met !PKT_ALIAS_OK", res); \ - ATF_CHECK(addr_eq(src, pip->ip_src)); \ - ATF_CHECK(addr_eq(dst, pip->ip_dst)); \ -} while(0) - -#define UNNAT_CHECK(pip, src, dst, rel) do { \ - int res; \ - int len = ntohs(pip->ip_len); \ - pip->ip_src = src; \ - pip->ip_dst = dst; \ - res = LibAliasIn(la, pip, len); \ - ATF_CHECK_MSG(res == PKT_ALIAS_OK, \ - ">%d< not met PKT_ALIAS_OK", res); \ - ATF_CHECK(addr_eq(src, pip->ip_src)); \ - ATF_CHECK(addr_eq(rel, pip->ip_dst)); \ -} while(0) - -#define UNNAT_FAIL(pip, src, dst) do { \ - int res; \ - int len = ntohs(pip->ip_len); \ - pip->ip_src = src; \ - pip->ip_dst = dst; \ - res = LibAliasIn(la, pip, len); \ - ATF_CHECK_MSG(res != PKT_ALIAS_OK, \ - ">%d< not met !PKT_ALIAS_OK", res); \ - ATF_CHECK(addr_eq(src, pip->ip_src)); \ - ATF_CHECK(addr_eq(dst, pip->ip_dst)); \ -} while(0) - ATF_TC_WITHOUT_HEAD(1_simplemasq); ATF_TC_BODY(1_simplemasq, dummy) { @@ -105,12 +48,12 @@ ATF_TC_BODY(1_simplemasq, dummy) LibAliasSetAddress(la, masq); LibAliasSetMode(la, 0, ~0); - pip = ip_packet(prv1, ext, 254, 64); - NAT_CHECK(pip, prv1, masq); - NAT_CHECK(pip, prv2, masq); - NAT_CHECK(pip, prv3, masq); - NAT_CHECK(pip, cgn, masq); - NAT_CHECK(pip, pub, masq); + pip = ip_packet(254, 64); + NAT_CHECK(pip, prv1, ext, masq); + NAT_CHECK(pip, prv2, ext, masq); + NAT_CHECK(pip, prv3, ext, masq); + NAT_CHECK(pip, cgn, ext, masq); + NAT_CHECK(pip, pub, ext, masq); free(pip); LibAliasUninit(la); @@ -126,12 +69,12 @@ ATF_TC_BODY(2_unregistered, dummy) LibAliasSetAddress(la, masq); LibAliasSetMode(la, PKT_ALIAS_UNREGISTERED_ONLY, ~0); - pip = ip_packet(prv1, ext, 254, 64); - NAT_CHECK(pip, prv1, masq); - NAT_CHECK(pip, prv2, masq); - NAT_CHECK(pip, prv3, masq); - NAT_CHECK(pip, cgn, cgn); - NAT_CHECK(pip, pub, pub); + pip = ip_packet(254, 64); + NAT_CHECK(pip, prv1, ext, masq); + NAT_CHECK(pip, prv2, ext, masq); + NAT_CHECK(pip, prv3, ext, masq); + NAT_CHECK(pip, cgn, ext, cgn); + NAT_CHECK(pip, pub, ext, pub); /* * State is only for new connections @@ -139,11 +82,11 @@ ATF_TC_BODY(2_unregistered, dummy) * the mode setting should be ignored */ LibAliasSetMode(la, 0, PKT_ALIAS_UNREGISTERED_ONLY); - NAT_CHECK(pip, prv1, masq); - NAT_CHECK(pip, prv2, masq); - NAT_CHECK(pip, prv3, masq); - NAT_CHECK(pip, cgn, cgn); - NAT_CHECK(pip, pub, pub); + NAT_CHECK(pip, prv1, ext, masq); + NAT_CHECK(pip, prv2, ext, masq); + NAT_CHECK(pip, prv3, ext, masq); + NAT_CHECK(pip, cgn, ext, cgn); + NAT_CHECK(pip, pub, ext, pub); free(pip); LibAliasUninit(la); @@ -159,12 +102,12 @@ ATF_TC_BODY(3_cgn, dummy) LibAliasSetAddress(la, masq); LibAliasSetMode(la, PKT_ALIAS_UNREGISTERED_CGN, ~0); - pip = ip_packet(prv1, ext, 254, 64); - NAT_CHECK(pip, prv1, masq); - NAT_CHECK(pip, prv2, masq); - NAT_CHECK(pip, prv3, masq); - NAT_CHECK(pip, cgn, masq); - NAT_CHECK(pip, pub, pub); + pip = ip_packet(254, 64); + NAT_CHECK(pip, prv1, ext, masq); + NAT_CHECK(pip, prv2, ext, masq); + NAT_CHECK(pip, prv3, ext, masq); + NAT_CHECK(pip, cgn, ext, masq); + NAT_CHECK(pip, pub, ext, pub); /* * State is only for new connections @@ -172,11 +115,11 @@ ATF_TC_BODY(3_cgn, dummy) * the mode setting should be ignored */ LibAliasSetMode(la, 0, PKT_ALIAS_UNREGISTERED_CGN); - NAT_CHECK(pip, prv1, masq); - NAT_CHECK(pip, prv2, masq); - NAT_CHECK(pip, prv3, masq); - NAT_CHECK(pip, cgn, masq); - NAT_CHECK(pip, pub, pub); + NAT_CHECK(pip, prv1, ext, masq); + NAT_CHECK(pip, prv2, ext, masq); + NAT_CHECK(pip, prv3, ext, masq); + NAT_CHECK(pip, cgn, ext, masq); + NAT_CHECK(pip, pub, ext, pub); free(pip); LibAliasUninit(la); @@ -197,41 +140,27 @@ ATF_TC_BODY(4_udp, dummy) LibAliasSetMode(la, 0, ~0); /* Query from prv1 */ - po = ip_packet(prv1, ext, 0, 64); - uo = set_udp(po, sport, dport); - NAT_CHECK(po, prv1, masq); - ATF_CHECK(uo->uh_dport == htons(dport)); - ATF_CHECK(addr_eq(po->ip_dst, ext)); + po = ip_packet(0, 64); + UDP_NAT_CHECK(po, uo, prv1, sport, ext, dport, masq); aport = ntohs(uo->uh_sport); /* should use a different external port */ ATF_CHECK(aport != sport); /* Response */ - pi = ip_packet(po->ip_dst, po->ip_src, 0, 64); - ui = set_udp(pi, ntohs(uo->uh_dport), ntohs(uo->uh_sport)); - UNNAT_CHECK(pi, ext, masq, prv1); - ATF_CHECK(ui->uh_sport == htons(dport)); - ATF_CHECK(ui->uh_dport == htons(sport)); + pi = ip_packet(0, 64); + UDP_UNNAT_CHECK(pi, ui, ext, dport, masq, aport, prv1, sport); /* Query from different source with same ports */ - uo = set_udp(po, sport, dport); - NAT_CHECK(po, prv2, masq); - ATF_CHECK(uo->uh_dport == htons(dport)); - ATF_CHECK(addr_eq(po->ip_dst, ext)); + UDP_NAT_CHECK(po, uo, prv2, sport, ext, dport, masq); /* should use a different external port */ ATF_CHECK(uo->uh_sport != htons(aport)); /* Response to prv2 */ ui->uh_dport = uo->uh_sport; - UNNAT_CHECK(pi, ext, masq, prv2); - ATF_CHECK(ui->uh_sport == htons(dport)); - ATF_CHECK(ui->uh_dport == htons(sport)); + UDP_UNNAT_CHECK(pi, ui, ext, dport, masq, htons(uo->uh_sport), prv2, sport); /* Response to prv1 again */ - ui->uh_dport = htons(aport); - UNNAT_CHECK(pi, ext, masq, prv1); - ATF_CHECK(ui->uh_sport == htons(dport)); - ATF_CHECK(ui->uh_dport == htons(sport)); + UDP_UNNAT_CHECK(pi, ui, ext, dport, masq, aport, prv1, sport); free(pi); free(po); @@ -253,20 +182,14 @@ ATF_TC_BODY(5_sameport, dummy) LibAliasSetMode(la, PKT_ALIAS_SAME_PORTS, ~0); /* Query from prv1 */ - p = ip_packet(prv1, ext, 0, 64); - u = set_udp(p, sport, dport); - NAT_CHECK(p, prv1, masq); - ATF_CHECK(u->uh_dport == htons(dport)); - ATF_CHECK(addr_eq(p->ip_dst, ext)); + p = ip_packet(0, 64); + UDP_NAT_CHECK(p, u, prv1, sport, ext, dport, masq); aport = ntohs(u->uh_sport); /* should use the same external port */ ATF_CHECK(aport == sport); /* Query from different source with same ports */ - u = set_udp(p, sport, dport); - NAT_CHECK(p, prv2, masq); - ATF_CHECK(u->uh_dport == htons(dport)); - ATF_CHECK(addr_eq(p->ip_dst, ext)); + UDP_NAT_CHECK(p, u, prv2, sport, ext, dport, masq); /* should use a different external port */ ATF_CHECK(u->uh_sport != htons(aport)); @@ -291,43 +214,30 @@ ATF_TC_BODY(6_cleartable, dummy) LibAliasSetMode(la, PKT_ALIAS_DENY_INCOMING, PKT_ALIAS_DENY_INCOMING); /* Query from prv1 */ - po = ip_packet(prv1, ext, 0, 64); - uo = set_udp(po, sport, dport); - NAT_CHECK(po, prv1, masq); - ATF_CHECK(uo->uh_dport == htons(dport)); - ATF_CHECK(addr_eq(po->ip_dst, ext)); + po = ip_packet(0, 64); + UDP_NAT_CHECK(po, uo, prv1, sport, ext, dport, masq); aport = ntohs(uo->uh_sport); /* should use the same external port */ ATF_CHECK(aport == sport); /* Response */ - pi = ip_packet(po->ip_dst, po->ip_src, 0, 64); - ui = set_udp(pi, ntohs(uo->uh_dport), ntohs(uo->uh_sport)); - UNNAT_CHECK(pi, ext, masq, prv1); - ATF_CHECK(ui->uh_sport == htons(dport)); - ATF_CHECK(ui->uh_dport == htons(sport)); + pi = ip_packet(0, 64); + UDP_UNNAT_CHECK(po, uo, ext, dport, masq, aport, prv1, sport); /* clear table by keeping the address */ LibAliasSetAddress(la, ext); LibAliasSetAddress(la, masq); /* Response to prv1 again -> DENY_INCOMING */ - ui->uh_dport = htons(aport); - UNNAT_FAIL(pi, ext, masq); + UDP_UNNAT_FAIL(pi, ui, ext, dport, masq, aport); /* Query from different source with same ports */ - uo = set_udp(po, sport, dport); - NAT_CHECK(po, prv2, masq); - ATF_CHECK(uo->uh_dport == htons(dport)); - ATF_CHECK(addr_eq(po->ip_dst, ext)); + UDP_NAT_CHECK(po, uo, prv2, sport, ext, dport, masq); /* should use the same external port, because it's free */ ATF_CHECK(uo->uh_sport == htons(aport)); /* Response to prv2 */ - ui->uh_dport = uo->uh_sport; - UNNAT_CHECK(pi, ext, masq, prv2); - ATF_CHECK(ui->uh_sport == htons(dport)); - ATF_CHECK(ui->uh_dport == htons(sport)); + UDP_UNNAT_CHECK(po, uo, ext, dport, masq, htons(uo->uh_sport), prv2, sport); free(pi); free(po); @@ -351,8 +261,7 @@ ATF_TC_BODY(7_stress, dummy) ATF_REQUIRE(la != NULL); LibAliasSetAddress(la, masq); - p = ip_packet(prv1, ext, 0, 64); - u = set_udp(p, 0, 0); + p = ip_packet(0, 64); batch = calloc(batch_size, sizeof(*batch)); ATF_REQUIRE(batch != NULL); @@ -374,21 +283,20 @@ ATF_TC_BODY(7_stress, dummy) } for (i = 0; i < batch_size; i++) { - p->ip_dst = batch[i].dst; - u = set_udp(p, batch[i].sport, batch[i].dport); - NAT_CHECK(p, batch[i].src, masq); - ATF_CHECK(u->uh_dport == htons(batch[i].dport)); - ATF_CHECK(addr_eq(p->ip_dst, batch[i].dst)); + UDP_NAT_CHECK(p, u, + batch[i].src, batch[i].sport, + batch[i].dst, batch[i].dport, + masq); batch[i].aport = htons(u->uh_sport); } qsort(batch, batch_size, sizeof(*batch), randcmp); for (i = 0; i < batch_size; i++) { - u = set_udp(p, batch[i].dport, batch[i].aport); - UNNAT_CHECK(p, batch[i].dst, masq, batch[i].src); - ATF_CHECK(u->uh_dport == htons(batch[i].sport)); - ATF_CHECK(u->uh_sport == htons(batch[i].dport)); + UDP_UNNAT_CHECK(p, u, + batch[i].dst, batch[i].dport, + masq, batch[i].aport, + batch[i].src, batch[i].sport); } } diff --git a/tests/sys/netinet/libalias/3_natin.c b/tests/sys/netinet/libalias/3_natin.c new file mode 100644 index 000000000000..e8e5257e4baa --- /dev/null +++ b/tests/sys/netinet/libalias/3_natin.c @@ -0,0 +1,381 @@ +/* + * SPDX-License-Identifier: BSD-3-Clause + * + * Copyright 2021 Lutz Donnerhacke + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND + * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED + * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR + * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF + * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#include +#include +#include +#include + +#include "util.h" + +ATF_TC_WITHOUT_HEAD(1_portforward); +ATF_TC_BODY(1_portforward, dummy) +{ + struct libalias *la = LibAliasInit(NULL); + struct alias_link *pf1, *pf2, *pf3, *pf4; + struct ip *p; + struct udphdr *u; + + ATF_REQUIRE(la != NULL); + LibAliasSetAddress(la, masq); + LibAliasSetMode(la, PKT_ALIAS_RESET_ON_ADDR_CHANGE, ~0); + LibAliasSetMode(la, PKT_ALIAS_DENY_INCOMING, PKT_ALIAS_DENY_INCOMING); + + /* + * Fully specified + */ + pf1 = LibAliasRedirectPort(la, prv1, ntohs(0x1234), ext, ntohs(0x5678), masq, ntohs(0xabcd), IPPROTO_UDP); + ATF_REQUIRE(pf1 != NULL); + + p = ip_packet(0, 64); + UDP_UNNAT_CHECK(p, u, ext, 0x5678, masq, 0xabcd, prv1, 0x1234); + /* try again */ + UDP_UNNAT_CHECK(p, u, ext, 0x5678, masq, 0xabcd, prv1, 0x1234); + /* different source */ + UDP_UNNAT_FAIL(p, u, pub, 0x5678, masq, 0xabcd); + UDP_UNNAT_FAIL(p, u, ext, 0xdead, masq, 0xabcd); + + /* clear table by keeping the address */ + LibAliasSetAddress(la, ext); + LibAliasSetAddress(la, masq); + + /* delete and try again */ + LibAliasRedirectDelete(la, pf1); + UDP_UNNAT_FAIL(p, u, ext, 0x5678, masq, 0xabcd); + + /* + * Any external port + */ + pf2 = LibAliasRedirectPort(la, prv2, ntohs(0x1234), ext, ntohs(0), masq, ntohs(0xabcd), IPPROTO_UDP); + ATF_REQUIRE(pf2 != NULL); + + UDP_UNNAT_CHECK(p, u, ext, 0x5678, masq, 0xabcd, prv2, 0x1234); + /* try again */ + UDP_UNNAT_CHECK(p, u, ext, 0x5678, masq, 0xabcd, prv2, 0x1234); + /* different source */ + UDP_UNNAT_FAIL(p, u, pub, 0x5678, masq, 0xabcd); + UDP_UNNAT_CHECK(p, u, ext, 0xdead, masq, 0xabcd, prv2, 0x1234); + + /* clear table by keeping the address */ + LibAliasSetAddress(la, ext); + LibAliasSetAddress(la, masq); + + /* delete and try again */ + LibAliasRedirectDelete(la, pf2); + UDP_UNNAT_FAIL(p, u, ext, 0x5678, masq, 0xabcd); + + /* + * Any external host + */ + pf3 = LibAliasRedirectPort(la, prv3, ntohs(0x1234), ANY_ADDR, ntohs(0x5678), masq, ntohs(0xabcd), IPPROTO_UDP); + ATF_REQUIRE(pf3 != NULL); + + UDP_UNNAT_CHECK(p, u, ext, 0x5678, masq, 0xabcd, prv3, 0x1234); + /* try again */ + UDP_UNNAT_CHECK(p, u, ext, 0x5678, masq, 0xabcd, prv3, 0x1234); + /* different source */ + UDP_UNNAT_CHECK(p, u, pub, 0x5678, masq, 0xabcd, prv3, 0x1234); + UDP_UNNAT_FAIL(p, u, ext, 0xdead, masq, 0xabcd); + + /* clear table by keeping the address */ + LibAliasSetAddress(la, ext); + LibAliasSetAddress(la, masq); + + /* delete and try again */ + LibAliasRedirectDelete(la, pf2); + UDP_UNNAT_FAIL(p, u, ext, 0x5678, masq, 0xabcd); + + /* + * Any external host, any port + */ + pf4 = LibAliasRedirectPort(la, cgn, ntohs(0x1234), ANY_ADDR, ntohs(0), masq, ntohs(0xabcd), IPPROTO_UDP); + ATF_REQUIRE(pf4 != NULL); + + UDP_UNNAT_CHECK(p, u, ext, 0x5678, masq, 0xabcd, cgn, 0x1234); + /* try again */ + UDP_UNNAT_CHECK(p, u, ext, 0x5678, masq, 0xabcd, cgn, 0x1234); + /* different source */ + UDP_UNNAT_CHECK(p, u, pub, 0x5678, masq, 0xabcd, cgn, 0x1234); + UDP_UNNAT_CHECK(p, u, ext, 0xdead, masq, 0xabcd, cgn, 0x1234); + + /* clear table by keeping the address */ + LibAliasSetAddress(la, ext); + LibAliasSetAddress(la, masq); + + /* delete and try again */ + LibAliasRedirectDelete(la, pf2); + UDP_UNNAT_FAIL(p, u, ext, 0x5678, masq, 0xabcd); + + free(p); + LibAliasUninit(la); +} + +ATF_TC_WITHOUT_HEAD(2_portoverlap); +ATF_TC_BODY(2_portoverlap, dummy) +{ + struct libalias *la = LibAliasInit(NULL); + struct alias_link *pf1, *pf2, *pf3, *pf4; + struct ip *p; + struct udphdr *u; + + ATF_REQUIRE(la != NULL); + LibAliasSetAddress(la, masq); + LibAliasSetMode(la, PKT_ALIAS_RESET_ON_ADDR_CHANGE, ~0); + LibAliasSetMode(la, PKT_ALIAS_DENY_INCOMING, PKT_ALIAS_DENY_INCOMING); + + /* + * Fully specified + */ + pf1 = LibAliasRedirectPort(la, prv2, ntohs(0x1234), ext, ntohs(0x5678), masq, ntohs(0xabcd), IPPROTO_UDP); + ATF_REQUIRE(pf1 != NULL); + + p = ip_packet(0, 64); + UDP_UNNAT_CHECK(p, u, ext, 0x5678, masq, 0xabcd, prv2, 0x1234); + + /* clear table by keeping the address */ + LibAliasSetAddress(la, ext); + LibAliasSetAddress(la, masq); + + /* + * Fully specified (override) + */ + pf1 = LibAliasRedirectPort(la, prv1, ntohs(0x1234), ext, ntohs(0x5678), masq, ntohs(0xabcd), IPPROTO_UDP); + ATF_REQUIRE(pf1 != NULL); + + UDP_UNNAT_CHECK(p, u, ext, 0x5678, masq, 0xabcd, prv1, 0x1234); + + /* clear table by keeping the address */ + LibAliasSetAddress(la, ext); + LibAliasSetAddress(la, masq); + + /* + * Any external port + */ + pf2 = LibAliasRedirectPort(la, prv2, ntohs(0x1234), ext, ntohs(0), masq, ntohs(0xabcd), IPPROTO_UDP); + ATF_REQUIRE(pf2 != NULL); + + UDP_UNNAT_CHECK(p, u, ext, 0x5679, masq, 0xabcd, prv2, 0x1234); + /* more specific rule wins */ + UDP_UNNAT_CHECK(p, u, ext, 0x5678, masq, 0xabcd, prv1, 0x1234); + + /* clear table by keeping the address */ + LibAliasSetAddress(la, ext); + LibAliasSetAddress(la, masq); + + /* + * Any external host + */ + pf3 = LibAliasRedirectPort(la, prv3, ntohs(0x1234), ANY_ADDR, ntohs(0x5678), masq, ntohs(0xabcd), IPPROTO_UDP); + ATF_REQUIRE(pf3 != NULL); + + UDP_UNNAT_CHECK(p, u, pub, 0x5678, masq, 0xabcd, prv3, 0x1234); + /* more specific rule wins */ + UDP_UNNAT_CHECK(p, u, ext, 0x5679, masq, 0xabcd, prv2, 0x1234); + UDP_UNNAT_CHECK(p, u, ext, 0x5678, masq, 0xabcd, prv1, 0x1234); + + /* clear table by keeping the address */ + LibAliasSetAddress(la, ext); + LibAliasSetAddress(la, masq); + + /* + * Any external host, any port + */ + pf4 = LibAliasRedirectPort(la, cgn, ntohs(0x1234), ANY_ADDR, ntohs(0), masq, ntohs(0xabcd), IPPROTO_UDP); + ATF_REQUIRE(pf4 != NULL); + + UDP_UNNAT_CHECK(p, u, prv1, 0x5679, masq, 0xabcd, cgn, 0x1234); + /* more specific rule wins */ + UDP_UNNAT_CHECK(p, u, pub, 0x5678, masq, 0xabcd, prv3, 0x1234); + UDP_UNNAT_CHECK(p, u, ext, 0x5679, masq, 0xabcd, prv2, 0x1234); + UDP_UNNAT_CHECK(p, u, ext, 0x5678, masq, 0xabcd, prv1, 0x1234); + + free(p); + LibAliasUninit(la); +} + +ATF_TC_WITHOUT_HEAD(3_redirectany); +ATF_TC_BODY(3_redirectany, dummy) +{ + struct libalias *la = LibAliasInit(NULL); + struct alias_link *pf; + struct ip *p; + struct udphdr *u; + + ATF_REQUIRE(la != NULL); + LibAliasSetMode(la, PKT_ALIAS_DENY_INCOMING, ~0); + p = ip_packet(0, 64); + + pf = LibAliasRedirectPort(la, prv1, ntohs(0x1234), ANY_ADDR, 0, ANY_ADDR, ntohs(0xabcd), IPPROTO_UDP); + ATF_REQUIRE(pf != NULL); + + LibAliasSetAddress(la, masq); + UDP_UNNAT_CHECK(p, u, ext, 0x5678, masq, 0xabcd, prv1, 0x1234); + UDP_UNNAT_FAIL(p, u, pub, 0x5678, pub, 0xabcd); + + LibAliasSetAddress(la, pub); + UDP_UNNAT_CHECK(p, u, pub, 0x5679, pub, 0xabcd, prv1, 0x1234); + UDP_UNNAT_FAIL(p, u, ext, 0x5679, masq, 0xabcd); + + free(p); + LibAliasUninit(la); +} + +ATF_TC_WITHOUT_HEAD(4_redirectaddr); +ATF_TC_BODY(4_redirectaddr, dummy) +{ + struct libalias *la = LibAliasInit(NULL); + struct alias_link *pf1, *pf2; + struct ip *p; + + ATF_REQUIRE(la != NULL); + LibAliasSetAddress(la, masq); + pf1 = LibAliasRedirectAddr(la, prv1, pub); + ATF_REQUIRE(pf1 != NULL); + + p = ip_packet(254, 64); + UNNAT_CHECK(p, ext, pub, prv1); + UNNAT_CHECK(p, ext, masq, masq); + + pf2 = LibAliasRedirectAddr(la, prv2, pub); + ATF_REQUIRE(pf2 != NULL); + UNNAT_CHECK(p, ext, pub, prv1); + p->ip_p = 253; /* new flows */ + UNNAT_CHECK(p, ext, pub, prv2); + UNNAT_CHECK(p, ext, masq, masq); + + p->ip_p = 252; /* new flows */ + NAT_CHECK(p, prv1, ext, pub); + NAT_CHECK(p, prv2, ext, pub); + NAT_CHECK(p, prv3, ext, masq); + + LibAliasSetMode(la, PKT_ALIAS_DENY_INCOMING, ~0); + p->ip_p = 251; /* new flows */ + UNNAT_FAIL(p, ext, pub); + UNNAT_FAIL(p, ext, masq); + + /* unhide older version */ + LibAliasRedirectDelete(la, pf2); + LibAliasSetMode(la, 0, ~0); + p->ip_p = 250; /* new flows */ + UNNAT_CHECK(p, ext, pub, prv1); + + p->ip_p = 249; /* new flows */ + NAT_CHECK(p, prv1, ext, pub); + NAT_CHECK(p, prv2, ext, masq); + NAT_CHECK(p, prv3, ext, masq); + + free(p); + LibAliasUninit(la); +} + +ATF_TC_WITHOUT_HEAD(5_lsnat); +ATF_TC_BODY(5_lsnat, dummy) +{ + struct libalias *la = LibAliasInit(NULL); + struct alias_link *pf; + struct ip *p; + struct udphdr *u; + + ATF_REQUIRE(la != NULL); + LibAliasSetMode(la, 0, ~0); + p = ip_packet(0, 64); + + pf = LibAliasRedirectPort(la, cgn, ntohs(0xdead), ANY_ADDR, 0, masq, ntohs(0xabcd), IPPROTO_UDP); + ATF_REQUIRE(pf != NULL); + + ATF_REQUIRE(0 == LibAliasAddServer(la, pf, prv1, ntohs(0x1234))); + ATF_REQUIRE(0 == LibAliasAddServer(la, pf, prv2, ntohs(0x2345))); + ATF_REQUIRE(0 == LibAliasAddServer(la, pf, prv3, ntohs(0x3456))); + + UDP_UNNAT_CHECK(p, u, ext, 0x5678, masq, 0xabcd, prv3, 0x3456); + UDP_UNNAT_CHECK(p, u, ext, 0x5679, masq, 0xabcd, prv2, 0x2345); + UDP_UNNAT_CHECK(p, u, ext, 0x567a, masq, 0xabcd, prv1, 0x1234); + UDP_UNNAT_CHECK(p, u, ext, 0x567b, masq, 0xabcd, prv3, 0x3456); + UDP_UNNAT_CHECK(p, u, ext, 0x567c, masq, 0xabcd, prv2, 0x2345); + UDP_UNNAT_CHECK(p, u, ext, 0x567d, masq, 0xabcd, prv1, 0x1234); + + free(p); + LibAliasUninit(la); +} + +ATF_TC_WITHOUT_HEAD(6_oneshot); +ATF_TC_BODY(6_oneshot, dummy) +{ + struct libalias *la = LibAliasInit(NULL); + struct alias_link *pf; + struct ip *p; + struct udphdr *u; + + ATF_REQUIRE(la != NULL); + LibAliasSetMode(la, 0, ~0); + LibAliasSetMode(la, PKT_ALIAS_RESET_ON_ADDR_CHANGE, ~0); + LibAliasSetMode(la, PKT_ALIAS_DENY_INCOMING, PKT_ALIAS_DENY_INCOMING); + + pf = LibAliasRedirectPort(la, prv1, ntohs(0x1234), ANY_ADDR, 0, masq, ntohs(0xabcd), IPPROTO_UDP); + ATF_REQUIRE(pf != NULL); + /* only for fully specified links */ + ATF_CHECK(-1 == LibAliasRedirectDynamic(la, pf)); + LibAliasRedirectDelete(la, pf); + + pf = LibAliasRedirectPort(la, prv1, ntohs(0x1234), ext, ntohs(0x5678), masq, ntohs(0xabcd), IPPROTO_UDP); + ATF_REQUIRE(pf != NULL); + ATF_CHECK(0 == LibAliasRedirectDynamic(la, pf)); + + p = ip_packet(0, 64); + UDP_UNNAT_CHECK(p, u, ext, 0x5678, masq, 0xabcd, prv1, 0x1234); + + /* clear table by keeping the address */ + LibAliasSetAddress(la, ext); + LibAliasSetAddress(la, masq); + + /* does not work anymore */ + UDP_UNNAT_FAIL(p, u, ext, 0x5678, masq, 0xabcd); + + free(p); + LibAliasUninit(la); +} + +ATF_TP_ADD_TCS(natin) +{ + /* Use "dd if=/dev/random bs=2 count=1 | od -x" to reproduce */ + srand(0xe859); + + ATF_TP_ADD_TC(natin, 1_portforward); + ATF_TP_ADD_TC(natin, 2_portoverlap); + ATF_TP_ADD_TC(natin, 3_redirectany); + ATF_TP_ADD_TC(natin, 4_redirectaddr); + ATF_TP_ADD_TC(natin, 5_lsnat); + ATF_TP_ADD_TC(natin, 6_oneshot); + + return atf_no_error(); +} diff --git a/tests/sys/netinet/libalias/Makefile b/tests/sys/netinet/libalias/Makefile index 6ee2fc0e0e1f..e5ed88f52fcd 100644 --- a/tests/sys/netinet/libalias/Makefile +++ b/tests/sys/netinet/libalias/Makefile @@ -7,6 +7,7 @@ BINDIR= ${TESTSDIR} ATF_TESTS_C+= 1_instance \ 2_natout \ + 3_natin \ PROGS+= perf @@ -14,6 +15,7 @@ LIBADD+= alias SRCS.1_instance=1_instance.c util.c SRCS.2_natout= 2_natout.c util.c +SRCS.3_natin= 3_natin.c util.c SRCS.perf= perf.c util.c .include diff --git a/tests/sys/netinet/libalias/perf.c b/tests/sys/netinet/libalias/perf.c index 365b8f2e9fcc..f238846bdb16 100644 --- a/tests/sys/netinet/libalias/perf.c +++ b/tests/sys/netinet/libalias/perf.c @@ -38,10 +38,7 @@ #include "util.h" #include -/* common ip ranges */ -static struct in_addr masq = { htonl(0x01020304) }; -static struct in_addr prv = { htonl(0x0a000000) }; -static struct in_addr ext = { htonl(0x12000000) }; +static void usage(void); #define timevalcmp(tv, uv, cmp) \ (((tv).tv_sec == (uv).tv_sec) \ @@ -52,10 +49,24 @@ static struct in_addr ext = { htonl(0x12000000) }; (((n).tv_sec - (o).tv_sec)*1000000l + \ ((n).tv_usec - (o).tv_usec)) +#define check_timeout() do { \ + if (check_timeout_cnt++ > 1000) { \ + check_timeout_cnt = 0; \ + gettimeofday(&now, NULL); \ + if (timevalcmp(now, timeout, >=)) \ + goto out; \ + } } while(0) + +static void +usage(void) { + printf("Usage: perf [max_seconds [batch_size [random_size [attack_size [redir_size]]]]]\n"); + exit(1); +} + int main(int argc, char ** argv) { struct libalias *la; - struct timeval timeout; + struct timeval timeout, now, start; struct ip *p; struct udphdr *u; struct { @@ -64,34 +75,59 @@ int main(int argc, char ** argv) } *batch; struct { unsigned long ok, fail; - } nat, unnat, random, attack; - int max_seconds, batch_size, random_size, attack_length, round, cnt; - - if(argc != 5 || - 0 > (max_seconds = atoi(argv[1])) || - 0 >= (batch_size = atoi(argv[2])) || - 0 >= (random_size = atoi(argv[3])) || - 0 >= (attack_length = atoi(argv[4]))) { - printf("Usage: %s max_seconds batch_size random_size attack_length\n", argv[0]); - return 1; + } nat, usenat, unnat, random, attack; + int i, round, check_timeout_cnt = 0; + int max_seconds = 90, batch_size = 2000, + random_size = 1000, attack_size = 1000, + redir_size = 2000; + + if (argc >= 2) { + char * end; + + max_seconds = strtol(argv[1], &end, 10); + if (max_seconds < 2 || end[0] != '\0') + usage(); } + if (argc > 2 && (batch_size = atoi(argv[2])) < 0) usage(); + if (argc > 3 && (random_size = atoi(argv[3])) < 0) usage(); + if (argc > 4 && (attack_size = atoi(argv[4])) < 0) usage(); + if (argc > 5 && (redir_size = atoi(argv[5])) < 0) usage(); + + printf("Running perfomance test with parameters:\n"); + printf(" Maximum Runtime (max_seconds) = %d\n", max_seconds); + printf(" Amount of valid connections (batch_size) = %d\n", batch_size); + printf(" Amount of random, incoming packets (batch_size) = %d\n", random_size); + printf(" Repeat count of a random, incoming packet (attack_size) = %d\n", attack_size); + printf(" Amount of open port forwardings (redir_size) = %d\n", redir_size); + printf("\n"); + if (NULL == (la = LibAliasInit(NULL))) { perror("LibAliasInit"); return -1; } bzero(&nat, sizeof(nat)); + bzero(&usenat, sizeof(usenat)); bzero(&unnat, sizeof(unnat)); bzero(&random, sizeof(random)); bzero(&attack, sizeof(attack)); LibAliasSetAddress(la, masq); - LibAliasSetMode(la, PKT_ALIAS_DENY_INCOMING, PKT_ALIAS_DENY_INCOMING); + LibAliasSetMode(la, PKT_ALIAS_SAME_PORTS | PKT_ALIAS_DENY_INCOMING, ~0); - prv.s_addr &= htonl(0xffff0000); + prv1.s_addr &= htonl(0xffff0000); ext.s_addr &= htonl(0xffff0000); - p = ip_packet(prv, ext, 0, 64); + for (i = 0; i < redir_size; i++) { + int aport = htons(rand_range(1000, 2000)); + int sport = htons(rand_range(1000, 2000)); + + prv2.s_addr &= htonl(0xffff0000); + prv2.s_addr |= rand_range(0, 0xffff); + LibAliasRedirectPort(la, prv2, sport, ANY_ADDR, 0, masq, aport, IPPROTO_UDP); + } + + p = ip_packet(0, 64); u = set_udp(p, 0, 0); if (NULL == (batch = calloc(batch_size, sizeof(*batch)))) { @@ -102,17 +138,16 @@ int main(int argc, char ** argv) gettimeofday(&timeout, NULL); timeout.tv_sec += max_seconds; - printf("RND SECND NAT RND ATT UNA\n"); + printf("RND SECOND newNAT RANDOM ATTACK useNAT\n"); for (round = 0; ; round++) { - int i, res; - struct timeval now, start; + int res, cnt; printf("%3d ", round+1); gettimeofday(&start, NULL); - printf("%5.1f ", max_seconds - timevaldiff(timeout, start)/1000000.0f); + printf("%6.1f ", max_seconds - timevaldiff(timeout, start)/1000000.0f); for (cnt = i = 0; i < batch_size; i++, cnt++) { - batch[i].src.s_addr = prv.s_addr | htonl(rand_range(0, 0xffff)); + batch[i].src.s_addr = prv1.s_addr | htonl(rand_range(0, 0xffff)); batch[i].dst.s_addr = ext.s_addr | htonl(rand_range(0, 0xffff)); batch[i].sport = rand_range(1000, 60000); batch[i].dport = rand_range(1000, 60000); @@ -132,12 +167,13 @@ int main(int argc, char ** argv) else nat.fail++; - gettimeofday(&now, NULL); - if(timevalcmp(now, timeout, >=)) - goto out; + check_timeout(); } + gettimeofday(&now, NULL); if (cnt > 0) - printf("%3.0f ", timevaldiff(now, start) / cnt); + printf("%6.2f ", timevaldiff(now, start) / cnt); + else + printf("------ "); start = now; for (cnt = i = 0; i < random_size; i++, cnt++) { @@ -153,19 +189,20 @@ int main(int argc, char ** argv) else random.fail++; - gettimeofday(&now, NULL); - if(timevalcmp(now, timeout, >=)) - goto out; + check_timeout(); } + gettimeofday(&now, NULL); if (cnt > 0) - printf("%3.0f ", timevaldiff(now, start) / cnt); + printf("%6.2f ", timevaldiff(now, start) / cnt); + else + printf("------ "); start = now; p->ip_src.s_addr = ext.s_addr & htonl(0xfff00000); p->ip_src.s_addr |= htonl(rand_range(0, 0xffff)); p->ip_dst = masq; u = set_udp(p, rand_range(1, 0xffff), rand_range(1, 0xffff)); - for (cnt = i = 0; i < attack_length; i++, cnt++) { + for (cnt = i = 0; i < attack_size; i++, cnt++) { res = LibAliasIn(la, p, 64); if (res == PKT_ALIAS_OK) @@ -173,59 +210,99 @@ int main(int argc, char ** argv) else attack.fail++; - gettimeofday(&now, NULL); - if(timevalcmp(now, timeout, >=)) - goto out; + check_timeout(); } + gettimeofday(&now, NULL); if (cnt > 0) - printf("%3.0f ", timevaldiff(now, start) / cnt); + printf("%6.2f ", timevaldiff(now, start) / cnt); + else + printf("------ "); qsort(batch, batch_size, sizeof(*batch), randcmp); gettimeofday(&start, NULL); *** 251 LINES SKIPPED *** From owner-dev-commits-src-branches@freebsd.org Wed Jun 2 12:24:46 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 44C0D642016; Wed, 2 Jun 2021 12:24: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 4Fw7Wf1T8vz3FGb; Wed, 2 Jun 2021 12:24:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1AD6016C52; Wed, 2 Jun 2021 12:24:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 152COkf7019053; Wed, 2 Jun 2021 12:24:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 152COk9Q019052; Wed, 2 Jun 2021 12:24:46 GMT (envelope-from git) Date: Wed, 2 Jun 2021 12:24:46 GMT Message-Id: <202106021224.152COk9Q019052@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: 8d8bfdf20dc4 - stable/13 - Rework for-loop in EPOCH(9) to reduce indentation level. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8d8bfdf20dc473a163c74bcd00b94b083f81ae0c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jun 2021 12:24:46 -0000 The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=8d8bfdf20dc473a163c74bcd00b94b083f81ae0c commit 8d8bfdf20dc473a163c74bcd00b94b083f81ae0c Author: Hans Petter Selasky AuthorDate: 2021-05-21 08:20:34 +0000 Commit: Hans Petter Selasky CommitDate: 2021-06-02 11:12:34 +0000 Rework for-loop in EPOCH(9) to reduce indentation level. No functional change intended. Sponsored by: Mellanox Technologies // NVIDIA Networking (cherry picked from commit cc9bb7a9b863c018a069a71392fa9baea98b5fdb) --- sys/kern/subr_epoch.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/sys/kern/subr_epoch.c b/sys/kern/subr_epoch.c index 48567f97dcfa..210cf78d55f0 100644 --- a/sys/kern/subr_epoch.c +++ b/sys/kern/subr_epoch.c @@ -219,12 +219,14 @@ epoch_trace_enter(struct thread *td, epoch_t epoch, epoch_tracker_t et, { epoch_tracker_t iet; - SLIST_FOREACH(iet, &td->td_epochs, et_tlink) - if (iet->et_epoch == epoch) - epoch_trace_report("Recursively entering epoch %s " - "at %s:%d, previously entered at %s:%d\n", - epoch->e_name, file, line, - iet->et_file, iet->et_line); + SLIST_FOREACH(iet, &td->td_epochs, et_tlink) { + if (iet->et_epoch != epoch) + continue; + epoch_trace_report("Recursively entering epoch %s " + "at %s:%d, previously entered at %s:%d\n", + epoch->e_name, file, line, + iet->et_file, iet->et_line); + } et->et_epoch = epoch; et->et_file = file; et->et_line = line; From owner-dev-commits-src-branches@freebsd.org Wed Jun 2 12:24:47 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 816236418C1; Wed, 2 Jun 2021 12:24:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fw7Wg2df6z3FV4; Wed, 2 Jun 2021 12:24:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3510616BE4; Wed, 2 Jun 2021 12:24:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 152COlT2019074; Wed, 2 Jun 2021 12:24:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 152COl6c019073; Wed, 2 Jun 2021 12:24:47 GMT (envelope-from git) Date: Wed, 2 Jun 2021 12:24:47 GMT Message-Id: <202106021224.152COl6c019073@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: 623d96f4afb6 - stable/13 - Accessing the epoch structure should happen after the INIT_CHECK(). Else the epoch pointer may be NULL. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 623d96f4afb60eb0d6fcf5ba738d9880a3b10ca0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jun 2021 12:24:47 -0000 The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=623d96f4afb60eb0d6fcf5ba738d9880a3b10ca0 commit 623d96f4afb60eb0d6fcf5ba738d9880a3b10ca0 Author: Hans Petter Selasky AuthorDate: 2021-05-21 09:06:27 +0000 Commit: Hans Petter Selasky CommitDate: 2021-06-02 11:12:41 +0000 Accessing the epoch structure should happen after the INIT_CHECK(). Else the epoch pointer may be NULL. Sponsored by: Mellanox Technologies // NVIDIA Networking (cherry picked from commit c82c200622b5380b8346de29879222538653f663) --- sys/kern/subr_epoch.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/kern/subr_epoch.c b/sys/kern/subr_epoch.c index 210cf78d55f0..31b79513fdc2 100644 --- a/sys/kern/subr_epoch.c +++ b/sys/kern/subr_epoch.c @@ -442,13 +442,14 @@ _epoch_enter_preempt(epoch_t epoch, epoch_tracker_t et EPOCH_FILE_LINE) struct thread *td; MPASS(cold || epoch != NULL); - MPASS(epoch->e_flags & EPOCH_PREEMPT); td = curthread; MPASS((vm_offset_t)et >= td->td_kstack && (vm_offset_t)et + sizeof(struct epoch_tracker) <= td->td_kstack + td->td_kstack_pages * PAGE_SIZE); INIT_CHECK(epoch); + MPASS(epoch->e_flags & EPOCH_PREEMPT); + #ifdef EPOCH_TRACE epoch_trace_enter(td, epoch, et, file, line); #endif From owner-dev-commits-src-branches@freebsd.org Wed Jun 2 12:24:48 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A6D0F641A50; Wed, 2 Jun 2021 12:24: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 4Fw7Wh3nb5z3FD4; Wed, 2 Jun 2021 12:24:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 61F4116D93; Wed, 2 Jun 2021 12:24:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 152COmCC019095; Wed, 2 Jun 2021 12:24:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 152COmC1019094; Wed, 2 Jun 2021 12:24:48 GMT (envelope-from git) Date: Wed, 2 Jun 2021 12:24:48 GMT Message-Id: <202106021224.152COmC1019094@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: 407b687dfef6 - stable/13 - Make sure all tasklets are drained before unloading the LinuxKPI. Else use-after-free may happen. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 407b687dfef6bf20623726a71127b63f4fb20615 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jun 2021 12:24:48 -0000 The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=407b687dfef6bf20623726a71127b63f4fb20615 commit 407b687dfef6bf20623726a71127b63f4fb20615 Author: Hans Petter Selasky AuthorDate: 2021-05-21 06:52:59 +0000 Commit: Hans Petter Selasky CommitDate: 2021-06-02 11:23:19 +0000 Make sure all tasklets are drained before unloading the LinuxKPI. Else use-after-free may happen. This change also partially cherry picks support for the taskqgroup_drain_all() function. Sponsored by: Mellanox Technologies // NVIDIA Networking (cherry picked from commit 209d4919c5270fe9e3c1d809cf91355d222dc2f3) --- sys/compat/linuxkpi/common/src/linux_tasklet.c | 2 ++ sys/kern/subr_gtaskqueue.c | 13 +++++++++++++ sys/sys/gtaskqueue.h | 1 + 3 files changed, 16 insertions(+) diff --git a/sys/compat/linuxkpi/common/src/linux_tasklet.c b/sys/compat/linuxkpi/common/src/linux_tasklet.c index 9a4c01737466..26e7bb75cf19 100644 --- a/sys/compat/linuxkpi/common/src/linux_tasklet.c +++ b/sys/compat/linuxkpi/common/src/linux_tasklet.c @@ -128,6 +128,8 @@ tasklet_subsystem_uninit(void *arg __unused) struct tasklet_worker *tw; int i; + taskqgroup_drain_all(qgroup_softirq); + CPU_FOREACH(i) { if (CPU_ABSENT(i)) continue; diff --git a/sys/kern/subr_gtaskqueue.c b/sys/kern/subr_gtaskqueue.c index 3eac29631244..c4db60890eee 100644 --- a/sys/kern/subr_gtaskqueue.c +++ b/sys/kern/subr_gtaskqueue.c @@ -817,3 +817,16 @@ void taskqgroup_destroy(struct taskqgroup *qgroup) { } + +void +taskqgroup_drain_all(struct taskqgroup *tqg) +{ + struct gtaskqueue *q; + + for (int i = 0; i < mp_ncpus; i++) { + q = tqg->tqg_queue[i].tgc_taskq; + if (q == NULL) + continue; + gtaskqueue_drain_all(q); + } +} diff --git a/sys/sys/gtaskqueue.h b/sys/sys/gtaskqueue.h index aa352902c65b..f662aa39f00e 100644 --- a/sys/sys/gtaskqueue.h +++ b/sys/sys/gtaskqueue.h @@ -80,6 +80,7 @@ void taskqgroup_detach(struct taskqgroup *qgroup, struct grouptask *gtask); struct taskqgroup *taskqgroup_create(const char *name, int cnt, int stride); void taskqgroup_destroy(struct taskqgroup *qgroup); void taskqgroup_bind(struct taskqgroup *qgroup); +void taskqgroup_drain_all(struct taskqgroup *qgroup); #define GTASK_INIT(gtask, flags, priority, func, context) do { \ (gtask)->ta_flags = flags; \ From owner-dev-commits-src-branches@freebsd.org Wed Jun 2 12:24:49 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D086D642165; Wed, 2 Jun 2021 12:24: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 4Fw7Wj4Yxbz3FRx; Wed, 2 Jun 2021 12:24:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 795C616D94; Wed, 2 Jun 2021 12:24:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 152COnW4019116; Wed, 2 Jun 2021 12:24:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 152COnVf019115; Wed, 2 Jun 2021 12:24:49 GMT (envelope-from git) Date: Wed, 2 Jun 2021 12:24:49 GMT Message-Id: <202106021224.152COnVf019115@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: 71370d8c7fc3 - stable/13 - Properly define EPOCH(9) function macro. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 71370d8c7fc306c4999f16fcbc12365159ab92a7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jun 2021 12:24:49 -0000 The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=71370d8c7fc306c4999f16fcbc12365159ab92a7 commit 71370d8c7fc306c4999f16fcbc12365159ab92a7 Author: Hans Petter Selasky AuthorDate: 2021-05-21 08:22:13 +0000 Commit: Hans Petter Selasky CommitDate: 2021-06-02 11:25:19 +0000 Properly define EPOCH(9) function macro. No functional change intended. Sponsored by: Mellanox Technologies // NVIDIA Networking (cherry picked from commit f33168351b3804664f5e82a409d9f956df2802f3) --- sys/kern/subr_epoch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/subr_epoch.c b/sys/kern/subr_epoch.c index 31b79513fdc2..798dbdc4360e 100644 --- a/sys/kern/subr_epoch.c +++ b/sys/kern/subr_epoch.c @@ -871,7 +871,7 @@ epoch_assert_nocpu(epoch_t epoch, struct thread *td) } } #else -#define epoch_assert_nocpu(e, td) +#define epoch_assert_nocpu(e, td) do {} while (0) #endif int From owner-dev-commits-src-branches@freebsd.org Wed Jun 2 12:24:51 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E09C76418D9; Wed, 2 Jun 2021 12:24: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 4Fw7Wk5Jsdz3Frk; Wed, 2 Jun 2021 12:24:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9ABAD16D95; Wed, 2 Jun 2021 12:24:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 152COoMS019143; Wed, 2 Jun 2021 12:24:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 152COoPi019142; Wed, 2 Jun 2021 12:24:50 GMT (envelope-from git) Date: Wed, 2 Jun 2021 12:24:50 GMT Message-Id: <202106021224.152COoPi019142@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: 9f98b3ea746f - stable/13 - Fix for use-after-free by if_ioctl() calls from user-space in USB drivers by detaching the ifnet before the miibus. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 9f98b3ea746f97b61d37f1c11d0e7abb3cd81305 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jun 2021 12:24:51 -0000 The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=9f98b3ea746f97b61d37f1c11d0e7abb3cd81305 commit 9f98b3ea746f97b61d37f1c11d0e7abb3cd81305 Author: Hans Petter Selasky AuthorDate: 2021-01-12 17:51:09 +0000 Commit: Hans Petter Selasky CommitDate: 2021-06-02 11:25:19 +0000 Fix for use-after-free by if_ioctl() calls from user-space in USB drivers by detaching the ifnet before the miibus. PR: 252608 Suggested by: jhb@ Sponsored by: Mellanox Technologies // NVIDIA Networking (cherry picked from commit 4eac63af23ddafc2b1dfb2aad2896f4513c37cdd) --- sys/dev/usb/net/uhso.c | 2 +- sys/dev/usb/net/usb_ethernet.c | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/sys/dev/usb/net/uhso.c b/sys/dev/usb/net/uhso.c index c72fa8d7a36b..4ff5fcc075d3 100644 --- a/sys/dev/usb/net/uhso.c +++ b/sys/dev/usb/net/uhso.c @@ -691,10 +691,10 @@ uhso_detach(device_t self) free_unr(uhso_ifnet_unit, sc->sc_ifp->if_dunit); mtx_lock(&sc->sc_mtx); uhso_if_stop(sc); + mtx_unlock(&sc->sc_mtx); bpfdetach(sc->sc_ifp); if_detach(sc->sc_ifp); if_free(sc->sc_ifp); - mtx_unlock(&sc->sc_mtx); usbd_transfer_unsetup(sc->sc_if_xfer, UHSO_IFNET_MAX); } diff --git a/sys/dev/usb/net/usb_ethernet.c b/sys/dev/usb/net/usb_ethernet.c index e1eb2c247b5a..33659049f970 100644 --- a/sys/dev/usb/net/usb_ethernet.c +++ b/sys/dev/usb/net/usb_ethernet.c @@ -319,6 +319,12 @@ uether_ifdetach(struct usb_ether *ue) /* drain any callouts */ usb_callout_drain(&ue->ue_watchdog); + /* + * Detach ethernet first to stop miibus calls from + * user-space: + */ + ether_ifdetach(ifp); + /* detach miibus */ if (ue->ue_miibus != NULL) { mtx_lock(&Giant); /* device_xxx() depends on this */ @@ -326,9 +332,6 @@ uether_ifdetach(struct usb_ether *ue) mtx_unlock(&Giant); } - /* detach ethernet */ - ether_ifdetach(ifp); - /* free interface instance */ if_free(ifp); From owner-dev-commits-src-branches@freebsd.org Wed Jun 2 12:24:52 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1707A641C43; Wed, 2 Jun 2021 12:24:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fw7Wl6BVQz3Frr; Wed, 2 Jun 2021 12:24:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BAD9A16C53; Wed, 2 Jun 2021 12:24:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 152COp33019165; Wed, 2 Jun 2021 12:24:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 152COpKG019164; Wed, 2 Jun 2021 12:24:51 GMT (envelope-from git) Date: Wed, 2 Jun 2021 12:24:51 GMT Message-Id: <202106021224.152COpKG019164@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: 5bbf7afe3066 - stable/13 - Update USB_PORT_RESET_RECOVERY to comply with the USB 2.0 specification which says it should be max 10 milliseconds. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5bbf7afe30662343487b6cecc43693edc82c5b0e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jun 2021 12:24:52 -0000 The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=5bbf7afe30662343487b6cecc43693edc82c5b0e commit 5bbf7afe30662343487b6cecc43693edc82c5b0e Author: Hans Petter Selasky AuthorDate: 2021-05-18 13:22:32 +0000 Commit: Hans Petter Selasky CommitDate: 2021-06-02 11:25:19 +0000 Update USB_PORT_RESET_RECOVERY to comply with the USB 2.0 specification which says it should be max 10 milliseconds. This may fix some USB enumeration issues: > usbd_req_re_enumerate: addr=3, set address failed! (USB_ERR_IOERROR, ignored) > usbd_setup_device_desc: getting device descriptor at addr 3 failed, Found by: Zhichao1.Li@dell.com Sponsored by: Mellanox Technologies // NVIDIA Networking (cherry picked from commit 70ffaaa69c830d26b59136d0b0447ab2f8683db8) --- sys/dev/usb/usb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/usb/usb.h b/sys/dev/usb/usb.h index 346ecd3059d7..dcdb62114d63 100644 --- a/sys/dev/usb/usb.h +++ b/sys/dev/usb/usb.h @@ -115,7 +115,7 @@ MALLOC_DECLARE(M_USBDEV); /* Allow for marginal and non-conforming devices. */ #define USB_PORT_RESET_DELAY 50 /* ms */ #define USB_PORT_ROOT_RESET_DELAY 200 /* ms */ -#define USB_PORT_RESET_RECOVERY 250 /* ms */ +#define USB_PORT_RESET_RECOVERY 10 /* ms */ #define USB_PORT_POWERUP_DELAY 300 /* ms */ #define USB_PORT_RESUME_DELAY (20*2) /* ms */ #define USB_SET_ADDRESS_SETTLE 10 /* ms */ From owner-dev-commits-src-branches@freebsd.org Wed Jun 2 12:24:53 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7B08C6418DA; Wed, 2 Jun 2021 12:24: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 4Fw7Wn1G4zz3FpV; Wed, 2 Jun 2021 12:24:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E31B816BE5; Wed, 2 Jun 2021 12:24:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 152COqom019186; Wed, 2 Jun 2021 12:24:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 152COqYc019185; Wed, 2 Jun 2021 12:24:52 GMT (envelope-from git) Date: Wed, 2 Jun 2021 12:24:52 GMT Message-Id: <202106021224.152COqYc019185@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: ae9aba942b58 - stable/13 - Update usb_timings_sysctl_handler() to accept any value for timings between 0 milliseconds and 2 seconds inclusivly. Some style fixes while at it. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ae9aba942b58ff235c5aafd599fe37821c8f79f5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jun 2021 12:24:53 -0000 The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=ae9aba942b58ff235c5aafd599fe37821c8f79f5 commit ae9aba942b58ff235c5aafd599fe37821c8f79f5 Author: Hans Petter Selasky AuthorDate: 2021-05-18 13:16:29 +0000 Commit: Hans Petter Selasky CommitDate: 2021-06-02 11:25:20 +0000 Update usb_timings_sysctl_handler() to accept any value for timings between 0 milliseconds and 2 seconds inclusivly. Some style fixes while at it. The USB specification has minimum values and maximum values, and not only minimum values. Sponsored by: Mellanox Technologies // NVIDIA Networking (cherry picked from commit 00e501d720d46386e6c8d0ebb4b3a8e98cb0390e) --- sys/dev/usb/usb_debug.c | 57 +++++++++++-------------------------------------- 1 file changed, 13 insertions(+), 44 deletions(-) diff --git a/sys/dev/usb/usb_debug.c b/sys/dev/usb/usb_debug.c index 5b5d141508c3..5e521f7ec3a5 100644 --- a/sys/dev/usb/usb_debug.c +++ b/sys/dev/usb/usb_debug.c @@ -249,71 +249,40 @@ unsigned int usb_extra_power_up_time = USB_EXTRA_POWER_UP_TIME; /*------------------------------------------------------------------------* * usb_timings_sysctl_handler * - * This function updates timings variables, adjusting them where necessary. + * This function is used to update USB timing variables. *------------------------------------------------------------------------*/ static int usb_timings_sysctl_handler(SYSCTL_HANDLER_ARGS) { int error = 0; - unsigned int val; + unsigned val; /* * Attempt to get a coherent snapshot by making a copy of the data. */ if (arg1) - val = *(unsigned int *)arg1; + val = *(unsigned *)arg1; else val = arg2; - error = SYSCTL_OUT(req, &val, sizeof(int)); + error = SYSCTL_OUT(req, &val, sizeof(unsigned)); if (error || !req->newptr) return (error); if (!arg1) - return EPERM; + return (EPERM); - error = SYSCTL_IN(req, &val, sizeof(unsigned int)); + error = SYSCTL_IN(req, &val, sizeof(unsigned)); if (error) return (error); /* - * Now make sure the values are decent, and certainly no lower than - * what the USB spec prescribes. + * Make sure the specified value is not too big. Accept any + * value from 0 milliseconds to 2 seconds inclusivly for all + * parameters. */ - unsigned int *p = (unsigned int *)arg1; - if (p == &usb_port_reset_delay) { - if (val < USB_PORT_RESET_DELAY_SPEC) - return (EINVAL); - } else if (p == &usb_port_root_reset_delay) { - if (val < USB_PORT_ROOT_RESET_DELAY_SPEC) - return (EINVAL); - } else if (p == &usb_port_reset_recovery) { - if (val < USB_PORT_RESET_RECOVERY_SPEC) - return (EINVAL); - } else if (p == &usb_port_powerup_delay) { - if (val < USB_PORT_POWERUP_DELAY_SPEC) - return (EINVAL); - } else if (p == &usb_port_resume_delay) { - if (val < USB_PORT_RESUME_DELAY_SPEC) - return (EINVAL); - } else if (p == &usb_set_address_settle) { - if (val < USB_SET_ADDRESS_SETTLE_SPEC) - return (EINVAL); - } else if (p == &usb_resume_delay) { - if (val < USB_RESUME_DELAY_SPEC) - return (EINVAL); - } else if (p == &usb_resume_wait) { - if (val < USB_RESUME_WAIT_SPEC) - return (EINVAL); - } else if (p == &usb_resume_recovery) { - if (val < USB_RESUME_RECOVERY_SPEC) - return (EINVAL); - } else if (p == &usb_extra_power_up_time) { - if (val < USB_EXTRA_POWER_UP_TIME_SPEC) - return (EINVAL); - } else { - /* noop */ - } + if (val > 2000) + return (EINVAL); - *p = val; - return 0; + *(unsigned *)arg1 = val; + return (0); } #endif From owner-dev-commits-src-branches@freebsd.org Wed Jun 2 12:24:55 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0EDDF641A58; Wed, 2 Jun 2021 12:24:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fw7Wp3Zdlz3Fjf; Wed, 2 Jun 2021 12:24:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0F44A1685F; Wed, 2 Jun 2021 12:24:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 152COrv4019207; Wed, 2 Jun 2021 12:24:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 152COrst019206; Wed, 2 Jun 2021 12:24:53 GMT (envelope-from git) Date: Wed, 2 Jun 2021 12:24:53 GMT Message-Id: <202106021224.152COrst019206@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: ad9d0df7c66a - stable/13 - Propagate down USB explore error codes, so that failures to enumerate USB HUBs behind USB HUBs are detected and the USB reset counter logic will kick in preventing enumeration of continuously failing ports. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ad9d0df7c66a02db53f102e87e6f8414e8da67fc Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jun 2021 12:24:55 -0000 The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=ad9d0df7c66a02db53f102e87e6f8414e8da67fc commit ad9d0df7c66a02db53f102e87e6f8414e8da67fc Author: Hans Petter Selasky AuthorDate: 2021-05-18 13:52:00 +0000 Commit: Hans Petter Selasky CommitDate: 2021-06-02 11:25:20 +0000 Propagate down USB explore error codes, so that failures to enumerate USB HUBs behind USB HUBs are detected and the USB reset counter logic will kick in preventing enumeration of continuously failing ports. Submitted by: phk@ Tested by: bz@ PR: 237666 Sponsored by: Mellanox Technologies // NVIDIA Networking (cherry picked from commit e5ff940a81b56cb236795e0059c44981053f8404) --- sys/dev/usb/usb_hub.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/sys/dev/usb/usb_hub.c b/sys/dev/usb/usb_hub.c index 6ed30b64b1e0..52ac0a8a7ff7 100644 --- a/sys/dev/usb/usb_hub.c +++ b/sys/dev/usb/usb_hub.c @@ -513,7 +513,7 @@ uhub_explore_sub(struct uhub_softc *sc, struct usb_port *up) usb_error_t err; bus = sc->sc_udev->bus; - err = 0; + err = USB_ERR_NORMAL_COMPLETION; /* get driver added refcount from USB bus */ refcount = bus->driver_added_refcount; @@ -1013,7 +1013,7 @@ uhub_explore(struct usb_device *udev) if (udev->flags.self_suspended) { /* need to wait until the child signals resume */ DPRINTF("Device is suspended!\n"); - return (0); + return (USB_ERR_NORMAL_COMPLETION); } /* @@ -1022,6 +1022,12 @@ uhub_explore(struct usb_device *udev) */ do_unlock = usbd_enum_lock(udev); + /* + * Set default error code to avoid compiler warnings. + * Note that hub->nports cannot be zero. + */ + err = USB_ERR_NORMAL_COMPLETION; + for (x = 0; x != hub->nports; x++) { up = hub->ports + x; portno = x + 1; @@ -1090,13 +1096,11 @@ uhub_explore(struct usb_device *udev) break; } } - err = uhub_explore_sub(sc, up); - if (err) { - /* no device(s) present */ - continue; + + if (uhub_explore_sub(sc, up) == USB_ERR_NORMAL_COMPLETION) { + /* explore succeeded - reset restart counter */ + up->restartcnt = 0; } - /* explore succeeded - reset restart counter */ - up->restartcnt = 0; } if (do_unlock) @@ -1105,8 +1109,7 @@ uhub_explore(struct usb_device *udev) /* initial status checked */ sc->sc_flags |= UHUB_FLAG_DID_EXPLORE; - /* return success */ - return (USB_ERR_NORMAL_COMPLETION); + return (err); } int From owner-dev-commits-src-branches@freebsd.org Wed Jun 2 12:24:56 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5787E641C66; Wed, 2 Jun 2021 12:24:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fw7Wq32jPz3Fjl; Wed, 2 Jun 2021 12:24:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3E2E116A3F; Wed, 2 Jun 2021 12:24:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 152COtiJ019228; Wed, 2 Jun 2021 12:24:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 152COtA3019227; Wed, 2 Jun 2021 12:24:55 GMT (envelope-from git) Date: Wed, 2 Jun 2021 12:24:55 GMT Message-Id: <202106021224.152COtA3019227@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: c7ed836df315 - stable/13 - Update ugen(4) manual page. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c7ed836df3153950434d79404224e290a3b14a73 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jun 2021 12:24:56 -0000 The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=c7ed836df3153950434d79404224e290a3b14a73 commit c7ed836df3153950434d79404224e290a3b14a73 Author: Hans Petter Selasky AuthorDate: 2021-05-14 14:34:15 +0000 Commit: Hans Petter Selasky CommitDate: 2021-06-02 11:25:20 +0000 Update ugen(4) manual page. Fix description of generic USB character devices. PR: 244842 Sponsored by: Mellanox Technologies // NVIDIA Networking (cherry picked from commit c65e2d7092d6cbaf03721ebe46e51cec4bd6ac0f) --- share/man/man4/ugen.4 | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/share/man/man4/ugen.4 b/share/man/man4/ugen.4 index ad3ba80e0af7..35580e8aa88b 100644 --- a/share/man/man4/ugen.4 +++ b/share/man/man4/ugen.4 @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 24, 2018 +.Dd May 14, 2021 .Dt UGEN 4 .Os .Sh NAME @@ -304,12 +304,19 @@ debug message verbosity. Default is 0. .El .Sh FILES -.Bl -tag -width ".Pa /dev/ugen Ns Ar N Ns Pa \&. Ns Ar E" -compact -.It Pa /dev/ugen Ns Ar N Ns Pa \&. Ns Ar E +.Bl -tag -width "/dev/usb/B.D.E" -compact +.It Pa /dev/usb/B.D.E Endpoint .Ar E of device -.Ar N . +.Ar D +at bus +.Ar B . +.It Pa /dev/ugenB.D +Control endpoint, 0, of device +.Ar D +at bus +.Ar B . .El .Sh SEE ALSO .Xr usb 4 @@ -319,5 +326,3 @@ The driver appeared in .Nx 1.4 . -.\" .Sh BUGS -.\" The driver is not yet finished; there is no access to isochronous endpoints. From owner-dev-commits-src-branches@freebsd.org Wed Jun 2 12:24:56 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CCC9F641C68; Wed, 2 Jun 2021 12:24:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fw7Wr41dNz3FSX; Wed, 2 Jun 2021 12:24:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 65D2A16C54; Wed, 2 Jun 2021 12:24:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 152COuHu019251; Wed, 2 Jun 2021 12:24:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 152COuXv019250; Wed, 2 Jun 2021 12:24:56 GMT (envelope-from git) Date: Wed, 2 Jun 2021 12:24:56 GMT Message-Id: <202106021224.152COuXv019250@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: 4c4416a09805 - stable/13 - Implement own command line option for the frequently used -i usbusX -f Y syntax, -d ugenX.Y, similar to what usbconfig(8) does. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4c4416a0980528ca31efaa8ff63978852c67c03d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jun 2021 12:24:56 -0000 The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=4c4416a0980528ca31efaa8ff63978852c67c03d commit 4c4416a0980528ca31efaa8ff63978852c67c03d Author: Hans Petter Selasky AuthorDate: 2021-05-14 15:12:57 +0000 Commit: Hans Petter Selasky CommitDate: 2021-06-02 11:25:20 +0000 Implement own command line option for the frequently used -i usbusX -f Y syntax, -d ugenX.Y, similar to what usbconfig(8) does. Sponsored by: Mellanox Technologies // NVIDIA Networking (cherry picked from commit c904e20cc903d28c1090c531c907cdd6865455ff) --- usr.sbin/usbdump/usbdump.8 | 30 ++++++++++++++++++++++++- usr.sbin/usbdump/usbdump.c | 56 ++++++++++++++++++++++++++++++++++++++-------- 2 files changed, 76 insertions(+), 10 deletions(-) diff --git a/usr.sbin/usbdump/usbdump.8 b/usr.sbin/usbdump/usbdump.8 index 475e832cd03b..6b5ad1920e94 100644 --- a/usr.sbin/usbdump/usbdump.8 +++ b/usr.sbin/usbdump/usbdump.8 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 24, 2012 +.Dd May 14, 2021 .Dt USBDUMP 8 .Os .Sh NAME @@ -33,6 +33,9 @@ .Nd "dump traffic on USB host controller" .Sh SYNOPSIS .Nm +.Op Fl d Ar [ugen]B +.Op Fl d Ar [ugen]B.D +.Op Fl d Ar [ugen]B.D.E .Op Fl i Ar ifname .Op Fl r Ar file .Op Fl s Ar snaplen @@ -48,6 +51,31 @@ utility provides a way to dump USB packets on host controllers. .Pp The following options are accepted: .Bl -tag -width ".Fl f Ar file" +.It Fl d Ar [ugen]bus +Shortcut for +.Fl i +option. +The argument may be prefixed by "ugen". +The option may be specified multiple times, but the bus specified must +be the same. +.It Fl d Ar [ugen]bus.device +Shortcut for +.Fl i +and +.Fl f +options. +The argument may be prefixed by "ugen". +The option may be specified multiple times, but the bus specified must +be the same. +.It Fl d Ar [ugen]bus.device.endpoint +Shortcut for +.Fl i +and +.Fl f +options. +The argument may be prefixed by "ugen". +The option may be specified multiple times, but the bus specified must +be the same. .It Fl b Ar file Store data part of the USB trace in binary format to the given .Ar file . diff --git a/usr.sbin/usbdump/usbdump.c b/usr.sbin/usbdump/usbdump.c index a38d08a252af..00d3b8e8913b 100644 --- a/usr.sbin/usbdump/usbdump.c +++ b/usr.sbin/usbdump/usbdump.c @@ -108,14 +108,14 @@ struct header_32 { uint8_t align; } __packed; -static int doexit = 0; -static int pkt_captured = 0; -static int verbose = 0; +static int doexit; +static int pkt_captured; +static int verbose; static int uf_minor; -static const char *i_arg = "usbus0"; -static const char *r_arg = NULL; -static const char *w_arg = NULL; -static const char *b_arg = NULL; +static char *i_arg; +static char *r_arg; +static char *w_arg; +static char *b_arg; static struct usbcap uc; static const char *errstr_table[USB_ERR_MAX] = { [USB_ERR_NORMAL_COMPLETION] = "0", @@ -779,7 +779,10 @@ usage(void) #define FMT " %-14s %s\n" fprintf(stderr, "usage: usbdump [options]\n"); - fprintf(stderr, FMT, "-i ", "Listen on USB bus interface"); + fprintf(stderr, FMT, "-d [ugen]B", "Listen on bus, B"); + fprintf(stderr, FMT, "-d [ugen]B.D", "Listen on bus, B and device, D"); + fprintf(stderr, FMT, "-d [ugen]B.D.E", "Listen on bus, B, device, D, and endpoint E"); + fprintf(stderr, FMT, "-i ", "Listen on this bus interface"); fprintf(stderr, FMT, "-f ", "Specify a device and endpoint filter"); fprintf(stderr, FMT, "-r ", "Read the raw packets from file"); fprintf(stderr, FMT, "-s ", "Snapshot bytes from each packet"); @@ -828,9 +831,41 @@ main(int argc, char *argv[]) const char *optstring; char *pp; - optstring = "b:hi:r:s:vw:f:"; + optstring = "b:d:hi:r:s:vw:f:"; while ((o = getopt(argc, argv, optstring)) != -1) { switch (o) { + case 'd': + pp = optarg; + if (pp[0] == 'u' && pp[1] == 'g' && pp[2] == 'e' && pp[3] == 'n') + pp += 4; + ifindex = strtol(pp, &pp, 10); + /* Must be same bus when using -d option. */ + if (i_arg != NULL) { + if (atoi(i_arg + 5) != ifindex) + usage(); + } else { + asprintf(&i_arg, "usbus%d", ifindex); + } + /* Parse unit and endpoint, if any. */ + if (pp != NULL) { + if (*pp == '.') { + filt_unit = strtol(pp + 1, &pp, 10); + filt_ep = -1; + if (pp != NULL) { + if (*pp == '.') { + filt_ep = strtol(pp + 1, &pp, 10); + if (pp != NULL && *pp != 0) + usage(); + } else if (*pp != 0) { + usage(); + } + } + add_filter(filt_unit, filt_ep); + } else if (*pp != 0) { + usage(); + } + } + break; case 'i': i_arg = optarg; break; @@ -879,6 +914,9 @@ main(int argc, char *argv[]) } } + if (i_arg == NULL) + i_arg = "usbus0"; + if (b_arg != NULL) { p->bfd = open(b_arg, O_CREAT | O_TRUNC | O_WRONLY, S_IRUSR | S_IWUSR); From owner-dev-commits-src-branches@freebsd.org Wed Jun 2 12:24:58 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B0D096418FE; Wed, 2 Jun 2021 12:24:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fw7Wt26B0z3Fs9; Wed, 2 Jun 2021 12:24:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8831D16E2F; Wed, 2 Jun 2021 12:24:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 152COvgm019276; Wed, 2 Jun 2021 12:24:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 152COvOO019275; Wed, 2 Jun 2021 12:24:57 GMT (envelope-from git) Date: Wed, 2 Jun 2021 12:24:57 GMT Message-Id: <202106021224.152COvOO019275@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: 303bef2a0797 - stable/13 - cdev_del() should only put it's kernel object in the LinuxKPI. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 303bef2a07974e6573774e04fbdb0e7c8e2f07ca Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jun 2021 12:24:58 -0000 The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=303bef2a07974e6573774e04fbdb0e7c8e2f07ca commit 303bef2a07974e6573774e04fbdb0e7c8e2f07ca Author: Hans Petter Selasky AuthorDate: 2021-05-11 18:51:35 +0000 Commit: Hans Petter Selasky CommitDate: 2021-06-02 11:25:20 +0000 cdev_del() should only put it's kernel object in the LinuxKPI. The destructor takes care of the rest. Sponsored by: Mellanox Technologies // NVIDIA Networking (cherry picked from commit 67807f5066a012254da9a4535c0f225377afb66d) --- sys/compat/linuxkpi/common/include/linux/cdev.h | 4 ---- sys/compat/linuxkpi/common/src/linux_compat.c | 3 ++- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/cdev.h b/sys/compat/linuxkpi/common/include/linux/cdev.h index 2a472da91866..bdfb7e76c9a7 100644 --- a/sys/compat/linuxkpi/common/include/linux/cdev.h +++ b/sys/compat/linuxkpi/common/include/linux/cdev.h @@ -135,13 +135,9 @@ cdev_add_ext(struct linux_cdev *cdev, dev_t dev, uid_t uid, gid_t gid, int mode) return (0); } -void linux_destroy_dev(struct linux_cdev *); - static inline void cdev_del(struct linux_cdev *cdev) { - - linux_destroy_dev(cdev); kobject_put(&cdev->kobj); } diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c b/sys/compat/linuxkpi/common/src/linux_compat.c index 8fe4f4509571..35535eb75abb 100644 --- a/sys/compat/linuxkpi/common/src/linux_compat.c +++ b/sys/compat/linuxkpi/common/src/linux_compat.c @@ -108,6 +108,7 @@ MALLOC_DEFINE(M_KMALLOC, "linux", "Linux kmalloc compat"); #undef cdev #define RB_ROOT(head) (head)->rbh_root +static void linux_destroy_dev(struct linux_cdev *); static void linux_cdev_deref(struct linux_cdev *ldev); static struct vm_area_struct *linux_cdev_handle_find(void *handle); @@ -2234,7 +2235,7 @@ linux_cdev_static_release(struct kobject *kobj) kobject_put(kobj->parent); } -void +static void linux_destroy_dev(struct linux_cdev *ldev) { From owner-dev-commits-src-branches@freebsd.org Wed Jun 2 12:24:59 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 41AFA642042; Wed, 2 Jun 2021 12:24: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 4Fw7Wt6NcDz3FgT; Wed, 2 Jun 2021 12:24:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B288416C55; Wed, 2 Jun 2021 12:24:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 152COwO9019297; Wed, 2 Jun 2021 12:24:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 152COwi8019296; Wed, 2 Jun 2021 12:24:58 GMT (envelope-from git) Date: Wed, 2 Jun 2021 12:24:58 GMT Message-Id: <202106021224.152COwi8019296@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: fba2292d65e0 - stable/13 - Implement cdev_device_add() and cdev_device_del() in the LinuxKPI. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: fba2292d65e04d3a07eb5d089f511f230d344ac8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jun 2021 12:24:59 -0000 The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=fba2292d65e04d3a07eb5d089f511f230d344ac8 commit fba2292d65e04d3a07eb5d089f511f230d344ac8 Author: Hans Petter Selasky AuthorDate: 2021-05-11 18:51:59 +0000 Commit: Hans Petter Selasky CommitDate: 2021-06-02 11:25:20 +0000 Implement cdev_device_add() and cdev_device_del() in the LinuxKPI. Sponsored by: Mellanox Technologies // NVIDIA Networking (cherry picked from commit b8f113cab91f288e5d5e29d21184d1601b87cfdd) --- sys/compat/linuxkpi/common/include/linux/cdev.h | 11 ++++++- sys/compat/linuxkpi/common/src/linux_compat.c | 38 ++++++++++++++++++++++++- 2 files changed, 47 insertions(+), 2 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/cdev.h b/sys/compat/linuxkpi/common/include/linux/cdev.h index bdfb7e76c9a7..39a65472e921 100644 --- a/sys/compat/linuxkpi/common/include/linux/cdev.h +++ b/sys/compat/linuxkpi/common/include/linux/cdev.h @@ -2,7 +2,7 @@ * Copyright (c) 2010 Isilon Systems, Inc. * Copyright (c) 2010 iX Systems, Inc. * Copyright (c) 2010 Panasas, Inc. - * Copyright (c) 2013-2016 Mellanox Technologies, Ltd. + * Copyright (c) 2013-2021 Mellanox Technologies, Ltd. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -38,6 +38,7 @@ #include +struct device; struct file_operations; struct inode; struct module; @@ -143,6 +144,14 @@ cdev_del(struct linux_cdev *cdev) struct linux_cdev *linux_find_cdev(const char *name, unsigned major, unsigned minor); +int linux_cdev_device_add(struct linux_cdev *, struct device *); +void linux_cdev_device_del(struct linux_cdev *, struct device *); + +#define cdev_device_add(...) \ + linux_cdev_device_add(__VA_ARGS__) +#define cdev_device_del(...) \ + linux_cdev_device_del(__VA_ARGS__) + #define cdev linux_cdev #endif /* _LINUX_CDEV_H_ */ diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c b/sys/compat/linuxkpi/common/src/linux_compat.c index 35535eb75abb..0fc0ad702788 100644 --- a/sys/compat/linuxkpi/common/src/linux_compat.c +++ b/sys/compat/linuxkpi/common/src/linux_compat.c @@ -2,7 +2,7 @@ * Copyright (c) 2010 Isilon Systems, Inc. * Copyright (c) 2010 iX Systems, Inc. * Copyright (c) 2010 Panasas, Inc. - * Copyright (c) 2013-2018 Mellanox Technologies, Ltd. + * Copyright (c) 2013-2021 Mellanox Technologies, Ltd. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -2235,6 +2235,42 @@ linux_cdev_static_release(struct kobject *kobj) kobject_put(kobj->parent); } +int +linux_cdev_device_add(struct linux_cdev *ldev, struct device *dev) +{ + int ret; + + if (dev->devt != 0) { + /* Set parent kernel object. */ + ldev->kobj.parent = &dev->kobj; + + /* + * Unlike Linux we require the kobject of the + * character device structure to have a valid name + * before calling this function: + */ + if (ldev->kobj.name == NULL) + return (-EINVAL); + + ret = cdev_add(ldev, dev->devt, 1); + if (ret) + return (ret); + } + ret = device_add(dev); + if (ret != 0 && dev->devt != 0) + cdev_del(ldev); + return (ret); +} + +void +linux_cdev_device_del(struct linux_cdev *ldev, struct device *dev) +{ + device_del(dev); + + if (dev->devt != 0) + cdev_del(ldev); +} + static void linux_destroy_dev(struct linux_cdev *ldev) { From owner-dev-commits-src-branches@freebsd.org Wed Jun 2 12:25:00 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7533F64204B; Wed, 2 Jun 2021 12:25:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fw7Wv7121z3Fvp; Wed, 2 Jun 2021 12:24:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D5D77166F7; Wed, 2 Jun 2021 12:24:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 152COxLf019318; Wed, 2 Jun 2021 12:24:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 152COxtq019317; Wed, 2 Jun 2021 12:24:59 GMT (envelope-from git) Date: Wed, 2 Jun 2021 12:24:59 GMT Message-Id: <202106021224.152COxtq019317@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: 28d95cc69fee - stable/13 - Implement read-only VM_SHARED flag in the LinuxKPI. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 28d95cc69fee30b160418d83bebaf7fddae6058e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jun 2021 12:25:00 -0000 The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=28d95cc69fee30b160418d83bebaf7fddae6058e commit 28d95cc69fee30b160418d83bebaf7fddae6058e Author: Hans Petter Selasky AuthorDate: 2021-05-11 18:49:13 +0000 Commit: Hans Petter Selasky CommitDate: 2021-06-02 11:25:20 +0000 Implement read-only VM_SHARED flag in the LinuxKPI. For use by mmap(2) callbacks. Sponsored by: Mellanox Technologies // NVIDIA Networking (cherry picked from commit 904390b4787d2e4a0d9d8ca9cb0d6da5a4fb320c) --- sys/compat/linuxkpi/common/include/linux/mm.h | 1 + sys/compat/linuxkpi/common/src/linux_compat.c | 14 ++++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/mm.h b/sys/compat/linuxkpi/common/include/linux/mm.h index f6f53afbc8a9..68a0f34acaf3 100644 --- a/sys/compat/linuxkpi/common/include/linux/mm.h +++ b/sys/compat/linuxkpi/common/include/linux/mm.h @@ -63,6 +63,7 @@ CTASSERT((VM_PROT_ALL & -(1 << 8)) == 0); #define VM_DONTCOPY (1 << 14) #define VM_DONTEXPAND (1 << 15) #define VM_DONTDUMP (1 << 16) +#define VM_SHARED (1 << 17) #define VMA_MAX_PREFAULT_RECORD 1 diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c b/sys/compat/linuxkpi/common/src/linux_compat.c index 0fc0ad702788..4337f1f7bbd7 100644 --- a/sys/compat/linuxkpi/common/src/linux_compat.c +++ b/sys/compat/linuxkpi/common/src/linux_compat.c @@ -1226,7 +1226,7 @@ linux_file_kqfilter(struct file *file, struct knote *kn) static int linux_file_mmap_single(struct file *fp, const struct file_operations *fop, vm_ooffset_t *offset, vm_size_t size, struct vm_object **object, - int nprot, struct thread *td) + int nprot, bool is_shared, struct thread *td) { struct task_struct *task; struct vm_area_struct *vmap; @@ -1261,6 +1261,8 @@ linux_file_mmap_single(struct file *fp, const struct file_operations *fop, vmap->vm_pgoff = *offset / PAGE_SIZE; vmap->vm_pfn = 0; vmap->vm_flags = vmap->vm_page_prot = (nprot & VM_PROT_ALL); + if (is_shared) + vmap->vm_flags |= VM_SHARED; vmap->vm_ops = NULL; vmap->vm_file = get_file(filp); vmap->vm_mm = mm; @@ -1595,21 +1597,21 @@ linux_file_ioctl(struct file *fp, u_long cmd, void *data, struct ucred *cred, static int linux_file_mmap_sub(struct thread *td, vm_size_t objsize, vm_prot_t prot, - vm_prot_t *maxprotp, int *flagsp, struct file *fp, + vm_prot_t maxprot, int flags, struct file *fp, vm_ooffset_t *foff, const struct file_operations *fop, vm_object_t *objp) { /* * Character devices do not provide private mappings * of any kind: */ - if ((*maxprotp & VM_PROT_WRITE) == 0 && + if ((maxprot & VM_PROT_WRITE) == 0 && (prot & VM_PROT_WRITE) != 0) return (EACCES); - if ((*flagsp & (MAP_PRIVATE | MAP_COPY)) != 0) + if ((flags & (MAP_PRIVATE | MAP_COPY)) != 0) return (EINVAL); return (linux_file_mmap_single(fp, fop, foff, objsize, objp, - (int)prot, td)); + (int)prot, (flags & MAP_SHARED) ? true : false, td)); } static int @@ -1667,7 +1669,7 @@ linux_file_mmap(struct file *fp, vm_map_t map, vm_offset_t *addr, vm_size_t size maxprot &= cap_maxprot; linux_get_fop(filp, &fop, &ldev); - error = linux_file_mmap_sub(td, size, prot, &maxprot, &flags, fp, + error = linux_file_mmap_sub(td, size, prot, maxprot, flags, fp, &foff, fop, &object); if (error != 0) goto out; From owner-dev-commits-src-branches@freebsd.org Wed Jun 2 12:25:02 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5A069641A71; Wed, 2 Jun 2021 12:25:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fw7Wx2kmdz3FmV; Wed, 2 Jun 2021 12:25:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0469B16BE6; Wed, 2 Jun 2021 12:25:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 152CP0tc019345; Wed, 2 Jun 2021 12:25:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 152CP0lc019344; Wed, 2 Jun 2021 12:25:00 GMT (envelope-from git) Date: Wed, 2 Jun 2021 12:25:00 GMT Message-Id: <202106021225.152CP0lc019344@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: e31579b8558d - stable/13 - Add TCP LRO support for VLAN and VxLAN. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e31579b8558db508dfc3f8fc276611a7c3c93aa1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jun 2021 12:25:02 -0000 The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=e31579b8558db508dfc3f8fc276611a7c3c93aa1 commit e31579b8558db508dfc3f8fc276611a7c3c93aa1 Author: Hans Petter Selasky AuthorDate: 2021-03-31 10:36:36 +0000 Commit: Hans Petter Selasky CommitDate: 2021-06-02 11:55:45 +0000 Add TCP LRO support for VLAN and VxLAN. This change makes the TCP LRO code more generic and flexible with regards to supporting multiple different TCP encapsulation protocols and in general lays the ground for broader TCP LRO support. The main job of the TCP LRO code is to merge TCP packets for the same flow, to reduce the number of calls to upper layers. This reduces CPU and increases performance, due to being able to send larger TSO offloaded data chunks at a time. Basically the TCP LRO makes it possible to avoid per-packet interaction by the host CPU. Because the current TCP LRO code was tightly bound and optimized for TCP/IP over ethernet only, several larger changes were needed. Also a minor bug was fixed in the flushing mechanism for inactive entries, where the expire time, "le->mtime" was not always properly set. To avoid having to re-run time consuming regression tests for every change, it was chosen to squash the following list of changes into a single commit: - Refactor parsing of all address information into the "lro_parser" structure. This easily allows to reuse parsing code for inner headers. - Speedup header data comparison. Don't compare field by field, but instead use an unsigned long array, where the fields get packed. - Refactor the IPv4/TCP/UDP checksum computations, so that they may be computed recursivly, only applying deltas as the result of updating payload data. - Make smaller inline functions doing one operation at a time instead of big functions having repeated code. - Refactor the TCP ACK compression code to only execute once per TCP LRO flush. This gives a minor performance improvement and keeps the code simple. - Use sbintime() for all time-keeping. This change also fixes flushing of inactive entries. - Try to shrink the size of the LRO entry, because it is frequently zeroed. - Removed unused TCP LRO macros. - Cleanup unused TCP LRO statistics counters while at it. - Try to use __predict_true() and predict_false() to optimise CPU branch predictions. Bump the __FreeBSD_version due to adding new member to the "lro_ctrl" structure. Tested by: Netflix Reviewed by: rrs (transport) Differential Revision: https://reviews.freebsd.org/D29564 Sponsored by: Mellanox Technologies // NVIDIA Networking (cherry picked from commit 9ca874cf740ee68c5742df8b5f9e20910085c011) --- sys/netinet/in_pcb.h | 4 +- sys/netinet/tcp_lro.c | 1829 +++++++++++++++++++++++++++++------------------- sys/netinet/tcp_lro.h | 151 ++-- sys/netinet/tcp_subr.c | 2 - sys/netinet/tcp_var.h | 2 - sys/sys/mbuf.h | 6 +- sys/sys/param.h | 2 +- 7 files changed, 1244 insertions(+), 752 deletions(-) diff --git a/sys/netinet/in_pcb.h b/sys/netinet/in_pcb.h index 080d07cc7218..9604a837cfb4 100644 --- a/sys/netinet/in_pcb.h +++ b/sys/netinet/in_pcb.h @@ -731,8 +731,8 @@ int inp_so_options(const struct inpcb *inp); /* * Flags for inp_flags2. */ -#define INP_2UNUSED1 0x00000001 -#define INP_2UNUSED2 0x00000002 +#define INP_MBUF_L_ACKS 0x00000001 /* We need large mbufs for ack compression */ +#define INP_MBUF_ACKCMP 0x00000002 /* TCP mbuf ack compression ok */ #define INP_PCBGROUPWILD 0x00000004 /* in pcbgroup wildcard list */ #define INP_REUSEPORT 0x00000008 /* SO_REUSEPORT option is set */ #define INP_FREED 0x00000010 /* inp itself is not valid */ diff --git a/sys/netinet/tcp_lro.c b/sys/netinet/tcp_lro.c index baa2fe522e90..09fc024c3d73 100644 --- a/sys/netinet/tcp_lro.c +++ b/sys/netinet/tcp_lro.c @@ -4,7 +4,7 @@ * Copyright (c) 2007, Myricom Inc. * Copyright (c) 2008, Intel Corporation. * Copyright (c) 2012 The FreeBSD Foundation - * Copyright (c) 2016 Mellanox Technologies. + * Copyright (c) 2016-2021 Mellanox Technologies. * All rights reserved. * * Portions of this software were developed by Bjoern Zeeb @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -64,54 +65,64 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include +#include #include #include static MALLOC_DEFINE(M_LRO, "LRO", "LRO control structures"); -#define TCP_LRO_UPDATE_CSUM 1 -#ifndef TCP_LRO_UPDATE_CSUM -#define TCP_LRO_INVALID_CSUM 0x0000 -#endif +#define TCP_LRO_TS_OPTION \ + ntohl((TCPOPT_NOP << 24) | (TCPOPT_NOP << 16) | \ + (TCPOPT_TIMESTAMP << 8) | TCPOLEN_TIMESTAMP) static void tcp_lro_rx_done(struct lro_ctrl *lc); -static int tcp_lro_rx2(struct lro_ctrl *lc, struct mbuf *m, - uint32_t csum, int use_hash); +static int tcp_lro_rx_common(struct lro_ctrl *lc, struct mbuf *m, + uint32_t csum, bool use_hash); + +#ifdef TCPHPTS +static bool do_bpf_strip_and_compress(struct inpcb *, struct lro_ctrl *, + struct lro_entry *, struct mbuf **, struct mbuf **, struct mbuf **, bool *, bool); + +#endif SYSCTL_NODE(_net_inet_tcp, OID_AUTO, lro, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "TCP LRO"); -static long tcplro_stacks_wanting_mbufq = 0; +static long tcplro_stacks_wanting_mbufq; counter_u64_t tcp_inp_lro_direct_queue; counter_u64_t tcp_inp_lro_wokeup_queue; counter_u64_t tcp_inp_lro_compressed; -counter_u64_t tcp_inp_lro_single_push; counter_u64_t tcp_inp_lro_locks_taken; -counter_u64_t tcp_inp_lro_sack_wake; +counter_u64_t tcp_extra_mbuf; +counter_u64_t tcp_would_have_but; +counter_u64_t tcp_comp_total; +counter_u64_t tcp_uncomp_total; static unsigned tcp_lro_entries = TCP_LRO_ENTRIES; -static int32_t hold_lock_over_compress = 0; -SYSCTL_INT(_net_inet_tcp_lro, OID_AUTO, hold_lock, CTLFLAG_RW, - &hold_lock_over_compress, 0, - "Do we hold the lock over the compress of mbufs?"); SYSCTL_UINT(_net_inet_tcp_lro, OID_AUTO, entries, CTLFLAG_RDTUN | CTLFLAG_MPSAFE, &tcp_lro_entries, 0, "default number of LRO entries"); + SYSCTL_COUNTER_U64(_net_inet_tcp_lro, OID_AUTO, fullqueue, CTLFLAG_RD, &tcp_inp_lro_direct_queue, "Number of lro's fully queued to transport"); SYSCTL_COUNTER_U64(_net_inet_tcp_lro, OID_AUTO, wokeup, CTLFLAG_RD, &tcp_inp_lro_wokeup_queue, "Number of lro's where we woke up transport via hpts"); SYSCTL_COUNTER_U64(_net_inet_tcp_lro, OID_AUTO, compressed, CTLFLAG_RD, &tcp_inp_lro_compressed, "Number of lro's compressed and sent to transport"); -SYSCTL_COUNTER_U64(_net_inet_tcp_lro, OID_AUTO, single, CTLFLAG_RD, - &tcp_inp_lro_single_push, "Number of lro's sent with single segment"); SYSCTL_COUNTER_U64(_net_inet_tcp_lro, OID_AUTO, lockcnt, CTLFLAG_RD, &tcp_inp_lro_locks_taken, "Number of lro's inp_wlocks taken"); -SYSCTL_COUNTER_U64(_net_inet_tcp_lro, OID_AUTO, sackwakeups, CTLFLAG_RD, - &tcp_inp_lro_sack_wake, "Number of wakeups caused by sack/fin"); +SYSCTL_COUNTER_U64(_net_inet_tcp_lro, OID_AUTO, extra_mbuf, CTLFLAG_RD, + &tcp_extra_mbuf, "Number of times we had an extra compressed ack dropped into the tp"); +SYSCTL_COUNTER_U64(_net_inet_tcp_lro, OID_AUTO, would_have_but, CTLFLAG_RD, + &tcp_would_have_but, "Number of times we would have had an extra compressed, but mget failed"); +SYSCTL_COUNTER_U64(_net_inet_tcp_lro, OID_AUTO, with_m_ackcmp, CTLFLAG_RD, + &tcp_comp_total, "Number of mbufs queued with M_ACKCMP flags set"); +SYSCTL_COUNTER_U64(_net_inet_tcp_lro, OID_AUTO, without_m_ackcmp, CTLFLAG_RD, + &tcp_uncomp_total, "Number of mbufs queued without M_ACKCMP"); void tcp_lro_reg_mbufq(void) @@ -203,34 +214,243 @@ tcp_lro_init_args(struct lro_ctrl *lc, struct ifnet *ifp, return (0); } -static struct tcphdr * -tcp_lro_get_th(struct lro_entry *le, struct mbuf *m) +struct vxlan_header { + uint32_t vxlh_flags; + uint32_t vxlh_vni; +}; + +static inline void * +tcp_lro_low_level_parser(void *ptr, struct lro_parser *parser, bool update_data, bool is_vxlan) { - struct ether_header *eh; - struct tcphdr *th = NULL; -#ifdef INET6 - struct ip6_hdr *ip6 = NULL; /* Keep compiler happy. */ -#endif + const struct ether_vlan_header *eh; + void *old; + uint16_t eth_type; + + if (update_data) + memset(parser, 0, sizeof(*parser)); + + old = ptr; + + if (is_vxlan) { + const struct vxlan_header *vxh; + vxh = ptr; + ptr = (uint8_t *)ptr + sizeof(*vxh); + if (update_data) { + parser->data.vxlan_vni = + vxh->vxlh_vni & htonl(0xffffff00); + } + } + + eh = ptr; + if (__predict_false(eh->evl_encap_proto == htons(ETHERTYPE_VLAN))) { + eth_type = eh->evl_proto; + if (update_data) { + /* strip priority and keep VLAN ID only */ + parser->data.vlan_id = eh->evl_tag & htons(EVL_VLID_MASK); + } + /* advance to next header */ + ptr = (uint8_t *)ptr + ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN; + } else { + eth_type = eh->evl_encap_proto; + /* advance to next header */ + ptr = (uint8_t *)ptr + ETHER_HDR_LEN; + } + + switch (eth_type) { #ifdef INET - struct ip *ip4 = NULL; /* Keep compiler happy. */ + case htons(ETHERTYPE_IP): + parser->ip4 = ptr; + /* Ensure there are no IPv4 options. */ + if ((parser->ip4->ip_hl << 2) != sizeof (*parser->ip4)) + break; + /* .. and the packet is not fragmented. */ + if (parser->ip4->ip_off & htons(IP_MF|IP_OFFMASK)) + break; + ptr = (uint8_t *)ptr + (parser->ip4->ip_hl << 2); + if (update_data) { + parser->data.s_addr.v4 = parser->ip4->ip_src; + parser->data.d_addr.v4 = parser->ip4->ip_dst; + } + switch (parser->ip4->ip_p) { + case IPPROTO_UDP: + parser->udp = ptr; + if (update_data) { + parser->data.lro_type = LRO_TYPE_IPV4_UDP; + parser->data.s_port = parser->udp->uh_sport; + parser->data.d_port = parser->udp->uh_dport; + } else { + MPASS(parser->data.lro_type == LRO_TYPE_IPV4_UDP); + } + ptr = ((uint8_t *)ptr + sizeof(*parser->udp)); + parser->total_hdr_len = (uint8_t *)ptr - (uint8_t *)old; + return (ptr); + case IPPROTO_TCP: + parser->tcp = ptr; + if (update_data) { + parser->data.lro_type = LRO_TYPE_IPV4_TCP; + parser->data.s_port = parser->tcp->th_sport; + parser->data.d_port = parser->tcp->th_dport; + } else { + MPASS(parser->data.lro_type == LRO_TYPE_IPV4_TCP); + } + ptr = (uint8_t *)ptr + (parser->tcp->th_off << 2); + parser->total_hdr_len = (uint8_t *)ptr - (uint8_t *)old; + return (ptr); + default: + break; + } + break; #endif - - eh = mtod(m, struct ether_header *); - switch (le->eh_type) { #ifdef INET6 - case ETHERTYPE_IPV6: - ip6 = (struct ip6_hdr *)(eh + 1); - th = (struct tcphdr *)(ip6 + 1); + case htons(ETHERTYPE_IPV6): + parser->ip6 = ptr; + ptr = (uint8_t *)ptr + sizeof(*parser->ip6); + if (update_data) { + parser->data.s_addr.v6 = parser->ip6->ip6_src; + parser->data.d_addr.v6 = parser->ip6->ip6_dst; + } + switch (parser->ip6->ip6_nxt) { + case IPPROTO_UDP: + parser->udp = ptr; + if (update_data) { + parser->data.lro_type = LRO_TYPE_IPV6_UDP; + parser->data.s_port = parser->udp->uh_sport; + parser->data.d_port = parser->udp->uh_dport; + } else { + MPASS(parser->data.lro_type == LRO_TYPE_IPV6_UDP); + } + ptr = (uint8_t *)ptr + sizeof(*parser->udp); + parser->total_hdr_len = (uint8_t *)ptr - (uint8_t *)old; + return (ptr); + case IPPROTO_TCP: + parser->tcp = ptr; + if (update_data) { + parser->data.lro_type = LRO_TYPE_IPV6_TCP; + parser->data.s_port = parser->tcp->th_sport; + parser->data.d_port = parser->tcp->th_dport; + } else { + MPASS(parser->data.lro_type == LRO_TYPE_IPV6_TCP); + } + ptr = (uint8_t *)ptr + (parser->tcp->th_off << 2); + parser->total_hdr_len = (uint8_t *)ptr - (uint8_t *)old; + return (ptr); + default: + break; + } break; #endif + default: + break; + } + /* Invalid packet - cannot parse */ + return (NULL); +} + +static const int vxlan_csum = CSUM_INNER_L3_CALC | CSUM_INNER_L3_VALID | + CSUM_INNER_L4_CALC | CSUM_INNER_L4_VALID; + +static inline struct lro_parser * +tcp_lro_parser(struct mbuf *m, struct lro_parser *po, struct lro_parser *pi, bool update_data) +{ + void *data_ptr; + + /* Try to parse outer headers first. */ + data_ptr = tcp_lro_low_level_parser(m->m_data, po, update_data, false); + if (data_ptr == NULL || po->total_hdr_len > m->m_len) + return (NULL); + + if (update_data) { + /* Store VLAN ID, if any. */ + if (__predict_false(m->m_flags & M_VLANTAG)) { + po->data.vlan_id = + htons(m->m_pkthdr.ether_vtag) & htons(EVL_VLID_MASK); + } + } + + switch (po->data.lro_type) { + case LRO_TYPE_IPV4_UDP: + case LRO_TYPE_IPV6_UDP: + /* Check for VXLAN headers. */ + if ((m->m_pkthdr.csum_flags & vxlan_csum) != vxlan_csum) + break; + + /* Try to parse inner headers. */ + data_ptr = tcp_lro_low_level_parser(data_ptr, pi, update_data, true); + if (data_ptr == NULL || pi->total_hdr_len > m->m_len) + break; + + /* Verify supported header types. */ + switch (pi->data.lro_type) { + case LRO_TYPE_IPV4_TCP: + case LRO_TYPE_IPV6_TCP: + return (pi); + default: + break; + } + break; + case LRO_TYPE_IPV4_TCP: + case LRO_TYPE_IPV6_TCP: + if (update_data) + memset(pi, 0, sizeof(*pi)); + return (po); + default: + break; + } + return (NULL); +} + +static inline int +tcp_lro_trim_mbuf_chain(struct mbuf *m, const struct lro_parser *po) +{ + int len; + + switch (po->data.lro_type) { #ifdef INET - case ETHERTYPE_IP: - ip4 = (struct ip *)(eh + 1); - th = (struct tcphdr *)(ip4 + 1); + case LRO_TYPE_IPV4_TCP: + len = ((uint8_t *)po->ip4 - (uint8_t *)m->m_data) + + ntohs(po->ip4->ip_len); + break; +#endif +#ifdef INET6 + case LRO_TYPE_IPV6_TCP: + len = ((uint8_t *)po->ip6 - (uint8_t *)m->m_data) + + ntohs(po->ip6->ip6_plen) + sizeof(*po->ip6); break; #endif + default: + return (TCP_LRO_CANNOT); + } + + /* + * If the frame is padded beyond the end of the IP packet, + * then trim the extra bytes off: + */ + if (__predict_true(m->m_pkthdr.len == len)) { + return (0); + } else if (m->m_pkthdr.len > len) { + m_adj(m, len - m->m_pkthdr.len); + return (0); + } + return (TCP_LRO_CANNOT); +} + +static struct tcphdr * +tcp_lro_get_th(struct mbuf *m) +{ + return ((struct tcphdr *)((uint8_t *)m->m_data + m->m_pkthdr.lro_tcp_h_off)); +} + +static void +lro_free_mbuf_chain(struct mbuf *m) +{ + struct mbuf *save; + + while (m) { + save = m->m_nextpkt; + m->m_nextpkt = NULL; + m_freem(m); + m = save; } - return (th); } void @@ -245,7 +465,7 @@ tcp_lro_free(struct lro_ctrl *lc) /* free active mbufs, if any */ while ((le = LIST_FIRST(&lc->lro_active)) != NULL) { tcp_lro_active_remove(le); - m_freem(le->m_head); + lro_free_mbuf_chain(le->m_head); } /* free hash table */ @@ -264,86 +484,67 @@ tcp_lro_free(struct lro_ctrl *lc) } static uint16_t -tcp_lro_csum_th(struct tcphdr *th) +tcp_lro_rx_csum_tcphdr(const struct tcphdr *th) { - uint32_t ch; - uint16_t *p, l; - - ch = th->th_sum = 0x0000; - l = th->th_off; - p = (uint16_t *)th; - while (l > 0) { - ch += *p; - p++; - ch += *p; - p++; - l--; + const uint16_t *ptr; + uint32_t csum; + uint16_t len; + + csum = -th->th_sum; /* exclude checksum field */ + len = th->th_off; + ptr = (const uint16_t *)th; + while (len--) { + csum += *ptr; + ptr++; + csum += *ptr; + ptr++; } - while (ch > 0xffff) - ch = (ch >> 16) + (ch & 0xffff); + while (csum > 0xffff) + csum = (csum >> 16) + (csum & 0xffff); - return (ch & 0xffff); + return (csum); } static uint16_t -tcp_lro_rx_csum_fixup(struct lro_entry *le, void *l3hdr, struct tcphdr *th, - uint16_t tcp_data_len, uint16_t csum) +tcp_lro_rx_csum_data(const struct lro_parser *pa, uint16_t tcp_csum) { uint32_t c; uint16_t cs; - c = csum; + c = tcp_csum; - /* Remove length from checksum. */ - switch (le->eh_type) { + switch (pa->data.lro_type) { #ifdef INET6 - case ETHERTYPE_IPV6: - { - struct ip6_hdr *ip6; - - ip6 = (struct ip6_hdr *)l3hdr; - if (le->append_cnt == 0) - cs = ip6->ip6_plen; - else { - uint32_t cx; - - cx = ntohs(ip6->ip6_plen); - cs = in6_cksum_pseudo(ip6, cx, ip6->ip6_nxt, 0); - } + case LRO_TYPE_IPV6_TCP: + /* Compute full pseudo IPv6 header checksum. */ + cs = in6_cksum_pseudo(pa->ip6, ntohs(pa->ip6->ip6_plen), pa->ip6->ip6_nxt, 0); break; - } #endif #ifdef INET - case ETHERTYPE_IP: - { - struct ip *ip4; - - ip4 = (struct ip *)l3hdr; - if (le->append_cnt == 0) - cs = ip4->ip_len; - else { - cs = in_addword(ntohs(ip4->ip_len) - sizeof(*ip4), - IPPROTO_TCP); - cs = in_pseudo(ip4->ip_src.s_addr, ip4->ip_dst.s_addr, - htons(cs)); - } + case LRO_TYPE_IPV4_TCP: + /* Compute full pseudo IPv4 header checsum. */ + cs = in_addword(ntohs(pa->ip4->ip_len) - sizeof(*pa->ip4), IPPROTO_TCP); + cs = in_pseudo(pa->ip4->ip_src.s_addr, pa->ip4->ip_dst.s_addr, htons(cs)); break; - } #endif default: cs = 0; /* Keep compiler happy. */ + break; } + /* Complement checksum. */ cs = ~cs; c += cs; - /* Remove TCP header csum. */ - cs = ~tcp_lro_csum_th(th); + /* Remove TCP header checksum. */ + cs = ~tcp_lro_rx_csum_tcphdr(pa->tcp); c += cs; + + /* Compute checksum remainder. */ while (c > 0xffff) c = (c >> 16) + (c & 0xffff); - return (c & 0xffff); + return (c); } static void @@ -361,83 +562,51 @@ void tcp_lro_flush_inactive(struct lro_ctrl *lc, const struct timeval *timeout) { struct lro_entry *le, *le_tmp; - struct timeval tv; + sbintime_t sbt; if (LIST_EMPTY(&lc->lro_active)) return; - getmicrouptime(&tv); - timevalsub(&tv, timeout); + /* get timeout time */ + sbt = getsbinuptime() - tvtosbt(*timeout); + LIST_FOREACH_SAFE(le, &lc->lro_active, next, le_tmp) { - if (timevalcmp(&tv, &le->mtime, >=)) { + if (sbt >= le->alloc_time) { tcp_lro_active_remove(le); tcp_lro_flush(lc, le); } } } -#ifdef INET6 -static int -tcp_lro_rx_ipv6(struct lro_ctrl *lc, struct mbuf *m, struct ip6_hdr *ip6, - struct tcphdr **th) -{ - - /* XXX-BZ we should check the flow-label. */ - - /* XXX-BZ We do not yet support ext. hdrs. */ - if (ip6->ip6_nxt != IPPROTO_TCP) - return (TCP_LRO_NOT_SUPPORTED); - - /* Find the TCP header. */ - *th = (struct tcphdr *)(ip6 + 1); - - return (0); -} -#endif - #ifdef INET static int -tcp_lro_rx_ipv4(struct lro_ctrl *lc, struct mbuf *m, struct ip *ip4, - struct tcphdr **th) +tcp_lro_rx_ipv4(struct lro_ctrl *lc, struct mbuf *m, struct ip *ip4) { - int csum_flags; uint16_t csum; - if (ip4->ip_p != IPPROTO_TCP) - return (TCP_LRO_NOT_SUPPORTED); - - /* Ensure there are no options. */ - if ((ip4->ip_hl << 2) != sizeof (*ip4)) - return (TCP_LRO_CANNOT); - - /* .. and the packet is not fragmented. */ - if (ip4->ip_off & htons(IP_MF|IP_OFFMASK)) - return (TCP_LRO_CANNOT); - /* Legacy IP has a header checksum that needs to be correct. */ - csum_flags = m->m_pkthdr.csum_flags; - if (csum_flags & CSUM_IP_CHECKED) { - if (__predict_false((csum_flags & CSUM_IP_VALID) == 0)) { + if (m->m_pkthdr.csum_flags & CSUM_IP_CHECKED) { + if (__predict_false((m->m_pkthdr.csum_flags & CSUM_IP_VALID) == 0)) { lc->lro_bad_csum++; return (TCP_LRO_CANNOT); } } else { csum = in_cksum_hdr(ip4); - if (__predict_false((csum) != 0)) { + if (__predict_false(csum != 0)) { lc->lro_bad_csum++; return (TCP_LRO_CANNOT); } } - /* Find the TCP header (we assured there are no IP options). */ - *th = (struct tcphdr *)(ip4 + 1); return (0); } #endif +#ifdef TCPHPTS static void -tcp_lro_log(struct tcpcb *tp, struct lro_ctrl *lc, - struct lro_entry *le, struct mbuf *m, int frm, int32_t tcp_data_len, - uint32_t th_seq , uint32_t th_ack, uint16_t th_win) +tcp_lro_log(struct tcpcb *tp, const struct lro_ctrl *lc, + const struct lro_entry *le, const struct mbuf *m, + int frm, int32_t tcp_data_len, uint32_t th_seq, + uint32_t th_ack, uint16_t th_win) { if (tp->t_logstate != TCP_LOG_STATE_OFF) { union tcp_log_stackspecific log; @@ -452,13 +621,13 @@ tcp_lro_log(struct tcpcb *tp, struct lro_ctrl *lc, log.u_bbr.flex2 = m->m_pkthdr.len; else log.u_bbr.flex2 = 0; - log.u_bbr.flex3 = le->append_cnt; - log.u_bbr.flex4 = le->p_len; - log.u_bbr.flex5 = le->m_head->m_pkthdr.len; - log.u_bbr.delRate = le->m_head->m_flags; - log.u_bbr.rttProp = le->m_head->m_pkthdr.rcv_tstmp; - log.u_bbr.flex6 = lc->lro_length_lim; - log.u_bbr.flex7 = lc->lro_ackcnt_lim; + log.u_bbr.flex3 = le->m_head->m_pkthdr.lro_nsegs; + log.u_bbr.flex4 = le->m_head->m_pkthdr.lro_tcp_d_len; + if (le->m_head) { + log.u_bbr.flex5 = le->m_head->m_pkthdr.len; + log.u_bbr.delRate = le->m_head->m_flags; + log.u_bbr.rttProp = le->m_head->m_pkthdr.rcv_tstmp; + } log.u_bbr.inflight = th_seq; log.u_bbr.timeStamp = cts; log.u_bbr.epoch = le->next_seq; @@ -468,9 +637,13 @@ tcp_lro_log(struct tcpcb *tp, struct lro_ctrl *lc, log.u_bbr.cwnd_gain = le->window; log.u_bbr.cur_del_rate = (uintptr_t)m; log.u_bbr.bw_inuse = (uintptr_t)le->m_head; - log.u_bbr.pkts_out = le->mbuf_cnt; /* Total mbufs added */ - log.u_bbr.applimited = le->ulp_csum; - log.u_bbr.lost = le->mbuf_appended; + log.u_bbr.flex6 = sbttous(lc->lro_last_queue_time); + log.u_bbr.flex7 = le->compressed; + log.u_bbr.pacing_gain = le->uncompressed; + if (in_epoch(net_epoch_preempt)) + log.u_bbr.inhpts = 1; + else + log.u_bbr.inhpts = 0; TCP_LOG_EVENTP(tp, NULL, &tp->t_inpcb->inp_socket->so_rcv, &tp->t_inpcb->inp_socket->so_snd, @@ -478,205 +651,294 @@ tcp_lro_log(struct tcpcb *tp, struct lro_ctrl *lc, 0, &log, false, &tv); } } +#endif -static void -tcp_flush_out_le(struct tcpcb *tp, struct lro_ctrl *lc, struct lro_entry *le, int locked) +static inline void +tcp_lro_assign_and_checksum_16(uint16_t *ptr, uint16_t value, uint16_t *psum) { - if (le->append_cnt > 1) { - struct tcphdr *th; - uint16_t p_len; + uint32_t csum; - p_len = htons(le->p_len); - switch (le->eh_type) { -#ifdef INET6 - case ETHERTYPE_IPV6: - { - struct ip6_hdr *ip6; + csum = 0xffff - *ptr + value; + while (csum > 0xffff) + csum = (csum >> 16) + (csum & 0xffff); + *ptr = value; + *psum = csum; +} + +static uint16_t +tcp_lro_update_checksum(const struct lro_parser *pa, const struct lro_entry *le, + uint16_t payload_len, uint16_t delta_sum) +{ + uint32_t csum; + uint16_t tlen; + uint16_t temp[5] = {}; + + switch (pa->data.lro_type) { + case LRO_TYPE_IPV4_TCP: + /* Compute new IPv4 length. */ + tlen = (pa->ip4->ip_hl << 2) + (pa->tcp->th_off << 2) + payload_len; + tcp_lro_assign_and_checksum_16(&pa->ip4->ip_len, htons(tlen), &temp[0]); + + /* Subtract delta from current IPv4 checksum. */ + csum = pa->ip4->ip_sum + 0xffff - temp[0]; + while (csum > 0xffff) + csum = (csum >> 16) + (csum & 0xffff); + tcp_lro_assign_and_checksum_16(&pa->ip4->ip_sum, csum, &temp[1]); + goto update_tcp_header; + + case LRO_TYPE_IPV6_TCP: + /* Compute new IPv6 length. */ + tlen = (pa->tcp->th_off << 2) + payload_len; + tcp_lro_assign_and_checksum_16(&pa->ip6->ip6_plen, htons(tlen), &temp[0]); + goto update_tcp_header; + + case LRO_TYPE_IPV4_UDP: + /* Compute new IPv4 length. */ + tlen = (pa->ip4->ip_hl << 2) + sizeof(*pa->udp) + payload_len; + tcp_lro_assign_and_checksum_16(&pa->ip4->ip_len, htons(tlen), &temp[0]); + + /* Subtract delta from current IPv4 checksum. */ + csum = pa->ip4->ip_sum + 0xffff - temp[0]; + while (csum > 0xffff) + csum = (csum >> 16) + (csum & 0xffff); + tcp_lro_assign_and_checksum_16(&pa->ip4->ip_sum, csum, &temp[1]); + goto update_udp_header; + + case LRO_TYPE_IPV6_UDP: + /* Compute new IPv6 length. */ + tlen = sizeof(*pa->udp) + payload_len; + tcp_lro_assign_and_checksum_16(&pa->ip6->ip6_plen, htons(tlen), &temp[0]); + goto update_udp_header; + + default: + return (0); + } + +update_tcp_header: + /* Compute current TCP header checksum. */ + temp[2] = tcp_lro_rx_csum_tcphdr(pa->tcp); + + /* Incorporate the latest ACK into the TCP header. */ + pa->tcp->th_ack = le->ack_seq; + pa->tcp->th_win = le->window; - ip6 = le->le_ip6; - ip6->ip6_plen = p_len; - th = (struct tcphdr *)(ip6 + 1); + /* Incorporate latest timestamp into the TCP header. */ + if (le->timestamp != 0) { + uint32_t *ts_ptr; + + ts_ptr = (uint32_t *)(pa->tcp + 1); + ts_ptr[1] = htonl(le->tsval); + ts_ptr[2] = le->tsecr; + } + + /* Compute new TCP header checksum. */ + temp[3] = tcp_lro_rx_csum_tcphdr(pa->tcp); + + /* Compute new TCP checksum. */ + csum = pa->tcp->th_sum + 0xffff - delta_sum + + 0xffff - temp[0] + 0xffff - temp[3] + temp[2]; + while (csum > 0xffff) + csum = (csum >> 16) + (csum & 0xffff); + + /* Assign new TCP checksum. */ + tcp_lro_assign_and_checksum_16(&pa->tcp->th_sum, csum, &temp[4]); + + /* Compute all modififications affecting next checksum. */ + csum = temp[0] + temp[1] + 0xffff - temp[2] + + temp[3] + temp[4] + delta_sum; + while (csum > 0xffff) + csum = (csum >> 16) + (csum & 0xffff); + + /* Return delta checksum to next stage, if any. */ + return (csum); + +update_udp_header: + tlen = sizeof(*pa->udp) + payload_len; + /* Assign new UDP length and compute checksum delta. */ + tcp_lro_assign_and_checksum_16(&pa->udp->uh_ulen, htons(tlen), &temp[2]); + + /* Check if there is a UDP checksum. */ + if (__predict_false(pa->udp->uh_sum != 0)) { + /* Compute new UDP checksum. */ + csum = pa->udp->uh_sum + 0xffff - delta_sum + + 0xffff - temp[0] + 0xffff - temp[2]; + while (csum > 0xffff) + csum = (csum >> 16) + (csum & 0xffff); + /* Assign new UDP checksum. */ + tcp_lro_assign_and_checksum_16(&pa->udp->uh_sum, csum, &temp[3]); + } + + /* Compute all modififications affecting next checksum. */ + csum = temp[0] + temp[1] + temp[2] + temp[3] + delta_sum; + while (csum > 0xffff) + csum = (csum >> 16) + (csum & 0xffff); + + /* Return delta checksum to next stage, if any. */ + return (csum); +} + +static void +tcp_flush_out_entry(struct lro_ctrl *lc, struct lro_entry *le) +{ + /* Check if we need to recompute any checksums. */ + if (le->m_head->m_pkthdr.lro_nsegs > 1) { + uint16_t csum; + + switch (le->inner.data.lro_type) { + case LRO_TYPE_IPV4_TCP: + csum = tcp_lro_update_checksum(&le->inner, le, + le->m_head->m_pkthdr.lro_tcp_d_len, + le->m_head->m_pkthdr.lro_tcp_d_csum); + csum = tcp_lro_update_checksum(&le->outer, NULL, + le->m_head->m_pkthdr.lro_tcp_d_len + + le->inner.total_hdr_len, csum); le->m_head->m_pkthdr.csum_flags = CSUM_DATA_VALID | - CSUM_PSEUDO_HDR; - le->p_len += ETHER_HDR_LEN + sizeof(*ip6); + CSUM_PSEUDO_HDR | CSUM_IP_CHECKED | CSUM_IP_VALID; + le->m_head->m_pkthdr.csum_data = 0xffff; break; - } -#endif -#ifdef INET - case ETHERTYPE_IP: - { - struct ip *ip4; - uint32_t cl; - uint16_t c; - - ip4 = le->le_ip4; - /* Fix IP header checksum for new length. */ - c = ~ip4->ip_sum; - cl = c; - c = ~ip4->ip_len; - cl += c + p_len; - while (cl > 0xffff) - cl = (cl >> 16) + (cl & 0xffff); - c = cl; - ip4->ip_sum = ~c; - ip4->ip_len = p_len; - th = (struct tcphdr *)(ip4 + 1); + case LRO_TYPE_IPV6_TCP: + csum = tcp_lro_update_checksum(&le->inner, le, + le->m_head->m_pkthdr.lro_tcp_d_len, + le->m_head->m_pkthdr.lro_tcp_d_csum); + csum = tcp_lro_update_checksum(&le->outer, NULL, + le->m_head->m_pkthdr.lro_tcp_d_len + + le->inner.total_hdr_len, csum); le->m_head->m_pkthdr.csum_flags = CSUM_DATA_VALID | - CSUM_PSEUDO_HDR | CSUM_IP_CHECKED | CSUM_IP_VALID; - le->p_len += ETHER_HDR_LEN; + CSUM_PSEUDO_HDR; + le->m_head->m_pkthdr.csum_data = 0xffff; + break; + case LRO_TYPE_NONE: + switch (le->outer.data.lro_type) { + case LRO_TYPE_IPV4_TCP: + csum = tcp_lro_update_checksum(&le->outer, le, + le->m_head->m_pkthdr.lro_tcp_d_len, + le->m_head->m_pkthdr.lro_tcp_d_csum); + le->m_head->m_pkthdr.csum_flags = CSUM_DATA_VALID | + CSUM_PSEUDO_HDR | CSUM_IP_CHECKED | CSUM_IP_VALID; + le->m_head->m_pkthdr.csum_data = 0xffff; + break; + case LRO_TYPE_IPV6_TCP: + csum = tcp_lro_update_checksum(&le->outer, le, + le->m_head->m_pkthdr.lro_tcp_d_len, + le->m_head->m_pkthdr.lro_tcp_d_csum); + le->m_head->m_pkthdr.csum_flags = CSUM_DATA_VALID | + CSUM_PSEUDO_HDR; + le->m_head->m_pkthdr.csum_data = 0xffff; + break; + default: + break; + } break; - } -#endif default: - th = NULL; /* Keep compiler happy. */ - } - le->m_head->m_pkthdr.csum_data = 0xffff; - le->m_head->m_pkthdr.len = le->p_len; - - /* Incorporate the latest ACK into the TCP header. */ - th->th_ack = le->ack_seq; - th->th_win = le->window; - /* Incorporate latest timestamp into the TCP header. */ - if (le->timestamp != 0) { - uint32_t *ts_ptr; - - ts_ptr = (uint32_t *)(th + 1); - ts_ptr[1] = htonl(le->tsval); - ts_ptr[2] = le->tsecr; - } - /* Update the TCP header checksum. */ - le->ulp_csum += p_len; - le->ulp_csum += tcp_lro_csum_th(th); - while (le->ulp_csum > 0xffff) - le->ulp_csum = (le->ulp_csum >> 16) + - (le->ulp_csum & 0xffff); - th->th_sum = (le->ulp_csum & 0xffff); - th->th_sum = ~th->th_sum; - if (tp && locked) { - tcp_lro_log(tp, lc, le, NULL, 7, 0, 0, 0, 0); + break; } } + /* * Break any chain, this is not set to NULL on the singleton * case m_nextpkt points to m_head. Other case set them * m_nextpkt to NULL in push_and_replace. */ le->m_head->m_nextpkt = NULL; - le->m_head->m_pkthdr.lro_nsegs = le->append_cnt; - if (tp && locked) { - tcp_lro_log(tp, lc, le, le->m_head, 8, 0, 0, 0, 0); - } + lc->lro_queued += le->m_head->m_pkthdr.lro_nsegs; (*lc->ifp->if_input)(lc->ifp, le->m_head); - lc->lro_queued += le->append_cnt; } static void -tcp_set_le_to_m(struct lro_ctrl *lc, struct lro_entry *le, struct mbuf *m) +tcp_set_entry_to_mbuf(struct lro_ctrl *lc, struct lro_entry *le, + struct mbuf *m, struct tcphdr *th) { - struct ether_header *eh; - void *l3hdr = NULL; /* Keep compiler happy. */ - struct tcphdr *th; -#ifdef INET6 *** 1612 LINES SKIPPED *** From owner-dev-commits-src-branches@freebsd.org Wed Jun 2 12:25:02 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A6BF8642299; Wed, 2 Jun 2021 12:25:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fw7Wy2VGYz3FsK; Wed, 2 Jun 2021 12:25:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2AC3316D96; Wed, 2 Jun 2021 12:25:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 152CP2dk019367; Wed, 2 Jun 2021 12:25:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 152CP2Eh019366; Wed, 2 Jun 2021 12:25:02 GMT (envelope-from git) Date: Wed, 2 Jun 2021 12:25:02 GMT Message-Id: <202106021225.152CP2Eh019366@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: c64d1bd7145b - stable/13 - The old thread priority must be stored as part of the EPOCH(9) tracker. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c64d1bd7145b5d30c97d1cd99e584da529d95100 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jun 2021 12:25:04 -0000 The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=c64d1bd7145b5d30c97d1cd99e584da529d95100 commit c64d1bd7145b5d30c97d1cd99e584da529d95100 Author: Hans Petter Selasky AuthorDate: 2021-05-21 08:27:20 +0000 Commit: Hans Petter Selasky CommitDate: 2021-06-02 12:03:21 +0000 The old thread priority must be stored as part of the EPOCH(9) tracker. Else recursive use of EPOCH(9) may cause the wrong priority to be restored. Bump the __FreeBSD_version due to adding new member to the epoch tracker structure. Differential Revision: https://reviews.freebsd.org/D30375 Reviewed by: markj@ Sponsored by: Mellanox Technologies // NVIDIA Networking (cherry picked from commit ef0f7ae934b04a4f90e051d701ba539dd04e7d5b) --- sys/kern/subr_epoch.c | 6 +++--- sys/sys/epoch.h | 1 + sys/sys/param.h | 2 +- sys/sys/proc.h | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/sys/kern/subr_epoch.c b/sys/kern/subr_epoch.c index 798dbdc4360e..651fd8b419f0 100644 --- a/sys/kern/subr_epoch.c +++ b/sys/kern/subr_epoch.c @@ -457,7 +457,7 @@ _epoch_enter_preempt(epoch_t epoch, epoch_tracker_t et EPOCH_FILE_LINE) THREAD_NO_SLEEPING(); critical_enter(); sched_pin(); - td->td_pre_epoch_prio = td->td_priority; + et->et_old_priority = td->td_priority; er = epoch_currecord(epoch); /* Record-level tracking is reserved for non-preemptible epochs. */ MPASS(er->er_td == NULL); @@ -510,8 +510,8 @@ _epoch_exit_preempt(epoch_t epoch, epoch_tracker_t et EPOCH_FILE_LINE) ck_epoch_end(&er->er_record, &et->et_section); TAILQ_REMOVE(&er->er_tdlist, et, et_link); er->er_gen++; - if (__predict_false(td->td_pre_epoch_prio != td->td_priority)) - epoch_adjust_prio(td, td->td_pre_epoch_prio); + if (__predict_false(et->et_old_priority != td->td_priority)) + epoch_adjust_prio(td, et->et_old_priority); critical_exit(); #ifdef EPOCH_TRACE epoch_trace_exit(td, epoch, et, file, line); diff --git a/sys/sys/epoch.h b/sys/sys/epoch.h index 25d2bb3dc6e3..85c791d3df6c 100644 --- a/sys/sys/epoch.h +++ b/sys/sys/epoch.h @@ -55,6 +55,7 @@ struct epoch_tracker { TAILQ_ENTRY(epoch_tracker) et_link; struct thread *et_td; ck_epoch_section_t et_section; + uint8_t et_old_priority; #ifdef EPOCH_TRACE struct epoch *et_epoch; SLIST_ENTRY(epoch_tracker) et_tlink; diff --git a/sys/sys/param.h b/sys/sys/param.h index 127c04becf58..f9b67ef94bc0 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300506 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300507 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, diff --git a/sys/sys/proc.h b/sys/sys/proc.h index 8e2a081eb027..05fdc83fd1e2 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -325,7 +325,7 @@ struct thread { u_char td_pri_class; /* (t) Scheduling class. */ u_char td_user_pri; /* (t) User pri from estcpu and nice. */ u_char td_base_user_pri; /* (t) Base user pri */ - u_char td_pre_epoch_prio; /* (k) User pri on entry to epoch */ + u_char td_unused_0; /* no longer used field */ uintptr_t td_rb_list; /* (k) Robust list head. */ uintptr_t td_rbp_list; /* (k) Robust priv list head. */ uintptr_t td_rb_inact; /* (k) Current in-action mutex loc. */ From owner-dev-commits-src-branches@freebsd.org Wed Jun 2 13:35:35 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 35EE06436CC; Wed, 2 Jun 2021 13:35:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fw95M14rcz3MX5; Wed, 2 Jun 2021 13:35:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0E68C17A48; Wed, 2 Jun 2021 13:35:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 152DZYlS011968; Wed, 2 Jun 2021 13:35:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 152DZYZk011967; Wed, 2 Jun 2021 13:35:34 GMT (envelope-from git) Date: Wed, 2 Jun 2021 13:35:34 GMT Message-Id: <202106021335.152DZYZk011967@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 78b147467ea5 - stable/13 - acpi: Add missing error handling to acpi_pci_link_route_irqs() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 78b147467ea55886071b099d364757e827afbcd7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jun 2021 13:35:35 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=78b147467ea55886071b099d364757e827afbcd7 commit 78b147467ea55886071b099d364757e827afbcd7 Author: Mark Johnston AuthorDate: 2021-05-26 14:34:39 +0000 Commit: Mark Johnston CommitDate: 2021-06-02 13:32:37 +0000 acpi: Add missing error handling to acpi_pci_link_route_irqs() Otherwise the resouce buffer may have been freed when AcpiSetCurrentResources() is called, leading to a use-after-free. PR: 255862 Submitted by: Lv Yunlong (original version) MFC after: 1 week (cherry picked from commit 4cf33275289088e3b0a913a44b5cd549e348094d) --- sys/dev/acpica/acpi_pci_link.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/dev/acpica/acpi_pci_link.c b/sys/dev/acpica/acpi_pci_link.c index ecc4f26d3fb4..3dab2807bd92 100644 --- a/sys/dev/acpica/acpi_pci_link.c +++ b/sys/dev/acpica/acpi_pci_link.c @@ -843,8 +843,10 @@ acpi_pci_link_srs_from_links(struct acpi_pci_link_softc *sc, device_printf(sc->pl_dev, "Unable to build resources: %s\n", AcpiFormatException(status)); - if (srsbuf->Pointer != NULL) + if (srsbuf->Pointer != NULL) { AcpiOsFree(srsbuf->Pointer); + srsbuf->Pointer = NULL; + } return (status); } } @@ -867,6 +869,8 @@ acpi_pci_link_route_irqs(device_t dev) status = acpi_pci_link_srs_from_links(sc, &srsbuf); else status = acpi_pci_link_srs_from_crs(sc, &srsbuf); + if (ACPI_FAILURE(status)) + return (status); /* Write out new resources via _SRS. */ status = AcpiSetCurrentResources(acpi_get_handle(dev), &srsbuf); From owner-dev-commits-src-branches@freebsd.org Wed Jun 2 13:35:36 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7C2346432E2; Wed, 2 Jun 2021 13:35:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fw95N2Vr9z3MX8; Wed, 2 Jun 2021 13:35:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3203E17C18; Wed, 2 Jun 2021 13:35:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 152DZaDc011991; Wed, 2 Jun 2021 13:35:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 152DZaSR011990; Wed, 2 Jun 2021 13:35:36 GMT (envelope-from git) Date: Wed, 2 Jun 2021 13:35:36 GMT Message-Id: <202106021335.152DZaSR011990@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: b22150dadd23 - stable/13 - oce: Fix handling of m_pullup() errors in oce_tso_setup() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b22150dadd231a84886b2a078dfbe02f9c6d87cc Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jun 2021 13:35:36 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=b22150dadd231a84886b2a078dfbe02f9c6d87cc commit b22150dadd231a84886b2a078dfbe02f9c6d87cc Author: Mark Johnston AuthorDate: 2021-05-26 13:49:49 +0000 Commit: Mark Johnston CommitDate: 2021-06-02 13:33:16 +0000 oce: Fix handling of m_pullup() errors in oce_tso_setup() m_pullup() frees the input mbuf chain upon a failure. Set *mpp to NULL in this case to ensure that the caller does not free the chain again. PR: 255864 Submitted by: Lv Yunlong (original version) MFC after: 1 week (cherry picked from commit 71776d67198fadd7d96937c9bdd22063636b132b) --- sys/dev/oce/oce_if.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/sys/dev/oce/oce_if.c b/sys/dev/oce/oce_if.c index 7c9b71089081..271c35015a9f 100644 --- a/sys/dev/oce/oce_if.c +++ b/sys/dev/oce/oce_if.c @@ -1330,11 +1330,8 @@ oce_tso_setup(POCE_SOFTC sc, struct mbuf **mpp) } m = m_pullup(m, total_len); - if (!m) - return NULL; *mpp = m; return m; - } #endif /* INET6 || INET */ From owner-dev-commits-src-branches@freebsd.org Wed Jun 2 13:35:37 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B523E643567; Wed, 2 Jun 2021 13:35: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 4Fw95P4DClz3MZb; Wed, 2 Jun 2021 13:35:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 59C6B17EEA; Wed, 2 Jun 2021 13:35:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 152DZbSg012017; Wed, 2 Jun 2021 13:35:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 152DZbSF012016; Wed, 2 Jun 2021 13:35:37 GMT (envelope-from git) Date: Wed, 2 Jun 2021 13:35:37 GMT Message-Id: <202106021335.152DZbSF012016@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 7a67b893e81e - stable/13 - cxgb: Avoid a read-after-free in get_packet() when cxgb_debug is on MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7a67b893e81e20c2d6f4e30ef6c304838f6cc0df Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jun 2021 13:35:37 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=7a67b893e81e20c2d6f4e30ef6c304838f6cc0df commit 7a67b893e81e20c2d6f4e30ef6c304838f6cc0df Author: Mark Johnston AuthorDate: 2021-05-26 14:02:19 +0000 Commit: Mark Johnston CommitDate: 2021-06-02 13:34:07 +0000 cxgb: Avoid a read-after-free in get_packet() when cxgb_debug is on PR: 255863 MFC after: 1 week (cherry picked from commit 16f8f89c5c1f324a15a7e0607f03f041a230a572) --- sys/dev/cxgb/cxgb_sge.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/cxgb/cxgb_sge.c b/sys/dev/cxgb/cxgb_sge.c index f13d2f03180c..00b67880fcc8 100644 --- a/sys/dev/cxgb/cxgb_sge.c +++ b/sys/dev/cxgb/cxgb_sge.c @@ -2773,6 +2773,7 @@ get_packet(adapter_t *adap, unsigned int drop_thres, struct sge_qset *qs, if (mh->mh_tail == NULL) { log(LOG_ERR, "discarding intermediate descriptor entry\n"); m_freem(m); + m = NULL; break; } mh->mh_tail->m_next = m; @@ -2780,7 +2781,7 @@ get_packet(adapter_t *adap, unsigned int drop_thres, struct sge_qset *qs, mh->mh_head->m_pkthdr.len += len; break; } - if (cxgb_debug) + if (cxgb_debug && m != NULL) printf("len=%d pktlen=%d\n", m->m_len, m->m_pkthdr.len); done: if (++fl->cidx == fl->size) From owner-dev-commits-src-branches@freebsd.org Wed Jun 2 13:35:38 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AA990643C09; Wed, 2 Jun 2021 13:35:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fw95Q40gyz3MZf; Wed, 2 Jun 2021 13:35:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6FEEA17EEB; Wed, 2 Jun 2021 13:35:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 152DZcGV012038; Wed, 2 Jun 2021 13:35:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 152DZc6G012037; Wed, 2 Jun 2021 13:35:38 GMT (envelope-from git) Date: Wed, 2 Jun 2021 13:35:38 GMT Message-Id: <202106021335.152DZc6G012037@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 4814dbd3c0e6 - stable/13 - rpcsec_gss: Use a designated initializer for rpc_gss_ops MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4814dbd3c0e6fc02014f145bd54b3b854162e4e4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jun 2021 13:35:38 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=4814dbd3c0e6fc02014f145bd54b3b854162e4e4 commit 4814dbd3c0e6fc02014f145bd54b3b854162e4e4 Author: Mark Johnston AuthorDate: 2021-05-26 14:14:35 +0000 Commit: Mark Johnston CommitDate: 2021-06-02 13:34:41 +0000 rpcsec_gss: Use a designated initializer for rpc_gss_ops No functional change intended. MFC after: 1 week Sponsored by: The FreeBSD Foundation (cherry picked from commit ba5bc6e8f9cb9c523d09599d7290a6d75ec9fd8b) --- sys/rpc/rpcsec_gss/rpcsec_gss.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/rpc/rpcsec_gss/rpcsec_gss.c b/sys/rpc/rpcsec_gss/rpcsec_gss.c index 2eef1544b61a..b384a8347ef5 100644 --- a/sys/rpc/rpcsec_gss/rpcsec_gss.c +++ b/sys/rpc/rpcsec_gss/rpcsec_gss.c @@ -98,11 +98,11 @@ static void rpc_gss_destroy(AUTH *); static void rpc_gss_destroy_context(AUTH *, bool_t); static struct auth_ops rpc_gss_ops = { - rpc_gss_nextverf, - rpc_gss_marshal, - rpc_gss_validate, - rpc_gss_refresh, - rpc_gss_destroy, + .ah_nextverf = rpc_gss_nextverf, + .ah_marshal = rpc_gss_marshal, + .ah_validate = rpc_gss_validate, + .ah_refresh = rpc_gss_refresh, + .ah_destroy = rpc_gss_destroy, }; enum rpcsec_gss_state { From owner-dev-commits-src-branches@freebsd.org Wed Jun 2 13:35:39 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D0FF0643C9C; Wed, 2 Jun 2021 13:35: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 4Fw95R4cTCz3MMS; Wed, 2 Jun 2021 13:35:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8480E17CB2; Wed, 2 Jun 2021 13:35:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 152DZdBg012059; Wed, 2 Jun 2021 13:35:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 152DZdkB012058; Wed, 2 Jun 2021 13:35:39 GMT (envelope-from git) Date: Wed, 2 Jun 2021 13:35:39 GMT Message-Id: <202106021335.152DZdkB012058@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: a9ff49e0288b - stable/13 - netsmb: Avoid a read-after-free in smb_t2_request_int() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a9ff49e0288b8844ddc6fb2a278ec652908d30cc Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jun 2021 13:35:40 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=a9ff49e0288b8844ddc6fb2a278ec652908d30cc commit a9ff49e0288b8844ddc6fb2a278ec652908d30cc Author: Mark Johnston AuthorDate: 2021-05-26 13:57:38 +0000 Commit: Mark Johnston CommitDate: 2021-06-02 13:34:47 +0000 netsmb: Avoid a read-after-free in smb_t2_request_int() Defer freeing the request structure until we've decided whether the request should be retried. PR: 255881 MFC after: 1 week (cherry picked from commit 771e95d2e2ee1b60539f1273c62837b48249590a) --- sys/netsmb/smb_rq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netsmb/smb_rq.c b/sys/netsmb/smb_rq.c index 57bf053034ad..c5d5d0f85742 100644 --- a/sys/netsmb/smb_rq.c +++ b/sys/netsmb/smb_rq.c @@ -737,13 +737,13 @@ smb_t2_request_int(struct smb_t2rq *t2p) bad: smb_iod_removerq(rqp); freerq: - smb_rq_done(rqp); if (error) { if (rqp->sr_flags & SMBR_RESTART) t2p->t2_flags |= SMBT2_RESTART; md_done(&t2p->t2_rparam); md_done(&t2p->t2_rdata); } + smb_rq_done(rqp); return error; } From owner-dev-commits-src-branches@freebsd.org Wed Jun 2 13:37:14 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6EEDD643E25; Wed, 2 Jun 2021 13:37: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 4Fw97G2hmWz3MYK; Wed, 2 Jun 2021 13:37:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 42C4817B97; Wed, 2 Jun 2021 13:37:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 152DbELt012326; Wed, 2 Jun 2021 13:37:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 152DbEvs012325; Wed, 2 Jun 2021 13:37:14 GMT (envelope-from git) Date: Wed, 2 Jun 2021 13:37:14 GMT Message-Id: <202106021337.152DbEvs012325@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: a53f3a29bf6d - stable/12 - acpi: Add missing error handling to acpi_pci_link_route_irqs() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: a53f3a29bf6d3af7cbddaf97b04b05cac7e923a6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jun 2021 13:37:14 -0000 The branch stable/12 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=a53f3a29bf6d3af7cbddaf97b04b05cac7e923a6 commit a53f3a29bf6d3af7cbddaf97b04b05cac7e923a6 Author: Mark Johnston AuthorDate: 2021-05-26 14:34:39 +0000 Commit: Mark Johnston CommitDate: 2021-06-02 13:36:03 +0000 acpi: Add missing error handling to acpi_pci_link_route_irqs() Otherwise the resouce buffer may have been freed when AcpiSetCurrentResources() is called, leading to a use-after-free. PR: 255862 Submitted by: Lv Yunlong (original version) MFC after: 1 week (cherry picked from commit 4cf33275289088e3b0a913a44b5cd549e348094d) --- sys/dev/acpica/acpi_pci_link.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/dev/acpica/acpi_pci_link.c b/sys/dev/acpica/acpi_pci_link.c index 660407604256..f5378e6ca3cf 100644 --- a/sys/dev/acpica/acpi_pci_link.c +++ b/sys/dev/acpica/acpi_pci_link.c @@ -843,8 +843,10 @@ acpi_pci_link_srs_from_links(struct acpi_pci_link_softc *sc, device_printf(sc->pl_dev, "Unable to build resources: %s\n", AcpiFormatException(status)); - if (srsbuf->Pointer != NULL) + if (srsbuf->Pointer != NULL) { AcpiOsFree(srsbuf->Pointer); + srsbuf->Pointer = NULL; + } return (status); } } @@ -867,6 +869,8 @@ acpi_pci_link_route_irqs(device_t dev) status = acpi_pci_link_srs_from_links(sc, &srsbuf); else status = acpi_pci_link_srs_from_crs(sc, &srsbuf); + if (ACPI_FAILURE(status)) + return (status); /* Write out new resources via _SRS. */ status = AcpiSetCurrentResources(acpi_get_handle(dev), &srsbuf); From owner-dev-commits-src-branches@freebsd.org Wed Jun 2 13:37:15 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B328A643DBC; Wed, 2 Jun 2021 13:37: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 4Fw97H3Y11z3Mfg; Wed, 2 Jun 2021 13:37:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6312F17A4A; Wed, 2 Jun 2021 13:37:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 152DbFiv012352; Wed, 2 Jun 2021 13:37:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 152DbF4d012351; Wed, 2 Jun 2021 13:37:15 GMT (envelope-from git) Date: Wed, 2 Jun 2021 13:37:15 GMT Message-Id: <202106021337.152DbF4d012351@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: d88bd7d80ff2 - stable/12 - cxgb: Avoid a read-after-free in get_packet() when cxgb_debug is on MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: d88bd7d80ff2a318aa6dc3c710538f5ddc5a1a63 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jun 2021 13:37:15 -0000 The branch stable/12 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=d88bd7d80ff2a318aa6dc3c710538f5ddc5a1a63 commit d88bd7d80ff2a318aa6dc3c710538f5ddc5a1a63 Author: Mark Johnston AuthorDate: 2021-05-26 14:02:19 +0000 Commit: Mark Johnston CommitDate: 2021-06-02 13:36:35 +0000 cxgb: Avoid a read-after-free in get_packet() when cxgb_debug is on PR: 255863 MFC after: 1 week (cherry picked from commit 16f8f89c5c1f324a15a7e0607f03f041a230a572) --- sys/dev/cxgb/cxgb_sge.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/cxgb/cxgb_sge.c b/sys/dev/cxgb/cxgb_sge.c index 07eb91a4d04c..5c5d1f902f30 100644 --- a/sys/dev/cxgb/cxgb_sge.c +++ b/sys/dev/cxgb/cxgb_sge.c @@ -2778,6 +2778,7 @@ get_packet(adapter_t *adap, unsigned int drop_thres, struct sge_qset *qs, if (mh->mh_tail == NULL) { log(LOG_ERR, "discarding intermediate descriptor entry\n"); m_freem(m); + m = NULL; break; } mh->mh_tail->m_next = m; @@ -2785,7 +2786,7 @@ get_packet(adapter_t *adap, unsigned int drop_thres, struct sge_qset *qs, mh->mh_head->m_pkthdr.len += len; break; } - if (cxgb_debug) + if (cxgb_debug && m != NULL) printf("len=%d pktlen=%d\n", m->m_len, m->m_pkthdr.len); done: if (++fl->cidx == fl->size) From owner-dev-commits-src-branches@freebsd.org Wed Jun 2 13:37:18 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4ACBA643D3E; Wed, 2 Jun 2021 13:37: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 4Fw97K6nF0z3Mc9; Wed, 2 Jun 2021 13:37:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B07A5178F0; Wed, 2 Jun 2021 13:37:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 152DbGtN012375; Wed, 2 Jun 2021 13:37:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 152DbGg9012374; Wed, 2 Jun 2021 13:37:16 GMT (envelope-from git) Date: Wed, 2 Jun 2021 13:37:16 GMT Message-Id: <202106021337.152DbGg9012374@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: ce8cbeaf39af - stable/12 - rpcsec_gss: Use a designated initializer for rpc_gss_ops MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: ce8cbeaf39afbc696b1936127fabea45681c0348 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jun 2021 13:37:18 -0000 The branch stable/12 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=ce8cbeaf39afbc696b1936127fabea45681c0348 commit ce8cbeaf39afbc696b1936127fabea45681c0348 Author: Mark Johnston AuthorDate: 2021-05-26 14:14:35 +0000 Commit: Mark Johnston CommitDate: 2021-06-02 13:37:00 +0000 rpcsec_gss: Use a designated initializer for rpc_gss_ops No functional change intended. MFC after: 1 week Sponsored by: The FreeBSD Foundation (cherry picked from commit ba5bc6e8f9cb9c523d09599d7290a6d75ec9fd8b) --- sys/rpc/rpcsec_gss/rpcsec_gss.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/rpc/rpcsec_gss/rpcsec_gss.c b/sys/rpc/rpcsec_gss/rpcsec_gss.c index 2eef1544b61a..b384a8347ef5 100644 --- a/sys/rpc/rpcsec_gss/rpcsec_gss.c +++ b/sys/rpc/rpcsec_gss/rpcsec_gss.c @@ -98,11 +98,11 @@ static void rpc_gss_destroy(AUTH *); static void rpc_gss_destroy_context(AUTH *, bool_t); static struct auth_ops rpc_gss_ops = { - rpc_gss_nextverf, - rpc_gss_marshal, - rpc_gss_validate, - rpc_gss_refresh, - rpc_gss_destroy, + .ah_nextverf = rpc_gss_nextverf, + .ah_marshal = rpc_gss_marshal, + .ah_validate = rpc_gss_validate, + .ah_refresh = rpc_gss_refresh, + .ah_destroy = rpc_gss_destroy, }; enum rpcsec_gss_state { From owner-dev-commits-src-branches@freebsd.org Wed Jun 2 13:37:18 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5016B643F81; Wed, 2 Jun 2021 13:37: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 4Fw97L0xYwz3Mhk; Wed, 2 Jun 2021 13:37:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DEDC817D1F; Wed, 2 Jun 2021 13:37:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 152DbH4i012396; Wed, 2 Jun 2021 13:37:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 152DbHZj012395; Wed, 2 Jun 2021 13:37:17 GMT (envelope-from git) Date: Wed, 2 Jun 2021 13:37:17 GMT Message-Id: <202106021337.152DbHZj012395@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 138c9932888f - stable/12 - netsmb: Avoid a read-after-free in smb_t2_request_int() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 138c9932888f5d0f331a675ec1fa925fcb707976 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jun 2021 13:37:18 -0000 The branch stable/12 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=138c9932888f5d0f331a675ec1fa925fcb707976 commit 138c9932888f5d0f331a675ec1fa925fcb707976 Author: Mark Johnston AuthorDate: 2021-05-26 13:57:38 +0000 Commit: Mark Johnston CommitDate: 2021-06-02 13:37:06 +0000 netsmb: Avoid a read-after-free in smb_t2_request_int() Defer freeing the request structure until we've decided whether the request should be retried. PR: 255881 MFC after: 1 week (cherry picked from commit 771e95d2e2ee1b60539f1273c62837b48249590a) --- sys/netsmb/smb_rq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netsmb/smb_rq.c b/sys/netsmb/smb_rq.c index 544bfd1194f0..5a2ec0e7214a 100644 --- a/sys/netsmb/smb_rq.c +++ b/sys/netsmb/smb_rq.c @@ -738,13 +738,13 @@ smb_t2_request_int(struct smb_t2rq *t2p) bad: smb_iod_removerq(rqp); freerq: - smb_rq_done(rqp); if (error) { if (rqp->sr_flags & SMBR_RESTART) t2p->t2_flags |= SMBT2_RESTART; md_done(&t2p->t2_rparam); md_done(&t2p->t2_rdata); } + smb_rq_done(rqp); return error; } From owner-dev-commits-src-branches@freebsd.org Wed Jun 2 14:51:21 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 65B72645097; Wed, 2 Jun 2021 14:51: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 4FwBmn2Tqsz3jmZ; Wed, 2 Jun 2021 14:51:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3D69C18CAB; Wed, 2 Jun 2021 14:51:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 152EpLTb016677; Wed, 2 Jun 2021 14:51:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 152EpLIB016676; Wed, 2 Jun 2021 14:51:21 GMT (envelope-from git) Date: Wed, 2 Jun 2021 14:51:21 GMT Message-Id: <202106021451.152EpLIB016676@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 05b9673637fe - stable/12 - Cirrus-CI: avoid boot smoke test on stable/12 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 05b9673637feedb3ef0cf51fd9b7e914b08f7554 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jun 2021 14:51:21 -0000 The branch stable/12 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=05b9673637feedb3ef0cf51fd9b7e914b08f7554 commit 05b9673637feedb3ef0cf51fd9b7e914b08f7554 Author: Ed Maste AuthorDate: 2021-06-02 14:11:40 +0000 Commit: Ed Maste CommitDate: 2021-06-02 14:49:29 +0000 Cirrus-CI: avoid boot smoke test on stable/12 The boot smoke test boots from a FAT filesystem (created in-memory by QEMU), but this does not work on stable/12: mountroot: waiting for device /dev/ada0s1... Mounting from msdosfs:/dev/ada0s1 failed with error 19. For now on stable/12 use Cirrus-CI as only a build test. Sponsored by: The FreeBSD Foundation --- .cirrus.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index ec87c371aca2..ed89c0061973 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -14,5 +14,8 @@ task: - pkg install -y qemu-devel uefi-edk2-qemu-x86_64 script: - make -j$(sysctl -n hw.ncpu) WITHOUT_TOOLCHAIN=yes buildworld buildkernel - test_script: - - sh tools/boot/ci-qemu-test.sh +# FAT root fs fails on stable/12: +# Mounting from msdosfs:/dev/ada0s1 failed with error 19. +# +# test_script: +# - sh tools/boot/ci-qemu-test.sh From owner-dev-commits-src-branches@freebsd.org Wed Jun 2 15:01:47 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0452364558A; Wed, 2 Jun 2021 15:01:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FwC0p6nGfz3k6x; Wed, 2 Jun 2021 15:01:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D171218CEE; Wed, 2 Jun 2021 15:01:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 152F1kgu031740; Wed, 2 Jun 2021 15:01:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 152F1keM031739; Wed, 2 Jun 2021 15:01:46 GMT (envelope-from git) Date: Wed, 2 Jun 2021 15:01:46 GMT Message-Id: <202106021501.152F1keM031739@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 3b78559094fe - stable/13 - lockprof: retire lock_prof_skipcount MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3b78559094fea6320b925966a05cc14416b71c4a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jun 2021 15:01:47 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=3b78559094fea6320b925966a05cc14416b71c4a commit 3b78559094fea6320b925966a05cc14416b71c4a Author: Mateusz Guzik AuthorDate: 2021-05-18 19:05:42 +0000 Commit: Mateusz Guzik CommitDate: 2021-06-02 15:00:21 +0000 lockprof: retire lock_prof_skipcount The implementation uses a global variable for *ALL* calls, defeating the point of sampling in the first place. Remove it as it clearly remains unused. (cherry picked from commit fca5cfd584d81ca291dbd898a8ff60c52d8c3c42) --- sys/kern/subr_lock.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/sys/kern/subr_lock.c b/sys/kern/subr_lock.c index b69ee349482c..09113836efe5 100644 --- a/sys/kern/subr_lock.c +++ b/sys/kern/subr_lock.c @@ -277,7 +277,6 @@ static volatile int lock_prof_resetting; static int lock_prof_rejected; static int lock_prof_skipspin; -static int lock_prof_skipcount; #ifndef USE_CPU_NANOSECONDS uint64_t @@ -596,7 +595,6 @@ void lock_profile_obtain_lock_success(struct lock_object *lo, int contested, uint64_t waittime, const char *file, int line) { - static int lock_prof_count; struct lock_profile_object *l; int spin; @@ -606,9 +604,6 @@ lock_profile_obtain_lock_success(struct lock_object *lo, int contested, /* don't reset the timer when/if recursing */ if (!lock_prof_enable || (lo->lo_flags & LO_NOPROFILE)) return; - if (lock_prof_skipcount && - (++lock_prof_count % lock_prof_skipcount) != 0) - return; spin = (LOCK_CLASS(lo)->lc_flags & LC_SPINLOCK) ? 1 : 0; if (spin && lock_prof_skipspin == 1) return; @@ -731,8 +726,6 @@ static SYSCTL_NODE(_debug_lock, OID_AUTO, prof, "lock profiling"); SYSCTL_INT(_debug_lock_prof, OID_AUTO, skipspin, CTLFLAG_RW, &lock_prof_skipspin, 0, "Skip profiling on spinlocks."); -SYSCTL_INT(_debug_lock_prof, OID_AUTO, skipcount, CTLFLAG_RW, - &lock_prof_skipcount, 0, "Sample approximately every N lock acquisitions."); SYSCTL_INT(_debug_lock_prof, OID_AUTO, rejected, CTLFLAG_RD, &lock_prof_rejected, 0, "Number of rejected profiling records"); SYSCTL_PROC(_debug_lock_prof, OID_AUTO, stats, From owner-dev-commits-src-branches@freebsd.org Wed Jun 2 15:01:48 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4234C64567B; Wed, 2 Jun 2021 15:01: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 4FwC0r0rqjz3kRP; Wed, 2 Jun 2021 15:01:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0014A18CEF; Wed, 2 Jun 2021 15:01:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 152F1lGG031761; Wed, 2 Jun 2021 15:01:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 152F1lcQ031760; Wed, 2 Jun 2021 15:01:47 GMT (envelope-from git) Date: Wed, 2 Jun 2021 15:01:47 GMT Message-Id: <202106021501.152F1lcQ031760@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: f03b2f7c8b81 - stable/13 - lockprof: add contested-only profiling MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f03b2f7c8b814ad5c71c519316644541dd5ceae2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jun 2021 15:01:48 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=f03b2f7c8b814ad5c71c519316644541dd5ceae2 commit f03b2f7c8b814ad5c71c519316644541dd5ceae2 Author: Mateusz Guzik AuthorDate: 2021-05-18 19:07:19 +0000 Commit: Mateusz Guzik CommitDate: 2021-06-02 15:00:22 +0000 lockprof: add contested-only profiling This allows tracking all wait times with much smaller runtime impact. For example when doing -j 104 buildkernel on tmpfs: no profiling: 2921.70s user 282.72s system 6598% cpu 48.562 total all acquires: 2926.87s user 350.53s system 6656% cpu 49.237 total contested only: 2919.64s user 290.31s system 6583% cpu 48.756 total (cherry picked from commit a0842e69aa5f86d61c072544b540ef21b2015211) --- sys/kern/subr_lock.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/kern/subr_lock.c b/sys/kern/subr_lock.c index 09113836efe5..6d91118ae0f3 100644 --- a/sys/kern/subr_lock.c +++ b/sys/kern/subr_lock.c @@ -271,6 +271,7 @@ DPCPU_DEFINE_STATIC(struct lock_prof_cpu, lp); #define LP_CPU(cpu) (DPCPU_ID_PTR((cpu), lp)) volatile int __read_mostly lock_prof_enable; +int __read_mostly lock_contested_only; static volatile int lock_prof_resetting; #define LPROF_SBUF_SIZE 256 @@ -604,6 +605,8 @@ lock_profile_obtain_lock_success(struct lock_object *lo, int contested, /* don't reset the timer when/if recursing */ if (!lock_prof_enable || (lo->lo_flags & LO_NOPROFILE)) return; + if (lock_contested_only && !contested) + return; spin = (LOCK_CLASS(lo)->lc_flags & LC_SPINLOCK) ? 1 : 0; if (spin && lock_prof_skipspin == 1) return; @@ -728,6 +731,8 @@ SYSCTL_INT(_debug_lock_prof, OID_AUTO, skipspin, CTLFLAG_RW, &lock_prof_skipspin, 0, "Skip profiling on spinlocks."); SYSCTL_INT(_debug_lock_prof, OID_AUTO, rejected, CTLFLAG_RD, &lock_prof_rejected, 0, "Number of rejected profiling records"); +SYSCTL_INT(_debug_lock_prof, OID_AUTO, contested_only, CTLFLAG_RW, + &lock_contested_only, 0, "Only profile contested acquires"); SYSCTL_PROC(_debug_lock_prof, OID_AUTO, stats, CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0, dump_lock_prof_stats, "A", From owner-dev-commits-src-branches@freebsd.org Wed Jun 2 15:01:49 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4E10F6454DF; Wed, 2 Jun 2021 15:01: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 4FwC0s1K9gz3kc9; Wed, 2 Jun 2021 15:01:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 13C7B18D4D; Wed, 2 Jun 2021 15:01:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 152F1nj2031782; Wed, 2 Jun 2021 15:01:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 152F1nKb031781; Wed, 2 Jun 2021 15:01:49 GMT (envelope-from git) Date: Wed, 2 Jun 2021 15:01:49 GMT Message-Id: <202106021501.152F1nKb031781@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 4ee784e4d8db - stable/13 - lockprof: pass lock type as an argument instead of reading the spin flag MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4ee784e4d8db2da6b53fc5792fc6ee565d6a7cee Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jun 2021 15:01:49 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=4ee784e4d8db2da6b53fc5792fc6ee565d6a7cee commit 4ee784e4d8db2da6b53fc5792fc6ee565d6a7cee Author: Mateusz Guzik AuthorDate: 2021-05-23 15:25:42 +0000 Commit: Mateusz Guzik CommitDate: 2021-06-02 15:00:23 +0000 lockprof: pass lock type as an argument instead of reading the spin flag (cherry picked from commit 6a467cc5e1f673a700f6229e63e9a98ed65264c8) --- sys/kern/kern_lock.c | 10 +++++----- sys/kern/kern_mutex.c | 20 +++++++++++--------- sys/kern/kern_rwlock.c | 8 ++++---- sys/kern/kern_sx.c | 8 ++++---- sys/kern/sched_4bsd.c | 8 ++++---- sys/kern/subr_lock.c | 30 +++++++++++++++++++++++------- sys/sys/lock_profile.h | 16 ++++++++-------- sys/sys/lockstat.h | 28 ++++++++++++++++++++++------ sys/sys/mutex.h | 6 +++--- 9 files changed, 84 insertions(+), 50 deletions(-) diff --git a/sys/kern/kern_lock.c b/sys/kern/kern_lock.c index 091abcda2a1e..c86dad2218d4 100644 --- a/sys/kern/kern_lock.c +++ b/sys/kern/kern_lock.c @@ -631,7 +631,7 @@ lockmgr_slock_hard(struct lock *lk, u_int flags, struct lock_object *ilk, #ifdef HWPMC_HOOKS PMC_SOFT_CALL( , , lock, failed); #endif - lock_profile_obtain_lock_failed(&lk->lock_object, + lock_profile_obtain_lock_failed(&lk->lock_object, false, &contested, &waittime); /* @@ -844,7 +844,7 @@ lockmgr_xlock_hard(struct lock *lk, u_int flags, struct lock_object *ilk, #ifdef HWPMC_HOOKS PMC_SOFT_CALL( , , lock, failed); #endif - lock_profile_obtain_lock_failed(&lk->lock_object, + lock_profile_obtain_lock_failed(&lk->lock_object, false, &contested, &waittime); /* @@ -1434,7 +1434,7 @@ __lockmgr_args(struct lock *lk, u_int flags, struct lock_object *ilk, #ifdef HWPMC_HOOKS PMC_SOFT_CALL( , , lock, failed); #endif - lock_profile_obtain_lock_failed(&lk->lock_object, + lock_profile_obtain_lock_failed(&lk->lock_object, false, &contested, &waittime); /* @@ -1581,7 +1581,7 @@ __lockmgr_args(struct lock *lk, u_int flags, struct lock_object *ilk, if (error == 0) { lock_profile_obtain_lock_success(&lk->lock_object, - contested, waittime, file, line); + false, contested, waittime, file, line); LOCK_LOG_LOCK("DRAIN", &lk->lock_object, 0, lk->lk_recurse, file, line); WITNESS_LOCK(&lk->lock_object, LOP_EXCLUSIVE | @@ -1627,7 +1627,7 @@ _lockmgr_disown(struct lock *lk, const char *file, int line) */ if (LK_HOLDER(lk->lk_lock) != tid) return; - lock_profile_release_lock(&lk->lock_object); + lock_profile_release_lock(&lk->lock_object, false); LOCKSTAT_RECORD1(lockmgr__disown, lk, LOCKSTAT_WRITER); LOCK_LOG_LOCK("XDISOWN", &lk->lock_object, 0, 0, file, line); WITNESS_UNLOCK(&lk->lock_object, LOP_EXCLUSIVE, file, line); diff --git a/sys/kern/kern_mutex.c b/sys/kern/kern_mutex.c index 0c384281f711..d9db69e2ac09 100644 --- a/sys/kern/kern_mutex.c +++ b/sys/kern/kern_mutex.c @@ -344,7 +344,7 @@ __mtx_lock_spin_flags(volatile uintptr_t *c, int opts, const char *file, if (!_mtx_obtain_lock_fetch(m, &v, tid)) _mtx_lock_spin(m, v, opts, file, line); else - LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(spin__acquire, + LOCKSTAT_PROFILE_OBTAIN_SPIN_LOCK_SUCCESS(spin__acquire, m, 0, 0, file, line); #else __mtx_lock_spin(m, curthread, opts, file, line); @@ -565,7 +565,7 @@ __mtx_lock_sleep(volatile uintptr_t *c, uintptr_t v) #ifdef HWPMC_HOOKS PMC_SOFT_CALL( , , lock, failed); #endif - lock_profile_obtain_lock_failed(&m->lock_object, + lock_profile_obtain_lock_failed(&m->lock_object, false, &contested, &waittime); if (LOCK_LOG_TEST(&m->lock_object, opts)) CTR4(KTR_LOCK, @@ -756,7 +756,7 @@ _mtx_lock_spin_cookie(volatile uintptr_t *c, uintptr_t v) #ifdef HWPMC_HOOKS PMC_SOFT_CALL( , , lock, failed); #endif - lock_profile_obtain_lock_failed(&m->lock_object, &contested, &waittime); + lock_profile_obtain_lock_failed(&m->lock_object, true, &contested, &waittime); for (;;) { if (v == MTX_UNOWNED) { @@ -792,7 +792,7 @@ _mtx_lock_spin_cookie(volatile uintptr_t *c, uintptr_t v) LOCKSTAT_RECORD1(spin__spin, m, spin_time); out_lockstat: #endif - LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(spin__acquire, m, + LOCKSTAT_PROFILE_OBTAIN_SPIN_LOCK_SUCCESS(spin__acquire, m, contested, waittime, file, line); } #endif /* SMP */ @@ -912,7 +912,7 @@ retry: continue; } MPASS(v != tid); - lock_profile_obtain_lock_failed(&m->lock_object, + lock_profile_obtain_lock_failed(&m->lock_object, true, &contested, &waittime); /* Give interrupts a chance while we spin. */ spinlock_exit(); @@ -945,7 +945,7 @@ retry: #ifdef KDTRACE_HOOKS spin_time += lockstat_nsecs(&m->lock_object); #endif - LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(spin__acquire, m, contested, + LOCKSTAT_PROFILE_OBTAIN_SPIN_LOCK_SUCCESS(spin__acquire, m, contested, waittime, file, line); #ifdef KDTRACE_HOOKS if (lda.spin_cnt != 0) @@ -1183,12 +1183,14 @@ _mtx_destroy(volatile uintptr_t *c) MPASS((m->mtx_lock & (MTX_RECURSED|MTX_CONTESTED)) == 0); /* Perform the non-mtx related part of mtx_unlock_spin(). */ - if (LOCK_CLASS(&m->lock_object) == &lock_class_mtx_spin) + if (LOCK_CLASS(&m->lock_object) == &lock_class_mtx_spin) { + lock_profile_release_lock(&m->lock_object, true); spinlock_exit(); - else + } else { TD_LOCKS_DEC(curthread); + lock_profile_release_lock(&m->lock_object, false); + } - lock_profile_release_lock(&m->lock_object); /* Tell witness this isn't locked to make it happy. */ WITNESS_UNLOCK(&m->lock_object, LOP_EXCLUSIVE, __FILE__, __LINE__); diff --git a/sys/kern/kern_rwlock.c b/sys/kern/kern_rwlock.c index cf1af0ee7af9..f1c18f952f24 100644 --- a/sys/kern/kern_rwlock.c +++ b/sys/kern/kern_rwlock.c @@ -481,7 +481,7 @@ __rw_rlock_hard(struct rwlock *rw, struct thread *td, uintptr_t v #ifdef HWPMC_HOOKS PMC_SOFT_CALL( , , lock, failed); #endif - lock_profile_obtain_lock_failed(&rw->lock_object, + lock_profile_obtain_lock_failed(&rw->lock_object, false, &contested, &waittime); for (;;) { @@ -681,7 +681,7 @@ __rw_rlock_int(struct rwlock *rw LOCK_FILE_LINE_ARG_DEF) !__rw_rlock_try(rw, td, &v, true LOCK_FILE_LINE_ARG))) __rw_rlock_hard(rw, td, v LOCK_FILE_LINE_ARG); else - lock_profile_obtain_lock_success(&rw->lock_object, 0, 0, + lock_profile_obtain_lock_success(&rw->lock_object, false, 0, 0, file, line); LOCK_LOG_LOCK("RLOCK", &rw->lock_object, 0, 0, file, line); @@ -856,7 +856,7 @@ _rw_runlock_cookie_int(struct rwlock *rw LOCK_FILE_LINE_ARG_DEF) !__rw_runlock_try(rw, td, &v))) __rw_runlock_hard(rw, td, v LOCK_FILE_LINE_ARG); else - lock_profile_release_lock(&rw->lock_object); + lock_profile_release_lock(&rw->lock_object, false); TD_LOCKS_DEC(curthread); } @@ -975,7 +975,7 @@ __rw_wlock_hard(volatile uintptr_t *c, uintptr_t v LOCK_FILE_LINE_ARG_DEF) #ifdef HWPMC_HOOKS PMC_SOFT_CALL( , , lock, failed); #endif - lock_profile_obtain_lock_failed(&rw->lock_object, + lock_profile_obtain_lock_failed(&rw->lock_object, false, &contested, &waittime); for (;;) { diff --git a/sys/kern/kern_sx.c b/sys/kern/kern_sx.c index 0d914375ec87..d8bdf4a17358 100644 --- a/sys/kern/kern_sx.c +++ b/sys/kern/kern_sx.c @@ -648,7 +648,7 @@ _sx_xlock_hard(struct sx *sx, uintptr_t x, int opts LOCK_FILE_LINE_ARG_DEF) #ifdef HWPMC_HOOKS PMC_SOFT_CALL( , , lock, failed); #endif - lock_profile_obtain_lock_failed(&sx->lock_object, &contested, + lock_profile_obtain_lock_failed(&sx->lock_object, false, &contested, &waittime); #ifndef INVARIANTS @@ -1069,7 +1069,7 @@ _sx_slock_hard(struct sx *sx, int opts, uintptr_t x LOCK_FILE_LINE_ARG_DEF) #ifdef HWPMC_HOOKS PMC_SOFT_CALL( , , lock, failed); #endif - lock_profile_obtain_lock_failed(&sx->lock_object, &contested, + lock_profile_obtain_lock_failed(&sx->lock_object, false, &contested, &waittime); #ifndef INVARIANTS @@ -1272,7 +1272,7 @@ _sx_slock_int(struct sx *sx, int opts LOCK_FILE_LINE_ARG_DEF) !__sx_slock_try(sx, td, &x, true LOCK_FILE_LINE_ARG))) error = _sx_slock_hard(sx, opts, x LOCK_FILE_LINE_ARG); else - lock_profile_obtain_lock_success(&sx->lock_object, 0, 0, + lock_profile_obtain_lock_success(&sx->lock_object, false, 0, 0, file, line); if (error == 0) { LOCK_LOG_LOCK("SLOCK", &sx->lock_object, 0, 0, file, line); @@ -1379,7 +1379,7 @@ _sx_sunlock_int(struct sx *sx LOCK_FILE_LINE_ARG_DEF) !_sx_sunlock_try(sx, td, &x))) _sx_sunlock_hard(sx, td, x LOCK_FILE_LINE_ARG); else - lock_profile_release_lock(&sx->lock_object); + lock_profile_release_lock(&sx->lock_object, false); TD_LOCKS_DEC(curthread); } diff --git a/sys/kern/sched_4bsd.c b/sys/kern/sched_4bsd.c index 7b44e12ef330..a3290de9f460 100644 --- a/sys/kern/sched_4bsd.c +++ b/sys/kern/sched_4bsd.c @@ -1053,7 +1053,7 @@ sched_switch(struct thread *td, int flags) SDT_PROBE2(sched, , , off__cpu, newtd, newtd->td_proc); /* I feel sleepy */ - lock_profile_release_lock(&sched_lock.lock_object); + lock_profile_release_lock(&sched_lock.lock_object, true); #ifdef KDTRACE_HOOKS /* * If DTrace has set the active vtime enum to anything @@ -1065,7 +1065,7 @@ sched_switch(struct thread *td, int flags) #endif cpu_switch(td, newtd, tmtx); - lock_profile_obtain_lock_success(&sched_lock.lock_object, + lock_profile_obtain_lock_success(&sched_lock.lock_object, true, 0, 0, __FILE__, __LINE__); /* * Where am I? What year is it? @@ -1676,7 +1676,7 @@ sched_throw(struct thread *td) PCPU_SET(switchtime, cpu_ticks()); PCPU_SET(switchticks, ticks); } else { - lock_profile_release_lock(&sched_lock.lock_object); + lock_profile_release_lock(&sched_lock.lock_object, true); MPASS(td->td_lock == &sched_lock); td->td_lastcpu = td->td_oncpu; td->td_oncpu = NOCPU; @@ -1696,7 +1696,7 @@ sched_fork_exit(struct thread *td) */ td->td_oncpu = PCPU_GET(cpuid); sched_lock.mtx_lock = (uintptr_t)td; - lock_profile_obtain_lock_success(&sched_lock.lock_object, + lock_profile_obtain_lock_success(&sched_lock.lock_object, true, 0, 0, __FILE__, __LINE__); THREAD_LOCK_ASSERT(td, MA_OWNED | MA_NOTRECURSED); diff --git a/sys/kern/subr_lock.c b/sys/kern/subr_lock.c index 6d91118ae0f3..7c3bfec3ea40 100644 --- a/sys/kern/subr_lock.c +++ b/sys/kern/subr_lock.c @@ -57,6 +57,12 @@ __FBSDID("$FreeBSD$"); #include +/* + * Uncomment to validate that spin argument to acquire/release routines matches + * the flag in the lock + */ +//#define LOCK_PROFILING_DEBUG_SPIN + SDT_PROVIDER_DEFINE(lock); SDT_PROBE_DEFINE1(lock, , , starvation, "u_int"); @@ -593,11 +599,17 @@ lock_profile_object_lookup(struct lock_object *lo, int spin, const char *file, } void -lock_profile_obtain_lock_success(struct lock_object *lo, int contested, - uint64_t waittime, const char *file, int line) +lock_profile_obtain_lock_success(struct lock_object *lo, bool spin, + int contested, uint64_t waittime, const char *file, int line) { struct lock_profile_object *l; - int spin; + +#ifdef LOCK_PROFILING_DEBUG_SPIN + bool is_spin = (LOCK_CLASS(lo)->lc_flags & LC_SPINLOCK); + if ((spin && !is_spin) || (!spin && is_spin)) + printf("%s: lock %s spin mismatch (arg %d, flag %d)\n", __func__, + lo->lo_name, spin, is_spin); +#endif if (SCHEDULER_STOPPED()) return; @@ -607,7 +619,6 @@ lock_profile_obtain_lock_success(struct lock_object *lo, int contested, return; if (lock_contested_only && !contested) return; - spin = (LOCK_CLASS(lo)->lc_flags & LC_SPINLOCK) ? 1 : 0; if (spin && lock_prof_skipspin == 1) return; critical_enter(); @@ -660,20 +671,25 @@ lock_profile_thread_exit(struct thread *td) } void -lock_profile_release_lock(struct lock_object *lo) +lock_profile_release_lock(struct lock_object *lo, bool spin) { struct lock_profile_object *l; struct lock_prof_type *type; struct lock_prof *lp; uint64_t curtime, holdtime; struct lpohead *head; - int spin; + +#ifdef LOCK_PROFILING_DEBUG_SPIN + bool is_spin = (LOCK_CLASS(lo)->lc_flags & LC_SPINLOCK); + if ((spin && !is_spin) || (!spin && is_spin)) + printf("%s: lock %s spin mismatch (arg %d, flag %d)\n", __func__, + lo->lo_name, spin, is_spin); +#endif if (SCHEDULER_STOPPED()) return; if (lo->lo_flags & LO_NOPROFILE) return; - spin = (LOCK_CLASS(lo)->lc_flags & LC_SPINLOCK) ? 1 : 0; head = &curthread->td_lprof[spin]; if (LIST_FIRST(head) == NULL) return; diff --git a/sys/sys/lock_profile.h b/sys/sys/lock_profile.h index 2ace6ef56983..de1a95779254 100644 --- a/sys/sys/lock_profile.h +++ b/sys/sys/lock_profile.h @@ -46,14 +46,14 @@ u_int64_t nanoseconds(void); extern volatile int lock_prof_enable; -void lock_profile_obtain_lock_success(struct lock_object *lo, int contested, - uint64_t waittime, const char *file, int line); -void lock_profile_release_lock(struct lock_object *lo); +void lock_profile_obtain_lock_success(struct lock_object *lo, bool spin, + int contested, uint64_t waittime, const char *file, int line); +void lock_profile_release_lock(struct lock_object *lo, bool spin); void lock_profile_thread_exit(struct thread *td); static inline void -lock_profile_obtain_lock_failed(struct lock_object *lo, int *contested, - uint64_t *waittime) +lock_profile_obtain_lock_failed(struct lock_object *lo, bool spin, + int *contested, uint64_t *waittime) { if (!lock_prof_enable || (lo->lo_flags & LO_NOPROFILE) || *contested) return; @@ -63,9 +63,9 @@ lock_profile_obtain_lock_failed(struct lock_object *lo, int *contested, #else /* !LOCK_PROFILING */ -#define lock_profile_release_lock(lo) (void)0 -#define lock_profile_obtain_lock_failed(lo, contested, waittime) (void)0 -#define lock_profile_obtain_lock_success(lo, contested, waittime, file, line) (void)0 +#define lock_profile_release_lock(lo, spin) (void)0 +#define lock_profile_obtain_lock_failed(lo, spin, contested, waittime) (void)0 +#define lock_profile_obtain_lock_success(lo, spin, contested, waittime, file, line) (void)0 #define lock_profile_thread_exit(td) (void)0 #endif /* !LOCK_PROFILING */ diff --git a/sys/sys/lockstat.h b/sys/sys/lockstat.h index 6a5f79a2f152..76bd97dbafa5 100644 --- a/sys/sys/lockstat.h +++ b/sys/sys/lockstat.h @@ -97,22 +97,32 @@ extern volatile bool lockstat_enabled; SDT_PROBE5(lockstat, , , probe, lp, arg1, arg2, arg3, arg4) #define LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(probe, lp, c, wt, f, l) do { \ - lock_profile_obtain_lock_success(&(lp)->lock_object, c, wt, f, l); \ + lock_profile_obtain_lock_success(&(lp)->lock_object, false, c, wt, f, l); \ + LOCKSTAT_RECORD0(probe, lp); \ +} while (0) + +#define LOCKSTAT_PROFILE_OBTAIN_SPIN_LOCK_SUCCESS(probe, lp, c, wt, f, l) do { \ + lock_profile_obtain_lock_success(&(lp)->lock_object, true, c, wt, f, l); \ LOCKSTAT_RECORD0(probe, lp); \ } while (0) #define LOCKSTAT_PROFILE_OBTAIN_RWLOCK_SUCCESS(probe, lp, c, wt, f, l, a) do { \ - lock_profile_obtain_lock_success(&(lp)->lock_object, c, wt, f, l); \ + lock_profile_obtain_lock_success(&(lp)->lock_object, false, c, wt, f, l); \ LOCKSTAT_RECORD1(probe, lp, a); \ } while (0) #define LOCKSTAT_PROFILE_RELEASE_LOCK(probe, lp) do { \ - lock_profile_release_lock(&(lp)->lock_object); \ + lock_profile_release_lock(&(lp)->lock_object, false); \ + LOCKSTAT_RECORD0(probe, lp); \ +} while (0) + +#define LOCKSTAT_PROFILE_RELEASE_SPIN_LOCK(probe, lp) do { \ + lock_profile_release_lock(&(lp)->lock_object, true); \ LOCKSTAT_RECORD0(probe, lp); \ } while (0) #define LOCKSTAT_PROFILE_RELEASE_RWLOCK(probe, lp, a) do { \ - lock_profile_release_lock(&(lp)->lock_object); \ + lock_profile_release_lock(&(lp)->lock_object, false); \ LOCKSTAT_RECORD1(probe, lp, a); \ } while (0) @@ -130,13 +140,19 @@ uint64_t lockstat_nsecs(struct lock_object *); #define LOCKSTAT_RECORD4(probe, lp, arg1, arg2, arg3, arg4) #define LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(probe, lp, c, wt, f, l) \ - lock_profile_obtain_lock_success(&(lp)->lock_object, c, wt, f, l) + lock_profile_obtain_lock_success(&(lp)->lock_object, false, c, wt, f, l) + +#define LOCKSTAT_PROFILE_OBTAIN_SPIN_LOCK_SUCCESS(probe, lp, c, wt, f, l) \ + lock_profile_obtain_lock_success(&(lp)->lock_object, true, c, wt, f, l) #define LOCKSTAT_PROFILE_OBTAIN_RWLOCK_SUCCESS(probe, lp, c, wt, f, l, a) \ LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(probe, lp, c, wt, f, l) #define LOCKSTAT_PROFILE_RELEASE_LOCK(probe, lp) \ - lock_profile_release_lock(&(lp)->lock_object) + lock_profile_release_lock(&(lp)->lock_object, false) + +#define LOCKSTAT_PROFILE_RELEASE_SPIN_LOCK(probe, lp) \ + lock_profile_release_lock(&(lp)->lock_object, true) #define LOCKSTAT_PROFILE_RELEASE_RWLOCK(probe, lp, a) \ LOCKSTAT_PROFILE_RELEASE_LOCK(probe, lp) diff --git a/sys/sys/mutex.h b/sys/sys/mutex.h index 35257ce97038..f35cdd7413a6 100644 --- a/sys/sys/mutex.h +++ b/sys/sys/mutex.h @@ -270,7 +270,7 @@ void _thread_lock(struct thread *); spinlock_exit(); \ _ret = 0; \ } else { \ - LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(spin__acquire, \ + LOCKSTAT_PROFILE_OBTAIN_SPIN_LOCK_SUCCESS(spin__acquire, \ mp, 0, 0, file, line); \ _ret = 1; \ } \ @@ -328,7 +328,7 @@ void _thread_lock(struct thread *); if (mtx_recursed((mp))) \ (mp)->mtx_recurse--; \ else { \ - LOCKSTAT_PROFILE_RELEASE_LOCK(spin__release, mp); \ + LOCKSTAT_PROFILE_RELEASE_SPIN_LOCK(spin__release, mp); \ _mtx_release_lock_quick((mp)); \ } \ spinlock_exit(); \ @@ -338,7 +338,7 @@ void _thread_lock(struct thread *); if (mtx_recursed((mp))) \ (mp)->mtx_recurse--; \ else { \ - LOCKSTAT_PROFILE_RELEASE_LOCK(spin__release, mp); \ + LOCKSTAT_PROFILE_RELEASE_SPIN_LOCK(spin__release, mp); \ (mp)->mtx_lock = MTX_UNOWNED; \ } \ spinlock_exit(); \ From owner-dev-commits-src-branches@freebsd.org Wed Jun 2 15:01:50 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B3F6E6450C6; Wed, 2 Jun 2021 15:01: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 4FwC0t2L2Lz3kTH; Wed, 2 Jun 2021 15:01:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3249218D4F; Wed, 2 Jun 2021 15:01:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 152F1ovg031810; Wed, 2 Jun 2021 15:01:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 152F1oKZ031809; Wed, 2 Jun 2021 15:01:50 GMT (envelope-from git) Date: Wed, 2 Jun 2021 15:01:50 GMT Message-Id: <202106021501.152F1oKZ031809@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 66eda48003ae - stable/13 - lockprof: move panic check after inspecting the state MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 66eda48003ae7f320f2975123783c7f47c93ca1a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jun 2021 15:01:50 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=66eda48003ae7f320f2975123783c7f47c93ca1a commit 66eda48003ae7f320f2975123783c7f47c93ca1a Author: Mateusz Guzik AuthorDate: 2021-05-23 16:04:31 +0000 Commit: Mateusz Guzik CommitDate: 2021-06-02 15:00:23 +0000 lockprof: move panic check after inspecting the state (cherry picked from commit e2ab16b1a6c0f556299df21be54f04652ba7169d) --- sys/kern/subr_lock.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/sys/kern/subr_lock.c b/sys/kern/subr_lock.c index 7c3bfec3ea40..36ba9125e176 100644 --- a/sys/kern/subr_lock.c +++ b/sys/kern/subr_lock.c @@ -611,9 +611,6 @@ lock_profile_obtain_lock_success(struct lock_object *lo, bool spin, lo->lo_name, spin, is_spin); #endif - if (SCHEDULER_STOPPED()) - return; - /* don't reset the timer when/if recursing */ if (!lock_prof_enable || (lo->lo_flags & LO_NOPROFILE)) return; @@ -621,6 +618,10 @@ lock_profile_obtain_lock_success(struct lock_object *lo, bool spin, return; if (spin && lock_prof_skipspin == 1) return; + + if (SCHEDULER_STOPPED()) + return; + critical_enter(); /* Recheck enabled now that we're in a critical section. */ if (lock_prof_enable == 0) @@ -686,13 +687,13 @@ lock_profile_release_lock(struct lock_object *lo, bool spin) lo->lo_name, spin, is_spin); #endif - if (SCHEDULER_STOPPED()) - return; if (lo->lo_flags & LO_NOPROFILE) return; head = &curthread->td_lprof[spin]; if (LIST_FIRST(head) == NULL) return; + if (SCHEDULER_STOPPED()) + return; critical_enter(); /* Recheck enabled now that we're in a critical section. */ if (lock_prof_enable == 0 && lock_prof_resetting == 1) From owner-dev-commits-src-branches@freebsd.org Wed Jun 2 18:51:05 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A21AF6498CA; Wed, 2 Jun 2021 18:51: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 4FwJ5P4D5Gz4YM4; Wed, 2 Jun 2021 18:51:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 79B9B1BCB3; Wed, 2 Jun 2021 18:51:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 152Ip5MO038213; Wed, 2 Jun 2021 18:51:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 152Ip5wB038211; Wed, 2 Jun 2021 18:51:05 GMT (envelope-from git) Date: Wed, 2 Jun 2021 18:51:05 GMT Message-Id: <202106021851.152Ip5wB038211@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: cca9c2f51372 - stable/12 - pf tests: Test cases for fragment reassembly MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: cca9c2f51372f7a6c69b52617f58be4d725910f0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jun 2021 18:51:05 -0000 The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=cca9c2f51372f7a6c69b52617f58be4d725910f0 commit cca9c2f51372f7a6c69b52617f58be4d725910f0 Author: Kristof Provost AuthorDate: 2021-02-25 08:50:57 +0000 Commit: Kristof Provost CommitDate: 2021-06-02 18:40:07 +0000 pf tests: Test cases for fragment reassembly Obtained from: Alexander Bluhm, OpenBSD (cherry picked from commit d39d5ee2d67f61abc890b51973b5c4a0c81d6647) --- tests/sys/netpfil/pf/Makefile | 10 +++- tests/sys/netpfil/pf/frag-overindex.py | 82 ++++++++++++++++++++++++++++++ tests/sys/netpfil/pf/frag-overlimit.py | 87 ++++++++++++++++++++++++++++++++ tests/sys/netpfil/pf/frag-overreplace.py | 84 ++++++++++++++++++++++++++++++ tests/sys/netpfil/pf/fragcommon.py | 52 +++++++++++++++++++ tests/sys/netpfil/pf/fragmentation.sh | 83 ++++++++++++++++++++++++++++++ 6 files changed, 397 insertions(+), 1 deletion(-) diff --git a/tests/sys/netpfil/pf/Makefile b/tests/sys/netpfil/pf/Makefile index 34740ca9dca2..f67f510fbf29 100644 --- a/tests/sys/netpfil/pf/Makefile +++ b/tests/sys/netpfil/pf/Makefile @@ -29,9 +29,17 @@ ATF_TESTS_SH+= anchor \ ${PACKAGE}FILES+= utils.subr \ echo_inetd.conf \ CVE-2019-5597.py \ - CVE-2019-5598.py + CVE-2019-5598.py \ + fragcommon.py \ + frag-overindex.py \ + frag-overlimit.py \ + frag-overreplace.py ${PACKAGE}FILESMODE_CVE-2019-5597.py= 0555 ${PACKAGE}FILESMODE_CVE-2019-5598.py= 0555 +${PACKAGE}FILESMODE_fragcommon.py= 0555 +${PACKAGE}FILESMODE_frag-overindex.py= 0555 +${PACKAGE}FILESMODE_frag-overlimit.py= 0555 +${PACKAGE}FILESMODE_frag-overreplace.py= 0555 .include diff --git a/tests/sys/netpfil/pf/frag-overindex.py b/tests/sys/netpfil/pf/frag-overindex.py new file mode 100644 index 000000000000..594eb9efe39d --- /dev/null +++ b/tests/sys/netpfil/pf/frag-overindex.py @@ -0,0 +1,82 @@ +#!/usr/bin/env python3 +# +# SPDX-License-Identifier: ISC +# +# Copyright (c) 2012-2021 Alexander Bluhm +# +# Permission to use, copy, modify, and distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +from fragcommon import * + +# index boundary 4096 | +# |--------------| +# .... +# |--------------| +# |XXXX-----| +# |--------------| +# +# this should trigger "frag index %d, new %d" log in kernel + +def send(src, dst, send_if, recv_if): + pid = os.getpid() + eid = pid & 0xffff + payload = b"ABCDEFGHIJKLMNOP" + dummy = b"01234567" + fragsize = 64 + boundary = 4096 + fragnum = int(boundary / fragsize) + packet = sp.IP(src=src, dst=dst)/ \ + sp.ICMP(type='echo-request', id=eid)/ \ + (int((boundary + 8) / len(payload)) * payload) + frag = [] + fid = pid & 0xffff + for i in range(fragnum - 1): + frag.append(sp.IP(src=src, dst=dst, proto=1, id=fid, + frag=(i * fragsize) >> 3, flags='MF') / + bytes(packet)[20 + i * fragsize:20 + (i + 1) * fragsize]) + frag.append(sp.IP(src=src, dst=dst, proto=1, id=fid, + frag=(boundary - 8) >> 3) / + (dummy + bytes(packet)[20 + boundary:20 + boundary + 8])) + frag.append(sp.IP(src=src, dst=dst, proto=1, id=fid, + frag=(boundary - fragsize) >> 3, flags='MF') / + bytes(packet)[20 + boundary - fragsize:20 + boundary]) + eth = [] + for f in frag: + eth.append(sp.Ether() / f) + + if os.fork() == 0: + time.sleep(1) + for e in eth: + sp.sendp(e, iface=send_if) + time.sleep(0.001) + os._exit(0) + + ans = sp.sniff(iface=recv_if, timeout=5) + print(ans) + for a in ans: + a.show() + if a and a.type == sp.ETH_P_IP and \ + a.payload.proto == 1 and \ + a.payload.frag == 0 and \ + sp.icmptypes[a.payload.payload.type] == 'echo-reply': + id = a.payload.payload.id + print("id=%#x" % (id)) + if id != eid: + print("WRONG ECHO REPLY ID") + sys.exit(2) + sys.exit(0) + print("NO ECHO REPLY") + exit(1) + +if __name__ == '__main__': + main(send) diff --git a/tests/sys/netpfil/pf/frag-overlimit.py b/tests/sys/netpfil/pf/frag-overlimit.py new file mode 100644 index 000000000000..e25ebf5b0dcd --- /dev/null +++ b/tests/sys/netpfil/pf/frag-overlimit.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python3 +# +# SPDX-License-Identifier: ISC +# +# Copyright (c) 2012-2021 Alexander Bluhm +# +# Permission to use, copy, modify, and distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +from fragcommon import * +from itertools import chain + +# index boundary 4096 | +# |--------------| +# .... +# |--------------| +# |--------------| +# ....----| +# |XXXX-----| +# |--------------| + +# this should trigger "fragment requeue limit exceeded" log in kernel + +def send(src, dst, send_if, recv_if): + pid = os.getpid() + eid = pid & 0xffff + payload = b"ABCDEFGHIJKLMNOP" + dummy = b"01234567" + fragsize = 64 + boundary = 4096 + fragnum= int(boundary / fragsize) + packet = sp.IP(src=src, dst=dst)/ \ + sp.ICMP(type='echo-request', id=eid)/ \ + (int((boundary + boundary) / len(payload)) * payload) + frag = [] + fid = pid & 0xffff + for i in chain(range(fragnum - 1), range(fragnum, fragnum + fragnum - 1)): + frag.append(sp.IP(src=src, dst=dst, proto=1, id=fid, + frag=(i * fragsize) >> 3, flags='MF') / + bytes(packet)[20 + i * fragsize:20 + (i + 1) * fragsize]) + frag.append(sp.IP(src=src, dst=dst, proto=1, id=fid, + frag=(boundary + boundary - fragsize) >> 3) / + bytes(packet)[20 + boundary + boundary - fragsize:]) + frag.append(sp.IP(src=src, dst=dst, proto=1, id=fid, + frag=(boundary - 8) >> 3, flags='MF')/ + (dummy + bytes(packet)[20 + boundary:20 + boundary + 8])) + frag.append(sp.IP(src=src, dst=dst, proto=1, id=fid, + frag=(boundary - fragsize) >> 3, flags='MF') / + bytes(packet)[20 + boundary - fragsize:20 + boundary]) + eth = [] + for f in frag: + eth.append(sp.Ether() / f) + + if os.fork() == 0: + time.sleep(1) + for e in eth: + sp.sendp(e, iface=send_if) + time.sleep(0.001) + os._exit(0) + + ans = sp.sniff(iface=recv_if, timeout=10, filter= + "ip and src " + dst + " and dst " + src + " and icmp") + for a in ans: + if a and a.type == ETH_P_IP and \ + a.payload.proto == 1 and \ + a.payload.frag == 0 and \ + sp.icmptypes[a.payload.payload.type] == 'echo-reply': + id = a.payload.payload.id + print("id=%#x" % (id)) + if id != eid: + print("WRONG ECHO REPLY ID") + sys.exit(2) + print("ECHO REPLY") + sys.exit(1) + sys.exit(0) + +if __name__ == '__main__': + main(send) diff --git a/tests/sys/netpfil/pf/frag-overreplace.py b/tests/sys/netpfil/pf/frag-overreplace.py new file mode 100644 index 000000000000..ff9184243a1d --- /dev/null +++ b/tests/sys/netpfil/pf/frag-overreplace.py @@ -0,0 +1,84 @@ +#!/usr/bin/env python3 +# +# SPDX-License-Identifier: ISC +# +# Copyright (c) 2012-2021 Alexander Bluhm +# +# Permission to use, copy, modify, and distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +from fragcommon import * + +# index boundary 4096 | +# |--------------| +# .... +# |--------------| +# |XXXX-----| +# |--------------| +# |--------------| + +# this should trigger "frag tail overlap %d" and "frag head overlap %d" + +def send(src, dst, send_if, recv_if): + pid = os.getpid() + eid = pid & 0xffff + payload = b"ABCDEFGHIJKLMNOP" + dummy = b"01234567" + fragsize = 1024 + boundary = 4096 + fragnum = int(boundary / fragsize) + packet = sp.IP(src=src, dst=dst)/ \ + sp.ICMP(type='echo-request', id=eid)/ \ + (int((boundary + fragsize) / len(payload)) * payload) + frag = [] + fid = pid & 0xffff + + for i in range(fragnum - 1): + frag.append(sp.IP(src=src, dst=dst, proto=1, id=fid, + frag=(i * fragsize) >> 3, flags='MF') / + bytes(packet)[20 + i * fragsize:20 + (i + 1) * fragsize]) + frag.append(sp.IP(src=src, dst=dst, proto=1, id=fid, + frag=(boundary - 8) >> 3, flags='MF') / + (dummy + bytes(packet)[20 + boundary:20 + boundary + 8])) + frag.append(sp.IP(src=src, dst=dst, proto=1, id=fid, + frag=(boundary - fragsize) >> 3, flags='MF') / + bytes(packet)[20 + boundary - fragsize:20 + boundary]) + frag.append(sp.IP(src=src, dst=dst, proto=1, id=fid, + frag=(boundary) >> 3)/bytes(packet)[20 + boundary:]) + + eth=[] + for f in frag: + eth.append(sp.Ether() / f) + + if os.fork() == 0: + time.sleep(1) + for e in eth: + sp.sendp(e, iface=send_if) + time.sleep(0.001) + os._exit(0) + + ans = sp.sniff(iface=recv_if, timeout=3, filter="") + for a in ans: + if a and a.type == sp.ETH_P_IP and \ + a.payload.proto == 1 and \ + a.payload.frag == 0 and \ + sp.icmptypes[a.payload.payload.type] == 'echo-reply': + id=a.payload.payload.id + if id != eid: + print("WRONG ECHO REPLY ID") + sys.exit(2) + sys.exit(0) + print("NO ECHO REPLY") + sys.exit(1) + +if __name__ == '__main__': + main(send) diff --git a/tests/sys/netpfil/pf/fragcommon.py b/tests/sys/netpfil/pf/fragcommon.py new file mode 100644 index 000000000000..2bcd3989b420 --- /dev/null +++ b/tests/sys/netpfil/pf/fragcommon.py @@ -0,0 +1,52 @@ +#!/usr/bin/env python3 +# +# SPDX-License-Identifier: BSD-2-Clause +# +# Copyright (c) 2021 Rubicon Communications, LLC (Netgate). All Rights Reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. + +import argparse +import os +import scapy.all as sp +import sys +import time + +def main(send): + parser = argparse.ArgumentParser("frag-overindex.py", + description="Fragmentation test tool") + parser.add_argument('--to', nargs=1, + required=True, + help='The address to send the fragmented packets to') + parser.add_argument('--fromaddr', nargs=1, + required=True, + help='The source address for the generated packets') + parser.add_argument('--sendif', nargs=1, + required=True, + help='The interface through which the packet(s) will be sent') + parser.add_argument('--recvif', nargs=1, + required=True, + help='The interface to expect the reply on') + + args = parser.parse_args() + + send(args.fromaddr[0], args.to[0], args.sendif[0], args.recvif[0]) diff --git a/tests/sys/netpfil/pf/fragmentation.sh b/tests/sys/netpfil/pf/fragmentation.sh index fe92a2ec88e3..de83f5d5c82b 100755 --- a/tests/sys/netpfil/pf/fragmentation.sh +++ b/tests/sys/netpfil/pf/fragmentation.sh @@ -189,9 +189,92 @@ mtu_diff_cleanup() pft_cleanup } +frag_common() +{ + name=$1 + + pft_init + + epair=$(vnet_mkepair) + vnet_mkjail alcatraz ${epair}a + + ifconfig ${epair}b inet 192.0.2.1/24 up + jexec alcatraz ifconfig ${epair}a 192.0.2.2/24 up + + jexec alcatraz pfctl -e + pft_set_rules alcatraz \ + "scrub all fragment reassemble" + + # Sanity check + atf_check -s exit:0 -o ignore ping -c 1 192.0.2.2 + + atf_check -s exit:0 -o ignore $(atf_get_srcdir)/frag-${1}.py \ + --to 192.0.2.2 \ + --fromaddr 192.0.2.1 \ + --sendif ${epair}b \ + --recvif ${epair}b +} + +atf_test_case "overreplace" "cleanup" +overreplace_head() +{ + atf_set descr 'ping fragment that overlaps fragment at index boundary and replace it' + atf_set require.user root + atf_set require.progs scapy +} + +overreplace_body() +{ + frag_common overreplace +} + +overreplace_cleanup() +{ + pft_cleanup +} + +atf_test_case "overindex" "cleanup" +overindex_head() +{ + atf_set descr 'ping fragment that overlaps the first fragment at index boundary' + atf_set require.user root + atf_set require.progs scapy +} + +overindex_body() +{ + frag_common overindex +} + +overindex_cleanup() +{ + pft_cleanup +} + +atf_test_case "overlimit" "cleanup" +overlimit_head() +{ + atf_set descr 'ping fragment at index boundary that cannot be requeued' + atf_set require.user root + atf_set require.progs scapy +} + +overlimit_body() +{ + frag_common overlimit +} + +overlimit_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "too_many_fragments" atf_add_test_case "v6" atf_add_test_case "mtu_diff" + atf_add_test_case "overreplace" + atf_add_test_case "overindex" + atf_add_test_case "overlimit" } From owner-dev-commits-src-branches@freebsd.org Wed Jun 2 18:51:05 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BC941649A8B; Wed, 2 Jun 2021 18:51: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 4FwJ5P50dwz4Y96; Wed, 2 Jun 2021 18:51:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 919E11C1CD; Wed, 2 Jun 2021 18:51:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 152Ip5kh038261; Wed, 2 Jun 2021 18:51:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 152Ip5JW038260; Wed, 2 Jun 2021 18:51:05 GMT (envelope-from git) Date: Wed, 2 Jun 2021 18:51:05 GMT Message-Id: <202106021851.152Ip5JW038260@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: b4612f6a27b0 - stable/13 - pf tests: Test cases for fragment reassembly MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b4612f6a27b05692119326ea6277d844a741fcf1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jun 2021 18:51:05 -0000 The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=b4612f6a27b05692119326ea6277d844a741fcf1 commit b4612f6a27b05692119326ea6277d844a741fcf1 Author: Kristof Provost AuthorDate: 2021-02-25 08:50:57 +0000 Commit: Kristof Provost CommitDate: 2021-06-02 18:50:56 +0000 pf tests: Test cases for fragment reassembly Obtained from: Alexander Bluhm, OpenBSD (cherry picked from commit d39d5ee2d67f61abc890b51973b5c4a0c81d6647) --- tests/sys/netpfil/pf/Makefile | 8 +++ tests/sys/netpfil/pf/frag-overindex.py | 82 ++++++++++++++++++++++++++++++ tests/sys/netpfil/pf/frag-overlimit.py | 87 ++++++++++++++++++++++++++++++++ tests/sys/netpfil/pf/frag-overreplace.py | 84 ++++++++++++++++++++++++++++++ tests/sys/netpfil/pf/fragcommon.py | 52 +++++++++++++++++++ tests/sys/netpfil/pf/fragmentation.sh | 83 ++++++++++++++++++++++++++++++ 6 files changed, 396 insertions(+) diff --git a/tests/sys/netpfil/pf/Makefile b/tests/sys/netpfil/pf/Makefile index d2dbbcdd18f6..e21f78e761b6 100644 --- a/tests/sys/netpfil/pf/Makefile +++ b/tests/sys/netpfil/pf/Makefile @@ -30,9 +30,17 @@ ATF_TESTS_SH+= anchor \ ${PACKAGE}FILES+= CVE-2019-5597.py \ CVE-2019-5598.py \ echo_inetd.conf \ + fragcommon.py \ + frag-overindex.py \ + frag-overlimit.py \ + frag-overreplace.py \ utils.subr ${PACKAGE}FILESMODE_CVE-2019-5597.py= 0555 ${PACKAGE}FILESMODE_CVE-2019-5598.py= 0555 +${PACKAGE}FILESMODE_fragcommon.py= 0555 +${PACKAGE}FILESMODE_frag-overindex.py= 0555 +${PACKAGE}FILESMODE_frag-overlimit.py= 0555 +${PACKAGE}FILESMODE_frag-overreplace.py= 0555 .include diff --git a/tests/sys/netpfil/pf/frag-overindex.py b/tests/sys/netpfil/pf/frag-overindex.py new file mode 100644 index 000000000000..594eb9efe39d --- /dev/null +++ b/tests/sys/netpfil/pf/frag-overindex.py @@ -0,0 +1,82 @@ +#!/usr/bin/env python3 +# +# SPDX-License-Identifier: ISC +# +# Copyright (c) 2012-2021 Alexander Bluhm +# +# Permission to use, copy, modify, and distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +from fragcommon import * + +# index boundary 4096 | +# |--------------| +# .... +# |--------------| +# |XXXX-----| +# |--------------| +# +# this should trigger "frag index %d, new %d" log in kernel + +def send(src, dst, send_if, recv_if): + pid = os.getpid() + eid = pid & 0xffff + payload = b"ABCDEFGHIJKLMNOP" + dummy = b"01234567" + fragsize = 64 + boundary = 4096 + fragnum = int(boundary / fragsize) + packet = sp.IP(src=src, dst=dst)/ \ + sp.ICMP(type='echo-request', id=eid)/ \ + (int((boundary + 8) / len(payload)) * payload) + frag = [] + fid = pid & 0xffff + for i in range(fragnum - 1): + frag.append(sp.IP(src=src, dst=dst, proto=1, id=fid, + frag=(i * fragsize) >> 3, flags='MF') / + bytes(packet)[20 + i * fragsize:20 + (i + 1) * fragsize]) + frag.append(sp.IP(src=src, dst=dst, proto=1, id=fid, + frag=(boundary - 8) >> 3) / + (dummy + bytes(packet)[20 + boundary:20 + boundary + 8])) + frag.append(sp.IP(src=src, dst=dst, proto=1, id=fid, + frag=(boundary - fragsize) >> 3, flags='MF') / + bytes(packet)[20 + boundary - fragsize:20 + boundary]) + eth = [] + for f in frag: + eth.append(sp.Ether() / f) + + if os.fork() == 0: + time.sleep(1) + for e in eth: + sp.sendp(e, iface=send_if) + time.sleep(0.001) + os._exit(0) + + ans = sp.sniff(iface=recv_if, timeout=5) + print(ans) + for a in ans: + a.show() + if a and a.type == sp.ETH_P_IP and \ + a.payload.proto == 1 and \ + a.payload.frag == 0 and \ + sp.icmptypes[a.payload.payload.type] == 'echo-reply': + id = a.payload.payload.id + print("id=%#x" % (id)) + if id != eid: + print("WRONG ECHO REPLY ID") + sys.exit(2) + sys.exit(0) + print("NO ECHO REPLY") + exit(1) + +if __name__ == '__main__': + main(send) diff --git a/tests/sys/netpfil/pf/frag-overlimit.py b/tests/sys/netpfil/pf/frag-overlimit.py new file mode 100644 index 000000000000..e25ebf5b0dcd --- /dev/null +++ b/tests/sys/netpfil/pf/frag-overlimit.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python3 +# +# SPDX-License-Identifier: ISC +# +# Copyright (c) 2012-2021 Alexander Bluhm +# +# Permission to use, copy, modify, and distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +from fragcommon import * +from itertools import chain + +# index boundary 4096 | +# |--------------| +# .... +# |--------------| +# |--------------| +# ....----| +# |XXXX-----| +# |--------------| + +# this should trigger "fragment requeue limit exceeded" log in kernel + +def send(src, dst, send_if, recv_if): + pid = os.getpid() + eid = pid & 0xffff + payload = b"ABCDEFGHIJKLMNOP" + dummy = b"01234567" + fragsize = 64 + boundary = 4096 + fragnum= int(boundary / fragsize) + packet = sp.IP(src=src, dst=dst)/ \ + sp.ICMP(type='echo-request', id=eid)/ \ + (int((boundary + boundary) / len(payload)) * payload) + frag = [] + fid = pid & 0xffff + for i in chain(range(fragnum - 1), range(fragnum, fragnum + fragnum - 1)): + frag.append(sp.IP(src=src, dst=dst, proto=1, id=fid, + frag=(i * fragsize) >> 3, flags='MF') / + bytes(packet)[20 + i * fragsize:20 + (i + 1) * fragsize]) + frag.append(sp.IP(src=src, dst=dst, proto=1, id=fid, + frag=(boundary + boundary - fragsize) >> 3) / + bytes(packet)[20 + boundary + boundary - fragsize:]) + frag.append(sp.IP(src=src, dst=dst, proto=1, id=fid, + frag=(boundary - 8) >> 3, flags='MF')/ + (dummy + bytes(packet)[20 + boundary:20 + boundary + 8])) + frag.append(sp.IP(src=src, dst=dst, proto=1, id=fid, + frag=(boundary - fragsize) >> 3, flags='MF') / + bytes(packet)[20 + boundary - fragsize:20 + boundary]) + eth = [] + for f in frag: + eth.append(sp.Ether() / f) + + if os.fork() == 0: + time.sleep(1) + for e in eth: + sp.sendp(e, iface=send_if) + time.sleep(0.001) + os._exit(0) + + ans = sp.sniff(iface=recv_if, timeout=10, filter= + "ip and src " + dst + " and dst " + src + " and icmp") + for a in ans: + if a and a.type == ETH_P_IP and \ + a.payload.proto == 1 and \ + a.payload.frag == 0 and \ + sp.icmptypes[a.payload.payload.type] == 'echo-reply': + id = a.payload.payload.id + print("id=%#x" % (id)) + if id != eid: + print("WRONG ECHO REPLY ID") + sys.exit(2) + print("ECHO REPLY") + sys.exit(1) + sys.exit(0) + +if __name__ == '__main__': + main(send) diff --git a/tests/sys/netpfil/pf/frag-overreplace.py b/tests/sys/netpfil/pf/frag-overreplace.py new file mode 100644 index 000000000000..ff9184243a1d --- /dev/null +++ b/tests/sys/netpfil/pf/frag-overreplace.py @@ -0,0 +1,84 @@ +#!/usr/bin/env python3 +# +# SPDX-License-Identifier: ISC +# +# Copyright (c) 2012-2021 Alexander Bluhm +# +# Permission to use, copy, modify, and distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +from fragcommon import * + +# index boundary 4096 | +# |--------------| +# .... +# |--------------| +# |XXXX-----| +# |--------------| +# |--------------| + +# this should trigger "frag tail overlap %d" and "frag head overlap %d" + +def send(src, dst, send_if, recv_if): + pid = os.getpid() + eid = pid & 0xffff + payload = b"ABCDEFGHIJKLMNOP" + dummy = b"01234567" + fragsize = 1024 + boundary = 4096 + fragnum = int(boundary / fragsize) + packet = sp.IP(src=src, dst=dst)/ \ + sp.ICMP(type='echo-request', id=eid)/ \ + (int((boundary + fragsize) / len(payload)) * payload) + frag = [] + fid = pid & 0xffff + + for i in range(fragnum - 1): + frag.append(sp.IP(src=src, dst=dst, proto=1, id=fid, + frag=(i * fragsize) >> 3, flags='MF') / + bytes(packet)[20 + i * fragsize:20 + (i + 1) * fragsize]) + frag.append(sp.IP(src=src, dst=dst, proto=1, id=fid, + frag=(boundary - 8) >> 3, flags='MF') / + (dummy + bytes(packet)[20 + boundary:20 + boundary + 8])) + frag.append(sp.IP(src=src, dst=dst, proto=1, id=fid, + frag=(boundary - fragsize) >> 3, flags='MF') / + bytes(packet)[20 + boundary - fragsize:20 + boundary]) + frag.append(sp.IP(src=src, dst=dst, proto=1, id=fid, + frag=(boundary) >> 3)/bytes(packet)[20 + boundary:]) + + eth=[] + for f in frag: + eth.append(sp.Ether() / f) + + if os.fork() == 0: + time.sleep(1) + for e in eth: + sp.sendp(e, iface=send_if) + time.sleep(0.001) + os._exit(0) + + ans = sp.sniff(iface=recv_if, timeout=3, filter="") + for a in ans: + if a and a.type == sp.ETH_P_IP and \ + a.payload.proto == 1 and \ + a.payload.frag == 0 and \ + sp.icmptypes[a.payload.payload.type] == 'echo-reply': + id=a.payload.payload.id + if id != eid: + print("WRONG ECHO REPLY ID") + sys.exit(2) + sys.exit(0) + print("NO ECHO REPLY") + sys.exit(1) + +if __name__ == '__main__': + main(send) diff --git a/tests/sys/netpfil/pf/fragcommon.py b/tests/sys/netpfil/pf/fragcommon.py new file mode 100644 index 000000000000..2bcd3989b420 --- /dev/null +++ b/tests/sys/netpfil/pf/fragcommon.py @@ -0,0 +1,52 @@ +#!/usr/bin/env python3 +# +# SPDX-License-Identifier: BSD-2-Clause +# +# Copyright (c) 2021 Rubicon Communications, LLC (Netgate). All Rights Reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. + +import argparse +import os +import scapy.all as sp +import sys +import time + +def main(send): + parser = argparse.ArgumentParser("frag-overindex.py", + description="Fragmentation test tool") + parser.add_argument('--to', nargs=1, + required=True, + help='The address to send the fragmented packets to') + parser.add_argument('--fromaddr', nargs=1, + required=True, + help='The source address for the generated packets') + parser.add_argument('--sendif', nargs=1, + required=True, + help='The interface through which the packet(s) will be sent') + parser.add_argument('--recvif', nargs=1, + required=True, + help='The interface to expect the reply on') + + args = parser.parse_args() + + send(args.fromaddr[0], args.to[0], args.sendif[0], args.recvif[0]) diff --git a/tests/sys/netpfil/pf/fragmentation.sh b/tests/sys/netpfil/pf/fragmentation.sh index 8b57bcf11487..8b16c9655d08 100644 --- a/tests/sys/netpfil/pf/fragmentation.sh +++ b/tests/sys/netpfil/pf/fragmentation.sh @@ -189,9 +189,92 @@ mtu_diff_cleanup() pft_cleanup } +frag_common() +{ + name=$1 + + pft_init + + epair=$(vnet_mkepair) + vnet_mkjail alcatraz ${epair}a + + ifconfig ${epair}b inet 192.0.2.1/24 up + jexec alcatraz ifconfig ${epair}a 192.0.2.2/24 up + + jexec alcatraz pfctl -e + pft_set_rules alcatraz \ + "scrub all fragment reassemble" + + # Sanity check + atf_check -s exit:0 -o ignore ping -c 1 192.0.2.2 + + atf_check -s exit:0 -o ignore $(atf_get_srcdir)/frag-${1}.py \ + --to 192.0.2.2 \ + --fromaddr 192.0.2.1 \ + --sendif ${epair}b \ + --recvif ${epair}b +} + +atf_test_case "overreplace" "cleanup" +overreplace_head() +{ + atf_set descr 'ping fragment that overlaps fragment at index boundary and replace it' + atf_set require.user root + atf_set require.progs scapy +} + +overreplace_body() +{ + frag_common overreplace +} + +overreplace_cleanup() +{ + pft_cleanup +} + +atf_test_case "overindex" "cleanup" +overindex_head() +{ + atf_set descr 'ping fragment that overlaps the first fragment at index boundary' + atf_set require.user root + atf_set require.progs scapy +} + +overindex_body() +{ + frag_common overindex +} + +overindex_cleanup() +{ + pft_cleanup +} + +atf_test_case "overlimit" "cleanup" +overlimit_head() +{ + atf_set descr 'ping fragment at index boundary that cannot be requeued' + atf_set require.user root + atf_set require.progs scapy +} + +overlimit_body() +{ + frag_common overlimit +} + +overlimit_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "too_many_fragments" atf_add_test_case "v6" atf_add_test_case "mtu_diff" + atf_add_test_case "overreplace" + atf_add_test_case "overindex" + atf_add_test_case "overlimit" } From owner-dev-commits-src-branches@freebsd.org Wed Jun 2 18:51:07 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 778F7649924; Wed, 2 Jun 2021 18:51:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FwJ5R06bYz4Y6h; Wed, 2 Jun 2021 18:51:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9F8E21BCB5; Wed, 2 Jun 2021 18:51:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 152Ip6Tf038282; Wed, 2 Jun 2021 18:51:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 152Ip6Ct038281; Wed, 2 Jun 2021 18:51:06 GMT (envelope-from git) Date: Wed, 2 Jun 2021 18:51:06 GMT Message-Id: <202106021851.152Ip6Ct038281@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: a58a471b5d51 - stable/12 - pf tests: Only log critical errors from scapy MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: a58a471b5d512c1ae81d3298b5cb317793373867 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jun 2021 18:51:07 -0000 The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=a58a471b5d512c1ae81d3298b5cb317793373867 commit a58a471b5d512c1ae81d3298b5cb317793373867 Author: Kristof Provost AuthorDate: 2021-05-26 11:07:50 +0000 Commit: Kristof Provost CommitDate: 2021-06-02 18:40:07 +0000 pf tests: Only log critical errors from scapy See a26e895f3d803cc1f4ee1c2b33c61330998808b9. Silence these new tests as well. MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 9d0bc96ef8c0288c05a627b3961edd2da046c5c9) --- tests/sys/netpfil/pf/fragcommon.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/sys/netpfil/pf/fragcommon.py b/tests/sys/netpfil/pf/fragcommon.py index 2bcd3989b420..1ca3129e6057 100644 --- a/tests/sys/netpfil/pf/fragcommon.py +++ b/tests/sys/netpfil/pf/fragcommon.py @@ -27,6 +27,8 @@ import argparse import os +import logging +logging.getLogger("scapy").setLevel(logging.CRITICAL) import scapy.all as sp import sys import time From owner-dev-commits-src-branches@freebsd.org Wed Jun 2 18:51:07 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 965036496E8; Wed, 2 Jun 2021 18:51:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FwJ5R1x4Vz4Y5F; Wed, 2 Jun 2021 18:51:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B7FDF1C1CE; Wed, 2 Jun 2021 18:51:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 152Ip62L038305; Wed, 2 Jun 2021 18:51:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 152Ip6Fh038304; Wed, 2 Jun 2021 18:51:06 GMT (envelope-from git) Date: Wed, 2 Jun 2021 18:51:06 GMT Message-Id: <202106021851.152Ip6Fh038304@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 80fe5ac55561 - stable/13 - pf tests: Only log critical errors from scapy MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 80fe5ac555615f4470c9dda4ab6ae48cade00e9c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jun 2021 18:51:07 -0000 The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=80fe5ac555615f4470c9dda4ab6ae48cade00e9c commit 80fe5ac555615f4470c9dda4ab6ae48cade00e9c Author: Kristof Provost AuthorDate: 2021-05-26 11:07:50 +0000 Commit: Kristof Provost CommitDate: 2021-06-02 18:50:56 +0000 pf tests: Only log critical errors from scapy See a26e895f3d803cc1f4ee1c2b33c61330998808b9. Silence these new tests as well. MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 9d0bc96ef8c0288c05a627b3961edd2da046c5c9) --- tests/sys/netpfil/pf/fragcommon.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/sys/netpfil/pf/fragcommon.py b/tests/sys/netpfil/pf/fragcommon.py index 2bcd3989b420..1ca3129e6057 100644 --- a/tests/sys/netpfil/pf/fragcommon.py +++ b/tests/sys/netpfil/pf/fragcommon.py @@ -27,6 +27,8 @@ import argparse import os +import logging +logging.getLogger("scapy").setLevel(logging.CRITICAL) import scapy.all as sp import sys import time From owner-dev-commits-src-branches@freebsd.org Wed Jun 2 19:38:57 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C2E2364A740; Wed, 2 Jun 2021 19:38:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FwK8d4xgPz4cXb; Wed, 2 Jun 2021 19:38:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8E0951C863; Wed, 2 Jun 2021 19:38:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 152Jcvir096490; Wed, 2 Jun 2021 19:38:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 152JcvlR096489; Wed, 2 Jun 2021 19:38:57 GMT (envelope-from git) Date: Wed, 2 Jun 2021 19:38:57 GMT Message-Id: <202106021938.152JcvlR096489@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kirk McKusick Subject: git: 02966cbdf03a - stable/13 - Fix fsck_ufs segfault when it needs to rerun. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 02966cbdf03ae48a7c79cc75dd25eea9049ccb72 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jun 2021 19:38:57 -0000 The branch stable/13 has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=02966cbdf03ae48a7c79cc75dd25eea9049ccb72 commit 02966cbdf03ae48a7c79cc75dd25eea9049ccb72 Author: Kirk McKusick AuthorDate: 2021-05-29 02:41:05 +0000 Commit: Kirk McKusick CommitDate: 2021-06-02 19:41:38 +0000 Fix fsck_ufs segfault when it needs to rerun. Sponsored by: Netflix (cherry picked from commit 5c9e9eb7a27feb24136c16706f3db8ce7c8bbc47) --- sbin/fsck_ffs/inode.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sbin/fsck_ffs/inode.c b/sbin/fsck_ffs/inode.c index d4e5723f559f..ba2d5892238e 100644 --- a/sbin/fsck_ffs/inode.c +++ b/sbin/fsck_ffs/inode.c @@ -416,14 +416,14 @@ void ginode(ino_t inumber, struct inode *ip) { ufs2_daddr_t iblk; - static ino_t startinum = -1; if (inumber < UFS_ROOTINO || inumber > maxino) errx(EEXIT, "bad inode number %ju to ginode", (uintmax_t)inumber); ip->i_number = inumber; - if (startinum != -1 && - inumber >= startinum && inumber < startinum + INOPB(&sblock)) { + if (icachebp != NULL && + inumber >= icachebp->b_index && + inumber < icachebp->b_index + INOPB(&sblock)) { /* take an additional reference for the returned inode */ icachebp->b_refcnt++; } else { @@ -433,14 +433,14 @@ ginode(ino_t inumber, struct inode *ip) brelse(icachebp); icachebp = getdatablk(iblk, sblock.fs_bsize, BT_INODES); if (icachebp->b_errs != 0) { + icachebp = NULL; ip->i_bp = NULL; ip->i_dp = &zino; return; } - startinum = rounddown(inumber, INOPB(&sblock)); /* take a cache-hold reference on new icachebp */ icachebp->b_refcnt++; - icachebp->b_index = startinum; + icachebp->b_index = rounddown(inumber, INOPB(&sblock)); } ip->i_bp = icachebp; if (sblock.fs_magic == FS_UFS1_MAGIC) { From owner-dev-commits-src-branches@freebsd.org Wed Jun 2 23:57:31 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CD94164E457; Wed, 2 Jun 2021 23:57: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 4FwQtz5S5Cz3G9r; Wed, 2 Jun 2021 23:57:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A321D20019; Wed, 2 Jun 2021 23:57:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 152NvVHo040446; Wed, 2 Jun 2021 23:57:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 152NvVqE040445; Wed, 2 Jun 2021 23:57:31 GMT (envelope-from git) Date: Wed, 2 Jun 2021 23:57:31 GMT Message-Id: <202106022357.152NvVqE040445@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 4775325dd661 - stable/13 - nfscl: Fix NFSv4.1/4.2 mount recovery from an expired lease MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4775325dd6615160a3aca19f3a339af63fa0ceb7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jun 2021 23:57:31 -0000 The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=4775325dd6615160a3aca19f3a339af63fa0ceb7 commit 4775325dd6615160a3aca19f3a339af63fa0ceb7 Author: Rick Macklem AuthorDate: 2021-05-19 21:52:56 +0000 Commit: Rick Macklem CommitDate: 2021-06-02 23:54:10 +0000 nfscl: Fix NFSv4.1/4.2 mount recovery from an expired lease The most difficult NFSv4 client recovery case happens when the lease has expired on the server. For NFSv4.0, the client will receive a NFSERR_EXPIRED reply from the server to indicate this has happened. For NFSv4.1/4.2, most RPCs have a Sequence operation and, as such, the client will receive a NFSERR_BADSESSION reply when the lease has expired for these RPCs. The client will then call nfscl_recover() to handle the NFSERR_BADSESSION reply. However, for the expired lease case, the first reclaim Open will fail with NFSERR_NOGRACE. This patch recognizes this case and calls nfscl_expireclient() to handle the recovery from an expired lease. This patch only affects NFSv4.1/4.2 mounts when the lease expires on the server, due to a network partitioning that exceeds the lease duration or similar. (cherry picked from commit c28cb257ddfe3339756f6fd659fa4a2efa4de2cb) --- sys/fs/nfsclient/nfs_clstate.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c index 8b5f07b5aa2a..1ed3630ce6e7 100644 --- a/sys/fs/nfsclient/nfs_clstate.c +++ b/sys/fs/nfsclient/nfs_clstate.c @@ -1996,6 +1996,7 @@ nfscl_recover(struct nfsclclient *clp, bool *retokp, struct ucred *cred, u_int32_t delegtype = NFSV4OPEN_DELEGATEWRITE, mode; int i, igotlock = 0, error, trycnt, firstlock; struct nfscllayout *lyp, *nlyp; + bool recovered_one; /* * First, lock the client structure, so everyone else will @@ -2077,6 +2078,7 @@ nfscl_recover(struct nfsclclient *clp, bool *retokp, struct ucred *cred, * Now traverse the state lists, doing Open and Lock Reclaims. */ tcred = newnfs_getcred(); + recovered_one = false; owp = LIST_FIRST(&clp->nfsc_owner); while (owp != NULL) { nowp = LIST_NEXT(owp, nfsow_list); @@ -2110,6 +2112,7 @@ nfscl_recover(struct nfsclclient *clp, bool *retokp, struct ucred *cred, op->nfso_mode, op, NULL, 0, &ndp, 1, delegtype, tcred, p); if (!error) { + recovered_one = true; /* Handle any replied delegation */ if (ndp != NULL && ((ndp->nfsdl_flags & NFSCLDL_WRITE) || NFSMNT_RDONLY(nmp->nm_mountp))) { @@ -2168,6 +2171,21 @@ nfscl_recover(struct nfsclclient *clp, bool *retokp, struct ucred *cred, nfscl_freelockowner(lp, 0); lp = nlp; } + } else if (error == NFSERR_NOGRACE && !recovered_one && + NFSHASNFSV4N(nmp)) { + /* + * For NFSv4.1/4.2, the NFSERR_EXPIRED case will + * actually end up here, since the client will do + * a recovery for NFSERR_BADSESSION, but will get + * an NFSERR_NOGRACE reply for the first "reclaim" + * attempt. + * So, call nfscl_expireclient() to recover the + * opens as best we can and then do a reclaim + * complete and return. + */ + nfsrpc_reclaimcomplete(nmp, cred, p); + nfscl_expireclient(clp, nmp, tcred, p); + goto out; } } if (error != 0 && error != NFSERR_BADSESSION) @@ -2254,6 +2272,23 @@ nfscl_recover(struct nfsclclient *clp, bool *retokp, struct ucred *cred, if (error) { if (nop != NULL) free(nop, M_NFSCLOPEN); + if (error == NFSERR_NOGRACE && !recovered_one && + NFSHASNFSV4N(nmp)) { + /* + * For NFSv4.1/4.2, the NFSERR_EXPIRED case will + * actually end up here, since the client will do + * a recovery for NFSERR_BADSESSION, but will get + * an NFSERR_NOGRACE reply for the first "reclaim" + * attempt. + * So, call nfscl_expireclient() to recover the + * opens as best we can and then do a reclaim + * complete and return. + */ + nfsrpc_reclaimcomplete(nmp, cred, p); + nfscl_expireclient(clp, nmp, tcred, p); + free(nowp, M_NFSCLOWNER); + goto out; + } /* * Couldn't reclaim it, so throw the state * away. Ouch!! @@ -2261,6 +2296,7 @@ nfscl_recover(struct nfsclclient *clp, bool *retokp, struct ucred *cred, nfscl_cleandeleg(dp); nfscl_freedeleg(&clp->nfsc_deleg, dp, true); } else { + recovered_one = true; LIST_INSERT_HEAD(&extra_open, nop, nfso_list); } } From owner-dev-commits-src-branches@freebsd.org Thu Jun 3 00:04:35 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6F73364E4EE; Thu, 3 Jun 2021 00:04:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FwR372cTYz3GRQ; Thu, 3 Jun 2021 00:04:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 41E382038C; Thu, 3 Jun 2021 00:04:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15304ZYk054113; Thu, 3 Jun 2021 00:04:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15304ZuP054112; Thu, 3 Jun 2021 00:04:35 GMT (envelope-from git) Date: Thu, 3 Jun 2021 00:04:35 GMT Message-Id: <202106030004.15304ZuP054112@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 5a8b2c5a46df - stable/12 - nfscl: Fix NFSv4.1/4.2 mount recovery from an expired lease MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 5a8b2c5a46dffa3828ad16abee36ac4676f741bf Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jun 2021 00:04:35 -0000 The branch stable/12 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=5a8b2c5a46dffa3828ad16abee36ac4676f741bf commit 5a8b2c5a46dffa3828ad16abee36ac4676f741bf Author: Rick Macklem AuthorDate: 2021-05-19 21:52:56 +0000 Commit: Rick Macklem CommitDate: 2021-06-02 23:58:53 +0000 nfscl: Fix NFSv4.1/4.2 mount recovery from an expired lease The most difficult NFSv4 client recovery case happens when the lease has expired on the server. For NFSv4.0, the client will receive a NFSERR_EXPIRED reply from the server to indicate this has happened. For NFSv4.1/4.2, most RPCs have a Sequence operation and, as such, the client will receive a NFSERR_BADSESSION reply when the lease has expired for these RPCs. The client will then call nfscl_recover() to handle the NFSERR_BADSESSION reply. However, for the expired lease case, the first reclaim Open will fail with NFSERR_NOGRACE. This patch recognizes this case and calls nfscl_expireclient() to handle the recovery from an expired lease. This patch only affects NFSv4.1/4.2 mounts when the lease expires on the server, due to a network partitioning that exceeds the lease duration or similar. (cherry picked from commit c28cb257ddfe3339756f6fd659fa4a2efa4de2cb) --- sys/fs/nfsclient/nfs_clstate.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c index e705af31185b..e1b9d37b3a3e 100644 --- a/sys/fs/nfsclient/nfs_clstate.c +++ b/sys/fs/nfsclient/nfs_clstate.c @@ -1977,6 +1977,7 @@ nfscl_recover(struct nfsclclient *clp, struct ucred *cred, NFSPROC_T *p) u_int32_t delegtype = NFSV4OPEN_DELEGATEWRITE, mode; int i, igotlock = 0, error, trycnt, firstlock; struct nfscllayout *lyp, *nlyp; + bool recovered_one; /* * First, lock the client structure, so everyone else will @@ -2050,6 +2051,7 @@ nfscl_recover(struct nfsclclient *clp, struct ucred *cred, NFSPROC_T *p) * Now traverse the state lists, doing Open and Lock Reclaims. */ tcred = newnfs_getcred(); + recovered_one = false; owp = LIST_FIRST(&clp->nfsc_owner); while (owp != NULL) { nowp = LIST_NEXT(owp, nfsow_list); @@ -2083,6 +2085,7 @@ nfscl_recover(struct nfsclclient *clp, struct ucred *cred, NFSPROC_T *p) op->nfso_mode, op, NULL, 0, &ndp, 1, delegtype, tcred, p); if (!error) { + recovered_one = true; /* Handle any replied delegation */ if (ndp != NULL && ((ndp->nfsdl_flags & NFSCLDL_WRITE) || NFSMNT_RDONLY(nmp->nm_mountp))) { @@ -2141,6 +2144,21 @@ nfscl_recover(struct nfsclclient *clp, struct ucred *cred, NFSPROC_T *p) nfscl_freelockowner(lp, 0); lp = nlp; } + } else if (error == NFSERR_NOGRACE && !recovered_one && + NFSHASNFSV4N(nmp)) { + /* + * For NFSv4.1/4.2, the NFSERR_EXPIRED case will + * actually end up here, since the client will do + * a recovery for NFSERR_BADSESSION, but will get + * an NFSERR_NOGRACE reply for the first "reclaim" + * attempt. + * So, call nfscl_expireclient() to recover the + * opens as best we can and then do a reclaim + * complete and return. + */ + nfsrpc_reclaimcomplete(nmp, cred, p); + nfscl_expireclient(clp, nmp, tcred, p); + goto out; } } if (error != 0 && error != NFSERR_BADSESSION) @@ -2227,6 +2245,23 @@ nfscl_recover(struct nfsclclient *clp, struct ucred *cred, NFSPROC_T *p) if (error) { if (nop != NULL) free(nop, M_NFSCLOPEN); + if (error == NFSERR_NOGRACE && !recovered_one && + NFSHASNFSV4N(nmp)) { + /* + * For NFSv4.1/4.2, the NFSERR_EXPIRED case will + * actually end up here, since the client will do + * a recovery for NFSERR_BADSESSION, but will get + * an NFSERR_NOGRACE reply for the first "reclaim" + * attempt. + * So, call nfscl_expireclient() to recover the + * opens as best we can and then do a reclaim + * complete and return. + */ + nfsrpc_reclaimcomplete(nmp, cred, p); + nfscl_expireclient(clp, nmp, tcred, p); + free(nowp, M_NFSCLOWNER); + goto out; + } /* * Couldn't reclaim it, so throw the state * away. Ouch!! @@ -2234,6 +2269,7 @@ nfscl_recover(struct nfsclclient *clp, struct ucred *cred, NFSPROC_T *p) nfscl_cleandeleg(dp); nfscl_freedeleg(&clp->nfsc_deleg, dp, true); } else { + recovered_one = true; LIST_INSERT_HEAD(&extra_open, nop, nfso_list); } } From owner-dev-commits-src-branches@freebsd.org Thu Jun 3 00:55:44 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BE72064F1B6; Thu, 3 Jun 2021 00:55:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FwSB84gYSz3J92; Thu, 3 Jun 2021 00:55:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 840C120872; Thu, 3 Jun 2021 00:55:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1530ti0U019856; Thu, 3 Jun 2021 00:55:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1530tilh019855; Thu, 3 Jun 2021 00:55:44 GMT (envelope-from git) Date: Thu, 3 Jun 2021 00:55:44 GMT Message-Id: <202106030055.1530tilh019855@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 19cfc8e65587 - stable/13 - MFV d60fa10fd872db7e3d8cb1e161cfdae026c43b14: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 19cfc8e65587e5a619e425a062e4aa69cdcf1eaf Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jun 2021 00:55:44 -0000 The branch stable/13 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=19cfc8e65587e5a619e425a062e4aa69cdcf1eaf commit 19cfc8e65587e5a619e425a062e4aa69cdcf1eaf Author: Cy Schubert AuthorDate: 2021-02-10 04:25:05 +0000 Commit: Cy Schubert CommitDate: 2021-06-03 00:54:29 +0000 MFV d60fa10fd872db7e3d8cb1e161cfdae026c43b14: Update unbound 1.13.0 --> 1.13.1. Includes numerous bugfixes documented at: https://www.nlnetlabs.nl/projects/unbound/download/#unbound-1-13-1 (cherry picked from commit f44e67d120ad78ef7894241b519ee79fd190a16e) --- contrib/unbound/Makefile.in | 516 ++++++++++++--------- contrib/unbound/aclocal.m4 | 8 +- contrib/unbound/acx_nlnetlabs.m4 | 60 ++- contrib/unbound/acx_python.m4 | 6 +- contrib/unbound/cachedb/cachedb.c | 1 + contrib/unbound/config.guess | 20 +- contrib/unbound/config.h.in | 3 +- contrib/unbound/config.sub | 20 +- contrib/unbound/configure | 137 +++--- contrib/unbound/configure.ac | 197 ++++---- .../contrib/build-unbound-localzone-from-hosts.pl | 0 .../unbound/contrib/create_unbound_ad_servers.sh | 0 contrib/unbound/contrib/parseunbound.pl | 0 contrib/unbound/contrib/unbound_cache.sh | 0 contrib/unbound/contrib/warmup.sh | 0 contrib/unbound/daemon/remote.c | 55 +++ contrib/unbound/daemon/worker.c | 22 +- contrib/unbound/dns64/dns64.c | 43 +- contrib/unbound/dnscrypt/dnscrypt.m4 | 2 +- contrib/unbound/dnstap/dnstap.m4 | 2 +- contrib/unbound/dnstap/unbound-dnstap-socket.c | 9 +- contrib/unbound/doc/Changelog | 131 +++++- contrib/unbound/doc/FEATURES | 1 + contrib/unbound/doc/README | 2 +- contrib/unbound/doc/TODO | 1 - contrib/unbound/doc/example.conf.in | 32 +- contrib/unbound/doc/libunbound.3.in | 4 +- contrib/unbound/doc/unbound-anchor.8.in | 2 +- contrib/unbound/doc/unbound-checkconf.8.in | 2 +- contrib/unbound/doc/unbound-control.8.in | 8 +- contrib/unbound/doc/unbound-host.1.in | 2 +- contrib/unbound/doc/unbound.8.in | 4 +- contrib/unbound/doc/unbound.conf.5.in | 60 ++- contrib/unbound/doc/unbound.doxygen | 6 +- contrib/unbound/dynlibmod/dynlibmod.c | 20 +- contrib/unbound/dynlibmod/dynlibmod.h | 4 +- contrib/unbound/dynlibmod/examples/helloworld.c | 14 +- contrib/unbound/ipset/ipset.c | 0 contrib/unbound/ipset/ipset.h | 0 contrib/unbound/libunbound/libworker.c | 4 + contrib/unbound/ltmain.sh | 0 contrib/unbound/respip/respip.c | 2 +- contrib/unbound/services/authzone.c | 17 +- contrib/unbound/services/cache/rrset.c | 2 + contrib/unbound/services/listen_dnsport.c | 14 +- contrib/unbound/services/listen_dnsport.h | 2 +- contrib/unbound/services/localzone.c | 107 ++++- contrib/unbound/services/localzone.h | 7 + contrib/unbound/services/mesh.c | 38 +- contrib/unbound/services/outside_network.c | 77 ++- contrib/unbound/services/outside_network.h | 2 + contrib/unbound/services/rpz.c | 21 +- contrib/unbound/services/rpz.h | 13 + contrib/unbound/smallapp/unbound-anchor.c | 67 +-- contrib/unbound/smallapp/unbound-control.c | 105 ++++- contrib/unbound/smallapp/worker_cb.c | 3 + contrib/unbound/util/config_file.c | 71 ++- contrib/unbound/util/config_file.h | 27 ++ contrib/unbound/util/configlexer.lex | 6 + contrib/unbound/util/configparser.y | 87 +++- contrib/unbound/util/configyyrename.h | 6 + contrib/unbound/util/data/msgencode.c | 63 ++- contrib/unbound/util/data/msgparse.c | 2 + contrib/unbound/util/data/msgparse.h | 4 + contrib/unbound/util/data/msgreply.c | 36 +- contrib/unbound/util/data/msgreply.h | 20 +- contrib/unbound/util/data/packed_rrset.c | 17 +- contrib/unbound/util/data/packed_rrset.h | 3 + contrib/unbound/util/edns.c | 16 + contrib/unbound/util/iana_ports.inc | 2 +- contrib/unbound/util/module.h | 4 +- contrib/unbound/util/net_help.c | 2 +- contrib/unbound/util/netevent.c | 122 ++++- contrib/unbound/util/netevent.h | 12 + contrib/unbound/util/storage/lruhash.c | 4 +- contrib/unbound/validator/autotrust.c | 1 + usr.sbin/unbound/config.h | 6 +- 77 files changed, 1700 insertions(+), 686 deletions(-) diff --git a/contrib/unbound/Makefile.in b/contrib/unbound/Makefile.in index d2600e71f0cf..6809881b6a95 100644 --- a/contrib/unbound/Makefile.in +++ b/contrib/unbound/Makefile.in @@ -248,6 +248,7 @@ DNSTAP_SOCKET_SRC=dnstap/unbound-dnstap-socket.c DNSTAP_SOCKET_OBJ=unbound-dnstap-socket.lo DNSTAP_SOCKET_OBJ_LINK=$(DNSTAP_SOCKET_OBJ) $(COMMON_OBJ) \ $(COMPAT_OBJ) $(SLDNS_OBJ) +DNSTAP_SOCKET_TESTBIN=@DNSTAP_SOCKET_TESTBIN@ LIBUNBOUND_SRC=libunbound/context.c libunbound/libunbound.c \ libunbound/libworker.c LIBUNBOUND_OBJ=context.lo libunbound.lo libworker.lo ub_event_pluggable.lo @@ -323,7 +324,7 @@ rsrc_unbound_checkconf.o: $(srcdir)/winrc/rsrc_unbound_checkconf.rc config.h TEST_BIN=asynclook$(EXEEXT) delayer$(EXEEXT) \ lock-verify$(EXEEXT) memstats$(EXEEXT) perf$(EXEEXT) \ petal$(EXEEXT) pktview$(EXEEXT) streamtcp$(EXEEXT) \ - unbound-dnstap-socket$(EXEEXT) dohclient$(EXEEXT) \ + $(DNSTAP_SOCKET_TESTBIN) dohclient$(EXEEXT) \ testbound$(EXEEXT) unittest$(EXEEXT) tests: all $(TEST_BIN) @@ -349,10 +350,10 @@ unbound$(EXEEXT): $(DAEMON_OBJ_LINK) libunbound.la $(LINK) -o $@ $(DAEMON_OBJ_LINK) $(EXTRALINK) $(SSLLIB) $(LIBS) $(DYNLIBMOD_EXTRALIBS) unbound-checkconf$(EXEEXT): $(CHECKCONF_OBJ_LINK) libunbound.la - $(LINK) -o $@ $(CHECKCONF_OBJ_LINK) $(EXTRALINK) $(SSLLIB) $(LIBS) $(DYNLIBMOD_EXTRALIBS) + $(LINK) -o $@ $(CHECKCONF_OBJ_LINK) $(EXTRALINK) $(SSLLIB) $(LIBS) unbound-control$(EXEEXT): $(CONTROL_OBJ_LINK) libunbound.la - $(LINK) -o $@ $(CONTROL_OBJ_LINK) $(EXTRALINK) $(SSLLIB) $(LIBS) $(DYNLIBMOD_EXTRALIBS) + $(LINK) -o $@ $(CONTROL_OBJ_LINK) $(EXTRALINK) $(SSLLIB) $(LIBS) unbound-host$(EXEEXT): $(HOST_OBJ_LINK) libunbound.la $(LINK) -o $@ $(HOST_OBJ_LINK) -L. -L.libs -lunbound $(SSLLIB) $(LIBS) @@ -370,37 +371,37 @@ anchor-update$(EXEEXT): $(ANCHORUPD_OBJ_LINK) libunbound.la $(LINK) -o $@ $(ANCHORUPD_OBJ_LINK) -L. -L.libs -lunbound $(LIBS) unittest$(EXEEXT): $(UNITTEST_OBJ_LINK) - $(LINK) -o $@ $(UNITTEST_OBJ_LINK) $(SSLLIB) $(LIBS) $(DYNLIBMOD_EXTRALIBS) + $(LINK) -o $@ $(UNITTEST_OBJ_LINK) $(SSLLIB) $(LIBS) testbound$(EXEEXT): $(TESTBOUND_OBJ_LINK) - $(LINK) -o $@ $(TESTBOUND_OBJ_LINK) $(SSLLIB) $(LIBS) $(DYNLIBMOD_EXTRALIBS) + $(LINK) -o $@ $(TESTBOUND_OBJ_LINK) $(SSLLIB) $(LIBS) lock-verify$(EXEEXT): $(LOCKVERIFY_OBJ_LINK) - $(LINK) -o $@ $(LOCKVERIFY_OBJ_LINK) $(SSLLIB) $(LIBS) $(DYNLIBMOD_EXTRALIBS) + $(LINK) -o $@ $(LOCKVERIFY_OBJ_LINK) $(SSLLIB) $(LIBS) petal$(EXEEXT): $(PETAL_OBJ_LINK) $(LINK) -o $@ $(PETAL_OBJ_LINK) $(SSLLIB) $(LIBS) pktview$(EXEEXT): $(PKTVIEW_OBJ_LINK) - $(LINK) -o $@ $(PKTVIEW_OBJ_LINK) $(SSLLIB) $(LIBS) $(DYNLIBMOD_EXTRALIBS) + $(LINK) -o $@ $(PKTVIEW_OBJ_LINK) $(SSLLIB) $(LIBS) memstats$(EXEEXT): $(MEMSTATS_OBJ_LINK) - $(LINK) -o $@ $(MEMSTATS_OBJ_LINK) $(SSLLIB) $(LIBS) $(DYNLIBMOD_EXTRALIBS) + $(LINK) -o $@ $(MEMSTATS_OBJ_LINK) $(SSLLIB) $(LIBS) asynclook$(EXEEXT): $(ASYNCLOOK_OBJ_LINK) libunbound.la $(LINK) -o $@ $(ASYNCLOOK_OBJ_LINK) -L. -L.libs -lunbound $(SSLLIB) $(LIBS) streamtcp$(EXEEXT): $(STREAMTCP_OBJ_LINK) - $(LINK) -o $@ $(STREAMTCP_OBJ_LINK) $(SSLLIB) $(LIBS) $(DYNLIBMOD_EXTRALIBS) + $(LINK) -o $@ $(STREAMTCP_OBJ_LINK) $(SSLLIB) $(LIBS) dohclient$(EXEEXT): $(DOHCLIENT_OBJ_LINK) - $(LINK) -o $@ $(DOHCLIENT_OBJ_LINK) $(SSLLIB) $(LIBS) $(DYNLIBMOD_EXTRALIBS) + $(LINK) -o $@ $(DOHCLIENT_OBJ_LINK) $(SSLLIB) $(LIBS) perf$(EXEEXT): $(PERF_OBJ_LINK) - $(LINK) -o $@ $(PERF_OBJ_LINK) $(SSLLIB) $(LIBS) $(DYNLIBMOD_EXTRALIBS) + $(LINK) -o $@ $(PERF_OBJ_LINK) $(SSLLIB) $(LIBS) delayer$(EXEEXT): $(DELAYER_OBJ_LINK) - $(LINK) -o $@ $(DELAYER_OBJ_LINK) $(SSLLIB) $(LIBS) $(DYNLIBMOD_EXTRALIBS) + $(LINK) -o $@ $(DELAYER_OBJ_LINK) $(SSLLIB) $(LIBS) signit$(EXEEXT): testcode/signit.c $(CC) $(CPPFLAGS) $(CFLAGS) @PTHREAD_CFLAGS_ONLY@ -o $@ testcode/signit.c $(LDFLAGS) -lldns $(SSLLIB) $(LIBS) @@ -423,12 +424,13 @@ dnstap/dnstap.pb-c.c dnstap/dnstap.pb-c.h: $(srcdir)/dnstap/dnstap.proto $(PROTOC_C) --c_out=. --proto_path=$(srcdir) $(srcdir)/dnstap/dnstap.proto unbound-dnstap-socket$(EXEEXT): $(DNSTAP_SOCKET_OBJ_LINK) - $(LINK) -o $@ $(DNSTAP_SOCKET_OBJ_LINK) $(SSLLIB) $(LIBS) $(DYNLIBMOD_EXTRALIBS) + $(LINK) -o $@ $(DNSTAP_SOCKET_OBJ_LINK) $(SSLLIB) $(LIBS) dnstap.pb-c.lo dnstap.pb-c.o: dnstap/dnstap.pb-c.c dnstap/dnstap.pb-c.h dtstream.lo dtstream.o: $(srcdir)/dnstap/dtstream.c config.h $(srcdir)/dnstap/dtstream.h dnstap_fstrm.lo dnstap_fstrm.o: $(srcdir)/dnstap/dnstap_fstrm.c config.h $(srcdir)/dnstap/dnstap_fstrm.h unbound-dnstap-socket.lo unbound-dnstap-socket.o: $(srcdir)/dnstap/unbound-dnstap-socket.c config.h $(srcdir)/dnstap/dtstream.h +dynlibmod.lo dynlibdmod.o: $(srcdir)/dynlibmod/dynlibmod.c config.h $(srcdir)/dynlibmod/dynlibmod.h # dnscrypt dnscrypt.lo dnscrypt.o: $(srcdir)/dnscrypt/dnscrypt.c config.h \ @@ -826,13 +828,16 @@ modstack.lo modstack.o: $(srcdir)/services/modstack.c config.h $(srcdir)/service $(srcdir)/util/module.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/netevent.h \ - $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/dnscrypt/cert.h \ - $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h $(srcdir)/dns64/dns64.h \ - $(srcdir)/iterator/iterator.h $(srcdir)/services/outbound_list.h $(srcdir)/validator/validator.h \ - $(srcdir)/validator/val_utils.h $(srcdir)/respip/respip.h $(srcdir)/services/localzone.h \ - $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h $(PYTHONMOD_HEADER) $(srcdir)/ipsecmod/ipsecmod.h \ - $(srcdir)/util/storage/slabhash.h $(srcdir)/edns-subnet/addrtree.h $(srcdir)/edns-subnet/edns-subnet.h \ - $(srcdir)/ipset/ipset.h $(srcdir)/dynlibmod/dynlibmod.h + $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/util/tube.h \ + $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h \ + $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h \ + $(srcdir)/util/config_file.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \ + $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h $(srcdir)/dns64/dns64.h $(srcdir)/iterator/iterator.h \ + $(srcdir)/services/outbound_list.h $(srcdir)/validator/validator.h $(srcdir)/validator/val_utils.h \ + $(PYTHONMOD_HEADER) $(DYNLIBMOD_HEADER) $(srcdir)/cachedb/cachedb.h \ + $(srcdir)/ipsecmod/ipsecmod.h $(srcdir)/edns-subnet/subnetmod.h $(srcdir)/util/alloc.h $(srcdir)/util/net_help.h \ + $(srcdir)/util/storage/slabhash.h $(srcdir)/util/data/dname.h $(srcdir)/edns-subnet/addrtree.h \ + $(srcdir)/edns-subnet/edns-subnet.h $(srcdir)/ipset/ipset.h view.lo view.o: $(srcdir)/services/view.c config.h $(srcdir)/services/view.h $(srcdir)/util/rbtree.h \ $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/services/localzone.h $(srcdir)/util/storage/dnstree.h \ $(srcdir)/util/module.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/data/msgreply.h \ @@ -863,7 +868,8 @@ outside_network.lo outside_network.o: $(srcdir)/services/outside_network.c confi $(srcdir)/services/mesh.h $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h \ $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h $(srcdir)/util/config_file.h $(srcdir)/services/authzone.h \ $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h \ - $(srcdir)/dnstap/dnstap.h + $(srcdir)/util/edns.h $(srcdir)/dnstap/dnstap.h \ + alloc.lo alloc.o: $(srcdir)/util/alloc.c config.h $(srcdir)/util/alloc.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ $(srcdir)/util/regional.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \ $(srcdir)/util/fptr_wlist.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ @@ -884,7 +890,8 @@ config_file.lo config_file.o: $(srcdir)/util/config_file.c config.h $(srcdir)/ut $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h \ $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h $(srcdir)/util/data/dname.h \ $(srcdir)/util/rtt.h $(srcdir)/services/cache/infra.h $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/parseutil.h \ - $(srcdir)/iterator/iterator.h $(srcdir)/services/outbound_list.h $(srcdir)/util/iana_ports.inc + $(srcdir)/iterator/iterator.h $(srcdir)/services/outbound_list.h $(srcdir)/edns-subnet/edns-subnet.h \ + $(srcdir)/util/iana_ports.inc configlexer.lo configlexer.o: util/configlexer.c config.h $(srcdir)/util/configyyrename.h \ $(srcdir)/util/config_file.h util/configparser.h configparser.lo configparser.o: util/configparser.c config.h $(srcdir)/util/configyyrename.h \ @@ -913,38 +920,31 @@ authzone.lo authzone.o: $(srcdir)/services/authzone.c config.h $(srcdir)/service $(srcdir)/util/data/msgencode.h $(srcdir)/util/regional.h $(srcdir)/util/net_help.h $(srcdir)/util/random.h \ $(srcdir)/services/cache/dns.h $(srcdir)/services/outside_network.h \ $(srcdir)/services/listen_dnsport.h $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/wire2str.h \ - $(srcdir)/sldns/parseutil.h $(srcdir)/sldns/keyraw.h $(srcdir)/validator/val_nsec3.h \ - $(srcdir)/validator/val_secalgo.h + $(srcdir)/sldns/parseutil.h $(srcdir)/sldns/keyraw.h \ + $(srcdir)/validator/val_nsec3.h $(srcdir)/validator/val_secalgo.h fptr_wlist.lo fptr_wlist.o: $(srcdir)/util/fptr_wlist.c config.h $(srcdir)/util/fptr_wlist.h \ $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/storage/lruhash.h \ - $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \ - $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h \ - $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h $(srcdir)/util/mini_event.h \ - $(srcdir)/services/outside_network.h $(srcdir)/services/localzone.h \ - $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h $(srcdir)/services/authzone.h \ - $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h $(srcdir)/services/cache/rrset.h \ - $(srcdir)/util/storage/slabhash.h $(srcdir)/dns64/dns64.h $(srcdir)/iterator/iterator.h \ - $(srcdir)/services/outbound_list.h $(srcdir)/iterator/iter_fwd.h $(srcdir)/validator/validator.h \ - $(srcdir)/validator/val_utils.h $(srcdir)/validator/val_anchor.h $(srcdir)/validator/val_nsec3.h \ - $(srcdir)/validator/val_sigcrypt.h $(srcdir)/validator/val_kentry.h $(srcdir)/validator/val_neg.h \ - $(srcdir)/validator/autotrust.h $(srcdir)/libunbound/libworker.h $(srcdir)/libunbound/context.h \ - $(srcdir)/util/alloc.h $(srcdir)/libunbound/unbound.h $(srcdir)/libunbound/unbound-event.h \ - $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h $(srcdir)/util/config_file.h $(srcdir)/respip/respip.h \ - $(PYTHONMOD_HEADER) $(srcdir)/ipsecmod/ipsecmod.h $(srcdir)/edns-subnet/subnetmod.h $(srcdir)/util/net_help.h \ - $(srcdir)/edns-subnet/addrtree.h $(srcdir)/edns-subnet/edns-subnet.h $(srcdir)/ipset/ipset.h \ - $(srcdir)/dynlibmod/dynlibmod.h + $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/module.h \ + $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ + $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h \ + $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h \ + $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h \ + $(srcdir)/util/config_file.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \ + $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h $(srcdir)/util/mini_event.h \ + $(srcdir)/services/outside_network.h $(srcdir)/services/cache/infra.h \ + $(srcdir)/util/rtt.h $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h $(srcdir)/dns64/dns64.h \ + $(srcdir)/iterator/iterator.h $(srcdir)/services/outbound_list.h $(srcdir)/iterator/iter_fwd.h \ + $(srcdir)/validator/validator.h $(srcdir)/validator/val_utils.h $(srcdir)/validator/val_anchor.h \ + $(srcdir)/validator/val_nsec3.h $(srcdir)/validator/val_sigcrypt.h $(srcdir)/validator/val_kentry.h \ + $(srcdir)/validator/val_neg.h $(srcdir)/validator/autotrust.h $(srcdir)/libunbound/libworker.h \ + $(srcdir)/libunbound/context.h $(srcdir)/util/alloc.h $(srcdir)/libunbound/unbound-event.h \ + $(srcdir)/libunbound/worker.h $(PYTHONMOD_HEADER) $(DYNLIBMOD_HEADER) \ + $(srcdir)/cachedb/cachedb.h $(srcdir)/ipsecmod/ipsecmod.h $(srcdir)/edns-subnet/subnetmod.h \ + $(srcdir)/util/net_help.h $(srcdir)/util/data/dname.h $(srcdir)/edns-subnet/addrtree.h \ + $(srcdir)/edns-subnet/edns-subnet.h $(srcdir)/ipset/ipset.h $(srcdir)/dnstap/dtstream.h locks.lo locks.o: $(srcdir)/util/locks.c config.h $(srcdir)/util/locks.h $(srcdir)/util/log.h log.lo log.o: $(srcdir)/util/log.c config.h $(srcdir)/util/log.h $(srcdir)/util/locks.h $(srcdir)/sldns/sbuffer.h -mini_event.lo mini_event.o: $(srcdir)/util/mini_event.c config.h $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h \ - $(srcdir)/util/fptr_wlist.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h \ - $(srcdir)/util/log.h $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \ - $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h \ - $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h \ - $(srcdir)/services/localzone.h $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h \ - $(srcdir)/sldns/sbuffer.h $(srcdir)/util/config_file.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h \ - $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h +mini_event.lo mini_event.o: $(srcdir)/util/mini_event.c config.h $(srcdir)/util/mini_event.h module.lo module.o: $(srcdir)/util/module.c config.h $(srcdir)/util/module.h $(srcdir)/util/storage/lruhash.h \ $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \ $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/wire2str.h @@ -957,12 +957,14 @@ netevent.lo netevent.o: $(srcdir)/util/netevent.c config.h $(srcdir)/util/neteve $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h $(srcdir)/services/view.h \ $(srcdir)/sldns/sbuffer.h $(srcdir)/util/config_file.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h \ $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h $(srcdir)/sldns/str2wire.h \ - $(srcdir)/dnstap/dnstap.h $(srcdir)/services/listen_dnsport.h + $(srcdir)/dnstap/dnstap.h $(srcdir)/services/listen_dnsport.h \ + net_help.lo net_help.o: $(srcdir)/util/net_help.c config.h $(srcdir)/util/net_help.h $(srcdir)/util/log.h \ $(srcdir)/util/data/dname.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/module.h \ $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/regional.h $(srcdir)/util/config_file.h \ - $(srcdir)/sldns/parseutil.h $(srcdir)/sldns/wire2str.h + $(srcdir)/sldns/parseutil.h $(srcdir)/sldns/wire2str.h \ + random.lo random.o: $(srcdir)/util/random.c config.h $(srcdir)/util/random.h $(srcdir)/util/log.h rbtree.lo rbtree.o: $(srcdir)/util/rbtree.c config.h $(srcdir)/util/log.h $(srcdir)/util/fptr_wlist.h \ $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ @@ -978,11 +980,11 @@ rtt.lo rtt.o: $(srcdir)/util/rtt.c config.h $(srcdir)/util/rtt.h $(srcdir)/itera $(srcdir)/services/outbound_list.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/storage/lruhash.h \ $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/module.h \ $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h -edns.lo edns.o: $(srcdir)/util/edns.c config.h $(srcdir)/util/edns.h $(srcdir)/util/config_file.h \ - $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/util/regional.h $(srcdir)/util/data/msgparse.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h \ - $(srcdir)/util/log.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/data/msgreply.h \ - $(srcdir)/util/data/packed_rrset.h +edns.lo edns.o: $(srcdir)/util/edns.c config.h $(srcdir)/util/edns.h $(srcdir)/util/storage/dnstree.h \ + $(srcdir)/util/rbtree.h $(srcdir)/util/config_file.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ + $(srcdir)/util/net_help.h $(srcdir)/util/log.h $(srcdir)/util/regional.h \ + $(srcdir)/util/data/msgparse.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/sldns/pkthdr.h \ + $(srcdir)/sldns/rrdef.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h dnstree.lo dnstree.o: $(srcdir)/util/storage/dnstree.c config.h $(srcdir)/util/storage/dnstree.h \ $(srcdir)/util/rbtree.h $(srcdir)/util/data/dname.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h \ $(srcdir)/util/log.h $(srcdir)/util/net_help.h @@ -1016,7 +1018,8 @@ tube.lo tube.o: $(srcdir)/util/tube.c config.h $(srcdir)/util/tube.h $(srcdir)/u $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h $(srcdir)/util/ub_event.h ub_event.lo ub_event.o: $(srcdir)/util/ub_event.c config.h $(srcdir)/util/ub_event.h $(srcdir)/util/log.h \ $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/util/tube.h $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h + $(srcdir)/util/tube.h \ + ub_event_pluggable.lo ub_event_pluggable.o: $(srcdir)/util/ub_event_pluggable.c config.h $(srcdir)/util/ub_event.h \ $(srcdir)/libunbound/unbound-event.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ $(srcdir)/util/log.h $(srcdir)/util/fptr_wlist.h \ @@ -1026,7 +1029,8 @@ ub_event_pluggable.lo ub_event_pluggable.o: $(srcdir)/util/ub_event_pluggable.c $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h \ $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h \ $(srcdir)/util/config_file.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \ - $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h + $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h \ + winsock_event.lo winsock_event.o: $(srcdir)/util/winsock_event.c config.h autotrust.lo autotrust.o: $(srcdir)/validator/autotrust.c config.h $(srcdir)/validator/autotrust.h \ $(srcdir)/util/rbtree.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \ @@ -1039,7 +1043,8 @@ autotrust.lo autotrust.o: $(srcdir)/validator/autotrust.c config.h $(srcdir)/val $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h \ $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h \ $(srcdir)/respip/respip.h $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h \ - $(srcdir)/validator/val_kcache.h $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/keyraw.h + $(srcdir)/validator/val_kcache.h $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/keyraw.h \ + val_anchor.lo val_anchor.o: $(srcdir)/validator/val_anchor.c config.h $(srcdir)/validator/val_anchor.h \ $(srcdir)/util/rbtree.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/validator/val_sigcrypt.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/sldns/pkthdr.h \ @@ -1069,11 +1074,13 @@ val_kcache.lo val_kcache.o: $(srcdir)/validator/val_kcache.c config.h $(srcdir)/ val_kentry.lo val_kentry.o: $(srcdir)/validator/val_kentry.c config.h $(srcdir)/validator/val_kentry.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/data/packed_rrset.h \ $(srcdir)/util/data/dname.h $(srcdir)/util/storage/lookup3.h $(srcdir)/util/regional.h $(srcdir)/util/net_help.h \ - $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/keyraw.h -val_neg.lo val_neg.o: $(srcdir)/validator/val_neg.c config.h $(srcdir)/validator/val_neg.h $(srcdir)/util/locks.h \ - $(srcdir)/util/log.h $(srcdir)/util/rbtree.h $(srcdir)/validator/val_nsec.h $(srcdir)/util/data/packed_rrset.h \ - $(srcdir)/util/storage/lruhash.h $(srcdir)/validator/val_nsec3.h $(srcdir)/validator/val_utils.h \ - $(srcdir)/sldns/pkthdr.h $(srcdir)/util/data/dname.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/net_help.h \ + $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/keyraw.h \ + +val_neg.lo val_neg.o: $(srcdir)/validator/val_neg.c config.h \ + $(srcdir)/validator/val_neg.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/rbtree.h \ + $(srcdir)/validator/val_nsec.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \ + $(srcdir)/validator/val_nsec3.h $(srcdir)/validator/val_utils.h $(srcdir)/sldns/pkthdr.h \ + $(srcdir)/util/data/dname.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/net_help.h \ $(srcdir)/util/config_file.h $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h \ $(srcdir)/services/cache/dns.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/sbuffer.h val_nsec3.lo val_nsec3.o: $(srcdir)/validator/val_nsec3.c config.h $(srcdir)/validator/val_nsec3.h \ @@ -1091,15 +1098,17 @@ val_nsec.lo val_nsec.o: $(srcdir)/validator/val_nsec.c config.h $(srcdir)/valida val_secalgo.lo val_secalgo.o: $(srcdir)/validator/val_secalgo.c config.h $(srcdir)/util/data/packed_rrset.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/validator/val_secalgo.h \ $(srcdir)/validator/val_nsec3.h $(srcdir)/util/rbtree.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/keyraw.h \ - $(srcdir)/sldns/sbuffer.h + $(srcdir)/sldns/sbuffer.h \ + val_sigcrypt.lo val_sigcrypt.o: $(srcdir)/validator/val_sigcrypt.c config.h \ $(srcdir)/validator/val_sigcrypt.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \ $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/sldns/pkthdr.h $(srcdir)/validator/val_secalgo.h \ $(srcdir)/validator/validator.h $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h \ $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/rrdef.h $(srcdir)/validator/val_utils.h \ $(srcdir)/util/data/dname.h $(srcdir)/util/rbtree.h $(srcdir)/util/net_help.h $(srcdir)/util/regional.h \ - $(srcdir)/util/config_file.h $(srcdir)/sldns/keyraw.h $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/parseutil.h \ - $(srcdir)/sldns/wire2str.h + $(srcdir)/util/config_file.h $(srcdir)/sldns/keyraw.h \ + $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/parseutil.h $(srcdir)/sldns/wire2str.h \ + val_utils.lo val_utils.o: $(srcdir)/validator/val_utils.c config.h $(srcdir)/validator/val_utils.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ $(srcdir)/sldns/pkthdr.h $(srcdir)/validator/validator.h $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h \ @@ -1120,15 +1129,43 @@ dns64.lo dns64.o: $(srcdir)/dns64/dns64.c config.h $(srcdir)/dns64/dns64.h $(src $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h \ $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h $(srcdir)/util/net_help.h \ $(srcdir)/util/regional.h $(srcdir)/util/data/dname.h $(srcdir)/sldns/str2wire.h -edns-subnet.lo edns-subnet.o: $(srcdir)/edns-subnet/edns-subnet.c config.h -subnetmod.lo subnetmod.o: $(srcdir)/edns-subnet/subnetmod.c config.h +edns-subnet.lo edns-subnet.o: $(srcdir)/edns-subnet/edns-subnet.c config.h \ + $(srcdir)/edns-subnet/edns-subnet.h $(srcdir)/util/net_help.h $(srcdir)/util/log.h +subnetmod.lo subnetmod.o: $(srcdir)/edns-subnet/subnetmod.c config.h $(srcdir)/edns-subnet/subnetmod.h \ + $(srcdir)/util/module.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ + $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ + $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/services/outbound_list.h $(srcdir)/util/alloc.h \ + $(srcdir)/util/net_help.h $(srcdir)/util/storage/slabhash.h $(srcdir)/util/data/dname.h \ + $(srcdir)/edns-subnet/addrtree.h $(srcdir)/edns-subnet/edns-subnet.h \ + $(srcdir)/edns-subnet/subnet-whitelist.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h \ + $(srcdir)/services/mesh.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ + $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h \ + $(srcdir)/services/localzone.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h $(srcdir)/util/config_file.h \ + $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h \ + $(srcdir)/respip/respip.h $(srcdir)/services/cache/dns.h $(srcdir)/util/regional.h \ + $(srcdir)/iterator/iter_utils.h $(srcdir)/iterator/iter_resptype.h addrtree.lo addrtree.o: $(srcdir)/edns-subnet/addrtree.c config.h $(srcdir)/util/log.h \ $(srcdir)/util/data/msgreply.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/module.h $(srcdir)/util/data/msgparse.h \ $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/edns-subnet/addrtree.h -subnet-whitelist.lo subnet-whitelist.o: $(srcdir)/edns-subnet/subnet-whitelist.c config.h -cachedb.lo cachedb.o: $(srcdir)/cachedb/cachedb.c config.h -redis.lo redis.o: $(srcdir)/cachedb/redis.c config.h +subnet-whitelist.lo subnet-whitelist.o: $(srcdir)/edns-subnet/subnet-whitelist.c config.h \ + $(srcdir)/edns-subnet/edns-subnet.h $(srcdir)/util/net_help.h $(srcdir)/util/log.h \ + $(srcdir)/edns-subnet/subnet-whitelist.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h \ + $(srcdir)/util/regional.h $(srcdir)/util/config_file.h $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/rrdef.h \ + $(srcdir)/util/data/dname.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h +cachedb.lo cachedb.o: $(srcdir)/cachedb/cachedb.c config.h $(srcdir)/cachedb/cachedb.h $(srcdir)/util/module.h \ + $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/data/msgreply.h \ + $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ + $(srcdir)/sldns/rrdef.h $(srcdir)/cachedb/redis.h $(srcdir)/util/regional.h $(srcdir)/util/net_help.h \ + $(srcdir)/util/config_file.h $(srcdir)/util/data/msgencode.h $(srcdir)/services/cache/dns.h \ + $(srcdir)/validator/val_neg.h $(srcdir)/util/rbtree.h $(srcdir)/validator/val_secalgo.h \ + $(srcdir)/iterator/iter_utils.h $(srcdir)/iterator/iter_resptype.h $(srcdir)/sldns/parseutil.h \ + $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/sbuffer.h +redis.lo redis.o: $(srcdir)/cachedb/redis.c config.h $(srcdir)/cachedb/redis.h $(srcdir)/cachedb/cachedb.h \ + $(srcdir)/util/module.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ + $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ + $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/alloc.h $(srcdir)/util/config_file.h \ + $(srcdir)/sldns/sbuffer.h respip.lo respip.o: $(srcdir)/respip/respip.c config.h $(srcdir)/services/localzone.h $(srcdir)/util/rbtree.h \ $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/module.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \ @@ -1143,31 +1180,40 @@ checklocks.lo checklocks.o: $(srcdir)/testcode/checklocks.c config.h $(srcdir)/u $(srcdir)/testcode/checklocks.h dnstap.lo dnstap.o: $(srcdir)/dnstap/dnstap.c config.h $(srcdir)/sldns/sbuffer.h \ $(srcdir)/util/config_file.h $(srcdir)/util/net_help.h $(srcdir)/util/log.h $(srcdir)/util/netevent.h \ - $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/dnscrypt/cert.h \ - $(srcdir)/util/locks.h $(srcdir)/dnstap/dnstap.h \ - dnstap/dnstap.pb-c.h + $(srcdir)/dnscrypt/dnscrypt.h \ + $(srcdir)/dnstap/dnstap.h \ + $(srcdir)/dnstap/dtstream.h $(srcdir)/util/locks.h dnstap/dnstap.pb-c.h dnstap.pb-c.lo dnstap.pb-c.o: dnstap/dnstap.pb-c.c dnstap/dnstap.pb-c.h \ -dynlibmod.lo dynlibmod.o: $(srcdir)/dynlibmod/dynlibmod.c config.h $(srcdir)/dynlibmod/dynlibmod.h \ +dnstap_fstrm.lo dnstap_fstrm.o: $(srcdir)/dnstap/dnstap_fstrm.c config.h $(srcdir)/dnstap/dnstap_fstrm.h \ + $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/wire2str.h +dtstream.lo dtstream.o: $(srcdir)/dnstap/dtstream.c config.h $(srcdir)/dnstap/dtstream.h $(srcdir)/util/locks.h \ + $(srcdir)/util/log.h $(srcdir)/dnstap/dnstap_fstrm.h $(srcdir)/util/config_file.h $(srcdir)/util/ub_event.h \ + $(srcdir)/util/net_help.h $(srcdir)/services/outside_network.h $(srcdir)/util/rbtree.h $(srcdir)/util/netevent.h \ + $(srcdir)/dnscrypt/dnscrypt.h \ + $(srcdir)/sldns/sbuffer.h \ + +ipsecmod.lo ipsecmod.o: $(srcdir)/ipsecmod/ipsecmod.c config.h $(srcdir)/ipsecmod/ipsecmod.h \ $(srcdir)/util/module.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ - $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/rbtree.h\ + $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/rbtree.h $(srcdir)/ipsecmod/ipsecmod-whitelist.h \ $(srcdir)/util/storage/dnstree.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/netevent.h \ $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/util/tube.h \ - $(srcdir)/services/mesh.h $(srcdir)/services/modstack.h $(srcdir)/util/regional.h $(srcdir)/util/net_help.h \ - $(srcdir)/util/config_file.h $(srcdir)/services/cache/dns.h $(srcdir)/sldns/wire2str.h -dnscrypt.lo dnscrypt.o: $(srcdir)/dnscrypt/dnscrypt.c config.h $(srcdir)/sldns/sbuffer.h \ - $(srcdir)/util/config_file.h $(srcdir)/util/net_help.h $(srcdir)/util/log.h $(srcdir)/util/netevent.h \ - $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/dnscrypt/cert.h \ - $(srcdir)/util/locks.h $(srcdir)/util/storage/slabhash.h $(srcdir)/util/storage/lruhash.h \ - $(srcdir)/util/storage/lookup3.h -ipsecmod.lo ipsecmod.o: $(srcdir)/ipsecmod/ipsecmod.c config.h + $(srcdir)/services/mesh.h $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h \ + $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h $(srcdir)/util/config_file.h $(srcdir)/services/authzone.h \ + $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h \ + $(srcdir)/util/regional.h $(srcdir)/util/net_help.h $(srcdir)/services/cache/dns.h $(srcdir)/sldns/wire2str.h +ipsecmod-whitelist.lo ipsecmod-whitelist.o: $(srcdir)/ipsecmod/ipsecmod-whitelist.c config.h \ + $(srcdir)/ipsecmod/ipsecmod.h $(srcdir)/util/module.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h \ + $(srcdir)/util/log.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \ + $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/rbtree.h \ + $(srcdir)/ipsecmod/ipsecmod-whitelist.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/regional.h \ + $(srcdir)/util/config_file.h $(srcdir)/util/data/dname.h $(srcdir)/sldns/str2wire.h ipset.lo ipset.o: $(srcdir)/ipset/ipset.c config.h $(srcdir)/ipset/ipset.h $(srcdir)/util/module.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/data/msgreply.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ - $(srcdir)/sldns/rrdef.h $(srcdir)/util/regional.h $(srcdir)/util/config_file.h $(srcdir)/services/cache/dns.h \ - $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/parseutil.h -ipsecmod-whitelist.lo ipsecmod-whitelist.o: $(srcdir)/ipsecmod/ipsecmod-whitelist.c config.h + $(srcdir)/sldns/rrdef.h $(srcdir)/util/regional.h $(srcdir)/util/net_help.h $(srcdir)/util/config_file.h \ + $(srcdir)/services/cache/dns.h $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/parseutil.h unitanchor.lo unitanchor.o: $(srcdir)/testcode/unitanchor.c config.h $(srcdir)/util/log.h $(srcdir)/util/data/dname.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/testcode/unitmain.h \ $(srcdir)/validator/val_anchor.h $(srcdir)/util/rbtree.h $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/rrdef.h @@ -1176,7 +1222,8 @@ unitdname.lo unitdname.o: $(srcdir)/testcode/unitdname.c config.h $(srcdir)/util $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/rrdef.h unitlruhash.lo unitlruhash.o: $(srcdir)/testcode/unitlruhash.c config.h $(srcdir)/testcode/unitmain.h \ $(srcdir)/util/log.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/storage/slabhash.h -unitmain.lo unitmain.o: $(srcdir)/testcode/unitmain.c config.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/keyraw.h \ +unitmain.lo unitmain.o: $(srcdir)/testcode/unitmain.c config.h \ + $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/keyraw.h \ $(srcdir)/util/log.h $(srcdir)/testcode/unitmain.h $(srcdir)/util/alloc.h $(srcdir)/util/locks.h $(srcdir)/util/net_help.h \ $(srcdir)/util/config_file.h $(srcdir)/util/rtt.h $(srcdir)/util/timehist.h $(srcdir)/iterator/iterator.h \ $(srcdir)/services/outbound_list.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/storage/lruhash.h \ @@ -1184,7 +1231,8 @@ unitmain.lo unitmain.o: $(srcdir)/testcode/unitmain.c config.h $(srcdir)/sldns/r $(srcdir)/sldns/pkthdr.h $(srcdir)/libunbound/unbound.h $(srcdir)/services/cache/infra.h \ $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ $(srcdir)/util/random.h $(srcdir)/respip/respip.h \ - $(srcdir)/services/localzone.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h + $(srcdir)/services/localzone.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h \ + $(srcdir)/services/outside_network.h unitmsgparse.lo unitmsgparse.o: $(srcdir)/testcode/unitmsgparse.c config.h $(srcdir)/util/log.h \ $(srcdir)/testcode/unitmain.h $(srcdir)/util/data/msgparse.h $(srcdir)/util/storage/lruhash.h \ $(srcdir)/util/locks.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/data/msgreply.h \ @@ -1216,7 +1264,13 @@ testpkts.lo testpkts.o: $(srcdir)/testcode/testpkts.c config.h $(srcdir)/testcod unitldns.lo unitldns.o: $(srcdir)/testcode/unitldns.c config.h $(srcdir)/util/log.h $(srcdir)/testcode/unitmain.h \ $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/wire2str.h \ $(srcdir)/sldns/parseutil.h -unitecs.lo unitecs.o: $(srcdir)/testcode/unitecs.c config.h +unitecs.lo unitecs.o: $(srcdir)/testcode/unitecs.c config.h $(srcdir)/util/log.h $(srcdir)/util/module.h \ + $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/data/msgreply.h \ + $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ + $(srcdir)/sldns/rrdef.h $(srcdir)/testcode/unitmain.h $(srcdir)/edns-subnet/addrtree.h \ + $(srcdir)/edns-subnet/subnetmod.h $(srcdir)/services/outbound_list.h $(srcdir)/util/alloc.h \ + $(srcdir)/util/net_help.h $(srcdir)/util/storage/slabhash.h $(srcdir)/util/data/dname.h \ + $(srcdir)/edns-subnet/edns-subnet.h unitauth.lo unitauth.o: $(srcdir)/testcode/unitauth.c config.h $(srcdir)/services/authzone.h \ $(srcdir)/util/rbtree.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/services/mesh.h $(srcdir)/util/netevent.h \ $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/util/data/msgparse.h \ @@ -1233,40 +1287,43 @@ acl_list.lo acl_list.o: $(srcdir)/daemon/acl_list.c config.h $(srcdir)/daemon/ac $(srcdir)/services/localzone.h $(srcdir)/util/module.h $(srcdir)/util/storage/lruhash.h \ $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/str2wire.h -cachedump.lo cachedump.o: $(srcdir)/daemon/cachedump.c config.h $(srcdir)/daemon/cachedump.h \ - $(srcdir)/daemon/remote.h $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h \ - $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ - $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/util/alloc.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ - $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h \ - $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h \ - $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h $(srcdir)/services/cache/dns.h \ - $(srcdir)/services/cache/infra.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/util/rtt.h \ - $(srcdir)/util/regional.h $(srcdir)/util/net_help.h $(srcdir)/util/data/dname.h $(srcdir)/iterator/iterator.h \ - $(srcdir)/services/outbound_list.h $(srcdir)/iterator/iter_delegpt.h $(srcdir)/iterator/iter_utils.h \ - $(srcdir)/iterator/iter_resptype.h $(srcdir)/iterator/iter_fwd.h $(srcdir)/iterator/iter_hints.h \ - $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/str2wire.h -daemon.lo daemon.o: $(srcdir)/daemon/daemon.c config.h $(srcdir)/daemon/daemon.h $(srcdir)/util/locks.h \ - $(srcdir)/util/log.h $(srcdir)/util/alloc.h $(srcdir)/services/modstack.h \ - $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h \ +cachedump.lo cachedump.o: $(srcdir)/daemon/cachedump.c config.h \ + $(srcdir)/daemon/cachedump.h $(srcdir)/daemon/remote.h $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h \ $(srcdir)/sldns/sbuffer.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \ - $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/util/data/msgreply.h \ + $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ + $(srcdir)/util/alloc.h $(srcdir)/util/data/msgreply.h \ $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h \ $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h \ - $(srcdir)/daemon/remote.h $(srcdir)/daemon/acl_list.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h \ - $(srcdir)/services/view.h $(srcdir)/util/config_file.h $(srcdir)/util/shm_side/shm_main.h \ - $(srcdir)/util/storage/lookup3.h $(srcdir)/util/storage/slabhash.h $(srcdir)/util/tcp_conn_limit.h \ + $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h \ + $(srcdir)/services/cache/dns.h $(srcdir)/services/cache/infra.h $(srcdir)/util/storage/dnstree.h \ + $(srcdir)/util/rbtree.h $(srcdir)/util/rtt.h $(srcdir)/util/regional.h $(srcdir)/util/net_help.h \ + $(srcdir)/util/data/dname.h $(srcdir)/iterator/iterator.h $(srcdir)/services/outbound_list.h \ + $(srcdir)/iterator/iter_delegpt.h $(srcdir)/iterator/iter_utils.h $(srcdir)/iterator/iter_resptype.h \ + $(srcdir)/iterator/iter_fwd.h $(srcdir)/iterator/iter_hints.h $(srcdir)/sldns/wire2str.h \ + $(srcdir)/sldns/str2wire.h +daemon.lo daemon.o: $(srcdir)/daemon/daemon.c config.h \ + $(srcdir)/daemon/daemon.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/alloc.h $(srcdir)/services/modstack.h \ + $(srcdir)/daemon/worker.h \ + $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h $(srcdir)/util/data/packed_rrset.h \ + $(srcdir)/util/storage/lruhash.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ + $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h \ + $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/util/module.h \ + $(srcdir)/dnstap/dnstap.h $(srcdir)/daemon/remote.h \ + $(srcdir)/daemon/acl_list.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/services/view.h \ + $(srcdir)/util/config_file.h $(srcdir)/util/shm_side/shm_main.h $(srcdir)/util/storage/lookup3.h \ + $(srcdir)/util/storage/slabhash.h $(srcdir)/util/tcp_conn_limit.h $(srcdir)/util/edns.h \ $(srcdir)/services/listen_dnsport.h $(srcdir)/services/cache/rrset.h $(srcdir)/services/cache/infra.h \ $(srcdir)/util/rtt.h $(srcdir)/services/localzone.h $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h \ $(srcdir)/services/rpz.h $(srcdir)/respip/respip.h $(srcdir)/util/random.h $(srcdir)/util/tube.h $(srcdir)/util/net_help.h \ $(srcdir)/sldns/keyraw.h -remote.lo remote.o: $(srcdir)/daemon/remote.c config.h $(srcdir)/daemon/remote.h $(srcdir)/daemon/worker.h \ - $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h $(srcdir)/util/data/packed_rrset.h \ - $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/netevent.h \ - $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/util/alloc.h \ - $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h \ - $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/util/module.h \ - $(srcdir)/dnstap/dnstap.h $(srcdir)/daemon/daemon.h \ +remote.lo remote.o: $(srcdir)/daemon/remote.c config.h \ + $(srcdir)/daemon/remote.h \ + $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h \ + $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ + $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ + $(srcdir)/util/alloc.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ + $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h \ + $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h $(srcdir)/daemon/daemon.h \ $(srcdir)/services/modstack.h $(srcdir)/daemon/cachedump.h $(srcdir)/util/config_file.h \ $(srcdir)/util/net_help.h $(srcdir)/services/listen_dnsport.h $(srcdir)/services/cache/rrset.h \ $(srcdir)/util/storage/slabhash.h $(srcdir)/services/cache/infra.h $(srcdir)/util/storage/dnstree.h \ @@ -1291,19 +1348,21 @@ stats.lo stats.o: $(srcdir)/daemon/stats.c config.h $(srcdir)/daemon/stats.h $(s $(srcdir)/util/net_help.h $(srcdir)/validator/validator.h $(srcdir)/validator/val_utils.h \ $(srcdir)/iterator/iterator.h $(srcdir)/services/outbound_list.h $(srcdir)/services/cache/rrset.h \ $(srcdir)/util/storage/slabhash.h $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h \ - $(srcdir)/validator/val_kcache.h $(srcdir)/validator/val_neg.h + $(srcdir)/validator/val_kcache.h $(srcdir)/validator/val_neg.h $(srcdir)/edns-subnet/subnetmod.h \ + $(srcdir)/util/data/dname.h $(srcdir)/edns-subnet/addrtree.h $(srcdir)/edns-subnet/edns-subnet.h \ + unbound.lo unbound.o: $(srcdir)/daemon/unbound.c config.h $(srcdir)/util/log.h $(srcdir)/daemon/daemon.h \ $(srcdir)/util/locks.h $(srcdir)/util/alloc.h $(srcdir)/services/modstack.h \ - $(srcdir)/daemon/remote.h $(srcdir)/util/config_file.h \ - $(srcdir)/util/storage/slabhash.h $(srcdir)/util/storage/lruhash.h $(srcdir)/services/listen_dnsport.h \ - $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/services/cache/rrset.h \ - $(srcdir)/util/data/packed_rrset.h $(srcdir)/services/cache/infra.h $(srcdir)/util/storage/dnstree.h \ - $(srcdir)/util/rbtree.h $(srcdir)/util/rtt.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/fptr_wlist.h \ - $(srcdir)/util/module.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h \ - $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h \ - $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h \ - $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h $(srcdir)/util/net_help.h \ - $(srcdir)/util/ub_event.h + $(srcdir)/daemon/remote.h \ + $(srcdir)/util/config_file.h $(srcdir)/util/storage/slabhash.h $(srcdir)/util/storage/lruhash.h \ + $(srcdir)/services/listen_dnsport.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ + $(srcdir)/services/cache/rrset.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/services/cache/infra.h \ + $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/util/rtt.h $(srcdir)/util/data/msgreply.h \ + $(srcdir)/util/fptr_wlist.h $(srcdir)/util/module.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ + $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/services/rpz.h \ + $(srcdir)/services/localzone.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h $(srcdir)/services/authzone.h \ + $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h \ + $(srcdir)/util/net_help.h $(srcdir)/util/ub_event.h worker.lo worker.o: $(srcdir)/daemon/worker.c config.h $(srcdir)/util/log.h $(srcdir)/util/net_help.h \ $(srcdir)/util/random.h $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h \ @@ -1311,23 +1370,24 @@ worker.lo worker.o: $(srcdir)/daemon/worker.c config.h $(srcdir)/util/log.h $(sr $(srcdir)/util/alloc.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h \ $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h $(srcdir)/daemon/daemon.h \ - $(srcdir)/services/modstack.h $(srcdir)/daemon/remote.h $(srcdir)/daemon/acl_list.h \ - $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/services/view.h $(srcdir)/util/config_file.h \ - $(srcdir)/util/regional.h $(srcdir)/util/storage/slabhash.h $(srcdir)/services/listen_dnsport.h \ - $(srcdir)/services/outside_network.h $(srcdir)/services/outbound_list.h \ - $(srcdir)/services/cache/rrset.h $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h \ - $(srcdir)/services/cache/dns.h $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h $(srcdir)/services/rpz.h \ - $(srcdir)/services/localzone.h $(srcdir)/respip/respip.h $(srcdir)/util/data/msgencode.h \ - $(srcdir)/util/data/dname.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h $(srcdir)/util/edns.h \ - $(srcdir)/iterator/iter_fwd.h $(srcdir)/iterator/iter_hints.h $(srcdir)/validator/autotrust.h \ - $(srcdir)/validator/val_anchor.h $(srcdir)/libunbound/context.h $(srcdir)/libunbound/unbound-event.h \ - $(srcdir)/libunbound/libworker.h $(srcdir)/sldns/wire2str.h $(srcdir)/util/shm_side/shm_main.h \ - $(srcdir)/dnstap/dtstream.h + $(srcdir)/services/modstack.h $(srcdir)/daemon/remote.h \ + $(srcdir)/daemon/acl_list.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/services/view.h \ + $(srcdir)/util/config_file.h $(srcdir)/util/regional.h $(srcdir)/util/storage/slabhash.h \ + $(srcdir)/services/listen_dnsport.h $(srcdir)/services/outside_network.h \ + $(srcdir)/services/outbound_list.h $(srcdir)/services/cache/rrset.h $(srcdir)/services/cache/infra.h \ + $(srcdir)/util/rtt.h $(srcdir)/services/cache/dns.h $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h \ + $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h $(srcdir)/respip/respip.h \ + $(srcdir)/util/data/msgencode.h $(srcdir)/util/data/dname.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h \ + $(srcdir)/util/edns.h $(srcdir)/iterator/iter_fwd.h $(srcdir)/iterator/iter_hints.h \ + $(srcdir)/validator/autotrust.h $(srcdir)/validator/val_anchor.h $(srcdir)/libunbound/context.h \ + $(srcdir)/libunbound/unbound-event.h $(srcdir)/libunbound/libworker.h $(srcdir)/sldns/wire2str.h \ + $(srcdir)/util/shm_side/shm_main.h $(srcdir)/dnstap/dtstream.h testbound.lo testbound.o: $(srcdir)/testcode/testbound.c config.h $(srcdir)/testcode/testpkts.h \ $(srcdir)/testcode/replay.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ $(srcdir)/util/rbtree.h $(srcdir)/testcode/fake_event.h \ - $(srcdir)/daemon/remote.h $(srcdir)/util/config_file.h $(srcdir)/sldns/keyraw.h $(srcdir)/daemon/unbound.c \ - $(srcdir)/util/log.h $(srcdir)/daemon/daemon.h $(srcdir)/util/locks.h $(srcdir)/util/alloc.h $(srcdir)/services/modstack.h \ + $(srcdir)/daemon/remote.h \ + $(srcdir)/util/config_file.h $(srcdir)/sldns/keyraw.h $(srcdir)/daemon/unbound.c $(srcdir)/util/log.h \ + $(srcdir)/daemon/daemon.h $(srcdir)/util/locks.h $(srcdir)/util/alloc.h $(srcdir)/services/modstack.h \ $(srcdir)/util/storage/slabhash.h $(srcdir)/util/storage/lruhash.h \ $(srcdir)/services/listen_dnsport.h $(srcdir)/services/cache/rrset.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/services/cache/infra.h $(srcdir)/util/storage/dnstree.h \ @@ -1346,34 +1406,35 @@ worker.lo worker.o: $(srcdir)/daemon/worker.c config.h $(srcdir)/util/log.h $(sr $(srcdir)/util/alloc.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h \ $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h $(srcdir)/daemon/daemon.h \ - $(srcdir)/services/modstack.h $(srcdir)/daemon/remote.h $(srcdir)/daemon/acl_list.h \ - $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/services/view.h $(srcdir)/util/config_file.h \ - $(srcdir)/util/regional.h $(srcdir)/util/storage/slabhash.h $(srcdir)/services/listen_dnsport.h \ - $(srcdir)/services/outside_network.h $(srcdir)/services/outbound_list.h \ - $(srcdir)/services/cache/rrset.h $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h \ - $(srcdir)/services/cache/dns.h $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h $(srcdir)/services/rpz.h \ - $(srcdir)/services/localzone.h $(srcdir)/respip/respip.h $(srcdir)/util/data/msgencode.h \ - $(srcdir)/util/data/dname.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h $(srcdir)/util/edns.h \ - $(srcdir)/iterator/iter_fwd.h $(srcdir)/iterator/iter_hints.h $(srcdir)/validator/autotrust.h \ - $(srcdir)/validator/val_anchor.h $(srcdir)/libunbound/context.h $(srcdir)/libunbound/unbound-event.h \ - $(srcdir)/libunbound/libworker.h $(srcdir)/sldns/wire2str.h $(srcdir)/util/shm_side/shm_main.h \ - $(srcdir)/dnstap/dtstream.h + $(srcdir)/services/modstack.h $(srcdir)/daemon/remote.h \ + $(srcdir)/daemon/acl_list.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/services/view.h \ + $(srcdir)/util/config_file.h $(srcdir)/util/regional.h $(srcdir)/util/storage/slabhash.h \ + $(srcdir)/services/listen_dnsport.h $(srcdir)/services/outside_network.h \ + $(srcdir)/services/outbound_list.h $(srcdir)/services/cache/rrset.h $(srcdir)/services/cache/infra.h \ + $(srcdir)/util/rtt.h $(srcdir)/services/cache/dns.h $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h \ + $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h $(srcdir)/respip/respip.h \ + $(srcdir)/util/data/msgencode.h $(srcdir)/util/data/dname.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h \ + $(srcdir)/util/edns.h $(srcdir)/iterator/iter_fwd.h $(srcdir)/iterator/iter_hints.h \ + $(srcdir)/validator/autotrust.h $(srcdir)/validator/val_anchor.h $(srcdir)/libunbound/context.h \ + $(srcdir)/libunbound/unbound-event.h $(srcdir)/libunbound/libworker.h $(srcdir)/sldns/wire2str.h \ + $(srcdir)/util/shm_side/shm_main.h $(srcdir)/dnstap/dtstream.h acl_list.lo acl_list.o: $(srcdir)/daemon/acl_list.c config.h $(srcdir)/daemon/acl_list.h \ $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/services/view.h $(srcdir)/util/locks.h \ $(srcdir)/util/log.h $(srcdir)/util/regional.h $(srcdir)/util/config_file.h $(srcdir)/util/net_help.h \ $(srcdir)/services/localzone.h $(srcdir)/util/module.h $(srcdir)/util/storage/lruhash.h \ $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/str2wire.h -daemon.lo daemon.o: $(srcdir)/daemon/daemon.c config.h $(srcdir)/daemon/daemon.h $(srcdir)/util/locks.h \ - $(srcdir)/util/log.h $(srcdir)/util/alloc.h $(srcdir)/services/modstack.h \ - $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h \ - $(srcdir)/sldns/sbuffer.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \ - $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/util/data/msgreply.h \ - $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h \ - $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h \ - $(srcdir)/daemon/remote.h $(srcdir)/daemon/acl_list.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h \ - $(srcdir)/services/view.h $(srcdir)/util/config_file.h $(srcdir)/util/shm_side/shm_main.h \ - $(srcdir)/util/storage/lookup3.h $(srcdir)/util/storage/slabhash.h $(srcdir)/util/tcp_conn_limit.h \ +daemon.lo daemon.o: $(srcdir)/daemon/daemon.c config.h \ + $(srcdir)/daemon/daemon.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/alloc.h $(srcdir)/services/modstack.h \ + $(srcdir)/daemon/worker.h \ + $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h $(srcdir)/util/data/packed_rrset.h \ + $(srcdir)/util/storage/lruhash.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ + $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h \ + $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/util/module.h \ + $(srcdir)/dnstap/dnstap.h $(srcdir)/daemon/remote.h \ + $(srcdir)/daemon/acl_list.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/services/view.h \ + $(srcdir)/util/config_file.h $(srcdir)/util/shm_side/shm_main.h $(srcdir)/util/storage/lookup3.h \ + $(srcdir)/util/storage/slabhash.h $(srcdir)/util/tcp_conn_limit.h $(srcdir)/util/edns.h \ $(srcdir)/services/listen_dnsport.h $(srcdir)/services/cache/rrset.h $(srcdir)/services/cache/infra.h \ $(srcdir)/util/rtt.h $(srcdir)/services/localzone.h $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h \ $(srcdir)/services/rpz.h $(srcdir)/respip/respip.h $(srcdir)/util/random.h $(srcdir)/util/tube.h $(srcdir)/util/net_help.h \ @@ -1391,7 +1452,9 @@ stats.lo stats.o: $(srcdir)/daemon/stats.c config.h $(srcdir)/daemon/stats.h $(s $(srcdir)/util/net_help.h $(srcdir)/validator/validator.h $(srcdir)/validator/val_utils.h \ $(srcdir)/iterator/iterator.h $(srcdir)/services/outbound_list.h $(srcdir)/services/cache/rrset.h \ $(srcdir)/util/storage/slabhash.h $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h \ - $(srcdir)/validator/val_kcache.h $(srcdir)/validator/val_neg.h + $(srcdir)/validator/val_kcache.h $(srcdir)/validator/val_neg.h $(srcdir)/edns-subnet/subnetmod.h \ + $(srcdir)/util/data/dname.h $(srcdir)/edns-subnet/addrtree.h $(srcdir)/edns-subnet/edns-subnet.h \ + replay.lo replay.o: $(srcdir)/testcode/replay.c config.h $(srcdir)/util/log.h $(srcdir)/util/net_help.h \ $(srcdir)/util/config_file.h $(srcdir)/testcode/replay.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ $(srcdir)/testcode/testpkts.h $(srcdir)/util/rbtree.h \ @@ -1401,13 +1464,14 @@ fake_event.lo fake_event.o: $(srcdir)/testcode/fake_event.c config.h $(srcdir)/t $(srcdir)/util/net_help.h $(srcdir)/util/log.h $(srcdir)/util/data/msgparse.h $(srcdir)/util/storage/lruhash.h \ $(srcdir)/util/locks.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/data/msgreply.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgencode.h $(srcdir)/util/data/dname.h \ - $(srcdir)/util/config_file.h $(srcdir)/services/listen_dnsport.h $(srcdir)/services/outside_network.h \ - $(srcdir)/util/rbtree.h $(srcdir)/services/cache/infra.h \ - $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rtt.h $(srcdir)/testcode/replay.h $(srcdir)/testcode/testpkts.h \ - $(srcdir)/util/fptr_wlist.h $(srcdir)/util/module.h $(srcdir)/util/tube.h $(srcdir)/services/mesh.h \ - $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h $(srcdir)/services/view.h \ - $(srcdir)/sldns/sbuffer.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \ - $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/str2wire.h + $(srcdir)/util/edns.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/util/config_file.h \ + $(srcdir)/services/listen_dnsport.h $(srcdir)/services/outside_network.h \ + $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h \ + $(srcdir)/testcode/replay.h $(srcdir)/testcode/testpkts.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/module.h \ + $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h \ + $(srcdir)/services/localzone.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h $(srcdir)/services/authzone.h \ + $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h \ + $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/str2wire.h lock_verify.lo lock_verify.o: $(srcdir)/testcode/lock_verify.c config.h $(srcdir)/util/log.h $(srcdir)/util/rbtree.h \ $(srcdir)/util/locks.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/module.h \ @@ -1442,7 +1506,8 @@ unbound-checkconf.lo unbound-checkconf.o: $(srcdir)/smallapp/unbound-checkconf.c $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h \ $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \ - $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h + $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h $(srcdir)/sldns/str2wire.h \ + $(PYTHONMOD_HEADER) $(srcdir)/edns-subnet/subnet-whitelist.h worker_cb.lo worker_cb.o: $(srcdir)/smallapp/worker_cb.c config.h $(srcdir)/libunbound/context.h \ $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/alloc.h $(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h \ $(srcdir)/libunbound/unbound.h $(srcdir)/libunbound/unbound-event.h $(srcdir)/util/data/packed_rrset.h \ @@ -1463,76 +1528,83 @@ context.lo context.o: $(srcdir)/libunbound/context.c config.h $(srcdir)/libunbou $(srcdir)/util/storage/slabhash.h $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h \ $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h $(srcdir)/services/rpz.h $(srcdir)/daemon/stats.h \ - $(srcdir)/util/timehist.h $(srcdir)/respip/respip.h + $(srcdir)/util/timehist.h $(srcdir)/respip/respip.h $(srcdir)/util/edns.h libunbound.lo libunbound.o: $(srcdir)/libunbound/libunbound.c $(srcdir)/libunbound/unbound.h \ $(srcdir)/libunbound/unbound-event.h config.h $(srcdir)/libunbound/context.h $(srcdir)/util/locks.h \ $(srcdir)/util/log.h $(srcdir)/util/alloc.h $(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/libunbound/libworker.h \ $(srcdir)/util/config_file.h $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h \ $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/regional.h \ - $(srcdir)/util/random.h $(srcdir)/util/net_help.h $(srcdir)/util/tube.h $(srcdir)/util/ub_event.h \ - $(srcdir)/services/localzone.h $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h \ + $(srcdir)/util/random.h $(srcdir)/util/net_help.h $(srcdir)/util/tube.h $(srcdir)/util/ub_event.h $(srcdir)/util/edns.h \ + $(srcdir)/util/storage/dnstree.h $(srcdir)/services/localzone.h $(srcdir)/services/view.h \ $(srcdir)/sldns/sbuffer.h $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h $(srcdir)/util/netevent.h \ $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/services/cache/rrset.h \ $(srcdir)/util/storage/slabhash.h $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h \ $(srcdir)/services/rpz.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/respip/respip.h -libworker.lo libworker.o: $(srcdir)/libunbound/libworker.c config.h $(srcdir)/libunbound/libworker.h \ - $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ - $(srcdir)/libunbound/context.h $(srcdir)/util/alloc.h $(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h \ - $(srcdir)/libunbound/unbound.h $(srcdir)/libunbound/unbound-event.h $(srcdir)/libunbound/worker.h \ - $(srcdir)/sldns/sbuffer.h $(srcdir)/services/outside_network.h $(srcdir)/util/netevent.h \ - $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/services/mesh.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h \ - $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h \ - $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h $(srcdir)/util/config_file.h \ - $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/respip/respip.h \ - $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h $(srcdir)/services/outbound_list.h \ - $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h $(srcdir)/util/regional.h $(srcdir)/util/random.h \ - $(srcdir)/util/storage/lookup3.h $(srcdir)/util/net_help.h $(srcdir)/util/data/dname.h \ - $(srcdir)/util/data/msgencode.h $(srcdir)/iterator/iter_fwd.h $(srcdir)/iterator/iter_hints.h \ - $(srcdir)/sldns/str2wire.h +libworker.lo libworker.o: $(srcdir)/libunbound/libworker.c config.h \ + $(srcdir)/libunbound/libworker.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \ + $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/libunbound/context.h $(srcdir)/util/alloc.h $(srcdir)/util/rbtree.h \ + $(srcdir)/services/modstack.h $(srcdir)/libunbound/unbound.h $(srcdir)/libunbound/unbound-event.h \ + $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h $(srcdir)/services/outside_network.h \ + $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ + $(srcdir)/services/mesh.h $(srcdir)/util/data/msgparse.h \ + $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h \ + $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h $(srcdir)/util/storage/dnstree.h \ + $(srcdir)/services/view.h $(srcdir)/util/config_file.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h \ + $(srcdir)/util/timehist.h $(srcdir)/respip/respip.h $(srcdir)/services/cache/rrset.h \ + $(srcdir)/util/storage/slabhash.h $(srcdir)/services/outbound_list.h $(srcdir)/util/fptr_wlist.h \ + $(srcdir)/util/tube.h $(srcdir)/util/regional.h $(srcdir)/util/random.h $(srcdir)/util/storage/lookup3.h \ + $(srcdir)/util/net_help.h $(srcdir)/util/data/dname.h $(srcdir)/util/data/msgencode.h \ + $(srcdir)/iterator/iter_fwd.h $(srcdir)/iterator/iter_hints.h $(srcdir)/sldns/str2wire.h unbound-host.lo unbound-host.o: $(srcdir)/smallapp/unbound-host.c config.h $(srcdir)/libunbound/unbound.h \ - $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/wire2str.h + $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/wire2str.h \ + asynclook.lo asynclook.o: $(srcdir)/testcode/asynclook.c config.h $(srcdir)/libunbound/unbound.h \ $(srcdir)/libunbound/context.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/alloc.h $(srcdir)/util/rbtree.h \ $(srcdir)/services/modstack.h $(srcdir)/libunbound/unbound-event.h $(srcdir)/util/data/packed_rrset.h \ - $(srcdir)/util/storage/lruhash.h $(srcdir)/sldns/rrdef.h + $(srcdir)/util/storage/lruhash.h $(srcdir)/sldns/rrdef.h \ + streamtcp.lo streamtcp.o: $(srcdir)/testcode/streamtcp.c config.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ $(srcdir)/util/net_help.h $(srcdir)/util/data/msgencode.h $(srcdir)/util/data/msgparse.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/data/msgreply.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/dname.h $(srcdir)/sldns/sbuffer.h \ - $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/wire2str.h + $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/wire2str.h \ + perf.lo perf.o: $(srcdir)/testcode/perf.c config.h $(srcdir)/util/log.h $(srcdir)/util/locks.h $(srcdir)/util/net_help.h \ $(srcdir)/util/data/msgencode.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/storage/lruhash.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/str2wire.h delayer.lo delayer.o: $(srcdir)/testcode/delayer.c config.h $(srcdir)/util/net_help.h $(srcdir)/util/log.h \ $(srcdir)/util/config_file.h $(srcdir)/sldns/sbuffer.h -unbound-control.lo unbound-control.o: $(srcdir)/smallapp/unbound-control.c config.h $(srcdir)/util/log.h \ - $(srcdir)/util/config_file.h $(srcdir)/util/locks.h $(srcdir)/util/net_help.h $(srcdir)/util/shm_side/shm_main.h \ - $(srcdir)/libunbound/unbound.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/sldns/wire2str.h \ - $(srcdir)/sldns/pkthdr.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h $(srcdir)/util/rbtree.h \ - $(srcdir)/util/storage/dnstree.h $(srcdir)/util/module.h $(srcdir)/util/storage/lruhash.h \ - $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ - $(srcdir)/sldns/rrdef.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h $(srcdir)/services/authzone.h \ - $(srcdir)/services/mesh.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ +unbound-control.lo unbound-control.o: $(srcdir)/smallapp/unbound-control.c config.h \ + $(srcdir)/util/log.h $(srcdir)/util/config_file.h $(srcdir)/util/locks.h $(srcdir)/util/net_help.h \ + $(srcdir)/util/shm_side/shm_main.h $(srcdir)/libunbound/unbound.h $(srcdir)/daemon/stats.h \ + $(srcdir)/util/timehist.h $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/pkthdr.h $(srcdir)/services/rpz.h \ + $(srcdir)/services/localzone.h $(srcdir)/util/rbtree.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/module.h \ + $(srcdir)/util/storage/lruhash.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \ + $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/rrdef.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h \ + $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ $(srcdir)/services/modstack.h $(srcdir)/respip/respip.h unbound-anchor.lo unbound-anchor.o: $(srcdir)/smallapp/unbound-anchor.c config.h $(srcdir)/libunbound/unbound.h \ - $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/parseutil.h -petal.lo petal.o: $(srcdir)/testcode/petal.c config.h + $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/parseutil.h \ + +petal.lo petal.o: $(srcdir)/testcode/petal.c config.h \ + unbound-dnstap-socket.lo unbound-dnstap-socket.o: $(srcdir)/dnstap/unbound-dnstap-socket.c config.h \ $(srcdir)/dnstap/dtstream.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/dnstap/dnstap_fstrm.h \ $(srcdir)/util/ub_event.h $(srcdir)/util/net_help.h $(srcdir)/services/listen_dnsport.h \ $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/wire2str.h $(srcdir)/util/config_file.h \ - $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h + $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/wire2str.h \ + dnstap/dnstap.pb-c.h \ + $(srcdir)/util/config_file.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h pythonmod_utils.lo pythonmod_utils.o: $(srcdir)/pythonmod/pythonmod_utils.c config.h $(srcdir)/util/module.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/data/msgreply.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ $(srcdir)/sldns/rrdef.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ $(srcdir)/util/net_help.h $(srcdir)/services/cache/dns.h \ $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h $(srcdir)/util/regional.h \ - $(srcdir)/iterator/iter_delegpt.h $(srcdir)/sldns/sbuffer.h + $(srcdir)/iterator/iter_delegpt.h $(srcdir)/sldns/sbuffer.h \ + win_svc.lo win_svc.o: $(srcdir)/winrc/win_svc.c config.h $(srcdir)/winrc/win_svc.h $(srcdir)/winrc/w_inst.h \ $(srcdir)/daemon/daemon.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/alloc.h $(srcdir)/services/modstack.h \ $(srcdir)/daemon/worker.h \ @@ -1540,8 +1612,8 @@ win_svc.lo win_svc.o: $(srcdir)/winrc/win_svc.c config.h $(srcdir)/winrc/win_svc $(srcdir)/util/storage/lruhash.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h \ $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/util/module.h \ - $(srcdir)/dnstap/dnstap.h $(srcdir)/daemon/remote.h $(srcdir)/util/config_file.h $(srcdir)/util/ub_event.h \ - $(srcdir)/util/net_help.h + $(srcdir)/dnstap/dnstap.h $(srcdir)/daemon/remote.h \ + $(srcdir)/util/config_file.h $(srcdir)/util/ub_event.h $(srcdir)/util/net_help.h w_inst.lo w_inst.o: $(srcdir)/winrc/w_inst.c config.h $(srcdir)/winrc/w_inst.h $(srcdir)/winrc/win_svc.h unbound-service-install.lo unbound-service-install.o: $(srcdir)/winrc/unbound-service-install.c config.h \ $(srcdir)/winrc/w_inst.h @@ -1549,12 +1621,14 @@ unbound-service-remove.lo unbound-service-remove.o: $(srcdir)/winrc/unbound-serv $(srcdir)/winrc/w_inst.h anchor-update.lo anchor-update.o: $(srcdir)/winrc/anchor-update.c config.h $(srcdir)/libunbound/unbound.h \ $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/wire2str.h -keyraw.lo keyraw.o: $(srcdir)/sldns/keyraw.c config.h $(srcdir)/sldns/keyraw.h $(srcdir)/sldns/rrdef.h +keyraw.lo keyraw.o: $(srcdir)/sldns/keyraw.c config.h $(srcdir)/sldns/keyraw.h \ + $(srcdir)/sldns/rrdef.h \ + sbuffer.lo sbuffer.o: $(srcdir)/sldns/sbuffer.c config.h $(srcdir)/sldns/sbuffer.h wire2str.lo wire2str.o: $(srcdir)/sldns/wire2str.c config.h $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/str2wire.h \ $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/parseutil.h $(srcdir)/sldns/sbuffer.h \ - $(srcdir)/sldns/keyraw.h $(srcdir)/util/data/dname.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h \ - $(srcdir)/util/log.h + $(srcdir)/sldns/keyraw.h \ + $(srcdir)/util/data/dname.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h parse.lo parse.o: $(srcdir)/sldns/parse.c config.h $(srcdir)/sldns/parse.h $(srcdir)/sldns/parseutil.h \ $(srcdir)/sldns/sbuffer.h parseutil.lo parseutil.o: $(srcdir)/sldns/parseutil.c config.h $(srcdir)/sldns/parseutil.h @@ -1562,9 +1636,11 @@ rrdef.lo rrdef.o: $(srcdir)/sldns/rrdef.c config.h $(srcdir)/sldns/rrdef.h $(src str2wire.lo str2wire.o: $(srcdir)/sldns/str2wire.c config.h $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/rrdef.h \ $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/parse.h $(srcdir)/sldns/parseutil.h dohclient.lo dohclient.o: $(srcdir)/testcode/dohclient.c config.h $(srcdir)/sldns/wire2str.h \ - $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/data/msgencode.h \ - $(srcdir)/util/data/msgreply.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ - $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/net_help.h + $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/parseutil.h \ + $(srcdir)/util/data/msgencode.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/storage/lruhash.h \ + $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ + $(srcdir)/sldns/pkthdr.h $(srcdir)/util/net_help.h \ + ctime_r.lo ctime_r.o: $(srcdir)/compat/ctime_r.c config.h $(srcdir)/util/locks.h $(srcdir)/util/log.h fake-rfc2553.lo fake-rfc2553.o: $(srcdir)/compat/fake-rfc2553.c $(srcdir)/compat/fake-rfc2553.h config.h gmtime_r.lo gmtime_r.o: $(srcdir)/compat/gmtime_r.c config.h @@ -1579,9 +1655,11 @@ strlcat.lo strlcat.o: $(srcdir)/compat/strlcat.c config.h strlcpy.lo strlcpy.o: $(srcdir)/compat/strlcpy.c config.h strptime.lo strptime.o: $(srcdir)/compat/strptime.c config.h getentropy_freebsd.lo getentropy_freebsd.o: $(srcdir)/compat/getentropy_freebsd.c -getentropy_linux.lo getentropy_linux.o: $(srcdir)/compat/getentropy_linux.c config.h +getentropy_linux.lo getentropy_linux.o: $(srcdir)/compat/getentropy_linux.c config.h \ + getentropy_osx.lo getentropy_osx.o: $(srcdir)/compat/getentropy_osx.c -getentropy_solaris.lo getentropy_solaris.o: $(srcdir)/compat/getentropy_solaris.c config.h +getentropy_solaris.lo getentropy_solaris.o: $(srcdir)/compat/getentropy_solaris.c config.h \ + getentropy_win.lo getentropy_win.o: $(srcdir)/compat/getentropy_win.c explicit_bzero.lo explicit_bzero.o: $(srcdir)/compat/explicit_bzero.c config.h arc4random.lo arc4random.o: $(srcdir)/compat/arc4random.c config.h $(srcdir)/compat/chacha_private.h diff --git a/contrib/unbound/aclocal.m4 b/contrib/unbound/aclocal.m4 index dd1b8658c7b8..bf3c57e2fd9f 100644 --- a/contrib/unbound/aclocal.m4 +++ b/contrib/unbound/aclocal.m4 @@ -1,6 +1,6 @@ -# generated automatically by aclocal 1.16.1 -*- Autoconf -*- +# generated automatically by aclocal 1.16.2 -*- Autoconf -*- -# Copyright (C) 1996-2018 Free Software Foundation, Inc. +# Copyright (C) 1996-2020 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -9390,7 +9390,7 @@ AS_IF([test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"], # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997-2018 Free Software Foundation, Inc. +# Copyright (C) 1997-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -9421,7 +9421,7 @@ AC_CONFIG_COMMANDS_PRE( Usually this means the macro was only invoked conditionally.]]) *** 4737 LINES SKIPPED *** From owner-dev-commits-src-branches@freebsd.org Thu Jun 3 00:55:45 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E1CAC64F411; Thu, 3 Jun 2021 00:55:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FwSB95P8Jz3JHk; Thu, 3 Jun 2021 00:55:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9B8C320957; Thu, 3 Jun 2021 00:55:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1530tjMK019877; Thu, 3 Jun 2021 00:55:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1530tjx6019876; Thu, 3 Jun 2021 00:55:45 GMT (envelope-from git) Date: Thu, 3 Jun 2021 00:55:45 GMT Message-Id: <202106030055.1530tjx6019876@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 2fb377976493 - stable/13 - ipfilter: Fix ip_nat memory leak and use-after-free MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2fb377976493cd961dfe1908d1c565742e79bb4a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jun 2021 00:55:46 -0000 The branch stable/13 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=2fb377976493cd961dfe1908d1c565742e79bb4a commit 2fb377976493cd961dfe1908d1c565742e79bb4a Author: Cy Schubert AuthorDate: 2021-05-25 18:54:49 +0000 Commit: Cy Schubert CommitDate: 2021-06-03 00:54:30 +0000 ipfilter: Fix ip_nat memory leak and use-after-free Unfortunately the wrong elemet is freed, also resulting in use-after-free. PR: 255859 Submitted by: lylgood@foxmail.com Reported by: lylgood@foxmail.com (cherry picked from commit 323a4e2c4e285e6f8eee8db3fe2cb7490a734da0) --- sys/contrib/ipfilter/netinet/ip_nat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/contrib/ipfilter/netinet/ip_nat.c b/sys/contrib/ipfilter/netinet/ip_nat.c index 084c79bbee9a..6b48543d6119 100644 --- a/sys/contrib/ipfilter/netinet/ip_nat.c +++ b/sys/contrib/ipfilter/netinet/ip_nat.c @@ -6243,7 +6243,7 @@ ipf_nat_rule_deref(softc, inp) if (n->in_tqehead[0] != NULL) { if (ipf_deletetimeoutqueue(n->in_tqehead[0]) == 0) { - ipf_freetimeoutqueue(softc, n->in_tqehead[1]); + ipf_freetimeoutqueue(softc, n->in_tqehead[0]); } } From owner-dev-commits-src-branches@freebsd.org Thu Jun 3 00:57:52 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0AA0064F590; Thu, 3 Jun 2021 00:57: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 4FwSDb6lmVz3K4P; Thu, 3 Jun 2021 00:57:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CEC4E209F8; Thu, 3 Jun 2021 00:57:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1530vpRM020141; Thu, 3 Jun 2021 00:57:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1530vpAH020140; Thu, 3 Jun 2021 00:57:51 GMT (envelope-from git) Date: Thu, 3 Jun 2021 00:57:51 GMT Message-Id: <202106030057.1530vpAH020140@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: fedf63143b6e - stable/12 - MFV d60fa10fd872db7e3d8cb1e161cfdae026c43b14: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: fedf63143b6ee3cdf393c2e5038edf9490a6d664 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jun 2021 00:57:52 -0000 The branch stable/12 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=fedf63143b6ee3cdf393c2e5038edf9490a6d664 commit fedf63143b6ee3cdf393c2e5038edf9490a6d664 Author: Cy Schubert AuthorDate: 2021-02-10 04:25:05 +0000 Commit: Cy Schubert CommitDate: 2021-06-03 00:57:45 +0000 MFV d60fa10fd872db7e3d8cb1e161cfdae026c43b14: Update unbound 1.13.0 --> 1.13.1. Includes numerous bugfixes documented at: https://www.nlnetlabs.nl/projects/unbound/download/#unbound-1-13-1 (cherry picked from commit f44e67d120ad78ef7894241b519ee79fd190a16e) --- contrib/unbound/Makefile.in | 516 ++++++++++++--------- contrib/unbound/aclocal.m4 | 8 +- contrib/unbound/acx_nlnetlabs.m4 | 60 ++- contrib/unbound/acx_python.m4 | 6 +- contrib/unbound/cachedb/cachedb.c | 1 + contrib/unbound/config.guess | 20 +- contrib/unbound/config.h.in | 3 +- contrib/unbound/config.sub | 20 +- contrib/unbound/configure | 137 +++--- contrib/unbound/configure.ac | 197 ++++---- .../contrib/build-unbound-localzone-from-hosts.pl | 0 .../unbound/contrib/create_unbound_ad_servers.sh | 0 contrib/unbound/contrib/parseunbound.pl | 0 contrib/unbound/contrib/unbound_cache.sh | 0 contrib/unbound/contrib/warmup.sh | 0 contrib/unbound/daemon/remote.c | 55 +++ contrib/unbound/daemon/worker.c | 22 +- contrib/unbound/dns64/dns64.c | 43 +- contrib/unbound/dnscrypt/dnscrypt.m4 | 2 +- contrib/unbound/dnstap/dnstap.m4 | 2 +- contrib/unbound/dnstap/unbound-dnstap-socket.c | 9 +- contrib/unbound/doc/Changelog | 131 +++++- contrib/unbound/doc/FEATURES | 1 + contrib/unbound/doc/README | 2 +- contrib/unbound/doc/TODO | 1 - contrib/unbound/doc/example.conf.in | 32 +- contrib/unbound/doc/libunbound.3.in | 4 +- contrib/unbound/doc/unbound-anchor.8.in | 2 +- contrib/unbound/doc/unbound-checkconf.8.in | 2 +- contrib/unbound/doc/unbound-control.8.in | 8 +- contrib/unbound/doc/unbound-host.1.in | 2 +- contrib/unbound/doc/unbound.8.in | 4 +- contrib/unbound/doc/unbound.conf.5.in | 60 ++- contrib/unbound/doc/unbound.doxygen | 6 +- contrib/unbound/dynlibmod/dynlibmod.c | 20 +- contrib/unbound/dynlibmod/dynlibmod.h | 4 +- contrib/unbound/dynlibmod/examples/helloworld.c | 14 +- contrib/unbound/ipset/ipset.c | 0 contrib/unbound/ipset/ipset.h | 0 contrib/unbound/libunbound/libworker.c | 4 + contrib/unbound/ltmain.sh | 0 contrib/unbound/respip/respip.c | 2 +- contrib/unbound/services/authzone.c | 17 +- contrib/unbound/services/cache/rrset.c | 2 + contrib/unbound/services/listen_dnsport.c | 14 +- contrib/unbound/services/listen_dnsport.h | 2 +- contrib/unbound/services/localzone.c | 107 ++++- contrib/unbound/services/localzone.h | 7 + contrib/unbound/services/mesh.c | 38 +- contrib/unbound/services/outside_network.c | 77 ++- contrib/unbound/services/outside_network.h | 2 + contrib/unbound/services/rpz.c | 21 +- contrib/unbound/services/rpz.h | 13 + contrib/unbound/smallapp/unbound-anchor.c | 67 +-- contrib/unbound/smallapp/unbound-control.c | 105 ++++- contrib/unbound/smallapp/worker_cb.c | 3 + contrib/unbound/util/config_file.c | 71 ++- contrib/unbound/util/config_file.h | 27 ++ contrib/unbound/util/configlexer.lex | 6 + contrib/unbound/util/configparser.y | 87 +++- contrib/unbound/util/configyyrename.h | 6 + contrib/unbound/util/data/msgencode.c | 63 ++- contrib/unbound/util/data/msgparse.c | 2 + contrib/unbound/util/data/msgparse.h | 4 + contrib/unbound/util/data/msgreply.c | 36 +- contrib/unbound/util/data/msgreply.h | 20 +- contrib/unbound/util/data/packed_rrset.c | 17 +- contrib/unbound/util/data/packed_rrset.h | 3 + contrib/unbound/util/edns.c | 16 + contrib/unbound/util/iana_ports.inc | 2 +- contrib/unbound/util/module.h | 4 +- contrib/unbound/util/net_help.c | 2 +- contrib/unbound/util/netevent.c | 122 ++++- contrib/unbound/util/netevent.h | 12 + contrib/unbound/util/storage/lruhash.c | 4 +- contrib/unbound/validator/autotrust.c | 1 + usr.sbin/unbound/config.h | 6 +- 77 files changed, 1700 insertions(+), 686 deletions(-) diff --git a/contrib/unbound/Makefile.in b/contrib/unbound/Makefile.in index d2600e71f0cf..6809881b6a95 100644 --- a/contrib/unbound/Makefile.in +++ b/contrib/unbound/Makefile.in @@ -248,6 +248,7 @@ DNSTAP_SOCKET_SRC=dnstap/unbound-dnstap-socket.c DNSTAP_SOCKET_OBJ=unbound-dnstap-socket.lo DNSTAP_SOCKET_OBJ_LINK=$(DNSTAP_SOCKET_OBJ) $(COMMON_OBJ) \ $(COMPAT_OBJ) $(SLDNS_OBJ) +DNSTAP_SOCKET_TESTBIN=@DNSTAP_SOCKET_TESTBIN@ LIBUNBOUND_SRC=libunbound/context.c libunbound/libunbound.c \ libunbound/libworker.c LIBUNBOUND_OBJ=context.lo libunbound.lo libworker.lo ub_event_pluggable.lo @@ -323,7 +324,7 @@ rsrc_unbound_checkconf.o: $(srcdir)/winrc/rsrc_unbound_checkconf.rc config.h TEST_BIN=asynclook$(EXEEXT) delayer$(EXEEXT) \ lock-verify$(EXEEXT) memstats$(EXEEXT) perf$(EXEEXT) \ petal$(EXEEXT) pktview$(EXEEXT) streamtcp$(EXEEXT) \ - unbound-dnstap-socket$(EXEEXT) dohclient$(EXEEXT) \ + $(DNSTAP_SOCKET_TESTBIN) dohclient$(EXEEXT) \ testbound$(EXEEXT) unittest$(EXEEXT) tests: all $(TEST_BIN) @@ -349,10 +350,10 @@ unbound$(EXEEXT): $(DAEMON_OBJ_LINK) libunbound.la $(LINK) -o $@ $(DAEMON_OBJ_LINK) $(EXTRALINK) $(SSLLIB) $(LIBS) $(DYNLIBMOD_EXTRALIBS) unbound-checkconf$(EXEEXT): $(CHECKCONF_OBJ_LINK) libunbound.la - $(LINK) -o $@ $(CHECKCONF_OBJ_LINK) $(EXTRALINK) $(SSLLIB) $(LIBS) $(DYNLIBMOD_EXTRALIBS) + $(LINK) -o $@ $(CHECKCONF_OBJ_LINK) $(EXTRALINK) $(SSLLIB) $(LIBS) unbound-control$(EXEEXT): $(CONTROL_OBJ_LINK) libunbound.la - $(LINK) -o $@ $(CONTROL_OBJ_LINK) $(EXTRALINK) $(SSLLIB) $(LIBS) $(DYNLIBMOD_EXTRALIBS) + $(LINK) -o $@ $(CONTROL_OBJ_LINK) $(EXTRALINK) $(SSLLIB) $(LIBS) unbound-host$(EXEEXT): $(HOST_OBJ_LINK) libunbound.la $(LINK) -o $@ $(HOST_OBJ_LINK) -L. -L.libs -lunbound $(SSLLIB) $(LIBS) @@ -370,37 +371,37 @@ anchor-update$(EXEEXT): $(ANCHORUPD_OBJ_LINK) libunbound.la $(LINK) -o $@ $(ANCHORUPD_OBJ_LINK) -L. -L.libs -lunbound $(LIBS) unittest$(EXEEXT): $(UNITTEST_OBJ_LINK) - $(LINK) -o $@ $(UNITTEST_OBJ_LINK) $(SSLLIB) $(LIBS) $(DYNLIBMOD_EXTRALIBS) + $(LINK) -o $@ $(UNITTEST_OBJ_LINK) $(SSLLIB) $(LIBS) testbound$(EXEEXT): $(TESTBOUND_OBJ_LINK) - $(LINK) -o $@ $(TESTBOUND_OBJ_LINK) $(SSLLIB) $(LIBS) $(DYNLIBMOD_EXTRALIBS) + $(LINK) -o $@ $(TESTBOUND_OBJ_LINK) $(SSLLIB) $(LIBS) lock-verify$(EXEEXT): $(LOCKVERIFY_OBJ_LINK) - $(LINK) -o $@ $(LOCKVERIFY_OBJ_LINK) $(SSLLIB) $(LIBS) $(DYNLIBMOD_EXTRALIBS) + $(LINK) -o $@ $(LOCKVERIFY_OBJ_LINK) $(SSLLIB) $(LIBS) petal$(EXEEXT): $(PETAL_OBJ_LINK) $(LINK) -o $@ $(PETAL_OBJ_LINK) $(SSLLIB) $(LIBS) pktview$(EXEEXT): $(PKTVIEW_OBJ_LINK) - $(LINK) -o $@ $(PKTVIEW_OBJ_LINK) $(SSLLIB) $(LIBS) $(DYNLIBMOD_EXTRALIBS) + $(LINK) -o $@ $(PKTVIEW_OBJ_LINK) $(SSLLIB) $(LIBS) memstats$(EXEEXT): $(MEMSTATS_OBJ_LINK) - $(LINK) -o $@ $(MEMSTATS_OBJ_LINK) $(SSLLIB) $(LIBS) $(DYNLIBMOD_EXTRALIBS) + $(LINK) -o $@ $(MEMSTATS_OBJ_LINK) $(SSLLIB) $(LIBS) asynclook$(EXEEXT): $(ASYNCLOOK_OBJ_LINK) libunbound.la $(LINK) -o $@ $(ASYNCLOOK_OBJ_LINK) -L. -L.libs -lunbound $(SSLLIB) $(LIBS) streamtcp$(EXEEXT): $(STREAMTCP_OBJ_LINK) - $(LINK) -o $@ $(STREAMTCP_OBJ_LINK) $(SSLLIB) $(LIBS) $(DYNLIBMOD_EXTRALIBS) + $(LINK) -o $@ $(STREAMTCP_OBJ_LINK) $(SSLLIB) $(LIBS) dohclient$(EXEEXT): $(DOHCLIENT_OBJ_LINK) - $(LINK) -o $@ $(DOHCLIENT_OBJ_LINK) $(SSLLIB) $(LIBS) $(DYNLIBMOD_EXTRALIBS) + $(LINK) -o $@ $(DOHCLIENT_OBJ_LINK) $(SSLLIB) $(LIBS) perf$(EXEEXT): $(PERF_OBJ_LINK) - $(LINK) -o $@ $(PERF_OBJ_LINK) $(SSLLIB) $(LIBS) $(DYNLIBMOD_EXTRALIBS) + $(LINK) -o $@ $(PERF_OBJ_LINK) $(SSLLIB) $(LIBS) delayer$(EXEEXT): $(DELAYER_OBJ_LINK) - $(LINK) -o $@ $(DELAYER_OBJ_LINK) $(SSLLIB) $(LIBS) $(DYNLIBMOD_EXTRALIBS) + $(LINK) -o $@ $(DELAYER_OBJ_LINK) $(SSLLIB) $(LIBS) signit$(EXEEXT): testcode/signit.c $(CC) $(CPPFLAGS) $(CFLAGS) @PTHREAD_CFLAGS_ONLY@ -o $@ testcode/signit.c $(LDFLAGS) -lldns $(SSLLIB) $(LIBS) @@ -423,12 +424,13 @@ dnstap/dnstap.pb-c.c dnstap/dnstap.pb-c.h: $(srcdir)/dnstap/dnstap.proto $(PROTOC_C) --c_out=. --proto_path=$(srcdir) $(srcdir)/dnstap/dnstap.proto unbound-dnstap-socket$(EXEEXT): $(DNSTAP_SOCKET_OBJ_LINK) - $(LINK) -o $@ $(DNSTAP_SOCKET_OBJ_LINK) $(SSLLIB) $(LIBS) $(DYNLIBMOD_EXTRALIBS) + $(LINK) -o $@ $(DNSTAP_SOCKET_OBJ_LINK) $(SSLLIB) $(LIBS) dnstap.pb-c.lo dnstap.pb-c.o: dnstap/dnstap.pb-c.c dnstap/dnstap.pb-c.h dtstream.lo dtstream.o: $(srcdir)/dnstap/dtstream.c config.h $(srcdir)/dnstap/dtstream.h dnstap_fstrm.lo dnstap_fstrm.o: $(srcdir)/dnstap/dnstap_fstrm.c config.h $(srcdir)/dnstap/dnstap_fstrm.h unbound-dnstap-socket.lo unbound-dnstap-socket.o: $(srcdir)/dnstap/unbound-dnstap-socket.c config.h $(srcdir)/dnstap/dtstream.h +dynlibmod.lo dynlibdmod.o: $(srcdir)/dynlibmod/dynlibmod.c config.h $(srcdir)/dynlibmod/dynlibmod.h # dnscrypt dnscrypt.lo dnscrypt.o: $(srcdir)/dnscrypt/dnscrypt.c config.h \ @@ -826,13 +828,16 @@ modstack.lo modstack.o: $(srcdir)/services/modstack.c config.h $(srcdir)/service $(srcdir)/util/module.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/netevent.h \ - $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/dnscrypt/cert.h \ - $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h $(srcdir)/dns64/dns64.h \ - $(srcdir)/iterator/iterator.h $(srcdir)/services/outbound_list.h $(srcdir)/validator/validator.h \ - $(srcdir)/validator/val_utils.h $(srcdir)/respip/respip.h $(srcdir)/services/localzone.h \ - $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h $(PYTHONMOD_HEADER) $(srcdir)/ipsecmod/ipsecmod.h \ - $(srcdir)/util/storage/slabhash.h $(srcdir)/edns-subnet/addrtree.h $(srcdir)/edns-subnet/edns-subnet.h \ - $(srcdir)/ipset/ipset.h $(srcdir)/dynlibmod/dynlibmod.h + $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/util/tube.h \ + $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h \ + $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h \ + $(srcdir)/util/config_file.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \ + $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h $(srcdir)/dns64/dns64.h $(srcdir)/iterator/iterator.h \ + $(srcdir)/services/outbound_list.h $(srcdir)/validator/validator.h $(srcdir)/validator/val_utils.h \ + $(PYTHONMOD_HEADER) $(DYNLIBMOD_HEADER) $(srcdir)/cachedb/cachedb.h \ + $(srcdir)/ipsecmod/ipsecmod.h $(srcdir)/edns-subnet/subnetmod.h $(srcdir)/util/alloc.h $(srcdir)/util/net_help.h \ + $(srcdir)/util/storage/slabhash.h $(srcdir)/util/data/dname.h $(srcdir)/edns-subnet/addrtree.h \ + $(srcdir)/edns-subnet/edns-subnet.h $(srcdir)/ipset/ipset.h view.lo view.o: $(srcdir)/services/view.c config.h $(srcdir)/services/view.h $(srcdir)/util/rbtree.h \ $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/services/localzone.h $(srcdir)/util/storage/dnstree.h \ $(srcdir)/util/module.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/data/msgreply.h \ @@ -863,7 +868,8 @@ outside_network.lo outside_network.o: $(srcdir)/services/outside_network.c confi $(srcdir)/services/mesh.h $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h \ $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h $(srcdir)/util/config_file.h $(srcdir)/services/authzone.h \ $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h \ - $(srcdir)/dnstap/dnstap.h + $(srcdir)/util/edns.h $(srcdir)/dnstap/dnstap.h \ + alloc.lo alloc.o: $(srcdir)/util/alloc.c config.h $(srcdir)/util/alloc.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ $(srcdir)/util/regional.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \ $(srcdir)/util/fptr_wlist.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ @@ -884,7 +890,8 @@ config_file.lo config_file.o: $(srcdir)/util/config_file.c config.h $(srcdir)/ut $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h \ $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h $(srcdir)/util/data/dname.h \ $(srcdir)/util/rtt.h $(srcdir)/services/cache/infra.h $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/parseutil.h \ - $(srcdir)/iterator/iterator.h $(srcdir)/services/outbound_list.h $(srcdir)/util/iana_ports.inc + $(srcdir)/iterator/iterator.h $(srcdir)/services/outbound_list.h $(srcdir)/edns-subnet/edns-subnet.h \ + $(srcdir)/util/iana_ports.inc configlexer.lo configlexer.o: util/configlexer.c config.h $(srcdir)/util/configyyrename.h \ $(srcdir)/util/config_file.h util/configparser.h configparser.lo configparser.o: util/configparser.c config.h $(srcdir)/util/configyyrename.h \ @@ -913,38 +920,31 @@ authzone.lo authzone.o: $(srcdir)/services/authzone.c config.h $(srcdir)/service $(srcdir)/util/data/msgencode.h $(srcdir)/util/regional.h $(srcdir)/util/net_help.h $(srcdir)/util/random.h \ $(srcdir)/services/cache/dns.h $(srcdir)/services/outside_network.h \ $(srcdir)/services/listen_dnsport.h $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/wire2str.h \ - $(srcdir)/sldns/parseutil.h $(srcdir)/sldns/keyraw.h $(srcdir)/validator/val_nsec3.h \ - $(srcdir)/validator/val_secalgo.h + $(srcdir)/sldns/parseutil.h $(srcdir)/sldns/keyraw.h \ + $(srcdir)/validator/val_nsec3.h $(srcdir)/validator/val_secalgo.h fptr_wlist.lo fptr_wlist.o: $(srcdir)/util/fptr_wlist.c config.h $(srcdir)/util/fptr_wlist.h \ $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/storage/lruhash.h \ - $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \ - $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h \ - $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h $(srcdir)/util/mini_event.h \ - $(srcdir)/services/outside_network.h $(srcdir)/services/localzone.h \ - $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h $(srcdir)/services/authzone.h \ - $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h $(srcdir)/services/cache/rrset.h \ - $(srcdir)/util/storage/slabhash.h $(srcdir)/dns64/dns64.h $(srcdir)/iterator/iterator.h \ - $(srcdir)/services/outbound_list.h $(srcdir)/iterator/iter_fwd.h $(srcdir)/validator/validator.h \ - $(srcdir)/validator/val_utils.h $(srcdir)/validator/val_anchor.h $(srcdir)/validator/val_nsec3.h \ - $(srcdir)/validator/val_sigcrypt.h $(srcdir)/validator/val_kentry.h $(srcdir)/validator/val_neg.h \ - $(srcdir)/validator/autotrust.h $(srcdir)/libunbound/libworker.h $(srcdir)/libunbound/context.h \ - $(srcdir)/util/alloc.h $(srcdir)/libunbound/unbound.h $(srcdir)/libunbound/unbound-event.h \ - $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h $(srcdir)/util/config_file.h $(srcdir)/respip/respip.h \ - $(PYTHONMOD_HEADER) $(srcdir)/ipsecmod/ipsecmod.h $(srcdir)/edns-subnet/subnetmod.h $(srcdir)/util/net_help.h \ - $(srcdir)/edns-subnet/addrtree.h $(srcdir)/edns-subnet/edns-subnet.h $(srcdir)/ipset/ipset.h \ - $(srcdir)/dynlibmod/dynlibmod.h + $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/module.h \ + $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ + $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h \ + $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h \ + $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h \ + $(srcdir)/util/config_file.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \ + $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h $(srcdir)/util/mini_event.h \ + $(srcdir)/services/outside_network.h $(srcdir)/services/cache/infra.h \ + $(srcdir)/util/rtt.h $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h $(srcdir)/dns64/dns64.h \ + $(srcdir)/iterator/iterator.h $(srcdir)/services/outbound_list.h $(srcdir)/iterator/iter_fwd.h \ + $(srcdir)/validator/validator.h $(srcdir)/validator/val_utils.h $(srcdir)/validator/val_anchor.h \ + $(srcdir)/validator/val_nsec3.h $(srcdir)/validator/val_sigcrypt.h $(srcdir)/validator/val_kentry.h \ + $(srcdir)/validator/val_neg.h $(srcdir)/validator/autotrust.h $(srcdir)/libunbound/libworker.h \ + $(srcdir)/libunbound/context.h $(srcdir)/util/alloc.h $(srcdir)/libunbound/unbound-event.h \ + $(srcdir)/libunbound/worker.h $(PYTHONMOD_HEADER) $(DYNLIBMOD_HEADER) \ + $(srcdir)/cachedb/cachedb.h $(srcdir)/ipsecmod/ipsecmod.h $(srcdir)/edns-subnet/subnetmod.h \ + $(srcdir)/util/net_help.h $(srcdir)/util/data/dname.h $(srcdir)/edns-subnet/addrtree.h \ + $(srcdir)/edns-subnet/edns-subnet.h $(srcdir)/ipset/ipset.h $(srcdir)/dnstap/dtstream.h locks.lo locks.o: $(srcdir)/util/locks.c config.h $(srcdir)/util/locks.h $(srcdir)/util/log.h log.lo log.o: $(srcdir)/util/log.c config.h $(srcdir)/util/log.h $(srcdir)/util/locks.h $(srcdir)/sldns/sbuffer.h -mini_event.lo mini_event.o: $(srcdir)/util/mini_event.c config.h $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h \ - $(srcdir)/util/fptr_wlist.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h \ - $(srcdir)/util/log.h $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \ - $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h \ - $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h \ - $(srcdir)/services/localzone.h $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h \ - $(srcdir)/sldns/sbuffer.h $(srcdir)/util/config_file.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h \ - $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h +mini_event.lo mini_event.o: $(srcdir)/util/mini_event.c config.h $(srcdir)/util/mini_event.h module.lo module.o: $(srcdir)/util/module.c config.h $(srcdir)/util/module.h $(srcdir)/util/storage/lruhash.h \ $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \ $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/wire2str.h @@ -957,12 +957,14 @@ netevent.lo netevent.o: $(srcdir)/util/netevent.c config.h $(srcdir)/util/neteve $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h $(srcdir)/services/view.h \ $(srcdir)/sldns/sbuffer.h $(srcdir)/util/config_file.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h \ $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h $(srcdir)/sldns/str2wire.h \ - $(srcdir)/dnstap/dnstap.h $(srcdir)/services/listen_dnsport.h + $(srcdir)/dnstap/dnstap.h $(srcdir)/services/listen_dnsport.h \ + net_help.lo net_help.o: $(srcdir)/util/net_help.c config.h $(srcdir)/util/net_help.h $(srcdir)/util/log.h \ $(srcdir)/util/data/dname.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/module.h \ $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/regional.h $(srcdir)/util/config_file.h \ - $(srcdir)/sldns/parseutil.h $(srcdir)/sldns/wire2str.h + $(srcdir)/sldns/parseutil.h $(srcdir)/sldns/wire2str.h \ + random.lo random.o: $(srcdir)/util/random.c config.h $(srcdir)/util/random.h $(srcdir)/util/log.h rbtree.lo rbtree.o: $(srcdir)/util/rbtree.c config.h $(srcdir)/util/log.h $(srcdir)/util/fptr_wlist.h \ $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ @@ -978,11 +980,11 @@ rtt.lo rtt.o: $(srcdir)/util/rtt.c config.h $(srcdir)/util/rtt.h $(srcdir)/itera $(srcdir)/services/outbound_list.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/storage/lruhash.h \ $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/module.h \ $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h -edns.lo edns.o: $(srcdir)/util/edns.c config.h $(srcdir)/util/edns.h $(srcdir)/util/config_file.h \ - $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/util/regional.h $(srcdir)/util/data/msgparse.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h \ - $(srcdir)/util/log.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/data/msgreply.h \ - $(srcdir)/util/data/packed_rrset.h +edns.lo edns.o: $(srcdir)/util/edns.c config.h $(srcdir)/util/edns.h $(srcdir)/util/storage/dnstree.h \ + $(srcdir)/util/rbtree.h $(srcdir)/util/config_file.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ + $(srcdir)/util/net_help.h $(srcdir)/util/log.h $(srcdir)/util/regional.h \ + $(srcdir)/util/data/msgparse.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/sldns/pkthdr.h \ + $(srcdir)/sldns/rrdef.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h dnstree.lo dnstree.o: $(srcdir)/util/storage/dnstree.c config.h $(srcdir)/util/storage/dnstree.h \ $(srcdir)/util/rbtree.h $(srcdir)/util/data/dname.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h \ $(srcdir)/util/log.h $(srcdir)/util/net_help.h @@ -1016,7 +1018,8 @@ tube.lo tube.o: $(srcdir)/util/tube.c config.h $(srcdir)/util/tube.h $(srcdir)/u $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h $(srcdir)/util/ub_event.h ub_event.lo ub_event.o: $(srcdir)/util/ub_event.c config.h $(srcdir)/util/ub_event.h $(srcdir)/util/log.h \ $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/util/tube.h $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h + $(srcdir)/util/tube.h \ + ub_event_pluggable.lo ub_event_pluggable.o: $(srcdir)/util/ub_event_pluggable.c config.h $(srcdir)/util/ub_event.h \ $(srcdir)/libunbound/unbound-event.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ $(srcdir)/util/log.h $(srcdir)/util/fptr_wlist.h \ @@ -1026,7 +1029,8 @@ ub_event_pluggable.lo ub_event_pluggable.o: $(srcdir)/util/ub_event_pluggable.c $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h \ $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h \ $(srcdir)/util/config_file.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \ - $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h + $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h \ + winsock_event.lo winsock_event.o: $(srcdir)/util/winsock_event.c config.h autotrust.lo autotrust.o: $(srcdir)/validator/autotrust.c config.h $(srcdir)/validator/autotrust.h \ $(srcdir)/util/rbtree.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \ @@ -1039,7 +1043,8 @@ autotrust.lo autotrust.o: $(srcdir)/validator/autotrust.c config.h $(srcdir)/val $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h \ $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h \ $(srcdir)/respip/respip.h $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h \ - $(srcdir)/validator/val_kcache.h $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/keyraw.h + $(srcdir)/validator/val_kcache.h $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/keyraw.h \ + val_anchor.lo val_anchor.o: $(srcdir)/validator/val_anchor.c config.h $(srcdir)/validator/val_anchor.h \ $(srcdir)/util/rbtree.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/validator/val_sigcrypt.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/sldns/pkthdr.h \ @@ -1069,11 +1074,13 @@ val_kcache.lo val_kcache.o: $(srcdir)/validator/val_kcache.c config.h $(srcdir)/ val_kentry.lo val_kentry.o: $(srcdir)/validator/val_kentry.c config.h $(srcdir)/validator/val_kentry.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/data/packed_rrset.h \ $(srcdir)/util/data/dname.h $(srcdir)/util/storage/lookup3.h $(srcdir)/util/regional.h $(srcdir)/util/net_help.h \ - $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/keyraw.h -val_neg.lo val_neg.o: $(srcdir)/validator/val_neg.c config.h $(srcdir)/validator/val_neg.h $(srcdir)/util/locks.h \ - $(srcdir)/util/log.h $(srcdir)/util/rbtree.h $(srcdir)/validator/val_nsec.h $(srcdir)/util/data/packed_rrset.h \ - $(srcdir)/util/storage/lruhash.h $(srcdir)/validator/val_nsec3.h $(srcdir)/validator/val_utils.h \ - $(srcdir)/sldns/pkthdr.h $(srcdir)/util/data/dname.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/net_help.h \ + $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/keyraw.h \ + +val_neg.lo val_neg.o: $(srcdir)/validator/val_neg.c config.h \ + $(srcdir)/validator/val_neg.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/rbtree.h \ + $(srcdir)/validator/val_nsec.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \ + $(srcdir)/validator/val_nsec3.h $(srcdir)/validator/val_utils.h $(srcdir)/sldns/pkthdr.h \ + $(srcdir)/util/data/dname.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/net_help.h \ $(srcdir)/util/config_file.h $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h \ $(srcdir)/services/cache/dns.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/sbuffer.h val_nsec3.lo val_nsec3.o: $(srcdir)/validator/val_nsec3.c config.h $(srcdir)/validator/val_nsec3.h \ @@ -1091,15 +1098,17 @@ val_nsec.lo val_nsec.o: $(srcdir)/validator/val_nsec.c config.h $(srcdir)/valida val_secalgo.lo val_secalgo.o: $(srcdir)/validator/val_secalgo.c config.h $(srcdir)/util/data/packed_rrset.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/validator/val_secalgo.h \ $(srcdir)/validator/val_nsec3.h $(srcdir)/util/rbtree.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/keyraw.h \ - $(srcdir)/sldns/sbuffer.h + $(srcdir)/sldns/sbuffer.h \ + val_sigcrypt.lo val_sigcrypt.o: $(srcdir)/validator/val_sigcrypt.c config.h \ $(srcdir)/validator/val_sigcrypt.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \ $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/sldns/pkthdr.h $(srcdir)/validator/val_secalgo.h \ $(srcdir)/validator/validator.h $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h \ $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/rrdef.h $(srcdir)/validator/val_utils.h \ $(srcdir)/util/data/dname.h $(srcdir)/util/rbtree.h $(srcdir)/util/net_help.h $(srcdir)/util/regional.h \ - $(srcdir)/util/config_file.h $(srcdir)/sldns/keyraw.h $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/parseutil.h \ - $(srcdir)/sldns/wire2str.h + $(srcdir)/util/config_file.h $(srcdir)/sldns/keyraw.h \ + $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/parseutil.h $(srcdir)/sldns/wire2str.h \ + val_utils.lo val_utils.o: $(srcdir)/validator/val_utils.c config.h $(srcdir)/validator/val_utils.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ $(srcdir)/sldns/pkthdr.h $(srcdir)/validator/validator.h $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h \ @@ -1120,15 +1129,43 @@ dns64.lo dns64.o: $(srcdir)/dns64/dns64.c config.h $(srcdir)/dns64/dns64.h $(src $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h \ $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h $(srcdir)/util/net_help.h \ $(srcdir)/util/regional.h $(srcdir)/util/data/dname.h $(srcdir)/sldns/str2wire.h -edns-subnet.lo edns-subnet.o: $(srcdir)/edns-subnet/edns-subnet.c config.h -subnetmod.lo subnetmod.o: $(srcdir)/edns-subnet/subnetmod.c config.h +edns-subnet.lo edns-subnet.o: $(srcdir)/edns-subnet/edns-subnet.c config.h \ + $(srcdir)/edns-subnet/edns-subnet.h $(srcdir)/util/net_help.h $(srcdir)/util/log.h +subnetmod.lo subnetmod.o: $(srcdir)/edns-subnet/subnetmod.c config.h $(srcdir)/edns-subnet/subnetmod.h \ + $(srcdir)/util/module.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ + $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ + $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/services/outbound_list.h $(srcdir)/util/alloc.h \ + $(srcdir)/util/net_help.h $(srcdir)/util/storage/slabhash.h $(srcdir)/util/data/dname.h \ + $(srcdir)/edns-subnet/addrtree.h $(srcdir)/edns-subnet/edns-subnet.h \ + $(srcdir)/edns-subnet/subnet-whitelist.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h \ + $(srcdir)/services/mesh.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ + $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h \ + $(srcdir)/services/localzone.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h $(srcdir)/util/config_file.h \ + $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h \ + $(srcdir)/respip/respip.h $(srcdir)/services/cache/dns.h $(srcdir)/util/regional.h \ + $(srcdir)/iterator/iter_utils.h $(srcdir)/iterator/iter_resptype.h addrtree.lo addrtree.o: $(srcdir)/edns-subnet/addrtree.c config.h $(srcdir)/util/log.h \ $(srcdir)/util/data/msgreply.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/module.h $(srcdir)/util/data/msgparse.h \ $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/edns-subnet/addrtree.h -subnet-whitelist.lo subnet-whitelist.o: $(srcdir)/edns-subnet/subnet-whitelist.c config.h -cachedb.lo cachedb.o: $(srcdir)/cachedb/cachedb.c config.h -redis.lo redis.o: $(srcdir)/cachedb/redis.c config.h +subnet-whitelist.lo subnet-whitelist.o: $(srcdir)/edns-subnet/subnet-whitelist.c config.h \ + $(srcdir)/edns-subnet/edns-subnet.h $(srcdir)/util/net_help.h $(srcdir)/util/log.h \ + $(srcdir)/edns-subnet/subnet-whitelist.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h \ + $(srcdir)/util/regional.h $(srcdir)/util/config_file.h $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/rrdef.h \ + $(srcdir)/util/data/dname.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h +cachedb.lo cachedb.o: $(srcdir)/cachedb/cachedb.c config.h $(srcdir)/cachedb/cachedb.h $(srcdir)/util/module.h \ + $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/data/msgreply.h \ + $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ + $(srcdir)/sldns/rrdef.h $(srcdir)/cachedb/redis.h $(srcdir)/util/regional.h $(srcdir)/util/net_help.h \ + $(srcdir)/util/config_file.h $(srcdir)/util/data/msgencode.h $(srcdir)/services/cache/dns.h \ + $(srcdir)/validator/val_neg.h $(srcdir)/util/rbtree.h $(srcdir)/validator/val_secalgo.h \ + $(srcdir)/iterator/iter_utils.h $(srcdir)/iterator/iter_resptype.h $(srcdir)/sldns/parseutil.h \ + $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/sbuffer.h +redis.lo redis.o: $(srcdir)/cachedb/redis.c config.h $(srcdir)/cachedb/redis.h $(srcdir)/cachedb/cachedb.h \ + $(srcdir)/util/module.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ + $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ + $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/alloc.h $(srcdir)/util/config_file.h \ + $(srcdir)/sldns/sbuffer.h respip.lo respip.o: $(srcdir)/respip/respip.c config.h $(srcdir)/services/localzone.h $(srcdir)/util/rbtree.h \ $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/module.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \ @@ -1143,31 +1180,40 @@ checklocks.lo checklocks.o: $(srcdir)/testcode/checklocks.c config.h $(srcdir)/u $(srcdir)/testcode/checklocks.h dnstap.lo dnstap.o: $(srcdir)/dnstap/dnstap.c config.h $(srcdir)/sldns/sbuffer.h \ $(srcdir)/util/config_file.h $(srcdir)/util/net_help.h $(srcdir)/util/log.h $(srcdir)/util/netevent.h \ - $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/dnscrypt/cert.h \ - $(srcdir)/util/locks.h $(srcdir)/dnstap/dnstap.h \ - dnstap/dnstap.pb-c.h + $(srcdir)/dnscrypt/dnscrypt.h \ + $(srcdir)/dnstap/dnstap.h \ + $(srcdir)/dnstap/dtstream.h $(srcdir)/util/locks.h dnstap/dnstap.pb-c.h dnstap.pb-c.lo dnstap.pb-c.o: dnstap/dnstap.pb-c.c dnstap/dnstap.pb-c.h \ -dynlibmod.lo dynlibmod.o: $(srcdir)/dynlibmod/dynlibmod.c config.h $(srcdir)/dynlibmod/dynlibmod.h \ +dnstap_fstrm.lo dnstap_fstrm.o: $(srcdir)/dnstap/dnstap_fstrm.c config.h $(srcdir)/dnstap/dnstap_fstrm.h \ + $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/wire2str.h +dtstream.lo dtstream.o: $(srcdir)/dnstap/dtstream.c config.h $(srcdir)/dnstap/dtstream.h $(srcdir)/util/locks.h \ + $(srcdir)/util/log.h $(srcdir)/dnstap/dnstap_fstrm.h $(srcdir)/util/config_file.h $(srcdir)/util/ub_event.h \ + $(srcdir)/util/net_help.h $(srcdir)/services/outside_network.h $(srcdir)/util/rbtree.h $(srcdir)/util/netevent.h \ + $(srcdir)/dnscrypt/dnscrypt.h \ + $(srcdir)/sldns/sbuffer.h \ + +ipsecmod.lo ipsecmod.o: $(srcdir)/ipsecmod/ipsecmod.c config.h $(srcdir)/ipsecmod/ipsecmod.h \ $(srcdir)/util/module.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ - $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/rbtree.h\ + $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/rbtree.h $(srcdir)/ipsecmod/ipsecmod-whitelist.h \ $(srcdir)/util/storage/dnstree.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/netevent.h \ $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/util/tube.h \ - $(srcdir)/services/mesh.h $(srcdir)/services/modstack.h $(srcdir)/util/regional.h $(srcdir)/util/net_help.h \ - $(srcdir)/util/config_file.h $(srcdir)/services/cache/dns.h $(srcdir)/sldns/wire2str.h -dnscrypt.lo dnscrypt.o: $(srcdir)/dnscrypt/dnscrypt.c config.h $(srcdir)/sldns/sbuffer.h \ - $(srcdir)/util/config_file.h $(srcdir)/util/net_help.h $(srcdir)/util/log.h $(srcdir)/util/netevent.h \ - $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/dnscrypt/cert.h \ - $(srcdir)/util/locks.h $(srcdir)/util/storage/slabhash.h $(srcdir)/util/storage/lruhash.h \ - $(srcdir)/util/storage/lookup3.h -ipsecmod.lo ipsecmod.o: $(srcdir)/ipsecmod/ipsecmod.c config.h + $(srcdir)/services/mesh.h $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h \ + $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h $(srcdir)/util/config_file.h $(srcdir)/services/authzone.h \ + $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h \ + $(srcdir)/util/regional.h $(srcdir)/util/net_help.h $(srcdir)/services/cache/dns.h $(srcdir)/sldns/wire2str.h +ipsecmod-whitelist.lo ipsecmod-whitelist.o: $(srcdir)/ipsecmod/ipsecmod-whitelist.c config.h \ + $(srcdir)/ipsecmod/ipsecmod.h $(srcdir)/util/module.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h \ + $(srcdir)/util/log.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \ + $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/rbtree.h \ + $(srcdir)/ipsecmod/ipsecmod-whitelist.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/regional.h \ + $(srcdir)/util/config_file.h $(srcdir)/util/data/dname.h $(srcdir)/sldns/str2wire.h ipset.lo ipset.o: $(srcdir)/ipset/ipset.c config.h $(srcdir)/ipset/ipset.h $(srcdir)/util/module.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/data/msgreply.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ - $(srcdir)/sldns/rrdef.h $(srcdir)/util/regional.h $(srcdir)/util/config_file.h $(srcdir)/services/cache/dns.h \ - $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/parseutil.h -ipsecmod-whitelist.lo ipsecmod-whitelist.o: $(srcdir)/ipsecmod/ipsecmod-whitelist.c config.h + $(srcdir)/sldns/rrdef.h $(srcdir)/util/regional.h $(srcdir)/util/net_help.h $(srcdir)/util/config_file.h \ + $(srcdir)/services/cache/dns.h $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/parseutil.h unitanchor.lo unitanchor.o: $(srcdir)/testcode/unitanchor.c config.h $(srcdir)/util/log.h $(srcdir)/util/data/dname.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/testcode/unitmain.h \ $(srcdir)/validator/val_anchor.h $(srcdir)/util/rbtree.h $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/rrdef.h @@ -1176,7 +1222,8 @@ unitdname.lo unitdname.o: $(srcdir)/testcode/unitdname.c config.h $(srcdir)/util $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/rrdef.h unitlruhash.lo unitlruhash.o: $(srcdir)/testcode/unitlruhash.c config.h $(srcdir)/testcode/unitmain.h \ $(srcdir)/util/log.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/storage/slabhash.h -unitmain.lo unitmain.o: $(srcdir)/testcode/unitmain.c config.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/keyraw.h \ +unitmain.lo unitmain.o: $(srcdir)/testcode/unitmain.c config.h \ + $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/keyraw.h \ $(srcdir)/util/log.h $(srcdir)/testcode/unitmain.h $(srcdir)/util/alloc.h $(srcdir)/util/locks.h $(srcdir)/util/net_help.h \ $(srcdir)/util/config_file.h $(srcdir)/util/rtt.h $(srcdir)/util/timehist.h $(srcdir)/iterator/iterator.h \ $(srcdir)/services/outbound_list.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/storage/lruhash.h \ @@ -1184,7 +1231,8 @@ unitmain.lo unitmain.o: $(srcdir)/testcode/unitmain.c config.h $(srcdir)/sldns/r $(srcdir)/sldns/pkthdr.h $(srcdir)/libunbound/unbound.h $(srcdir)/services/cache/infra.h \ $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ $(srcdir)/util/random.h $(srcdir)/respip/respip.h \ - $(srcdir)/services/localzone.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h + $(srcdir)/services/localzone.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h \ + $(srcdir)/services/outside_network.h unitmsgparse.lo unitmsgparse.o: $(srcdir)/testcode/unitmsgparse.c config.h $(srcdir)/util/log.h \ $(srcdir)/testcode/unitmain.h $(srcdir)/util/data/msgparse.h $(srcdir)/util/storage/lruhash.h \ $(srcdir)/util/locks.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/data/msgreply.h \ @@ -1216,7 +1264,13 @@ testpkts.lo testpkts.o: $(srcdir)/testcode/testpkts.c config.h $(srcdir)/testcod unitldns.lo unitldns.o: $(srcdir)/testcode/unitldns.c config.h $(srcdir)/util/log.h $(srcdir)/testcode/unitmain.h \ $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/wire2str.h \ $(srcdir)/sldns/parseutil.h -unitecs.lo unitecs.o: $(srcdir)/testcode/unitecs.c config.h +unitecs.lo unitecs.o: $(srcdir)/testcode/unitecs.c config.h $(srcdir)/util/log.h $(srcdir)/util/module.h \ + $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/data/msgreply.h \ + $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ + $(srcdir)/sldns/rrdef.h $(srcdir)/testcode/unitmain.h $(srcdir)/edns-subnet/addrtree.h \ + $(srcdir)/edns-subnet/subnetmod.h $(srcdir)/services/outbound_list.h $(srcdir)/util/alloc.h \ + $(srcdir)/util/net_help.h $(srcdir)/util/storage/slabhash.h $(srcdir)/util/data/dname.h \ + $(srcdir)/edns-subnet/edns-subnet.h unitauth.lo unitauth.o: $(srcdir)/testcode/unitauth.c config.h $(srcdir)/services/authzone.h \ $(srcdir)/util/rbtree.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/services/mesh.h $(srcdir)/util/netevent.h \ $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/util/data/msgparse.h \ @@ -1233,40 +1287,43 @@ acl_list.lo acl_list.o: $(srcdir)/daemon/acl_list.c config.h $(srcdir)/daemon/ac $(srcdir)/services/localzone.h $(srcdir)/util/module.h $(srcdir)/util/storage/lruhash.h \ $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/str2wire.h -cachedump.lo cachedump.o: $(srcdir)/daemon/cachedump.c config.h $(srcdir)/daemon/cachedump.h \ - $(srcdir)/daemon/remote.h $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h \ - $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ - $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/util/alloc.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ - $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h \ - $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h \ - $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h $(srcdir)/services/cache/dns.h \ - $(srcdir)/services/cache/infra.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/util/rtt.h \ - $(srcdir)/util/regional.h $(srcdir)/util/net_help.h $(srcdir)/util/data/dname.h $(srcdir)/iterator/iterator.h \ - $(srcdir)/services/outbound_list.h $(srcdir)/iterator/iter_delegpt.h $(srcdir)/iterator/iter_utils.h \ - $(srcdir)/iterator/iter_resptype.h $(srcdir)/iterator/iter_fwd.h $(srcdir)/iterator/iter_hints.h \ - $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/str2wire.h -daemon.lo daemon.o: $(srcdir)/daemon/daemon.c config.h $(srcdir)/daemon/daemon.h $(srcdir)/util/locks.h \ - $(srcdir)/util/log.h $(srcdir)/util/alloc.h $(srcdir)/services/modstack.h \ - $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h \ +cachedump.lo cachedump.o: $(srcdir)/daemon/cachedump.c config.h \ + $(srcdir)/daemon/cachedump.h $(srcdir)/daemon/remote.h $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h \ $(srcdir)/sldns/sbuffer.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \ - $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/util/data/msgreply.h \ + $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ + $(srcdir)/util/alloc.h $(srcdir)/util/data/msgreply.h \ $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h \ $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h \ - $(srcdir)/daemon/remote.h $(srcdir)/daemon/acl_list.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h \ - $(srcdir)/services/view.h $(srcdir)/util/config_file.h $(srcdir)/util/shm_side/shm_main.h \ - $(srcdir)/util/storage/lookup3.h $(srcdir)/util/storage/slabhash.h $(srcdir)/util/tcp_conn_limit.h \ + $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h \ + $(srcdir)/services/cache/dns.h $(srcdir)/services/cache/infra.h $(srcdir)/util/storage/dnstree.h \ + $(srcdir)/util/rbtree.h $(srcdir)/util/rtt.h $(srcdir)/util/regional.h $(srcdir)/util/net_help.h \ + $(srcdir)/util/data/dname.h $(srcdir)/iterator/iterator.h $(srcdir)/services/outbound_list.h \ + $(srcdir)/iterator/iter_delegpt.h $(srcdir)/iterator/iter_utils.h $(srcdir)/iterator/iter_resptype.h \ + $(srcdir)/iterator/iter_fwd.h $(srcdir)/iterator/iter_hints.h $(srcdir)/sldns/wire2str.h \ + $(srcdir)/sldns/str2wire.h +daemon.lo daemon.o: $(srcdir)/daemon/daemon.c config.h \ + $(srcdir)/daemon/daemon.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/alloc.h $(srcdir)/services/modstack.h \ + $(srcdir)/daemon/worker.h \ + $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h $(srcdir)/util/data/packed_rrset.h \ + $(srcdir)/util/storage/lruhash.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ + $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h \ + $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/util/module.h \ + $(srcdir)/dnstap/dnstap.h $(srcdir)/daemon/remote.h \ + $(srcdir)/daemon/acl_list.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/services/view.h \ + $(srcdir)/util/config_file.h $(srcdir)/util/shm_side/shm_main.h $(srcdir)/util/storage/lookup3.h \ + $(srcdir)/util/storage/slabhash.h $(srcdir)/util/tcp_conn_limit.h $(srcdir)/util/edns.h \ $(srcdir)/services/listen_dnsport.h $(srcdir)/services/cache/rrset.h $(srcdir)/services/cache/infra.h \ $(srcdir)/util/rtt.h $(srcdir)/services/localzone.h $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h \ $(srcdir)/services/rpz.h $(srcdir)/respip/respip.h $(srcdir)/util/random.h $(srcdir)/util/tube.h $(srcdir)/util/net_help.h \ $(srcdir)/sldns/keyraw.h -remote.lo remote.o: $(srcdir)/daemon/remote.c config.h $(srcdir)/daemon/remote.h $(srcdir)/daemon/worker.h \ - $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h $(srcdir)/util/data/packed_rrset.h \ - $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/netevent.h \ - $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/util/alloc.h \ - $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h \ - $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/util/module.h \ - $(srcdir)/dnstap/dnstap.h $(srcdir)/daemon/daemon.h \ +remote.lo remote.o: $(srcdir)/daemon/remote.c config.h \ + $(srcdir)/daemon/remote.h \ + $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h \ + $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ + $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ + $(srcdir)/util/alloc.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ + $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h \ + $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h $(srcdir)/daemon/daemon.h \ $(srcdir)/services/modstack.h $(srcdir)/daemon/cachedump.h $(srcdir)/util/config_file.h \ $(srcdir)/util/net_help.h $(srcdir)/services/listen_dnsport.h $(srcdir)/services/cache/rrset.h \ $(srcdir)/util/storage/slabhash.h $(srcdir)/services/cache/infra.h $(srcdir)/util/storage/dnstree.h \ @@ -1291,19 +1348,21 @@ stats.lo stats.o: $(srcdir)/daemon/stats.c config.h $(srcdir)/daemon/stats.h $(s $(srcdir)/util/net_help.h $(srcdir)/validator/validator.h $(srcdir)/validator/val_utils.h \ $(srcdir)/iterator/iterator.h $(srcdir)/services/outbound_list.h $(srcdir)/services/cache/rrset.h \ $(srcdir)/util/storage/slabhash.h $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h \ - $(srcdir)/validator/val_kcache.h $(srcdir)/validator/val_neg.h + $(srcdir)/validator/val_kcache.h $(srcdir)/validator/val_neg.h $(srcdir)/edns-subnet/subnetmod.h \ + $(srcdir)/util/data/dname.h $(srcdir)/edns-subnet/addrtree.h $(srcdir)/edns-subnet/edns-subnet.h \ + unbound.lo unbound.o: $(srcdir)/daemon/unbound.c config.h $(srcdir)/util/log.h $(srcdir)/daemon/daemon.h \ $(srcdir)/util/locks.h $(srcdir)/util/alloc.h $(srcdir)/services/modstack.h \ - $(srcdir)/daemon/remote.h $(srcdir)/util/config_file.h \ - $(srcdir)/util/storage/slabhash.h $(srcdir)/util/storage/lruhash.h $(srcdir)/services/listen_dnsport.h \ - $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/services/cache/rrset.h \ - $(srcdir)/util/data/packed_rrset.h $(srcdir)/services/cache/infra.h $(srcdir)/util/storage/dnstree.h \ - $(srcdir)/util/rbtree.h $(srcdir)/util/rtt.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/fptr_wlist.h \ - $(srcdir)/util/module.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h \ - $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h \ - $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h \ - $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h $(srcdir)/util/net_help.h \ - $(srcdir)/util/ub_event.h + $(srcdir)/daemon/remote.h \ + $(srcdir)/util/config_file.h $(srcdir)/util/storage/slabhash.h $(srcdir)/util/storage/lruhash.h \ + $(srcdir)/services/listen_dnsport.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ + $(srcdir)/services/cache/rrset.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/services/cache/infra.h \ + $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/util/rtt.h $(srcdir)/util/data/msgreply.h \ + $(srcdir)/util/fptr_wlist.h $(srcdir)/util/module.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ + $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/services/rpz.h \ + $(srcdir)/services/localzone.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h $(srcdir)/services/authzone.h \ + $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h \ + $(srcdir)/util/net_help.h $(srcdir)/util/ub_event.h worker.lo worker.o: $(srcdir)/daemon/worker.c config.h $(srcdir)/util/log.h $(srcdir)/util/net_help.h \ $(srcdir)/util/random.h $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h \ @@ -1311,23 +1370,24 @@ worker.lo worker.o: $(srcdir)/daemon/worker.c config.h $(srcdir)/util/log.h $(sr $(srcdir)/util/alloc.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h \ $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h $(srcdir)/daemon/daemon.h \ - $(srcdir)/services/modstack.h $(srcdir)/daemon/remote.h $(srcdir)/daemon/acl_list.h \ - $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/services/view.h $(srcdir)/util/config_file.h \ - $(srcdir)/util/regional.h $(srcdir)/util/storage/slabhash.h $(srcdir)/services/listen_dnsport.h \ - $(srcdir)/services/outside_network.h $(srcdir)/services/outbound_list.h \ - $(srcdir)/services/cache/rrset.h $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h \ - $(srcdir)/services/cache/dns.h $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h $(srcdir)/services/rpz.h \ - $(srcdir)/services/localzone.h $(srcdir)/respip/respip.h $(srcdir)/util/data/msgencode.h \ - $(srcdir)/util/data/dname.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h $(srcdir)/util/edns.h \ - $(srcdir)/iterator/iter_fwd.h $(srcdir)/iterator/iter_hints.h $(srcdir)/validator/autotrust.h \ - $(srcdir)/validator/val_anchor.h $(srcdir)/libunbound/context.h $(srcdir)/libunbound/unbound-event.h \ - $(srcdir)/libunbound/libworker.h $(srcdir)/sldns/wire2str.h $(srcdir)/util/shm_side/shm_main.h \ - $(srcdir)/dnstap/dtstream.h + $(srcdir)/services/modstack.h $(srcdir)/daemon/remote.h \ + $(srcdir)/daemon/acl_list.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/services/view.h \ + $(srcdir)/util/config_file.h $(srcdir)/util/regional.h $(srcdir)/util/storage/slabhash.h \ + $(srcdir)/services/listen_dnsport.h $(srcdir)/services/outside_network.h \ + $(srcdir)/services/outbound_list.h $(srcdir)/services/cache/rrset.h $(srcdir)/services/cache/infra.h \ + $(srcdir)/util/rtt.h $(srcdir)/services/cache/dns.h $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h \ + $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h $(srcdir)/respip/respip.h \ + $(srcdir)/util/data/msgencode.h $(srcdir)/util/data/dname.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h \ + $(srcdir)/util/edns.h $(srcdir)/iterator/iter_fwd.h $(srcdir)/iterator/iter_hints.h \ + $(srcdir)/validator/autotrust.h $(srcdir)/validator/val_anchor.h $(srcdir)/libunbound/context.h \ + $(srcdir)/libunbound/unbound-event.h $(srcdir)/libunbound/libworker.h $(srcdir)/sldns/wire2str.h \ + $(srcdir)/util/shm_side/shm_main.h $(srcdir)/dnstap/dtstream.h testbound.lo testbound.o: $(srcdir)/testcode/testbound.c config.h $(srcdir)/testcode/testpkts.h \ $(srcdir)/testcode/replay.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ $(srcdir)/util/rbtree.h $(srcdir)/testcode/fake_event.h \ - $(srcdir)/daemon/remote.h $(srcdir)/util/config_file.h $(srcdir)/sldns/keyraw.h $(srcdir)/daemon/unbound.c \ - $(srcdir)/util/log.h $(srcdir)/daemon/daemon.h $(srcdir)/util/locks.h $(srcdir)/util/alloc.h $(srcdir)/services/modstack.h \ + $(srcdir)/daemon/remote.h \ + $(srcdir)/util/config_file.h $(srcdir)/sldns/keyraw.h $(srcdir)/daemon/unbound.c $(srcdir)/util/log.h \ + $(srcdir)/daemon/daemon.h $(srcdir)/util/locks.h $(srcdir)/util/alloc.h $(srcdir)/services/modstack.h \ $(srcdir)/util/storage/slabhash.h $(srcdir)/util/storage/lruhash.h \ $(srcdir)/services/listen_dnsport.h $(srcdir)/services/cache/rrset.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/services/cache/infra.h $(srcdir)/util/storage/dnstree.h \ @@ -1346,34 +1406,35 @@ worker.lo worker.o: $(srcdir)/daemon/worker.c config.h $(srcdir)/util/log.h $(sr $(srcdir)/util/alloc.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h \ $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h $(srcdir)/daemon/daemon.h \ - $(srcdir)/services/modstack.h $(srcdir)/daemon/remote.h $(srcdir)/daemon/acl_list.h \ - $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/services/view.h $(srcdir)/util/config_file.h \ - $(srcdir)/util/regional.h $(srcdir)/util/storage/slabhash.h $(srcdir)/services/listen_dnsport.h \ - $(srcdir)/services/outside_network.h $(srcdir)/services/outbound_list.h \ - $(srcdir)/services/cache/rrset.h $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h \ - $(srcdir)/services/cache/dns.h $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h $(srcdir)/services/rpz.h \ - $(srcdir)/services/localzone.h $(srcdir)/respip/respip.h $(srcdir)/util/data/msgencode.h \ - $(srcdir)/util/data/dname.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h $(srcdir)/util/edns.h \ - $(srcdir)/iterator/iter_fwd.h $(srcdir)/iterator/iter_hints.h $(srcdir)/validator/autotrust.h \ - $(srcdir)/validator/val_anchor.h $(srcdir)/libunbound/context.h $(srcdir)/libunbound/unbound-event.h \ - $(srcdir)/libunbound/libworker.h $(srcdir)/sldns/wire2str.h $(srcdir)/util/shm_side/shm_main.h \ - $(srcdir)/dnstap/dtstream.h + $(srcdir)/services/modstack.h $(srcdir)/daemon/remote.h \ + $(srcdir)/daemon/acl_list.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/services/view.h \ + $(srcdir)/util/config_file.h $(srcdir)/util/regional.h $(srcdir)/util/storage/slabhash.h \ + $(srcdir)/services/listen_dnsport.h $(srcdir)/services/outside_network.h \ + $(srcdir)/services/outbound_list.h $(srcdir)/services/cache/rrset.h $(srcdir)/services/cache/infra.h \ + $(srcdir)/util/rtt.h $(srcdir)/services/cache/dns.h $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h \ + $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h $(srcdir)/respip/respip.h \ + $(srcdir)/util/data/msgencode.h $(srcdir)/util/data/dname.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h \ + $(srcdir)/util/edns.h $(srcdir)/iterator/iter_fwd.h $(srcdir)/iterator/iter_hints.h \ + $(srcdir)/validator/autotrust.h $(srcdir)/validator/val_anchor.h $(srcdir)/libunbound/context.h \ + $(srcdir)/libunbound/unbound-event.h $(srcdir)/libunbound/libworker.h $(srcdir)/sldns/wire2str.h \ + $(srcdir)/util/shm_side/shm_main.h $(srcdir)/dnstap/dtstream.h acl_list.lo acl_list.o: $(srcdir)/daemon/acl_list.c config.h $(srcdir)/daemon/acl_list.h \ $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/services/view.h $(srcdir)/util/locks.h \ $(srcdir)/util/log.h $(srcdir)/util/regional.h $(srcdir)/util/config_file.h $(srcdir)/util/net_help.h \ $(srcdir)/services/localzone.h $(srcdir)/util/module.h $(srcdir)/util/storage/lruhash.h \ $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/str2wire.h -daemon.lo daemon.o: $(srcdir)/daemon/daemon.c config.h $(srcdir)/daemon/daemon.h $(srcdir)/util/locks.h \ - $(srcdir)/util/log.h $(srcdir)/util/alloc.h $(srcdir)/services/modstack.h \ - $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h \ - $(srcdir)/sldns/sbuffer.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \ - $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/util/data/msgreply.h \ - $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h \ - $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h \ - $(srcdir)/daemon/remote.h $(srcdir)/daemon/acl_list.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h \ - $(srcdir)/services/view.h $(srcdir)/util/config_file.h $(srcdir)/util/shm_side/shm_main.h \ - $(srcdir)/util/storage/lookup3.h $(srcdir)/util/storage/slabhash.h $(srcdir)/util/tcp_conn_limit.h \ +daemon.lo daemon.o: $(srcdir)/daemon/daemon.c config.h \ + $(srcdir)/daemon/daemon.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/alloc.h $(srcdir)/services/modstack.h \ + $(srcdir)/daemon/worker.h \ + $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h $(srcdir)/util/data/packed_rrset.h \ + $(srcdir)/util/storage/lruhash.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ + $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h \ + $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/util/module.h \ + $(srcdir)/dnstap/dnstap.h $(srcdir)/daemon/remote.h \ + $(srcdir)/daemon/acl_list.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/services/view.h \ + $(srcdir)/util/config_file.h $(srcdir)/util/shm_side/shm_main.h $(srcdir)/util/storage/lookup3.h \ + $(srcdir)/util/storage/slabhash.h $(srcdir)/util/tcp_conn_limit.h $(srcdir)/util/edns.h \ $(srcdir)/services/listen_dnsport.h $(srcdir)/services/cache/rrset.h $(srcdir)/services/cache/infra.h \ $(srcdir)/util/rtt.h $(srcdir)/services/localzone.h $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h \ $(srcdir)/services/rpz.h $(srcdir)/respip/respip.h $(srcdir)/util/random.h $(srcdir)/util/tube.h $(srcdir)/util/net_help.h \ @@ -1391,7 +1452,9 @@ stats.lo stats.o: $(srcdir)/daemon/stats.c config.h $(srcdir)/daemon/stats.h $(s $(srcdir)/util/net_help.h $(srcdir)/validator/validator.h $(srcdir)/validator/val_utils.h \ $(srcdir)/iterator/iterator.h $(srcdir)/services/outbound_list.h $(srcdir)/services/cache/rrset.h \ $(srcdir)/util/storage/slabhash.h $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h \ - $(srcdir)/validator/val_kcache.h $(srcdir)/validator/val_neg.h + $(srcdir)/validator/val_kcache.h $(srcdir)/validator/val_neg.h $(srcdir)/edns-subnet/subnetmod.h \ + $(srcdir)/util/data/dname.h $(srcdir)/edns-subnet/addrtree.h $(srcdir)/edns-subnet/edns-subnet.h \ + replay.lo replay.o: $(srcdir)/testcode/replay.c config.h $(srcdir)/util/log.h $(srcdir)/util/net_help.h \ $(srcdir)/util/config_file.h $(srcdir)/testcode/replay.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ $(srcdir)/testcode/testpkts.h $(srcdir)/util/rbtree.h \ @@ -1401,13 +1464,14 @@ fake_event.lo fake_event.o: $(srcdir)/testcode/fake_event.c config.h $(srcdir)/t $(srcdir)/util/net_help.h $(srcdir)/util/log.h $(srcdir)/util/data/msgparse.h $(srcdir)/util/storage/lruhash.h \ $(srcdir)/util/locks.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/data/msgreply.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgencode.h $(srcdir)/util/data/dname.h \ - $(srcdir)/util/config_file.h $(srcdir)/services/listen_dnsport.h $(srcdir)/services/outside_network.h \ - $(srcdir)/util/rbtree.h $(srcdir)/services/cache/infra.h \ - $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rtt.h $(srcdir)/testcode/replay.h $(srcdir)/testcode/testpkts.h \ - $(srcdir)/util/fptr_wlist.h $(srcdir)/util/module.h $(srcdir)/util/tube.h $(srcdir)/services/mesh.h \ - $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h $(srcdir)/services/view.h \ - $(srcdir)/sldns/sbuffer.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \ - $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/str2wire.h + $(srcdir)/util/edns.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/util/config_file.h \ + $(srcdir)/services/listen_dnsport.h $(srcdir)/services/outside_network.h \ + $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h \ + $(srcdir)/testcode/replay.h $(srcdir)/testcode/testpkts.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/module.h \ + $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h \ + $(srcdir)/services/localzone.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h $(srcdir)/services/authzone.h \ + $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h \ + $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/str2wire.h lock_verify.lo lock_verify.o: $(srcdir)/testcode/lock_verify.c config.h $(srcdir)/util/log.h $(srcdir)/util/rbtree.h \ $(srcdir)/util/locks.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/module.h \ @@ -1442,7 +1506,8 @@ unbound-checkconf.lo unbound-checkconf.o: $(srcdir)/smallapp/unbound-checkconf.c $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h \ $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \ - $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h + $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h $(srcdir)/sldns/str2wire.h \ + $(PYTHONMOD_HEADER) $(srcdir)/edns-subnet/subnet-whitelist.h worker_cb.lo worker_cb.o: $(srcdir)/smallapp/worker_cb.c config.h $(srcdir)/libunbound/context.h \ $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/alloc.h $(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h \ $(srcdir)/libunbound/unbound.h $(srcdir)/libunbound/unbound-event.h $(srcdir)/util/data/packed_rrset.h \ @@ -1463,76 +1528,83 @@ context.lo context.o: $(srcdir)/libunbound/context.c config.h $(srcdir)/libunbou $(srcdir)/util/storage/slabhash.h $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h \ $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h $(srcdir)/services/rpz.h $(srcdir)/daemon/stats.h \ - $(srcdir)/util/timehist.h $(srcdir)/respip/respip.h + $(srcdir)/util/timehist.h $(srcdir)/respip/respip.h $(srcdir)/util/edns.h libunbound.lo libunbound.o: $(srcdir)/libunbound/libunbound.c $(srcdir)/libunbound/unbound.h \ $(srcdir)/libunbound/unbound-event.h config.h $(srcdir)/libunbound/context.h $(srcdir)/util/locks.h \ $(srcdir)/util/log.h $(srcdir)/util/alloc.h $(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/libunbound/libworker.h \ $(srcdir)/util/config_file.h $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h \ $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/regional.h \ - $(srcdir)/util/random.h $(srcdir)/util/net_help.h $(srcdir)/util/tube.h $(srcdir)/util/ub_event.h \ - $(srcdir)/services/localzone.h $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h \ + $(srcdir)/util/random.h $(srcdir)/util/net_help.h $(srcdir)/util/tube.h $(srcdir)/util/ub_event.h $(srcdir)/util/edns.h \ + $(srcdir)/util/storage/dnstree.h $(srcdir)/services/localzone.h $(srcdir)/services/view.h \ $(srcdir)/sldns/sbuffer.h $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h $(srcdir)/util/netevent.h \ $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/services/cache/rrset.h \ $(srcdir)/util/storage/slabhash.h $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h \ $(srcdir)/services/rpz.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/respip/respip.h -libworker.lo libworker.o: $(srcdir)/libunbound/libworker.c config.h $(srcdir)/libunbound/libworker.h \ - $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ - $(srcdir)/libunbound/context.h $(srcdir)/util/alloc.h $(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h \ - $(srcdir)/libunbound/unbound.h $(srcdir)/libunbound/unbound-event.h $(srcdir)/libunbound/worker.h \ - $(srcdir)/sldns/sbuffer.h $(srcdir)/services/outside_network.h $(srcdir)/util/netevent.h \ - $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/services/mesh.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h \ - $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h \ - $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h $(srcdir)/util/config_file.h \ - $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/respip/respip.h \ - $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h $(srcdir)/services/outbound_list.h \ - $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h $(srcdir)/util/regional.h $(srcdir)/util/random.h \ - $(srcdir)/util/storage/lookup3.h $(srcdir)/util/net_help.h $(srcdir)/util/data/dname.h \ - $(srcdir)/util/data/msgencode.h $(srcdir)/iterator/iter_fwd.h $(srcdir)/iterator/iter_hints.h \ - $(srcdir)/sldns/str2wire.h +libworker.lo libworker.o: $(srcdir)/libunbound/libworker.c config.h \ + $(srcdir)/libunbound/libworker.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \ + $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/libunbound/context.h $(srcdir)/util/alloc.h $(srcdir)/util/rbtree.h \ + $(srcdir)/services/modstack.h $(srcdir)/libunbound/unbound.h $(srcdir)/libunbound/unbound-event.h \ + $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h $(srcdir)/services/outside_network.h \ + $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ + $(srcdir)/services/mesh.h $(srcdir)/util/data/msgparse.h \ + $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h \ + $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h $(srcdir)/util/storage/dnstree.h \ + $(srcdir)/services/view.h $(srcdir)/util/config_file.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h \ + $(srcdir)/util/timehist.h $(srcdir)/respip/respip.h $(srcdir)/services/cache/rrset.h \ + $(srcdir)/util/storage/slabhash.h $(srcdir)/services/outbound_list.h $(srcdir)/util/fptr_wlist.h \ + $(srcdir)/util/tube.h $(srcdir)/util/regional.h $(srcdir)/util/random.h $(srcdir)/util/storage/lookup3.h \ + $(srcdir)/util/net_help.h $(srcdir)/util/data/dname.h $(srcdir)/util/data/msgencode.h \ + $(srcdir)/iterator/iter_fwd.h $(srcdir)/iterator/iter_hints.h $(srcdir)/sldns/str2wire.h unbound-host.lo unbound-host.o: $(srcdir)/smallapp/unbound-host.c config.h $(srcdir)/libunbound/unbound.h \ - $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/wire2str.h + $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/wire2str.h \ + asynclook.lo asynclook.o: $(srcdir)/testcode/asynclook.c config.h $(srcdir)/libunbound/unbound.h \ $(srcdir)/libunbound/context.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/alloc.h $(srcdir)/util/rbtree.h \ $(srcdir)/services/modstack.h $(srcdir)/libunbound/unbound-event.h $(srcdir)/util/data/packed_rrset.h \ - $(srcdir)/util/storage/lruhash.h $(srcdir)/sldns/rrdef.h + $(srcdir)/util/storage/lruhash.h $(srcdir)/sldns/rrdef.h \ + streamtcp.lo streamtcp.o: $(srcdir)/testcode/streamtcp.c config.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ $(srcdir)/util/net_help.h $(srcdir)/util/data/msgencode.h $(srcdir)/util/data/msgparse.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/data/msgreply.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/dname.h $(srcdir)/sldns/sbuffer.h \ - $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/wire2str.h + $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/wire2str.h \ + perf.lo perf.o: $(srcdir)/testcode/perf.c config.h $(srcdir)/util/log.h $(srcdir)/util/locks.h $(srcdir)/util/net_help.h \ $(srcdir)/util/data/msgencode.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/storage/lruhash.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/str2wire.h delayer.lo delayer.o: $(srcdir)/testcode/delayer.c config.h $(srcdir)/util/net_help.h $(srcdir)/util/log.h \ $(srcdir)/util/config_file.h $(srcdir)/sldns/sbuffer.h -unbound-control.lo unbound-control.o: $(srcdir)/smallapp/unbound-control.c config.h $(srcdir)/util/log.h \ - $(srcdir)/util/config_file.h $(srcdir)/util/locks.h $(srcdir)/util/net_help.h $(srcdir)/util/shm_side/shm_main.h \ - $(srcdir)/libunbound/unbound.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/sldns/wire2str.h \ - $(srcdir)/sldns/pkthdr.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h $(srcdir)/util/rbtree.h \ - $(srcdir)/util/storage/dnstree.h $(srcdir)/util/module.h $(srcdir)/util/storage/lruhash.h \ - $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ - $(srcdir)/sldns/rrdef.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h $(srcdir)/services/authzone.h \ - $(srcdir)/services/mesh.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ +unbound-control.lo unbound-control.o: $(srcdir)/smallapp/unbound-control.c config.h \ + $(srcdir)/util/log.h $(srcdir)/util/config_file.h $(srcdir)/util/locks.h $(srcdir)/util/net_help.h \ + $(srcdir)/util/shm_side/shm_main.h $(srcdir)/libunbound/unbound.h $(srcdir)/daemon/stats.h \ + $(srcdir)/util/timehist.h $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/pkthdr.h $(srcdir)/services/rpz.h \ + $(srcdir)/services/localzone.h $(srcdir)/util/rbtree.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/module.h \ + $(srcdir)/util/storage/lruhash.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \ + $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/rrdef.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h \ + $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ $(srcdir)/services/modstack.h $(srcdir)/respip/respip.h unbound-anchor.lo unbound-anchor.o: $(srcdir)/smallapp/unbound-anchor.c config.h $(srcdir)/libunbound/unbound.h \ - $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/parseutil.h -petal.lo petal.o: $(srcdir)/testcode/petal.c config.h + $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/parseutil.h \ + +petal.lo petal.o: $(srcdir)/testcode/petal.c config.h \ + unbound-dnstap-socket.lo unbound-dnstap-socket.o: $(srcdir)/dnstap/unbound-dnstap-socket.c config.h \ $(srcdir)/dnstap/dtstream.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/dnstap/dnstap_fstrm.h \ $(srcdir)/util/ub_event.h $(srcdir)/util/net_help.h $(srcdir)/services/listen_dnsport.h \ $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/wire2str.h $(srcdir)/util/config_file.h \ - $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h + $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/wire2str.h \ + dnstap/dnstap.pb-c.h \ + $(srcdir)/util/config_file.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h pythonmod_utils.lo pythonmod_utils.o: $(srcdir)/pythonmod/pythonmod_utils.c config.h $(srcdir)/util/module.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/data/msgreply.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ $(srcdir)/sldns/rrdef.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ $(srcdir)/util/net_help.h $(srcdir)/services/cache/dns.h \ $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h $(srcdir)/util/regional.h \ - $(srcdir)/iterator/iter_delegpt.h $(srcdir)/sldns/sbuffer.h + $(srcdir)/iterator/iter_delegpt.h $(srcdir)/sldns/sbuffer.h \ + win_svc.lo win_svc.o: $(srcdir)/winrc/win_svc.c config.h $(srcdir)/winrc/win_svc.h $(srcdir)/winrc/w_inst.h \ $(srcdir)/daemon/daemon.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/alloc.h $(srcdir)/services/modstack.h \ $(srcdir)/daemon/worker.h \ @@ -1540,8 +1612,8 @@ win_svc.lo win_svc.o: $(srcdir)/winrc/win_svc.c config.h $(srcdir)/winrc/win_svc $(srcdir)/util/storage/lruhash.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h \ $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/util/module.h \ - $(srcdir)/dnstap/dnstap.h $(srcdir)/daemon/remote.h $(srcdir)/util/config_file.h $(srcdir)/util/ub_event.h \ - $(srcdir)/util/net_help.h + $(srcdir)/dnstap/dnstap.h $(srcdir)/daemon/remote.h \ + $(srcdir)/util/config_file.h $(srcdir)/util/ub_event.h $(srcdir)/util/net_help.h w_inst.lo w_inst.o: $(srcdir)/winrc/w_inst.c config.h $(srcdir)/winrc/w_inst.h $(srcdir)/winrc/win_svc.h unbound-service-install.lo unbound-service-install.o: $(srcdir)/winrc/unbound-service-install.c config.h \ $(srcdir)/winrc/w_inst.h @@ -1549,12 +1621,14 @@ unbound-service-remove.lo unbound-service-remove.o: $(srcdir)/winrc/unbound-serv $(srcdir)/winrc/w_inst.h anchor-update.lo anchor-update.o: $(srcdir)/winrc/anchor-update.c config.h $(srcdir)/libunbound/unbound.h \ $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/wire2str.h -keyraw.lo keyraw.o: $(srcdir)/sldns/keyraw.c config.h $(srcdir)/sldns/keyraw.h $(srcdir)/sldns/rrdef.h +keyraw.lo keyraw.o: $(srcdir)/sldns/keyraw.c config.h $(srcdir)/sldns/keyraw.h \ + $(srcdir)/sldns/rrdef.h \ + sbuffer.lo sbuffer.o: $(srcdir)/sldns/sbuffer.c config.h $(srcdir)/sldns/sbuffer.h wire2str.lo wire2str.o: $(srcdir)/sldns/wire2str.c config.h $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/str2wire.h \ $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/parseutil.h $(srcdir)/sldns/sbuffer.h \ - $(srcdir)/sldns/keyraw.h $(srcdir)/util/data/dname.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h \ - $(srcdir)/util/log.h + $(srcdir)/sldns/keyraw.h \ + $(srcdir)/util/data/dname.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h parse.lo parse.o: $(srcdir)/sldns/parse.c config.h $(srcdir)/sldns/parse.h $(srcdir)/sldns/parseutil.h \ $(srcdir)/sldns/sbuffer.h parseutil.lo parseutil.o: $(srcdir)/sldns/parseutil.c config.h $(srcdir)/sldns/parseutil.h @@ -1562,9 +1636,11 @@ rrdef.lo rrdef.o: $(srcdir)/sldns/rrdef.c config.h $(srcdir)/sldns/rrdef.h $(src str2wire.lo str2wire.o: $(srcdir)/sldns/str2wire.c config.h $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/rrdef.h \ $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/parse.h $(srcdir)/sldns/parseutil.h dohclient.lo dohclient.o: $(srcdir)/testcode/dohclient.c config.h $(srcdir)/sldns/wire2str.h \ - $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/data/msgencode.h \ - $(srcdir)/util/data/msgreply.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ - $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/net_help.h + $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/parseutil.h \ + $(srcdir)/util/data/msgencode.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/storage/lruhash.h \ + $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ + $(srcdir)/sldns/pkthdr.h $(srcdir)/util/net_help.h \ + ctime_r.lo ctime_r.o: $(srcdir)/compat/ctime_r.c config.h $(srcdir)/util/locks.h $(srcdir)/util/log.h fake-rfc2553.lo fake-rfc2553.o: $(srcdir)/compat/fake-rfc2553.c $(srcdir)/compat/fake-rfc2553.h config.h gmtime_r.lo gmtime_r.o: $(srcdir)/compat/gmtime_r.c config.h @@ -1579,9 +1655,11 @@ strlcat.lo strlcat.o: $(srcdir)/compat/strlcat.c config.h strlcpy.lo strlcpy.o: $(srcdir)/compat/strlcpy.c config.h strptime.lo strptime.o: $(srcdir)/compat/strptime.c config.h getentropy_freebsd.lo getentropy_freebsd.o: $(srcdir)/compat/getentropy_freebsd.c -getentropy_linux.lo getentropy_linux.o: $(srcdir)/compat/getentropy_linux.c config.h +getentropy_linux.lo getentropy_linux.o: $(srcdir)/compat/getentropy_linux.c config.h \ + getentropy_osx.lo getentropy_osx.o: $(srcdir)/compat/getentropy_osx.c -getentropy_solaris.lo getentropy_solaris.o: $(srcdir)/compat/getentropy_solaris.c config.h +getentropy_solaris.lo getentropy_solaris.o: $(srcdir)/compat/getentropy_solaris.c config.h \ + getentropy_win.lo getentropy_win.o: $(srcdir)/compat/getentropy_win.c explicit_bzero.lo explicit_bzero.o: $(srcdir)/compat/explicit_bzero.c config.h arc4random.lo arc4random.o: $(srcdir)/compat/arc4random.c config.h $(srcdir)/compat/chacha_private.h diff --git a/contrib/unbound/aclocal.m4 b/contrib/unbound/aclocal.m4 index dd1b8658c7b8..bf3c57e2fd9f 100644 --- a/contrib/unbound/aclocal.m4 +++ b/contrib/unbound/aclocal.m4 @@ -1,6 +1,6 @@ -# generated automatically by aclocal 1.16.1 -*- Autoconf -*- +# generated automatically by aclocal 1.16.2 -*- Autoconf -*- -# Copyright (C) 1996-2018 Free Software Foundation, Inc. +# Copyright (C) 1996-2020 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -9390,7 +9390,7 @@ AS_IF([test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"], # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997-2018 Free Software Foundation, Inc. +# Copyright (C) 1997-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -9421,7 +9421,7 @@ AC_CONFIG_COMMANDS_PRE( Usually this means the macro was only invoked conditionally.]]) *** 4737 LINES SKIPPED *** From owner-dev-commits-src-branches@freebsd.org Thu Jun 3 00:57:53 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E065064F079; Thu, 3 Jun 2021 00:57: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 4FwSDd0qLqz3K0B; Thu, 3 Jun 2021 00:57:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ED09B20C50; Thu, 3 Jun 2021 00:57:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1530vqMY020162; Thu, 3 Jun 2021 00:57:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1530vq3A020161; Thu, 3 Jun 2021 00:57:52 GMT (envelope-from git) Date: Thu, 3 Jun 2021 00:57:52 GMT Message-Id: <202106030057.1530vq3A020161@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: c8773c8018e7 - stable/12 - ipfilter: Fix ip_nat memory leak and use-after-free MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: c8773c8018e74a34a5d9e7ec6d66f4311148f975 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jun 2021 00:57:54 -0000 The branch stable/12 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=c8773c8018e74a34a5d9e7ec6d66f4311148f975 commit c8773c8018e74a34a5d9e7ec6d66f4311148f975 Author: Cy Schubert AuthorDate: 2021-05-25 18:54:49 +0000 Commit: Cy Schubert CommitDate: 2021-06-03 00:57:45 +0000 ipfilter: Fix ip_nat memory leak and use-after-free Unfortunately the wrong elemet is freed, also resulting in use-after-free. PR: 255859 Submitted by: lylgood@foxmail.com Reported by: lylgood@foxmail.com (cherry picked from commit 323a4e2c4e285e6f8eee8db3fe2cb7490a734da0) --- sys/contrib/ipfilter/netinet/ip_nat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/contrib/ipfilter/netinet/ip_nat.c b/sys/contrib/ipfilter/netinet/ip_nat.c index bbf78877249c..028be649cccd 100644 --- a/sys/contrib/ipfilter/netinet/ip_nat.c +++ b/sys/contrib/ipfilter/netinet/ip_nat.c @@ -6243,7 +6243,7 @@ ipf_nat_rule_deref(softc, inp) if (n->in_tqehead[0] != NULL) { if (ipf_deletetimeoutqueue(n->in_tqehead[0]) == 0) { - ipf_freetimeoutqueue(softc, n->in_tqehead[1]); + ipf_freetimeoutqueue(softc, n->in_tqehead[0]); } } From owner-dev-commits-src-branches@freebsd.org Thu Jun 3 01:00:00 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3619064F1F6; Thu, 3 Jun 2021 01:00:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FwSH40ZK2z3Kw8; Thu, 3 Jun 2021 01:00:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E09C62095B; Thu, 3 Jun 2021 00:59:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1530xxwm020441; Thu, 3 Jun 2021 00:59:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1530xxM5020440; Thu, 3 Jun 2021 00:59:59 GMT (envelope-from git) Date: Thu, 3 Jun 2021 00:59:59 GMT Message-Id: <202106030059.1530xxM5020440@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 735956e48aad - stable/11 - Apply upstream fix 08968baec1122a58bb90d8f97ad948a75f8a5d69: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/11 X-Git-Reftype: branch X-Git-Commit: 735956e48aad33a0509da08506d3b6866eb2467e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jun 2021 01:00:00 -0000 The branch stable/11 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=735956e48aad33a0509da08506d3b6866eb2467e commit 735956e48aad33a0509da08506d3b6866eb2467e Author: Xin LI AuthorDate: 2020-12-17 23:35:18 +0000 Commit: Cy Schubert CommitDate: 2021-06-01 19:25:27 +0000 Apply upstream fix 08968baec1122a58bb90d8f97ad948a75f8a5d69: Fix error cases when udp-connect is set and send() returns an error Approved by: git-admin (uqs) (cherry picked from commit 072fbfa38b24d202f4eac875ad2f93531dad7f7e) --- contrib/unbound/services/authzone.c | 2 +- contrib/unbound/services/outside_network.c | 15 +- contrib/unbound/util/netevent.c | 29 +- contrib/unbound/util/netevent.h | 3 +- testcode/fake_event.c | 1878 ++++++++++++++++++++++++++++ 5 files changed, 1904 insertions(+), 23 deletions(-) diff --git a/contrib/unbound/services/authzone.c b/contrib/unbound/services/authzone.c index 8fa69d27aa21..a43a25def993 100644 --- a/contrib/unbound/services/authzone.c +++ b/contrib/unbound/services/authzone.c @@ -6093,7 +6093,7 @@ xfr_probe_send_probe(struct auth_xfer* xfr, struct module_env* env, /* send udp packet */ if(!comm_point_send_udp_msg(xfr->task_probe->cp, env->scratch_buffer, - (struct sockaddr*)&addr, addrlen)) { + (struct sockaddr*)&addr, addrlen, 0)) { char zname[255+1], as[256]; dname_str(xfr->name, zname); addr_to_str(&addr, addrlen, as, sizeof(as)); diff --git a/contrib/unbound/services/outside_network.c b/contrib/unbound/services/outside_network.c index 11951adea7bc..e87aba893d98 100644 --- a/contrib/unbound/services/outside_network.c +++ b/contrib/unbound/services/outside_network.c @@ -1870,17 +1870,10 @@ randomize_and_send_udp(struct pending* pend, sldns_buffer* packet, int timeout) log_assert(pend->pc && pend->pc->cp); /* send it over the commlink */ - if(outnet->udp_connect) { - if(!comm_point_send_udp_msg(pend->pc->cp, packet, NULL, 0)) { - portcomm_loweruse(outnet, pend->pc); - return 0; - } - } else { - if(!comm_point_send_udp_msg(pend->pc->cp, packet, - (struct sockaddr*)&pend->addr, pend->addrlen)) { - portcomm_loweruse(outnet, pend->pc); - return 0; - } + if(!comm_point_send_udp_msg(pend->pc->cp, packet, + (struct sockaddr*)&pend->addr, pend->addrlen, outnet->udp_connect)) { + portcomm_loweruse(outnet, pend->pc); + return 0; } /* system calls to set timeout after sending UDP to make roundtrip diff --git a/contrib/unbound/util/netevent.c b/contrib/unbound/util/netevent.c index 8bbad15920a2..3525af39aa30 100644 --- a/contrib/unbound/util/netevent.c +++ b/contrib/unbound/util/netevent.c @@ -333,7 +333,7 @@ int tcp_connect_errno_needs_log(struct sockaddr* addr, socklen_t addrlen) /* send a UDP reply */ int comm_point_send_udp_msg(struct comm_point *c, sldns_buffer* packet, - struct sockaddr* addr, socklen_t addrlen) + struct sockaddr* addr, socklen_t addrlen, int is_connected) { ssize_t sent; log_assert(c->fd != -1); @@ -341,8 +341,8 @@ comm_point_send_udp_msg(struct comm_point *c, sldns_buffer* packet, if(sldns_buffer_remaining(packet) == 0) log_err("error: send empty UDP packet"); #endif - if(addr) { - log_assert(addr && addrlen > 0); + log_assert(addr && addrlen > 0); + if(!is_connected) { sent = sendto(c->fd, (void*)sldns_buffer_begin(packet), sldns_buffer_remaining(packet), 0, addr, addrlen); @@ -367,9 +367,14 @@ comm_point_send_udp_msg(struct comm_point *c, sldns_buffer* packet, #endif int e; fd_set_block(c->fd); - sent = sendto(c->fd, (void*)sldns_buffer_begin(packet), - sldns_buffer_remaining(packet), 0, - addr, addrlen); + if (!is_connected) { + sent = sendto(c->fd, (void*)sldns_buffer_begin(packet), + sldns_buffer_remaining(packet), 0, + addr, addrlen); + } else { + sent = send(c->fd, (void*)sldns_buffer_begin(packet), + sldns_buffer_remaining(packet), 0); + } e = errno; fd_set_nonblock(c->fd); errno = e; @@ -378,8 +383,12 @@ comm_point_send_udp_msg(struct comm_point *c, sldns_buffer* packet, if(sent == -1) { if(!udp_send_errno_needs_log(addr, addrlen)) return 0; - verbose(VERB_OPS, "sendto failed: %s", sock_strerror(errno)); - log_addr(VERB_OPS, "remote address is", + if (!is_connected) { + verbose(VERB_OPS, "sendto failed: %s", sock_strerror(errno)); + } else { + verbose(VERB_OPS, "send failed: %s", sock_strerror(errno)); + } + log_addr(VERB_OPS, "remote address is", (struct sockaddr_storage*)addr, addrlen); return 0; } else if((size_t)sent != sldns_buffer_remaining(packet)) { @@ -754,7 +763,7 @@ comm_point_udp_callback(int fd, short event, void* arg) buffer = rep.c->buffer; #endif (void)comm_point_send_udp_msg(rep.c, buffer, - (struct sockaddr*)&rep.addr, rep.addrlen); + (struct sockaddr*)&rep.addr, rep.addrlen, 0); } if(!rep.c || rep.c->fd != fd) /* commpoint closed to -1 or reused for another UDP port. Note rep.c cannot be reused with TCP fd. */ @@ -3901,7 +3910,7 @@ comm_point_send_reply(struct comm_reply *repinfo) repinfo->addrlen, repinfo); else comm_point_send_udp_msg(repinfo->c, buffer, - (struct sockaddr*)&repinfo->addr, repinfo->addrlen); + (struct sockaddr*)&repinfo->addr, repinfo->addrlen, 0); #ifdef USE_DNSTAP if(repinfo->c->dtenv != NULL && repinfo->c->dtenv->log_client_response_messages) diff --git a/contrib/unbound/util/netevent.h b/contrib/unbound/util/netevent.h index daa954b6492f..4c1d9c15b2f2 100644 --- a/contrib/unbound/util/netevent.h +++ b/contrib/unbound/util/netevent.h @@ -633,10 +633,11 @@ void comm_point_drop_reply(struct comm_reply* repinfo); * @param addr: where to send it to. If NULL, send is performed, * for connected sockets, to the connected address. * @param addrlen: length of addr. + * @param is_connected: if the UDP socket is connect()ed. * @return: false on a failure. */ int comm_point_send_udp_msg(struct comm_point* c, struct sldns_buffer* packet, - struct sockaddr* addr, socklen_t addrlen); + struct sockaddr* addr, socklen_t addrlen,int is_connected); /** * Stop listening for input on the commpoint. No callbacks will happen. diff --git a/testcode/fake_event.c b/testcode/fake_event.c new file mode 100644 index 000000000000..6ad4c2cee61a --- /dev/null +++ b/testcode/fake_event.c @@ -0,0 +1,1878 @@ +/* + * testcode/fake_event.c - fake event handling that replays existing scenario. + * + * Copyright (c) 2007, NLnet Labs. All rights reserved. + * + * This software is open source. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * Neither the name of the NLNET LABS nor the names of its contributors may + * be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED + * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** + * \file + * Event service that replays a scenario. + * This implements the same exported symbols as the files: + * util/netevent.c + * services/listen_dnsport.c + * services/outside_network.c + * But these do not actually access the network or events, instead + * the scenario is played. + */ + +#include "config.h" +#include "testcode/fake_event.h" +#include "util/netevent.h" +#include "util/net_help.h" +#include "util/data/msgparse.h" +#include "util/data/msgreply.h" +#include "util/data/msgencode.h" +#include "util/data/dname.h" +#include "util/edns.h" +#include "util/config_file.h" +#include "services/listen_dnsport.h" +#include "services/outside_network.h" +#include "services/cache/infra.h" +#include "testcode/replay.h" +#include "testcode/testpkts.h" +#include "util/log.h" +#include "util/fptr_wlist.h" +#include "sldns/sbuffer.h" +#include "sldns/wire2str.h" +#include "sldns/str2wire.h" +#include +struct worker; +struct daemon_remote; + +/** unique code to check that fake_commpoint is that structure */ +#define FAKE_COMMPOINT_TYPECODE 97347923 +/** fake commpoint, stores information */ +struct fake_commpoint { + /** typecode */ + int typecode; + /** if this is a udp outgoing type of commpoint */ + int type_udp_out; + /** if this is a tcp outgoing type of commpoint */ + int type_tcp_out; + /** if this is a http outgoing type of commpoint. */ + int type_http_out; + + /** the callback, stored for usage */ + comm_point_callback_type* cb; + /** the callback userarg, stored for usage */ + void* cb_arg; + /** runtime ptr */ + struct replay_runtime* runtime; + /** the pending entry for this commpoint (if any) */ + struct fake_pending* pending; +}; + +/** Global variable: the scenario. Saved here for when event_init is done. */ +static struct replay_scenario* saved_scenario = NULL; + +/** add timers and the values do not overflow or become negative */ +static void +timeval_add(struct timeval* d, const struct timeval* add) +{ +#ifndef S_SPLINT_S + d->tv_sec += add->tv_sec; + d->tv_usec += add->tv_usec; + if(d->tv_usec >= 1000000) { + d->tv_usec -= 1000000; + d->tv_sec++; + } +#endif +} + +void +fake_temp_file(const char* adj, const char* id, char* buf, size_t len) +{ +#ifdef USE_WINSOCK + snprintf(buf, len, "testbound_%u%s%s.tmp", + (unsigned)getpid(), adj, id); +#else + snprintf(buf, len, "/tmp/testbound_%u%s%s.tmp", + (unsigned)getpid(), adj, id); +#endif +} + +void +fake_event_init(struct replay_scenario* scen) +{ + saved_scenario = scen; +} + +void +fake_event_cleanup(void) +{ + replay_scenario_delete(saved_scenario); + saved_scenario = NULL; +} + +/** helper function that logs a sldns_pkt packet to logfile */ +static void +log_pkt(const char* desc, uint8_t* pkt, size_t len) +{ + char* str = sldns_wire2str_pkt(pkt, len); + if(!str) + fatal_exit("%s: (failed out of memory wire2str_pkt)", desc); + else { + log_info("%s%s", desc, str); + free(str); + } +} + +/** + * Returns a string describing the event type. + */ +static const char* +repevt_string(enum replay_event_type t) +{ + switch(t) { + case repevt_nothing: return "NOTHING"; + case repevt_front_query: return "QUERY"; + case repevt_front_reply: return "CHECK_ANSWER"; + case repevt_timeout: return "TIMEOUT"; + case repevt_time_passes: return "TIME_PASSES"; + case repevt_back_reply: return "REPLY"; + case repevt_back_query: return "CHECK_OUT_QUERY"; + case repevt_autotrust_check: return "CHECK_AUTOTRUST"; + case repevt_tempfile_check: return "CHECK_TEMPFILE"; + case repevt_error: return "ERROR"; + case repevt_assign: return "ASSIGN"; + case repevt_traffic: return "TRAFFIC"; + case repevt_infra_rtt: return "INFRA_RTT"; + default: return "UNKNOWN"; + } +} + +/** delete a fake pending */ +static void +delete_fake_pending(struct fake_pending* pend) +{ + if(!pend) + return; + free(pend->zone); + sldns_buffer_free(pend->buffer); + free(pend->pkt); + free(pend); +} + +/** delete a replay answer */ +static void +delete_replay_answer(struct replay_answer* a) +{ + if(!a) + return; + if(a->repinfo.c) { + sldns_buffer_free(a->repinfo.c->buffer); + free(a->repinfo.c); + } + free(a->pkt); + free(a); +} + +/** + * return: true if pending query matches the now event. + */ +static int +pending_matches_current(struct replay_runtime* runtime, + struct entry** entry, struct fake_pending **pend) +{ + struct fake_pending* p; + struct entry* e; + if(!runtime->now || runtime->now->evt_type != repevt_back_query + || !runtime->pending_list) + return 0; + /* see if any of the pending queries matches */ + for(p = runtime->pending_list; p; p = p->next) { + if(runtime->now->addrlen != 0 && + sockaddr_cmp(&p->addr, p->addrlen, &runtime->now->addr, + runtime->now->addrlen) != 0) + continue; + if((e=find_match(runtime->now->match, p->pkt, p->pkt_len, + p->transport))) { + *entry = e; + *pend = p; + return 1; + } + } + return 0; +} + +/** + * Find the range that matches this pending message. + * @param runtime: runtime with current moment, and range list. + * @param entry: returns the pointer to entry that matches. + * @param pend: the pending that the entry must match. + * @return: true if a match is found. + */ +static int +pending_find_match(struct replay_runtime* runtime, struct entry** entry, + struct fake_pending* pend) +{ + int timenow = runtime->now->time_step; + struct replay_range* p = runtime->scenario->range_list; + while(p) { + if(p->start_step <= timenow && timenow <= p->end_step && + (p->addrlen == 0 || sockaddr_cmp(&p->addr, p->addrlen, + &pend->addr, pend->addrlen) == 0) && + (*entry = find_match(p->match, pend->pkt, pend->pkt_len, + pend->transport))) { + log_info("matched query time %d in range [%d, %d] " + "with entry line %d", timenow, + p->start_step, p->end_step, (*entry)->lineno); + if(p->addrlen != 0) + log_addr(0, "matched ip", &p->addr, p->addrlen); + log_pkt("matched pkt: ", + (*entry)->reply_list->reply_pkt, + (*entry)->reply_list->reply_len); + return 1; + } + p = p->next_range; + } + return 0; +} + +/** + * See if outgoing pending query matches an entry. + * @param runtime: runtime. + * @param entry: if true, the entry that matches is returned. + * @param pend: if true, the outgoing message that matches is returned. + * @return: true if pending query matches the now event. + */ +static int +pending_matches_range(struct replay_runtime* runtime, + struct entry** entry, struct fake_pending** pend) +{ + struct fake_pending* p = runtime->pending_list; + /* slow, O(N*N), but it works as advertised with weird matching */ + while(p) { + if(p->tcp_pkt_counter != 0) { + /* continue tcp transfer */ + *pend = p; + return 1; + } + if(pending_find_match(runtime, entry, p)) { + *pend = p; + return 1; + } + p = p->next; + } + return 0; +} + +/** + * Remove the item from the pending list. + */ +static void +pending_list_delete(struct replay_runtime* runtime, struct fake_pending* pend) +{ + struct fake_pending** prev = &runtime->pending_list; + struct fake_pending* p = runtime->pending_list; + + while(p) { + if(p == pend) { + *prev = p->next; + delete_fake_pending(pend); + return; + } + + prev = &p->next; + p = p->next; + } +} + +/** number of replies in entry */ +static int +count_reply_packets(struct entry* entry) +{ + int count = 0; + struct reply_packet* reppkt = entry->reply_list; + while(reppkt) { + count++; + reppkt = reppkt->next; + } + return count; +} + +/** + * Fill buffer with reply from the entry. + */ +static void +fill_buffer_with_reply(sldns_buffer* buffer, struct entry* entry, uint8_t* q, + size_t qlen, int tcp_pkt_counter) +{ + struct reply_packet* reppkt; + uint8_t* c; + size_t clen; + log_assert(entry && entry->reply_list); + sldns_buffer_clear(buffer); + reppkt = entry->reply_list; + if(tcp_pkt_counter > 0) { + int i = tcp_pkt_counter; + while(reppkt && i--) + reppkt = reppkt->next; + if(!reppkt) fatal_exit("extra packet read from TCP stream but none is available"); + log_pkt("extra_packet ", reppkt->reply_pkt, reppkt->reply_len); + } + if(reppkt->reply_from_hex) { + c = sldns_buffer_begin(reppkt->reply_from_hex); + clen = sldns_buffer_limit(reppkt->reply_from_hex); + if(!c) fatal_exit("out of memory"); + } else { + c = reppkt->reply_pkt; + clen = reppkt->reply_len; + } + if(c) { + if(q) adjust_packet(entry, &c, &clen, q, qlen); + sldns_buffer_write(buffer, c, clen); + if(q) free(c); + } + sldns_buffer_flip(buffer); +} + +/** + * Perform range entry on pending message. + * @param runtime: runtime buffer size preference. + * @param entry: entry that codes for the reply to do. + * @param pend: pending query that is answered, callback called. + */ +static void +answer_callback_from_entry(struct replay_runtime* runtime, + struct entry* entry, struct fake_pending* pend) +{ + struct comm_point c; + struct comm_reply repinfo; + void* cb_arg = pend->cb_arg; + comm_point_callback_type* cb = pend->callback; + + memset(&c, 0, sizeof(c)); + c.fd = -1; + c.buffer = sldns_buffer_new(runtime->bufsize); + c.type = comm_udp; + if(pend->transport == transport_tcp) { + c.type = comm_tcp; + c.tcp_timeout_msec = 30000; + c.tcp_keepalive = runtime->tcp_seen_keepalive; + } + fill_buffer_with_reply(c.buffer, entry, pend->pkt, pend->pkt_len, + pend->tcp_pkt_counter); + repinfo.c = &c; + repinfo.addrlen = pend->addrlen; + memcpy(&repinfo.addr, &pend->addr, pend->addrlen); + if(!pend->serviced) { + if(entry && entry->reply_list->next && + pend->tcp_pkt_counter < count_reply_packets(entry)) { + /* go to next packet next time */ + pend->tcp_pkt_counter++; + } else { + pending_list_delete(runtime, pend); + } + } + if((*cb)(&c, cb_arg, NETEVENT_NOERROR, &repinfo)) { + fatal_exit("testbound: unexpected: callback returned 1"); + } + sldns_buffer_free(c.buffer); +} + +/** Check the now moment answer check event */ +static void +answer_check_it(struct replay_runtime* runtime) +{ + struct replay_answer* ans = runtime->answer_list, + *prev = NULL; + log_assert(runtime && runtime->now && + runtime->now->evt_type == repevt_front_reply); + while(ans) { + enum transport_type tr = transport_tcp; + if(ans->repinfo.c->type == comm_udp) + tr = transport_udp; + if((runtime->now->addrlen == 0 || sockaddr_cmp( + &runtime->now->addr, runtime->now->addrlen, + &ans->repinfo.addr, ans->repinfo.addrlen) == 0) && + find_match(runtime->now->match, ans->pkt, + ans->pkt_len, tr)) { + log_info("testbound matched event entry from line %d", + runtime->now->match->lineno); + log_info("testbound: do STEP %d %s", + runtime->now->time_step, + repevt_string(runtime->now->evt_type)); + if(prev) + prev->next = ans->next; + else runtime->answer_list = ans->next; + if(!ans->next) + runtime->answer_last = prev; + if(ans->repinfo.c->tcp_keepalive) + runtime->tcp_seen_keepalive = 1; + delete_replay_answer(ans); + return; + } else { + prev = ans; + ans = ans->next; + } + } + log_info("testbound: do STEP %d %s", runtime->now->time_step, + repevt_string(runtime->now->evt_type)); + fatal_exit("testbound: not matched"); +} + +/** + * Create commpoint (as return address) for a fake incoming query. + */ +static void +fake_front_query(struct replay_runtime* runtime, struct replay_moment *todo) +{ + struct comm_reply repinfo; + memset(&repinfo, 0, sizeof(repinfo)); + repinfo.c = (struct comm_point*)calloc(1, sizeof(struct comm_point)); + repinfo.addrlen = (socklen_t)sizeof(struct sockaddr_in); + if(todo->addrlen != 0) { + repinfo.addrlen = todo->addrlen; + memcpy(&repinfo.addr, &todo->addr, todo->addrlen); + } + repinfo.c->fd = -1; + repinfo.c->ev = (struct internal_event*)runtime; + repinfo.c->buffer = sldns_buffer_new(runtime->bufsize); + if(todo->match->match_transport == transport_tcp) { + repinfo.c->type = comm_tcp; + repinfo.c->tcp_timeout_msec = 30000; + repinfo.c->tcp_keepalive = runtime->tcp_seen_keepalive; + } else + repinfo.c->type = comm_udp; + fill_buffer_with_reply(repinfo.c->buffer, todo->match, NULL, 0, 0); + log_info("testbound: incoming QUERY"); + log_pkt("query pkt", todo->match->reply_list->reply_pkt, + todo->match->reply_list->reply_len); + /* call the callback for incoming queries */ + if((*runtime->callback_query)(repinfo.c, runtime->cb_arg, + NETEVENT_NOERROR, &repinfo)) { + /* send immediate reply */ + comm_point_send_reply(&repinfo); + } + /* clear it again, in case copy not done properly */ + memset(&repinfo, 0, sizeof(repinfo)); +} + +/** + * Perform callback for fake pending message. + */ +static void +fake_pending_callback(struct replay_runtime* runtime, + struct replay_moment* todo, int error) +{ + struct fake_pending* p = runtime->pending_list; + struct comm_reply repinfo; + struct comm_point c; + void* cb_arg; + comm_point_callback_type* cb; + + memset(&c, 0, sizeof(c)); + if(!p) fatal_exit("No pending queries."); + cb_arg = p->cb_arg; + cb = p->callback; + c.buffer = sldns_buffer_new(runtime->bufsize); + c.type = comm_udp; + if(p->transport == transport_tcp) { + c.type = comm_tcp; + c.tcp_timeout_msec = 30000; + c.tcp_keepalive = runtime->tcp_seen_keepalive; + } + if(todo->evt_type == repevt_back_reply && todo->match) { + fill_buffer_with_reply(c.buffer, todo->match, p->pkt, + p->pkt_len, p->tcp_pkt_counter); + } + repinfo.c = &c; + repinfo.addrlen = p->addrlen; + memcpy(&repinfo.addr, &p->addr, p->addrlen); + if(!p->serviced) { + if(todo->match && todo->match->reply_list->next && !error && + p->tcp_pkt_counter < count_reply_packets(todo->match)) { + /* go to next packet next time */ + p->tcp_pkt_counter++; + } else { + pending_list_delete(runtime, p); + } + } + if((*cb)(&c, cb_arg, error, &repinfo)) { + fatal_exit("unexpected: pending callback returned 1"); + } + /* delete the pending item. */ + sldns_buffer_free(c.buffer); +} + +/** pass time */ +static void +moment_assign(struct replay_runtime* runtime, struct replay_moment* mom) +{ + char* value = macro_process(runtime->vars, runtime, mom->string); + if(!value) + fatal_exit("could not process macro step %d", mom->time_step); + log_info("assign %s = %s", mom->variable, value); + if(!macro_assign(runtime->vars, mom->variable, value)) + fatal_exit("out of memory storing macro"); + free(value); + if(verbosity >= VERB_ALGO) + macro_print_debug(runtime->vars); +} + +/** pass time */ +static void +time_passes(struct replay_runtime* runtime, struct replay_moment* mom) +{ + struct fake_timer *t; + struct timeval tv = mom->elapse; + if(mom->string) { + char* xp = macro_process(runtime->vars, runtime, mom->string); + double sec; + if(!xp) fatal_exit("could not macro expand %s", mom->string); + verbose(VERB_ALGO, "EVAL %s", mom->string); + sec = atof(xp); + free(xp); +#ifndef S_SPLINT_S + tv.tv_sec = sec; + tv.tv_usec = (int)((sec - (double)tv.tv_sec) *1000000. + 0.5); +#endif + } + timeval_add(&runtime->now_tv, &tv); + runtime->now_secs = (time_t)runtime->now_tv.tv_sec; +#ifndef S_SPLINT_S + log_info("elapsed %d.%6.6d now %d.%6.6d", + (int)tv.tv_sec, (int)tv.tv_usec, + (int)runtime->now_tv.tv_sec, (int)runtime->now_tv.tv_usec); +#endif + /* see if any timers have fired; and run them */ + while( (t=replay_get_oldest_timer(runtime)) ) { + t->enabled = 0; + log_info("fake_timer callback"); + fptr_ok(fptr_whitelist_comm_timer(t->cb)); + (*t->cb)(t->cb_arg); + } +} + +/** check autotrust file contents */ +static void +autotrust_check(struct replay_runtime* runtime, struct replay_moment* mom) +{ + char name[1024], line[1024]; + FILE *in; + int lineno = 0, oke=1; + char* expanded; + struct config_strlist* p; + line[sizeof(line)-1] = 0; + log_assert(mom->autotrust_id); + fake_temp_file("_auto_", mom->autotrust_id, name, sizeof(name)); + in = fopen(name, "r"); + if(!in) fatal_exit("could not open %s: %s", name, strerror(errno)); + for(p=mom->file_content; p; p=p->next) { + lineno++; + if(!fgets(line, (int)sizeof(line)-1, in)) { + log_err("autotrust check failed, could not read line"); + log_err("file %s, line %d", name, lineno); + log_err("should be: %s", p->str); + fatal_exit("autotrust_check failed"); + } + if(line[0]) line[strlen(line)-1] = 0; /* remove newline */ + expanded = macro_process(runtime->vars, runtime, p->str); + if(!expanded) + fatal_exit("could not expand macro line %d", lineno); + if(verbosity >= 7 && strcmp(p->str, expanded) != 0) + log_info("expanded '%s' to '%s'", p->str, expanded); + if(strcmp(expanded, line) != 0) { + log_err("mismatch in file %s, line %d", name, lineno); + log_err("file has : %s", line); + log_err("should be: %s", expanded); + free(expanded); + oke = 0; + continue; + } + free(expanded); + fprintf(stderr, "%s:%2d ok : %s\n", name, lineno, line); + } + if(fgets(line, (int)sizeof(line)-1, in)) { + log_err("autotrust check failed, extra lines in %s after %d", + name, lineno); + do { + fprintf(stderr, "file has: %s", line); + } while(fgets(line, (int)sizeof(line)-1, in)); + oke = 0; + } + fclose(in); + if(!oke) + fatal_exit("autotrust_check STEP %d failed", mom->time_step); + log_info("autotrust %s is OK", mom->autotrust_id); +} + +/** check tempfile file contents */ +static void +tempfile_check(struct replay_runtime* runtime, struct replay_moment* mom) +{ + char name[1024], line[1024]; + FILE *in; + int lineno = 0, oke=1; + char* expanded; + struct config_strlist* p; + line[sizeof(line)-1] = 0; + log_assert(mom->autotrust_id); + fake_temp_file("_temp_", mom->autotrust_id, name, sizeof(name)); + in = fopen(name, "r"); + if(!in) fatal_exit("could not open %s: %s", name, strerror(errno)); + for(p=mom->file_content; p; p=p->next) { + lineno++; + if(!fgets(line, (int)sizeof(line)-1, in)) { + log_err("tempfile check failed, could not read line"); + log_err("file %s, line %d", name, lineno); + log_err("should be: %s", p->str); + fatal_exit("tempfile_check failed"); + } + if(line[0]) line[strlen(line)-1] = 0; /* remove newline */ + expanded = macro_process(runtime->vars, runtime, p->str); + if(!expanded) + fatal_exit("could not expand macro line %d", lineno); + if(verbosity >= 7 && strcmp(p->str, expanded) != 0) + log_info("expanded '%s' to '%s'", p->str, expanded); + if(strcmp(expanded, line) != 0) { + log_err("mismatch in file %s, line %d", name, lineno); + log_err("file has : %s", line); + log_err("should be: %s", expanded); + free(expanded); + oke = 0; + continue; + } + free(expanded); + fprintf(stderr, "%s:%2d ok : %s\n", name, lineno, line); + } + if(fgets(line, (int)sizeof(line)-1, in)) { + log_err("tempfile check failed, extra lines in %s after %d", + name, lineno); + do { + fprintf(stderr, "file has: %s", line); + } while(fgets(line, (int)sizeof(line)-1, in)); + oke = 0; + } + fclose(in); + if(!oke) + fatal_exit("tempfile_check STEP %d failed", mom->time_step); + log_info("tempfile %s is OK", mom->autotrust_id); +} + +/** Store RTT in infra cache */ +static void +do_infra_rtt(struct replay_runtime* runtime) +{ + struct replay_moment* now = runtime->now; + int rto; + size_t dplen = 0; + uint8_t* dp = sldns_str2wire_dname(now->variable, &dplen); + if(!dp) fatal_exit("cannot parse %s", now->variable); + rto = infra_rtt_update(runtime->infra, &now->addr, now->addrlen, + dp, dplen, LDNS_RR_TYPE_A, atoi(now->string), + -1, runtime->now_secs); + log_addr(0, "INFRA_RTT for", &now->addr, now->addrlen); + log_info("INFRA_RTT(%s roundtrip %d): rto of %d", now->variable, + atoi(now->string), rto); + if(rto == 0) fatal_exit("infra_rtt_update failed"); + free(dp); +} + +/** perform exponential backoff on the timeout */ +static void +expon_timeout_backoff(struct replay_runtime* runtime) +{ + struct fake_pending* p = runtime->pending_list; + int rtt, vs; + uint8_t edns_lame_known; + int last_rtt, rto; + if(!p) return; /* no pending packet to backoff */ + if(!infra_host(runtime->infra, &p->addr, p->addrlen, p->zone, + p->zonelen, runtime->now_secs, &vs, &edns_lame_known, &rtt)) + return; + last_rtt = rtt; + rto = infra_rtt_update(runtime->infra, &p->addr, p->addrlen, p->zone, + p->zonelen, p->qtype, -1, last_rtt, runtime->now_secs); + log_info("infra_rtt_update returned rto %d", rto); +} + +/** + * Advance to the next moment. + */ +static void +advance_moment(struct replay_runtime* runtime) +{ + if(!runtime->now) + runtime->now = runtime->scenario->mom_first; + else runtime->now = runtime->now->mom_next; +} + +/** + * Perform actions or checks determined by the moment. + * Also advances the time by one step. + * @param runtime: scenario runtime information. + */ +static void +do_moment_and_advance(struct replay_runtime* runtime) +{ + struct replay_moment* mom; + if(!runtime->now) { + advance_moment(runtime); + return; + } + log_info("testbound: do STEP %d %s", runtime->now->time_step, + repevt_string(runtime->now->evt_type)); + switch(runtime->now->evt_type) { + case repevt_nothing: + advance_moment(runtime); + break; + case repevt_front_query: + /* advance moment before doing the step, so that the next + moment which may check some result of the mom step + can catch those results. */ + mom = runtime->now; + advance_moment(runtime); + fake_front_query(runtime, mom); + break; + case repevt_front_reply: + if(runtime->answer_list) + log_err("testbound: There are unmatched answers."); + fatal_exit("testbound: query answer not matched"); + break; + case repevt_timeout: + mom = runtime->now; + advance_moment(runtime); + expon_timeout_backoff(runtime); + fake_pending_callback(runtime, mom, NETEVENT_TIMEOUT); + break; + case repevt_back_reply: + mom = runtime->now; + advance_moment(runtime); + fake_pending_callback(runtime, mom, NETEVENT_NOERROR); + break; + case repevt_back_query: + /* Back queries are matched when they are sent out. */ + log_err("No query matching the current moment was sent."); + fatal_exit("testbound: back query not matched"); + break; + case repevt_error: + mom = runtime->now; + advance_moment(runtime); + fake_pending_callback(runtime, mom, NETEVENT_CLOSED); + break; + case repevt_time_passes: + time_passes(runtime, runtime->now); + advance_moment(runtime); + break; + case repevt_autotrust_check: + autotrust_check(runtime, runtime->now); + advance_moment(runtime); + break; + case repevt_tempfile_check: + tempfile_check(runtime, runtime->now); + advance_moment(runtime); + break; + case repevt_assign: + moment_assign(runtime, runtime->now); + advance_moment(runtime); + break; + case repevt_traffic: + advance_moment(runtime); + break; + case repevt_infra_rtt: + do_infra_rtt(runtime); + advance_moment(runtime); + break; + default: + fatal_exit("testbound: unknown event type %d", + runtime->now->evt_type); + } +} + +/** run the scenario in event callbacks */ +static void +run_scenario(struct replay_runtime* runtime) +{ + struct entry* entry = NULL; + struct fake_pending* pending = NULL; + int max_rounds = 5000; + int rounds = 0; + runtime->now = runtime->scenario->mom_first; + log_info("testbound: entering fake runloop"); + do { + /* if moment matches pending query do it. */ + /* else if moment matches given answer, do it */ *** 1053 LINES SKIPPED *** From owner-dev-commits-src-branches@freebsd.org Thu Jun 3 01:00:01 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4702F64F61F; Thu, 3 Jun 2021 01:00:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FwSH51Jwyz3KnH; Thu, 3 Jun 2021 01:00:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 10A7C207DC; Thu, 3 Jun 2021 01:00:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 153101cl022518; Thu, 3 Jun 2021 01:00:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 153100Xi022208; Thu, 3 Jun 2021 01:00:00 GMT (envelope-from git) Date: Thu, 3 Jun 2021 01:00:00 GMT Message-Id: <202106030100.153100Xi022208@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: c1f4b179fee7 - stable/11 - MFV d60fa10fd872db7e3d8cb1e161cfdae026c43b14: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/11 X-Git-Reftype: branch X-Git-Commit: c1f4b179fee705bc884d5bda381efcabfef106da Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jun 2021 01:00:01 -0000 The branch stable/11 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=c1f4b179fee705bc884d5bda381efcabfef106da commit c1f4b179fee705bc884d5bda381efcabfef106da Author: Cy Schubert AuthorDate: 2021-02-10 04:25:05 +0000 Commit: Cy Schubert CommitDate: 2021-06-01 19:26:12 +0000 MFV d60fa10fd872db7e3d8cb1e161cfdae026c43b14: Update unbound 1.13.0 --> 1.13.1. Includes numerous bugfixes documented at: https://www.nlnetlabs.nl/projects/unbound/download/#unbound-1-13-1 (cherry picked from commit f44e67d120ad78ef7894241b519ee79fd190a16e) --- contrib/unbound/Makefile.in | 516 ++++++++++++--------- contrib/unbound/aclocal.m4 | 8 +- contrib/unbound/acx_nlnetlabs.m4 | 60 ++- contrib/unbound/acx_python.m4 | 6 +- contrib/unbound/cachedb/cachedb.c | 1 + contrib/unbound/config.guess | 20 +- contrib/unbound/config.h.in | 3 +- contrib/unbound/config.sub | 20 +- contrib/unbound/configure | 137 +++--- contrib/unbound/configure.ac | 197 ++++---- .../contrib/build-unbound-localzone-from-hosts.pl | 0 .../unbound/contrib/create_unbound_ad_servers.sh | 0 contrib/unbound/contrib/parseunbound.pl | 0 contrib/unbound/contrib/unbound_cache.sh | 0 contrib/unbound/contrib/warmup.sh | 0 contrib/unbound/daemon/remote.c | 55 +++ contrib/unbound/daemon/worker.c | 22 +- contrib/unbound/dns64/dns64.c | 43 +- contrib/unbound/dnscrypt/dnscrypt.m4 | 2 +- contrib/unbound/dnstap/dnstap.m4 | 2 +- contrib/unbound/dnstap/unbound-dnstap-socket.c | 9 +- contrib/unbound/doc/Changelog | 131 +++++- contrib/unbound/doc/FEATURES | 1 + contrib/unbound/doc/README | 2 +- contrib/unbound/doc/TODO | 1 - contrib/unbound/doc/example.conf.in | 32 +- contrib/unbound/doc/libunbound.3.in | 4 +- contrib/unbound/doc/unbound-anchor.8.in | 2 +- contrib/unbound/doc/unbound-checkconf.8.in | 2 +- contrib/unbound/doc/unbound-control.8.in | 8 +- contrib/unbound/doc/unbound-host.1.in | 2 +- contrib/unbound/doc/unbound.8.in | 4 +- contrib/unbound/doc/unbound.conf.5.in | 60 ++- contrib/unbound/doc/unbound.doxygen | 6 +- contrib/unbound/dynlibmod/dynlibmod.c | 20 +- contrib/unbound/dynlibmod/dynlibmod.h | 4 +- contrib/unbound/dynlibmod/examples/helloworld.c | 14 +- contrib/unbound/ipset/ipset.c | 0 contrib/unbound/ipset/ipset.h | 0 contrib/unbound/libunbound/libworker.c | 4 + contrib/unbound/ltmain.sh | 0 contrib/unbound/respip/respip.c | 2 +- contrib/unbound/services/authzone.c | 17 +- contrib/unbound/services/cache/rrset.c | 2 + contrib/unbound/services/listen_dnsport.c | 14 +- contrib/unbound/services/listen_dnsport.h | 2 +- contrib/unbound/services/localzone.c | 107 ++++- contrib/unbound/services/localzone.h | 7 + contrib/unbound/services/mesh.c | 38 +- contrib/unbound/services/outside_network.c | 77 ++- contrib/unbound/services/outside_network.h | 2 + contrib/unbound/services/rpz.c | 21 +- contrib/unbound/services/rpz.h | 13 + contrib/unbound/smallapp/unbound-anchor.c | 67 +-- contrib/unbound/smallapp/unbound-control.c | 105 ++++- contrib/unbound/smallapp/worker_cb.c | 3 + contrib/unbound/util/config_file.c | 71 ++- contrib/unbound/util/config_file.h | 27 ++ contrib/unbound/util/configlexer.lex | 6 + contrib/unbound/util/configparser.y | 87 +++- contrib/unbound/util/configyyrename.h | 6 + contrib/unbound/util/data/msgencode.c | 63 ++- contrib/unbound/util/data/msgparse.c | 2 + contrib/unbound/util/data/msgparse.h | 4 + contrib/unbound/util/data/msgreply.c | 36 +- contrib/unbound/util/data/msgreply.h | 20 +- contrib/unbound/util/data/packed_rrset.c | 17 +- contrib/unbound/util/data/packed_rrset.h | 3 + contrib/unbound/util/edns.c | 16 + contrib/unbound/util/iana_ports.inc | 2 +- contrib/unbound/util/module.h | 4 +- contrib/unbound/util/net_help.c | 2 +- contrib/unbound/util/netevent.c | 122 ++++- contrib/unbound/util/netevent.h | 12 + contrib/unbound/util/storage/lruhash.c | 4 +- contrib/unbound/validator/autotrust.c | 1 + usr.sbin/unbound/config.h | 6 +- 77 files changed, 1700 insertions(+), 686 deletions(-) diff --git a/contrib/unbound/Makefile.in b/contrib/unbound/Makefile.in index d2600e71f0cf..6809881b6a95 100644 --- a/contrib/unbound/Makefile.in +++ b/contrib/unbound/Makefile.in @@ -248,6 +248,7 @@ DNSTAP_SOCKET_SRC=dnstap/unbound-dnstap-socket.c DNSTAP_SOCKET_OBJ=unbound-dnstap-socket.lo DNSTAP_SOCKET_OBJ_LINK=$(DNSTAP_SOCKET_OBJ) $(COMMON_OBJ) \ $(COMPAT_OBJ) $(SLDNS_OBJ) +DNSTAP_SOCKET_TESTBIN=@DNSTAP_SOCKET_TESTBIN@ LIBUNBOUND_SRC=libunbound/context.c libunbound/libunbound.c \ libunbound/libworker.c LIBUNBOUND_OBJ=context.lo libunbound.lo libworker.lo ub_event_pluggable.lo @@ -323,7 +324,7 @@ rsrc_unbound_checkconf.o: $(srcdir)/winrc/rsrc_unbound_checkconf.rc config.h TEST_BIN=asynclook$(EXEEXT) delayer$(EXEEXT) \ lock-verify$(EXEEXT) memstats$(EXEEXT) perf$(EXEEXT) \ petal$(EXEEXT) pktview$(EXEEXT) streamtcp$(EXEEXT) \ - unbound-dnstap-socket$(EXEEXT) dohclient$(EXEEXT) \ + $(DNSTAP_SOCKET_TESTBIN) dohclient$(EXEEXT) \ testbound$(EXEEXT) unittest$(EXEEXT) tests: all $(TEST_BIN) @@ -349,10 +350,10 @@ unbound$(EXEEXT): $(DAEMON_OBJ_LINK) libunbound.la $(LINK) -o $@ $(DAEMON_OBJ_LINK) $(EXTRALINK) $(SSLLIB) $(LIBS) $(DYNLIBMOD_EXTRALIBS) unbound-checkconf$(EXEEXT): $(CHECKCONF_OBJ_LINK) libunbound.la - $(LINK) -o $@ $(CHECKCONF_OBJ_LINK) $(EXTRALINK) $(SSLLIB) $(LIBS) $(DYNLIBMOD_EXTRALIBS) + $(LINK) -o $@ $(CHECKCONF_OBJ_LINK) $(EXTRALINK) $(SSLLIB) $(LIBS) unbound-control$(EXEEXT): $(CONTROL_OBJ_LINK) libunbound.la - $(LINK) -o $@ $(CONTROL_OBJ_LINK) $(EXTRALINK) $(SSLLIB) $(LIBS) $(DYNLIBMOD_EXTRALIBS) + $(LINK) -o $@ $(CONTROL_OBJ_LINK) $(EXTRALINK) $(SSLLIB) $(LIBS) unbound-host$(EXEEXT): $(HOST_OBJ_LINK) libunbound.la $(LINK) -o $@ $(HOST_OBJ_LINK) -L. -L.libs -lunbound $(SSLLIB) $(LIBS) @@ -370,37 +371,37 @@ anchor-update$(EXEEXT): $(ANCHORUPD_OBJ_LINK) libunbound.la $(LINK) -o $@ $(ANCHORUPD_OBJ_LINK) -L. -L.libs -lunbound $(LIBS) unittest$(EXEEXT): $(UNITTEST_OBJ_LINK) - $(LINK) -o $@ $(UNITTEST_OBJ_LINK) $(SSLLIB) $(LIBS) $(DYNLIBMOD_EXTRALIBS) + $(LINK) -o $@ $(UNITTEST_OBJ_LINK) $(SSLLIB) $(LIBS) testbound$(EXEEXT): $(TESTBOUND_OBJ_LINK) - $(LINK) -o $@ $(TESTBOUND_OBJ_LINK) $(SSLLIB) $(LIBS) $(DYNLIBMOD_EXTRALIBS) + $(LINK) -o $@ $(TESTBOUND_OBJ_LINK) $(SSLLIB) $(LIBS) lock-verify$(EXEEXT): $(LOCKVERIFY_OBJ_LINK) - $(LINK) -o $@ $(LOCKVERIFY_OBJ_LINK) $(SSLLIB) $(LIBS) $(DYNLIBMOD_EXTRALIBS) + $(LINK) -o $@ $(LOCKVERIFY_OBJ_LINK) $(SSLLIB) $(LIBS) petal$(EXEEXT): $(PETAL_OBJ_LINK) $(LINK) -o $@ $(PETAL_OBJ_LINK) $(SSLLIB) $(LIBS) pktview$(EXEEXT): $(PKTVIEW_OBJ_LINK) - $(LINK) -o $@ $(PKTVIEW_OBJ_LINK) $(SSLLIB) $(LIBS) $(DYNLIBMOD_EXTRALIBS) + $(LINK) -o $@ $(PKTVIEW_OBJ_LINK) $(SSLLIB) $(LIBS) memstats$(EXEEXT): $(MEMSTATS_OBJ_LINK) - $(LINK) -o $@ $(MEMSTATS_OBJ_LINK) $(SSLLIB) $(LIBS) $(DYNLIBMOD_EXTRALIBS) + $(LINK) -o $@ $(MEMSTATS_OBJ_LINK) $(SSLLIB) $(LIBS) asynclook$(EXEEXT): $(ASYNCLOOK_OBJ_LINK) libunbound.la $(LINK) -o $@ $(ASYNCLOOK_OBJ_LINK) -L. -L.libs -lunbound $(SSLLIB) $(LIBS) streamtcp$(EXEEXT): $(STREAMTCP_OBJ_LINK) - $(LINK) -o $@ $(STREAMTCP_OBJ_LINK) $(SSLLIB) $(LIBS) $(DYNLIBMOD_EXTRALIBS) + $(LINK) -o $@ $(STREAMTCP_OBJ_LINK) $(SSLLIB) $(LIBS) dohclient$(EXEEXT): $(DOHCLIENT_OBJ_LINK) - $(LINK) -o $@ $(DOHCLIENT_OBJ_LINK) $(SSLLIB) $(LIBS) $(DYNLIBMOD_EXTRALIBS) + $(LINK) -o $@ $(DOHCLIENT_OBJ_LINK) $(SSLLIB) $(LIBS) perf$(EXEEXT): $(PERF_OBJ_LINK) - $(LINK) -o $@ $(PERF_OBJ_LINK) $(SSLLIB) $(LIBS) $(DYNLIBMOD_EXTRALIBS) + $(LINK) -o $@ $(PERF_OBJ_LINK) $(SSLLIB) $(LIBS) delayer$(EXEEXT): $(DELAYER_OBJ_LINK) - $(LINK) -o $@ $(DELAYER_OBJ_LINK) $(SSLLIB) $(LIBS) $(DYNLIBMOD_EXTRALIBS) + $(LINK) -o $@ $(DELAYER_OBJ_LINK) $(SSLLIB) $(LIBS) signit$(EXEEXT): testcode/signit.c $(CC) $(CPPFLAGS) $(CFLAGS) @PTHREAD_CFLAGS_ONLY@ -o $@ testcode/signit.c $(LDFLAGS) -lldns $(SSLLIB) $(LIBS) @@ -423,12 +424,13 @@ dnstap/dnstap.pb-c.c dnstap/dnstap.pb-c.h: $(srcdir)/dnstap/dnstap.proto $(PROTOC_C) --c_out=. --proto_path=$(srcdir) $(srcdir)/dnstap/dnstap.proto unbound-dnstap-socket$(EXEEXT): $(DNSTAP_SOCKET_OBJ_LINK) - $(LINK) -o $@ $(DNSTAP_SOCKET_OBJ_LINK) $(SSLLIB) $(LIBS) $(DYNLIBMOD_EXTRALIBS) + $(LINK) -o $@ $(DNSTAP_SOCKET_OBJ_LINK) $(SSLLIB) $(LIBS) dnstap.pb-c.lo dnstap.pb-c.o: dnstap/dnstap.pb-c.c dnstap/dnstap.pb-c.h dtstream.lo dtstream.o: $(srcdir)/dnstap/dtstream.c config.h $(srcdir)/dnstap/dtstream.h dnstap_fstrm.lo dnstap_fstrm.o: $(srcdir)/dnstap/dnstap_fstrm.c config.h $(srcdir)/dnstap/dnstap_fstrm.h unbound-dnstap-socket.lo unbound-dnstap-socket.o: $(srcdir)/dnstap/unbound-dnstap-socket.c config.h $(srcdir)/dnstap/dtstream.h +dynlibmod.lo dynlibdmod.o: $(srcdir)/dynlibmod/dynlibmod.c config.h $(srcdir)/dynlibmod/dynlibmod.h # dnscrypt dnscrypt.lo dnscrypt.o: $(srcdir)/dnscrypt/dnscrypt.c config.h \ @@ -826,13 +828,16 @@ modstack.lo modstack.o: $(srcdir)/services/modstack.c config.h $(srcdir)/service $(srcdir)/util/module.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/netevent.h \ - $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/dnscrypt/cert.h \ - $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h $(srcdir)/dns64/dns64.h \ - $(srcdir)/iterator/iterator.h $(srcdir)/services/outbound_list.h $(srcdir)/validator/validator.h \ - $(srcdir)/validator/val_utils.h $(srcdir)/respip/respip.h $(srcdir)/services/localzone.h \ - $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h $(PYTHONMOD_HEADER) $(srcdir)/ipsecmod/ipsecmod.h \ - $(srcdir)/util/storage/slabhash.h $(srcdir)/edns-subnet/addrtree.h $(srcdir)/edns-subnet/edns-subnet.h \ - $(srcdir)/ipset/ipset.h $(srcdir)/dynlibmod/dynlibmod.h + $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/util/tube.h \ + $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h \ + $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h \ + $(srcdir)/util/config_file.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \ + $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h $(srcdir)/dns64/dns64.h $(srcdir)/iterator/iterator.h \ + $(srcdir)/services/outbound_list.h $(srcdir)/validator/validator.h $(srcdir)/validator/val_utils.h \ + $(PYTHONMOD_HEADER) $(DYNLIBMOD_HEADER) $(srcdir)/cachedb/cachedb.h \ + $(srcdir)/ipsecmod/ipsecmod.h $(srcdir)/edns-subnet/subnetmod.h $(srcdir)/util/alloc.h $(srcdir)/util/net_help.h \ + $(srcdir)/util/storage/slabhash.h $(srcdir)/util/data/dname.h $(srcdir)/edns-subnet/addrtree.h \ + $(srcdir)/edns-subnet/edns-subnet.h $(srcdir)/ipset/ipset.h view.lo view.o: $(srcdir)/services/view.c config.h $(srcdir)/services/view.h $(srcdir)/util/rbtree.h \ $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/services/localzone.h $(srcdir)/util/storage/dnstree.h \ $(srcdir)/util/module.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/data/msgreply.h \ @@ -863,7 +868,8 @@ outside_network.lo outside_network.o: $(srcdir)/services/outside_network.c confi $(srcdir)/services/mesh.h $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h \ $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h $(srcdir)/util/config_file.h $(srcdir)/services/authzone.h \ $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h \ - $(srcdir)/dnstap/dnstap.h + $(srcdir)/util/edns.h $(srcdir)/dnstap/dnstap.h \ + alloc.lo alloc.o: $(srcdir)/util/alloc.c config.h $(srcdir)/util/alloc.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ $(srcdir)/util/regional.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \ $(srcdir)/util/fptr_wlist.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ @@ -884,7 +890,8 @@ config_file.lo config_file.o: $(srcdir)/util/config_file.c config.h $(srcdir)/ut $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h \ $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h $(srcdir)/util/data/dname.h \ $(srcdir)/util/rtt.h $(srcdir)/services/cache/infra.h $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/parseutil.h \ - $(srcdir)/iterator/iterator.h $(srcdir)/services/outbound_list.h $(srcdir)/util/iana_ports.inc + $(srcdir)/iterator/iterator.h $(srcdir)/services/outbound_list.h $(srcdir)/edns-subnet/edns-subnet.h \ + $(srcdir)/util/iana_ports.inc configlexer.lo configlexer.o: util/configlexer.c config.h $(srcdir)/util/configyyrename.h \ $(srcdir)/util/config_file.h util/configparser.h configparser.lo configparser.o: util/configparser.c config.h $(srcdir)/util/configyyrename.h \ @@ -913,38 +920,31 @@ authzone.lo authzone.o: $(srcdir)/services/authzone.c config.h $(srcdir)/service $(srcdir)/util/data/msgencode.h $(srcdir)/util/regional.h $(srcdir)/util/net_help.h $(srcdir)/util/random.h \ $(srcdir)/services/cache/dns.h $(srcdir)/services/outside_network.h \ $(srcdir)/services/listen_dnsport.h $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/wire2str.h \ - $(srcdir)/sldns/parseutil.h $(srcdir)/sldns/keyraw.h $(srcdir)/validator/val_nsec3.h \ - $(srcdir)/validator/val_secalgo.h + $(srcdir)/sldns/parseutil.h $(srcdir)/sldns/keyraw.h \ + $(srcdir)/validator/val_nsec3.h $(srcdir)/validator/val_secalgo.h fptr_wlist.lo fptr_wlist.o: $(srcdir)/util/fptr_wlist.c config.h $(srcdir)/util/fptr_wlist.h \ $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/storage/lruhash.h \ - $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \ - $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h \ - $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h $(srcdir)/util/mini_event.h \ - $(srcdir)/services/outside_network.h $(srcdir)/services/localzone.h \ - $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h $(srcdir)/services/authzone.h \ - $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h $(srcdir)/services/cache/rrset.h \ - $(srcdir)/util/storage/slabhash.h $(srcdir)/dns64/dns64.h $(srcdir)/iterator/iterator.h \ - $(srcdir)/services/outbound_list.h $(srcdir)/iterator/iter_fwd.h $(srcdir)/validator/validator.h \ - $(srcdir)/validator/val_utils.h $(srcdir)/validator/val_anchor.h $(srcdir)/validator/val_nsec3.h \ - $(srcdir)/validator/val_sigcrypt.h $(srcdir)/validator/val_kentry.h $(srcdir)/validator/val_neg.h \ - $(srcdir)/validator/autotrust.h $(srcdir)/libunbound/libworker.h $(srcdir)/libunbound/context.h \ - $(srcdir)/util/alloc.h $(srcdir)/libunbound/unbound.h $(srcdir)/libunbound/unbound-event.h \ - $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h $(srcdir)/util/config_file.h $(srcdir)/respip/respip.h \ - $(PYTHONMOD_HEADER) $(srcdir)/ipsecmod/ipsecmod.h $(srcdir)/edns-subnet/subnetmod.h $(srcdir)/util/net_help.h \ - $(srcdir)/edns-subnet/addrtree.h $(srcdir)/edns-subnet/edns-subnet.h $(srcdir)/ipset/ipset.h \ - $(srcdir)/dynlibmod/dynlibmod.h + $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/module.h \ + $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ + $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h \ + $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h \ + $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h \ + $(srcdir)/util/config_file.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \ + $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h $(srcdir)/util/mini_event.h \ + $(srcdir)/services/outside_network.h $(srcdir)/services/cache/infra.h \ + $(srcdir)/util/rtt.h $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h $(srcdir)/dns64/dns64.h \ + $(srcdir)/iterator/iterator.h $(srcdir)/services/outbound_list.h $(srcdir)/iterator/iter_fwd.h \ + $(srcdir)/validator/validator.h $(srcdir)/validator/val_utils.h $(srcdir)/validator/val_anchor.h \ + $(srcdir)/validator/val_nsec3.h $(srcdir)/validator/val_sigcrypt.h $(srcdir)/validator/val_kentry.h \ + $(srcdir)/validator/val_neg.h $(srcdir)/validator/autotrust.h $(srcdir)/libunbound/libworker.h \ + $(srcdir)/libunbound/context.h $(srcdir)/util/alloc.h $(srcdir)/libunbound/unbound-event.h \ + $(srcdir)/libunbound/worker.h $(PYTHONMOD_HEADER) $(DYNLIBMOD_HEADER) \ + $(srcdir)/cachedb/cachedb.h $(srcdir)/ipsecmod/ipsecmod.h $(srcdir)/edns-subnet/subnetmod.h \ + $(srcdir)/util/net_help.h $(srcdir)/util/data/dname.h $(srcdir)/edns-subnet/addrtree.h \ + $(srcdir)/edns-subnet/edns-subnet.h $(srcdir)/ipset/ipset.h $(srcdir)/dnstap/dtstream.h locks.lo locks.o: $(srcdir)/util/locks.c config.h $(srcdir)/util/locks.h $(srcdir)/util/log.h log.lo log.o: $(srcdir)/util/log.c config.h $(srcdir)/util/log.h $(srcdir)/util/locks.h $(srcdir)/sldns/sbuffer.h -mini_event.lo mini_event.o: $(srcdir)/util/mini_event.c config.h $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h \ - $(srcdir)/util/fptr_wlist.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h \ - $(srcdir)/util/log.h $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \ - $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h \ - $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h \ - $(srcdir)/services/localzone.h $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h \ - $(srcdir)/sldns/sbuffer.h $(srcdir)/util/config_file.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h \ - $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h +mini_event.lo mini_event.o: $(srcdir)/util/mini_event.c config.h $(srcdir)/util/mini_event.h module.lo module.o: $(srcdir)/util/module.c config.h $(srcdir)/util/module.h $(srcdir)/util/storage/lruhash.h \ $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \ $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/wire2str.h @@ -957,12 +957,14 @@ netevent.lo netevent.o: $(srcdir)/util/netevent.c config.h $(srcdir)/util/neteve $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h $(srcdir)/services/view.h \ $(srcdir)/sldns/sbuffer.h $(srcdir)/util/config_file.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h \ $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h $(srcdir)/sldns/str2wire.h \ - $(srcdir)/dnstap/dnstap.h $(srcdir)/services/listen_dnsport.h + $(srcdir)/dnstap/dnstap.h $(srcdir)/services/listen_dnsport.h \ + net_help.lo net_help.o: $(srcdir)/util/net_help.c config.h $(srcdir)/util/net_help.h $(srcdir)/util/log.h \ $(srcdir)/util/data/dname.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/module.h \ $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/regional.h $(srcdir)/util/config_file.h \ - $(srcdir)/sldns/parseutil.h $(srcdir)/sldns/wire2str.h + $(srcdir)/sldns/parseutil.h $(srcdir)/sldns/wire2str.h \ + random.lo random.o: $(srcdir)/util/random.c config.h $(srcdir)/util/random.h $(srcdir)/util/log.h rbtree.lo rbtree.o: $(srcdir)/util/rbtree.c config.h $(srcdir)/util/log.h $(srcdir)/util/fptr_wlist.h \ $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ @@ -978,11 +980,11 @@ rtt.lo rtt.o: $(srcdir)/util/rtt.c config.h $(srcdir)/util/rtt.h $(srcdir)/itera $(srcdir)/services/outbound_list.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/storage/lruhash.h \ $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/module.h \ $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h -edns.lo edns.o: $(srcdir)/util/edns.c config.h $(srcdir)/util/edns.h $(srcdir)/util/config_file.h \ - $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/util/regional.h $(srcdir)/util/data/msgparse.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h \ - $(srcdir)/util/log.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/data/msgreply.h \ - $(srcdir)/util/data/packed_rrset.h +edns.lo edns.o: $(srcdir)/util/edns.c config.h $(srcdir)/util/edns.h $(srcdir)/util/storage/dnstree.h \ + $(srcdir)/util/rbtree.h $(srcdir)/util/config_file.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ + $(srcdir)/util/net_help.h $(srcdir)/util/log.h $(srcdir)/util/regional.h \ + $(srcdir)/util/data/msgparse.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/sldns/pkthdr.h \ + $(srcdir)/sldns/rrdef.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h dnstree.lo dnstree.o: $(srcdir)/util/storage/dnstree.c config.h $(srcdir)/util/storage/dnstree.h \ $(srcdir)/util/rbtree.h $(srcdir)/util/data/dname.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h \ $(srcdir)/util/log.h $(srcdir)/util/net_help.h @@ -1016,7 +1018,8 @@ tube.lo tube.o: $(srcdir)/util/tube.c config.h $(srcdir)/util/tube.h $(srcdir)/u $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h $(srcdir)/util/ub_event.h ub_event.lo ub_event.o: $(srcdir)/util/ub_event.c config.h $(srcdir)/util/ub_event.h $(srcdir)/util/log.h \ $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/util/tube.h $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h + $(srcdir)/util/tube.h \ + ub_event_pluggable.lo ub_event_pluggable.o: $(srcdir)/util/ub_event_pluggable.c config.h $(srcdir)/util/ub_event.h \ $(srcdir)/libunbound/unbound-event.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ $(srcdir)/util/log.h $(srcdir)/util/fptr_wlist.h \ @@ -1026,7 +1029,8 @@ ub_event_pluggable.lo ub_event_pluggable.o: $(srcdir)/util/ub_event_pluggable.c $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h \ $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h \ $(srcdir)/util/config_file.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \ - $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h + $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h \ + winsock_event.lo winsock_event.o: $(srcdir)/util/winsock_event.c config.h autotrust.lo autotrust.o: $(srcdir)/validator/autotrust.c config.h $(srcdir)/validator/autotrust.h \ $(srcdir)/util/rbtree.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \ @@ -1039,7 +1043,8 @@ autotrust.lo autotrust.o: $(srcdir)/validator/autotrust.c config.h $(srcdir)/val $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h \ $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h \ $(srcdir)/respip/respip.h $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h \ - $(srcdir)/validator/val_kcache.h $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/keyraw.h + $(srcdir)/validator/val_kcache.h $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/keyraw.h \ + val_anchor.lo val_anchor.o: $(srcdir)/validator/val_anchor.c config.h $(srcdir)/validator/val_anchor.h \ $(srcdir)/util/rbtree.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/validator/val_sigcrypt.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/sldns/pkthdr.h \ @@ -1069,11 +1074,13 @@ val_kcache.lo val_kcache.o: $(srcdir)/validator/val_kcache.c config.h $(srcdir)/ val_kentry.lo val_kentry.o: $(srcdir)/validator/val_kentry.c config.h $(srcdir)/validator/val_kentry.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/data/packed_rrset.h \ $(srcdir)/util/data/dname.h $(srcdir)/util/storage/lookup3.h $(srcdir)/util/regional.h $(srcdir)/util/net_help.h \ - $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/keyraw.h -val_neg.lo val_neg.o: $(srcdir)/validator/val_neg.c config.h $(srcdir)/validator/val_neg.h $(srcdir)/util/locks.h \ - $(srcdir)/util/log.h $(srcdir)/util/rbtree.h $(srcdir)/validator/val_nsec.h $(srcdir)/util/data/packed_rrset.h \ - $(srcdir)/util/storage/lruhash.h $(srcdir)/validator/val_nsec3.h $(srcdir)/validator/val_utils.h \ - $(srcdir)/sldns/pkthdr.h $(srcdir)/util/data/dname.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/net_help.h \ + $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/keyraw.h \ + +val_neg.lo val_neg.o: $(srcdir)/validator/val_neg.c config.h \ + $(srcdir)/validator/val_neg.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/rbtree.h \ + $(srcdir)/validator/val_nsec.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \ + $(srcdir)/validator/val_nsec3.h $(srcdir)/validator/val_utils.h $(srcdir)/sldns/pkthdr.h \ + $(srcdir)/util/data/dname.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/net_help.h \ $(srcdir)/util/config_file.h $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h \ $(srcdir)/services/cache/dns.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/sbuffer.h val_nsec3.lo val_nsec3.o: $(srcdir)/validator/val_nsec3.c config.h $(srcdir)/validator/val_nsec3.h \ @@ -1091,15 +1098,17 @@ val_nsec.lo val_nsec.o: $(srcdir)/validator/val_nsec.c config.h $(srcdir)/valida val_secalgo.lo val_secalgo.o: $(srcdir)/validator/val_secalgo.c config.h $(srcdir)/util/data/packed_rrset.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/validator/val_secalgo.h \ $(srcdir)/validator/val_nsec3.h $(srcdir)/util/rbtree.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/keyraw.h \ - $(srcdir)/sldns/sbuffer.h + $(srcdir)/sldns/sbuffer.h \ + val_sigcrypt.lo val_sigcrypt.o: $(srcdir)/validator/val_sigcrypt.c config.h \ $(srcdir)/validator/val_sigcrypt.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \ $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/sldns/pkthdr.h $(srcdir)/validator/val_secalgo.h \ $(srcdir)/validator/validator.h $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h \ $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/rrdef.h $(srcdir)/validator/val_utils.h \ $(srcdir)/util/data/dname.h $(srcdir)/util/rbtree.h $(srcdir)/util/net_help.h $(srcdir)/util/regional.h \ - $(srcdir)/util/config_file.h $(srcdir)/sldns/keyraw.h $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/parseutil.h \ - $(srcdir)/sldns/wire2str.h + $(srcdir)/util/config_file.h $(srcdir)/sldns/keyraw.h \ + $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/parseutil.h $(srcdir)/sldns/wire2str.h \ + val_utils.lo val_utils.o: $(srcdir)/validator/val_utils.c config.h $(srcdir)/validator/val_utils.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ $(srcdir)/sldns/pkthdr.h $(srcdir)/validator/validator.h $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h \ @@ -1120,15 +1129,43 @@ dns64.lo dns64.o: $(srcdir)/dns64/dns64.c config.h $(srcdir)/dns64/dns64.h $(src $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h \ $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h $(srcdir)/util/net_help.h \ $(srcdir)/util/regional.h $(srcdir)/util/data/dname.h $(srcdir)/sldns/str2wire.h -edns-subnet.lo edns-subnet.o: $(srcdir)/edns-subnet/edns-subnet.c config.h -subnetmod.lo subnetmod.o: $(srcdir)/edns-subnet/subnetmod.c config.h +edns-subnet.lo edns-subnet.o: $(srcdir)/edns-subnet/edns-subnet.c config.h \ + $(srcdir)/edns-subnet/edns-subnet.h $(srcdir)/util/net_help.h $(srcdir)/util/log.h +subnetmod.lo subnetmod.o: $(srcdir)/edns-subnet/subnetmod.c config.h $(srcdir)/edns-subnet/subnetmod.h \ + $(srcdir)/util/module.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ + $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ + $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/services/outbound_list.h $(srcdir)/util/alloc.h \ + $(srcdir)/util/net_help.h $(srcdir)/util/storage/slabhash.h $(srcdir)/util/data/dname.h \ + $(srcdir)/edns-subnet/addrtree.h $(srcdir)/edns-subnet/edns-subnet.h \ + $(srcdir)/edns-subnet/subnet-whitelist.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h \ + $(srcdir)/services/mesh.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ + $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h \ + $(srcdir)/services/localzone.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h $(srcdir)/util/config_file.h \ + $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h \ + $(srcdir)/respip/respip.h $(srcdir)/services/cache/dns.h $(srcdir)/util/regional.h \ + $(srcdir)/iterator/iter_utils.h $(srcdir)/iterator/iter_resptype.h addrtree.lo addrtree.o: $(srcdir)/edns-subnet/addrtree.c config.h $(srcdir)/util/log.h \ $(srcdir)/util/data/msgreply.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/module.h $(srcdir)/util/data/msgparse.h \ $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/edns-subnet/addrtree.h -subnet-whitelist.lo subnet-whitelist.o: $(srcdir)/edns-subnet/subnet-whitelist.c config.h -cachedb.lo cachedb.o: $(srcdir)/cachedb/cachedb.c config.h -redis.lo redis.o: $(srcdir)/cachedb/redis.c config.h +subnet-whitelist.lo subnet-whitelist.o: $(srcdir)/edns-subnet/subnet-whitelist.c config.h \ + $(srcdir)/edns-subnet/edns-subnet.h $(srcdir)/util/net_help.h $(srcdir)/util/log.h \ + $(srcdir)/edns-subnet/subnet-whitelist.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h \ + $(srcdir)/util/regional.h $(srcdir)/util/config_file.h $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/rrdef.h \ + $(srcdir)/util/data/dname.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h +cachedb.lo cachedb.o: $(srcdir)/cachedb/cachedb.c config.h $(srcdir)/cachedb/cachedb.h $(srcdir)/util/module.h \ + $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/data/msgreply.h \ + $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ + $(srcdir)/sldns/rrdef.h $(srcdir)/cachedb/redis.h $(srcdir)/util/regional.h $(srcdir)/util/net_help.h \ + $(srcdir)/util/config_file.h $(srcdir)/util/data/msgencode.h $(srcdir)/services/cache/dns.h \ + $(srcdir)/validator/val_neg.h $(srcdir)/util/rbtree.h $(srcdir)/validator/val_secalgo.h \ + $(srcdir)/iterator/iter_utils.h $(srcdir)/iterator/iter_resptype.h $(srcdir)/sldns/parseutil.h \ + $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/sbuffer.h +redis.lo redis.o: $(srcdir)/cachedb/redis.c config.h $(srcdir)/cachedb/redis.h $(srcdir)/cachedb/cachedb.h \ + $(srcdir)/util/module.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ + $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ + $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/alloc.h $(srcdir)/util/config_file.h \ + $(srcdir)/sldns/sbuffer.h respip.lo respip.o: $(srcdir)/respip/respip.c config.h $(srcdir)/services/localzone.h $(srcdir)/util/rbtree.h \ $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/module.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \ @@ -1143,31 +1180,40 @@ checklocks.lo checklocks.o: $(srcdir)/testcode/checklocks.c config.h $(srcdir)/u $(srcdir)/testcode/checklocks.h dnstap.lo dnstap.o: $(srcdir)/dnstap/dnstap.c config.h $(srcdir)/sldns/sbuffer.h \ $(srcdir)/util/config_file.h $(srcdir)/util/net_help.h $(srcdir)/util/log.h $(srcdir)/util/netevent.h \ - $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/dnscrypt/cert.h \ - $(srcdir)/util/locks.h $(srcdir)/dnstap/dnstap.h \ - dnstap/dnstap.pb-c.h + $(srcdir)/dnscrypt/dnscrypt.h \ + $(srcdir)/dnstap/dnstap.h \ + $(srcdir)/dnstap/dtstream.h $(srcdir)/util/locks.h dnstap/dnstap.pb-c.h dnstap.pb-c.lo dnstap.pb-c.o: dnstap/dnstap.pb-c.c dnstap/dnstap.pb-c.h \ -dynlibmod.lo dynlibmod.o: $(srcdir)/dynlibmod/dynlibmod.c config.h $(srcdir)/dynlibmod/dynlibmod.h \ +dnstap_fstrm.lo dnstap_fstrm.o: $(srcdir)/dnstap/dnstap_fstrm.c config.h $(srcdir)/dnstap/dnstap_fstrm.h \ + $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/wire2str.h +dtstream.lo dtstream.o: $(srcdir)/dnstap/dtstream.c config.h $(srcdir)/dnstap/dtstream.h $(srcdir)/util/locks.h \ + $(srcdir)/util/log.h $(srcdir)/dnstap/dnstap_fstrm.h $(srcdir)/util/config_file.h $(srcdir)/util/ub_event.h \ + $(srcdir)/util/net_help.h $(srcdir)/services/outside_network.h $(srcdir)/util/rbtree.h $(srcdir)/util/netevent.h \ + $(srcdir)/dnscrypt/dnscrypt.h \ + $(srcdir)/sldns/sbuffer.h \ + +ipsecmod.lo ipsecmod.o: $(srcdir)/ipsecmod/ipsecmod.c config.h $(srcdir)/ipsecmod/ipsecmod.h \ $(srcdir)/util/module.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ - $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/rbtree.h\ + $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/rbtree.h $(srcdir)/ipsecmod/ipsecmod-whitelist.h \ $(srcdir)/util/storage/dnstree.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/netevent.h \ $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/util/tube.h \ - $(srcdir)/services/mesh.h $(srcdir)/services/modstack.h $(srcdir)/util/regional.h $(srcdir)/util/net_help.h \ - $(srcdir)/util/config_file.h $(srcdir)/services/cache/dns.h $(srcdir)/sldns/wire2str.h -dnscrypt.lo dnscrypt.o: $(srcdir)/dnscrypt/dnscrypt.c config.h $(srcdir)/sldns/sbuffer.h \ - $(srcdir)/util/config_file.h $(srcdir)/util/net_help.h $(srcdir)/util/log.h $(srcdir)/util/netevent.h \ - $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/dnscrypt/cert.h \ - $(srcdir)/util/locks.h $(srcdir)/util/storage/slabhash.h $(srcdir)/util/storage/lruhash.h \ - $(srcdir)/util/storage/lookup3.h -ipsecmod.lo ipsecmod.o: $(srcdir)/ipsecmod/ipsecmod.c config.h + $(srcdir)/services/mesh.h $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h \ + $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h $(srcdir)/util/config_file.h $(srcdir)/services/authzone.h \ + $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h \ + $(srcdir)/util/regional.h $(srcdir)/util/net_help.h $(srcdir)/services/cache/dns.h $(srcdir)/sldns/wire2str.h +ipsecmod-whitelist.lo ipsecmod-whitelist.o: $(srcdir)/ipsecmod/ipsecmod-whitelist.c config.h \ + $(srcdir)/ipsecmod/ipsecmod.h $(srcdir)/util/module.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h \ + $(srcdir)/util/log.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \ + $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/rbtree.h \ + $(srcdir)/ipsecmod/ipsecmod-whitelist.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/regional.h \ + $(srcdir)/util/config_file.h $(srcdir)/util/data/dname.h $(srcdir)/sldns/str2wire.h ipset.lo ipset.o: $(srcdir)/ipset/ipset.c config.h $(srcdir)/ipset/ipset.h $(srcdir)/util/module.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/data/msgreply.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ - $(srcdir)/sldns/rrdef.h $(srcdir)/util/regional.h $(srcdir)/util/config_file.h $(srcdir)/services/cache/dns.h \ - $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/parseutil.h -ipsecmod-whitelist.lo ipsecmod-whitelist.o: $(srcdir)/ipsecmod/ipsecmod-whitelist.c config.h + $(srcdir)/sldns/rrdef.h $(srcdir)/util/regional.h $(srcdir)/util/net_help.h $(srcdir)/util/config_file.h \ + $(srcdir)/services/cache/dns.h $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/parseutil.h unitanchor.lo unitanchor.o: $(srcdir)/testcode/unitanchor.c config.h $(srcdir)/util/log.h $(srcdir)/util/data/dname.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/testcode/unitmain.h \ $(srcdir)/validator/val_anchor.h $(srcdir)/util/rbtree.h $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/rrdef.h @@ -1176,7 +1222,8 @@ unitdname.lo unitdname.o: $(srcdir)/testcode/unitdname.c config.h $(srcdir)/util $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/rrdef.h unitlruhash.lo unitlruhash.o: $(srcdir)/testcode/unitlruhash.c config.h $(srcdir)/testcode/unitmain.h \ $(srcdir)/util/log.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/storage/slabhash.h -unitmain.lo unitmain.o: $(srcdir)/testcode/unitmain.c config.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/keyraw.h \ +unitmain.lo unitmain.o: $(srcdir)/testcode/unitmain.c config.h \ + $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/keyraw.h \ $(srcdir)/util/log.h $(srcdir)/testcode/unitmain.h $(srcdir)/util/alloc.h $(srcdir)/util/locks.h $(srcdir)/util/net_help.h \ $(srcdir)/util/config_file.h $(srcdir)/util/rtt.h $(srcdir)/util/timehist.h $(srcdir)/iterator/iterator.h \ $(srcdir)/services/outbound_list.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/storage/lruhash.h \ @@ -1184,7 +1231,8 @@ unitmain.lo unitmain.o: $(srcdir)/testcode/unitmain.c config.h $(srcdir)/sldns/r $(srcdir)/sldns/pkthdr.h $(srcdir)/libunbound/unbound.h $(srcdir)/services/cache/infra.h \ $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ $(srcdir)/util/random.h $(srcdir)/respip/respip.h \ - $(srcdir)/services/localzone.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h + $(srcdir)/services/localzone.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h \ + $(srcdir)/services/outside_network.h unitmsgparse.lo unitmsgparse.o: $(srcdir)/testcode/unitmsgparse.c config.h $(srcdir)/util/log.h \ $(srcdir)/testcode/unitmain.h $(srcdir)/util/data/msgparse.h $(srcdir)/util/storage/lruhash.h \ $(srcdir)/util/locks.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/data/msgreply.h \ @@ -1216,7 +1264,13 @@ testpkts.lo testpkts.o: $(srcdir)/testcode/testpkts.c config.h $(srcdir)/testcod unitldns.lo unitldns.o: $(srcdir)/testcode/unitldns.c config.h $(srcdir)/util/log.h $(srcdir)/testcode/unitmain.h \ $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/wire2str.h \ $(srcdir)/sldns/parseutil.h -unitecs.lo unitecs.o: $(srcdir)/testcode/unitecs.c config.h +unitecs.lo unitecs.o: $(srcdir)/testcode/unitecs.c config.h $(srcdir)/util/log.h $(srcdir)/util/module.h \ + $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/data/msgreply.h \ + $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ + $(srcdir)/sldns/rrdef.h $(srcdir)/testcode/unitmain.h $(srcdir)/edns-subnet/addrtree.h \ + $(srcdir)/edns-subnet/subnetmod.h $(srcdir)/services/outbound_list.h $(srcdir)/util/alloc.h \ + $(srcdir)/util/net_help.h $(srcdir)/util/storage/slabhash.h $(srcdir)/util/data/dname.h \ + $(srcdir)/edns-subnet/edns-subnet.h unitauth.lo unitauth.o: $(srcdir)/testcode/unitauth.c config.h $(srcdir)/services/authzone.h \ $(srcdir)/util/rbtree.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/services/mesh.h $(srcdir)/util/netevent.h \ $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/util/data/msgparse.h \ @@ -1233,40 +1287,43 @@ acl_list.lo acl_list.o: $(srcdir)/daemon/acl_list.c config.h $(srcdir)/daemon/ac $(srcdir)/services/localzone.h $(srcdir)/util/module.h $(srcdir)/util/storage/lruhash.h \ $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/str2wire.h -cachedump.lo cachedump.o: $(srcdir)/daemon/cachedump.c config.h $(srcdir)/daemon/cachedump.h \ - $(srcdir)/daemon/remote.h $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h \ - $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ - $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/util/alloc.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ - $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h \ - $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h \ - $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h $(srcdir)/services/cache/dns.h \ - $(srcdir)/services/cache/infra.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/util/rtt.h \ - $(srcdir)/util/regional.h $(srcdir)/util/net_help.h $(srcdir)/util/data/dname.h $(srcdir)/iterator/iterator.h \ - $(srcdir)/services/outbound_list.h $(srcdir)/iterator/iter_delegpt.h $(srcdir)/iterator/iter_utils.h \ - $(srcdir)/iterator/iter_resptype.h $(srcdir)/iterator/iter_fwd.h $(srcdir)/iterator/iter_hints.h \ - $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/str2wire.h -daemon.lo daemon.o: $(srcdir)/daemon/daemon.c config.h $(srcdir)/daemon/daemon.h $(srcdir)/util/locks.h \ - $(srcdir)/util/log.h $(srcdir)/util/alloc.h $(srcdir)/services/modstack.h \ - $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h \ +cachedump.lo cachedump.o: $(srcdir)/daemon/cachedump.c config.h \ + $(srcdir)/daemon/cachedump.h $(srcdir)/daemon/remote.h $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h \ $(srcdir)/sldns/sbuffer.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \ - $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/util/data/msgreply.h \ + $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ + $(srcdir)/util/alloc.h $(srcdir)/util/data/msgreply.h \ $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h \ $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h \ - $(srcdir)/daemon/remote.h $(srcdir)/daemon/acl_list.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h \ - $(srcdir)/services/view.h $(srcdir)/util/config_file.h $(srcdir)/util/shm_side/shm_main.h \ - $(srcdir)/util/storage/lookup3.h $(srcdir)/util/storage/slabhash.h $(srcdir)/util/tcp_conn_limit.h \ + $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h \ + $(srcdir)/services/cache/dns.h $(srcdir)/services/cache/infra.h $(srcdir)/util/storage/dnstree.h \ + $(srcdir)/util/rbtree.h $(srcdir)/util/rtt.h $(srcdir)/util/regional.h $(srcdir)/util/net_help.h \ + $(srcdir)/util/data/dname.h $(srcdir)/iterator/iterator.h $(srcdir)/services/outbound_list.h \ + $(srcdir)/iterator/iter_delegpt.h $(srcdir)/iterator/iter_utils.h $(srcdir)/iterator/iter_resptype.h \ + $(srcdir)/iterator/iter_fwd.h $(srcdir)/iterator/iter_hints.h $(srcdir)/sldns/wire2str.h \ + $(srcdir)/sldns/str2wire.h +daemon.lo daemon.o: $(srcdir)/daemon/daemon.c config.h \ + $(srcdir)/daemon/daemon.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/alloc.h $(srcdir)/services/modstack.h \ + $(srcdir)/daemon/worker.h \ + $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h $(srcdir)/util/data/packed_rrset.h \ + $(srcdir)/util/storage/lruhash.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ + $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h \ + $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/util/module.h \ + $(srcdir)/dnstap/dnstap.h $(srcdir)/daemon/remote.h \ + $(srcdir)/daemon/acl_list.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/services/view.h \ + $(srcdir)/util/config_file.h $(srcdir)/util/shm_side/shm_main.h $(srcdir)/util/storage/lookup3.h \ + $(srcdir)/util/storage/slabhash.h $(srcdir)/util/tcp_conn_limit.h $(srcdir)/util/edns.h \ $(srcdir)/services/listen_dnsport.h $(srcdir)/services/cache/rrset.h $(srcdir)/services/cache/infra.h \ $(srcdir)/util/rtt.h $(srcdir)/services/localzone.h $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h \ $(srcdir)/services/rpz.h $(srcdir)/respip/respip.h $(srcdir)/util/random.h $(srcdir)/util/tube.h $(srcdir)/util/net_help.h \ $(srcdir)/sldns/keyraw.h -remote.lo remote.o: $(srcdir)/daemon/remote.c config.h $(srcdir)/daemon/remote.h $(srcdir)/daemon/worker.h \ - $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h $(srcdir)/util/data/packed_rrset.h \ - $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/netevent.h \ - $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/util/alloc.h \ - $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h \ - $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/util/module.h \ - $(srcdir)/dnstap/dnstap.h $(srcdir)/daemon/daemon.h \ +remote.lo remote.o: $(srcdir)/daemon/remote.c config.h \ + $(srcdir)/daemon/remote.h \ + $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h \ + $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ + $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ + $(srcdir)/util/alloc.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ + $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h \ + $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h $(srcdir)/daemon/daemon.h \ $(srcdir)/services/modstack.h $(srcdir)/daemon/cachedump.h $(srcdir)/util/config_file.h \ $(srcdir)/util/net_help.h $(srcdir)/services/listen_dnsport.h $(srcdir)/services/cache/rrset.h \ $(srcdir)/util/storage/slabhash.h $(srcdir)/services/cache/infra.h $(srcdir)/util/storage/dnstree.h \ @@ -1291,19 +1348,21 @@ stats.lo stats.o: $(srcdir)/daemon/stats.c config.h $(srcdir)/daemon/stats.h $(s $(srcdir)/util/net_help.h $(srcdir)/validator/validator.h $(srcdir)/validator/val_utils.h \ $(srcdir)/iterator/iterator.h $(srcdir)/services/outbound_list.h $(srcdir)/services/cache/rrset.h \ $(srcdir)/util/storage/slabhash.h $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h \ - $(srcdir)/validator/val_kcache.h $(srcdir)/validator/val_neg.h + $(srcdir)/validator/val_kcache.h $(srcdir)/validator/val_neg.h $(srcdir)/edns-subnet/subnetmod.h \ + $(srcdir)/util/data/dname.h $(srcdir)/edns-subnet/addrtree.h $(srcdir)/edns-subnet/edns-subnet.h \ + unbound.lo unbound.o: $(srcdir)/daemon/unbound.c config.h $(srcdir)/util/log.h $(srcdir)/daemon/daemon.h \ $(srcdir)/util/locks.h $(srcdir)/util/alloc.h $(srcdir)/services/modstack.h \ - $(srcdir)/daemon/remote.h $(srcdir)/util/config_file.h \ - $(srcdir)/util/storage/slabhash.h $(srcdir)/util/storage/lruhash.h $(srcdir)/services/listen_dnsport.h \ - $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/services/cache/rrset.h \ - $(srcdir)/util/data/packed_rrset.h $(srcdir)/services/cache/infra.h $(srcdir)/util/storage/dnstree.h \ - $(srcdir)/util/rbtree.h $(srcdir)/util/rtt.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/fptr_wlist.h \ - $(srcdir)/util/module.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h \ - $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h \ - $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h \ - $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h $(srcdir)/util/net_help.h \ - $(srcdir)/util/ub_event.h + $(srcdir)/daemon/remote.h \ + $(srcdir)/util/config_file.h $(srcdir)/util/storage/slabhash.h $(srcdir)/util/storage/lruhash.h \ + $(srcdir)/services/listen_dnsport.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ + $(srcdir)/services/cache/rrset.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/services/cache/infra.h \ + $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/util/rtt.h $(srcdir)/util/data/msgreply.h \ + $(srcdir)/util/fptr_wlist.h $(srcdir)/util/module.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ + $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/services/rpz.h \ + $(srcdir)/services/localzone.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h $(srcdir)/services/authzone.h \ + $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h \ + $(srcdir)/util/net_help.h $(srcdir)/util/ub_event.h worker.lo worker.o: $(srcdir)/daemon/worker.c config.h $(srcdir)/util/log.h $(srcdir)/util/net_help.h \ $(srcdir)/util/random.h $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h \ @@ -1311,23 +1370,24 @@ worker.lo worker.o: $(srcdir)/daemon/worker.c config.h $(srcdir)/util/log.h $(sr $(srcdir)/util/alloc.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h \ $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h $(srcdir)/daemon/daemon.h \ - $(srcdir)/services/modstack.h $(srcdir)/daemon/remote.h $(srcdir)/daemon/acl_list.h \ - $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/services/view.h $(srcdir)/util/config_file.h \ - $(srcdir)/util/regional.h $(srcdir)/util/storage/slabhash.h $(srcdir)/services/listen_dnsport.h \ - $(srcdir)/services/outside_network.h $(srcdir)/services/outbound_list.h \ - $(srcdir)/services/cache/rrset.h $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h \ - $(srcdir)/services/cache/dns.h $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h $(srcdir)/services/rpz.h \ - $(srcdir)/services/localzone.h $(srcdir)/respip/respip.h $(srcdir)/util/data/msgencode.h \ - $(srcdir)/util/data/dname.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h $(srcdir)/util/edns.h \ - $(srcdir)/iterator/iter_fwd.h $(srcdir)/iterator/iter_hints.h $(srcdir)/validator/autotrust.h \ - $(srcdir)/validator/val_anchor.h $(srcdir)/libunbound/context.h $(srcdir)/libunbound/unbound-event.h \ - $(srcdir)/libunbound/libworker.h $(srcdir)/sldns/wire2str.h $(srcdir)/util/shm_side/shm_main.h \ - $(srcdir)/dnstap/dtstream.h + $(srcdir)/services/modstack.h $(srcdir)/daemon/remote.h \ + $(srcdir)/daemon/acl_list.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/services/view.h \ + $(srcdir)/util/config_file.h $(srcdir)/util/regional.h $(srcdir)/util/storage/slabhash.h \ + $(srcdir)/services/listen_dnsport.h $(srcdir)/services/outside_network.h \ + $(srcdir)/services/outbound_list.h $(srcdir)/services/cache/rrset.h $(srcdir)/services/cache/infra.h \ + $(srcdir)/util/rtt.h $(srcdir)/services/cache/dns.h $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h \ + $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h $(srcdir)/respip/respip.h \ + $(srcdir)/util/data/msgencode.h $(srcdir)/util/data/dname.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h \ + $(srcdir)/util/edns.h $(srcdir)/iterator/iter_fwd.h $(srcdir)/iterator/iter_hints.h \ + $(srcdir)/validator/autotrust.h $(srcdir)/validator/val_anchor.h $(srcdir)/libunbound/context.h \ + $(srcdir)/libunbound/unbound-event.h $(srcdir)/libunbound/libworker.h $(srcdir)/sldns/wire2str.h \ + $(srcdir)/util/shm_side/shm_main.h $(srcdir)/dnstap/dtstream.h testbound.lo testbound.o: $(srcdir)/testcode/testbound.c config.h $(srcdir)/testcode/testpkts.h \ $(srcdir)/testcode/replay.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ $(srcdir)/util/rbtree.h $(srcdir)/testcode/fake_event.h \ - $(srcdir)/daemon/remote.h $(srcdir)/util/config_file.h $(srcdir)/sldns/keyraw.h $(srcdir)/daemon/unbound.c \ - $(srcdir)/util/log.h $(srcdir)/daemon/daemon.h $(srcdir)/util/locks.h $(srcdir)/util/alloc.h $(srcdir)/services/modstack.h \ + $(srcdir)/daemon/remote.h \ + $(srcdir)/util/config_file.h $(srcdir)/sldns/keyraw.h $(srcdir)/daemon/unbound.c $(srcdir)/util/log.h \ + $(srcdir)/daemon/daemon.h $(srcdir)/util/locks.h $(srcdir)/util/alloc.h $(srcdir)/services/modstack.h \ $(srcdir)/util/storage/slabhash.h $(srcdir)/util/storage/lruhash.h \ $(srcdir)/services/listen_dnsport.h $(srcdir)/services/cache/rrset.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/services/cache/infra.h $(srcdir)/util/storage/dnstree.h \ @@ -1346,34 +1406,35 @@ worker.lo worker.o: $(srcdir)/daemon/worker.c config.h $(srcdir)/util/log.h $(sr $(srcdir)/util/alloc.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h \ $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h $(srcdir)/daemon/daemon.h \ - $(srcdir)/services/modstack.h $(srcdir)/daemon/remote.h $(srcdir)/daemon/acl_list.h \ - $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/services/view.h $(srcdir)/util/config_file.h \ - $(srcdir)/util/regional.h $(srcdir)/util/storage/slabhash.h $(srcdir)/services/listen_dnsport.h \ - $(srcdir)/services/outside_network.h $(srcdir)/services/outbound_list.h \ - $(srcdir)/services/cache/rrset.h $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h \ - $(srcdir)/services/cache/dns.h $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h $(srcdir)/services/rpz.h \ - $(srcdir)/services/localzone.h $(srcdir)/respip/respip.h $(srcdir)/util/data/msgencode.h \ - $(srcdir)/util/data/dname.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h $(srcdir)/util/edns.h \ - $(srcdir)/iterator/iter_fwd.h $(srcdir)/iterator/iter_hints.h $(srcdir)/validator/autotrust.h \ - $(srcdir)/validator/val_anchor.h $(srcdir)/libunbound/context.h $(srcdir)/libunbound/unbound-event.h \ - $(srcdir)/libunbound/libworker.h $(srcdir)/sldns/wire2str.h $(srcdir)/util/shm_side/shm_main.h \ - $(srcdir)/dnstap/dtstream.h + $(srcdir)/services/modstack.h $(srcdir)/daemon/remote.h \ + $(srcdir)/daemon/acl_list.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/services/view.h \ + $(srcdir)/util/config_file.h $(srcdir)/util/regional.h $(srcdir)/util/storage/slabhash.h \ + $(srcdir)/services/listen_dnsport.h $(srcdir)/services/outside_network.h \ + $(srcdir)/services/outbound_list.h $(srcdir)/services/cache/rrset.h $(srcdir)/services/cache/infra.h \ + $(srcdir)/util/rtt.h $(srcdir)/services/cache/dns.h $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h \ + $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h $(srcdir)/respip/respip.h \ + $(srcdir)/util/data/msgencode.h $(srcdir)/util/data/dname.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h \ + $(srcdir)/util/edns.h $(srcdir)/iterator/iter_fwd.h $(srcdir)/iterator/iter_hints.h \ + $(srcdir)/validator/autotrust.h $(srcdir)/validator/val_anchor.h $(srcdir)/libunbound/context.h \ + $(srcdir)/libunbound/unbound-event.h $(srcdir)/libunbound/libworker.h $(srcdir)/sldns/wire2str.h \ + $(srcdir)/util/shm_side/shm_main.h $(srcdir)/dnstap/dtstream.h acl_list.lo acl_list.o: $(srcdir)/daemon/acl_list.c config.h $(srcdir)/daemon/acl_list.h \ $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/services/view.h $(srcdir)/util/locks.h \ $(srcdir)/util/log.h $(srcdir)/util/regional.h $(srcdir)/util/config_file.h $(srcdir)/util/net_help.h \ $(srcdir)/services/localzone.h $(srcdir)/util/module.h $(srcdir)/util/storage/lruhash.h \ $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/str2wire.h -daemon.lo daemon.o: $(srcdir)/daemon/daemon.c config.h $(srcdir)/daemon/daemon.h $(srcdir)/util/locks.h \ - $(srcdir)/util/log.h $(srcdir)/util/alloc.h $(srcdir)/services/modstack.h \ - $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h \ - $(srcdir)/sldns/sbuffer.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \ - $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/util/data/msgreply.h \ - $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h \ - $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h \ - $(srcdir)/daemon/remote.h $(srcdir)/daemon/acl_list.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h \ - $(srcdir)/services/view.h $(srcdir)/util/config_file.h $(srcdir)/util/shm_side/shm_main.h \ - $(srcdir)/util/storage/lookup3.h $(srcdir)/util/storage/slabhash.h $(srcdir)/util/tcp_conn_limit.h \ +daemon.lo daemon.o: $(srcdir)/daemon/daemon.c config.h \ + $(srcdir)/daemon/daemon.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/alloc.h $(srcdir)/services/modstack.h \ + $(srcdir)/daemon/worker.h \ + $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h $(srcdir)/util/data/packed_rrset.h \ + $(srcdir)/util/storage/lruhash.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ + $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h \ + $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/util/module.h \ + $(srcdir)/dnstap/dnstap.h $(srcdir)/daemon/remote.h \ + $(srcdir)/daemon/acl_list.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/services/view.h \ + $(srcdir)/util/config_file.h $(srcdir)/util/shm_side/shm_main.h $(srcdir)/util/storage/lookup3.h \ + $(srcdir)/util/storage/slabhash.h $(srcdir)/util/tcp_conn_limit.h $(srcdir)/util/edns.h \ $(srcdir)/services/listen_dnsport.h $(srcdir)/services/cache/rrset.h $(srcdir)/services/cache/infra.h \ $(srcdir)/util/rtt.h $(srcdir)/services/localzone.h $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h \ $(srcdir)/services/rpz.h $(srcdir)/respip/respip.h $(srcdir)/util/random.h $(srcdir)/util/tube.h $(srcdir)/util/net_help.h \ @@ -1391,7 +1452,9 @@ stats.lo stats.o: $(srcdir)/daemon/stats.c config.h $(srcdir)/daemon/stats.h $(s $(srcdir)/util/net_help.h $(srcdir)/validator/validator.h $(srcdir)/validator/val_utils.h \ $(srcdir)/iterator/iterator.h $(srcdir)/services/outbound_list.h $(srcdir)/services/cache/rrset.h \ $(srcdir)/util/storage/slabhash.h $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h \ - $(srcdir)/validator/val_kcache.h $(srcdir)/validator/val_neg.h + $(srcdir)/validator/val_kcache.h $(srcdir)/validator/val_neg.h $(srcdir)/edns-subnet/subnetmod.h \ + $(srcdir)/util/data/dname.h $(srcdir)/edns-subnet/addrtree.h $(srcdir)/edns-subnet/edns-subnet.h \ + replay.lo replay.o: $(srcdir)/testcode/replay.c config.h $(srcdir)/util/log.h $(srcdir)/util/net_help.h \ $(srcdir)/util/config_file.h $(srcdir)/testcode/replay.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ $(srcdir)/testcode/testpkts.h $(srcdir)/util/rbtree.h \ @@ -1401,13 +1464,14 @@ fake_event.lo fake_event.o: $(srcdir)/testcode/fake_event.c config.h $(srcdir)/t $(srcdir)/util/net_help.h $(srcdir)/util/log.h $(srcdir)/util/data/msgparse.h $(srcdir)/util/storage/lruhash.h \ $(srcdir)/util/locks.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/data/msgreply.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgencode.h $(srcdir)/util/data/dname.h \ - $(srcdir)/util/config_file.h $(srcdir)/services/listen_dnsport.h $(srcdir)/services/outside_network.h \ - $(srcdir)/util/rbtree.h $(srcdir)/services/cache/infra.h \ - $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rtt.h $(srcdir)/testcode/replay.h $(srcdir)/testcode/testpkts.h \ - $(srcdir)/util/fptr_wlist.h $(srcdir)/util/module.h $(srcdir)/util/tube.h $(srcdir)/services/mesh.h \ - $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h $(srcdir)/services/view.h \ - $(srcdir)/sldns/sbuffer.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \ - $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/str2wire.h + $(srcdir)/util/edns.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/util/config_file.h \ + $(srcdir)/services/listen_dnsport.h $(srcdir)/services/outside_network.h \ + $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h \ + $(srcdir)/testcode/replay.h $(srcdir)/testcode/testpkts.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/module.h \ + $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h \ + $(srcdir)/services/localzone.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h $(srcdir)/services/authzone.h \ + $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h \ + $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/str2wire.h lock_verify.lo lock_verify.o: $(srcdir)/testcode/lock_verify.c config.h $(srcdir)/util/log.h $(srcdir)/util/rbtree.h \ $(srcdir)/util/locks.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/module.h \ @@ -1442,7 +1506,8 @@ unbound-checkconf.lo unbound-checkconf.o: $(srcdir)/smallapp/unbound-checkconf.c $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h \ $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \ - $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h + $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h $(srcdir)/sldns/str2wire.h \ + $(PYTHONMOD_HEADER) $(srcdir)/edns-subnet/subnet-whitelist.h worker_cb.lo worker_cb.o: $(srcdir)/smallapp/worker_cb.c config.h $(srcdir)/libunbound/context.h \ $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/alloc.h $(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h \ $(srcdir)/libunbound/unbound.h $(srcdir)/libunbound/unbound-event.h $(srcdir)/util/data/packed_rrset.h \ @@ -1463,76 +1528,83 @@ context.lo context.o: $(srcdir)/libunbound/context.c config.h $(srcdir)/libunbou $(srcdir)/util/storage/slabhash.h $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h \ $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h $(srcdir)/services/rpz.h $(srcdir)/daemon/stats.h \ - $(srcdir)/util/timehist.h $(srcdir)/respip/respip.h + $(srcdir)/util/timehist.h $(srcdir)/respip/respip.h $(srcdir)/util/edns.h libunbound.lo libunbound.o: $(srcdir)/libunbound/libunbound.c $(srcdir)/libunbound/unbound.h \ $(srcdir)/libunbound/unbound-event.h config.h $(srcdir)/libunbound/context.h $(srcdir)/util/locks.h \ $(srcdir)/util/log.h $(srcdir)/util/alloc.h $(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/libunbound/libworker.h \ $(srcdir)/util/config_file.h $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h \ $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/regional.h \ - $(srcdir)/util/random.h $(srcdir)/util/net_help.h $(srcdir)/util/tube.h $(srcdir)/util/ub_event.h \ - $(srcdir)/services/localzone.h $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h \ + $(srcdir)/util/random.h $(srcdir)/util/net_help.h $(srcdir)/util/tube.h $(srcdir)/util/ub_event.h $(srcdir)/util/edns.h \ + $(srcdir)/util/storage/dnstree.h $(srcdir)/services/localzone.h $(srcdir)/services/view.h \ $(srcdir)/sldns/sbuffer.h $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h $(srcdir)/util/netevent.h \ $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/services/cache/rrset.h \ $(srcdir)/util/storage/slabhash.h $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h \ $(srcdir)/services/rpz.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/respip/respip.h -libworker.lo libworker.o: $(srcdir)/libunbound/libworker.c config.h $(srcdir)/libunbound/libworker.h \ - $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ - $(srcdir)/libunbound/context.h $(srcdir)/util/alloc.h $(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h \ - $(srcdir)/libunbound/unbound.h $(srcdir)/libunbound/unbound-event.h $(srcdir)/libunbound/worker.h \ - $(srcdir)/sldns/sbuffer.h $(srcdir)/services/outside_network.h $(srcdir)/util/netevent.h \ - $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/services/mesh.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h \ - $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h \ - $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h $(srcdir)/util/config_file.h \ - $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/respip/respip.h \ - $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h $(srcdir)/services/outbound_list.h \ - $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h $(srcdir)/util/regional.h $(srcdir)/util/random.h \ - $(srcdir)/util/storage/lookup3.h $(srcdir)/util/net_help.h $(srcdir)/util/data/dname.h \ - $(srcdir)/util/data/msgencode.h $(srcdir)/iterator/iter_fwd.h $(srcdir)/iterator/iter_hints.h \ - $(srcdir)/sldns/str2wire.h +libworker.lo libworker.o: $(srcdir)/libunbound/libworker.c config.h \ + $(srcdir)/libunbound/libworker.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \ + $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/libunbound/context.h $(srcdir)/util/alloc.h $(srcdir)/util/rbtree.h \ + $(srcdir)/services/modstack.h $(srcdir)/libunbound/unbound.h $(srcdir)/libunbound/unbound-event.h \ + $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h $(srcdir)/services/outside_network.h \ + $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ + $(srcdir)/services/mesh.h $(srcdir)/util/data/msgparse.h \ + $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h \ + $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h $(srcdir)/util/storage/dnstree.h \ + $(srcdir)/services/view.h $(srcdir)/util/config_file.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h \ + $(srcdir)/util/timehist.h $(srcdir)/respip/respip.h $(srcdir)/services/cache/rrset.h \ + $(srcdir)/util/storage/slabhash.h $(srcdir)/services/outbound_list.h $(srcdir)/util/fptr_wlist.h \ + $(srcdir)/util/tube.h $(srcdir)/util/regional.h $(srcdir)/util/random.h $(srcdir)/util/storage/lookup3.h \ + $(srcdir)/util/net_help.h $(srcdir)/util/data/dname.h $(srcdir)/util/data/msgencode.h \ + $(srcdir)/iterator/iter_fwd.h $(srcdir)/iterator/iter_hints.h $(srcdir)/sldns/str2wire.h unbound-host.lo unbound-host.o: $(srcdir)/smallapp/unbound-host.c config.h $(srcdir)/libunbound/unbound.h \ - $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/wire2str.h + $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/wire2str.h \ + asynclook.lo asynclook.o: $(srcdir)/testcode/asynclook.c config.h $(srcdir)/libunbound/unbound.h \ $(srcdir)/libunbound/context.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/alloc.h $(srcdir)/util/rbtree.h \ $(srcdir)/services/modstack.h $(srcdir)/libunbound/unbound-event.h $(srcdir)/util/data/packed_rrset.h \ - $(srcdir)/util/storage/lruhash.h $(srcdir)/sldns/rrdef.h + $(srcdir)/util/storage/lruhash.h $(srcdir)/sldns/rrdef.h \ + streamtcp.lo streamtcp.o: $(srcdir)/testcode/streamtcp.c config.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ $(srcdir)/util/net_help.h $(srcdir)/util/data/msgencode.h $(srcdir)/util/data/msgparse.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/data/msgreply.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/dname.h $(srcdir)/sldns/sbuffer.h \ - $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/wire2str.h + $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/wire2str.h \ + perf.lo perf.o: $(srcdir)/testcode/perf.c config.h $(srcdir)/util/log.h $(srcdir)/util/locks.h $(srcdir)/util/net_help.h \ $(srcdir)/util/data/msgencode.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/storage/lruhash.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/str2wire.h delayer.lo delayer.o: $(srcdir)/testcode/delayer.c config.h $(srcdir)/util/net_help.h $(srcdir)/util/log.h \ $(srcdir)/util/config_file.h $(srcdir)/sldns/sbuffer.h -unbound-control.lo unbound-control.o: $(srcdir)/smallapp/unbound-control.c config.h $(srcdir)/util/log.h \ - $(srcdir)/util/config_file.h $(srcdir)/util/locks.h $(srcdir)/util/net_help.h $(srcdir)/util/shm_side/shm_main.h \ - $(srcdir)/libunbound/unbound.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/sldns/wire2str.h \ - $(srcdir)/sldns/pkthdr.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h $(srcdir)/util/rbtree.h \ - $(srcdir)/util/storage/dnstree.h $(srcdir)/util/module.h $(srcdir)/util/storage/lruhash.h \ - $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ - $(srcdir)/sldns/rrdef.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h $(srcdir)/services/authzone.h \ - $(srcdir)/services/mesh.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ +unbound-control.lo unbound-control.o: $(srcdir)/smallapp/unbound-control.c config.h \ + $(srcdir)/util/log.h $(srcdir)/util/config_file.h $(srcdir)/util/locks.h $(srcdir)/util/net_help.h \ + $(srcdir)/util/shm_side/shm_main.h $(srcdir)/libunbound/unbound.h $(srcdir)/daemon/stats.h \ + $(srcdir)/util/timehist.h $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/pkthdr.h $(srcdir)/services/rpz.h \ + $(srcdir)/services/localzone.h $(srcdir)/util/rbtree.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/module.h \ + $(srcdir)/util/storage/lruhash.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \ + $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/rrdef.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h \ + $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ $(srcdir)/services/modstack.h $(srcdir)/respip/respip.h unbound-anchor.lo unbound-anchor.o: $(srcdir)/smallapp/unbound-anchor.c config.h $(srcdir)/libunbound/unbound.h \ - $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/parseutil.h -petal.lo petal.o: $(srcdir)/testcode/petal.c config.h + $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/parseutil.h \ + +petal.lo petal.o: $(srcdir)/testcode/petal.c config.h \ + unbound-dnstap-socket.lo unbound-dnstap-socket.o: $(srcdir)/dnstap/unbound-dnstap-socket.c config.h \ $(srcdir)/dnstap/dtstream.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/dnstap/dnstap_fstrm.h \ $(srcdir)/util/ub_event.h $(srcdir)/util/net_help.h $(srcdir)/services/listen_dnsport.h \ $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/wire2str.h $(srcdir)/util/config_file.h \ - $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h + $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/wire2str.h \ + dnstap/dnstap.pb-c.h \ + $(srcdir)/util/config_file.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h pythonmod_utils.lo pythonmod_utils.o: $(srcdir)/pythonmod/pythonmod_utils.c config.h $(srcdir)/util/module.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/data/msgreply.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ $(srcdir)/sldns/rrdef.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ $(srcdir)/util/net_help.h $(srcdir)/services/cache/dns.h \ $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h $(srcdir)/util/regional.h \ - $(srcdir)/iterator/iter_delegpt.h $(srcdir)/sldns/sbuffer.h + $(srcdir)/iterator/iter_delegpt.h $(srcdir)/sldns/sbuffer.h \ + win_svc.lo win_svc.o: $(srcdir)/winrc/win_svc.c config.h $(srcdir)/winrc/win_svc.h $(srcdir)/winrc/w_inst.h \ $(srcdir)/daemon/daemon.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/alloc.h $(srcdir)/services/modstack.h \ $(srcdir)/daemon/worker.h \ @@ -1540,8 +1612,8 @@ win_svc.lo win_svc.o: $(srcdir)/winrc/win_svc.c config.h $(srcdir)/winrc/win_svc $(srcdir)/util/storage/lruhash.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h \ $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/util/module.h \ - $(srcdir)/dnstap/dnstap.h $(srcdir)/daemon/remote.h $(srcdir)/util/config_file.h $(srcdir)/util/ub_event.h \ - $(srcdir)/util/net_help.h + $(srcdir)/dnstap/dnstap.h $(srcdir)/daemon/remote.h \ + $(srcdir)/util/config_file.h $(srcdir)/util/ub_event.h $(srcdir)/util/net_help.h w_inst.lo w_inst.o: $(srcdir)/winrc/w_inst.c config.h $(srcdir)/winrc/w_inst.h $(srcdir)/winrc/win_svc.h unbound-service-install.lo unbound-service-install.o: $(srcdir)/winrc/unbound-service-install.c config.h \ $(srcdir)/winrc/w_inst.h @@ -1549,12 +1621,14 @@ unbound-service-remove.lo unbound-service-remove.o: $(srcdir)/winrc/unbound-serv $(srcdir)/winrc/w_inst.h anchor-update.lo anchor-update.o: $(srcdir)/winrc/anchor-update.c config.h $(srcdir)/libunbound/unbound.h \ $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/wire2str.h -keyraw.lo keyraw.o: $(srcdir)/sldns/keyraw.c config.h $(srcdir)/sldns/keyraw.h $(srcdir)/sldns/rrdef.h +keyraw.lo keyraw.o: $(srcdir)/sldns/keyraw.c config.h $(srcdir)/sldns/keyraw.h \ + $(srcdir)/sldns/rrdef.h \ + sbuffer.lo sbuffer.o: $(srcdir)/sldns/sbuffer.c config.h $(srcdir)/sldns/sbuffer.h wire2str.lo wire2str.o: $(srcdir)/sldns/wire2str.c config.h $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/str2wire.h \ $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/parseutil.h $(srcdir)/sldns/sbuffer.h \ - $(srcdir)/sldns/keyraw.h $(srcdir)/util/data/dname.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h \ - $(srcdir)/util/log.h + $(srcdir)/sldns/keyraw.h \ + $(srcdir)/util/data/dname.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h parse.lo parse.o: $(srcdir)/sldns/parse.c config.h $(srcdir)/sldns/parse.h $(srcdir)/sldns/parseutil.h \ $(srcdir)/sldns/sbuffer.h parseutil.lo parseutil.o: $(srcdir)/sldns/parseutil.c config.h $(srcdir)/sldns/parseutil.h @@ -1562,9 +1636,11 @@ rrdef.lo rrdef.o: $(srcdir)/sldns/rrdef.c config.h $(srcdir)/sldns/rrdef.h $(src str2wire.lo str2wire.o: $(srcdir)/sldns/str2wire.c config.h $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/rrdef.h \ $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/parse.h $(srcdir)/sldns/parseutil.h dohclient.lo dohclient.o: $(srcdir)/testcode/dohclient.c config.h $(srcdir)/sldns/wire2str.h \ - $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/data/msgencode.h \ - $(srcdir)/util/data/msgreply.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ - $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/net_help.h + $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/parseutil.h \ + $(srcdir)/util/data/msgencode.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/storage/lruhash.h \ + $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ + $(srcdir)/sldns/pkthdr.h $(srcdir)/util/net_help.h \ + ctime_r.lo ctime_r.o: $(srcdir)/compat/ctime_r.c config.h $(srcdir)/util/locks.h $(srcdir)/util/log.h fake-rfc2553.lo fake-rfc2553.o: $(srcdir)/compat/fake-rfc2553.c $(srcdir)/compat/fake-rfc2553.h config.h gmtime_r.lo gmtime_r.o: $(srcdir)/compat/gmtime_r.c config.h @@ -1579,9 +1655,11 @@ strlcat.lo strlcat.o: $(srcdir)/compat/strlcat.c config.h strlcpy.lo strlcpy.o: $(srcdir)/compat/strlcpy.c config.h strptime.lo strptime.o: $(srcdir)/compat/strptime.c config.h getentropy_freebsd.lo getentropy_freebsd.o: $(srcdir)/compat/getentropy_freebsd.c -getentropy_linux.lo getentropy_linux.o: $(srcdir)/compat/getentropy_linux.c config.h +getentropy_linux.lo getentropy_linux.o: $(srcdir)/compat/getentropy_linux.c config.h \ + getentropy_osx.lo getentropy_osx.o: $(srcdir)/compat/getentropy_osx.c -getentropy_solaris.lo getentropy_solaris.o: $(srcdir)/compat/getentropy_solaris.c config.h +getentropy_solaris.lo getentropy_solaris.o: $(srcdir)/compat/getentropy_solaris.c config.h \ + getentropy_win.lo getentropy_win.o: $(srcdir)/compat/getentropy_win.c explicit_bzero.lo explicit_bzero.o: $(srcdir)/compat/explicit_bzero.c config.h arc4random.lo arc4random.o: $(srcdir)/compat/arc4random.c config.h $(srcdir)/compat/chacha_private.h diff --git a/contrib/unbound/aclocal.m4 b/contrib/unbound/aclocal.m4 index dd1b8658c7b8..bf3c57e2fd9f 100644 --- a/contrib/unbound/aclocal.m4 +++ b/contrib/unbound/aclocal.m4 @@ -1,6 +1,6 @@ -# generated automatically by aclocal 1.16.1 -*- Autoconf -*- +# generated automatically by aclocal 1.16.2 -*- Autoconf -*- -# Copyright (C) 1996-2018 Free Software Foundation, Inc. +# Copyright (C) 1996-2020 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -9390,7 +9390,7 @@ AS_IF([test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"], # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997-2018 Free Software Foundation, Inc. +# Copyright (C) 1997-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -9421,7 +9421,7 @@ AC_CONFIG_COMMANDS_PRE( Usually this means the macro was only invoked conditionally.]]) *** 4737 LINES SKIPPED *** From owner-dev-commits-src-branches@freebsd.org Thu Jun 3 01:16:30 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1EAFD64F7C2; Thu, 3 Jun 2021 01:16: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 4FwSf60PRXz3Lch; Thu, 3 Jun 2021 01:16:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E5C7521182; Thu, 3 Jun 2021 01:16:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1531GTca047378; Thu, 3 Jun 2021 01:16:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1531GTMR047377; Thu, 3 Jun 2021 01:16:29 GMT (envelope-from git) Date: Thu, 3 Jun 2021 01:16:29 GMT Message-Id: <202106030116.1531GTMR047377@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 7f527ae46b06 - stable/12 - nfscl: Revert commit 5a8b2c5a46dffa3828ad16abee36ac4676f741bf MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 7f527ae46b061c056fd395f46daf0481e2a292b8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jun 2021 01:16:30 -0000 The branch stable/12 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=7f527ae46b061c056fd395f46daf0481e2a292b8 commit 7f527ae46b061c056fd395f46daf0481e2a292b8 Author: Rick Macklem AuthorDate: 2021-06-03 01:13:21 +0000 Commit: Rick Macklem CommitDate: 2021-06-03 01:13:21 +0000 nfscl: Revert commit 5a8b2c5a46dffa3828ad16abee36ac4676f741bf This is a direct commit, since the MFC mis-merged. --- sys/fs/nfsclient/nfs_clstate.c | 36 ------------------------------------ 1 file changed, 36 deletions(-) diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c index e1b9d37b3a3e..e705af31185b 100644 --- a/sys/fs/nfsclient/nfs_clstate.c +++ b/sys/fs/nfsclient/nfs_clstate.c @@ -1977,7 +1977,6 @@ nfscl_recover(struct nfsclclient *clp, struct ucred *cred, NFSPROC_T *p) u_int32_t delegtype = NFSV4OPEN_DELEGATEWRITE, mode; int i, igotlock = 0, error, trycnt, firstlock; struct nfscllayout *lyp, *nlyp; - bool recovered_one; /* * First, lock the client structure, so everyone else will @@ -2051,7 +2050,6 @@ nfscl_recover(struct nfsclclient *clp, struct ucred *cred, NFSPROC_T *p) * Now traverse the state lists, doing Open and Lock Reclaims. */ tcred = newnfs_getcred(); - recovered_one = false; owp = LIST_FIRST(&clp->nfsc_owner); while (owp != NULL) { nowp = LIST_NEXT(owp, nfsow_list); @@ -2085,7 +2083,6 @@ nfscl_recover(struct nfsclclient *clp, struct ucred *cred, NFSPROC_T *p) op->nfso_mode, op, NULL, 0, &ndp, 1, delegtype, tcred, p); if (!error) { - recovered_one = true; /* Handle any replied delegation */ if (ndp != NULL && ((ndp->nfsdl_flags & NFSCLDL_WRITE) || NFSMNT_RDONLY(nmp->nm_mountp))) { @@ -2144,21 +2141,6 @@ nfscl_recover(struct nfsclclient *clp, struct ucred *cred, NFSPROC_T *p) nfscl_freelockowner(lp, 0); lp = nlp; } - } else if (error == NFSERR_NOGRACE && !recovered_one && - NFSHASNFSV4N(nmp)) { - /* - * For NFSv4.1/4.2, the NFSERR_EXPIRED case will - * actually end up here, since the client will do - * a recovery for NFSERR_BADSESSION, but will get - * an NFSERR_NOGRACE reply for the first "reclaim" - * attempt. - * So, call nfscl_expireclient() to recover the - * opens as best we can and then do a reclaim - * complete and return. - */ - nfsrpc_reclaimcomplete(nmp, cred, p); - nfscl_expireclient(clp, nmp, tcred, p); - goto out; } } if (error != 0 && error != NFSERR_BADSESSION) @@ -2245,23 +2227,6 @@ nfscl_recover(struct nfsclclient *clp, struct ucred *cred, NFSPROC_T *p) if (error) { if (nop != NULL) free(nop, M_NFSCLOPEN); - if (error == NFSERR_NOGRACE && !recovered_one && - NFSHASNFSV4N(nmp)) { - /* - * For NFSv4.1/4.2, the NFSERR_EXPIRED case will - * actually end up here, since the client will do - * a recovery for NFSERR_BADSESSION, but will get - * an NFSERR_NOGRACE reply for the first "reclaim" - * attempt. - * So, call nfscl_expireclient() to recover the - * opens as best we can and then do a reclaim - * complete and return. - */ - nfsrpc_reclaimcomplete(nmp, cred, p); - nfscl_expireclient(clp, nmp, tcred, p); - free(nowp, M_NFSCLOWNER); - goto out; - } /* * Couldn't reclaim it, so throw the state * away. Ouch!! @@ -2269,7 +2234,6 @@ nfscl_recover(struct nfsclclient *clp, struct ucred *cred, NFSPROC_T *p) nfscl_cleandeleg(dp); nfscl_freedeleg(&clp->nfsc_deleg, dp, true); } else { - recovered_one = true; LIST_INSERT_HEAD(&extra_open, nop, nfso_list); } } From owner-dev-commits-src-branches@freebsd.org Thu Jun 3 13:29:05 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0F47F63944E; Thu, 3 Jun 2021 13:29: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 4FwmvN75Cpz3JbG; Thu, 3 Jun 2021 13:29:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D9D392926; Thu, 3 Jun 2021 13:29:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 153DT4c7017242; Thu, 3 Jun 2021 13:29:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 153DT4T6017241; Thu, 3 Jun 2021 13:29:04 GMT (envelope-from git) Date: Thu, 3 Jun 2021 13:29:04 GMT Message-Id: <202106031329.153DT4T6017241@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: e539e7a0954b - stable/13 - ktrace: Handle negative array sizes in ktrstructarray MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e539e7a0954bc9fc0e308675b32d157917829cd4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jun 2021 13:29:05 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=e539e7a0954bc9fc0e308675b32d157917829cd4 commit e539e7a0954bc9fc0e308675b32d157917829cd4 Author: Mark Johnston AuthorDate: 2021-05-27 19:49:12 +0000 Commit: Mark Johnston CommitDate: 2021-06-03 13:28:42 +0000 ktrace: Handle negative array sizes in ktrstructarray ktrstructarray() may be used to create copies of kevent(2) change and event arrays. It is called before parameter validation is done and so should check for bogus array lengths before allocating a copy. Reported by: syzkaller Reviewed by: kib Sponsored by: The FreeBSD Foundation (cherry picked from commit f88510077377157008f648b7036e1d1c9c83ea23) --- sys/kern/kern_ktrace.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/kern/kern_ktrace.c b/sys/kern/kern_ktrace.c index 8728801acdf7..d0f7e0067064 100644 --- a/sys/kern/kern_ktrace.c +++ b/sys/kern/kern_ktrace.c @@ -803,6 +803,8 @@ ktrstructarray(const char *name, enum uio_seg seg, const void *data, if (__predict_false(curthread->td_pflags & TDP_INKTRACE)) return; + if (num_items < 0) + return; /* Trim array length to genio size. */ max_items = ktr_geniosize / struct_size; From owner-dev-commits-src-branches@freebsd.org Thu Jun 3 13:29:06 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A05AA6392F2; Thu, 3 Jun 2021 13:29: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 4FwmvQ20sGz3Jgy; Thu, 3 Jun 2021 13:29:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 174002B07; Thu, 3 Jun 2021 13:29:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 153DT5Hl017263; Thu, 3 Jun 2021 13:29:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 153DT5Qk017262; Thu, 3 Jun 2021 13:29:05 GMT (envelope-from git) Date: Thu, 3 Jun 2021 13:29:05 GMT Message-Id: <202106031329.153DT5Qk017262@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: fcf938e09396 - stable/13 - tcp, udp: Permit binding with AF_UNSPEC if the address is INADDR_ANY MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: fcf938e093963bd0a0d92e55c964cfb0b2ce3459 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jun 2021 13:29:06 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=fcf938e093963bd0a0d92e55c964cfb0b2ce3459 commit fcf938e093963bd0a0d92e55c964cfb0b2ce3459 Author: Mark Johnston AuthorDate: 2021-05-31 22:53:34 +0000 Commit: Mark Johnston CommitDate: 2021-06-03 13:28:53 +0000 tcp, udp: Permit binding with AF_UNSPEC if the address is INADDR_ANY Prior to commit f161d294b we only checked the sockaddr length, but now we verify the address family as well. This breaks at least ttcp. Relax the check to avoid breaking compatibility too much: permit AF_UNSPEC if the address is INADDR_ANY. Fixes: f161d294b Reported by: Bakul Shah Reviewed by: tuexen Sponsored by: The FreeBSD Foundation (cherry picked from commit f96603b56f0f74fa52d8f1ef0be869fca7305b99) --- sys/netinet/tcp_usrreq.c | 11 +++++++++-- sys/netinet/udp_usrreq.c | 13 +++++++++++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index 7132349dbba7..48c3be3ec42c 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -321,8 +321,15 @@ tcp_usr_bind(struct socket *so, struct sockaddr *nam, struct thread *td) struct sockaddr_in *sinp; sinp = (struct sockaddr_in *)nam; - if (nam->sa_family != AF_INET) - return (EAFNOSUPPORT); + if (nam->sa_family != AF_INET) { + /* + * Preserve compatibility with old programs. + */ + if (nam->sa_family != AF_UNSPEC || + sinp->sin_addr.s_addr != INADDR_ANY) + return (EAFNOSUPPORT); + nam->sa_family = AF_INET; + } if (nam->sa_len != sizeof(*sinp)) return (EINVAL); diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index 62a07701df6c..5c9dbd36a1d6 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -1622,14 +1622,23 @@ udp_bind(struct socket *so, struct sockaddr *nam, struct thread *td) { struct inpcb *inp; struct inpcbinfo *pcbinfo; + struct sockaddr_in *sinp; int error; pcbinfo = udp_get_inpcbinfo(so->so_proto->pr_protocol); inp = sotoinpcb(so); KASSERT(inp != NULL, ("udp_bind: inp == NULL")); - if (nam->sa_family != AF_INET) - return (EAFNOSUPPORT); + sinp = (struct sockaddr_in *)nam; + if (nam->sa_family != AF_INET) { + /* + * Preserve compatibility with old programs. + */ + if (nam->sa_family != AF_UNSPEC || + sinp->sin_addr.s_addr != INADDR_ANY) + return (EAFNOSUPPORT); + nam->sa_family = AF_INET; + } if (nam->sa_len != sizeof(struct sockaddr_in)) return (EINVAL); From owner-dev-commits-src-branches@freebsd.org Thu Jun 3 13:40:33 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A1CE8639BE7; Thu, 3 Jun 2021 13:40:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fwn8d4Dw9z3KcL; Thu, 3 Jun 2021 13:40:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6C0AD2960; Thu, 3 Jun 2021 13:40:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 153DeX3P038481; Thu, 3 Jun 2021 13:40:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 153DeX3c038477; Thu, 3 Jun 2021 13:40:33 GMT (envelope-from git) Date: Thu, 3 Jun 2021 13:40:33 GMT Message-Id: <202106031340.153DeX3c038477@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 38da14043dcc - stable/13 - libpfctl: fix memory leak MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 38da14043dcc960e0316846d2042fea1e0543b07 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jun 2021 13:40:33 -0000 The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=38da14043dcc960e0316846d2042fea1e0543b07 commit 38da14043dcc960e0316846d2042fea1e0543b07 Author: Kristof Provost AuthorDate: 2021-05-27 09:28:36 +0000 Commit: Kristof Provost CommitDate: 2021-06-03 13:38:25 +0000 libpfctl: fix memory leak When we create an nvlist and insert it into another nvlist we must remember to destroy it. The nvlist_add_nvlist() function makes a copy, just like nvlist_add_string() makes a copy of the string. See also 4483fb47735c29408c72045469c9c4b3e549668b Reviewed by: scottl MFC after: 3 days Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D30492 (cherry picked from commit 6dbb729d35d59cc8bc8451bd56f220f9c35a43f3) --- lib/libpfctl/libpfctl.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/libpfctl/libpfctl.c b/lib/libpfctl/libpfctl.c index e207a55a8673..ebc026800a1b 100644 --- a/lib/libpfctl/libpfctl.c +++ b/lib/libpfctl/libpfctl.c @@ -130,6 +130,7 @@ pfctl_nv_add_addr(nvlist_t *nvparent, const char *name, nvlist_add_binary(nvl, "addr", addr, sizeof(*addr)); nvlist_add_nvlist(nvparent, name, nvl); + nvlist_destroy(nvl); } static void @@ -159,6 +160,7 @@ pfctl_nv_add_addr_wrap(nvlist_t *nvparent, const char *name, pfctl_nv_add_addr(nvl, "mask", &addr->v.a.mask); nvlist_add_nvlist(nvparent, name, nvl); + nvlist_destroy(nvl); } static void @@ -192,6 +194,7 @@ pfctl_nv_add_rule_addr(nvlist_t *nvparent, const char *name, nvlist_add_number(nvl, "port_op", addr->port_op); nvlist_add_nvlist(nvparent, name, nvl); + nvlist_destroy(nvl); } static void @@ -214,6 +217,7 @@ pfctl_nv_add_mape(nvlist_t *nvparent, const char *name, nvlist_add_number(nvl, "psidlen", mape->psidlen); nvlist_add_number(nvl, "psid", mape->psid); nvlist_add_nvlist(nvparent, name, nvl); + nvlist_destroy(nvl); } static void @@ -234,6 +238,7 @@ pfctl_nv_add_pool(nvlist_t *nvparent, const char *name, pfctl_nv_add_mape(nvl, "mape", &pool->mape); nvlist_add_nvlist(nvparent, name, nvl); + nvlist_destroy(nvl); } static void @@ -277,6 +282,7 @@ pfctl_nv_add_uid(nvlist_t *nvparent, const char *name, nvlist_add_number(nvl, "op", uid->op); nvlist_add_nvlist(nvparent, name, nvl); + nvlist_destroy(nvl); } static void @@ -296,6 +302,7 @@ pfctl_nv_add_divert(nvlist_t *nvparent, const char *name, nvlist_add_number(nvl, "port", r->divert.port); nvlist_add_nvlist(nvparent, name, nvl); + nvlist_destroy(nvl); } static void @@ -511,6 +518,7 @@ pfctl_add_rule(int dev, const struct pfctl_rule *r, const char *anchor, pfctl_nv_add_divert(nvlr, "divert", r); nvlist_add_nvlist(nvl, "rule", nvlr); + nvlist_destroy(nvlr); /* Now do the call. */ nv.data = nvlist_pack(nvl, &nv.len); @@ -625,6 +633,7 @@ pfctl_nv_add_state_cmp(nvlist_t *nvl, const char *name, nvlist_add_number(nv, "direction", cmp->direction); nvlist_add_nvlist(nvl, name, nv); + nvlist_destroy(nv); } static void From owner-dev-commits-src-branches@freebsd.org Thu Jun 3 13:40:33 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CEFCD639A4C; Thu, 3 Jun 2021 13:40:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fwn8d5bHfz3KTr; Thu, 3 Jun 2021 13:40:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9DB6A2C11; Thu, 3 Jun 2021 13:40:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 153DeXEd038542; Thu, 3 Jun 2021 13:40:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 153DeXqa038541; Thu, 3 Jun 2021 13:40:33 GMT (envelope-from git) Date: Thu, 3 Jun 2021 13:40:33 GMT Message-Id: <202106031340.153DeXqa038541@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: a75154a11586 - stable/12 - libpfctl: fix memory leak MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: a75154a11586361c2564b020819e6f7971cf4e1f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jun 2021 13:40:33 -0000 The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=a75154a11586361c2564b020819e6f7971cf4e1f commit a75154a11586361c2564b020819e6f7971cf4e1f Author: Kristof Provost AuthorDate: 2021-05-27 09:28:36 +0000 Commit: Kristof Provost CommitDate: 2021-06-03 06:36:36 +0000 libpfctl: fix memory leak When we create an nvlist and insert it into another nvlist we must remember to destroy it. The nvlist_add_nvlist() function makes a copy, just like nvlist_add_string() makes a copy of the string. See also 4483fb47735c29408c72045469c9c4b3e549668b Reviewed by: scottl MFC after: 3 days Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D30492 (cherry picked from commit 6dbb729d35d59cc8bc8451bd56f220f9c35a43f3) --- lib/libpfctl/libpfctl.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/libpfctl/libpfctl.c b/lib/libpfctl/libpfctl.c index e207a55a8673..ebc026800a1b 100644 --- a/lib/libpfctl/libpfctl.c +++ b/lib/libpfctl/libpfctl.c @@ -130,6 +130,7 @@ pfctl_nv_add_addr(nvlist_t *nvparent, const char *name, nvlist_add_binary(nvl, "addr", addr, sizeof(*addr)); nvlist_add_nvlist(nvparent, name, nvl); + nvlist_destroy(nvl); } static void @@ -159,6 +160,7 @@ pfctl_nv_add_addr_wrap(nvlist_t *nvparent, const char *name, pfctl_nv_add_addr(nvl, "mask", &addr->v.a.mask); nvlist_add_nvlist(nvparent, name, nvl); + nvlist_destroy(nvl); } static void @@ -192,6 +194,7 @@ pfctl_nv_add_rule_addr(nvlist_t *nvparent, const char *name, nvlist_add_number(nvl, "port_op", addr->port_op); nvlist_add_nvlist(nvparent, name, nvl); + nvlist_destroy(nvl); } static void @@ -214,6 +217,7 @@ pfctl_nv_add_mape(nvlist_t *nvparent, const char *name, nvlist_add_number(nvl, "psidlen", mape->psidlen); nvlist_add_number(nvl, "psid", mape->psid); nvlist_add_nvlist(nvparent, name, nvl); + nvlist_destroy(nvl); } static void @@ -234,6 +238,7 @@ pfctl_nv_add_pool(nvlist_t *nvparent, const char *name, pfctl_nv_add_mape(nvl, "mape", &pool->mape); nvlist_add_nvlist(nvparent, name, nvl); + nvlist_destroy(nvl); } static void @@ -277,6 +282,7 @@ pfctl_nv_add_uid(nvlist_t *nvparent, const char *name, nvlist_add_number(nvl, "op", uid->op); nvlist_add_nvlist(nvparent, name, nvl); + nvlist_destroy(nvl); } static void @@ -296,6 +302,7 @@ pfctl_nv_add_divert(nvlist_t *nvparent, const char *name, nvlist_add_number(nvl, "port", r->divert.port); nvlist_add_nvlist(nvparent, name, nvl); + nvlist_destroy(nvl); } static void @@ -511,6 +518,7 @@ pfctl_add_rule(int dev, const struct pfctl_rule *r, const char *anchor, pfctl_nv_add_divert(nvlr, "divert", r); nvlist_add_nvlist(nvl, "rule", nvlr); + nvlist_destroy(nvlr); /* Now do the call. */ nv.data = nvlist_pack(nvl, &nv.len); @@ -625,6 +633,7 @@ pfctl_nv_add_state_cmp(nvlist_t *nvl, const char *name, nvlist_add_number(nv, "direction", cmp->direction); nvlist_add_nvlist(nvl, name, nv); + nvlist_destroy(nv); } static void From owner-dev-commits-src-branches@freebsd.org Thu Jun 3 13:40:35 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 21F62639C9E; Thu, 3 Jun 2021 13:40:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fwn8g07Dnz3KLH; Thu, 3 Jun 2021 13:40:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A53F62961; Thu, 3 Jun 2021 13:40:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 153DeY2G038564; Thu, 3 Jun 2021 13:40:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 153DeY4f038563; Thu, 3 Jun 2021 13:40:34 GMT (envelope-from git) Date: Thu, 3 Jun 2021 13:40:34 GMT Message-Id: <202106031340.153DeY4f038563@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: dec754f05d9c - stable/13 - libpfctl: Improve error handling in pfctl_get_states() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: dec754f05d9cb6ab441dc0993a34e451acbd93dd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jun 2021 13:40:35 -0000 The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=dec754f05d9cb6ab441dc0993a34e451acbd93dd commit dec754f05d9cb6ab441dc0993a34e451acbd93dd Author: Kristof Provost AuthorDate: 2021-05-27 09:43:17 +0000 Commit: Kristof Provost CommitDate: 2021-06-03 13:38:25 +0000 libpfctl: Improve error handling in pfctl_get_states() Ensure that we always free nvlists and other allocated memory. Reviewed by: scottl MFC after: 3 days Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D30493 (cherry picked from commit 27c77f42ae7402c313deec47aa67a8a8e0889410) --- lib/libpfctl/libpfctl.c | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/lib/libpfctl/libpfctl.c b/lib/libpfctl/libpfctl.c index ebc026800a1b..52cd0ed7f36c 100644 --- a/lib/libpfctl/libpfctl.c +++ b/lib/libpfctl/libpfctl.c @@ -731,9 +731,10 @@ int pfctl_get_states(int dev, struct pfctl_states *states) { struct pfioc_nv nv; - nvlist_t *nvl; + nvlist_t *nvl = NULL; const nvlist_t * const *slist; size_t found_count; + int error = 0; bzero(states, sizeof(*states)); TAILQ_INIT(&states->states); @@ -744,14 +745,14 @@ pfctl_get_states(int dev, struct pfctl_states *states) for (;;) { if (ioctl(dev, DIOCGETSTATESNV, &nv)) { - free(nv.data); - return (errno); + error = errno; + goto out; } nvl = nvlist_unpack(nv.data, nv.len, 0); if (nvl == NULL) { - free(nv.data); - return (EIO); + error = EIO; + goto out; } states->count = nvlist_get_number(nvl, "count"); @@ -776,8 +777,10 @@ pfctl_get_states(int dev, struct pfctl_states *states) nv.data = realloc(nv.data, new_size); nv.size = new_size; - if (nv.data == NULL) - return (ENOMEM); + if (nv.data == NULL) { + error = ENOMEM; + goto out; + } continue; } @@ -785,9 +788,8 @@ pfctl_get_states(int dev, struct pfctl_states *states) struct pfctl_state *s = malloc(sizeof(*s)); if (s == NULL) { pfctl_free_states(states); - nvlist_destroy(nvl); - free(nv.data); - return (ENOMEM); + error = ENOMEM; + goto out; } pf_nvstate_to_state(slist[i], s); @@ -796,7 +798,11 @@ pfctl_get_states(int dev, struct pfctl_states *states) break; } - return (0); +out: + nvlist_destroy(nvl); + free(nv.data); + + return (error); } void From owner-dev-commits-src-branches@freebsd.org Thu Jun 3 13:40:35 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4801D6399E3; Thu, 3 Jun 2021 13:40:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fwn8g1BFqz3Kfg; Thu, 3 Jun 2021 13:40:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E89022C12; Thu, 3 Jun 2021 13:40:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 153DeYfs038585; Thu, 3 Jun 2021 13:40:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 153DeYZI038584; Thu, 3 Jun 2021 13:40:34 GMT (envelope-from git) Date: Thu, 3 Jun 2021 13:40:34 GMT Message-Id: <202106031340.153DeYZI038584@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 2e7cd5ec7e62 - stable/12 - libpfctl: Improve error handling in pfctl_get_states() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 2e7cd5ec7e6217355a27754fd53b0645f7fe4e9d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jun 2021 13:40:35 -0000 The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=2e7cd5ec7e6217355a27754fd53b0645f7fe4e9d commit 2e7cd5ec7e6217355a27754fd53b0645f7fe4e9d Author: Kristof Provost AuthorDate: 2021-05-27 09:43:17 +0000 Commit: Kristof Provost CommitDate: 2021-06-03 06:36:54 +0000 libpfctl: Improve error handling in pfctl_get_states() Ensure that we always free nvlists and other allocated memory. Reviewed by: scottl MFC after: 3 days Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D30493 (cherry picked from commit 27c77f42ae7402c313deec47aa67a8a8e0889410) --- lib/libpfctl/libpfctl.c | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/lib/libpfctl/libpfctl.c b/lib/libpfctl/libpfctl.c index ebc026800a1b..52cd0ed7f36c 100644 --- a/lib/libpfctl/libpfctl.c +++ b/lib/libpfctl/libpfctl.c @@ -731,9 +731,10 @@ int pfctl_get_states(int dev, struct pfctl_states *states) { struct pfioc_nv nv; - nvlist_t *nvl; + nvlist_t *nvl = NULL; const nvlist_t * const *slist; size_t found_count; + int error = 0; bzero(states, sizeof(*states)); TAILQ_INIT(&states->states); @@ -744,14 +745,14 @@ pfctl_get_states(int dev, struct pfctl_states *states) for (;;) { if (ioctl(dev, DIOCGETSTATESNV, &nv)) { - free(nv.data); - return (errno); + error = errno; + goto out; } nvl = nvlist_unpack(nv.data, nv.len, 0); if (nvl == NULL) { - free(nv.data); - return (EIO); + error = EIO; + goto out; } states->count = nvlist_get_number(nvl, "count"); @@ -776,8 +777,10 @@ pfctl_get_states(int dev, struct pfctl_states *states) nv.data = realloc(nv.data, new_size); nv.size = new_size; - if (nv.data == NULL) - return (ENOMEM); + if (nv.data == NULL) { + error = ENOMEM; + goto out; + } continue; } @@ -785,9 +788,8 @@ pfctl_get_states(int dev, struct pfctl_states *states) struct pfctl_state *s = malloc(sizeof(*s)); if (s == NULL) { pfctl_free_states(states); - nvlist_destroy(nvl); - free(nv.data); - return (ENOMEM); + error = ENOMEM; + goto out; } pf_nvstate_to_state(slist[i], s); @@ -796,7 +798,11 @@ pfctl_get_states(int dev, struct pfctl_states *states) break; } - return (0); +out: + nvlist_destroy(nvl); + free(nv.data); + + return (error); } void From owner-dev-commits-src-branches@freebsd.org Thu Jun 3 13:53:30 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8B9FC63A425; Thu, 3 Jun 2021 13:53: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 4FwnRZ2N0tz3LQC; Thu, 3 Jun 2021 13:53:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3993D31C9; Thu, 3 Jun 2021 13:53:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 153DrUHH056443; Thu, 3 Jun 2021 13:53:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 153DrUxU056441; Thu, 3 Jun 2021 13:53:30 GMT (envelope-from git) Date: Thu, 3 Jun 2021 13:53:30 GMT Message-Id: <202106031353.153DrUxU056441@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 1569aab1cb38 - stable/13 - Newly added features and bug fixes in latest Microchip SmartPQI driver MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1569aab1cb38a38fb619f343ed1e47d4b4070ffe Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jun 2021 13:53:30 -0000 The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=1569aab1cb38a38fb619f343ed1e47d4b4070ffe commit 1569aab1cb38a38fb619f343ed1e47d4b4070ffe Author: PAPANI SRIKANTH AuthorDate: 2021-05-28 06:17:56 +0000 Commit: Warner Losh CommitDate: 2021-06-03 13:53:06 +0000 Newly added features and bug fixes in latest Microchip SmartPQI driver It includes: 1)Newly added TMF feature. 2)Added newly Huawei & Inspur PCI ID's 3)Fixed smartpqi driver hangs in Z-Pool while running on FreeBSD12.1 4)Fixed flooding dmesg in kernel while the controller is offline during in ioctls. 5)Avoided unnecessary host memory allocation for rcb sg buffers. 6)Fixed race conditions while accessing internal rcb structure. 7)Fixed where Logical volumes exposing two different names to the OS it's due to the system memory is overwritten with DMA stale data. 8)Fixed dynamically unloading a smartpqi driver. 9)Added device_shutdown callback instead of deprecated shutdown_final kernel event in smartpqi driver. 10)Fixed where Os is crashed during physical drive hot removal during heavy IO. 11)Fixed OS crash during controller lockup/offline during heavy IO. 12)Fixed coverity issues in smartpqi driver 13)Fixed system crash while creating and deleting logical volume in a continuous loop. 14)Fixed where the volume size is not exposing to OS when it expands. 15)Added HC3 pci id's. Reviewed by: Scott Benesh (microsemi), Murthy Bhat (microsemi), imp Differential Revision: https://reviews.freebsd.org/D30182 (cherry picked from commit 9fac68fc3853b696c8479bb3a8181d62cb9f59c9) --- sys/dev/smartpqi/smartpqi_cam.c | 586 ++++++++++++++++++----------- sys/dev/smartpqi/smartpqi_cmd.c | 11 +- sys/dev/smartpqi/smartpqi_defines.h | 459 +++++++++++++++------- sys/dev/smartpqi/smartpqi_discovery.c | 668 +++++++++++++++++++++------------ sys/dev/smartpqi/smartpqi_event.c | 94 ++--- sys/dev/smartpqi/smartpqi_helper.c | 289 +++++++++++--- sys/dev/smartpqi/smartpqi_includes.h | 6 +- sys/dev/smartpqi/smartpqi_init.c | 455 ++++++++++++++++------ sys/dev/smartpqi/smartpqi_intr.c | 151 ++++---- sys/dev/smartpqi/smartpqi_ioctl.c | 122 +++--- sys/dev/smartpqi/smartpqi_ioctl.h | 25 +- sys/dev/smartpqi/smartpqi_main.c | 247 +++++++----- sys/dev/smartpqi/smartpqi_mem.c | 74 +++- sys/dev/smartpqi/smartpqi_misc.c | 77 ++-- sys/dev/smartpqi/smartpqi_prototypes.h | 65 +++- sys/dev/smartpqi/smartpqi_queue.c | 236 +++++++----- sys/dev/smartpqi/smartpqi_request.c | 461 ++++++++++++++++++----- sys/dev/smartpqi/smartpqi_response.c | 171 +++++++-- sys/dev/smartpqi/smartpqi_sis.c | 93 +++-- sys/dev/smartpqi/smartpqi_structures.h | 597 +++++++++++++++++++---------- sys/dev/smartpqi/smartpqi_tag.c | 103 ++--- 21 files changed, 3392 insertions(+), 1598 deletions(-) diff --git a/sys/dev/smartpqi/smartpqi_cam.c b/sys/dev/smartpqi/smartpqi_cam.c index c81b5a049da6..3d39e1ffbdd4 100644 --- a/sys/dev/smartpqi/smartpqi_cam.c +++ b/sys/dev/smartpqi/smartpqi_cam.c @@ -1,6 +1,5 @@ /*- - * Copyright (c) 2018 Microsemi Corporation. - * All rights reserved. + * Copyright 2016-2021 Microchip Technology, Inc. and/or its subsidiaries. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -34,11 +33,15 @@ /* * Set cam sim properties of the smartpqi adapter. */ -static void update_sim_properties(struct cam_sim *sim, struct ccb_pathinq *cpi) +static void +update_sim_properties(struct cam_sim *sim, struct ccb_pathinq *cpi) { pqisrc_softstate_t *softs = (struct pqisrc_softstate *) cam_sim_softc(sim); + + device_t dev = softs->os_specific.pqi_dev; + DBG_FUNC("IN\n"); cpi->version_num = 1; @@ -50,9 +53,9 @@ static void update_sim_properties(struct cam_sim *sim, struct ccb_pathinq *cpi) cpi->max_target = 1088; cpi->maxio = (softs->pqi_cap.max_sg_elem - 1) * PAGE_SIZE; cpi->initiator_id = 255; - strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN); - strncpy(cpi->hba_vid, "Microsemi", HBA_IDLEN); - strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN); + strlcpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN); + strlcpy(cpi->hba_vid, "Microsemi", HBA_IDLEN); + strlcpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN); cpi->unit_number = cam_sim_unit(sim); cpi->bus_id = cam_sim_bus(sim); cpi->base_transfer_speed = 1200000; /* Base bus speed in KB/sec */ @@ -61,6 +64,11 @@ static void update_sim_properties(struct cam_sim *sim, struct ccb_pathinq *cpi) cpi->transport = XPORT_SPI; cpi->transport_version = 2; cpi->ccb_h.status = CAM_REQ_CMP; + cpi->hba_vendor = pci_get_vendor(dev); + cpi->hba_device = pci_get_device(dev); + cpi->hba_subvendor = pci_get_subvendor(dev); + cpi->hba_subdevice = pci_get_subdevice(dev); + DBG_FUNC("OUT\n"); } @@ -68,7 +76,8 @@ static void update_sim_properties(struct cam_sim *sim, struct ccb_pathinq *cpi) /* * Get transport settings of the smartpqi adapter */ -static void get_transport_settings(struct pqisrc_softstate *softs, +static void +get_transport_settings(struct pqisrc_softstate *softs, struct ccb_trans_settings *cts) { struct ccb_trans_settings_scsi *scsi = &cts->proto_specific.scsi; @@ -76,7 +85,7 @@ static void get_transport_settings(struct pqisrc_softstate *softs, struct ccb_trans_settings_spi *spi = &cts->xport_specific.spi; DBG_FUNC("IN\n"); - + cts->protocol = PROTO_SCSI; cts->protocol_version = SCSI_REV_SPC4; cts->transport = XPORT_SPI; @@ -94,8 +103,10 @@ static void get_transport_settings(struct pqisrc_softstate *softs, /* * Add the target to CAM layer and rescan, when a new device is found */ -void os_add_device(pqisrc_softstate_t *softs, pqi_scsi_dev_t *device) { - union ccb *ccb; +void +os_add_device(pqisrc_softstate_t *softs, pqi_scsi_dev_t *device) +{ + union ccb *ccb; DBG_FUNC("IN\n"); @@ -121,12 +132,13 @@ void os_add_device(pqisrc_softstate_t *softs, pqi_scsi_dev_t *device) { /* * Remove the device from CAM layer when deleted or hot removed */ -void os_remove_device(pqisrc_softstate_t *softs, - pqi_scsi_dev_t *device) { +void +os_remove_device(pqisrc_softstate_t *softs, pqi_scsi_dev_t *device) +{ struct cam_path *tmppath; DBG_FUNC("IN\n"); - + if(softs->os_specific.sim_registered) { if (xpt_create_path(&tmppath, NULL, cam_sim_path(softs->os_specific.sim), @@ -136,6 +148,7 @@ void os_remove_device(pqisrc_softstate_t *softs, } xpt_async(AC_LOST_DEVICE, tmppath, NULL); xpt_free_path(tmppath); + softs->device_list[device->target][device->lun] = NULL; pqisrc_free_device(softs, device); } @@ -146,7 +159,8 @@ void os_remove_device(pqisrc_softstate_t *softs, /* * Function to release the frozen simq */ -static void pqi_release_camq( rcb_t *rcb ) +static void +pqi_release_camq(rcb_t *rcb) { pqisrc_softstate_t *softs; struct ccb_scsiio *csio; @@ -167,18 +181,12 @@ static void pqi_release_camq( rcb_t *rcb ) DBG_FUNC("OUT\n"); } -/* - * Function to dma-unmap the completed request - */ -static void pqi_unmap_request(void *arg) +static void +pqi_synch_request(rcb_t *rcb) { - pqisrc_softstate_t *softs; - rcb_t *rcb; - - DBG_IO("IN rcb = %p\n", arg); + pqisrc_softstate_t *softs = rcb->softs; - rcb = (rcb_t *)arg; - softs = rcb->softs; + DBG_IO("IN rcb = %p\n", rcb); if (!(rcb->cm_flags & PQI_CMD_MAPPED)) return; @@ -199,9 +207,21 @@ static void pqi_unmap_request(void *arg) if(rcb->sgt && rcb->nseg) os_mem_free(rcb->softs, (void*)rcb->sgt, - rcb->nseg*sizeof(sgt_t)); + rcb->nseg*sizeof(sgt_t)); - pqisrc_put_tag(&softs->taglist, rcb->tag); + DBG_IO("OUT\n"); +} + +/* + * Function to dma-unmap the completed request + */ +static inline void +pqi_unmap_request(rcb_t *rcb) +{ + DBG_IO("IN rcb = %p\n", rcb); + + pqi_synch_request(rcb); + pqisrc_put_tag(&rcb->softs->taglist, rcb->tag); DBG_IO("OUT\n"); } @@ -218,61 +238,103 @@ smartpqi_fix_ld_inquiry(pqisrc_softstate_t *softs, struct ccb_scsiio *csio) DBG_FUNC("IN\n"); + if (pqisrc_ctrl_offline(softs)) + return; + cdb = (csio->ccb_h.flags & CAM_CDB_POINTER) ? (uint8_t *)csio->cdb_io.cdb_ptr : csio->cdb_io.cdb_bytes; - if(cdb[0] == INQUIRY && + if(cdb[0] == INQUIRY && (cdb[1] & SI_EVPD) == 0 && (csio->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN && csio->dxfer_len >= SHORT_INQUIRY_LENGTH) { + inq = (struct scsi_inquiry_data *)csio->data_ptr; device = softs->device_list[csio->ccb_h.target_id][csio->ccb_h.target_lun]; /* Let the disks be probed and dealt with via CAM. Only for LD let it fall through and inquiry be tweaked */ - if( !device || !pqisrc_is_logical_device(device) || - (device->devtype != DISK_DEVICE) || + if (!device || !pqisrc_is_logical_device(device) || + (device->devtype != DISK_DEVICE) || pqisrc_is_external_raid_device(device)) { return; } - strncpy(inq->vendor, "MSCC", - SID_VENDOR_SIZE); - strncpy(inq->product, - pqisrc_raidlevel_to_string(device->raid_level), - SID_PRODUCT_SIZE); + strncpy(inq->vendor, device->vendor, + SID_VENDOR_SIZE); + strncpy(inq->product, + pqisrc_raidlevel_to_string(device->raid_level), + SID_PRODUCT_SIZE); strncpy(inq->revision, device->volume_offline?"OFF":"OK", - SID_REVISION_SIZE); + SID_REVISION_SIZE); } DBG_FUNC("OUT\n"); } +static void +pqi_complete_scsi_io(struct ccb_scsiio *csio, rcb_t *rcb) +{ + uint32_t release_tag; + pqisrc_softstate_t *softs = rcb->softs; + + DBG_IO("IN scsi io = %p\n", csio); + + pqi_synch_request(rcb); + smartpqi_fix_ld_inquiry(rcb->softs, csio); + pqi_release_camq(rcb); + release_tag = rcb->tag; + os_reset_rcb(rcb); + pqisrc_put_tag(&softs->taglist, release_tag); + xpt_done((union ccb *)csio); + + DBG_FUNC("OUT\n"); +} + /* * Handle completion of a command - pass results back through the CCB */ void os_io_response_success(rcb_t *rcb) { - struct ccb_scsiio *csio; + struct ccb_scsiio *csio; DBG_IO("IN rcb = %p\n", rcb); - if (rcb == NULL) + if (rcb == NULL) panic("rcb is null"); csio = (struct ccb_scsiio *)&rcb->cm_ccb->csio; - if (csio == NULL) + if (csio == NULL) panic("csio is null"); rcb->status = REQUEST_SUCCESS; csio->ccb_h.status = CAM_REQ_CMP; - smartpqi_fix_ld_inquiry(rcb->softs, csio); - pqi_release_camq(rcb); - pqi_unmap_request(rcb); - xpt_done((union ccb *)csio); + pqi_complete_scsi_io(csio, rcb); + + DBG_IO("OUT\n"); +} + +static void +copy_sense_data_to_csio(struct ccb_scsiio *csio, + uint8_t *sense_data, uint16_t sense_data_len) +{ + DBG_IO("IN csio = %p\n", csio); + + memset(&csio->sense_data, 0, csio->sense_len); + + sense_data_len = (sense_data_len > csio->sense_len) ? + csio->sense_len : sense_data_len; + + if (sense_data) + memcpy(&csio->sense_data, sense_data, sense_data_len); + + if (csio->sense_len > sense_data_len) + csio->sense_resid = csio->sense_len - sense_data_len; + else + csio->sense_resid = 0; DBG_IO("OUT\n"); } @@ -280,7 +342,8 @@ os_io_response_success(rcb_t *rcb) /* * Error response handling for raid IO */ -void os_raid_response_error(rcb_t *rcb, raid_path_error_info_elem_t *err_info) +void +os_raid_response_error(rcb_t *rcb, raid_path_error_info_elem_t *err_info) { struct ccb_scsiio *csio; pqisrc_softstate_t *softs; @@ -294,10 +357,16 @@ void os_raid_response_error(rcb_t *rcb, raid_path_error_info_elem_t *err_info) softs = rcb->softs; - ASSERT(err_info != NULL); - csio->scsi_status = err_info->status; csio->ccb_h.status = CAM_REQ_CMP_ERR; + if (!err_info || !rcb->dvp) { + DBG_ERR("couldn't be accessed! error info = %p, rcb->dvp = %p\n", + err_info, rcb->dvp); + goto error_out; + } + + csio->scsi_status = err_info->status; + if (csio->ccb_h.func_code == XPT_SCSI_IO) { /* * Handle specific SCSI status values. @@ -305,59 +374,40 @@ void os_raid_response_error(rcb_t *rcb, raid_path_error_info_elem_t *err_info) switch(csio->scsi_status) { case PQI_RAID_STATUS_QUEUE_FULL: csio->ccb_h.status = CAM_REQ_CMP; - DBG_ERR("Queue Full error"); + DBG_ERR("Queue Full error\n"); break; /* check condition, sense data included */ case PQI_RAID_STATUS_CHECK_CONDITION: { - uint16_t sense_data_len = - LE_16(err_info->sense_data_len); - uint8_t *sense_data = NULL; - if (sense_data_len) - sense_data = err_info->data; - memset(&csio->sense_data, 0, csio->sense_len); - sense_data_len = (sense_data_len > - csio->sense_len) ? - csio->sense_len : - sense_data_len; - if (sense_data) - memcpy(&csio->sense_data, sense_data, - sense_data_len); - if (csio->sense_len > sense_data_len) - csio->sense_resid = csio->sense_len - - sense_data_len; - else - csio->sense_resid = 0; - csio->ccb_h.status = CAM_SCSI_STATUS_ERROR + uint16_t sense_data_len = + LE_16(err_info->sense_data_len); + uint8_t *sense_data = NULL; + if (sense_data_len) + sense_data = err_info->data; + copy_sense_data_to_csio(csio, sense_data, sense_data_len); + csio->ccb_h.status = CAM_SCSI_STATUS_ERROR | CAM_AUTOSNS_VALID | CAM_REQ_CMP_ERR; + } break; case PQI_RAID_DATA_IN_OUT_UNDERFLOW: { - uint32_t resid = 0; - resid = rcb->bcount-err_info->data_out_transferred; - csio->resid = resid; - csio->ccb_h.status = CAM_REQ_CMP; - break; + uint32_t resid = 0; + resid = rcb->bcount-err_info->data_out_transferred; + csio->resid = resid; + csio->ccb_h.status = CAM_REQ_CMP; } + break; default: csio->ccb_h.status = CAM_REQ_CMP; break; } } - if (softs->os_specific.pqi_flags & PQI_FLAG_BUSY) { - softs->os_specific.pqi_flags &= ~PQI_FLAG_BUSY; - if (csio->ccb_h.status & CAM_RELEASE_SIMQ) - xpt_release_simq(xpt_path_sim(csio->ccb_h.path), 0); - else - csio->ccb_h.status |= CAM_RELEASE_SIMQ; - } - - pqi_unmap_request(rcb); - xpt_done((union ccb *)csio); +error_out: + pqi_complete_scsi_io(csio, rcb); DBG_IO("OUT\n"); } @@ -365,14 +415,15 @@ void os_raid_response_error(rcb_t *rcb, raid_path_error_info_elem_t *err_info) /* * Error response handling for aio. */ -void os_aio_response_error(rcb_t *rcb, aio_path_error_info_elem_t *err_info) +void +os_aio_response_error(rcb_t *rcb, aio_path_error_info_elem_t *err_info) { struct ccb_scsiio *csio; pqisrc_softstate_t *softs; DBG_IO("IN\n"); - if (rcb == NULL) + if (rcb == NULL) panic("rcb is null"); rcb->status = REQUEST_SUCCESS; @@ -382,6 +433,13 @@ void os_aio_response_error(rcb_t *rcb, aio_path_error_info_elem_t *err_info) softs = rcb->softs; + if (!err_info || !rcb->dvp) { + csio->ccb_h.status = CAM_REQ_CMP_ERR; + DBG_ERR("couldn't be accessed! error info = %p, rcb->dvp = %p\n", + err_info, rcb->dvp); + goto error_out; + } + switch (err_info->service_resp) { case PQI_AIO_SERV_RESPONSE_COMPLETE: csio->ccb_h.status = err_info->status; @@ -402,6 +460,14 @@ void os_aio_response_error(rcb_t *rcb, aio_path_error_info_elem_t *err_info) break; case PQI_AIO_STATUS_AIO_PATH_DISABLED: DBG_WARN_BTL(rcb->dvp,"AIO Path Disabled\n"); + /* Timed out TMF response comes here */ + if (rcb->tm_req) { + rcb->req_pending = false; + rcb->status = REQUEST_SUCCESS; + DBG_ERR("AIO Disabled for TMF\n"); + return; + } + rcb->dvp->aio_enabled = false; rcb->dvp->offload_enabled = false; csio->ccb_h.status |= CAM_REQUEUE_REQ; break; @@ -417,18 +483,24 @@ void os_aio_response_error(rcb_t *rcb, aio_path_error_info_elem_t *err_info) break; case PQI_AIO_SERV_RESPONSE_TMF_COMPLETE: case PQI_AIO_SERV_RESPONSE_TMF_SUCCEEDED: - csio->ccb_h.status = CAM_REQ_CMP; - break; + DBG_ERR("PQI_AIO_SERV_RESPONSE_TMF %s\n", + (err_info->service_resp == PQI_AIO_SERV_RESPONSE_TMF_COMPLETE) ? "COMPLETE" : "SUCCEEDED"); + rcb->status = REQUEST_SUCCESS; + rcb->req_pending = false; + return; case PQI_AIO_SERV_RESPONSE_TMF_REJECTED: case PQI_AIO_SERV_RESPONSE_TMF_INCORRECT_LUN: - DBG_WARN_BTL(rcb->dvp,"TMF rejected/Incorrect Lun\n"); - csio->ccb_h.status |= CAM_SCSI_STATUS_ERROR; - break; + DBG_ERR("PQI_AIO_SERV_RESPONSE_TMF %s\n", + (err_info->service_resp == PQI_AIO_SERV_RESPONSE_TMF_REJECTED) ? "REJECTED" : "INCORRECT LUN"); + rcb->status = REQUEST_FAILED; + rcb->req_pending = false; + return; default: DBG_WARN_BTL(rcb->dvp,"Scsi Status Error\n"); csio->ccb_h.status |= CAM_SCSI_STATUS_ERROR; break; } + if(err_info->data_pres == DATA_PRESENT_SENSE_DATA ) { csio->scsi_status = PQI_AIO_STATUS_CHECK_CONDITION; uint8_t *sense_data = NULL; @@ -437,21 +509,12 @@ void os_aio_response_error(rcb_t *rcb, aio_path_error_info_elem_t *err_info) sense_data = err_info->data; DBG_ERR_BTL(rcb->dvp, "SCSI_STATUS_CHECK_COND sense size %u\n", sense_data_len); - memset(&csio->sense_data, 0, csio->sense_len); - if (sense_data) - memcpy(&csio->sense_data, sense_data, ((sense_data_len > - csio->sense_len) ? csio->sense_len : sense_data_len)); - if (csio->sense_len > sense_data_len) - csio->sense_resid = csio->sense_len - sense_data_len; - else - csio->sense_resid = 0; + copy_sense_data_to_csio(csio, sense_data, sense_data_len); csio->ccb_h.status = CAM_SCSI_STATUS_ERROR | CAM_AUTOSNS_VALID; } - smartpqi_fix_ld_inquiry(softs, csio); - pqi_release_camq(rcb); - pqi_unmap_request(rcb); - xpt_done((union ccb *)csio); +error_out: + pqi_complete_scsi_io(csio, rcb); DBG_IO("OUT\n"); } @@ -470,31 +533,21 @@ pqi_freeze_ccb(union ccb *ccb) static void pqi_request_map_helper(void *arg, bus_dma_segment_t *segs, int nseg, int error) { - pqisrc_softstate_t *softs; - rcb_t *rcb; - - rcb = (rcb_t *)arg; - softs = rcb->softs; + rcb_t *rcb = (rcb_t *)arg; + pqisrc_softstate_t *softs = rcb->softs; + union ccb *ccb; - if( error || nseg > softs->pqi_cap.max_sg_elem ) - { - rcb->cm_ccb->ccb_h.status = CAM_RESRC_UNAVAIL; - pqi_freeze_ccb(rcb->cm_ccb); - DBG_ERR_BTL(rcb->dvp, "map failed err = %d or nseg(%d) > sgelem(%d)\n", + if (error || nseg > softs->pqi_cap.max_sg_elem) { + DBG_ERR_BTL(rcb->dvp, "map failed err = %d or nseg(%d) > sgelem(%d)\n", error, nseg, softs->pqi_cap.max_sg_elem); - pqi_unmap_request(rcb); - xpt_done((union ccb *)rcb->cm_ccb); - return; + goto error_io; } - rcb->sgt = os_mem_alloc(softs, nseg * sizeof(rcb_t)); - if (rcb->sgt == NULL) { - rcb->cm_ccb->ccb_h.status = CAM_RESRC_UNAVAIL; - pqi_freeze_ccb(rcb->cm_ccb); + rcb->sgt = os_mem_alloc(softs, nseg * sizeof(sgt_t)); + + if (!rcb->sgt) { DBG_ERR_BTL(rcb->dvp, "os_mem_alloc() failed; nseg = %d\n", nseg); - pqi_unmap_request(rcb); - xpt_done((union ccb *)rcb->cm_ccb); - return; + goto error_io; } rcb->nseg = nseg; @@ -518,38 +571,46 @@ pqi_request_map_helper(void *arg, bus_dma_segment_t *segs, int nseg, int error) if (error) { rcb->req_pending = false; - rcb->cm_ccb->ccb_h.status = CAM_RESRC_UNAVAIL; - pqi_freeze_ccb(rcb->cm_ccb); DBG_ERR_BTL(rcb->dvp, "Build IO failed, error = %d\n", error); - pqi_unmap_request(rcb); - xpt_done((union ccb *)rcb->cm_ccb); + } else { + /* Successfully IO was submitted to the device. */ return; } + +error_io: + ccb = rcb->cm_ccb; + ccb->ccb_h.status = CAM_RESRC_UNAVAIL; + pqi_freeze_ccb(ccb); + pqi_unmap_request(rcb); + xpt_done(ccb); + return; } /* - * Function to dma-map the request buffer + * Function to dma-map the request buffer */ -static int pqi_map_request( rcb_t *rcb ) +static int +pqi_map_request(rcb_t *rcb) { pqisrc_softstate_t *softs = rcb->softs; - int error = PQI_STATUS_SUCCESS; + int bsd_status = BSD_SUCCESS; union ccb *ccb = rcb->cm_ccb; DBG_FUNC("IN\n"); /* check that mapping is necessary */ if (rcb->cm_flags & PQI_CMD_MAPPED) - return(0); + return BSD_SUCCESS; + rcb->cm_flags |= PQI_CMD_MAPPED; if (rcb->bcount) { - error = bus_dmamap_load_ccb(softs->os_specific.pqi_buffer_dmat, + bsd_status = bus_dmamap_load_ccb(softs->os_specific.pqi_buffer_dmat, rcb->cm_datamap, ccb, pqi_request_map_helper, rcb, 0); - if (error != 0){ - DBG_ERR_BTL(rcb->dvp, "bus_dmamap_load_ccb failed = %d count = %d\n", - error, rcb->bcount); - return error; + if (bsd_status != BSD_SUCCESS && bsd_status != EINPROGRESS) { + DBG_ERR_BTL(rcb->dvp, "bus_dmamap_load_ccb failed, return status = %d transfer length = %d\n", + bsd_status, rcb->bcount); + return bsd_status; } } else { /* @@ -560,18 +621,21 @@ static int pqi_map_request( rcb_t *rcb ) /* Call IO functions depending on pd or ld */ rcb->status = REQUEST_PENDING; - error = pqisrc_build_send_io(softs, rcb); + if (pqisrc_build_send_io(softs, rcb) != PQI_STATUS_SUCCESS) { + bsd_status = EIO; + } } - DBG_FUNC("OUT error = %d\n", error); + DBG_FUNC("OUT error = %d\n", bsd_status); - return error; + return bsd_status; } /* * Function to clear the request control block */ -void os_reset_rcb( rcb_t *rcb ) +void +os_reset_rcb(rcb_t *rcb) { rcb->error_info = NULL; rcb->req = NULL; @@ -582,7 +646,7 @@ void os_reset_rcb( rcb_t *rcb ) rcb->softs = NULL; rcb->cm_flags = 0; rcb->cm_data = NULL; - rcb->bcount = 0; + rcb->bcount = 0; rcb->nseg = 0; rcb->sgt = NULL; rcb->cm_ccb = NULL; @@ -590,30 +654,39 @@ void os_reset_rcb( rcb_t *rcb ) rcb->ioaccel_handle = 0; rcb->resp_qid = 0; rcb->req_pending = false; + rcb->tm_req = false; } /* * Callback function for the lun rescan */ -static void smartpqi_lunrescan_cb(struct cam_periph *periph, union ccb *ccb) +static void +smartpqi_lunrescan_cb(struct cam_periph *periph, union ccb *ccb) { xpt_free_path(ccb->ccb_h.path); xpt_free_ccb(ccb); } + /* * Function to rescan the lun */ -static void smartpqi_lun_rescan(struct pqisrc_softstate *softs, int target, +static void +smartpqi_lun_rescan(struct pqisrc_softstate *softs, int target, int lun) { - union ccb *ccb = NULL; - cam_status status = 0; - struct cam_path *path = NULL; + union ccb *ccb = NULL; + cam_status status = 0; + struct cam_path *path = NULL; DBG_FUNC("IN\n"); ccb = xpt_alloc_ccb_nowait(); + if (ccb == NULL) { + DBG_ERR("Unable to alloc ccb for lun rescan\n"); + return; + } + status = xpt_create_path(&path, NULL, cam_sim_path(softs->os_specific.sim), target, lun); if (status != CAM_REQ_CMP) { @@ -623,6 +696,7 @@ static void smartpqi_lun_rescan(struct pqisrc_softstate *softs, int target, return; } + bzero(ccb, sizeof(union ccb)); xpt_setup_ccb(&ccb->ccb_h, path, 5); ccb->ccb_h.func_code = XPT_SCAN_LUN; ccb->ccb_h.cbfcnp = smartpqi_lunrescan_cb; @@ -636,7 +710,8 @@ static void smartpqi_lun_rescan(struct pqisrc_softstate *softs, int target, /* * Function to rescan the lun under each target */ -void smartpqi_target_rescan(struct pqisrc_softstate *softs) +void +smartpqi_target_rescan(struct pqisrc_softstate *softs) { int target = 0, lun = 0; @@ -656,7 +731,8 @@ void smartpqi_target_rescan(struct pqisrc_softstate *softs) /* * Set the mode of tagged command queueing for the current task. */ -uint8_t os_get_task_attr(rcb_t *rcb) +uint8_t +os_get_task_attr(rcb_t *rcb) { union ccb *ccb = rcb->cm_ccb; uint8_t tag_action = SOP_TASK_ATTRIBUTE_SIMPLE; @@ -679,19 +755,24 @@ uint8_t os_get_task_attr(rcb_t *rcb) /* * Complete all outstanding commands */ -void os_complete_outstanding_cmds_nodevice(pqisrc_softstate_t *softs) +void +os_complete_outstanding_cmds_nodevice(pqisrc_softstate_t *softs) { int tag = 0; + pqi_scsi_dev_t *dvp = NULL; DBG_FUNC("IN\n"); - for (tag = 1; tag < softs->max_outstanding_io; tag++) { + for (tag = 1; tag <= softs->max_outstanding_io; tag++) { rcb_t *prcb = &softs->rcb[tag]; + dvp = prcb->dvp; if(prcb->req_pending && prcb->cm_ccb ) { prcb->req_pending = false; prcb->cm_ccb->ccb_h.status = CAM_REQ_ABORTED | CAM_REQ_CMP; - xpt_done((union ccb *)prcb->cm_ccb); - prcb->cm_ccb = NULL; + pqi_complete_scsi_io(&prcb->cm_ccb->csio, prcb); + if (dvp) + pqisrc_decrement_device_active_io(softs, dvp); + } } @@ -701,21 +782,22 @@ void os_complete_outstanding_cmds_nodevice(pqisrc_softstate_t *softs) /* * IO handling functionality entry point */ -static int pqisrc_io_start(struct cam_sim *sim, union ccb *ccb) +static int +pqisrc_io_start(struct cam_sim *sim, union ccb *ccb) { rcb_t *rcb; uint32_t tag, no_transfer = 0; pqisrc_softstate_t *softs = (struct pqisrc_softstate *) cam_sim_softc(sim); - int32_t error = PQI_STATUS_FAILURE; + int32_t error; pqi_scsi_dev_t *dvp; DBG_FUNC("IN\n"); - if( softs->device_list[ccb->ccb_h.target_id][ccb->ccb_h.target_lun] == NULL ) { + if (softs->device_list[ccb->ccb_h.target_id][ccb->ccb_h.target_lun] == NULL) { ccb->ccb_h.status = CAM_DEV_NOT_THERE; DBG_INFO("Device = %d not there\n", ccb->ccb_h.target_id); - return PQI_STATUS_FAILURE; + return ENXIO; } dvp = softs->device_list[ccb->ccb_h.target_id][ccb->ccb_h.target_lun]; @@ -724,40 +806,40 @@ static int pqisrc_io_start(struct cam_sim *sim, union ccb *ccb) ccb->ccb_h.status = CAM_SCSI_BUS_RESET | CAM_BUSY | CAM_REQ_INPROG; DBG_WARN("Device = %d BUSY/IN_RESET\n", ccb->ccb_h.target_id); - return error; + return ENXIO; } /* Check device state */ if (pqisrc_ctrl_offline(softs) || DEV_GONE(dvp)) { ccb->ccb_h.status = CAM_DEV_NOT_THERE | CAM_REQ_CMP; DBG_WARN("Device = %d GONE/OFFLINE\n", ccb->ccb_h.target_id); - return error; + return ENXIO; } /* Check device reset */ - if (dvp->reset_in_progress) { + if (DEVICE_RESET(dvp)) { ccb->ccb_h.status = CAM_SCSI_BUSY | CAM_REQ_INPROG | CAM_BUSY; DBG_WARN("Device %d reset returned busy\n", ccb->ccb_h.target_id); - return error; + return EBUSY; } if (dvp->expose_device == false) { ccb->ccb_h.status = CAM_DEV_NOT_THERE; DBG_INFO("Device = %d not exposed\n", ccb->ccb_h.target_id); - return error; + return ENXIO; } tag = pqisrc_get_tag(&softs->taglist); - if( tag == INVALID_ELEM ) { + if (tag == INVALID_ELEM) { DBG_ERR("Get Tag failed\n"); xpt_freeze_simq(softs->os_specific.sim, 1); softs->os_specific.pqi_flags |= PQI_FLAG_BUSY; ccb->ccb_h.status |= (CAM_REQUEUE_REQ | CAM_RELEASE_SIMQ); - return PQI_STATUS_FAILURE; + return EIO; } DBG_IO("tag = %d &softs->taglist : %p\n", tag, &softs->taglist); rcb = &softs->rcb[tag]; - os_reset_rcb( rcb ); + os_reset_rcb(rcb); rcb->tag = tag; rcb->softs = softs; rcb->cmdlen = ccb->csio.cdb_len; @@ -794,57 +876,72 @@ static int pqisrc_io_start(struct cam_sim *sim, union ccb *ccb) * if we ever learn a transport layer other than simple, may fail * if the adapter rejects the command). */ - if ((error = pqi_map_request(rcb)) != 0) { - rcb->req_pending = false; + if ((error = pqi_map_request(rcb)) != BSD_SUCCESS) { xpt_freeze_simq(softs->os_specific.sim, 1); - ccb->ccb_h.status |= CAM_RELEASE_SIMQ; if (error == EINPROGRESS) { - DBG_WARN("In Progress on %d\n", ccb->ccb_h.target_id); - error = 0; + /* Release simq in the completion */ + softs->os_specific.pqi_flags |= PQI_FLAG_BUSY; + error = BSD_SUCCESS; } else { - ccb->ccb_h.status |= CAM_REQUEUE_REQ; + rcb->req_pending = false; + ccb->ccb_h.status |= CAM_REQUEUE_REQ | CAM_RELEASE_SIMQ; DBG_WARN("Requeue req error = %d target = %d\n", error, ccb->ccb_h.target_id); pqi_unmap_request(rcb); + error = EIO; } } DBG_FUNC("OUT error = %d\n", error); + return error; } +static inline int +pqi_tmf_status_to_bsd_tmf_status(int pqi_status, rcb_t *rcb) +{ + if (PQI_STATUS_SUCCESS == pqi_status && + REQUEST_SUCCESS == rcb->status) + return BSD_SUCCESS; + else + return EIO; +} + /* * Abort a task, task management functionality */ static int pqisrc_scsi_abort_task(pqisrc_softstate_t *softs, union ccb *ccb) { - rcb_t *rcb = ccb->ccb_h.sim_priv.entries[0].ptr; - uint32_t abort_tag = rcb->tag; - uint32_t tag = 0; - int rval = PQI_STATUS_SUCCESS; - uint16_t qid; - - DBG_FUNC("IN\n"); + struct ccb_hdr *ccb_h = &ccb->ccb_h; + rcb_t *rcb = NULL; + rcb_t *prcb = ccb->ccb_h.sim_priv.entries[0].ptr; + uint32_t tag; + int rval; - qid = (uint16_t)rcb->resp_qid; + DBG_FUNC("IN\n"); tag = pqisrc_get_tag(&softs->taglist); rcb = &softs->rcb[tag]; rcb->tag = tag; - rcb->resp_qid = qid; - rval = pqisrc_send_tmf(softs, rcb->dvp, rcb, abort_tag, + if (!rcb->dvp) { + DBG_ERR("dvp is null, tmf type : 0x%x\n", ccb_h->func_code); + rval = ENXIO; + goto error_tmf; + } + + rcb->tm_req = true; + + rval = pqisrc_send_tmf(softs, rcb->dvp, rcb, prcb, SOP_TASK_MANAGEMENT_FUNCTION_ABORT_TASK); - if (PQI_STATUS_SUCCESS == rval) { - rval = rcb->status; - if (REQUEST_SUCCESS == rval) { - ccb->ccb_h.status = CAM_REQ_ABORTED; - } - } - pqisrc_put_tag(&softs->taglist, abort_tag); - pqisrc_put_tag(&softs->taglist,rcb->tag); + if ((rval = pqi_tmf_status_to_bsd_tmf_status(rval, rcb)) == BSD_SUCCESS) + ccb->ccb_h.status = CAM_REQ_ABORTED; + +error_tmf: + os_reset_rcb(rcb); + pqisrc_put_tag(&softs->taglist, tag); DBG_FUNC("OUT rval = %d\n", rval); @@ -857,9 +954,10 @@ pqisrc_scsi_abort_task(pqisrc_softstate_t *softs, union ccb *ccb) static int pqisrc_scsi_abort_task_set(pqisrc_softstate_t *softs, union ccb *ccb) { + struct ccb_hdr *ccb_h = &ccb->ccb_h; rcb_t *rcb = NULL; - uint32_t tag = 0; - int rval = PQI_STATUS_SUCCESS; + uint32_t tag; + int rval; DBG_FUNC("IN\n"); @@ -867,14 +965,22 @@ pqisrc_scsi_abort_task_set(pqisrc_softstate_t *softs, union ccb *ccb) rcb = &softs->rcb[tag]; rcb->tag = tag; - rval = pqisrc_send_tmf(softs, rcb->dvp, rcb, 0, + if (!rcb->dvp) { + DBG_ERR("dvp is null, tmf type : 0x%x\n", ccb_h->func_code); + rval = ENXIO; + goto error_tmf; *** 9201 LINES SKIPPED *** From owner-dev-commits-src-branches@freebsd.org Thu Jun 3 13:53:31 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 867FC639FBE; Thu, 3 Jun 2021 13:53: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 4FwnRb3MSbz3Lf2; Thu, 3 Jun 2021 13:53:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 526D2257D; Thu, 3 Jun 2021 13:53:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 153DrV8B056469; Thu, 3 Jun 2021 13:53:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 153DrVqF056468; Thu, 3 Jun 2021 13:53:31 GMT (envelope-from git) Date: Thu, 3 Jun 2021 13:53:31 GMT Message-Id: <202106031353.153DrVqF056468@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 92f49c769b4e - stable/13 - smartpqi: clear CCBs allocated on the stack MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 92f49c769b4ef51163151c3991357a08941e232d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jun 2021 13:53:31 -0000 The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=92f49c769b4ef51163151c3991357a08941e232d commit 92f49c769b4ef51163151c3991357a08941e232d Author: Edward Tomasz Napierala AuthorDate: 2021-05-28 06:33:37 +0000 Commit: Warner Losh CommitDate: 2021-06-03 13:53:12 +0000 smartpqi: clear CCBs allocated on the stack Differential Revision: https://reviews.freebsd.org/D30299 (cherry picked from commit e20e60be501204c3ba742e266afecc6c6e498a6c) --- sys/dev/smartpqi/smartpqi_cam.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/dev/smartpqi/smartpqi_cam.c b/sys/dev/smartpqi/smartpqi_cam.c index 3d39e1ffbdd4..e389eb143e4a 100644 --- a/sys/dev/smartpqi/smartpqi_cam.c +++ b/sys/dev/smartpqi/smartpqi_cam.c @@ -1140,6 +1140,7 @@ smartpqi_adjust_queue_depth(struct cam_path *path, uint32_t queue_depth) DBG_INFO("IN\n"); + memset(&crs, 0, sizeof(crs)); xpt_setup_ccb(&crs.ccb_h, path, 5); crs.ccb_h.func_code = XPT_REL_SIMQ; crs.ccb_h.flags = CAM_DEV_QFREEZE; @@ -1262,6 +1263,7 @@ register_sim(struct pqisrc_softstate *softs, int card_index) * derived from the FW. */ softs->os_specific.path = ccb->ccb_h.path; + memset(&csa, 0, sizeof(csa)); xpt_setup_ccb(&csa.ccb_h, softs->os_specific.path, 5); csa.ccb_h.func_code = XPT_SASYNC_CB; csa.event_enable = AC_FOUND_DEVICE; @@ -1294,6 +1296,7 @@ deregister_sim(struct pqisrc_softstate *softs) } + memset(&csa, 0, sizeof(csa)); xpt_setup_ccb(&csa.ccb_h, softs->os_specific.path, 5); csa.ccb_h.func_code = XPT_SASYNC_CB; csa.event_enable = 0; From owner-dev-commits-src-branches@freebsd.org Fri Jun 4 00:28:31 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EDF70643B3F; Fri, 4 Jun 2021 00:28: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 4Fx3XH6PWyz3H8K; Fri, 4 Jun 2021 00:28:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C421B13457; Fri, 4 Jun 2021 00:28:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1540SVfB093625; Fri, 4 Jun 2021 00:28:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1540SVTc093624; Fri, 4 Jun 2021 00:28:31 GMT (envelope-from git) Date: Fri, 4 Jun 2021 00:28:31 GMT Message-Id: <202106040028.1540SVTc093624@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: 36da5710d3e4 - stable/13 - aic7xxx: Fix re-building firmware with -fno-common MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 36da5710d3e4b3e3412ef7e4826506f9d64b0b35 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jun 2021 00:28:32 -0000 The branch stable/13 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=36da5710d3e4b3e3412ef7e4826506f9d64b0b35 commit 36da5710d3e4b3e3412ef7e4826506f9d64b0b35 Author: Jessica Clarke AuthorDate: 2021-05-28 18:07:17 +0000 Commit: Jessica Clarke CommitDate: 2021-06-04 00:28:15 +0000 aic7xxx: Fix re-building firmware with -fno-common The generated C output for aicasm_scan.l defines yylineno already, so references to it from other files should use an extern declaration. The STAILQ_HEAD use in aicasm_symbol.h also provided an identifier, causing it to both define the struct type and define a variable of that struct type, causing any C file including the header to define the same variable. This variable is not used (and confusingly clashes with a field name just below) and was likely caused by confusion when switching between defining fields using similar type macros and defining the type itself. Reviewed by: imp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D30525 (cherry picked from commit 5e912f5fec025766521f535d1237330ede7f18e2) --- sys/dev/aic7xxx/aicasm/aicasm_gram.y | 2 +- sys/dev/aic7xxx/aicasm/aicasm_symbol.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/aic7xxx/aicasm/aicasm_gram.y b/sys/dev/aic7xxx/aicasm/aicasm_gram.y index c479c8fdf2db..d32793f4c12b 100644 --- a/sys/dev/aic7xxx/aicasm/aicasm_gram.y +++ b/sys/dev/aic7xxx/aicasm/aicasm_gram.y @@ -59,7 +59,7 @@ #include "aicasm_symbol.h" #include "aicasm_insformat.h" -int yylineno; +extern int yylineno; char *yyfilename; char stock_prefix[] = "aic_"; char *prefix = stock_prefix; diff --git a/sys/dev/aic7xxx/aicasm/aicasm_symbol.h b/sys/dev/aic7xxx/aicasm/aicasm_symbol.h index 616dfd28fdeb..a15fa12176d1 100644 --- a/sys/dev/aic7xxx/aicasm/aicasm_symbol.h +++ b/sys/dev/aic7xxx/aicasm/aicasm_symbol.h @@ -110,7 +110,7 @@ struct macro_arg { regex_t arg_regex; char *replacement_text; }; -STAILQ_HEAD(macro_arg_list, macro_arg) args; +STAILQ_HEAD(macro_arg_list, macro_arg); struct macro_info { struct macro_arg_list args; From owner-dev-commits-src-branches@freebsd.org Fri Jun 4 00:29:01 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3DB4A643CBB; Fri, 4 Jun 2021 00:29:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fx3Xs1Gv4z3H1V; Fri, 4 Jun 2021 00:29:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 14004137D1; Fri, 4 Jun 2021 00:29:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1540T02r093767; Fri, 4 Jun 2021 00:29:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1540T0v5093766; Fri, 4 Jun 2021 00:29:00 GMT (envelope-from git) Date: Fri, 4 Jun 2021 00:29:00 GMT Message-Id: <202106040029.1540T0v5093766@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: 5e478926f04a - stable/12 - aic7xxx: Fix re-building firmware with -fno-common MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 5e478926f04a8ad0c2401744bcb477e363ea97f9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jun 2021 00:29:01 -0000 The branch stable/12 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=5e478926f04a8ad0c2401744bcb477e363ea97f9 commit 5e478926f04a8ad0c2401744bcb477e363ea97f9 Author: Jessica Clarke AuthorDate: 2021-05-28 18:07:17 +0000 Commit: Jessica Clarke CommitDate: 2021-06-04 00:28:45 +0000 aic7xxx: Fix re-building firmware with -fno-common The generated C output for aicasm_scan.l defines yylineno already, so references to it from other files should use an extern declaration. The STAILQ_HEAD use in aicasm_symbol.h also provided an identifier, causing it to both define the struct type and define a variable of that struct type, causing any C file including the header to define the same variable. This variable is not used (and confusingly clashes with a field name just below) and was likely caused by confusion when switching between defining fields using similar type macros and defining the type itself. Reviewed by: imp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D30525 (cherry picked from commit 5e912f5fec025766521f535d1237330ede7f18e2) --- sys/dev/aic7xxx/aicasm/aicasm_gram.y | 2 +- sys/dev/aic7xxx/aicasm/aicasm_symbol.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/aic7xxx/aicasm/aicasm_gram.y b/sys/dev/aic7xxx/aicasm/aicasm_gram.y index c479c8fdf2db..d32793f4c12b 100644 --- a/sys/dev/aic7xxx/aicasm/aicasm_gram.y +++ b/sys/dev/aic7xxx/aicasm/aicasm_gram.y @@ -59,7 +59,7 @@ #include "aicasm_symbol.h" #include "aicasm_insformat.h" -int yylineno; +extern int yylineno; char *yyfilename; char stock_prefix[] = "aic_"; char *prefix = stock_prefix; diff --git a/sys/dev/aic7xxx/aicasm/aicasm_symbol.h b/sys/dev/aic7xxx/aicasm/aicasm_symbol.h index 616dfd28fdeb..a15fa12176d1 100644 --- a/sys/dev/aic7xxx/aicasm/aicasm_symbol.h +++ b/sys/dev/aic7xxx/aicasm/aicasm_symbol.h @@ -110,7 +110,7 @@ struct macro_arg { regex_t arg_regex; char *replacement_text; }; -STAILQ_HEAD(macro_arg_list, macro_arg) args; +STAILQ_HEAD(macro_arg_list, macro_arg); struct macro_info { struct macro_arg_list args; From owner-dev-commits-src-branches@freebsd.org Fri Jun 4 00:30:18 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5BCEF643AD3; Fri, 4 Jun 2021 00:30: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 4Fx3ZL28bLz3HHn; Fri, 4 Jun 2021 00:30:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3264713749; Fri, 4 Jun 2021 00:30:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1540UIkG000634; Fri, 4 Jun 2021 00:30:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1540UIuF000628; Fri, 4 Jun 2021 00:30:18 GMT (envelope-from git) Date: Fri, 4 Jun 2021 00:30:18 GMT Message-Id: <202106040030.1540UIuF000628@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: b305e1dfbf69 - stable/11 - aic7xxx: Fix re-building firmware with -fno-common MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/11 X-Git-Reftype: branch X-Git-Commit: b305e1dfbf695d9082661cdb9cae830cdc592b32 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jun 2021 00:30:18 -0000 The branch stable/11 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=b305e1dfbf695d9082661cdb9cae830cdc592b32 commit b305e1dfbf695d9082661cdb9cae830cdc592b32 Author: Jessica Clarke AuthorDate: 2021-05-28 18:07:17 +0000 Commit: Jessica Clarke CommitDate: 2021-06-04 00:30:10 +0000 aic7xxx: Fix re-building firmware with -fno-common The generated C output for aicasm_scan.l defines yylineno already, so references to it from other files should use an extern declaration. The STAILQ_HEAD use in aicasm_symbol.h also provided an identifier, causing it to both define the struct type and define a variable of that struct type, causing any C file including the header to define the same variable. This variable is not used (and confusingly clashes with a field name just below) and was likely caused by confusion when switching between defining fields using similar type macros and defining the type itself. Reviewed by: imp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D30525 (cherry picked from commit 5e912f5fec025766521f535d1237330ede7f18e2) --- sys/dev/aic7xxx/aicasm/aicasm_gram.y | 2 +- sys/dev/aic7xxx/aicasm/aicasm_symbol.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/aic7xxx/aicasm/aicasm_gram.y b/sys/dev/aic7xxx/aicasm/aicasm_gram.y index 87fe1a25bf0a..746eb29d84db 100644 --- a/sys/dev/aic7xxx/aicasm/aicasm_gram.y +++ b/sys/dev/aic7xxx/aicasm/aicasm_gram.y @@ -57,7 +57,7 @@ #include "aicasm_symbol.h" #include "aicasm_insformat.h" -int yylineno; +extern int yylineno; char *yyfilename; char stock_prefix[] = "aic_"; char *prefix = stock_prefix; diff --git a/sys/dev/aic7xxx/aicasm/aicasm_symbol.h b/sys/dev/aic7xxx/aicasm/aicasm_symbol.h index 3242152c943b..ec88d494cb6f 100644 --- a/sys/dev/aic7xxx/aicasm/aicasm_symbol.h +++ b/sys/dev/aic7xxx/aicasm/aicasm_symbol.h @@ -108,7 +108,7 @@ struct macro_arg { regex_t arg_regex; char *replacement_text; }; -STAILQ_HEAD(macro_arg_list, macro_arg) args; +STAILQ_HEAD(macro_arg_list, macro_arg); struct macro_info { struct macro_arg_list args; From owner-dev-commits-src-branches@freebsd.org Fri Jun 4 00:44:26 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E43BB64439A; Fri, 4 Jun 2021 00:44:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fx3tf67rLz3Hhm; Fri, 4 Jun 2021 00:44:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BACBE13D95; Fri, 4 Jun 2021 00:44:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1540iQAN020530; Fri, 4 Jun 2021 00:44:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1540iQk9020529; Fri, 4 Jun 2021 00:44:26 GMT (envelope-from git) Date: Fri, 4 Jun 2021 00:44:26 GMT Message-Id: <202106040044.1540iQk9020529@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 99e1896f20a3 - stable/13 - rtld direct exec: add option to ignore LD_ variables MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 99e1896f20a3d7702aedc00c1220bdac12d1580a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jun 2021 00:44:27 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=99e1896f20a3d7702aedc00c1220bdac12d1580a commit 99e1896f20a3d7702aedc00c1220bdac12d1580a Author: Konstantin Belousov AuthorDate: 2021-05-28 23:59:07 +0000 Commit: Konstantin Belousov CommitDate: 2021-06-04 00:32:50 +0000 rtld direct exec: add option to ignore LD_ variables (cherry picked from commit d81f999ac22342789f2b3e21206d83d410be4df3) --- libexec/rtld-elf/rtld.1 | 10 +++++++++- libexec/rtld-elf/rtld.c | 3 +++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/libexec/rtld-elf/rtld.1 b/libexec/rtld-elf/rtld.1 index 47bdc028b22d..522382d24b16 100644 --- a/libexec/rtld-elf/rtld.1 +++ b/libexec/rtld-elf/rtld.1 @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 1, 2020 +.Dd March 24, 2021 .Dt RTLD 1 .Os .Sh NAME @@ -131,6 +131,7 @@ all the environment variables listed below, but is being prefixed with .Ev LD_32_ , for example: .Ev LD_32_TRACE_LOADED_OBJECTS . +If the activated image is setuid or setgid, the variables are ignored. .Bl -tag -width ".Ev LD_LIBMAP_DISABLE" .It Ev LD_DUMP_REL_POST If set, @@ -305,6 +306,8 @@ The syntax of the direct invocation is .Op Fl b Ar exe .Op Fl f Ar fd .Op Fl p +.Op Fl t +.Op Fl v .Op Fl - .Pa image_path .Op Ar image arguments @@ -345,6 +348,11 @@ character, uses the search path provided by the environment variable .Dv PATH to find the binary to execute. +.It Fl t +Ignore all +.Ev LD_ +environment variables that otherwise affect the dynamic +linker behavior. .It Fl v Display information about this run-time linker binary, then exit. .It Fl - diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 2943c1d06fa3..ae74f7b9a543 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -5773,6 +5773,8 @@ parse_args(char* argv[], int argc, bool *use_pathp, int *fdp, break; } else if (opt == 'p') { *use_pathp = true; + } else if (opt == 't') { + trust = false; } else if (opt == 'v') { machine[0] = '\0'; mib[0] = CTL_HW; @@ -5843,6 +5845,7 @@ print_usage(const char *argv0) " -b Execute instead of , arg0 is \n" " -f Execute instead of searching for \n" " -p Search in PATH for named binary\n" + " -t Ignore LD_ environment variables\n" " -v Display identification information\n" " -- End of RTLD options\n" " Name of process to execute\n" From owner-dev-commits-src-branches@freebsd.org Fri Jun 4 00:44:28 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0ECD96441C1; Fri, 4 Jun 2021 00:44: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 4Fx3tg73pFz3HwN; Fri, 4 Jun 2021 00:44:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DBFD813C98; Fri, 4 Jun 2021 00:44:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1540iRWL020554; Fri, 4 Jun 2021 00:44:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1540iRHK020553; Fri, 4 Jun 2021 00:44:27 GMT (envelope-from git) Date: Fri, 4 Jun 2021 00:44:27 GMT Message-Id: <202106040044.1540iRHK020553@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 59a876238f66 - stable/13 - rtld: Rename -t option to -u (ignore LD_ vars) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 59a876238f66ccd682336e6a33826ec0f271acc1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jun 2021 00:44:28 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=59a876238f66ccd682336e6a33826ec0f271acc1 commit 59a876238f66ccd682336e6a33826ec0f271acc1 Author: Konstantin Belousov AuthorDate: 2021-06-02 22:50:49 +0000 Commit: Konstantin Belousov CommitDate: 2021-06-04 00:32:50 +0000 rtld: Rename -t option to -u (ignore LD_ vars) (cherry picked from commit e3149e0a02d6d09fb4c3acd085da2509dbab7320) --- libexec/rtld-elf/rtld.1 | 6 +++--- libexec/rtld-elf/rtld.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libexec/rtld-elf/rtld.1 b/libexec/rtld-elf/rtld.1 index 522382d24b16..41b010a2376c 100644 --- a/libexec/rtld-elf/rtld.1 +++ b/libexec/rtld-elf/rtld.1 @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 24, 2021 +.Dd June 2, 2021 .Dt RTLD 1 .Os .Sh NAME @@ -306,7 +306,7 @@ The syntax of the direct invocation is .Op Fl b Ar exe .Op Fl f Ar fd .Op Fl p -.Op Fl t +.Op Fl u .Op Fl v .Op Fl - .Pa image_path @@ -348,7 +348,7 @@ character, uses the search path provided by the environment variable .Dv PATH to find the binary to execute. -.It Fl t +.It Fl u Ignore all .Ev LD_ environment variables that otherwise affect the dynamic diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index ae74f7b9a543..34c42969c779 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -5773,7 +5773,7 @@ parse_args(char* argv[], int argc, bool *use_pathp, int *fdp, break; } else if (opt == 'p') { *use_pathp = true; - } else if (opt == 't') { + } else if (opt == 'u') { trust = false; } else if (opt == 'v') { machine[0] = '\0'; @@ -5845,7 +5845,7 @@ print_usage(const char *argv0) " -b Execute instead of , arg0 is \n" " -f Execute instead of searching for \n" " -p Search in PATH for named binary\n" - " -t Ignore LD_ environment variables\n" + " -u Ignore LD_ environment variables\n" " -v Display identification information\n" " -- End of RTLD options\n" " Name of process to execute\n" From owner-dev-commits-src-branches@freebsd.org Fri Jun 4 00:44:29 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 65A376445A0; Fri, 4 Jun 2021 00:44: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 4Fx3tj27chz3HWR; Fri, 4 Jun 2021 00:44:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2242A13BA1; Fri, 4 Jun 2021 00:44:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1540iSsY020579; Fri, 4 Jun 2021 00:44:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1540iSBt020578; Fri, 4 Jun 2021 00:44:28 GMT (envelope-from git) Date: Fri, 4 Jun 2021 00:44:28 GMT Message-Id: <202106040044.1540iSBt020578@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 14bc67f1e788 - stable/13 - x86: initialize initial FPU state earlier MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 14bc67f1e78806c683df8d7ae65d14db8216d5a3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jun 2021 00:44:29 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=14bc67f1e78806c683df8d7ae65d14db8216d5a3 commit 14bc67f1e78806c683df8d7ae65d14db8216d5a3 Author: Konstantin Belousov AuthorDate: 2021-05-27 16:26:10 +0000 Commit: Konstantin Belousov CommitDate: 2021-06-04 00:43:59 +0000 x86: initialize initial FPU state earlier PR: 255997 (cherry picked from commit c56de177d28295b4b07ad0b17e4faf4f11c9e4f2) --- sys/amd64/amd64/fpu.c | 2 +- sys/i386/i386/npx.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/amd64/amd64/fpu.c b/sys/amd64/amd64/fpu.c index b9723266ea37..20e3dd34405d 100644 --- a/sys/amd64/amd64/fpu.c +++ b/sys/amd64/amd64/fpu.c @@ -495,7 +495,7 @@ fpuinitstate(void *arg __unused) intr_restore(saveintr); } /* EFIRT needs this to be initialized before we can enter our EFI environment */ -SYSINIT(fpuinitstate, SI_SUB_DRIVERS, SI_ORDER_FIRST, fpuinitstate, NULL); +SYSINIT(fpuinitstate, SI_SUB_CPU, SI_ORDER_ANY, fpuinitstate, NULL); /* * Free coprocessor (if we have it). diff --git a/sys/i386/i386/npx.c b/sys/i386/i386/npx.c index 34fd2e957169..4767d8896de9 100644 --- a/sys/i386/i386/npx.c +++ b/sys/i386/i386/npx.c @@ -551,7 +551,7 @@ npxinitstate(void *arg __unused) start_emulating(); intr_restore(saveintr); } -SYSINIT(npxinitstate, SI_SUB_DRIVERS, SI_ORDER_ANY, npxinitstate, NULL); +SYSINIT(npxinitstate, SI_SUB_CPU, SI_ORDER_ANY, npxinitstate, NULL); /* * Free coprocessor (if we have it). From owner-dev-commits-src-branches@freebsd.org Fri Jun 4 01:09:32 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 558B46446B3; Fri, 4 Jun 2021 01:09: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 4Fx4Rc1ZRXz3K28; Fri, 4 Jun 2021 01:09:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1E01413ECD; Fri, 4 Jun 2021 01:09:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15419WsY047769; Fri, 4 Jun 2021 01:09:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15419WQZ047768; Fri, 4 Jun 2021 01:09:32 GMT (envelope-from git) Date: Fri, 4 Jun 2021 01:09:32 GMT Message-Id: <202106040109.15419WQZ047768@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 0f05c6f3a527 - stable/13 - tcp: Make error handling in tcp_usr_send() more consistent MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 0f05c6f3a5274d07f17e7e2ca5a7d286ae37c09b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jun 2021 01:09:32 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=0f05c6f3a5274d07f17e7e2ca5a7d286ae37c09b commit 0f05c6f3a5274d07f17e7e2ca5a7d286ae37c09b Author: Mark Johnston AuthorDate: 2021-05-21 21:44:40 +0000 Commit: Mark Johnston CommitDate: 2021-06-04 01:01:33 +0000 tcp: Make error handling in tcp_usr_send() more consistent - Free the input mbuf in a single place instead of in every error path. - Handle PRUS_NOTREADY consistently. - Flush the socket's send buffer if an implicit connect fails. At that point the mbuf has already been enqueued but we don't want to keep it in the send buffer. Reviewed by: gallatin, tuexen Discussed with: jhb Sponsored by: The FreeBSD Foundation (cherry picked from commit 7d2608a5d24ec3534dad7f24191f12a8181ea206) --- sys/netinet/tcp_usrreq.c | 67 +++++++++++++++++++----------------------------- 1 file changed, 26 insertions(+), 41 deletions(-) diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index 48c3be3ec42c..1e593c4b1eb2 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -1000,13 +1000,6 @@ tcp_usr_send(struct socket *so, int flags, struct mbuf *m, if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) { if (control) m_freem(control); - - /* - * In case of PRUS_NOTREADY, tcp_usr_ready() is responsible - * for freeing memory. - */ - if ((flags & PRUS_NOTREADY) == 0) - m_freem(m); error = ECONNRESET; goto out; } @@ -1014,7 +1007,6 @@ tcp_usr_send(struct socket *so, int flags, struct mbuf *m, /* TCP doesn't do control messages (rights, creds, etc) */ if (control->m_len) { m_freem(control); - m_freem(m); error = EINVAL; goto out; } @@ -1022,13 +1014,10 @@ tcp_usr_send(struct socket *so, int flags, struct mbuf *m, control = NULL; } tp = intotcpcb(inp); - if (flags & PRUS_OOB) { - if ((error = tcp_pru_options_support(tp, PRUS_OOB)) != 0) { - if ((flags & PRUS_NOTREADY) == 0) - m_freem(m); - goto out; - } - } + if ((flags & PRUS_OOB) != 0 && + (error = tcp_pru_options_support(tp, PRUS_OOB)) != 0) + goto out; + TCPDEBUG1(); if (nam != NULL && tp->t_state < TCPS_SYN_SENT) { switch (nam->sa_family) { @@ -1036,30 +1025,24 @@ tcp_usr_send(struct socket *so, int flags, struct mbuf *m, case AF_INET: sinp = (struct sockaddr_in *)nam; if (sinp->sin_len != sizeof(struct sockaddr_in)) { - m_freem(m); error = EINVAL; goto out; } if ((inp->inp_vflag & INP_IPV6) != 0) { - m_freem(m); error = EAFNOSUPPORT; goto out; } if (IN_MULTICAST(ntohl(sinp->sin_addr.s_addr))) { - m_freem(m); error = EAFNOSUPPORT; goto out; } if (ntohl(sinp->sin_addr.s_addr) == INADDR_BROADCAST) { - m_freem(m); error = EACCES; goto out; } if ((error = prison_remote_ip4(td->td_ucred, - &sinp->sin_addr))) { - m_freem(m); + &sinp->sin_addr))) goto out; - } #ifdef INET6 isipv6 = 0; #endif @@ -1072,17 +1055,14 @@ tcp_usr_send(struct socket *so, int flags, struct mbuf *m, sin6 = (struct sockaddr_in6 *)nam; if (sin6->sin6_len != sizeof(*sin6)) { - m_freem(m); error = EINVAL; goto out; } if ((inp->inp_vflag & INP_IPV6PROTO) == 0) { - m_freem(m); error = EAFNOSUPPORT; goto out; } if (IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr)) { - m_freem(m); error = EAFNOSUPPORT; goto out; } @@ -1090,12 +1070,10 @@ tcp_usr_send(struct socket *so, int flags, struct mbuf *m, #ifdef INET if ((inp->inp_flags & IN6P_IPV6_V6ONLY) != 0) { error = EINVAL; - m_freem(m); goto out; } if ((inp->inp_vflag & INP_IPV4) == 0) { error = EAFNOSUPPORT; - m_freem(m); goto out; } restoreflags = true; @@ -1105,23 +1083,18 @@ tcp_usr_send(struct socket *so, int flags, struct mbuf *m, if (IN_MULTICAST( ntohl(sinp->sin_addr.s_addr))) { error = EAFNOSUPPORT; - m_freem(m); goto out; } if ((error = prison_remote_ip4(td->td_ucred, - &sinp->sin_addr))) { - m_freem(m); + &sinp->sin_addr))) goto out; - } isipv6 = 0; #else /* !INET */ error = EAFNOSUPPORT; - m_freem(m); goto out; #endif /* INET */ } else { if ((inp->inp_vflag & INP_IPV6) == 0) { - m_freem(m); error = EAFNOSUPPORT; goto out; } @@ -1129,23 +1102,21 @@ tcp_usr_send(struct socket *so, int flags, struct mbuf *m, inp->inp_vflag &= ~INP_IPV4; inp->inp_inc.inc_flags |= INC_ISIPV6; if ((error = prison_remote_ip6(td->td_ucred, - &sin6->sin6_addr))) { - m_freem(m); + &sin6->sin6_addr))) goto out; - } isipv6 = 1; } break; } #endif /* INET6 */ default: - m_freem(m); error = EAFNOSUPPORT; goto out; } } if (!(flags & PRUS_OOB)) { sbappendstream(&so->so_snd, m, flags); + m = NULL; if (nam && tp->t_state < TCPS_SYN_SENT) { /* * Do implied connect if not yet connected, @@ -1171,8 +1142,11 @@ tcp_usr_send(struct socket *so, int flags, struct mbuf *m, if (error == 0 || inp->inp_lport != 0) restoreflags = false; - if (error) + if (error) { + /* m is freed if PRUS_NOTREADY is unset. */ + sbflush(&so->so_snd); goto out; + } if (IS_FASTOPEN(tp->t_flags)) tcp_fastopen_connect(tp); else { @@ -1213,7 +1187,6 @@ tcp_usr_send(struct socket *so, int flags, struct mbuf *m, SOCKBUF_LOCK(&so->so_snd); if (sbspace(&so->so_snd) < -512) { SOCKBUF_UNLOCK(&so->so_snd); - m_freem(m); error = ENOBUFS; goto out; } @@ -1227,6 +1200,7 @@ tcp_usr_send(struct socket *so, int flags, struct mbuf *m, */ sbappendstream_locked(&so->so_snd, m, flags); SOCKBUF_UNLOCK(&so->so_snd); + m = NULL; if (nam && tp->t_state < TCPS_SYN_SENT) { /* * Do implied connect if not yet connected, @@ -1258,13 +1232,16 @@ tcp_usr_send(struct socket *so, int flags, struct mbuf *m, if (error == 0 || inp->inp_lport != 0) restoreflags = false; - if (error) + if (error != 0) { + /* m is freed if PRUS_NOTREADY is unset. */ + sbflush(&so->so_snd); goto out; + } tp->snd_wnd = TTCP_CLIENT_SND_WND; tcp_mss(tp, -1); } tp->snd_up = tp->snd_una + sbavail(&so->so_snd); - if (!(flags & PRUS_NOTREADY)) { + if ((flags & PRUS_NOTREADY) == 0) { tp->t_flags |= TF_FORCEDATA; error = tp->t_fb->tfb_tcp_output(tp); tp->t_flags &= ~TF_FORCEDATA; @@ -1275,7 +1252,15 @@ tcp_usr_send(struct socket *so, int flags, struct mbuf *m, &inp->inp_socket->so_snd, TCP_LOG_USERSEND, error, 0, NULL, false); + out: + /* + * In case of PRUS_NOTREADY, the caller or tcp_usr_ready() is + * responsible for freeing memory. + */ + if (m != NULL && (flags & PRUS_NOTREADY) == 0) + m_freem(m); + /* * If the request was unsuccessful and we changed flags, * restore the original flags. From owner-dev-commits-src-branches@freebsd.org Fri Jun 4 01:09:33 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 858F66446B4; Fri, 4 Jun 2021 01:09:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fx4Rd2nP7z3Jl4; Fri, 4 Jun 2021 01:09:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4869813FEF; Fri, 4 Jun 2021 01:09:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15419XdM047793; Fri, 4 Jun 2021 01:09:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15419XwY047792; Fri, 4 Jun 2021 01:09:33 GMT (envelope-from git) Date: Fri, 4 Jun 2021 01:09:33 GMT Message-Id: <202106040109.15419XwY047792@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 75683ed20b70 - stable/13 - Fix handling of errors from pru_send(PRUS_NOTREADY) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 75683ed20b70da2b813e5a9da220cfee94c0b307 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jun 2021 01:09:33 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=75683ed20b70da2b813e5a9da220cfee94c0b307 commit 75683ed20b70da2b813e5a9da220cfee94c0b307 Author: Mark Johnston AuthorDate: 2021-05-21 21:44:46 +0000 Commit: Mark Johnston CommitDate: 2021-06-04 01:02:02 +0000 Fix handling of errors from pru_send(PRUS_NOTREADY) PRUS_NOTREADY indicates that the caller has not yet populated the chain with data, and so it is not ready for transmission. This is used by sendfile (for async I/O) and KTLS (for encryption). In particular, if pru_send returns an error, the caller is responsible for freeing the chain since other implicit references to the data buffers exist. For async sendfile, it happens that an error will only be returned if the connection was dropped, in which case tcp_usr_ready() will handle freeing the chain. But since KTLS can be used in conjunction with the regular socket I/O system calls, many more error cases - which do not result in the connection being dropped - are reachable. In these cases, KTLS was effectively assuming success. So: - Change sosend_generic() to free the mbuf chain if pru_send(PRUS_NOTREADY) fails. Nothing else owns a reference to the chain at that point. - Similarly, in vn_sendfile() change the !async I/O && KTLS case to free the chain. - If async I/O is still outstanding when pru_send fails in vn_sendfile(), set an error in the sfio structure so that the connection is aborted and the mbuf chain is freed. Reviewed by: gallatin, tuexen Discussed with: jhb Sponsored by: The FreeBSD Foundation (cherry picked from commit 916c61a5ed37da8ecdedd3c5512813d8dcec9a24) --- sys/kern/kern_sendfile.c | 12 ++++++++---- sys/kern/uipc_socket.c | 19 +++++++------------ 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/sys/kern/kern_sendfile.c b/sys/kern/kern_sendfile.c index 520b7c9c62d0..ac1072ca2406 100644 --- a/sys/kern/kern_sendfile.c +++ b/sys/kern/kern_sendfile.c @@ -1175,8 +1175,12 @@ prepend_header: if (tls != NULL && tls->mode == TCP_TLS_MODE_SW) { error = (*so->so_proto->pr_usrreqs->pru_send) (so, PRUS_NOTREADY, m, NULL, NULL, td); - soref(so); - ktls_enqueue(m, so, tls_enq_cnt); + if (error != 0) { + m_freem(m); + } else { + soref(so); + ktls_enqueue(m, so, tls_enq_cnt); + } } else #endif error = (*so->so_proto->pr_usrreqs->pru_send) @@ -1187,11 +1191,11 @@ prepend_header: soref(so); error = (*so->so_proto->pr_usrreqs->pru_send) (so, PRUS_NOTREADY, m, NULL, NULL, td); - sendfile_iodone(sfio, NULL, 0, 0); + sendfile_iodone(sfio, NULL, 0, error); } CURVNET_RESTORE(); - m = NULL; /* pru_send always consumes */ + m = NULL; if (error) goto done; sbytes += space + hdrlen; diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 77ce876fd20f..852132e45e58 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -1763,18 +1763,13 @@ restart: #ifdef KERN_TLS if (tls != NULL && tls->mode == TCP_TLS_MODE_SW) { - /* - * Note that error is intentionally - * ignored. - * - * Like sendfile(), we rely on the - * completion routine (pru_ready()) - * to free the mbufs in the event that - * pru_send() encountered an error and - * did not append them to the sockbuf. - */ - soref(so); - ktls_enqueue(top, so, tls_enq_cnt); + if (error != 0) { + m_freem(top); + top = NULL; + } else { + soref(so); + ktls_enqueue(top, so, tls_enq_cnt); + } } #endif clen = 0; From owner-dev-commits-src-branches@freebsd.org Fri Jun 4 02:49:02 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 714456458B6; Fri, 4 Jun 2021 02:49:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fx6fQ2Tbyz3hxN; Fri, 4 Jun 2021 02:49:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 393C615374; Fri, 4 Jun 2021 02:49:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1542n21W079109; Fri, 4 Jun 2021 02:49:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1542n2Kx079108; Fri, 4 Jun 2021 02:49:02 GMT (envelope-from git) Date: Fri, 4 Jun 2021 02:49:02 GMT Message-Id: <202106040249.1542n2Kx079108@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: d94aa742b581 - stable/13 - daemon: add some basic tests MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d94aa742b5810bff16f85969f2ff4b1b6bdb9082 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jun 2021 02:49:02 -0000 The branch stable/13 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=d94aa742b5810bff16f85969f2ff4b1b6bdb9082 commit d94aa742b5810bff16f85969f2ff4b1b6bdb9082 Author: Alan Somers AuthorDate: 2021-03-17 16:35:00 +0000 Commit: Alan Somers CommitDate: 2021-06-04 02:48:47 +0000 daemon: add some basic tests Sponsored by: Axcient Differential Revision: https://reviews.freebsd.org/D29316 (cherry picked from commit 3b57d80c7aa924ed0fad565591f5292c2ac88da5) --- etc/mtree/BSD.tests.dist | 2 + usr.sbin/daemon/Makefile | 5 + usr.sbin/daemon/tests/Makefile | 7 ++ usr.sbin/daemon/tests/daemon_test.sh | 224 +++++++++++++++++++++++++++++++++++ 4 files changed, 238 insertions(+) diff --git a/etc/mtree/BSD.tests.dist b/etc/mtree/BSD.tests.dist index a38e6ce04b84..1dc756aecbc5 100644 --- a/etc/mtree/BSD.tests.dist +++ b/etc/mtree/BSD.tests.dist @@ -1096,6 +1096,8 @@ usr.sbin chown .. + daemon + .. etcupdate .. extattr diff --git a/usr.sbin/daemon/Makefile b/usr.sbin/daemon/Makefile index eb0d50280161..0bf34c351932 100644 --- a/usr.sbin/daemon/Makefile +++ b/usr.sbin/daemon/Makefile @@ -5,4 +5,9 @@ MAN= daemon.8 LIBADD= util +.include + +HAS_TESTS= +SUBDIR.${MK_TESTS}+= tests + .include diff --git a/usr.sbin/daemon/tests/Makefile b/usr.sbin/daemon/tests/Makefile new file mode 100644 index 000000000000..c687361ec4e7 --- /dev/null +++ b/usr.sbin/daemon/tests/Makefile @@ -0,0 +1,7 @@ +# $FreeBSD$ + +PACKAGE= tests + +ATF_TESTS_SH= daemon_test + +.include diff --git a/usr.sbin/daemon/tests/daemon_test.sh b/usr.sbin/daemon/tests/daemon_test.sh new file mode 100644 index 000000000000..ab5d86e0e71b --- /dev/null +++ b/usr.sbin/daemon/tests/daemon_test.sh @@ -0,0 +1,224 @@ +#!/bin/sh +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2021 Axcient +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. + +# $FreeBSD$ + +atf_test_case both_pidfile cleanup +both_pidfile_head() { + atf_set "descr" "daemon should write pid files for itself and its child" +} +both_pidfile_body() { + daemon -P daemon.pid -p sleep.pid sleep 300 + atf_check -s exit:0 test -f daemon.pid + atf_check -s exit:0 -o match:"daemon: sleep" ps -p `cat daemon.pid` + atf_check -s exit:0 test -f sleep.pid + atf_check -s exit:0 -o match:"[0-9] sleep 300$" ps -p `cat sleep.pid` +} +both_pidfile_cleanup() { + if [ -f daemon.pid ]; then + daemon_pid=`cat daemon.pid` + fi + if [ -f sleep_pid ]; then + sleep_pid=`cat sleep.pid` + fi + [ -n "$sleep_pid" ] && kill $sleep_pid + # NB: killing the sleep should kill the daemon too, so we musn't fail + # the test if the second kill fails with ESRCH + [ -n "$daemon_pid" ] && kill $daemon_pid || true +} + +atf_test_case chdir cleanup +chdir_head() { + atf_set "descr" "daemon should chdir to /" +} +chdir_body() { + # Executing sleep by relative path will only work from / + daemon -p ${PWD}/sleep.pid -c bin/sleep 300 + atf_check -s exit:0 test -f sleep.pid + atf_check -s exit:0 -o match:"[0-9] bin/sleep 300$" \ + ps -p `cat sleep.pid` +} +chdir_cleanup() { + [ -f sleep.pid ] && kill `cat sleep.pid` +} + +atf_test_case child_pidfile cleanup +child_pidfile_head() { + atf_set "descr" "daemon should write its child's pid to a pidfile" +} +child_pidfile_body() { + daemon -p sleep.pid sleep 300 + atf_check -s exit:0 test -f sleep.pid + atf_check -s exit:0 -o match:"[0-9] sleep 300$" ps -p `cat sleep.pid` +} +child_pidfile_cleanup() { + [ -f sleep.pid ] && kill `cat sleep.pid` +} + +atf_test_case child_pidfile_lock cleanup +child_pidfile_lock_head() { + atf_set "descr" "daemon should refuse to clobber an existing child" +} +child_pidfile_lock_body() { + daemon -p sleep.pid sleep 300 + atf_check -s exit:0 test -f sleep.pid + atf_check -s not-exit:0 -e match:"process already running" \ + daemon -p sleep.pid sleep 300 +} +child_pidfile_lock_cleanup() { + [ -f sleep.pid ] && kill `cat sleep.pid` +} + +atf_test_case newsyslog cleanup +newsyslog_head() { + atf_set "descr" "daemon should close and reopen the output file on SIGHUP" +} +newsyslog_body() { + cat > child.sh < expected_file + atf_check -s exit:0 cmp output_file expected_file +} + +atf_test_case restart_child cleanup +restart_child_head() { + atf_set "descr" "daemon should restart a dead child" +} +restart_child_body() { + daemon -rP daemon.pid -p sleep.pid sleep 300 + atf_check -s exit:0 test -f daemon.pid + atf_check -s exit:0 test -f sleep.pid + orig_sleep_pid=`cat sleep.pid` + kill $orig_sleep_pid + # Wait up to 10s for the daemon to restart the child. + for t in `seq 0 0.1 10`; do + new_sleep_pid=`cat sleep.pid` + [ "$orig_sleep_pid" -ne "$new_sleep_pid" ] && break + sleep 0.1 + done + [ "$orig_sleep_pid" -ne "$new_sleep_pid" ] || \ + atf_fail "child was not restarted" + +} +restart_child_cleanup() { + [ -f daemon.pid ] && kill `cat daemon.pid` +} + +atf_test_case supervisor_pidfile cleanup +supervisor_pidfile_head() { + atf_set "descr" "daemon should write its own pid to a pidfile" +} +supervisor_pidfile_body() { + daemon -P daemon.pid sleep 300 + atf_check -s exit:0 test -f daemon.pid + atf_check -s exit:0 -o match:"daemon: sleep" ps -p `cat daemon.pid` +} +supervisor_pidfile_cleanup() { + [ -f daemon.pid ] && kill `cat daemon.pid` +} + +atf_test_case supervisor_pidfile_lock cleanup +supervisor_pidfile_lock_head() { + atf_set "descr" "daemon should refuse to clobber an existing instance" +} +supervisor_pidfile_lock_body() { + daemon -P daemon.pid sleep 300 + atf_check -s exit:0 test -f daemon.pid + atf_check -s not-exit:0 -e match:"process already running" \ + daemon -p daemon.pid sleep 300 +} +supervisor_pidfile_lock_cleanup() { + [ -f daemon.pid ] && kill `cat daemon.pid` +} + +atf_test_case title cleanup +title_head() { + atf_set "descr" "daemon should change its process title" +} +title_body() { + daemon -P daemon.pid -t "I'm a title!" sleep 300 + atf_check -s exit:0 test -f daemon.pid + atf_check -s exit:0 -o match:"daemon: I'm a title!" \ + ps -p `cat daemon.pid` +} +title_cleanup() { + [ -f daemon.pid ] && kill `cat daemon.pid` +} + +atf_test_case user cleanup +user_head() { + atf_set "descr" "daemon should drop privileges" + atf_set "require.user" "root" +} +user_body() { + daemon -p sleep.pid -u nobody sleep 300 + atf_check -s exit:0 test -f sleep.pid + atf_check -s exit:0 -o match:"^nobody" ps -up `cat sleep.pid` +} +user_cleanup() { + [ -f sleep.pid ] && kill `cat sleep.pid` +} + + +atf_init_test_cases() { + atf_add_test_case both_pidfile + atf_add_test_case chdir + atf_add_test_case child_pidfile + atf_add_test_case child_pidfile_lock + atf_add_test_case newsyslog + atf_add_test_case output_file + atf_add_test_case restart_child + atf_add_test_case supervisor_pidfile + atf_add_test_case supervisor_pidfile_lock + atf_add_test_case title + atf_add_test_case user +} From owner-dev-commits-src-branches@freebsd.org Fri Jun 4 03:22:02 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 28BEC646503; Fri, 4 Jun 2021 03:22:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fx7NV0Kpbz3mbB; Fri, 4 Jun 2021 03:22:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E8C4E15F77; Fri, 4 Jun 2021 03:22:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1543M1gB032803; Fri, 4 Jun 2021 03:22:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1543M1Nj032802; Fri, 4 Jun 2021 03:22:01 GMT (envelope-from git) Date: Fri, 4 Jun 2021 03:22:01 GMT Message-Id: <202106040322.1543M1Nj032802@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 8513b4f15362 - stable/12 - nfscl: Fix NFSv4.1/4.2 mount recovery from an expired lease MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 8513b4f15362161c38c18a4262997468951d3ea0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jun 2021 03:22:02 -0000 The branch stable/12 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=8513b4f15362161c38c18a4262997468951d3ea0 commit 8513b4f15362161c38c18a4262997468951d3ea0 Author: Rick Macklem AuthorDate: 2021-05-19 21:52:56 +0000 Commit: Rick Macklem CommitDate: 2021-06-04 03:19:04 +0000 nfscl: Fix NFSv4.1/4.2 mount recovery from an expired lease The most difficult NFSv4 client recovery case happens when the lease has expired on the server. For NFSv4.0, the client will receive a NFSERR_EXPIRED reply from the server to indicate this has happened. For NFSv4.1/4.2, most RPCs have a Sequence operation and, as such, the client will receive a NFSERR_BADSESSION reply when the lease has expired for these RPCs. The client will then call nfscl_recover() to handle the NFSERR_BADSESSION reply. However, for the expired lease case, the first reclaim Open will fail with NFSERR_NOGRACE. This patch recognizes this case and calls nfscl_expireclient() to handle the recovery from an expired lease. This patch only affects NFSv4.1/4.2 mounts when the lease expires on the server, due to a network partitioning that exceeds the lease duration or similar. (cherry picked from commit c28cb257ddfe3339756f6fd659fa4a2efa4de2cb) --- sys/fs/nfsclient/nfs_clstate.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c index e705af31185b..9965b7ca7e4f 100644 --- a/sys/fs/nfsclient/nfs_clstate.c +++ b/sys/fs/nfsclient/nfs_clstate.c @@ -1977,6 +1977,7 @@ nfscl_recover(struct nfsclclient *clp, struct ucred *cred, NFSPROC_T *p) u_int32_t delegtype = NFSV4OPEN_DELEGATEWRITE, mode; int i, igotlock = 0, error, trycnt, firstlock; struct nfscllayout *lyp, *nlyp; + bool recovered_one; /* * First, lock the client structure, so everyone else will @@ -2050,6 +2051,7 @@ nfscl_recover(struct nfsclclient *clp, struct ucred *cred, NFSPROC_T *p) * Now traverse the state lists, doing Open and Lock Reclaims. */ tcred = newnfs_getcred(); + recovered_one = false; owp = LIST_FIRST(&clp->nfsc_owner); while (owp != NULL) { nowp = LIST_NEXT(owp, nfsow_list); @@ -2083,6 +2085,7 @@ nfscl_recover(struct nfsclclient *clp, struct ucred *cred, NFSPROC_T *p) op->nfso_mode, op, NULL, 0, &ndp, 1, delegtype, tcred, p); if (!error) { + recovered_one = true; /* Handle any replied delegation */ if (ndp != NULL && ((ndp->nfsdl_flags & NFSCLDL_WRITE) || NFSMNT_RDONLY(nmp->nm_mountp))) { @@ -2141,6 +2144,21 @@ nfscl_recover(struct nfsclclient *clp, struct ucred *cred, NFSPROC_T *p) nfscl_freelockowner(lp, 0); lp = nlp; } + } else if (error == NFSERR_NOGRACE && !recovered_one && + NFSHASNFSV4N(nmp)) { + /* + * For NFSv4.1/4.2, the NFSERR_EXPIRED case will + * actually end up here, since the client will do + * a recovery for NFSERR_BADSESSION, but will get + * an NFSERR_NOGRACE reply for the first "reclaim" + * attempt. + * So, call nfscl_expireclient() to recover the + * opens as best we can and then do a reclaim + * complete and return. + */ + nfsrpc_reclaimcomplete(nmp, cred, p); + nfscl_expireclient(clp, nmp, tcred, p); + goto out; } } if (error != 0 && error != NFSERR_BADSESSION) @@ -2227,6 +2245,23 @@ nfscl_recover(struct nfsclclient *clp, struct ucred *cred, NFSPROC_T *p) if (error) { if (nop != NULL) free(nop, M_NFSCLOPEN); + if (error == NFSERR_NOGRACE && !recovered_one && + NFSHASNFSV4N(nmp)) { + /* + * For NFSv4.1/4.2, the NFSERR_EXPIRED case will + * actually end up here, since the client will do + * a recovery for NFSERR_BADSESSION, but will get + * an NFSERR_NOGRACE reply for the first "reclaim" + * attempt. + * So, call nfscl_expireclient() to recover the + * opens as best we can and then do a reclaim + * complete and return. + */ + nfsrpc_reclaimcomplete(nmp, cred, p); + nfscl_expireclient(clp, nmp, tcred, p); + free(nowp, M_NFSCLOWNER); + goto out; + } /* * Couldn't reclaim it, so throw the state * away. Ouch!! @@ -2234,6 +2269,7 @@ nfscl_recover(struct nfsclclient *clp, struct ucred *cred, NFSPROC_T *p) nfscl_cleandeleg(dp); nfscl_freedeleg(&clp->nfsc_deleg, dp, true); } else { + recovered_one = true; LIST_INSERT_HEAD(&extra_open, nop, nfso_list); } } @@ -2271,6 +2307,7 @@ nfscl_recover(struct nfsclclient *clp, struct ucred *cred, NFSPROC_T *p) if (NFSHASNFSV4N(nmp)) (void)nfsrpc_reclaimcomplete(nmp, cred, p); +out: NFSLOCKCLSTATE(); clp->nfsc_flags &= ~NFSCLFLAGS_RECVRINPROG; wakeup(&clp->nfsc_flags); From owner-dev-commits-src-branches@freebsd.org Fri Jun 4 03:30:54 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 884B2646462; Fri, 4 Jun 2021 03:30:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fx7Zk3KsSz3mxQ; Fri, 4 Jun 2021 03:30:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5A95215D46; Fri, 4 Jun 2021 03:30:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1543UsXj041691; Fri, 4 Jun 2021 03:30:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1543Us1x041690; Fri, 4 Jun 2021 03:30:54 GMT (envelope-from git) Date: Fri, 4 Jun 2021 03:30:54 GMT Message-Id: <202106040330.1543Us1x041690@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 5713766d6317 - stable/12 - nfsd: Add support for CLAIM_DELEG_PREV_FH to the NFSv4.1/4.2 Open MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 5713766d631787677a291490e0b8e369d30be43e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jun 2021 03:30:54 -0000 The branch stable/12 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=5713766d631787677a291490e0b8e369d30be43e commit 5713766d631787677a291490e0b8e369d30be43e Author: Rick Macklem AuthorDate: 2021-05-21 01:37:40 +0000 Commit: Rick Macklem CommitDate: 2021-06-04 03:27:05 +0000 nfsd: Add support for CLAIM_DELEG_PREV_FH to the NFSv4.1/4.2 Open Commit b3d4c70dc60f added support for CLAIM_DELEG_CUR_FH to Open. While doing this, I noticed that CLAIM_DELEG_PREV_FH support could be added the same way. Although I am not aware of any extant NFSv4.1/4.2 client that uses this claim type, it seems prudent to add support for this variant of Open to the NFSv4.1/4.2 server. This patch does not affect mounts from extant NFSv4.1/4.2 clients, as far as I know. (cherry picked from commit d80a903a1c2acd73afbf06598955a0887433f8c6) --- sys/fs/nfsserver/nfs_nfsdserv.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/fs/nfsserver/nfs_nfsdserv.c b/sys/fs/nfsserver/nfs_nfsdserv.c index 4aa009b345fe..cd10b735ee34 100644 --- a/sys/fs/nfsserver/nfs_nfsdserv.c +++ b/sys/fs/nfsserver/nfs_nfsdserv.c @@ -2919,7 +2919,8 @@ nfsrvd_open(struct nfsrv_descript *nd, __unused int isdgram, stateid.seqid = fxdr_unsigned(u_int32_t, *tl++); NFSBCOPY((caddr_t)tl,(caddr_t)stateid.other,NFSX_STATEIDOTHER); stp->ls_flags |= NFSLCK_DELEGCUR; - } else if (claim == NFSV4OPEN_CLAIMDELEGATEPREV) { + } else if (claim == NFSV4OPEN_CLAIMDELEGATEPREV || claim == + NFSV4OPEN_CLAIMDELEGATEPREVFH) { stp->ls_flags |= NFSLCK_DELEGPREV; } if (claim == NFSV4OPEN_CLAIMNULL || claim == NFSV4OPEN_CLAIMDELEGATECUR @@ -2989,7 +2990,8 @@ nfsrvd_open(struct nfsrv_descript *nd, __unused int isdgram, &exclusive_flag, &nva, cverf, create, aclp, &attrbits, nd->nd_cred, p, exp, &vp); } else if (claim == NFSV4OPEN_CLAIMPREVIOUS || claim == - NFSV4OPEN_CLAIMFH || claim == NFSV4OPEN_CLAIMDELEGATECURFH) { + NFSV4OPEN_CLAIMFH || claim == NFSV4OPEN_CLAIMDELEGATECURFH || + claim == NFSV4OPEN_CLAIMDELEGATEPREVFH) { if (claim == NFSV4OPEN_CLAIMPREVIOUS) { NFSM_DISSECT(tl, u_int32_t *, NFSX_UNSIGNED); i = fxdr_unsigned(int, *tl); From owner-dev-commits-src-branches@freebsd.org Fri Jun 4 03:34:11 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AEF23646865; Fri, 4 Jun 2021 03:34:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fx7fW4Zfmz3n56; Fri, 4 Jun 2021 03:34:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 85D0815E5F; Fri, 4 Jun 2021 03:34:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1543YBM8046659; Fri, 4 Jun 2021 03:34:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1543YBV7046658; Fri, 4 Jun 2021 03:34:11 GMT (envelope-from git) Date: Fri, 4 Jun 2021 03:34:11 GMT Message-Id: <202106040334.1543YBV7046658@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: b1461cdd30a9 - stable/13 - nfsd: Add support for CLAIM_DELEG_PREV_FH to the NFSv4.1/4.2 Open MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b1461cdd30a96b8e54b6b5efb30b520ca527d8b4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jun 2021 03:34:11 -0000 The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=b1461cdd30a96b8e54b6b5efb30b520ca527d8b4 commit b1461cdd30a96b8e54b6b5efb30b520ca527d8b4 Author: Rick Macklem AuthorDate: 2021-05-21 01:37:40 +0000 Commit: Rick Macklem CommitDate: 2021-06-04 03:31:06 +0000 nfsd: Add support for CLAIM_DELEG_PREV_FH to the NFSv4.1/4.2 Open Commit b3d4c70dc60f added support for CLAIM_DELEG_CUR_FH to Open. While doing this, I noticed that CLAIM_DELEG_PREV_FH support could be added the same way. Although I am not aware of any extant NFSv4.1/4.2 client that uses this claim type, it seems prudent to add support for this variant of Open to the NFSv4.1/4.2 server. This patch does not affect mounts from extant NFSv4.1/4.2 clients, as far as I know. (cherry picked from commit d80a903a1c2acd73afbf06598955a0887433f8c6) --- sys/fs/nfsserver/nfs_nfsdserv.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/fs/nfsserver/nfs_nfsdserv.c b/sys/fs/nfsserver/nfs_nfsdserv.c index 5d6cac23b722..ef78f90fabfc 100644 --- a/sys/fs/nfsserver/nfs_nfsdserv.c +++ b/sys/fs/nfsserver/nfs_nfsdserv.c @@ -2987,7 +2987,8 @@ nfsrvd_open(struct nfsrv_descript *nd, __unused int isdgram, stateid.seqid = fxdr_unsigned(u_int32_t, *tl++); NFSBCOPY((caddr_t)tl,(caddr_t)stateid.other,NFSX_STATEIDOTHER); stp->ls_flags |= NFSLCK_DELEGCUR; - } else if (claim == NFSV4OPEN_CLAIMDELEGATEPREV) { + } else if (claim == NFSV4OPEN_CLAIMDELEGATEPREV || claim == + NFSV4OPEN_CLAIMDELEGATEPREVFH) { stp->ls_flags |= NFSLCK_DELEGPREV; } if (claim == NFSV4OPEN_CLAIMNULL || claim == NFSV4OPEN_CLAIMDELEGATECUR @@ -3057,7 +3058,8 @@ nfsrvd_open(struct nfsrv_descript *nd, __unused int isdgram, &exclusive_flag, &nva, cverf, create, aclp, &attrbits, nd->nd_cred, exp, &vp); } else if (claim == NFSV4OPEN_CLAIMPREVIOUS || claim == - NFSV4OPEN_CLAIMFH || claim == NFSV4OPEN_CLAIMDELEGATECURFH) { + NFSV4OPEN_CLAIMFH || claim == NFSV4OPEN_CLAIMDELEGATECURFH || + claim == NFSV4OPEN_CLAIMDELEGATEPREVFH) { if (claim == NFSV4OPEN_CLAIMPREVIOUS) { NFSM_DISSECT(tl, u_int32_t *, NFSX_UNSIGNED); i = fxdr_unsigned(int, *tl); From owner-dev-commits-src-branches@freebsd.org Fri Jun 4 09:47:50 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 261A464BAF8; Fri, 4 Jun 2021 09:47: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 4FxHxf0dllz4kyM; Fri, 4 Jun 2021 09:47:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E78FD1AD56; Fri, 4 Jun 2021 09:47:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1549lnDw040006; Fri, 4 Jun 2021 09:47:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1549lnTs040005; Fri, 4 Jun 2021 09:47:49 GMT (envelope-from git) Date: Fri, 4 Jun 2021 09:47:49 GMT Message-Id: <202106040947.1549lnTs040005@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 1d89dba26b95 - stable/12 - pf: Fix more ioctl memory leaks MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 1d89dba26b9557543e728a1e1bdab9702cc88ac3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jun 2021 09:47:50 -0000 The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=1d89dba26b9557543e728a1e1bdab9702cc88ac3 commit 1d89dba26b9557543e728a1e1bdab9702cc88ac3 Author: Kristof Provost AuthorDate: 2021-06-01 14:05:47 +0000 Commit: Kristof Provost CommitDate: 2021-06-04 08:12:32 +0000 pf: Fix more ioctl memory leaks We must also remember to free nvlists added to a parent nvlist with nvlist_append_nvlist_array(). More importantly, when nvlist_pack() allocates memory for us it does so in the M_NVLIST zone, so we must free it with free(.., M_NVLIST). Using free(.., M_TEMP) as we did silently failed to free the memory. MFC after: 3 days Reported by: kib@ Tested by: kib@ Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D30595 (cherry picked from commit 0f86492b09ca82042166a41f6f21b2dbe4f4a464) --- sys/netpfil/pf/pf_ioctl.c | 27 ++++++++++++++------------- sys/netpfil/pf/pf_nv.c | 1 + 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index 148a8a56f624..3a5a7601b51e 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -2438,7 +2438,7 @@ DIOCADDRULENV_error: ERROUT(ENOMEM); /* Copy the request in */ - nvlpacked = malloc(nv->len, M_TEMP, M_WAITOK); + nvlpacked = malloc(nv->len, M_NVLIST, M_WAITOK); if (nvlpacked == NULL) ERROUT(ENOMEM); @@ -2516,7 +2516,7 @@ DIOCADDRULENV_error: ERROUT(EBUSY); } - free(nvlpacked, M_TEMP); + free(nvlpacked, M_NVLIST); nvlpacked = nvlist_pack(nvl, &nv->len); if (nvlpacked == NULL) { PF_RULES_WUNLOCK(); @@ -2546,7 +2546,7 @@ DIOCADDRULENV_error: #undef ERROUT DIOCGETRULENV_error: - free(nvlpacked, M_TEMP); + free(nvlpacked, M_NVLIST); nvlist_destroy(nvrule); nvlist_destroy(nvl); @@ -4934,7 +4934,7 @@ pf_killstates_nv(struct pfioc_nv *nv) if (nv->len > pf_ioctl_maxcount) ERROUT(ENOMEM); - nvlpacked = malloc(nv->len, M_TEMP, M_WAITOK); + nvlpacked = malloc(nv->len, M_NVLIST, M_WAITOK); if (nvlpacked == NULL) ERROUT(ENOMEM); @@ -4952,7 +4952,7 @@ pf_killstates_nv(struct pfioc_nv *nv) error = pf_killstates(&kill, &killed); - free(nvlpacked, M_TEMP); + free(nvlpacked, M_NVLIST); nvlpacked = NULL; nvlist_destroy(nvl); nvl = nvlist_create(0); @@ -4974,7 +4974,7 @@ pf_killstates_nv(struct pfioc_nv *nv) on_error: nvlist_destroy(nvl); - free(nvlpacked, M_TEMP); + free(nvlpacked, M_NVLIST); return (error); } @@ -4992,7 +4992,7 @@ pf_clearstates_nv(struct pfioc_nv *nv) if (nv->len > pf_ioctl_maxcount) ERROUT(ENOMEM); - nvlpacked = malloc(nv->len, M_TEMP, M_WAITOK); + nvlpacked = malloc(nv->len, M_NVLIST, M_WAITOK); if (nvlpacked == NULL) ERROUT(ENOMEM); @@ -5010,7 +5010,7 @@ pf_clearstates_nv(struct pfioc_nv *nv) killed = pf_clear_states(&kill); - free(nvlpacked, M_TEMP); + free(nvlpacked, M_NVLIST); nvlpacked = NULL; nvlist_destroy(nvl); nvl = nvlist_create(0); @@ -5033,7 +5033,7 @@ pf_clearstates_nv(struct pfioc_nv *nv) #undef ERROUT on_error: nvlist_destroy(nvl); - free(nvlpacked, M_TEMP); + free(nvlpacked, M_NVLIST); return (error); } @@ -5051,7 +5051,7 @@ pf_getstate(struct pfioc_nv *nv) if (nv->len > pf_ioctl_maxcount) ERROUT(ENOMEM); - nvlpacked = malloc(nv->len, M_TEMP, M_WAITOK); + nvlpacked = malloc(nv->len, M_NVLIST, M_WAITOK); if (nvlpacked == NULL) ERROUT(ENOMEM); @@ -5070,7 +5070,7 @@ pf_getstate(struct pfioc_nv *nv) if (s == NULL) ERROUT(ENOENT); - free(nvlpacked, M_TEMP); + free(nvlpacked, M_NVLIST); nvlpacked = NULL; nvlist_destroy(nvl); nvl = nvlist_create(0); @@ -5099,7 +5099,7 @@ pf_getstate(struct pfioc_nv *nv) errout: if (s != NULL) PF_STATE_UNLOCK(s); - free(nvlpacked, M_TEMP); + free(nvlpacked, M_NVLIST); nvlist_destroy(nvl); return (error); } @@ -5141,6 +5141,7 @@ pf_getstates(struct pfioc_nv *nv) goto DIOCGETSTATESNV_full; } nvlist_append_nvlist_array(nvl, "states", nvls); + nvlist_destroy(nvls); count++; } PF_HASHROW_UNLOCK(ih); @@ -5167,7 +5168,7 @@ DIOCGETSTATESNV_full: #undef ERROUT errout: - free(nvlpacked, M_TEMP); + free(nvlpacked, M_NVLIST); nvlist_destroy(nvl); return (error); } diff --git a/sys/netpfil/pf/pf_nv.c b/sys/netpfil/pf/pf_nv.c index 863259dbf9aa..dab72f04d138 100644 --- a/sys/netpfil/pf/pf_nv.c +++ b/sys/netpfil/pf/pf_nv.c @@ -846,6 +846,7 @@ pf_state_key_to_nvstate_key(const struct pf_state_key *key) if (tmp == NULL) goto errout; nvlist_append_nvlist_array(nvl, "addr", tmp); + nvlist_destroy(tmp); nvlist_append_number_array(nvl, "port", key->port[i]); } nvlist_add_number(nvl, "af", key->af); From owner-dev-commits-src-branches@freebsd.org Fri Jun 4 09:47:51 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8238B64B4EA; Fri, 4 Jun 2021 09:47:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FxHxg26dZz4lBh; Fri, 4 Jun 2021 09:47:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2E25C1AE1E; Fri, 4 Jun 2021 09:47:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1549lo92040106; Fri, 4 Jun 2021 09:47:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1549lod1040105; Fri, 4 Jun 2021 09:47:50 GMT (envelope-from git) Date: Fri, 4 Jun 2021 09:47:50 GMT Message-Id: <202106040947.1549lod1040105@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 364c6a71a840 - stable/13 - pf: Fix more ioctl memory leaks MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 364c6a71a840e8cf48eeea3bef81623d6f3574ff Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jun 2021 09:47:51 -0000 The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=364c6a71a840e8cf48eeea3bef81623d6f3574ff commit 364c6a71a840e8cf48eeea3bef81623d6f3574ff Author: Kristof Provost AuthorDate: 2021-06-01 14:05:47 +0000 Commit: Kristof Provost CommitDate: 2021-06-04 08:12:11 +0000 pf: Fix more ioctl memory leaks We must also remember to free nvlists added to a parent nvlist with nvlist_append_nvlist_array(). More importantly, when nvlist_pack() allocates memory for us it does so in the M_NVLIST zone, so we must free it with free(.., M_NVLIST). Using free(.., M_TEMP) as we did silently failed to free the memory. MFC after: 3 days Reported by: kib@ Tested by: kib@ Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D30595 (cherry picked from commit 0f86492b09ca82042166a41f6f21b2dbe4f4a464) --- sys/netpfil/pf/pf_ioctl.c | 27 ++++++++++++++------------- sys/netpfil/pf/pf_nv.c | 1 + 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index af89ddf80daf..be7b8be23a31 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -2427,7 +2427,7 @@ DIOCADDRULENV_error: ERROUT(ENOMEM); /* Copy the request in */ - nvlpacked = malloc(nv->len, M_TEMP, M_WAITOK); + nvlpacked = malloc(nv->len, M_NVLIST, M_WAITOK); if (nvlpacked == NULL) ERROUT(ENOMEM); @@ -2505,7 +2505,7 @@ DIOCADDRULENV_error: ERROUT(EBUSY); } - free(nvlpacked, M_TEMP); + free(nvlpacked, M_NVLIST); nvlpacked = nvlist_pack(nvl, &nv->len); if (nvlpacked == NULL) { PF_RULES_WUNLOCK(); @@ -2535,7 +2535,7 @@ DIOCADDRULENV_error: #undef ERROUT DIOCGETRULENV_error: - free(nvlpacked, M_TEMP); + free(nvlpacked, M_NVLIST); nvlist_destroy(nvrule); nvlist_destroy(nvl); @@ -4919,7 +4919,7 @@ pf_killstates_nv(struct pfioc_nv *nv) if (nv->len > pf_ioctl_maxcount) ERROUT(ENOMEM); - nvlpacked = malloc(nv->len, M_TEMP, M_WAITOK); + nvlpacked = malloc(nv->len, M_NVLIST, M_WAITOK); if (nvlpacked == NULL) ERROUT(ENOMEM); @@ -4937,7 +4937,7 @@ pf_killstates_nv(struct pfioc_nv *nv) error = pf_killstates(&kill, &killed); - free(nvlpacked, M_TEMP); + free(nvlpacked, M_NVLIST); nvlpacked = NULL; nvlist_destroy(nvl); nvl = nvlist_create(0); @@ -4959,7 +4959,7 @@ pf_killstates_nv(struct pfioc_nv *nv) on_error: nvlist_destroy(nvl); - free(nvlpacked, M_TEMP); + free(nvlpacked, M_NVLIST); return (error); } @@ -4977,7 +4977,7 @@ pf_clearstates_nv(struct pfioc_nv *nv) if (nv->len > pf_ioctl_maxcount) ERROUT(ENOMEM); - nvlpacked = malloc(nv->len, M_TEMP, M_WAITOK); + nvlpacked = malloc(nv->len, M_NVLIST, M_WAITOK); if (nvlpacked == NULL) ERROUT(ENOMEM); @@ -4995,7 +4995,7 @@ pf_clearstates_nv(struct pfioc_nv *nv) killed = pf_clear_states(&kill); - free(nvlpacked, M_TEMP); + free(nvlpacked, M_NVLIST); nvlpacked = NULL; nvlist_destroy(nvl); nvl = nvlist_create(0); @@ -5018,7 +5018,7 @@ pf_clearstates_nv(struct pfioc_nv *nv) #undef ERROUT on_error: nvlist_destroy(nvl); - free(nvlpacked, M_TEMP); + free(nvlpacked, M_NVLIST); return (error); } @@ -5036,7 +5036,7 @@ pf_getstate(struct pfioc_nv *nv) if (nv->len > pf_ioctl_maxcount) ERROUT(ENOMEM); - nvlpacked = malloc(nv->len, M_TEMP, M_WAITOK); + nvlpacked = malloc(nv->len, M_NVLIST, M_WAITOK); if (nvlpacked == NULL) ERROUT(ENOMEM); @@ -5055,7 +5055,7 @@ pf_getstate(struct pfioc_nv *nv) if (s == NULL) ERROUT(ENOENT); - free(nvlpacked, M_TEMP); + free(nvlpacked, M_NVLIST); nvlpacked = NULL; nvlist_destroy(nvl); nvl = nvlist_create(0); @@ -5084,7 +5084,7 @@ pf_getstate(struct pfioc_nv *nv) errout: if (s != NULL) PF_STATE_UNLOCK(s); - free(nvlpacked, M_TEMP); + free(nvlpacked, M_NVLIST); nvlist_destroy(nvl); return (error); } @@ -5126,6 +5126,7 @@ pf_getstates(struct pfioc_nv *nv) goto DIOCGETSTATESNV_full; } nvlist_append_nvlist_array(nvl, "states", nvls); + nvlist_destroy(nvls); count++; } PF_HASHROW_UNLOCK(ih); @@ -5152,7 +5153,7 @@ DIOCGETSTATESNV_full: #undef ERROUT errout: - free(nvlpacked, M_TEMP); + free(nvlpacked, M_NVLIST); nvlist_destroy(nvl); return (error); } diff --git a/sys/netpfil/pf/pf_nv.c b/sys/netpfil/pf/pf_nv.c index 863259dbf9aa..dab72f04d138 100644 --- a/sys/netpfil/pf/pf_nv.c +++ b/sys/netpfil/pf/pf_nv.c @@ -846,6 +846,7 @@ pf_state_key_to_nvstate_key(const struct pf_state_key *key) if (tmp == NULL) goto errout; nvlist_append_nvlist_array(nvl, "addr", tmp); + nvlist_destroy(tmp); nvlist_append_number_array(nvl, "port", key->port[i]); } nvlist_add_number(nvl, "af", key->af); From owner-dev-commits-src-branches@freebsd.org Sat Jun 5 01:19:57 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A8C5A63868D; Sat, 5 Jun 2021 01:19:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fxhd94KFKz3j0X; Sat, 5 Jun 2021 01:19:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6AA1B2767C; Sat, 5 Jun 2021 01:19:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1551JvRd091401; Sat, 5 Jun 2021 01:19:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1551JvXv091400; Sat, 5 Jun 2021 01:19:57 GMT (envelope-from git) Date: Sat, 5 Jun 2021 01:19:57 GMT Message-Id: <202106050119.1551JvXv091400@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 4fee353bcb45 - stable/13 - nfscl: Add hash lists for the NFSv4 opens MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4fee353bcb452022ae8a049eca7b32ab4b816b90 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Jun 2021 01:19:57 -0000 The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=4fee353bcb452022ae8a049eca7b32ab4b816b90 commit 4fee353bcb452022ae8a049eca7b32ab4b816b90 Author: Rick Macklem AuthorDate: 2021-05-22 21:51:38 +0000 Commit: Rick Macklem CommitDate: 2021-06-05 01:16:10 +0000 nfscl: Add hash lists for the NFSv4 opens A problem was reported via email, where a large (130000+) accumulation of NFSv4 opens on an NFSv4 mount caused significant lock contention on the mutex used to protect the client mount's open/lock state. Although the root cause for the accumulation of opens was not resolved, it is obvious that the NFSv4 client is not designed to handle 100000+ opens efficiently. When searching for an open, usually for a match by file handle, a linear search of all opens is done. This patch adds a table of hash lists for the opens, hashed on file handle. This table will be used by future commits to search for an open based on file handle more efficiently. (cherry picked from commit 3f7e14ad93454476bb11b4b8de5b41930d13312e) --- sys/fs/nfs/nfsclstate.h | 7 +++++++ sys/fs/nfsclient/nfs_clstate.c | 15 ++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/sys/fs/nfs/nfsclstate.h b/sys/fs/nfs/nfsclstate.h index e17be74c5581..898a7de391dc 100644 --- a/sys/fs/nfs/nfsclstate.h +++ b/sys/fs/nfs/nfsclstate.h @@ -42,6 +42,7 @@ LIST_HEAD(nfsclhead, nfsclclient); LIST_HEAD(nfsclownerhead, nfsclowner); TAILQ_HEAD(nfscldeleghead, nfscldeleg); LIST_HEAD(nfscldeleghash, nfscldeleg); +LIST_HEAD(nfsclopenhash, nfsclopen); TAILQ_HEAD(nfscllayouthead, nfscllayout); LIST_HEAD(nfscllayouthash, nfscllayout); LIST_HEAD(nfsclflayouthead, nfsclflayout); @@ -50,6 +51,10 @@ LIST_HEAD(nfsclrecalllayouthead, nfsclrecalllayout); #define NFSCLDELEGHASHSIZE 256 #define NFSCLDELEGHASH(c, f, l) \ (&((c)->nfsc_deleghash[ncl_hash((f), (l)) % NFSCLDELEGHASHSIZE])) +#define NFSCLOPENHASHSIZE 256 +#define NFSCLOPENHASHFUNC(f, l) (ncl_hash((f), (l)) % NFSCLOPENHASHSIZE) +#define NFSCLOPENHASH(c, f, l) \ + (&((c)->nfsc_openhash[NFSCLOPENHASHFUNC((f), (l))])) #define NFSCLLAYOUTHASHSIZE 256 #define NFSCLLAYOUTHASH(c, f, l) \ (&((c)->nfsc_layouthash[ncl_hash((f), (l)) % NFSCLLAYOUTHASHSIZE])) @@ -104,6 +109,7 @@ struct nfsclclient { struct nfsclownerhead nfsc_owner; struct nfscldeleghead nfsc_deleg; struct nfscldeleghash nfsc_deleghash[NFSCLDELEGHASHSIZE]; + struct nfsclopenhash nfsc_openhash[NFSCLOPENHASHSIZE]; struct nfscllayouthead nfsc_layout; struct nfscllayouthash nfsc_layouthash[NFSCLLAYOUTHASHSIZE]; struct nfscldevinfohead nfsc_devinfo; @@ -183,6 +189,7 @@ struct nfscldeleg { */ struct nfsclopen { LIST_ENTRY(nfsclopen) nfso_list; + LIST_ENTRY(nfsclopen) nfso_hash; struct nfscllockownerhead nfso_lock; nfsv4stateid_t nfso_stateid; struct nfsclowner *nfso_own; diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c index 1ed3630ce6e7..a8eace2ffd0b 100644 --- a/sys/fs/nfsclient/nfs_clstate.c +++ b/sys/fs/nfsclient/nfs_clstate.c @@ -240,9 +240,11 @@ nfscl_open(vnode_t vp, u_int8_t *nfhp, int fhlen, u_int32_t amode, int usedeleg, */ nowp = malloc(sizeof (struct nfsclowner), M_NFSCLOWNER, M_WAITOK); - if (nfhp != NULL) + if (nfhp != NULL) { nop = malloc(sizeof (struct nfsclopen) + fhlen - 1, M_NFSCLOPEN, M_WAITOK); + nop->nfso_hash.le_prev = NULL; + } ret = nfscl_getcl(vp->v_mount, cred, p, 1, &clp); if (ret != 0) { free(nowp, M_NFSCLOWNER); @@ -412,6 +414,8 @@ nfscl_newopen(struct nfsclclient *clp, struct nfscldeleg *dp, dp->nfsdl_timestamp = NFSD_MONOSEC + 120; nfsstatsv1.cllocalopens++; } else { + LIST_INSERT_HEAD(NFSCLOPENHASH(clp, fhp, fhlen), + nop, nfso_hash); nfsstatsv1.clopens++; } LIST_INSERT_HEAD(&owp->nfsow_open, nop, nfso_list); @@ -837,6 +841,8 @@ nfscl_getcl(struct mount *mp, struct ucred *cred, NFSPROC_T *p, LIST_INIT(&clp->nfsc_devinfo); for (i = 0; i < NFSCLDELEGHASHSIZE; i++) LIST_INIT(&clp->nfsc_deleghash[i]); + for (i = 0; i < NFSCLOPENHASHSIZE; i++) + LIST_INIT(&clp->nfsc_openhash[i]); for (i = 0; i < NFSCLLAYOUTHASHSIZE; i++) LIST_INIT(&clp->nfsc_layouthash[i]); clp->nfsc_flags = NFSCLFLAGS_INITED; @@ -1475,6 +1481,8 @@ nfscl_freeopen(struct nfsclopen *op, int local) { LIST_REMOVE(op, nfso_list); + if (op->nfso_hash.le_prev != NULL) + LIST_REMOVE(op, nfso_hash); nfscl_freealllocks(&op->nfso_lock, local); free(op, M_NFSCLOPEN); if (local) @@ -1706,6 +1714,8 @@ nfscl_expireclient(struct nfsclclient *clp, struct nfsmount *nmp, LIST_REMOVE(op, nfso_list); op->nfso_own = towp; LIST_INSERT_HEAD(&towp->nfsow_open, op, nfso_list); + LIST_INSERT_HEAD(NFSCLOPENHASH(clp, op->nfso_fh, + op->nfso_fhlen), op, nfso_hash); nfsstatsv1.cllocalopens--; nfsstatsv1.clopens++; } @@ -1714,6 +1724,8 @@ nfscl_expireclient(struct nfsclclient *clp, struct nfsmount *nmp, LIST_REMOVE(owp, nfsow_list); owp->nfsow_clp = clp; LIST_INSERT_HEAD(&clp->nfsc_owner, owp, nfsow_list); + LIST_INSERT_HEAD(NFSCLOPENHASH(clp, op->nfso_fh, + op->nfso_fhlen), op, nfso_hash); nfsstatsv1.cllocalopenowners--; nfsstatsv1.clopenowners++; nfsstatsv1.cllocalopens--; @@ -4198,6 +4210,7 @@ nfscl_moveopen(vnode_t vp, struct nfsclclient *clp, struct nfsmount *nmp, np = VTONFS(vp); nop = malloc(sizeof (struct nfsclopen) + lop->nfso_fhlen - 1, M_NFSCLOPEN, M_WAITOK); + nop->nfso_hash.le_prev = NULL; newone = 0; nfscl_newopen(clp, NULL, &owp, NULL, &op, &nop, owp->nfsow_owner, lop->nfso_fh, lop->nfso_fhlen, cred, &newone); From owner-dev-commits-src-branches@freebsd.org Sat Jun 5 23:52:01 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E000C64C37E; Sat, 5 Jun 2021 23:52:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FyGdF5rvrz4nCj; Sat, 5 Jun 2021 23:52:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B1C4319B41; Sat, 5 Jun 2021 23:52:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 155Nq1kR091282; Sat, 5 Jun 2021 23:52:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 155Nq1AH091281; Sat, 5 Jun 2021 23:52:01 GMT (envelope-from git) Date: Sat, 5 Jun 2021 23:52:01 GMT Message-Id: <202106052352.155Nq1AH091281@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Oleksandr Tymoshenko Subject: git: c69de0206511 - stable/13 - cron: consume blanks in system crontabs before options MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gonzo X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c69de0206511636ebe28ac226dce74f7b204735b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Jun 2021 23:52:01 -0000 The branch stable/13 has been updated by gonzo: URL: https://cgit.FreeBSD.org/src/commit/?id=c69de0206511636ebe28ac226dce74f7b204735b commit c69de0206511636ebe28ac226dce74f7b204735b Author: Oleksandr Tymoshenko AuthorDate: 2021-03-04 07:23:31 +0000 Commit: Oleksandr Tymoshenko CommitDate: 2021-06-05 22:49:45 +0000 cron: consume blanks in system crontabs before options On system crontabs, multiple blanks are not being consumed after reading the username. This change adds blank consumption before parsing any -[qn] options. Without this change, an entry like: * * * * * username -n true # Two spaces between username and option. will fail, as the shell will try to execute (' -n true'), while an entry like: * * * * * username -n true # One space between username and option. works as expected (executes 'true'). For user crontabs, this is not an issue as the preceding (day of week or @shortcut) processing consumes any leading whitespace. PR: 253699 Submitted by: Eric A. Borisch MFC after: 1 week (cherry picked from commit 37cd6c20dbcf251e38d6dfb9d3e02022941f6fc7) --- usr.sbin/cron/lib/entry.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/usr.sbin/cron/lib/entry.c b/usr.sbin/cron/lib/entry.c index 66ead885bea8..2693c9c8d07a 100644 --- a/usr.sbin/cron/lib/entry.c +++ b/usr.sbin/cron/lib/entry.c @@ -315,6 +315,9 @@ load_entry(file, error_func, pw, envp) goto eof; } + /* need to have consumed blanks when checking options below */ + Skip_Blanks(ch, file) + unget_char(ch, file); #ifdef LOGIN_CAP if ((s = strrchr(username, '/')) != NULL) { *s = '\0'; From owner-dev-commits-src-branches@freebsd.org Sun Jun 6 11:22:13 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 07E1565C946; Sun, 6 Jun 2021 11:22: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 4FyYxc6rctz4bd6; Sun, 6 Jun 2021 11:22:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D366D22B23; Sun, 6 Jun 2021 11:22:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 156BMCwL006712; Sun, 6 Jun 2021 11:22:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 156BMCXn006711; Sun, 6 Jun 2021 11:22:12 GMT (envelope-from git) Date: Sun, 6 Jun 2021 11:22:12 GMT Message-Id: <202106061122.156BMCXn006711@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: 773f045e33a5 - stable/12 - rsu(4): add ASUS WL-167G V3 to the list of supported devices. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 773f045e33a5762093622e609ac17c843c9379a3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jun 2021 11:22:13 -0000 The branch stable/12 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=773f045e33a5762093622e609ac17c843c9379a3 commit 773f045e33a5762093622e609ac17c843c9379a3 Author: Dmitry Chagin AuthorDate: 2021-05-23 15:42:29 +0000 Commit: Dmitry Chagin CommitDate: 2021-06-06 11:20:01 +0000 rsu(4): add ASUS WL-167G V3 to the list of supported devices. (cherry picked from commit b595729ccfde8e5d5bac0acf9690de9d437a1afd) --- share/man/man4/rsu.4 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/share/man/man4/rsu.4 b/share/man/man4/rsu.4 index 8e875400bc0b..1d38c4a1618d 100644 --- a/share/man/man4/rsu.4 +++ b/share/man/man4/rsu.4 @@ -15,7 +15,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd April 4, 2018 +.Dd May 23, 2021 .Dt RSU 4 .Os .Sh NAME @@ -115,6 +115,7 @@ wireless network adapters, including: .Pp .Bl -tag -width Ds -offset indent -compact .It ASUS USB-N10 +.It ASUS WL-167G V3 .It Belkin F7D1101 v1 .It D-Link DWA-131 A1 .It EDUP EP-MS150N(W) From owner-dev-commits-src-branches@freebsd.org Sun Jun 6 11:22:14 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3903865CB13; Sun, 6 Jun 2021 11:22: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 4FyYxf0nstz4bG7; Sun, 6 Jun 2021 11:22:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 02BE922AD2; Sun, 6 Jun 2021 11:22:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 156BMDHu006736; Sun, 6 Jun 2021 11:22:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 156BMDIT006735; Sun, 6 Jun 2021 11:22:13 GMT (envelope-from git) Date: Sun, 6 Jun 2021 11:22:13 GMT Message-Id: <202106061122.156BMDIT006735@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: b86230e64a83 - stable/12 - run(4): add support for DLINK DWA-130 rev F1 wireless adaptor. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: b86230e64a837edbc07b033197365fab92bce9a0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jun 2021 11:22:14 -0000 The branch stable/12 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=b86230e64a837edbc07b033197365fab92bce9a0 commit b86230e64a837edbc07b033197365fab92bce9a0 Author: Dmitry Chagin AuthorDate: 2021-05-23 18:31:51 +0000 Commit: Dmitry Chagin CommitDate: 2021-06-06 11:21:10 +0000 run(4): add support for DLINK DWA-130 rev F1 wireless adaptor. PR: 256092 Submitted by: Francois Briere (cherry picked from commit 8746bc91873430d977b09bcc3fbd4d1b417a5a57) --- share/man/man4/run.4 | 1 + sys/dev/usb/usbdevs | 1 + sys/dev/usb/wlan/if_run.c | 1 + 3 files changed, 3 insertions(+) diff --git a/share/man/man4/run.4 b/share/man/man4/run.4 index ad314ff67011..0cea7beada77 100644 --- a/share/man/man4/run.4 +++ b/share/man/man4/run.4 @@ -145,6 +145,7 @@ driver supports the following wireless adapters: .It Corega CG-WLUSB300AGN .It Corega CG-WLUSB300GNM .It D-Link DWA-130 rev B1 +.It D-Link DWA-130 rev F1 .It D-Link DWA-140 rev B1, B2, B3, \&D1 .It D-Link DWA-160 rev B2 .It D-Link DWA-162 diff --git a/sys/dev/usb/usbdevs b/sys/dev/usb/usbdevs index db08e8e71d4b..9add31c6d781 100644 --- a/sys/dev/usb/usbdevs +++ b/sys/dev/usb/usbdevs @@ -1737,6 +1737,7 @@ product DLINK DWA160B2 0x3c1a DWA-160 rev B2 product DLINK DWA127 0x3c1b DWA-127 Wireless Adapter product DLINK DWA162 0x3c1f DWA-162 Wireless Adapter product DLINK DWA140D1 0x3c20 DWA-140 rev D1 +product DLINK DWA130F1 0x3c25 DWA-130 rev F1 product DLINK DSB650C 0x4000 10Mbps Ethernet product DLINK DSB650TX1 0x4001 10/100 Ethernet product DLINK DSB650TX 0x4002 10/100 Ethernet diff --git a/sys/dev/usb/wlan/if_run.c b/sys/dev/usb/wlan/if_run.c index edee3eaa863b..4460c5f40c00 100644 --- a/sys/dev/usb/wlan/if_run.c +++ b/sys/dev/usb/wlan/if_run.c @@ -213,6 +213,7 @@ static const STRUCT_USB_HOST_ID run_devs[] = { RUN_DEV(DLINK, DWA140B3), RUN_DEV(DLINK, DWA160B2), RUN_DEV(DLINK, DWA140D1), + RUN_DEV(DLINK, DWA130F1), RUN_DEV(DLINK, DWA162), RUN_DEV(DLINK2, DWA130), RUN_DEV(DLINK2, RT2870_1), From owner-dev-commits-src-branches@freebsd.org Sun Jun 6 11:24:02 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C3B4565CEAB; Sun, 6 Jun 2021 11:24:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FyYzk5BQ6z4bvP; Sun, 6 Jun 2021 11:24:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9A57F2293F; Sun, 6 Jun 2021 11:24:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 156BO28T006982; Sun, 6 Jun 2021 11:24:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 156BO2iD006981; Sun, 6 Jun 2021 11:24:02 GMT (envelope-from git) Date: Sun, 6 Jun 2021 11:24:02 GMT Message-Id: <202106061124.156BO2iD006981@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: c93a3187c24c - stable/13 - rsu(4): add ASUS WL-167G V3 to the list of supported devices. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c93a3187c24c85032debada1f3a80fa611e5bb2c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jun 2021 11:24:02 -0000 The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=c93a3187c24c85032debada1f3a80fa611e5bb2c commit c93a3187c24c85032debada1f3a80fa611e5bb2c Author: Dmitry Chagin AuthorDate: 2021-05-23 15:42:29 +0000 Commit: Dmitry Chagin CommitDate: 2021-06-06 11:23:10 +0000 rsu(4): add ASUS WL-167G V3 to the list of supported devices. (cherry picked from commit b595729ccfde8e5d5bac0acf9690de9d437a1afd) --- share/man/man4/rsu.4 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/share/man/man4/rsu.4 b/share/man/man4/rsu.4 index 8e875400bc0b..1d38c4a1618d 100644 --- a/share/man/man4/rsu.4 +++ b/share/man/man4/rsu.4 @@ -15,7 +15,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd April 4, 2018 +.Dd May 23, 2021 .Dt RSU 4 .Os .Sh NAME @@ -115,6 +115,7 @@ wireless network adapters, including: .Pp .Bl -tag -width Ds -offset indent -compact .It ASUS USB-N10 +.It ASUS WL-167G V3 .It Belkin F7D1101 v1 .It D-Link DWA-131 A1 .It EDUP EP-MS150N(W) From owner-dev-commits-src-branches@freebsd.org Sun Jun 6 11:24:03 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ECF5B65CB23; Sun, 6 Jun 2021 11:24:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FyYzl6Fsbz4bxm; Sun, 6 Jun 2021 11:24:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BCA3A22C91; Sun, 6 Jun 2021 11:24:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 156BO3f6007009; Sun, 6 Jun 2021 11:24:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 156BO3ss007008; Sun, 6 Jun 2021 11:24:03 GMT (envelope-from git) Date: Sun, 6 Jun 2021 11:24:03 GMT Message-Id: <202106061124.156BO3ss007008@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: 195f47fdb6c8 - stable/13 - run(4): add support for DLINK DWA-130 rev F1 wireless adaptor. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 195f47fdb6c8fc6592b0b324e3891ba03ad58a5d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jun 2021 11:24:04 -0000 The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=195f47fdb6c8fc6592b0b324e3891ba03ad58a5d commit 195f47fdb6c8fc6592b0b324e3891ba03ad58a5d Author: Dmitry Chagin AuthorDate: 2021-05-23 18:31:51 +0000 Commit: Dmitry Chagin CommitDate: 2021-06-06 11:23:43 +0000 run(4): add support for DLINK DWA-130 rev F1 wireless adaptor. PR: 256092 Submitted by: Francois Briere (cherry picked from commit 8746bc91873430d977b09bcc3fbd4d1b417a5a57) --- share/man/man4/run.4 | 1 + sys/dev/usb/usbdevs | 1 + sys/dev/usb/wlan/if_run.c | 1 + 3 files changed, 3 insertions(+) diff --git a/share/man/man4/run.4 b/share/man/man4/run.4 index ad314ff67011..0cea7beada77 100644 --- a/share/man/man4/run.4 +++ b/share/man/man4/run.4 @@ -145,6 +145,7 @@ driver supports the following wireless adapters: .It Corega CG-WLUSB300AGN .It Corega CG-WLUSB300GNM .It D-Link DWA-130 rev B1 +.It D-Link DWA-130 rev F1 .It D-Link DWA-140 rev B1, B2, B3, \&D1 .It D-Link DWA-160 rev B2 .It D-Link DWA-162 diff --git a/sys/dev/usb/usbdevs b/sys/dev/usb/usbdevs index c2a1a9ff31e6..1239449b4697 100644 --- a/sys/dev/usb/usbdevs +++ b/sys/dev/usb/usbdevs @@ -1736,6 +1736,7 @@ product DLINK DWA160B2 0x3c1a DWA-160 rev B2 product DLINK DWA127 0x3c1b DWA-127 Wireless Adapter product DLINK DWA162 0x3c1f DWA-162 Wireless Adapter product DLINK DWA140D1 0x3c20 DWA-140 rev D1 +product DLINK DWA130F1 0x3c25 DWA-130 rev F1 product DLINK DSB650C 0x4000 10Mbps Ethernet product DLINK DSB650TX1 0x4001 10/100 Ethernet product DLINK DSB650TX 0x4002 10/100 Ethernet diff --git a/sys/dev/usb/wlan/if_run.c b/sys/dev/usb/wlan/if_run.c index c7f0ae40f666..52933a4812dc 100644 --- a/sys/dev/usb/wlan/if_run.c +++ b/sys/dev/usb/wlan/if_run.c @@ -215,6 +215,7 @@ static const STRUCT_USB_HOST_ID run_devs[] = { RUN_DEV(DLINK, DWA140B3), RUN_DEV(DLINK, DWA160B2), RUN_DEV(DLINK, DWA140D1), + RUN_DEV(DLINK, DWA130F1), RUN_DEV(DLINK, DWA162), RUN_DEV(DLINK2, DWA130), RUN_DEV(DLINK2, RT2870_1), From owner-dev-commits-src-branches@freebsd.org Sun Jun 6 11:39:16 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D915F65D023; Sun, 6 Jun 2021 11:39: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 4FyZKJ5q0Qz4dZy; Sun, 6 Jun 2021 11:39:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A5AD622968; Sun, 6 Jun 2021 11:39:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 156BdGeD020582; Sun, 6 Jun 2021 11:39:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 156BdG8k020581; Sun, 6 Jun 2021 11:39:16 GMT (envelope-from git) Date: Sun, 6 Jun 2021 11:39:16 GMT Message-Id: <202106061139.156BdG8k020581@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 00e619dd054a - stable/13 - Merge llvm commits for kernel address and memory sanitizer support MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 00e619dd054a46f04b57102b48d231cd36f206c2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jun 2021 11:39:16 -0000 The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=00e619dd054a46f04b57102b48d231cd36f206c2 commit 00e619dd054a46f04b57102b48d231cd36f206c2 Author: Dimitry Andric AuthorDate: 2021-06-06 11:38:33 +0000 Commit: Dimitry Andric CommitDate: 2021-06-06 11:38:33 +0000 Merge llvm commits for kernel address and memory sanitizer support Merge commit 99eca1bd9c7a from llvm git (by Mark Johnston): [Driver] Enable kernel address and memory sanitizers on FreeBSD Test Plan: using kernel ASAN and MSAN implementations in FreeBSD Reviewed By: emaste, dim, arichardson Differential Revision: https://reviews.llvm.org/D98286 Merge commit f511dc75e4c1 from llvm git (by Mark Johnston): [asan] Add an offset for the kernel address sanitizer on FreeBSD This is based on a port of the sanitizer runtime to the FreeBSD kernel that has been commited as https://cgit.freebsd.org/src/commit/?id=38da497a4dfcf1979c8c2b0e9f3fa0564035c147 and the following commits. Reviewed By: emaste, dim Differential Revision: https://reviews.llvm.org/D98285 Requested by: markj MFC after: 3 days (cherry picked from commit 1b00608b264f1fac846e571e23d8ef7134834638) --- contrib/llvm-project/clang/lib/Driver/ToolChains/FreeBSD.cpp | 8 +++++++- .../llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp | 10 +++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/contrib/llvm-project/clang/lib/Driver/ToolChains/FreeBSD.cpp b/contrib/llvm-project/clang/lib/Driver/ToolChains/FreeBSD.cpp index 6d8e25470e28..baefb1607619 100644 --- a/contrib/llvm-project/clang/lib/Driver/ToolChains/FreeBSD.cpp +++ b/contrib/llvm-project/clang/lib/Driver/ToolChains/FreeBSD.cpp @@ -459,6 +459,7 @@ bool FreeBSD::IsUnwindTablesDefault(const ArgList &Args) const { return true; } bool FreeBSD::isPIEDefault() const { return getSanitizerArgs().requiresPIE(); } SanitizerMask FreeBSD::getSupportedSanitizers() const { + const bool IsAArch64 = getTriple().getArch() == llvm::Triple::aarch64; const bool IsX86 = getTriple().getArch() == llvm::Triple::x86; const bool IsX86_64 = getTriple().getArch() == llvm::Triple::x86_64; const bool IsMIPS64 = getTriple().isMIPS64(); @@ -477,8 +478,13 @@ SanitizerMask FreeBSD::getSupportedSanitizers() const { Res |= SanitizerKind::Fuzzer; Res |= SanitizerKind::FuzzerNoLink; } - if (IsX86_64) + if (IsAArch64 || IsX86_64) { + Res |= SanitizerKind::KernelAddress; + Res |= SanitizerKind::KernelMemory; + } + if (IsX86_64) { Res |= SanitizerKind::Memory; + } return Res; } diff --git a/contrib/llvm-project/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp b/contrib/llvm-project/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp index 1557fad4d372..5ce21cc3616a 100644 --- a/contrib/llvm-project/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp +++ b/contrib/llvm-project/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp @@ -107,6 +107,7 @@ static const uint64_t kMIPS64_ShadowOffset64 = 1ULL << 37; static const uint64_t kAArch64_ShadowOffset64 = 1ULL << 36; static const uint64_t kFreeBSD_ShadowOffset32 = 1ULL << 30; static const uint64_t kFreeBSD_ShadowOffset64 = 1ULL << 46; +static const uint64_t kFreeBSDKasan_ShadowOffset64 = 0xdffff7c000000000; static const uint64_t kNetBSD_ShadowOffset32 = 1ULL << 30; static const uint64_t kNetBSD_ShadowOffset64 = 1ULL << 46; static const uint64_t kNetBSDKasan_ShadowOffset64 = 0xdfff900000000000; @@ -489,9 +490,12 @@ static ShadowMapping getShadowMapping(Triple &TargetTriple, int LongSize, Mapping.Offset = kPPC64_ShadowOffset64; else if (IsSystemZ) Mapping.Offset = kSystemZ_ShadowOffset64; - else if (IsFreeBSD && !IsMIPS64) - Mapping.Offset = kFreeBSD_ShadowOffset64; - else if (IsNetBSD) { + else if (IsFreeBSD && !IsMIPS64) { + if (IsKasan) + Mapping.Offset = kFreeBSDKasan_ShadowOffset64; + else + Mapping.Offset = kFreeBSD_ShadowOffset64; + } else if (IsNetBSD) { if (IsKasan) Mapping.Offset = kNetBSDKasan_ShadowOffset64; else From owner-dev-commits-src-branches@freebsd.org Sun Jun 6 11:50:41 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D5C5765D40E; Sun, 6 Jun 2021 11:50:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FyZZT5fmVz4fGW; Sun, 6 Jun 2021 11:50:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AAC1022F99; Sun, 6 Jun 2021 11:50:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 156Bof0x041865; Sun, 6 Jun 2021 11:50:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 156Bof0Q041864; Sun, 6 Jun 2021 11:50:41 GMT (envelope-from git) Date: Sun, 6 Jun 2021 11:50:41 GMT Message-Id: <202106061150.156Bof0Q041864@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 70e13c4cffd5 - stable/13 - Add C++ headers MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 70e13c4cffd5ff7a70296bc5c4c3b7525c278b1d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jun 2021 11:50:41 -0000 The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=70e13c4cffd5ff7a70296bc5c4c3b7525c278b1d commit 70e13c4cffd5ff7a70296bc5c4c3b7525c278b1d Author: Dimitry Andric AuthorDate: 2021-06-03 18:53:18 +0000 Commit: Dimitry Andric CommitDate: 2021-06-06 11:41:34 +0000 Add C++ headers I missed adding these to the libc++ Makefile, when importing llvm-project 11.0.0-rc1, even though they were supplied by upstream. While here, update OptionalObsoleteFiles.inc to add these new headers, and cleanup old cruft. Reported by: yuri Submitted by: jkim (Makefile diff) PR: 255374 MFC after: 3 days (cherry picked from commit 95aa617e4bf09fcc813b1bab3d0dbf4b606807b1) --- lib/libc++/Makefile | 6 +++++ tools/build/mk/OptionalObsoleteFiles.inc | 43 ++++++++++++++++++++------------ 2 files changed, 33 insertions(+), 16 deletions(-) diff --git a/lib/libc++/Makefile b/lib/libc++/Makefile index bfb394fda2fb..066faf4abb1f 100644 --- a/lib/libc++/Makefile +++ b/lib/libc++/Makefile @@ -112,6 +112,7 @@ STD_HEADERS+= algorithm STD_HEADERS+= any STD_HEADERS+= array STD_HEADERS+= atomic +STD_HEADERS+= barrier STD_HEADERS+= bit STD_HEADERS+= bitset STD_HEADERS+= cassert @@ -131,6 +132,7 @@ STD_HEADERS+= codecvt STD_HEADERS+= compare STD_HEADERS+= complex STD_HEADERS+= complex.h +STD_HEADERS+= concepts STD_HEADERS+= condition_variable STD_HEADERS+= csetjmp STD_HEADERS+= csignal @@ -149,6 +151,7 @@ STD_HEADERS+= cwctype STD_HEADERS+= deque STD_HEADERS+= errno.h STD_HEADERS+= exception +STD_HEADERS+= execution STD_HEADERS+= fenv.h STD_HEADERS+= filesystem STD_HEADERS+= float.h @@ -164,6 +167,7 @@ STD_HEADERS+= iosfwd STD_HEADERS+= iostream STD_HEADERS+= istream STD_HEADERS+= iterator +STD_HEADERS+= latch STD_HEADERS+= limits STD_HEADERS+= limits.h STD_HEADERS+= list @@ -174,6 +178,7 @@ STD_HEADERS+= math.h STD_HEADERS+= memory STD_HEADERS+= mutex STD_HEADERS+= new +STD_HEADERS+= numbers STD_HEADERS+= numeric STD_HEADERS+= optional STD_HEADERS+= ostream @@ -182,6 +187,7 @@ STD_HEADERS+= random STD_HEADERS+= ratio STD_HEADERS+= regex STD_HEADERS+= scoped_allocator +STD_HEADERS+= semaphore STD_HEADERS+= set STD_HEADERS+= setjmp.h STD_HEADERS+= shared_mutex diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc index 4045355fb27f..ad4793ac9047 100644 --- a/tools/build/mk/OptionalObsoleteFiles.inc +++ b/tools/build/mk/OptionalObsoleteFiles.inc @@ -3831,6 +3831,7 @@ OLD_FILES+=usr/include/c++/v1/algorithm OLD_FILES+=usr/include/c++/v1/any OLD_FILES+=usr/include/c++/v1/array OLD_FILES+=usr/include/c++/v1/atomic +OLD_FILES+=usr/include/c++/v1/barrier OLD_FILES+=usr/include/c++/v1/bit OLD_FILES+=usr/include/c++/v1/bitset OLD_FILES+=usr/include/c++/v1/cassert @@ -3850,6 +3851,7 @@ OLD_FILES+=usr/include/c++/v1/codecvt OLD_FILES+=usr/include/c++/v1/compare OLD_FILES+=usr/include/c++/v1/complex OLD_FILES+=usr/include/c++/v1/complex.h +OLD_FILES+=usr/include/c++/v1/concepts OLD_FILES+=usr/include/c++/v1/condition_variable OLD_FILES+=usr/include/c++/v1/csetjmp OLD_FILES+=usr/include/c++/v1/csignal @@ -3869,14 +3871,12 @@ OLD_FILES+=usr/include/c++/v1/cxxabi.h OLD_FILES+=usr/include/c++/v1/deque OLD_FILES+=usr/include/c++/v1/errno.h OLD_FILES+=usr/include/c++/v1/exception +OLD_FILES+=usr/include/c++/v1/execution OLD_FILES+=usr/include/c++/v1/experimental/__config OLD_FILES+=usr/include/c++/v1/experimental/__memory OLD_FILES+=usr/include/c++/v1/experimental/algorithm -OLD_FILES+=usr/include/c++/v1/experimental/any -OLD_FILES+=usr/include/c++/v1/experimental/chrono OLD_FILES+=usr/include/c++/v1/experimental/coroutine OLD_FILES+=usr/include/c++/v1/experimental/deque -OLD_FILES+=usr/include/c++/v1/experimental/dynarray OLD_FILES+=usr/include/c++/v1/experimental/filesystem OLD_FILES+=usr/include/c++/v1/experimental/forward_list OLD_FILES+=usr/include/c++/v1/experimental/functional @@ -3884,25 +3884,22 @@ OLD_FILES+=usr/include/c++/v1/experimental/iterator OLD_FILES+=usr/include/c++/v1/experimental/list OLD_FILES+=usr/include/c++/v1/experimental/map OLD_FILES+=usr/include/c++/v1/experimental/memory_resource -OLD_FILES+=usr/include/c++/v1/experimental/numeric -OLD_FILES+=usr/include/c++/v1/experimental/optional OLD_FILES+=usr/include/c++/v1/experimental/propagate_const -OLD_FILES+=usr/include/c++/v1/experimental/ratio OLD_FILES+=usr/include/c++/v1/experimental/regex OLD_FILES+=usr/include/c++/v1/experimental/set OLD_FILES+=usr/include/c++/v1/experimental/simd OLD_FILES+=usr/include/c++/v1/experimental/string -OLD_FILES+=usr/include/c++/v1/experimental/string_view -OLD_FILES+=usr/include/c++/v1/experimental/system_error -OLD_FILES+=usr/include/c++/v1/experimental/tuple OLD_FILES+=usr/include/c++/v1/experimental/type_traits OLD_FILES+=usr/include/c++/v1/experimental/unordered_map OLD_FILES+=usr/include/c++/v1/experimental/unordered_set OLD_FILES+=usr/include/c++/v1/experimental/utility OLD_FILES+=usr/include/c++/v1/experimental/vector +OLD_DIRS+=usr/include/c++/v1/experimental OLD_FILES+=usr/include/c++/v1/ext/__hash OLD_FILES+=usr/include/c++/v1/ext/hash_map OLD_FILES+=usr/include/c++/v1/ext/hash_set +OLD_DIRS+=usr/include/c++/v1/ext +OLD_FILES+=usr/include/c++/v1/fenv.h OLD_FILES+=usr/include/c++/v1/filesystem OLD_FILES+=usr/include/c++/v1/float.h OLD_FILES+=usr/include/c++/v1/forward_list @@ -3917,6 +3914,7 @@ OLD_FILES+=usr/include/c++/v1/iosfwd OLD_FILES+=usr/include/c++/v1/iostream OLD_FILES+=usr/include/c++/v1/istream OLD_FILES+=usr/include/c++/v1/iterator +OLD_FILES+=usr/include/c++/v1/latch OLD_FILES+=usr/include/c++/v1/limits OLD_FILES+=usr/include/c++/v1/limits.h OLD_FILES+=usr/include/c++/v1/list @@ -3927,7 +3925,7 @@ OLD_FILES+=usr/include/c++/v1/math.h OLD_FILES+=usr/include/c++/v1/memory OLD_FILES+=usr/include/c++/v1/mutex OLD_FILES+=usr/include/c++/v1/new -OLD_FILES+=usr/include/c++/v1/numeric +OLD_FILES+=usr/include/c++/v1/numbers OLD_FILES+=usr/include/c++/v1/numeric OLD_FILES+=usr/include/c++/v1/optional OLD_FILES+=usr/include/c++/v1/ostream @@ -3936,6 +3934,7 @@ OLD_FILES+=usr/include/c++/v1/random OLD_FILES+=usr/include/c++/v1/ratio OLD_FILES+=usr/include/c++/v1/regex OLD_FILES+=usr/include/c++/v1/scoped_allocator +OLD_FILES+=usr/include/c++/v1/semaphore OLD_FILES+=usr/include/c++/v1/set OLD_FILES+=usr/include/c++/v1/setjmp.h OLD_FILES+=usr/include/c++/v1/shared_mutex @@ -3956,12 +3955,12 @@ OLD_FILES+=usr/include/c++/v1/strstream OLD_FILES+=usr/include/c++/v1/system_error OLD_FILES+=usr/include/c++/v1/tgmath.h OLD_FILES+=usr/include/c++/v1/thread -OLD_FILES+=usr/include/c++/v1/version OLD_FILES+=usr/include/c++/v1/tr1/__bit_reference OLD_FILES+=usr/include/c++/v1/tr1/__bsd_locale_defaults.h OLD_FILES+=usr/include/c++/v1/tr1/__bsd_locale_fallbacks.h OLD_FILES+=usr/include/c++/v1/tr1/__config OLD_FILES+=usr/include/c++/v1/tr1/__debug +OLD_FILES+=usr/include/c++/v1/tr1/__errc OLD_FILES+=usr/include/c++/v1/tr1/__functional_03 OLD_FILES+=usr/include/c++/v1/tr1/__functional_base OLD_FILES+=usr/include/c++/v1/tr1/__functional_base_03 @@ -3969,6 +3968,7 @@ OLD_FILES+=usr/include/c++/v1/tr1/__hash_table OLD_FILES+=usr/include/c++/v1/tr1/__libcpp_version OLD_FILES+=usr/include/c++/v1/tr1/__locale OLD_FILES+=usr/include/c++/v1/tr1/__mutex_base +OLD_FILES+=usr/include/c++/v1/tr1/__node_handle OLD_FILES+=usr/include/c++/v1/tr1/__nullptr OLD_FILES+=usr/include/c++/v1/tr1/__split_buffer OLD_FILES+=usr/include/c++/v1/tr1/__sso_allocator @@ -3982,6 +3982,8 @@ OLD_FILES+=usr/include/c++/v1/tr1/algorithm OLD_FILES+=usr/include/c++/v1/tr1/any OLD_FILES+=usr/include/c++/v1/tr1/array OLD_FILES+=usr/include/c++/v1/tr1/atomic +OLD_FILES+=usr/include/c++/v1/tr1/barrier +OLD_FILES+=usr/include/c++/v1/tr1/bit OLD_FILES+=usr/include/c++/v1/tr1/bitset OLD_FILES+=usr/include/c++/v1/tr1/cassert OLD_FILES+=usr/include/c++/v1/tr1/ccomplex @@ -3989,6 +3991,7 @@ OLD_FILES+=usr/include/c++/v1/tr1/cctype OLD_FILES+=usr/include/c++/v1/tr1/cerrno OLD_FILES+=usr/include/c++/v1/tr1/cfenv OLD_FILES+=usr/include/c++/v1/tr1/cfloat +OLD_FILES+=usr/include/c++/v1/tr1/charconv OLD_FILES+=usr/include/c++/v1/tr1/chrono OLD_FILES+=usr/include/c++/v1/tr1/cinttypes OLD_FILES+=usr/include/c++/v1/tr1/ciso646 @@ -3996,8 +3999,10 @@ OLD_FILES+=usr/include/c++/v1/tr1/climits OLD_FILES+=usr/include/c++/v1/tr1/clocale OLD_FILES+=usr/include/c++/v1/tr1/cmath OLD_FILES+=usr/include/c++/v1/tr1/codecvt +OLD_FILES+=usr/include/c++/v1/tr1/compare OLD_FILES+=usr/include/c++/v1/tr1/complex OLD_FILES+=usr/include/c++/v1/tr1/complex.h +OLD_FILES+=usr/include/c++/v1/tr1/concepts OLD_FILES+=usr/include/c++/v1/tr1/condition_variable OLD_FILES+=usr/include/c++/v1/tr1/csetjmp OLD_FILES+=usr/include/c++/v1/tr1/csignal @@ -4016,6 +4021,9 @@ OLD_FILES+=usr/include/c++/v1/tr1/cwctype OLD_FILES+=usr/include/c++/v1/tr1/deque OLD_FILES+=usr/include/c++/v1/tr1/errno.h OLD_FILES+=usr/include/c++/v1/tr1/exception +OLD_FILES+=usr/include/c++/v1/tr1/execution +OLD_FILES+=usr/include/c++/v1/tr1/fenv.h +OLD_FILES+=usr/include/c++/v1/tr1/filesystem OLD_FILES+=usr/include/c++/v1/tr1/float.h OLD_FILES+=usr/include/c++/v1/tr1/forward_list OLD_FILES+=usr/include/c++/v1/tr1/fstream @@ -4029,6 +4037,7 @@ OLD_FILES+=usr/include/c++/v1/tr1/iosfwd OLD_FILES+=usr/include/c++/v1/tr1/iostream OLD_FILES+=usr/include/c++/v1/tr1/istream OLD_FILES+=usr/include/c++/v1/tr1/iterator +OLD_FILES+=usr/include/c++/v1/tr1/latch OLD_FILES+=usr/include/c++/v1/tr1/limits OLD_FILES+=usr/include/c++/v1/tr1/limits.h OLD_FILES+=usr/include/c++/v1/tr1/list @@ -4039,7 +4048,7 @@ OLD_FILES+=usr/include/c++/v1/tr1/math.h OLD_FILES+=usr/include/c++/v1/tr1/memory OLD_FILES+=usr/include/c++/v1/tr1/mutex OLD_FILES+=usr/include/c++/v1/tr1/new -OLD_FILES+=usr/include/c++/v1/tr1/numeric +OLD_FILES+=usr/include/c++/v1/tr1/numbers OLD_FILES+=usr/include/c++/v1/tr1/numeric OLD_FILES+=usr/include/c++/v1/tr1/optional OLD_FILES+=usr/include/c++/v1/tr1/ostream @@ -4048,9 +4057,11 @@ OLD_FILES+=usr/include/c++/v1/tr1/random OLD_FILES+=usr/include/c++/v1/tr1/ratio OLD_FILES+=usr/include/c++/v1/tr1/regex OLD_FILES+=usr/include/c++/v1/tr1/scoped_allocator +OLD_FILES+=usr/include/c++/v1/tr1/semaphore OLD_FILES+=usr/include/c++/v1/tr1/set OLD_FILES+=usr/include/c++/v1/tr1/setjmp.h OLD_FILES+=usr/include/c++/v1/tr1/shared_mutex +OLD_FILES+=usr/include/c++/v1/tr1/span OLD_FILES+=usr/include/c++/v1/tr1/sstream OLD_FILES+=usr/include/c++/v1/tr1/stack OLD_FILES+=usr/include/c++/v1/tr1/stdbool.h @@ -4077,8 +4088,10 @@ OLD_FILES+=usr/include/c++/v1/tr1/utility OLD_FILES+=usr/include/c++/v1/tr1/valarray OLD_FILES+=usr/include/c++/v1/tr1/variant OLD_FILES+=usr/include/c++/v1/tr1/vector +OLD_FILES+=usr/include/c++/v1/tr1/version OLD_FILES+=usr/include/c++/v1/tr1/wchar.h OLD_FILES+=usr/include/c++/v1/tr1/wctype.h +OLD_DIRS+=usr/include/c++/v1/tr1 OLD_FILES+=usr/include/c++/v1/tuple OLD_FILES+=usr/include/c++/v1/type_traits OLD_FILES+=usr/include/c++/v1/typeindex @@ -4092,8 +4105,10 @@ OLD_FILES+=usr/include/c++/v1/utility OLD_FILES+=usr/include/c++/v1/valarray OLD_FILES+=usr/include/c++/v1/variant OLD_FILES+=usr/include/c++/v1/vector +OLD_FILES+=usr/include/c++/v1/version OLD_FILES+=usr/include/c++/v1/wchar.h OLD_FILES+=usr/include/c++/v1/wctype.h +OLD_DIRS+=usr/include/c++/v1 OLD_FILES+=usr/lib32/libc++.a OLD_FILES+=usr/lib32/libc++.so OLD_LIBS+=usr/lib32/libc++.so.1 @@ -4104,10 +4119,6 @@ OLD_FILES+=usr/lib32/libcxxrt.a OLD_FILES+=usr/lib32/libcxxrt.so OLD_LIBS+=usr/lib32/libcxxrt.so.1 OLD_FILES+=usr/lib32/libcxxrt_p.a -OLD_DIRS+=usr/include/c++/v1/tr1 -OLD_DIRS+=usr/include/c++/v1/experimental -OLD_DIRS+=usr/include/c++/v1/ext -OLD_DIRS+=usr/include/c++/v1 .endif .if ${MK_LLD} == no From owner-dev-commits-src-branches@freebsd.org Sun Jun 6 14:13:08 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4D7F065F66F; Sun, 6 Jun 2021 14:13: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 4Fydkr1pzQz4qhy; Sun, 6 Jun 2021 14:13:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 26E5524B7F; Sun, 6 Jun 2021 14:13:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 156ED8DR033033; Sun, 6 Jun 2021 14:13:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 156ED88f033032; Sun, 6 Jun 2021 14:13:08 GMT (envelope-from git) Date: Sun, 6 Jun 2021 14:13:08 GMT Message-Id: <202106061413.156ED88f033032@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 088dbb4b8d3e - stable/13 - Restore Cirrus-CI boot smoke test MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 088dbb4b8d3eb8275c9aba34eb521dbc79f98f51 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jun 2021 14:13:08 -0000 The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=088dbb4b8d3eb8275c9aba34eb521dbc79f98f51 commit 088dbb4b8d3eb8275c9aba34eb521dbc79f98f51 Author: Ed Maste AuthorDate: 2021-05-02 19:28:36 +0000 Commit: Ed Maste CommitDate: 2021-06-06 14:12:44 +0000 Restore Cirrus-CI boot smoke test This reverts commit a7d593dd1da27833b5384349700bc3c7bcae6aad. We now use compute_engine_instance which allows us to specify a custom disk size. Also go back to using the default qemu version (rather than qemu42 or qemu-devel) as any issues were fixed some time ago. Reviewed by: lwhsu, markj MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D30082 (cherry picked from commit cec2682cd2910080951782391d7d7cd30c95c4ea) --- .cirrus.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index ff144699675e..963355013df0 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -1,11 +1,14 @@ # $FreeBSD$ -freebsd_instance: +compute_engine_instance: # Image list available via # gcloud compute images list --project freebsd-org-cloud-dev --no-standard-images + platform: freebsd + image_project: freebsd-org-cloud-dev image: freebsd-13-0-release-amd64 cpu: 8 memory: 24G + disk: 40 env: CIRRUS_CLONE_DEPTH: 1 @@ -13,7 +16,7 @@ env: task: timeout_in: 120m install_script: - - pkg install -y llvm11 + - pkg install -y qemu uefi-edk2-qemu-x86_64 llvm11 setup_script: - uname -a - df -m @@ -22,6 +25,10 @@ task: - chown user:user /usr/obj/$(pwd -P) script: - su user -c "make -j$(sysctl -n hw.ncpu) CROSS_TOOLCHAIN=llvm11 WITHOUT_TOOLCHAIN=yes buildworld buildkernel" + package_script: + - su user -c "make CROSS_TOOLCHAIN=llvm11 WITHOUT_TOOLCHAIN=yes PKG_FORMAT=tar packages" + test_script: + - sh tools/boot/ci-qemu-test.sh post_script: - df -m - - du -m -s /usr/obj \ No newline at end of file + - du -m -s /usr/obj From owner-dev-commits-src-branches@freebsd.org Sun Jun 6 19:20:29 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4C26963BF8E; Sun, 6 Jun 2021 19:20: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 4FymYT1QQsz3lyt; Sun, 6 Jun 2021 19:20:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 19006E20; Sun, 6 Jun 2021 19:20:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 156JKTJn040467; Sun, 6 Jun 2021 19:20:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 156JKSgO040466; Sun, 6 Jun 2021 19:20:28 GMT (envelope-from git) Date: Sun, 6 Jun 2021 19:20:28 GMT Message-Id: <202106061920.156JKSgO040466@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 52faea7a3693 - stable/13 - Cirrus-CI: Add descriptive task name MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 52faea7a3693ddf13472ac6775340b4c1b2f5449 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jun 2021 19:20:29 -0000 The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=52faea7a3693ddf13472ac6775340b4c1b2f5449 commit 52faea7a3693ddf13472ac6775340b4c1b2f5449 Author: Ed Maste AuthorDate: 2021-06-02 15:31:48 +0000 Commit: Ed Maste CommitDate: 2021-06-06 19:19:26 +0000 Cirrus-CI: Add descriptive task name Previously it appeared only as "main" in places like GitHub's list of checks run as part of a pull request. MFC after: 1 week Sponsored by: The FreeBSD Foundation (cherry picked from commit 903526542ac2309c08c769e517ea173a9f67cdb2) --- .cirrus.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.cirrus.yml b/.cirrus.yml index 963355013df0..65dda70e7012 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -14,6 +14,7 @@ env: CIRRUS_CLONE_DEPTH: 1 task: + name: World and kernel amd64 build and boot smoke test timeout_in: 120m install_script: - pkg install -y qemu uefi-edk2-qemu-x86_64 llvm11 From owner-dev-commits-src-branches@freebsd.org Sun Jun 6 19:39:18 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D4AF963C461; Sun, 6 Jun 2021 19:39: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 4FymzB5PCCz3nnq; Sun, 6 Jun 2021 19:39:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A18311383; Sun, 6 Jun 2021 19:39:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 156JdIIM058537; Sun, 6 Jun 2021 19:39:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 156JdIuv058536; Sun, 6 Jun 2021 19:39:18 GMT (envelope-from git) Date: Sun, 6 Jun 2021 19:39:18 GMT Message-Id: <202106061939.156JdIuv058536@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 047905dc4299 - stable/13 - vinvalbuf: do not panic if we were unable to flush dirty buffers MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 047905dc42996fa353e149ea5afddefe877ac701 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jun 2021 19:39:18 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=047905dc42996fa353e149ea5afddefe877ac701 commit 047905dc42996fa353e149ea5afddefe877ac701 Author: Konstantin Belousov AuthorDate: 2021-05-30 16:52:42 +0000 Commit: Konstantin Belousov CommitDate: 2021-06-06 19:27:32 +0000 vinvalbuf: do not panic if we were unable to flush dirty buffers PR: 238565 (cherry picked from commit 27006229f7a40a18a61a0e8fd270bc583326b690) --- sys/kern/vfs_subr.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 5de58f979e97..3e6d11624197 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -1998,13 +1998,11 @@ bufobj_invalbuf(struct bufobj *bo, int flags, int slpflag, int slptimeo) } while (error == ERELOOKUP); if (error != 0) return (error); - /* - * XXX We could save a lock/unlock if this was only - * enabled under INVARIANTS - */ BO_LOCK(bo); - if (bo->bo_numoutput > 0 || bo->bo_dirty.bv_cnt > 0) - panic("vinvalbuf: dirty bufs"); + if (bo->bo_numoutput > 0 || bo->bo_dirty.bv_cnt > 0) { + BO_UNLOCK(bo); + return (EBUSY); + } } } /* From owner-dev-commits-src-branches@freebsd.org Sun Jun 6 21:54:37 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7765C63F8E1; Sun, 6 Jun 2021 21:54:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FyqzK2xGdz4cry; Sun, 6 Jun 2021 21:54:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4CBE83276; Sun, 6 Jun 2021 21:54:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 156LsbdH045428; Sun, 6 Jun 2021 21:54:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 156Lsaj4045427; Sun, 6 Jun 2021 21:54:36 GMT (envelope-from git) Date: Sun, 6 Jun 2021 21:54:36 GMT Message-Id: <202106062154.156Lsaj4045427@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: c334ddd922ae - stable/13 - Import sqlite 3.34.1 (3340100). MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c334ddd922ae0a611112a03066cb1234bb74a43d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jun 2021 21:54:37 -0000 The branch stable/13 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=c334ddd922ae0a611112a03066cb1234bb74a43d commit c334ddd922ae0a611112a03066cb1234bb74a43d Author: Cy Schubert AuthorDate: 2021-01-25 17:45:04 +0000 Commit: Cy Schubert CommitDate: 2021-06-06 21:53:03 +0000 Import sqlite 3.34.1 (3340100). (cherry picked from commit 25cdacf79b06356c929e59d5074d26c9dac41bdf) --- contrib/sqlite3/configure | 20 +- contrib/sqlite3/configure.ac | 2 +- contrib/sqlite3/ltmain.sh | 0 contrib/sqlite3/shell.c | 700 ++++++++- contrib/sqlite3/sqlite3.c | 2683 +++++++++++++++++++++++++---------- contrib/sqlite3/sqlite3.h | 81 +- contrib/sqlite3/sqlite3ext.h | 4 + contrib/sqlite3/sqlite3rc.h | 2 +- contrib/sqlite3/tea/configure | 18 +- contrib/sqlite3/tea/configure.ac | 2 +- contrib/sqlite3/tea/win/makefile.vc | 2 +- 11 files changed, 2685 insertions(+), 829 deletions(-) diff --git a/contrib/sqlite3/configure b/contrib/sqlite3/configure index 9aed16a74091..0eedad3467dd 100755 --- a/contrib/sqlite3/configure +++ b/contrib/sqlite3/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for sqlite 3.33.0. +# Generated by GNU Autoconf 2.69 for sqlite 3.34.1. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='sqlite' PACKAGE_TARNAME='sqlite' -PACKAGE_VERSION='3.33.0' -PACKAGE_STRING='sqlite 3.33.0' +PACKAGE_VERSION='3.34.1' +PACKAGE_STRING='sqlite 3.34.1' PACKAGE_BUGREPORT='http://www.sqlite.org' PACKAGE_URL='' @@ -1341,7 +1341,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures sqlite 3.33.0 to adapt to many kinds of systems. +\`configure' configures sqlite 3.34.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1412,7 +1412,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of sqlite 3.33.0:";; + short | recursive ) echo "Configuration of sqlite 3.34.1:";; esac cat <<\_ACEOF @@ -1537,7 +1537,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -sqlite configure 3.33.0 +sqlite configure 3.34.1 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1952,7 +1952,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by sqlite $as_me 3.33.0, which was +It was created by sqlite $as_me 3.34.1, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2818,7 +2818,7 @@ fi # Define the identity of the package. PACKAGE='sqlite' - VERSION='3.33.0' + VERSION='3.34.1' cat >>confdefs.h <<_ACEOF @@ -14438,7 +14438,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by sqlite $as_me 3.33.0, which was +This file was extended by sqlite $as_me 3.34.1, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -14495,7 +14495,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -sqlite config.status 3.33.0 +sqlite config.status 3.34.1 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/contrib/sqlite3/configure.ac b/contrib/sqlite3/configure.ac index a83dac3ac142..72472467d5b7 100644 --- a/contrib/sqlite3/configure.ac +++ b/contrib/sqlite3/configure.ac @@ -10,7 +10,7 @@ # AC_PREREQ(2.61) -AC_INIT(sqlite, 3.33.0, http://www.sqlite.org) +AC_INIT(sqlite, 3.34.1, http://www.sqlite.org) AC_CONFIG_SRCDIR([sqlite3.c]) AC_CONFIG_AUX_DIR([.]) diff --git a/contrib/sqlite3/ltmain.sh b/contrib/sqlite3/ltmain.sh old mode 100755 new mode 100644 diff --git a/contrib/sqlite3/shell.c b/contrib/sqlite3/shell.c index a1a77e49fa5f..6f4fee80dc1c 100644 --- a/contrib/sqlite3/shell.c +++ b/contrib/sqlite3/shell.c @@ -571,8 +571,6 @@ static void utf8_width_print(FILE *pOut, int w, const char *zUtf){ int i; int n; int aw = w<0 ? -w : w; - char zBuf[1000]; - if( aw>(int)sizeof(zBuf)/3 ) aw = (int)sizeof(zBuf)/3; for(i=n=0; zUtf[i]; i++){ if( (zUtf[i]&0xc0)!=0x80 ){ n++; @@ -2016,9 +2014,11 @@ static void sha3QueryFunc( } nCol = sqlite3_column_count(pStmt); z = sqlite3_sql(pStmt); - n = (int)strlen(z); - hash_step_vformat(&cx,"S%d:",n); - SHA3Update(&cx,(unsigned char*)z,n); + if( z ){ + n = (int)strlen(z); + hash_step_vformat(&cx,"S%d:",n); + SHA3Update(&cx,(unsigned char*)z,n); + } /* Compute a hash over the result of the query */ while( SQLITE_ROW==sqlite3_step(pStmt) ){ @@ -5315,6 +5315,444 @@ int sqlite3_ieee_init( } /************************* End ../ext/misc/ieee754.c ********************/ +/************************* Begin ../ext/misc/series.c ******************/ +/* +** 2015-08-18 +** +** The author disclaims copyright to this source code. In place of +** a legal notice, here is a blessing: +** +** May you do good and not evil. +** May you find forgiveness for yourself and forgive others. +** May you share freely, never taking more than you give. +** +************************************************************************* +** +** This file demonstrates how to create a table-valued-function using +** a virtual table. This demo implements the generate_series() function +** which gives similar results to the eponymous function in PostgreSQL. +** Examples: +** +** SELECT * FROM generate_series(0,100,5); +** +** The query above returns integers from 0 through 100 counting by steps +** of 5. +** +** SELECT * FROM generate_series(0,100); +** +** Integers from 0 through 100 with a step size of 1. +** +** SELECT * FROM generate_series(20) LIMIT 10; +** +** Integers 20 through 29. +** +** HOW IT WORKS +** +** The generate_series "function" is really a virtual table with the +** following schema: +** +** CREATE TABLE generate_series( +** value, +** start HIDDEN, +** stop HIDDEN, +** step HIDDEN +** ); +** +** Function arguments in queries against this virtual table are translated +** into equality constraints against successive hidden columns. In other +** words, the following pairs of queries are equivalent to each other: +** +** SELECT * FROM generate_series(0,100,5); +** SELECT * FROM generate_series WHERE start=0 AND stop=100 AND step=5; +** +** SELECT * FROM generate_series(0,100); +** SELECT * FROM generate_series WHERE start=0 AND stop=100; +** +** SELECT * FROM generate_series(20) LIMIT 10; +** SELECT * FROM generate_series WHERE start=20 LIMIT 10; +** +** The generate_series virtual table implementation leaves the xCreate method +** set to NULL. This means that it is not possible to do a CREATE VIRTUAL +** TABLE command with "generate_series" as the USING argument. Instead, there +** is a single generate_series virtual table that is always available without +** having to be created first. +** +** The xBestIndex method looks for equality constraints against the hidden +** start, stop, and step columns, and if present, it uses those constraints +** to bound the sequence of generated values. If the equality constraints +** are missing, it uses 0 for start, 4294967295 for stop, and 1 for step. +** xBestIndex returns a small cost when both start and stop are available, +** and a very large cost if either start or stop are unavailable. This +** encourages the query planner to order joins such that the bounds of the +** series are well-defined. +*/ +/* #include "sqlite3ext.h" */ +SQLITE_EXTENSION_INIT1 +#include +#include + +#ifndef SQLITE_OMIT_VIRTUALTABLE + + +/* series_cursor is a subclass of sqlite3_vtab_cursor which will +** serve as the underlying representation of a cursor that scans +** over rows of the result +*/ +typedef struct series_cursor series_cursor; +struct series_cursor { + sqlite3_vtab_cursor base; /* Base class - must be first */ + int isDesc; /* True to count down rather than up */ + sqlite3_int64 iRowid; /* The rowid */ + sqlite3_int64 iValue; /* Current value ("value") */ + sqlite3_int64 mnValue; /* Mimimum value ("start") */ + sqlite3_int64 mxValue; /* Maximum value ("stop") */ + sqlite3_int64 iStep; /* Increment ("step") */ +}; + +/* +** The seriesConnect() method is invoked to create a new +** series_vtab that describes the generate_series virtual table. +** +** Think of this routine as the constructor for series_vtab objects. +** +** All this routine needs to do is: +** +** (1) Allocate the series_vtab object and initialize all fields. +** +** (2) Tell SQLite (via the sqlite3_declare_vtab() interface) what the +** result set of queries against generate_series will look like. +*/ +static int seriesConnect( + sqlite3 *db, + void *pUnused, + int argcUnused, const char *const*argvUnused, + sqlite3_vtab **ppVtab, + char **pzErrUnused +){ + sqlite3_vtab *pNew; + int rc; + +/* Column numbers */ +#define SERIES_COLUMN_VALUE 0 +#define SERIES_COLUMN_START 1 +#define SERIES_COLUMN_STOP 2 +#define SERIES_COLUMN_STEP 3 + + (void)pUnused; + (void)argcUnused; + (void)argvUnused; + (void)pzErrUnused; + rc = sqlite3_declare_vtab(db, + "CREATE TABLE x(value,start hidden,stop hidden,step hidden)"); + if( rc==SQLITE_OK ){ + pNew = *ppVtab = sqlite3_malloc( sizeof(*pNew) ); + if( pNew==0 ) return SQLITE_NOMEM; + memset(pNew, 0, sizeof(*pNew)); + sqlite3_vtab_config(db, SQLITE_VTAB_INNOCUOUS); + } + return rc; +} + +/* +** This method is the destructor for series_cursor objects. +*/ +static int seriesDisconnect(sqlite3_vtab *pVtab){ + sqlite3_free(pVtab); + return SQLITE_OK; +} + +/* +** Constructor for a new series_cursor object. +*/ +static int seriesOpen(sqlite3_vtab *pUnused, sqlite3_vtab_cursor **ppCursor){ + series_cursor *pCur; + (void)pUnused; + pCur = sqlite3_malloc( sizeof(*pCur) ); + if( pCur==0 ) return SQLITE_NOMEM; + memset(pCur, 0, sizeof(*pCur)); + *ppCursor = &pCur->base; + return SQLITE_OK; +} + +/* +** Destructor for a series_cursor. +*/ +static int seriesClose(sqlite3_vtab_cursor *cur){ + sqlite3_free(cur); + return SQLITE_OK; +} + + +/* +** Advance a series_cursor to its next row of output. +*/ +static int seriesNext(sqlite3_vtab_cursor *cur){ + series_cursor *pCur = (series_cursor*)cur; + if( pCur->isDesc ){ + pCur->iValue -= pCur->iStep; + }else{ + pCur->iValue += pCur->iStep; + } + pCur->iRowid++; + return SQLITE_OK; +} + +/* +** Return values of columns for the row at which the series_cursor +** is currently pointing. +*/ +static int seriesColumn( + sqlite3_vtab_cursor *cur, /* The cursor */ + sqlite3_context *ctx, /* First argument to sqlite3_result_...() */ + int i /* Which column to return */ +){ + series_cursor *pCur = (series_cursor*)cur; + sqlite3_int64 x = 0; + switch( i ){ + case SERIES_COLUMN_START: x = pCur->mnValue; break; + case SERIES_COLUMN_STOP: x = pCur->mxValue; break; + case SERIES_COLUMN_STEP: x = pCur->iStep; break; + default: x = pCur->iValue; break; + } + sqlite3_result_int64(ctx, x); + return SQLITE_OK; +} + +/* +** Return the rowid for the current row. In this implementation, the +** first row returned is assigned rowid value 1, and each subsequent +** row a value 1 more than that of the previous. +*/ +static int seriesRowid(sqlite3_vtab_cursor *cur, sqlite_int64 *pRowid){ + series_cursor *pCur = (series_cursor*)cur; + *pRowid = pCur->iRowid; + return SQLITE_OK; +} + +/* +** Return TRUE if the cursor has been moved off of the last +** row of output. +*/ +static int seriesEof(sqlite3_vtab_cursor *cur){ + series_cursor *pCur = (series_cursor*)cur; + if( pCur->isDesc ){ + return pCur->iValue < pCur->mnValue; + }else{ + return pCur->iValue > pCur->mxValue; + } +} + +/* True to cause run-time checking of the start=, stop=, and/or step= +** parameters. The only reason to do this is for testing the +** constraint checking logic for virtual tables in the SQLite core. +*/ +#ifndef SQLITE_SERIES_CONSTRAINT_VERIFY +# define SQLITE_SERIES_CONSTRAINT_VERIFY 0 +#endif + +/* +** This method is called to "rewind" the series_cursor object back +** to the first row of output. This method is always called at least +** once prior to any call to seriesColumn() or seriesRowid() or +** seriesEof(). +** +** The query plan selected by seriesBestIndex is passed in the idxNum +** parameter. (idxStr is not used in this implementation.) idxNum +** is a bitmask showing which constraints are available: +** +** 1: start=VALUE +** 2: stop=VALUE +** 4: step=VALUE +** +** Also, if bit 8 is set, that means that the series should be output +** in descending order rather than in ascending order. +** +** This routine should initialize the cursor and position it so that it +** is pointing at the first row, or pointing off the end of the table +** (so that seriesEof() will return true) if the table is empty. +*/ +static int seriesFilter( + sqlite3_vtab_cursor *pVtabCursor, + int idxNum, const char *idxStrUnused, + int argc, sqlite3_value **argv +){ + series_cursor *pCur = (series_cursor *)pVtabCursor; + int i = 0; + (void)idxStrUnused; + if( idxNum & 1 ){ + pCur->mnValue = sqlite3_value_int64(argv[i++]); + }else{ + pCur->mnValue = 0; + } + if( idxNum & 2 ){ + pCur->mxValue = sqlite3_value_int64(argv[i++]); + }else{ + pCur->mxValue = 0xffffffff; + } + if( idxNum & 4 ){ + pCur->iStep = sqlite3_value_int64(argv[i++]); + if( pCur->iStep<1 ) pCur->iStep = 1; + }else{ + pCur->iStep = 1; + } + for(i=0; imnValue = 1; + pCur->mxValue = 0; + break; + } + } + if( idxNum & 8 ){ + pCur->isDesc = 1; + pCur->iValue = pCur->mxValue; + if( pCur->iStep>0 ){ + pCur->iValue -= (pCur->mxValue - pCur->mnValue)%pCur->iStep; + } + }else{ + pCur->isDesc = 0; + pCur->iValue = pCur->mnValue; + } + pCur->iRowid = 1; + return SQLITE_OK; +} + +/* +** SQLite will invoke this method one or more times while planning a query +** that uses the generate_series virtual table. This routine needs to create +** a query plan for each invocation and compute an estimated cost for that +** plan. +** +** In this implementation idxNum is used to represent the +** query plan. idxStr is unused. +** +** The query plan is represented by bits in idxNum: +** +** (1) start = $value -- constraint exists +** (2) stop = $value -- constraint exists +** (4) step = $value -- constraint exists +** (8) output in descending order +*/ +static int seriesBestIndex( + sqlite3_vtab *tabUnused, + sqlite3_index_info *pIdxInfo +){ + int i, j; /* Loop over constraints */ + int idxNum = 0; /* The query plan bitmask */ + int unusableMask = 0; /* Mask of unusable constraints */ + int nArg = 0; /* Number of arguments that seriesFilter() expects */ + int aIdx[3]; /* Constraints on start, stop, and step */ + const struct sqlite3_index_constraint *pConstraint; + + /* This implementation assumes that the start, stop, and step columns + ** are the last three columns in the virtual table. */ + assert( SERIES_COLUMN_STOP == SERIES_COLUMN_START+1 ); + assert( SERIES_COLUMN_STEP == SERIES_COLUMN_START+2 ); + (void)tabUnused; + aIdx[0] = aIdx[1] = aIdx[2] = -1; + pConstraint = pIdxInfo->aConstraint; + for(i=0; inConstraint; i++, pConstraint++){ + int iCol; /* 0 for start, 1 for stop, 2 for step */ + int iMask; /* bitmask for those column */ + if( pConstraint->iColumniColumn - SERIES_COLUMN_START; + assert( iCol>=0 && iCol<=2 ); + iMask = 1 << iCol; + if( pConstraint->usable==0 ){ + unusableMask |= iMask; + continue; + }else if( pConstraint->op==SQLITE_INDEX_CONSTRAINT_EQ ){ + idxNum |= iMask; + aIdx[iCol] = i; + } + } + for(i=0; i<3; i++){ + if( (j = aIdx[i])>=0 ){ + pIdxInfo->aConstraintUsage[j].argvIndex = ++nArg; + pIdxInfo->aConstraintUsage[j].omit = !SQLITE_SERIES_CONSTRAINT_VERIFY; + } + } + if( (unusableMask & ~idxNum)!=0 ){ + /* The start, stop, and step columns are inputs. Therefore if there + ** are unusable constraints on any of start, stop, or step then + ** this plan is unusable */ + return SQLITE_CONSTRAINT; + } + if( (idxNum & 3)==3 ){ + /* Both start= and stop= boundaries are available. This is the + ** the preferred case */ + pIdxInfo->estimatedCost = (double)(2 - ((idxNum&4)!=0)); + pIdxInfo->estimatedRows = 1000; + if( pIdxInfo->nOrderBy==1 ){ + if( pIdxInfo->aOrderBy[0].desc ) idxNum |= 8; + pIdxInfo->orderByConsumed = 1; + } + }else{ + /* If either boundary is missing, we have to generate a huge span + ** of numbers. Make this case very expensive so that the query + ** planner will work hard to avoid it. */ + pIdxInfo->estimatedRows = 2147483647; + } + pIdxInfo->idxNum = idxNum; + return SQLITE_OK; +} + +/* +** This following structure defines all the methods for the +** generate_series virtual table. +*/ +static sqlite3_module seriesModule = { + 0, /* iVersion */ + 0, /* xCreate */ + seriesConnect, /* xConnect */ + seriesBestIndex, /* xBestIndex */ + seriesDisconnect, /* xDisconnect */ + 0, /* xDestroy */ + seriesOpen, /* xOpen - open a cursor */ + seriesClose, /* xClose - close a cursor */ + seriesFilter, /* xFilter - configure scan constraints */ + seriesNext, /* xNext - advance a cursor */ + seriesEof, /* xEof - check for end of scan */ + seriesColumn, /* xColumn - read data */ + seriesRowid, /* xRowid - read data */ + 0, /* xUpdate */ + 0, /* xBegin */ + 0, /* xSync */ + 0, /* xCommit */ + 0, /* xRollback */ + 0, /* xFindMethod */ + 0, /* xRename */ + 0, /* xSavepoint */ + 0, /* xRelease */ + 0, /* xRollbackTo */ + 0 /* xShadowName */ +}; + +#endif /* SQLITE_OMIT_VIRTUALTABLE */ + +#ifdef _WIN32 + +#endif +int sqlite3_series_init( + sqlite3 *db, + char **pzErrMsg, + const sqlite3_api_routines *pApi +){ + int rc = SQLITE_OK; + SQLITE_EXTENSION_INIT2(pApi); +#ifndef SQLITE_OMIT_VIRTUALTABLE + if( sqlite3_libversion_number()<3008012 ){ + *pzErrMsg = sqlite3_mprintf( + "generate_series() requires SQLite 3.8.12 or later"); + return SQLITE_ERROR; + } + rc = sqlite3_create_module(db, "generate_series", &seriesModule, 0); +#endif + return rc; +} + +/************************* End ../ext/misc/series.c ********************/ #ifdef SQLITE_HAVE_ZLIB /************************* Begin ../ext/misc/zipfile.c ******************/ /* @@ -5842,14 +6280,16 @@ static int zipfileAppendData( const u8 *aWrite, int nWrite ){ - size_t n; - fseek(pTab->pWriteFd, (long)pTab->szCurrent, SEEK_SET); - n = fwrite(aWrite, 1, nWrite, pTab->pWriteFd); - if( (int)n!=nWrite ){ - pTab->base.zErrMsg = sqlite3_mprintf("error in fwrite()"); - return SQLITE_ERROR; + if( nWrite>0 ){ + size_t n = nWrite; + fseek(pTab->pWriteFd, (long)pTab->szCurrent, SEEK_SET); + n = fwrite(aWrite, 1, nWrite, pTab->pWriteFd); + if( (int)n!=nWrite ){ + pTab->base.zErrMsg = sqlite3_mprintf("error in fwrite()"); + return SQLITE_ERROR; + } + pTab->szCurrent += nWrite; } - pTab->szCurrent += nWrite; return SQLITE_OK; } @@ -8494,6 +8934,7 @@ static int idxGetTableInfo( IdxTable *pNew = 0; int rc, rc2; char *pCsr = 0; + int nPk = 0; rc = idxPrintfPrepareStmt(db, &p1, pzErrmsg, "PRAGMA table_info=%Q", zTab); while( rc==SQLITE_OK && SQLITE_ROW==sqlite3_step(p1) ){ @@ -8504,6 +8945,7 @@ static int idxGetTableInfo( ); nByte += 1 + STRLEN(zCol); nCol++; + nPk += (sqlite3_column_int(p1, 5)>0); } rc2 = sqlite3_reset(p1); if( rc==SQLITE_OK ) rc = rc2; @@ -8523,7 +8965,7 @@ static int idxGetTableInfo( const char *zCol = (const char*)sqlite3_column_text(p1, 1); int nCopy = STRLEN(zCol) + 1; pNew->aCol[nCol].zName = pCsr; - pNew->aCol[nCol].iPk = sqlite3_column_int(p1, 5); + pNew->aCol[nCol].iPk = (sqlite3_column_int(p1, 5)==1 && nPk==1); memcpy(pCsr, zCol, nCopy); pCsr += nCopy; @@ -9528,10 +9970,12 @@ static int idxPopulateStat1(sqlite3expert *p, char **pzErr){ idxFinalize(&rc, pIndexXInfo); idxFinalize(&rc, pWrite); - for(i=0; inSlot; i++){ - sqlite3_free(pCtx->aSlot[i].z); + if( pCtx ){ + for(i=0; inSlot; i++){ + sqlite3_free(pCtx->aSlot[i].z); + } + sqlite3_free(pCtx); } - sqlite3_free(pCtx); if( rc==SQLITE_OK ){ rc = sqlite3_exec(p->dbm, "ANALYZE sqlite_schema", 0, 0, 0); @@ -10771,6 +11215,8 @@ struct ShellState { #define SHFLG_CountChanges 0x00000020 /* .changes setting */ #define SHFLG_Echo 0x00000040 /* .echo or --echo setting */ #define SHFLG_HeaderSet 0x00000080 /* .header has been used */ +#define SHFLG_DumpDataOnly 0x00000100 /* .dump show data only */ +#define SHFLG_DumpNoSys 0x00000200 /* .dump omits system tables */ /* ** Macros for testing and setting shellFlgs @@ -13291,19 +13737,25 @@ static int dump_callback(void *pArg, int nArg, char **azArg, char **azNotUsed){ const char *zType; const char *zSql; ShellState *p = (ShellState *)pArg; + int dataOnly; + int noSys; UNUSED_PARAMETER(azNotUsed); if( nArg!=3 || azArg==0 ) return 0; zTable = azArg[0]; zType = azArg[1]; zSql = azArg[2]; + dataOnly = (p->shellFlgs & SHFLG_DumpDataOnly)!=0; + noSys = (p->shellFlgs & SHFLG_DumpNoSys)!=0; - if( strcmp(zTable, "sqlite_sequence")==0 ){ - raw_printf(p->out, "DELETE FROM sqlite_sequence;\n"); - }else if( sqlite3_strglob("sqlite_stat?", zTable)==0 ){ - raw_printf(p->out, "ANALYZE sqlite_schema;\n"); + if( strcmp(zTable, "sqlite_sequence")==0 && !noSys ){ + if( !dataOnly ) raw_printf(p->out, "DELETE FROM sqlite_sequence;\n"); + }else if( sqlite3_strglob("sqlite_stat?", zTable)==0 && !noSys ){ + if( !dataOnly ) raw_printf(p->out, "ANALYZE sqlite_schema;\n"); }else if( strncmp(zTable, "sqlite_", 7)==0 ){ return 0; + }else if( dataOnly ){ + /* no-op */ }else if( strncmp(zSql, "CREATE VIRTUAL TABLE", 20)==0 ){ char *zIns; if( !p->writableSchema ){ @@ -13476,8 +13928,10 @@ static const char *(azHelp[]) = { ".dbinfo ?DB? Show status information about the database", ".dump ?TABLE? Render database content as SQL", " Options:", - " --preserve-rowids Include ROWID values in the output", + " --data-only Output only INSERT statements", " --newlines Allow unescaped newline characters in output", + " --nosys Omit system tables (ex: \"sqlite_stat1\")", + " --preserve-rowids Include ROWID values in the output", " TABLE is a LIKE pattern for the tables to dump", " Additional LIKE patterns can be given in subsequent arguments", ".echo on|off Turn command echo on or off", @@ -13602,8 +14056,9 @@ static const char *(azHelp[]) = { ".save FILE Write in-memory database into FILE", ".scanstats on|off Turn sqlite3_stmt_scanstatus() metrics on or off", ".schema ?PATTERN? Show the CREATE statements matching PATTERN", - " Options:", - " --indent Try to pretty-print the schema", + " Options:", + " --indent Try to pretty-print the schema", + " --nosys Omit objects whose names start with \"sqlite_\"", ".selftest ?OPTIONS? Run tests defined in the SELFTEST table", " Options:", " --init Create a new SELFTEST table", @@ -14012,6 +14467,20 @@ static void shellIdQuote( } } +/* +** Scalar function "usleep(X)" invokes sqlite3_sleep(X) and returns X. +*/ +static void shellUSleepFunc( + sqlite3_context *context, + int argcUnused, + sqlite3_value **argv +){ + int sleep = sqlite3_value_int(argv[0]); + (void)argcUnused; + sqlite3_sleep(sleep/1000); + sqlite3_result_int(context, sleep); +} + /* ** Scalar function "shell_escape_crnl" used by the .recover command. ** The argument passed to this function is the output of built-in @@ -14176,6 +14645,7 @@ static void open_db(ShellState *p, int openFlags){ sqlite3_uint_init(p->db, 0, 0); sqlite3_decimal_init(p->db, 0, 0); sqlite3_ieee_init(p->db, 0, 0); + sqlite3_series_init(p->db, 0, 0); #if !defined(SQLITE_OMIT_VIRTUALTABLE) && defined(SQLITE_ENABLE_DBPAGE_VTAB) sqlite3_dbdata_init(p->db, 0, 0); #endif @@ -14195,6 +14665,8 @@ static void open_db(ShellState *p, int openFlags){ shellInt32, 0, 0); sqlite3_create_function(p->db, "shell_idquote", 1, SQLITE_UTF8, 0, shellIdQuote, 0, 0); + sqlite3_create_function(p->db, "usleep",1,SQLITE_UTF8,0, + shellUSleepFunc, 0, 0); #ifndef SQLITE_NOHAVE_SYSTEM sqlite3_create_function(p->db, "edit", 1, SQLITE_UTF8, 0, editFunc, 0, 0); @@ -17169,21 +17641,41 @@ static int do_meta_command(char *zLine, ShellState *p){ }else if( c=='d' && n>1 && strncmp(azArg[0], "databases", n)==0 ){ - ShellState data; - char *zErrMsg = 0; + char **azName = 0; + int nName = 0; + sqlite3_stmt *pStmt; + int i; open_db(p, 0); - memcpy(&data, p, sizeof(data)); - data.showHeader = 0; - data.cMode = data.mode = MODE_List; - sqlite3_snprintf(sizeof(data.colSeparator),data.colSeparator,": "); - data.cnt = 0; - sqlite3_exec(p->db, "SELECT name, file FROM pragma_database_list", - callback, &data, &zErrMsg); - if( zErrMsg ){ - utf8_printf(stderr,"Error: %s\n", zErrMsg); - sqlite3_free(zErrMsg); + rc = sqlite3_prepare_v2(p->db, "PRAGMA database_list", -1, &pStmt, 0); + if( rc ){ + utf8_printf(stderr, "Error: %s\n", sqlite3_errmsg(p->db)); rc = 1; + }else{ + while( sqlite3_step(pStmt)==SQLITE_ROW ){ + const char *zSchema = (const char *)sqlite3_column_text(pStmt,1); + const char *zFile = (const char*)sqlite3_column_text(pStmt,2); + azName = sqlite3_realloc(azName, (nName+1)*2*sizeof(char*)); + if( azName==0 ){ shell_out_of_memory(); /* Does not return */ } + azName[nName*2] = strdup(zSchema); + azName[nName*2+1] = strdup(zFile); + nName++; + } } + sqlite3_finalize(pStmt); + for(i=0; idb, azName[i*2]); + int bRdonly = sqlite3_db_readonly(p->db, azName[i*2]); + const char *z = azName[i*2+1]; + utf8_printf(p->out, "%s: %s %s%s\n", + azName[i*2], + z && z[0] ? z : "\"\"", + bRdonly ? "r/o" : "r/w", + eTxn==SQLITE_TXN_NONE ? "" : + eTxn==SQLITE_TXN_READ ? " read-txn" : " write-txn"); + free(azName[i*2]); + free(azName[i*2+1]); + } + sqlite3_free(azName); }else if( c=='d' && n>=3 && strncmp(azArg[0], "dbconfig", n)==0 ){ @@ -17242,7 +17734,9 @@ static int do_meta_command(char *zLine, ShellState *p){ int i; int savedShowHeader = p->showHeader; int savedShellFlags = p->shellFlgs; - ShellClearFlag(p, SHFLG_PreserveRowid|SHFLG_Newlines|SHFLG_Echo); + ShellClearFlag(p, + SHFLG_PreserveRowid|SHFLG_Newlines|SHFLG_Echo + |SHFLG_DumpDataOnly|SHFLG_DumpNoSys); for(i=1; iout, "PRAGMA foreign_keys=OFF;\n"); - raw_printf(p->out, "BEGIN TRANSACTION;\n"); + if( (p->shellFlgs & SHFLG_DumpDataOnly)==0 ){ + /* When playing back a "dump", the content might appear in an order + ** which causes immediate foreign key constraints to be violated. + ** So disable foreign-key constraint enforcement to prevent problems. */ + raw_printf(p->out, "PRAGMA foreign_keys=OFF;\n"); + raw_printf(p->out, "BEGIN TRANSACTION;\n"); + } p->writableSchema = 0; p->showHeader = 0; /* Set writable_schema=ON since doing so forces SQLite to initialize @@ -17299,14 +17801,16 @@ static int do_meta_command(char *zLine, ShellState *p){ ); run_schema_dump_query(p,zSql); sqlite3_free(zSql); - zSql = sqlite3_mprintf( - "SELECT sql FROM sqlite_schema " - "WHERE (%s) AND sql NOT NULL" - " AND type IN ('index','trigger','view')", - zLike - ); - run_table_dump_query(p, zSql); - sqlite3_free(zSql); + if( (p->shellFlgs & SHFLG_DumpDataOnly)==0 ){ + zSql = sqlite3_mprintf( + "SELECT sql FROM sqlite_schema " + "WHERE (%s) AND sql NOT NULL" + " AND type IN ('index','trigger','view')", + zLike + ); + run_table_dump_query(p, zSql); + sqlite3_free(zSql); + } sqlite3_free(zLike); if( p->writableSchema ){ raw_printf(p->out, "PRAGMA writable_schema=OFF;\n"); @@ -17314,7 +17818,9 @@ static int do_meta_command(char *zLine, ShellState *p){ } sqlite3_exec(p->db, "PRAGMA writable_schema=OFF;", 0, 0, 0); sqlite3_exec(p->db, "RELEASE dump;", 0, 0, 0); - raw_printf(p->out, p->nErr?"ROLLBACK; -- due to errors\n":"COMMIT;\n"); + if( (p->shellFlgs & SHFLG_DumpDataOnly)==0 ){ + raw_printf(p->out, p->nErr?"ROLLBACK; -- due to errors\n":"COMMIT;\n"); + } p->showHeader = savedShowHeader; p->shellFlgs = savedShellFlags; }else @@ -17753,7 +18259,7 @@ static int do_meta_command(char *zLine, ShellState *p){ while( (nSkip--)>0 ){ while( xRead(&sCtx) && sCtx.cTerm==sCtx.cColSep ){} } - zSql = sqlite3_mprintf("SELECT * FROM %s", zTable); + zSql = sqlite3_mprintf("SELECT * FROM \"%w\"", zTable); if( zSql==0 ){ import_cleanup(&sCtx); shell_out_of_memory(); @@ -17762,7 +18268,7 @@ static int do_meta_command(char *zLine, ShellState *p){ rc = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0); import_append_char(&sCtx, 0); /* To ensure sCtx.z is allocated */ if( rc && sqlite3_strglob("no such table: *", sqlite3_errmsg(p->db))==0 ){ - char *zCreate = sqlite3_mprintf("CREATE TABLE %s", zTable); + char *zCreate = sqlite3_mprintf("CREATE TABLE \"%w\"", zTable); char cSep = '('; while( xRead(&sCtx) ){ zCreate = sqlite3_mprintf("%z%c\n \"%w\" TEXT", zCreate, cSep, sCtx.z); @@ -17783,7 +18289,7 @@ static int do_meta_command(char *zLine, ShellState *p){ rc = sqlite3_exec(p->db, zCreate, 0, 0, 0); sqlite3_free(zCreate); if( rc ){ - utf8_printf(stderr, "CREATE TABLE %s(...) failed: %s\n", zTable, + utf8_printf(stderr, "CREATE TABLE \"%s\"(...) failed: %s\n", zTable, sqlite3_errmsg(p->db)); import_cleanup(&sCtx); rc = 1; @@ -18548,9 +19054,16 @@ static int do_meta_command(char *zLine, ShellState *p){ rc = 1; goto meta_command_exit; } - if( notNormalFile(azArg[1]) - || (p->in = fopen(azArg[1], "rb"))==0 - ){ + if( azArg[1][0]=='|' ){ + p->in = popen(azArg[1]+1, "r"); + if( p->in==0 ){ + utf8_printf(stderr, "Error: cannot open \"%s\"\n", azArg[1]); + rc = 1; + }else{ + rc = process_input(p); + pclose(p->in); + } + }else if( notNormalFile(azArg[1]) || (p->in = fopen(azArg[1], "rb"))==0 ){ utf8_printf(stderr,"Error: cannot open \"%s\"\n", azArg[1]); rc = 1; }else{ @@ -18632,6 +19145,7 @@ static int do_meta_command(char *zLine, ShellState *p){ const char *zName = 0; int iSchema = 0; int bDebug = 0; + int bNoSystemTabs = 0; int ii; open_db(p, 0); @@ -18644,10 +19158,16 @@ static int do_meta_command(char *zLine, ShellState *p){ data.cMode = data.mode = MODE_Pretty; }else if( optionMatch(azArg[ii],"debug") ){ bDebug = 1; + }else if( optionMatch(azArg[ii],"nosys") ){ + bNoSystemTabs = 1; + }else if( azArg[ii][0]=='-' ){ + utf8_printf(stderr, "Unknown option: \"%s\"\n", azArg[ii]); + rc = 1; + goto meta_command_exit; }else if( zName==0 ){ zName = azArg[ii]; }else{ - raw_printf(stderr, "Usage: .schema ?--indent? ?LIKE-PATTERN?\n"); + raw_printf(stderr, "Usage: .schema ?--indent? ?--nosys? ?LIKE-PATTERN?\n"); rc = 1; goto meta_command_exit; } @@ -18733,7 +19253,10 @@ static int do_meta_command(char *zLine, ShellState *p){ appendText(&sSelect, " AND ", 0); sqlite3_free(zQarg); } - appendText(&sSelect, "type!='meta' AND sql IS NOT NULL" + if( bNoSystemTabs ){ + appendText(&sSelect, "name NOT LIKE 'sqlite_%%' AND ", 0); + } + appendText(&sSelect, "sql IS NOT NULL" " ORDER BY snum, rowid", 0); if( bDebug ){ utf8_printf(p->out, "SQL: %s;\n", sSelect.z); @@ -19430,6 +19953,7 @@ static int do_meta_command(char *zLine, ShellState *p){ *** 5486 LINES SKIPPED *** From owner-dev-commits-src-branches@freebsd.org Sun Jun 6 21:54:39 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1F29563F656; Sun, 6 Jun 2021 21:54: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 4FyqzM0BtWz4d2j; Sun, 6 Jun 2021 21:54:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E239B313C; Sun, 6 Jun 2021 21:54:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 156LsciT045451; Sun, 6 Jun 2021 21:54:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 156Lsc4d045448; Sun, 6 Jun 2021 21:54:38 GMT (envelope-from git) Date: Sun, 6 Jun 2021 21:54:38 GMT Message-Id: <202106062154.156Lsc4d045448@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 7a9c6cbae913 - stable/13 - sqlite3: import sqlite3 3.35.5 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7a9c6cbae91307b152f45a3d38c9a3f895c53f66 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jun 2021 21:54:39 -0000 The branch stable/13 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=7a9c6cbae91307b152f45a3d38c9a3f895c53f66 commit 7a9c6cbae91307b152f45a3d38c9a3f895c53f66 Author: Cy Schubert AuthorDate: 2021-05-07 01:01:44 +0000 Commit: Cy Schubert CommitDate: 2021-06-06 21:53:04 +0000 sqlite3: import sqlite3 3.35.5 Merge commit '0511e356f5e2106928ee352ee974d1470c860a9a' into new_merge Changes at https://www.sqlite.org/releaselog/3_35_5.html. (cherry picked from commit ce9de47260d4edc963a94140789e4a52642c28e6) --- contrib/sqlite3/Makefile.msc | 3 + contrib/sqlite3/configure | 153 +- contrib/sqlite3/configure.ac | 50 +- contrib/sqlite3/shell.c | 501 +- contrib/sqlite3/sqlite3.c | 11777 ++++++++++++++++++++++--------------- contrib/sqlite3/sqlite3.h | 59 +- contrib/sqlite3/sqlite3rc.h | 2 +- contrib/sqlite3/tea/configure | 18 +- contrib/sqlite3/tea/configure.ac | 2 +- 9 files changed, 7708 insertions(+), 4857 deletions(-) diff --git a/contrib/sqlite3/Makefile.msc b/contrib/sqlite3/Makefile.msc index 746162a00c04..1f177557a25a 100644 --- a/contrib/sqlite3/Makefile.msc +++ b/contrib/sqlite3/Makefile.msc @@ -303,6 +303,9 @@ OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_SESSION=1 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_PREUPDATE_HOOK=1 !ENDIF +# Always enable math functions on Windows +OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_MATH_FUNCTIONS + # Should the rbu extension be enabled? If so, add compilation options # to enable it. # diff --git a/contrib/sqlite3/configure b/contrib/sqlite3/configure index 0eedad3467dd..4a16edbb6e02 100755 --- a/contrib/sqlite3/configure +++ b/contrib/sqlite3/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for sqlite 3.34.1. +# Generated by GNU Autoconf 2.69 for sqlite 3.35.5. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='sqlite' PACKAGE_TARNAME='sqlite' -PACKAGE_VERSION='3.34.1' -PACKAGE_STRING='sqlite 3.34.1' +PACKAGE_VERSION='3.35.5' +PACKAGE_STRING='sqlite 3.35.5' PACKAGE_BUGREPORT='http://www.sqlite.org' PACKAGE_URL='' @@ -772,6 +772,7 @@ enable_editline enable_readline enable_threadsafe enable_dynamic_extensions +enable_math enable_fts4 enable_fts3 enable_fts5 @@ -1341,7 +1342,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures sqlite 3.34.1 to adapt to many kinds of systems. +\`configure' configures sqlite 3.35.5 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1412,7 +1413,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of sqlite 3.34.1:";; + short | recursive ) echo "Configuration of sqlite 3.35.5:";; esac cat <<\_ACEOF @@ -1437,6 +1438,7 @@ Optional Features: --enable-threadsafe build a thread-safe library [default=yes] --enable-dynamic-extensions support loadable extensions [default=yes] + --enable-math SQL math functions [default=yes] --enable-fts4 include fts4 support [default=yes] --enable-fts3 include fts3 support [default=no] --enable-fts5 include fts5 support [default=yes] @@ -1537,7 +1539,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -sqlite configure 3.34.1 +sqlite configure 3.35.5 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1952,7 +1954,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by sqlite $as_me 3.34.1, which was +It was created by sqlite $as_me 3.35.5, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2818,7 +2820,7 @@ fi # Define the identity of the package. PACKAGE='sqlite' - VERSION='3.34.1' + VERSION='3.35.5' cat >>confdefs.h <<_ACEOF @@ -13335,7 +13337,9 @@ else enable_threadsafe=yes fi -if test x"$enable_threadsafe" != "xno"; then +if test x"$enable_threadsafe" == "xno"; then + BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_THREADSAFE=0" +else BUILD_CFLAGS="$BUILD_CFLAGS -D_REENTRANT=1 -DSQLITE_THREADSAFE=1" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing pthread_create" >&5 $as_echo_n "checking for library containing pthread_create... " >&6; } @@ -13528,6 +13532,84 @@ $as_echo_n "checking for whether to support dynamic extensions... " >&6; } $as_echo "$enable_dynamic_extensions" >&6; } #----------------------------------------------------------------------- +#----------------------------------------------------------------------- +# --enable-math +# +# Check whether --enable-math was given. +if test "${enable_math+set}" = set; then : + enableval=$enable_math; +else + enable_math=yes +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking SQL math functions" >&5 +$as_echo_n "checking SQL math functions... " >&6; } +if test x"$enable_math" = "xyes"; then + BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_MATH_FUNCTIONS" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: enabled" >&5 +$as_echo "enabled" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing ceil" >&5 +$as_echo_n "checking for library containing ceil... " >&6; } +if ${ac_cv_search_ceil+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char ceil (); +int +main () +{ +return ceil (); + ; + return 0; +} +_ACEOF +for ac_lib in '' m; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_ceil=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_ceil+:} false; then : + break +fi +done +if ${ac_cv_search_ceil+:} false; then : + +else + ac_cv_search_ceil=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_ceil" >&5 +$as_echo "$ac_cv_search_ceil" >&6; } +ac_res=$ac_cv_search_ceil +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 +$as_echo "disabled" >&6; } +fi +#----------------------------------------------------------------------- + #----------------------------------------------------------------------- # --enable-fts4 # @@ -13538,8 +13620,15 @@ else enable_fts4=yes fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking FTS4 extension" >&5 +$as_echo_n "checking FTS4 extension... " >&6; } if test x"$enable_fts4" = "xyes"; then BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_FTS4" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: enabled" >&5 +$as_echo "enabled" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 +$as_echo "disabled" >&6; } fi #----------------------------------------------------------------------- @@ -13551,8 +13640,15 @@ if test "${enable_fts3+set}" = set; then : enableval=$enable_fts3; fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking FTS3 extension" >&5 +$as_echo_n "checking FTS3 extension... " >&6; } if test x"$enable_fts3" = "xyes" -a x"$enable_fts4" = "xno"; then BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_FTS3" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: enabled" >&5 +$as_echo "enabled" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 +$as_echo "disabled" >&6; } fi #----------------------------------------------------------------------- @@ -13566,7 +13662,11 @@ else enable_fts5=yes fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking FTS5 extension" >&5 +$as_echo_n "checking FTS5 extension... " >&6; } if test x"$enable_fts5" = "xyes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: enabled" >&5 +$as_echo "enabled" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing log" >&5 $as_echo_n "checking for library containing log... " >&6; } if ${ac_cv_search_log+:} false; then : @@ -13624,6 +13724,9 @@ if test "$ac_res" != no; then : fi BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_FTS5" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 +$as_echo "disabled" >&6; } fi #----------------------------------------------------------------------- @@ -13637,8 +13740,15 @@ else enable_json1=yes fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking JSON functions" >&5 +$as_echo_n "checking JSON functions... " >&6; } if test x"$enable_json1" = "xyes"; then BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_JSON1" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: enabled" >&5 +$as_echo "enabled" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 +$as_echo "disabled" >&6; } fi #----------------------------------------------------------------------- @@ -13652,8 +13762,15 @@ else enable_rtree=yes fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking RTREE extension" >&5 +$as_echo_n "checking RTREE extension... " >&6; } if test x"$enable_rtree" = "xyes"; then BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_GEOPOLY" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: enabled" >&5 +$as_echo "enabled" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 +$as_echo "disabled" >&6; } fi #----------------------------------------------------------------------- @@ -13665,8 +13782,15 @@ if test "${enable_session+set}" = set; then : enableval=$enable_session; fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Session extension" >&5 +$as_echo_n "checking Session extension... " >&6; } if test x"$enable_session" = "xyes"; then BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_PREUPDATE_HOOK" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: enabled" >&5 +$as_echo "enabled" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 +$as_echo "disabled" >&6; } fi #----------------------------------------------------------------------- @@ -13678,9 +13802,16 @@ if test "${enable_debug+set}" = set; then : enableval=$enable_debug; fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Build type" >&5 +$as_echo_n "checking Build type... " >&6; } if test x"$enable_debug" = "xyes"; then BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_DEBUG -DSQLITE_ENABLE_SELECTTRACE -DSQLITE_ENABLE_WHERETRACE" CFLAGS="-g -O0" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: debug" >&5 +$as_echo "debug" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: release" >&5 +$as_echo "release" >&6; } fi #----------------------------------------------------------------------- @@ -14438,7 +14569,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by sqlite $as_me 3.34.1, which was +This file was extended by sqlite $as_me 3.35.5, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -14495,7 +14626,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -sqlite config.status 3.34.1 +sqlite config.status 3.35.5 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/contrib/sqlite3/configure.ac b/contrib/sqlite3/configure.ac index 72472467d5b7..166f7019cd5c 100644 --- a/contrib/sqlite3/configure.ac +++ b/contrib/sqlite3/configure.ac @@ -10,7 +10,7 @@ # AC_PREREQ(2.61) -AC_INIT(sqlite, 3.34.1, http://www.sqlite.org) +AC_INIT(sqlite, 3.35.5, http://www.sqlite.org) AC_CONFIG_SRCDIR([sqlite3.c]) AC_CONFIG_AUX_DIR([.]) @@ -87,7 +87,9 @@ AC_SUBST(READLINE_LIBS) AC_ARG_ENABLE(threadsafe, [AS_HELP_STRING( [--enable-threadsafe], [build a thread-safe library [default=yes]])], [], [enable_threadsafe=yes]) -if test x"$enable_threadsafe" != "xno"; then +if test x"$enable_threadsafe" == "xno"; then + BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_THREADSAFE=0" +else BUILD_CFLAGS="$BUILD_CFLAGS -D_REENTRANT=1 -DSQLITE_THREADSAFE=1" AC_SEARCH_LIBS(pthread_create, pthread) AC_SEARCH_LIBS(pthread_mutexattr_init, pthread) @@ -109,14 +111,34 @@ AC_MSG_CHECKING([for whether to support dynamic extensions]) AC_MSG_RESULT($enable_dynamic_extensions) #----------------------------------------------------------------------- +#----------------------------------------------------------------------- +# --enable-math +# +AC_ARG_ENABLE(math, [AS_HELP_STRING( + [--enable-math], [SQL math functions [default=yes]])], + [], [enable_math=yes]) +AC_MSG_CHECKING([SQL math functions]) +if test x"$enable_math" = "xyes"; then + BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_MATH_FUNCTIONS" + AC_MSG_RESULT([enabled]) + AC_SEARCH_LIBS(ceil, m) +else + AC_MSG_RESULT([disabled]) +fi +#----------------------------------------------------------------------- + #----------------------------------------------------------------------- # --enable-fts4 # AC_ARG_ENABLE(fts4, [AS_HELP_STRING( [--enable-fts4], [include fts4 support [default=yes]])], [], [enable_fts4=yes]) +AC_MSG_CHECKING([FTS4 extension]) if test x"$enable_fts4" = "xyes"; then BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_FTS4" + AC_MSG_RESULT([enabled]) +else + AC_MSG_RESULT([disabled]) fi #----------------------------------------------------------------------- @@ -126,8 +148,12 @@ fi AC_ARG_ENABLE(fts3, [AS_HELP_STRING( [--enable-fts3], [include fts3 support [default=no]])], [], []) +AC_MSG_CHECKING([FTS3 extension]) if test x"$enable_fts3" = "xyes" -a x"$enable_fts4" = "xno"; then BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_FTS3" + AC_MSG_RESULT([enabled]) +else + AC_MSG_RESULT([disabled]) fi #----------------------------------------------------------------------- @@ -137,9 +163,13 @@ fi AC_ARG_ENABLE(fts5, [AS_HELP_STRING( [--enable-fts5], [include fts5 support [default=yes]])], [], [enable_fts5=yes]) +AC_MSG_CHECKING([FTS5 extension]) if test x"$enable_fts5" = "xyes"; then + AC_MSG_RESULT([enabled]) AC_SEARCH_LIBS(log, m) BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_FTS5" +else + AC_MSG_RESULT([disabled]) fi #----------------------------------------------------------------------- @@ -149,8 +179,12 @@ fi AC_ARG_ENABLE(json1, [AS_HELP_STRING( [--enable-json1], [include json1 support [default=yes]])], [],[enable_json1=yes]) +AC_MSG_CHECKING([JSON functions]) if test x"$enable_json1" = "xyes"; then BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_JSON1" + AC_MSG_RESULT([enabled]) +else + AC_MSG_RESULT([disabled]) fi #----------------------------------------------------------------------- @@ -160,8 +194,12 @@ fi AC_ARG_ENABLE(rtree, [AS_HELP_STRING( [--enable-rtree], [include rtree support [default=yes]])], [], [enable_rtree=yes]) +AC_MSG_CHECKING([RTREE extension]) if test x"$enable_rtree" = "xyes"; then BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_GEOPOLY" + AC_MSG_RESULT([enabled]) +else + AC_MSG_RESULT([disabled]) fi #----------------------------------------------------------------------- @@ -171,8 +209,12 @@ fi AC_ARG_ENABLE(session, [AS_HELP_STRING( [--enable-session], [enable the session extension [default=no]])], [], []) +AC_MSG_CHECKING([Session extension]) if test x"$enable_session" = "xyes"; then BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_PREUPDATE_HOOK" + AC_MSG_RESULT([enabled]) +else + AC_MSG_RESULT([disabled]) fi #----------------------------------------------------------------------- @@ -182,9 +224,13 @@ fi AC_ARG_ENABLE(debug, [AS_HELP_STRING( [--enable-debug], [build with debugging features enabled [default=no]])], [], []) +AC_MSG_CHECKING([Build type]) if test x"$enable_debug" = "xyes"; then BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_DEBUG -DSQLITE_ENABLE_SELECTTRACE -DSQLITE_ENABLE_WHERETRACE" CFLAGS="-g -O0" + AC_MSG_RESULT([debug]) +else + AC_MSG_RESULT([release]) fi #----------------------------------------------------------------------- diff --git a/contrib/sqlite3/shell.c b/contrib/sqlite3/shell.c index 6f4fee80dc1c..27de22a3819b 100644 --- a/contrib/sqlite3/shell.c +++ b/contrib/sqlite3/shell.c @@ -1424,7 +1424,10 @@ SQLITE_EXTENSION_INIT1 #include #include #include + +#ifndef SQLITE_AMALGAMATION /* typedef sqlite3_uint64 u64; */ +#endif /* SQLITE_AMALGAMATION */ /****************************************************************************** ** The Hash Engine @@ -3637,24 +3640,23 @@ int sqlite3_completion_init( ** appended onto the end of some other file, such as an executable. ** ** A special record must appear at the end of the file that identifies the -** file as an appended database and provides an offset to page 1. For -** best performance page 1 should be located at a disk page boundary, though -** that is not required. +** file as an appended database and provides the offset to the first page +** of the exposed content. (Or, it is the length of the content prefix.) +** For best performance page 1 should be located at a disk page boundary, +** though that is not required. ** ** When opening a database using this VFS, the connection might treat -** the file as an ordinary SQLite database, or it might treat is as a -** database appended onto some other file. Here are the rules: +** the file as an ordinary SQLite database, or it might treat it as a +** database appended onto some other file. The decision is made by +** applying the following rules in order: ** -** (1) When opening a new empty file, that file is treated as an ordinary -** database. +** (1) An empty file is an ordinary database. ** -** (2) When opening a file that begins with the standard SQLite prefix -** string "SQLite format 3", that file is treated as an ordinary -** database. +** (2) If the file ends with the appendvfs trailer string +** "Start-Of-SQLite3-NNNNNNNN" that file is an appended database. ** -** (3) When opening a file that ends with the appendvfs trailer string -** "Start-Of-SQLite3-NNNNNNNN" that file is treated as an appended -** database. +** (3) If the file begins with the standard SQLite prefix string +** "SQLite format 3", that file is an ordinary database. ** ** (4) If none of the above apply and the SQLITE_OPEN_CREATE flag is ** set, then a new database is appended to the already existing file. @@ -3662,13 +3664,13 @@ int sqlite3_completion_init( ** (5) Otherwise, SQLITE_CANTOPEN is returned. ** ** To avoid unnecessary complications with the PENDING_BYTE, the size of -** the file containing the database is limited to 1GB. This VFS will refuse -** to read or write past the 1GB mark. This restriction might be lifted in -** future versions. For now, if you need a large database, then keep the -** database in a separate file. +** the file containing the database is limited to 1GiB. (1073741824 bytes) +** This VFS will not read or write past the 1GiB mark. This restriction +** might be lifted in future versions. For now, if you need a larger +** database, then keep it in a separate file. ** -** If the file being opened is not an appended database, then this shim is -** a pass-through into the default underlying VFS. +** If the file being opened is a plain database (not an appended one), then +** this shim is a pass-through into the default underlying VFS. (rule 3) **/ /* #include "sqlite3ext.h" */ SQLITE_EXTENSION_INIT1 @@ -3681,17 +3683,27 @@ SQLITE_EXTENSION_INIT1 ** 123456789 123456789 12345 ** ** The NNNNNNNN represents a 64-bit big-endian unsigned integer which is -** the offset to page 1. +** the offset to page 1, and also the length of the prefix content. */ #define APND_MARK_PREFIX "Start-Of-SQLite3-" #define APND_MARK_PREFIX_SZ 17 -#define APND_MARK_SIZE 25 +#define APND_MARK_FOS_SZ 8 +#define APND_MARK_SIZE (APND_MARK_PREFIX_SZ+APND_MARK_FOS_SZ) /* ** Maximum size of the combined prefix + database + append-mark. This ** must be less than 0x40000000 to avoid locking issues on Windows. */ -#define APND_MAX_SIZE (65536*15259) +#define APND_MAX_SIZE (0x40000000) + +/* +** Try to align the database to an even multiple of APND_ROUNDUP bytes. +*/ +#ifndef APND_ROUNDUP +#define APND_ROUNDUP 4096 +#endif +#define APND_ALIGN_MASK ((sqlite3_int64)(APND_ROUNDUP-1)) +#define APND_START_ROUNDUP(fsz) (((fsz)+APND_ALIGN_MASK) & ~APND_ALIGN_MASK) /* ** Forward declaration of objects used by this utility @@ -3705,11 +3717,45 @@ typedef struct ApndFile ApndFile; #define ORIGVFS(p) ((sqlite3_vfs*)((p)->pAppData)) #define ORIGFILE(p) ((sqlite3_file*)(((ApndFile*)(p))+1)) -/* An open file */ +/* An open appendvfs file +** +** An instance of this structure describes the appended database file. +** A separate sqlite3_file object is always appended. The appended +** sqlite3_file object (which can be accessed using ORIGFILE()) describes +** the entire file, including the prefix, the database, and the +** append-mark. +** +** The structure of an AppendVFS database is like this: +** +** +-------------+---------+----------+-------------+ +** | prefix-file | padding | database | append-mark | +** +-------------+---------+----------+-------------+ +** ^ ^ +** | | +** iPgOne iMark +** +** +** "prefix file" - file onto which the database has been appended. +** "padding" - zero or more bytes inserted so that "database" +** starts on an APND_ROUNDUP boundary +** "database" - The SQLite database file +** "append-mark" - The 25-byte "Start-Of-SQLite3-NNNNNNNN" that indicates +** the offset from the start of prefix-file to the start +** of "database". +** +** The size of the database is iMark - iPgOne. +** +** The NNNNNNNN in the "Start-Of-SQLite3-NNNNNNNN" suffix is the value +** of iPgOne stored as a big-ending 64-bit integer. +** +** iMark will be the size of the underlying file minus 25 (APND_MARKSIZE). +** Or, iMark is -1 to indicate that it has not yet been written. +*/ struct ApndFile { - sqlite3_file base; /* IO methods */ - sqlite3_int64 iPgOne; /* File offset to page 1 */ - sqlite3_int64 iMark; /* Start of the append-mark */ + sqlite3_file base; /* Subclass. MUST BE FIRST! */ + sqlite3_int64 iPgOne; /* Offset to the start of the database */ + sqlite3_int64 iMark; /* Offset of the append mark. -1 if unwritten */ + /* Always followed by another sqlite3_file that describes the whole file */ }; /* @@ -3801,8 +3847,6 @@ static const sqlite3_io_methods apnd_io_methods = { apndUnfetch /* xUnfetch */ }; - - /* ** Close an apnd-file. */ @@ -3820,22 +3864,37 @@ static int apndRead( int iAmt, sqlite_int64 iOfst ){ - ApndFile *p = (ApndFile *)pFile; + ApndFile *paf = (ApndFile *)pFile; pFile = ORIGFILE(pFile); - return pFile->pMethods->xRead(pFile, zBuf, iAmt, iOfst+p->iPgOne); + return pFile->pMethods->xRead(pFile, zBuf, iAmt, paf->iPgOne+iOfst); } /* -** Add the append-mark onto the end of the file. +** Add the append-mark onto what should become the end of the file. +* If and only if this succeeds, internal ApndFile.iMark is updated. +* Parameter iWriteEnd is the appendvfs-relative offset of the new mark. */ -static int apndWriteMark(ApndFile *p, sqlite3_file *pFile){ - int i; +static int apndWriteMark( + ApndFile *paf, + sqlite3_file *pFile, + sqlite_int64 iWriteEnd +){ + sqlite_int64 iPgOne = paf->iPgOne; unsigned char a[APND_MARK_SIZE]; + int i = APND_MARK_FOS_SZ; + int rc; + assert(pFile == ORIGFILE(paf)); memcpy(a, APND_MARK_PREFIX, APND_MARK_PREFIX_SZ); - for(i=0; i<8; i++){ - a[APND_MARK_PREFIX_SZ+i] = (p->iPgOne >> (56 - i*8)) & 0xff; + while( --i >= 0 ){ + a[APND_MARK_PREFIX_SZ+i] = (unsigned char)(iPgOne & 0xff); + iPgOne >>= 8; + } + iWriteEnd += paf->iPgOne; + if( SQLITE_OK==(rc = pFile->pMethods->xWrite + (pFile, a, APND_MARK_SIZE, iWriteEnd)) ){ + paf->iMark = iWriteEnd; } - return pFile->pMethods->xWrite(pFile, a, APND_MARK_SIZE, p->iMark); + return rc; } /* @@ -3847,38 +3906,28 @@ static int apndWrite( int iAmt, sqlite_int64 iOfst ){ - int rc; - ApndFile *p = (ApndFile *)pFile; + ApndFile *paf = (ApndFile *)pFile; + sqlite_int64 iWriteEnd = iOfst + iAmt; + if( iWriteEnd>=APND_MAX_SIZE ) return SQLITE_FULL; pFile = ORIGFILE(pFile); - if( iOfst+iAmt>=APND_MAX_SIZE ) return SQLITE_FULL; - rc = pFile->pMethods->xWrite(pFile, zBuf, iAmt, iOfst+p->iPgOne); - if( rc==SQLITE_OK && iOfst + iAmt + p->iPgOne > p->iMark ){ - sqlite3_int64 sz = 0; - rc = pFile->pMethods->xFileSize(pFile, &sz); - if( rc==SQLITE_OK ){ - p->iMark = sz - APND_MARK_SIZE; - if( iOfst + iAmt + p->iPgOne > p->iMark ){ - p->iMark = p->iPgOne + iOfst + iAmt; - rc = apndWriteMark(p, pFile); - } - } + /* If append-mark is absent or will be overwritten, write it. */ + if( paf->iMark < 0 || paf->iPgOne + iWriteEnd > paf->iMark ){ + int rc = apndWriteMark(paf, pFile, iWriteEnd); + if( SQLITE_OK!=rc ) return rc; } - return rc; + return pFile->pMethods->xWrite(pFile, zBuf, iAmt, paf->iPgOne+iOfst); } /* ** Truncate an apnd-file. */ static int apndTruncate(sqlite3_file *pFile, sqlite_int64 size){ - int rc; - ApndFile *p = (ApndFile *)pFile; + ApndFile *paf = (ApndFile *)pFile; pFile = ORIGFILE(pFile); - rc = pFile->pMethods->xTruncate(pFile, size+p->iPgOne+APND_MARK_SIZE); - if( rc==SQLITE_OK ){ - p->iMark = p->iPgOne+size; - rc = apndWriteMark(p, pFile); - } - return rc; + /* The append mark goes out first so truncate failure does not lose it. */ + if( SQLITE_OK!=apndWriteMark(paf, pFile, size) ) return SQLITE_IOERR; + /* Truncate underlying file just past append mark */ + return pFile->pMethods->xTruncate(pFile, paf->iMark+APND_MARK_SIZE); } /* @@ -3891,16 +3940,12 @@ static int apndSync(sqlite3_file *pFile, int flags){ /* ** Return the current file-size of an apnd-file. +** If the append mark is not yet there, the file-size is 0. */ static int apndFileSize(sqlite3_file *pFile, sqlite_int64 *pSize){ - ApndFile *p = (ApndFile *)pFile; - int rc; - pFile = ORIGFILE(p); - rc = pFile->pMethods->xFileSize(pFile, pSize); - if( rc==SQLITE_OK && p->iPgOne ){ - *pSize -= p->iPgOne + APND_MARK_SIZE; - } - return rc; + ApndFile *paf = (ApndFile *)pFile; + *pSize = ( paf->iMark >= 0 )? (paf->iMark - paf->iPgOne) : 0; + return SQLITE_OK; } /* @@ -3931,12 +3976,13 @@ static int apndCheckReservedLock(sqlite3_file *pFile, int *pResOut){ ** File control method. For custom operations on an apnd-file. */ static int apndFileControl(sqlite3_file *pFile, int op, void *pArg){ - ApndFile *p = (ApndFile *)pFile; + ApndFile *paf = (ApndFile *)pFile; int rc; pFile = ORIGFILE(pFile); + if( op==SQLITE_FCNTL_SIZE_HINT ) *(sqlite3_int64*)pArg += paf->iPgOne; rc = pFile->pMethods->xFileControl(pFile, op, pArg); if( rc==SQLITE_OK && op==SQLITE_FCNTL_VFSNAME ){ - *(char**)pArg = sqlite3_mprintf("apnd(%lld)/%z", p->iPgOne, *(char**)pArg); + *(char**)pArg = sqlite3_mprintf("apnd(%lld)/%z", paf->iPgOne,*(char**)pArg); } return rc; } @@ -3995,6 +4041,9 @@ static int apndFetch( void **pp ){ ApndFile *p = (ApndFile *)pFile; + if( p->iMark < 0 || iOfst+iAmt > p->iMark ){ + return SQLITE_IOERR; /* Cannot read what is not yet there. */ + } pFile = ORIGFILE(pFile); return pFile->pMethods->xFetch(pFile, iOfst+p->iPgOne, iAmt, pp); } @@ -4006,95 +4055,153 @@ static int apndUnfetch(sqlite3_file *pFile, sqlite3_int64 iOfst, void *pPage){ return pFile->pMethods->xUnfetch(pFile, iOfst+p->iPgOne, pPage); } -/* -** Check to see if the file is an ordinary SQLite database file. -*/ -static int apndIsOrdinaryDatabaseFile(sqlite3_int64 sz, sqlite3_file *pFile){ - int rc; - char zHdr[16]; - static const char aSqliteHdr[] = "SQLite format 3"; - if( sz<512 ) return 0; - rc = pFile->pMethods->xRead(pFile, zHdr, sizeof(zHdr), 0); - if( rc ) return 0; - return memcmp(zHdr, aSqliteHdr, sizeof(zHdr))==0; -} - /* ** Try to read the append-mark off the end of a file. Return the -** start of the appended database if the append-mark is present. If -** there is no append-mark, return -1; +** start of the appended database if the append-mark is present. +** If there is no valid append-mark, return -1; +** +** An append-mark is only valid if the NNNNNNNN start-of-database offset +** indicates that the appended database contains at least one page. The +** start-of-database value must be a multiple of 512. */ static sqlite3_int64 apndReadMark(sqlite3_int64 sz, sqlite3_file *pFile){ int rc, i; sqlite3_int64 iMark; + int msbs = 8 * (APND_MARK_FOS_SZ-1); unsigned char a[APND_MARK_SIZE]; - if( sz<=APND_MARK_SIZE ) return -1; + if( APND_MARK_SIZE!=(sz & 0x1ff) ) return -1; rc = pFile->pMethods->xRead(pFile, a, APND_MARK_SIZE, sz-APND_MARK_SIZE); if( rc ) return -1; if( memcmp(a, APND_MARK_PREFIX, APND_MARK_PREFIX_SZ)!=0 ) return -1; - iMark = ((sqlite3_int64)(a[APND_MARK_PREFIX_SZ]&0x7f))<<56; - for(i=1; i<8; i++){ - iMark += (sqlite3_int64)a[APND_MARK_PREFIX_SZ+i]<<(56-8*i); + iMark = ((sqlite3_int64)(a[APND_MARK_PREFIX_SZ] & 0x7f)) << msbs; + for(i=1; i<8; i++){ + msbs -= 8; + iMark |= (sqlite3_int64)a[APND_MARK_PREFIX_SZ+i]< (sz - APND_MARK_SIZE - 512) ) return -1; + if( iMark & 0x1ff ) return -1; return iMark; } +static const char apvfsSqliteHdr[] = "SQLite format 3"; +/* +** Check to see if the file is an appendvfs SQLite database file. +** Return true iff it is such. Parameter sz is the file's size. +*/ +static int apndIsAppendvfsDatabase(sqlite3_int64 sz, sqlite3_file *pFile){ + int rc; + char zHdr[16]; + sqlite3_int64 iMark = apndReadMark(sz, pFile); + if( iMark>=0 ){ + /* If file has the correct end-marker, the expected odd size, and the + ** SQLite DB type marker where the end-marker puts it, then it + ** is an appendvfs database. + */ + rc = pFile->pMethods->xRead(pFile, zHdr, sizeof(zHdr), iMark); + if( SQLITE_OK==rc + && memcmp(zHdr, apvfsSqliteHdr, sizeof(zHdr))==0 + && (sz & 0x1ff) == APND_MARK_SIZE + && sz>=512+APND_MARK_SIZE + ){ + return 1; /* It's an appendvfs database */ + } + } + return 0; +} + +/* +** Check to see if the file is an ordinary SQLite database file. +** Return true iff so. Parameter sz is the file's size. +*/ +static int apndIsOrdinaryDatabaseFile(sqlite3_int64 sz, sqlite3_file *pFile){ + char zHdr[16]; + if( apndIsAppendvfsDatabase(sz, pFile) /* rule 2 */ + || (sz & 0x1ff) != 0 + || SQLITE_OK!=pFile->pMethods->xRead(pFile, zHdr, sizeof(zHdr), 0) + || memcmp(zHdr, apvfsSqliteHdr, sizeof(zHdr))!=0 + ){ + return 0; + }else{ + return 1; + } +} + /* ** Open an apnd file handle. */ static int apndOpen( - sqlite3_vfs *pVfs, + sqlite3_vfs *pApndVfs, const char *zName, sqlite3_file *pFile, int flags, int *pOutFlags ){ - ApndFile *p; - sqlite3_file *pSubFile; - sqlite3_vfs *pSubVfs; + ApndFile *pApndFile = (ApndFile*)pFile; + sqlite3_file *pBaseFile = ORIGFILE(pFile); + sqlite3_vfs *pBaseVfs = ORIGVFS(pApndVfs); int rc; - sqlite3_int64 sz; - pSubVfs = ORIGVFS(pVfs); + sqlite3_int64 sz = 0; if( (flags & SQLITE_OPEN_MAIN_DB)==0 ){ - return pSubVfs->xOpen(pSubVfs, zName, pFile, flags, pOutFlags); + /* The appendvfs is not to be used for transient or temporary databases. + ** Just use the base VFS open to initialize the given file object and + ** open the underlying file. (Appendvfs is then unused for this file.) + */ + return pBaseVfs->xOpen(pBaseVfs, zName, pFile, flags, pOutFlags); } - p = (ApndFile*)pFile; - memset(p, 0, sizeof(*p)); - pSubFile = ORIGFILE(pFile); + memset(pApndFile, 0, sizeof(ApndFile)); pFile->pMethods = &apnd_io_methods; - rc = pSubVfs->xOpen(pSubVfs, zName, pSubFile, flags, pOutFlags); - if( rc ) goto apnd_open_done; - rc = pSubFile->pMethods->xFileSize(pSubFile, &sz); + pApndFile->iMark = -1; /* Append mark not yet written */ + + rc = pBaseVfs->xOpen(pBaseVfs, zName, pBaseFile, flags, pOutFlags); + if( rc==SQLITE_OK ){ + rc = pBaseFile->pMethods->xFileSize(pBaseFile, &sz); + } if( rc ){ - pSubFile->pMethods->xClose(pSubFile); - goto apnd_open_done; + pBaseFile->pMethods->xClose(pBaseFile); + pFile->pMethods = 0; + return rc; } - if( apndIsOrdinaryDatabaseFile(sz, pSubFile) ){ - memmove(pFile, pSubFile, pSubVfs->szOsFile); + if( apndIsOrdinaryDatabaseFile(sz, pBaseFile) ){ + /* The file being opened appears to be just an ordinary DB. Copy + ** the base dispatch-table so this instance mimics the base VFS. + */ + memmove(pApndFile, pBaseFile, pBaseVfs->szOsFile); return SQLITE_OK; } - p->iMark = 0; - p->iPgOne = apndReadMark(sz, pFile); - if( p->iPgOne>0 ){ + pApndFile->iPgOne = apndReadMark(sz, pFile); + if( pApndFile->iPgOne>=0 ){ + pApndFile->iMark = sz - APND_MARK_SIZE; /* Append mark found */ return SQLITE_OK; } if( (flags & SQLITE_OPEN_CREATE)==0 ){ - pSubFile->pMethods->xClose(pSubFile); + pBaseFile->pMethods->xClose(pBaseFile); rc = SQLITE_CANTOPEN; + pFile->pMethods = 0; + }else{ + /* Round newly added appendvfs location to #define'd page boundary. + ** Note that nothing has yet been written to the underlying file. + ** The append mark will be written along with first content write. + ** Until then, paf->iMark value indicates it is not yet written. + */ + pApndFile->iPgOne = APND_START_ROUNDUP(sz); } - p->iPgOne = (sz+0xfff) & ~(sqlite3_int64)0xfff; -apnd_open_done: - if( rc ) pFile->pMethods = 0; return rc; } *** 17971 LINES SKIPPED *** From owner-dev-commits-src-branches@freebsd.org Sun Jun 6 21:55:00 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D7B1363F97B; Sun, 6 Jun 2021 21:55:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fyqzm5nQ0z4cv9; Sun, 6 Jun 2021 21:55:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AEBE9313D; Sun, 6 Jun 2021 21:55:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 156Lt0AF045625; Sun, 6 Jun 2021 21:55:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 156Lt0GK045624; Sun, 6 Jun 2021 21:55:00 GMT (envelope-from git) Date: Sun, 6 Jun 2021 21:55:00 GMT Message-Id: <202106062155.156Lt0GK045624@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 33d140e56ded - stable/12 - Import sqlite 3.34.1 (3340100). MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 33d140e56ded1c903cdc3c8b69e890b5e8e3c424 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jun 2021 21:55:00 -0000 The branch stable/12 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=33d140e56ded1c903cdc3c8b69e890b5e8e3c424 commit 33d140e56ded1c903cdc3c8b69e890b5e8e3c424 Author: Cy Schubert AuthorDate: 2021-01-25 17:45:04 +0000 Commit: Cy Schubert CommitDate: 2021-06-06 21:52:01 +0000 Import sqlite 3.34.1 (3340100). (cherry picked from commit 25cdacf79b06356c929e59d5074d26c9dac41bdf) --- contrib/sqlite3/configure | 20 +- contrib/sqlite3/configure.ac | 2 +- contrib/sqlite3/ltmain.sh | 0 contrib/sqlite3/shell.c | 700 ++++++++- contrib/sqlite3/sqlite3.c | 2683 +++++++++++++++++++++++++---------- contrib/sqlite3/sqlite3.h | 81 +- contrib/sqlite3/sqlite3ext.h | 4 + contrib/sqlite3/sqlite3rc.h | 2 +- contrib/sqlite3/tea/configure | 18 +- contrib/sqlite3/tea/configure.ac | 2 +- contrib/sqlite3/tea/win/makefile.vc | 2 +- 11 files changed, 2685 insertions(+), 829 deletions(-) diff --git a/contrib/sqlite3/configure b/contrib/sqlite3/configure index 9aed16a74091..0eedad3467dd 100755 --- a/contrib/sqlite3/configure +++ b/contrib/sqlite3/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for sqlite 3.33.0. +# Generated by GNU Autoconf 2.69 for sqlite 3.34.1. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='sqlite' PACKAGE_TARNAME='sqlite' -PACKAGE_VERSION='3.33.0' -PACKAGE_STRING='sqlite 3.33.0' +PACKAGE_VERSION='3.34.1' +PACKAGE_STRING='sqlite 3.34.1' PACKAGE_BUGREPORT='http://www.sqlite.org' PACKAGE_URL='' @@ -1341,7 +1341,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures sqlite 3.33.0 to adapt to many kinds of systems. +\`configure' configures sqlite 3.34.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1412,7 +1412,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of sqlite 3.33.0:";; + short | recursive ) echo "Configuration of sqlite 3.34.1:";; esac cat <<\_ACEOF @@ -1537,7 +1537,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -sqlite configure 3.33.0 +sqlite configure 3.34.1 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1952,7 +1952,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by sqlite $as_me 3.33.0, which was +It was created by sqlite $as_me 3.34.1, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2818,7 +2818,7 @@ fi # Define the identity of the package. PACKAGE='sqlite' - VERSION='3.33.0' + VERSION='3.34.1' cat >>confdefs.h <<_ACEOF @@ -14438,7 +14438,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by sqlite $as_me 3.33.0, which was +This file was extended by sqlite $as_me 3.34.1, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -14495,7 +14495,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -sqlite config.status 3.33.0 +sqlite config.status 3.34.1 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/contrib/sqlite3/configure.ac b/contrib/sqlite3/configure.ac index a83dac3ac142..72472467d5b7 100644 --- a/contrib/sqlite3/configure.ac +++ b/contrib/sqlite3/configure.ac @@ -10,7 +10,7 @@ # AC_PREREQ(2.61) -AC_INIT(sqlite, 3.33.0, http://www.sqlite.org) +AC_INIT(sqlite, 3.34.1, http://www.sqlite.org) AC_CONFIG_SRCDIR([sqlite3.c]) AC_CONFIG_AUX_DIR([.]) diff --git a/contrib/sqlite3/ltmain.sh b/contrib/sqlite3/ltmain.sh old mode 100755 new mode 100644 diff --git a/contrib/sqlite3/shell.c b/contrib/sqlite3/shell.c index a1a77e49fa5f..6f4fee80dc1c 100644 --- a/contrib/sqlite3/shell.c +++ b/contrib/sqlite3/shell.c @@ -571,8 +571,6 @@ static void utf8_width_print(FILE *pOut, int w, const char *zUtf){ int i; int n; int aw = w<0 ? -w : w; - char zBuf[1000]; - if( aw>(int)sizeof(zBuf)/3 ) aw = (int)sizeof(zBuf)/3; for(i=n=0; zUtf[i]; i++){ if( (zUtf[i]&0xc0)!=0x80 ){ n++; @@ -2016,9 +2014,11 @@ static void sha3QueryFunc( } nCol = sqlite3_column_count(pStmt); z = sqlite3_sql(pStmt); - n = (int)strlen(z); - hash_step_vformat(&cx,"S%d:",n); - SHA3Update(&cx,(unsigned char*)z,n); + if( z ){ + n = (int)strlen(z); + hash_step_vformat(&cx,"S%d:",n); + SHA3Update(&cx,(unsigned char*)z,n); + } /* Compute a hash over the result of the query */ while( SQLITE_ROW==sqlite3_step(pStmt) ){ @@ -5315,6 +5315,444 @@ int sqlite3_ieee_init( } /************************* End ../ext/misc/ieee754.c ********************/ +/************************* Begin ../ext/misc/series.c ******************/ +/* +** 2015-08-18 +** +** The author disclaims copyright to this source code. In place of +** a legal notice, here is a blessing: +** +** May you do good and not evil. +** May you find forgiveness for yourself and forgive others. +** May you share freely, never taking more than you give. +** +************************************************************************* +** +** This file demonstrates how to create a table-valued-function using +** a virtual table. This demo implements the generate_series() function +** which gives similar results to the eponymous function in PostgreSQL. +** Examples: +** +** SELECT * FROM generate_series(0,100,5); +** +** The query above returns integers from 0 through 100 counting by steps +** of 5. +** +** SELECT * FROM generate_series(0,100); +** +** Integers from 0 through 100 with a step size of 1. +** +** SELECT * FROM generate_series(20) LIMIT 10; +** +** Integers 20 through 29. +** +** HOW IT WORKS +** +** The generate_series "function" is really a virtual table with the +** following schema: +** +** CREATE TABLE generate_series( +** value, +** start HIDDEN, +** stop HIDDEN, +** step HIDDEN +** ); +** +** Function arguments in queries against this virtual table are translated +** into equality constraints against successive hidden columns. In other +** words, the following pairs of queries are equivalent to each other: +** +** SELECT * FROM generate_series(0,100,5); +** SELECT * FROM generate_series WHERE start=0 AND stop=100 AND step=5; +** +** SELECT * FROM generate_series(0,100); +** SELECT * FROM generate_series WHERE start=0 AND stop=100; +** +** SELECT * FROM generate_series(20) LIMIT 10; +** SELECT * FROM generate_series WHERE start=20 LIMIT 10; +** +** The generate_series virtual table implementation leaves the xCreate method +** set to NULL. This means that it is not possible to do a CREATE VIRTUAL +** TABLE command with "generate_series" as the USING argument. Instead, there +** is a single generate_series virtual table that is always available without +** having to be created first. +** +** The xBestIndex method looks for equality constraints against the hidden +** start, stop, and step columns, and if present, it uses those constraints +** to bound the sequence of generated values. If the equality constraints +** are missing, it uses 0 for start, 4294967295 for stop, and 1 for step. +** xBestIndex returns a small cost when both start and stop are available, +** and a very large cost if either start or stop are unavailable. This +** encourages the query planner to order joins such that the bounds of the +** series are well-defined. +*/ +/* #include "sqlite3ext.h" */ +SQLITE_EXTENSION_INIT1 +#include +#include + +#ifndef SQLITE_OMIT_VIRTUALTABLE + + +/* series_cursor is a subclass of sqlite3_vtab_cursor which will +** serve as the underlying representation of a cursor that scans +** over rows of the result +*/ +typedef struct series_cursor series_cursor; +struct series_cursor { + sqlite3_vtab_cursor base; /* Base class - must be first */ + int isDesc; /* True to count down rather than up */ + sqlite3_int64 iRowid; /* The rowid */ + sqlite3_int64 iValue; /* Current value ("value") */ + sqlite3_int64 mnValue; /* Mimimum value ("start") */ + sqlite3_int64 mxValue; /* Maximum value ("stop") */ + sqlite3_int64 iStep; /* Increment ("step") */ +}; + +/* +** The seriesConnect() method is invoked to create a new +** series_vtab that describes the generate_series virtual table. +** +** Think of this routine as the constructor for series_vtab objects. +** +** All this routine needs to do is: +** +** (1) Allocate the series_vtab object and initialize all fields. +** +** (2) Tell SQLite (via the sqlite3_declare_vtab() interface) what the +** result set of queries against generate_series will look like. +*/ +static int seriesConnect( + sqlite3 *db, + void *pUnused, + int argcUnused, const char *const*argvUnused, + sqlite3_vtab **ppVtab, + char **pzErrUnused +){ + sqlite3_vtab *pNew; + int rc; + +/* Column numbers */ +#define SERIES_COLUMN_VALUE 0 +#define SERIES_COLUMN_START 1 +#define SERIES_COLUMN_STOP 2 +#define SERIES_COLUMN_STEP 3 + + (void)pUnused; + (void)argcUnused; + (void)argvUnused; + (void)pzErrUnused; + rc = sqlite3_declare_vtab(db, + "CREATE TABLE x(value,start hidden,stop hidden,step hidden)"); + if( rc==SQLITE_OK ){ + pNew = *ppVtab = sqlite3_malloc( sizeof(*pNew) ); + if( pNew==0 ) return SQLITE_NOMEM; + memset(pNew, 0, sizeof(*pNew)); + sqlite3_vtab_config(db, SQLITE_VTAB_INNOCUOUS); + } + return rc; +} + +/* +** This method is the destructor for series_cursor objects. +*/ +static int seriesDisconnect(sqlite3_vtab *pVtab){ + sqlite3_free(pVtab); + return SQLITE_OK; +} + +/* +** Constructor for a new series_cursor object. +*/ +static int seriesOpen(sqlite3_vtab *pUnused, sqlite3_vtab_cursor **ppCursor){ + series_cursor *pCur; + (void)pUnused; + pCur = sqlite3_malloc( sizeof(*pCur) ); + if( pCur==0 ) return SQLITE_NOMEM; + memset(pCur, 0, sizeof(*pCur)); + *ppCursor = &pCur->base; + return SQLITE_OK; +} + +/* +** Destructor for a series_cursor. +*/ +static int seriesClose(sqlite3_vtab_cursor *cur){ + sqlite3_free(cur); + return SQLITE_OK; +} + + +/* +** Advance a series_cursor to its next row of output. +*/ +static int seriesNext(sqlite3_vtab_cursor *cur){ + series_cursor *pCur = (series_cursor*)cur; + if( pCur->isDesc ){ + pCur->iValue -= pCur->iStep; + }else{ + pCur->iValue += pCur->iStep; + } + pCur->iRowid++; + return SQLITE_OK; +} + +/* +** Return values of columns for the row at which the series_cursor +** is currently pointing. +*/ +static int seriesColumn( + sqlite3_vtab_cursor *cur, /* The cursor */ + sqlite3_context *ctx, /* First argument to sqlite3_result_...() */ + int i /* Which column to return */ +){ + series_cursor *pCur = (series_cursor*)cur; + sqlite3_int64 x = 0; + switch( i ){ + case SERIES_COLUMN_START: x = pCur->mnValue; break; + case SERIES_COLUMN_STOP: x = pCur->mxValue; break; + case SERIES_COLUMN_STEP: x = pCur->iStep; break; + default: x = pCur->iValue; break; + } + sqlite3_result_int64(ctx, x); + return SQLITE_OK; +} + +/* +** Return the rowid for the current row. In this implementation, the +** first row returned is assigned rowid value 1, and each subsequent +** row a value 1 more than that of the previous. +*/ +static int seriesRowid(sqlite3_vtab_cursor *cur, sqlite_int64 *pRowid){ + series_cursor *pCur = (series_cursor*)cur; + *pRowid = pCur->iRowid; + return SQLITE_OK; +} + +/* +** Return TRUE if the cursor has been moved off of the last +** row of output. +*/ +static int seriesEof(sqlite3_vtab_cursor *cur){ + series_cursor *pCur = (series_cursor*)cur; + if( pCur->isDesc ){ + return pCur->iValue < pCur->mnValue; + }else{ + return pCur->iValue > pCur->mxValue; + } +} + +/* True to cause run-time checking of the start=, stop=, and/or step= +** parameters. The only reason to do this is for testing the +** constraint checking logic for virtual tables in the SQLite core. +*/ +#ifndef SQLITE_SERIES_CONSTRAINT_VERIFY +# define SQLITE_SERIES_CONSTRAINT_VERIFY 0 +#endif + +/* +** This method is called to "rewind" the series_cursor object back +** to the first row of output. This method is always called at least +** once prior to any call to seriesColumn() or seriesRowid() or +** seriesEof(). +** +** The query plan selected by seriesBestIndex is passed in the idxNum +** parameter. (idxStr is not used in this implementation.) idxNum +** is a bitmask showing which constraints are available: +** +** 1: start=VALUE +** 2: stop=VALUE +** 4: step=VALUE +** +** Also, if bit 8 is set, that means that the series should be output +** in descending order rather than in ascending order. +** +** This routine should initialize the cursor and position it so that it +** is pointing at the first row, or pointing off the end of the table +** (so that seriesEof() will return true) if the table is empty. +*/ +static int seriesFilter( + sqlite3_vtab_cursor *pVtabCursor, + int idxNum, const char *idxStrUnused, + int argc, sqlite3_value **argv +){ + series_cursor *pCur = (series_cursor *)pVtabCursor; + int i = 0; + (void)idxStrUnused; + if( idxNum & 1 ){ + pCur->mnValue = sqlite3_value_int64(argv[i++]); + }else{ + pCur->mnValue = 0; + } + if( idxNum & 2 ){ + pCur->mxValue = sqlite3_value_int64(argv[i++]); + }else{ + pCur->mxValue = 0xffffffff; + } + if( idxNum & 4 ){ + pCur->iStep = sqlite3_value_int64(argv[i++]); + if( pCur->iStep<1 ) pCur->iStep = 1; + }else{ + pCur->iStep = 1; + } + for(i=0; imnValue = 1; + pCur->mxValue = 0; + break; + } + } + if( idxNum & 8 ){ + pCur->isDesc = 1; + pCur->iValue = pCur->mxValue; + if( pCur->iStep>0 ){ + pCur->iValue -= (pCur->mxValue - pCur->mnValue)%pCur->iStep; + } + }else{ + pCur->isDesc = 0; + pCur->iValue = pCur->mnValue; + } + pCur->iRowid = 1; + return SQLITE_OK; +} + +/* +** SQLite will invoke this method one or more times while planning a query +** that uses the generate_series virtual table. This routine needs to create +** a query plan for each invocation and compute an estimated cost for that +** plan. +** +** In this implementation idxNum is used to represent the +** query plan. idxStr is unused. +** +** The query plan is represented by bits in idxNum: +** +** (1) start = $value -- constraint exists +** (2) stop = $value -- constraint exists +** (4) step = $value -- constraint exists +** (8) output in descending order +*/ +static int seriesBestIndex( + sqlite3_vtab *tabUnused, + sqlite3_index_info *pIdxInfo +){ + int i, j; /* Loop over constraints */ + int idxNum = 0; /* The query plan bitmask */ + int unusableMask = 0; /* Mask of unusable constraints */ + int nArg = 0; /* Number of arguments that seriesFilter() expects */ + int aIdx[3]; /* Constraints on start, stop, and step */ + const struct sqlite3_index_constraint *pConstraint; + + /* This implementation assumes that the start, stop, and step columns + ** are the last three columns in the virtual table. */ + assert( SERIES_COLUMN_STOP == SERIES_COLUMN_START+1 ); + assert( SERIES_COLUMN_STEP == SERIES_COLUMN_START+2 ); + (void)tabUnused; + aIdx[0] = aIdx[1] = aIdx[2] = -1; + pConstraint = pIdxInfo->aConstraint; + for(i=0; inConstraint; i++, pConstraint++){ + int iCol; /* 0 for start, 1 for stop, 2 for step */ + int iMask; /* bitmask for those column */ + if( pConstraint->iColumniColumn - SERIES_COLUMN_START; + assert( iCol>=0 && iCol<=2 ); + iMask = 1 << iCol; + if( pConstraint->usable==0 ){ + unusableMask |= iMask; + continue; + }else if( pConstraint->op==SQLITE_INDEX_CONSTRAINT_EQ ){ + idxNum |= iMask; + aIdx[iCol] = i; + } + } + for(i=0; i<3; i++){ + if( (j = aIdx[i])>=0 ){ + pIdxInfo->aConstraintUsage[j].argvIndex = ++nArg; + pIdxInfo->aConstraintUsage[j].omit = !SQLITE_SERIES_CONSTRAINT_VERIFY; + } + } + if( (unusableMask & ~idxNum)!=0 ){ + /* The start, stop, and step columns are inputs. Therefore if there + ** are unusable constraints on any of start, stop, or step then + ** this plan is unusable */ + return SQLITE_CONSTRAINT; + } + if( (idxNum & 3)==3 ){ + /* Both start= and stop= boundaries are available. This is the + ** the preferred case */ + pIdxInfo->estimatedCost = (double)(2 - ((idxNum&4)!=0)); + pIdxInfo->estimatedRows = 1000; + if( pIdxInfo->nOrderBy==1 ){ + if( pIdxInfo->aOrderBy[0].desc ) idxNum |= 8; + pIdxInfo->orderByConsumed = 1; + } + }else{ + /* If either boundary is missing, we have to generate a huge span + ** of numbers. Make this case very expensive so that the query + ** planner will work hard to avoid it. */ + pIdxInfo->estimatedRows = 2147483647; + } + pIdxInfo->idxNum = idxNum; + return SQLITE_OK; +} + +/* +** This following structure defines all the methods for the +** generate_series virtual table. +*/ +static sqlite3_module seriesModule = { + 0, /* iVersion */ + 0, /* xCreate */ + seriesConnect, /* xConnect */ + seriesBestIndex, /* xBestIndex */ + seriesDisconnect, /* xDisconnect */ + 0, /* xDestroy */ + seriesOpen, /* xOpen - open a cursor */ + seriesClose, /* xClose - close a cursor */ + seriesFilter, /* xFilter - configure scan constraints */ + seriesNext, /* xNext - advance a cursor */ + seriesEof, /* xEof - check for end of scan */ + seriesColumn, /* xColumn - read data */ + seriesRowid, /* xRowid - read data */ + 0, /* xUpdate */ + 0, /* xBegin */ + 0, /* xSync */ + 0, /* xCommit */ + 0, /* xRollback */ + 0, /* xFindMethod */ + 0, /* xRename */ + 0, /* xSavepoint */ + 0, /* xRelease */ + 0, /* xRollbackTo */ + 0 /* xShadowName */ +}; + +#endif /* SQLITE_OMIT_VIRTUALTABLE */ + +#ifdef _WIN32 + +#endif +int sqlite3_series_init( + sqlite3 *db, + char **pzErrMsg, + const sqlite3_api_routines *pApi +){ + int rc = SQLITE_OK; + SQLITE_EXTENSION_INIT2(pApi); +#ifndef SQLITE_OMIT_VIRTUALTABLE + if( sqlite3_libversion_number()<3008012 ){ + *pzErrMsg = sqlite3_mprintf( + "generate_series() requires SQLite 3.8.12 or later"); + return SQLITE_ERROR; + } + rc = sqlite3_create_module(db, "generate_series", &seriesModule, 0); +#endif + return rc; +} + +/************************* End ../ext/misc/series.c ********************/ #ifdef SQLITE_HAVE_ZLIB /************************* Begin ../ext/misc/zipfile.c ******************/ /* @@ -5842,14 +6280,16 @@ static int zipfileAppendData( const u8 *aWrite, int nWrite ){ - size_t n; - fseek(pTab->pWriteFd, (long)pTab->szCurrent, SEEK_SET); - n = fwrite(aWrite, 1, nWrite, pTab->pWriteFd); - if( (int)n!=nWrite ){ - pTab->base.zErrMsg = sqlite3_mprintf("error in fwrite()"); - return SQLITE_ERROR; + if( nWrite>0 ){ + size_t n = nWrite; + fseek(pTab->pWriteFd, (long)pTab->szCurrent, SEEK_SET); + n = fwrite(aWrite, 1, nWrite, pTab->pWriteFd); + if( (int)n!=nWrite ){ + pTab->base.zErrMsg = sqlite3_mprintf("error in fwrite()"); + return SQLITE_ERROR; + } + pTab->szCurrent += nWrite; } - pTab->szCurrent += nWrite; return SQLITE_OK; } @@ -8494,6 +8934,7 @@ static int idxGetTableInfo( IdxTable *pNew = 0; int rc, rc2; char *pCsr = 0; + int nPk = 0; rc = idxPrintfPrepareStmt(db, &p1, pzErrmsg, "PRAGMA table_info=%Q", zTab); while( rc==SQLITE_OK && SQLITE_ROW==sqlite3_step(p1) ){ @@ -8504,6 +8945,7 @@ static int idxGetTableInfo( ); nByte += 1 + STRLEN(zCol); nCol++; + nPk += (sqlite3_column_int(p1, 5)>0); } rc2 = sqlite3_reset(p1); if( rc==SQLITE_OK ) rc = rc2; @@ -8523,7 +8965,7 @@ static int idxGetTableInfo( const char *zCol = (const char*)sqlite3_column_text(p1, 1); int nCopy = STRLEN(zCol) + 1; pNew->aCol[nCol].zName = pCsr; - pNew->aCol[nCol].iPk = sqlite3_column_int(p1, 5); + pNew->aCol[nCol].iPk = (sqlite3_column_int(p1, 5)==1 && nPk==1); memcpy(pCsr, zCol, nCopy); pCsr += nCopy; @@ -9528,10 +9970,12 @@ static int idxPopulateStat1(sqlite3expert *p, char **pzErr){ idxFinalize(&rc, pIndexXInfo); idxFinalize(&rc, pWrite); - for(i=0; inSlot; i++){ - sqlite3_free(pCtx->aSlot[i].z); + if( pCtx ){ + for(i=0; inSlot; i++){ + sqlite3_free(pCtx->aSlot[i].z); + } + sqlite3_free(pCtx); } - sqlite3_free(pCtx); if( rc==SQLITE_OK ){ rc = sqlite3_exec(p->dbm, "ANALYZE sqlite_schema", 0, 0, 0); @@ -10771,6 +11215,8 @@ struct ShellState { #define SHFLG_CountChanges 0x00000020 /* .changes setting */ #define SHFLG_Echo 0x00000040 /* .echo or --echo setting */ #define SHFLG_HeaderSet 0x00000080 /* .header has been used */ +#define SHFLG_DumpDataOnly 0x00000100 /* .dump show data only */ +#define SHFLG_DumpNoSys 0x00000200 /* .dump omits system tables */ /* ** Macros for testing and setting shellFlgs @@ -13291,19 +13737,25 @@ static int dump_callback(void *pArg, int nArg, char **azArg, char **azNotUsed){ const char *zType; const char *zSql; ShellState *p = (ShellState *)pArg; + int dataOnly; + int noSys; UNUSED_PARAMETER(azNotUsed); if( nArg!=3 || azArg==0 ) return 0; zTable = azArg[0]; zType = azArg[1]; zSql = azArg[2]; + dataOnly = (p->shellFlgs & SHFLG_DumpDataOnly)!=0; + noSys = (p->shellFlgs & SHFLG_DumpNoSys)!=0; - if( strcmp(zTable, "sqlite_sequence")==0 ){ - raw_printf(p->out, "DELETE FROM sqlite_sequence;\n"); - }else if( sqlite3_strglob("sqlite_stat?", zTable)==0 ){ - raw_printf(p->out, "ANALYZE sqlite_schema;\n"); + if( strcmp(zTable, "sqlite_sequence")==0 && !noSys ){ + if( !dataOnly ) raw_printf(p->out, "DELETE FROM sqlite_sequence;\n"); + }else if( sqlite3_strglob("sqlite_stat?", zTable)==0 && !noSys ){ + if( !dataOnly ) raw_printf(p->out, "ANALYZE sqlite_schema;\n"); }else if( strncmp(zTable, "sqlite_", 7)==0 ){ return 0; + }else if( dataOnly ){ + /* no-op */ }else if( strncmp(zSql, "CREATE VIRTUAL TABLE", 20)==0 ){ char *zIns; if( !p->writableSchema ){ @@ -13476,8 +13928,10 @@ static const char *(azHelp[]) = { ".dbinfo ?DB? Show status information about the database", ".dump ?TABLE? Render database content as SQL", " Options:", - " --preserve-rowids Include ROWID values in the output", + " --data-only Output only INSERT statements", " --newlines Allow unescaped newline characters in output", + " --nosys Omit system tables (ex: \"sqlite_stat1\")", + " --preserve-rowids Include ROWID values in the output", " TABLE is a LIKE pattern for the tables to dump", " Additional LIKE patterns can be given in subsequent arguments", ".echo on|off Turn command echo on or off", @@ -13602,8 +14056,9 @@ static const char *(azHelp[]) = { ".save FILE Write in-memory database into FILE", ".scanstats on|off Turn sqlite3_stmt_scanstatus() metrics on or off", ".schema ?PATTERN? Show the CREATE statements matching PATTERN", - " Options:", - " --indent Try to pretty-print the schema", + " Options:", + " --indent Try to pretty-print the schema", + " --nosys Omit objects whose names start with \"sqlite_\"", ".selftest ?OPTIONS? Run tests defined in the SELFTEST table", " Options:", " --init Create a new SELFTEST table", @@ -14012,6 +14467,20 @@ static void shellIdQuote( } } +/* +** Scalar function "usleep(X)" invokes sqlite3_sleep(X) and returns X. +*/ +static void shellUSleepFunc( + sqlite3_context *context, + int argcUnused, + sqlite3_value **argv +){ + int sleep = sqlite3_value_int(argv[0]); + (void)argcUnused; + sqlite3_sleep(sleep/1000); + sqlite3_result_int(context, sleep); +} + /* ** Scalar function "shell_escape_crnl" used by the .recover command. ** The argument passed to this function is the output of built-in @@ -14176,6 +14645,7 @@ static void open_db(ShellState *p, int openFlags){ sqlite3_uint_init(p->db, 0, 0); sqlite3_decimal_init(p->db, 0, 0); sqlite3_ieee_init(p->db, 0, 0); + sqlite3_series_init(p->db, 0, 0); #if !defined(SQLITE_OMIT_VIRTUALTABLE) && defined(SQLITE_ENABLE_DBPAGE_VTAB) sqlite3_dbdata_init(p->db, 0, 0); #endif @@ -14195,6 +14665,8 @@ static void open_db(ShellState *p, int openFlags){ shellInt32, 0, 0); sqlite3_create_function(p->db, "shell_idquote", 1, SQLITE_UTF8, 0, shellIdQuote, 0, 0); + sqlite3_create_function(p->db, "usleep",1,SQLITE_UTF8,0, + shellUSleepFunc, 0, 0); #ifndef SQLITE_NOHAVE_SYSTEM sqlite3_create_function(p->db, "edit", 1, SQLITE_UTF8, 0, editFunc, 0, 0); @@ -17169,21 +17641,41 @@ static int do_meta_command(char *zLine, ShellState *p){ }else if( c=='d' && n>1 && strncmp(azArg[0], "databases", n)==0 ){ - ShellState data; - char *zErrMsg = 0; + char **azName = 0; + int nName = 0; + sqlite3_stmt *pStmt; + int i; open_db(p, 0); - memcpy(&data, p, sizeof(data)); - data.showHeader = 0; - data.cMode = data.mode = MODE_List; - sqlite3_snprintf(sizeof(data.colSeparator),data.colSeparator,": "); - data.cnt = 0; - sqlite3_exec(p->db, "SELECT name, file FROM pragma_database_list", - callback, &data, &zErrMsg); - if( zErrMsg ){ - utf8_printf(stderr,"Error: %s\n", zErrMsg); - sqlite3_free(zErrMsg); + rc = sqlite3_prepare_v2(p->db, "PRAGMA database_list", -1, &pStmt, 0); + if( rc ){ + utf8_printf(stderr, "Error: %s\n", sqlite3_errmsg(p->db)); rc = 1; + }else{ + while( sqlite3_step(pStmt)==SQLITE_ROW ){ + const char *zSchema = (const char *)sqlite3_column_text(pStmt,1); + const char *zFile = (const char*)sqlite3_column_text(pStmt,2); + azName = sqlite3_realloc(azName, (nName+1)*2*sizeof(char*)); + if( azName==0 ){ shell_out_of_memory(); /* Does not return */ } + azName[nName*2] = strdup(zSchema); + azName[nName*2+1] = strdup(zFile); + nName++; + } } + sqlite3_finalize(pStmt); + for(i=0; idb, azName[i*2]); + int bRdonly = sqlite3_db_readonly(p->db, azName[i*2]); + const char *z = azName[i*2+1]; + utf8_printf(p->out, "%s: %s %s%s\n", + azName[i*2], + z && z[0] ? z : "\"\"", + bRdonly ? "r/o" : "r/w", + eTxn==SQLITE_TXN_NONE ? "" : + eTxn==SQLITE_TXN_READ ? " read-txn" : " write-txn"); + free(azName[i*2]); + free(azName[i*2+1]); + } + sqlite3_free(azName); }else if( c=='d' && n>=3 && strncmp(azArg[0], "dbconfig", n)==0 ){ @@ -17242,7 +17734,9 @@ static int do_meta_command(char *zLine, ShellState *p){ int i; int savedShowHeader = p->showHeader; int savedShellFlags = p->shellFlgs; - ShellClearFlag(p, SHFLG_PreserveRowid|SHFLG_Newlines|SHFLG_Echo); + ShellClearFlag(p, + SHFLG_PreserveRowid|SHFLG_Newlines|SHFLG_Echo + |SHFLG_DumpDataOnly|SHFLG_DumpNoSys); for(i=1; iout, "PRAGMA foreign_keys=OFF;\n"); - raw_printf(p->out, "BEGIN TRANSACTION;\n"); + if( (p->shellFlgs & SHFLG_DumpDataOnly)==0 ){ + /* When playing back a "dump", the content might appear in an order + ** which causes immediate foreign key constraints to be violated. + ** So disable foreign-key constraint enforcement to prevent problems. */ + raw_printf(p->out, "PRAGMA foreign_keys=OFF;\n"); + raw_printf(p->out, "BEGIN TRANSACTION;\n"); + } p->writableSchema = 0; p->showHeader = 0; /* Set writable_schema=ON since doing so forces SQLite to initialize @@ -17299,14 +17801,16 @@ static int do_meta_command(char *zLine, ShellState *p){ ); run_schema_dump_query(p,zSql); sqlite3_free(zSql); - zSql = sqlite3_mprintf( - "SELECT sql FROM sqlite_schema " - "WHERE (%s) AND sql NOT NULL" - " AND type IN ('index','trigger','view')", - zLike - ); - run_table_dump_query(p, zSql); - sqlite3_free(zSql); + if( (p->shellFlgs & SHFLG_DumpDataOnly)==0 ){ + zSql = sqlite3_mprintf( + "SELECT sql FROM sqlite_schema " + "WHERE (%s) AND sql NOT NULL" + " AND type IN ('index','trigger','view')", + zLike + ); + run_table_dump_query(p, zSql); + sqlite3_free(zSql); + } sqlite3_free(zLike); if( p->writableSchema ){ raw_printf(p->out, "PRAGMA writable_schema=OFF;\n"); @@ -17314,7 +17818,9 @@ static int do_meta_command(char *zLine, ShellState *p){ } sqlite3_exec(p->db, "PRAGMA writable_schema=OFF;", 0, 0, 0); sqlite3_exec(p->db, "RELEASE dump;", 0, 0, 0); - raw_printf(p->out, p->nErr?"ROLLBACK; -- due to errors\n":"COMMIT;\n"); + if( (p->shellFlgs & SHFLG_DumpDataOnly)==0 ){ + raw_printf(p->out, p->nErr?"ROLLBACK; -- due to errors\n":"COMMIT;\n"); + } p->showHeader = savedShowHeader; p->shellFlgs = savedShellFlags; }else @@ -17753,7 +18259,7 @@ static int do_meta_command(char *zLine, ShellState *p){ while( (nSkip--)>0 ){ while( xRead(&sCtx) && sCtx.cTerm==sCtx.cColSep ){} } - zSql = sqlite3_mprintf("SELECT * FROM %s", zTable); + zSql = sqlite3_mprintf("SELECT * FROM \"%w\"", zTable); if( zSql==0 ){ import_cleanup(&sCtx); shell_out_of_memory(); @@ -17762,7 +18268,7 @@ static int do_meta_command(char *zLine, ShellState *p){ rc = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0); import_append_char(&sCtx, 0); /* To ensure sCtx.z is allocated */ if( rc && sqlite3_strglob("no such table: *", sqlite3_errmsg(p->db))==0 ){ - char *zCreate = sqlite3_mprintf("CREATE TABLE %s", zTable); + char *zCreate = sqlite3_mprintf("CREATE TABLE \"%w\"", zTable); char cSep = '('; while( xRead(&sCtx) ){ zCreate = sqlite3_mprintf("%z%c\n \"%w\" TEXT", zCreate, cSep, sCtx.z); @@ -17783,7 +18289,7 @@ static int do_meta_command(char *zLine, ShellState *p){ rc = sqlite3_exec(p->db, zCreate, 0, 0, 0); sqlite3_free(zCreate); if( rc ){ - utf8_printf(stderr, "CREATE TABLE %s(...) failed: %s\n", zTable, + utf8_printf(stderr, "CREATE TABLE \"%s\"(...) failed: %s\n", zTable, sqlite3_errmsg(p->db)); import_cleanup(&sCtx); rc = 1; @@ -18548,9 +19054,16 @@ static int do_meta_command(char *zLine, ShellState *p){ rc = 1; goto meta_command_exit; } - if( notNormalFile(azArg[1]) - || (p->in = fopen(azArg[1], "rb"))==0 - ){ + if( azArg[1][0]=='|' ){ + p->in = popen(azArg[1]+1, "r"); + if( p->in==0 ){ + utf8_printf(stderr, "Error: cannot open \"%s\"\n", azArg[1]); + rc = 1; + }else{ + rc = process_input(p); + pclose(p->in); + } + }else if( notNormalFile(azArg[1]) || (p->in = fopen(azArg[1], "rb"))==0 ){ utf8_printf(stderr,"Error: cannot open \"%s\"\n", azArg[1]); rc = 1; }else{ @@ -18632,6 +19145,7 @@ static int do_meta_command(char *zLine, ShellState *p){ const char *zName = 0; int iSchema = 0; int bDebug = 0; + int bNoSystemTabs = 0; int ii; open_db(p, 0); @@ -18644,10 +19158,16 @@ static int do_meta_command(char *zLine, ShellState *p){ data.cMode = data.mode = MODE_Pretty; }else if( optionMatch(azArg[ii],"debug") ){ bDebug = 1; + }else if( optionMatch(azArg[ii],"nosys") ){ + bNoSystemTabs = 1; + }else if( azArg[ii][0]=='-' ){ + utf8_printf(stderr, "Unknown option: \"%s\"\n", azArg[ii]); + rc = 1; + goto meta_command_exit; }else if( zName==0 ){ zName = azArg[ii]; }else{ - raw_printf(stderr, "Usage: .schema ?--indent? ?LIKE-PATTERN?\n"); + raw_printf(stderr, "Usage: .schema ?--indent? ?--nosys? ?LIKE-PATTERN?\n"); rc = 1; goto meta_command_exit; } @@ -18733,7 +19253,10 @@ static int do_meta_command(char *zLine, ShellState *p){ appendText(&sSelect, " AND ", 0); sqlite3_free(zQarg); } - appendText(&sSelect, "type!='meta' AND sql IS NOT NULL" + if( bNoSystemTabs ){ + appendText(&sSelect, "name NOT LIKE 'sqlite_%%' AND ", 0); + } + appendText(&sSelect, "sql IS NOT NULL" " ORDER BY snum, rowid", 0); if( bDebug ){ utf8_printf(p->out, "SQL: %s;\n", sSelect.z); @@ -19430,6 +19953,7 @@ static int do_meta_command(char *zLine, ShellState *p){ *** 5486 LINES SKIPPED *** From owner-dev-commits-src-branches@freebsd.org Sun Jun 6 21:55:02 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7E4F163F679; Sun, 6 Jun 2021 21:55:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fyqzp30ZBz4cxq; Sun, 6 Jun 2021 21:55:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4F26A3038; Sun, 6 Jun 2021 21:55:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 156Lt21p045646; Sun, 6 Jun 2021 21:55:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 156Lt1PH045645; Sun, 6 Jun 2021 21:55:01 GMT (envelope-from git) Date: Sun, 6 Jun 2021 21:55:01 GMT Message-Id: <202106062155.156Lt1PH045645@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 4616a539172f - stable/12 - sqlite3: import sqlite3 3.35.5 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 4616a539172f03a325dc5fdbc6e4d7610297ae9e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jun 2021 21:55:02 -0000 The branch stable/12 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=4616a539172f03a325dc5fdbc6e4d7610297ae9e commit 4616a539172f03a325dc5fdbc6e4d7610297ae9e Author: Cy Schubert AuthorDate: 2021-05-07 01:01:44 +0000 Commit: Cy Schubert CommitDate: 2021-06-06 21:52:01 +0000 sqlite3: import sqlite3 3.35.5 Merge commit '0511e356f5e2106928ee352ee974d1470c860a9a' into new_merge Changes at https://www.sqlite.org/releaselog/3_35_5.html. MFC after: 1 month (cherry picked from commit ce9de47260d4edc963a94140789e4a52642c28e6) --- contrib/sqlite3/Makefile.msc | 3 + contrib/sqlite3/configure | 153 +- contrib/sqlite3/configure.ac | 50 +- contrib/sqlite3/shell.c | 501 +- contrib/sqlite3/sqlite3.c | 11777 ++++++++++++++++++++++--------------- contrib/sqlite3/sqlite3.h | 59 +- contrib/sqlite3/sqlite3rc.h | 2 +- contrib/sqlite3/tea/configure | 18 +- contrib/sqlite3/tea/configure.ac | 2 +- 9 files changed, 7708 insertions(+), 4857 deletions(-) diff --git a/contrib/sqlite3/Makefile.msc b/contrib/sqlite3/Makefile.msc index 746162a00c04..1f177557a25a 100644 --- a/contrib/sqlite3/Makefile.msc +++ b/contrib/sqlite3/Makefile.msc @@ -303,6 +303,9 @@ OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_SESSION=1 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_PREUPDATE_HOOK=1 !ENDIF +# Always enable math functions on Windows +OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_MATH_FUNCTIONS + # Should the rbu extension be enabled? If so, add compilation options # to enable it. # diff --git a/contrib/sqlite3/configure b/contrib/sqlite3/configure index 0eedad3467dd..4a16edbb6e02 100755 --- a/contrib/sqlite3/configure +++ b/contrib/sqlite3/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for sqlite 3.34.1. +# Generated by GNU Autoconf 2.69 for sqlite 3.35.5. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='sqlite' PACKAGE_TARNAME='sqlite' -PACKAGE_VERSION='3.34.1' -PACKAGE_STRING='sqlite 3.34.1' +PACKAGE_VERSION='3.35.5' +PACKAGE_STRING='sqlite 3.35.5' PACKAGE_BUGREPORT='http://www.sqlite.org' PACKAGE_URL='' @@ -772,6 +772,7 @@ enable_editline enable_readline enable_threadsafe enable_dynamic_extensions +enable_math enable_fts4 enable_fts3 enable_fts5 @@ -1341,7 +1342,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures sqlite 3.34.1 to adapt to many kinds of systems. +\`configure' configures sqlite 3.35.5 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1412,7 +1413,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of sqlite 3.34.1:";; + short | recursive ) echo "Configuration of sqlite 3.35.5:";; esac cat <<\_ACEOF @@ -1437,6 +1438,7 @@ Optional Features: --enable-threadsafe build a thread-safe library [default=yes] --enable-dynamic-extensions support loadable extensions [default=yes] + --enable-math SQL math functions [default=yes] --enable-fts4 include fts4 support [default=yes] --enable-fts3 include fts3 support [default=no] --enable-fts5 include fts5 support [default=yes] @@ -1537,7 +1539,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -sqlite configure 3.34.1 +sqlite configure 3.35.5 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1952,7 +1954,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by sqlite $as_me 3.34.1, which was +It was created by sqlite $as_me 3.35.5, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2818,7 +2820,7 @@ fi # Define the identity of the package. PACKAGE='sqlite' - VERSION='3.34.1' + VERSION='3.35.5' cat >>confdefs.h <<_ACEOF @@ -13335,7 +13337,9 @@ else enable_threadsafe=yes fi -if test x"$enable_threadsafe" != "xno"; then +if test x"$enable_threadsafe" == "xno"; then + BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_THREADSAFE=0" +else BUILD_CFLAGS="$BUILD_CFLAGS -D_REENTRANT=1 -DSQLITE_THREADSAFE=1" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing pthread_create" >&5 $as_echo_n "checking for library containing pthread_create... " >&6; } @@ -13528,6 +13532,84 @@ $as_echo_n "checking for whether to support dynamic extensions... " >&6; } $as_echo "$enable_dynamic_extensions" >&6; } #----------------------------------------------------------------------- +#----------------------------------------------------------------------- +# --enable-math +# +# Check whether --enable-math was given. +if test "${enable_math+set}" = set; then : + enableval=$enable_math; +else + enable_math=yes +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking SQL math functions" >&5 +$as_echo_n "checking SQL math functions... " >&6; } +if test x"$enable_math" = "xyes"; then + BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_MATH_FUNCTIONS" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: enabled" >&5 +$as_echo "enabled" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing ceil" >&5 +$as_echo_n "checking for library containing ceil... " >&6; } +if ${ac_cv_search_ceil+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char ceil (); +int +main () +{ +return ceil (); + ; + return 0; +} +_ACEOF +for ac_lib in '' m; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_ceil=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_ceil+:} false; then : + break +fi +done +if ${ac_cv_search_ceil+:} false; then : + +else + ac_cv_search_ceil=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_ceil" >&5 +$as_echo "$ac_cv_search_ceil" >&6; } +ac_res=$ac_cv_search_ceil +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 +$as_echo "disabled" >&6; } +fi +#----------------------------------------------------------------------- + #----------------------------------------------------------------------- # --enable-fts4 # @@ -13538,8 +13620,15 @@ else enable_fts4=yes fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking FTS4 extension" >&5 +$as_echo_n "checking FTS4 extension... " >&6; } if test x"$enable_fts4" = "xyes"; then BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_FTS4" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: enabled" >&5 +$as_echo "enabled" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 +$as_echo "disabled" >&6; } fi #----------------------------------------------------------------------- @@ -13551,8 +13640,15 @@ if test "${enable_fts3+set}" = set; then : enableval=$enable_fts3; fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking FTS3 extension" >&5 +$as_echo_n "checking FTS3 extension... " >&6; } if test x"$enable_fts3" = "xyes" -a x"$enable_fts4" = "xno"; then BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_FTS3" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: enabled" >&5 +$as_echo "enabled" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 +$as_echo "disabled" >&6; } fi #----------------------------------------------------------------------- @@ -13566,7 +13662,11 @@ else enable_fts5=yes fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking FTS5 extension" >&5 +$as_echo_n "checking FTS5 extension... " >&6; } if test x"$enable_fts5" = "xyes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: enabled" >&5 +$as_echo "enabled" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing log" >&5 $as_echo_n "checking for library containing log... " >&6; } if ${ac_cv_search_log+:} false; then : @@ -13624,6 +13724,9 @@ if test "$ac_res" != no; then : fi BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_FTS5" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 +$as_echo "disabled" >&6; } fi #----------------------------------------------------------------------- @@ -13637,8 +13740,15 @@ else enable_json1=yes fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking JSON functions" >&5 +$as_echo_n "checking JSON functions... " >&6; } if test x"$enable_json1" = "xyes"; then BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_JSON1" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: enabled" >&5 +$as_echo "enabled" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 +$as_echo "disabled" >&6; } fi #----------------------------------------------------------------------- @@ -13652,8 +13762,15 @@ else enable_rtree=yes fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking RTREE extension" >&5 +$as_echo_n "checking RTREE extension... " >&6; } if test x"$enable_rtree" = "xyes"; then BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_GEOPOLY" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: enabled" >&5 +$as_echo "enabled" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 +$as_echo "disabled" >&6; } fi #----------------------------------------------------------------------- @@ -13665,8 +13782,15 @@ if test "${enable_session+set}" = set; then : enableval=$enable_session; fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Session extension" >&5 +$as_echo_n "checking Session extension... " >&6; } if test x"$enable_session" = "xyes"; then BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_PREUPDATE_HOOK" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: enabled" >&5 +$as_echo "enabled" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 +$as_echo "disabled" >&6; } fi #----------------------------------------------------------------------- @@ -13678,9 +13802,16 @@ if test "${enable_debug+set}" = set; then : enableval=$enable_debug; fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Build type" >&5 +$as_echo_n "checking Build type... " >&6; } if test x"$enable_debug" = "xyes"; then BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_DEBUG -DSQLITE_ENABLE_SELECTTRACE -DSQLITE_ENABLE_WHERETRACE" CFLAGS="-g -O0" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: debug" >&5 +$as_echo "debug" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: release" >&5 +$as_echo "release" >&6; } fi #----------------------------------------------------------------------- @@ -14438,7 +14569,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by sqlite $as_me 3.34.1, which was +This file was extended by sqlite $as_me 3.35.5, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -14495,7 +14626,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -sqlite config.status 3.34.1 +sqlite config.status 3.35.5 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/contrib/sqlite3/configure.ac b/contrib/sqlite3/configure.ac index 72472467d5b7..166f7019cd5c 100644 --- a/contrib/sqlite3/configure.ac +++ b/contrib/sqlite3/configure.ac @@ -10,7 +10,7 @@ # AC_PREREQ(2.61) -AC_INIT(sqlite, 3.34.1, http://www.sqlite.org) +AC_INIT(sqlite, 3.35.5, http://www.sqlite.org) AC_CONFIG_SRCDIR([sqlite3.c]) AC_CONFIG_AUX_DIR([.]) @@ -87,7 +87,9 @@ AC_SUBST(READLINE_LIBS) AC_ARG_ENABLE(threadsafe, [AS_HELP_STRING( [--enable-threadsafe], [build a thread-safe library [default=yes]])], [], [enable_threadsafe=yes]) -if test x"$enable_threadsafe" != "xno"; then +if test x"$enable_threadsafe" == "xno"; then + BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_THREADSAFE=0" +else BUILD_CFLAGS="$BUILD_CFLAGS -D_REENTRANT=1 -DSQLITE_THREADSAFE=1" AC_SEARCH_LIBS(pthread_create, pthread) AC_SEARCH_LIBS(pthread_mutexattr_init, pthread) @@ -109,14 +111,34 @@ AC_MSG_CHECKING([for whether to support dynamic extensions]) AC_MSG_RESULT($enable_dynamic_extensions) #----------------------------------------------------------------------- +#----------------------------------------------------------------------- +# --enable-math +# +AC_ARG_ENABLE(math, [AS_HELP_STRING( + [--enable-math], [SQL math functions [default=yes]])], + [], [enable_math=yes]) +AC_MSG_CHECKING([SQL math functions]) +if test x"$enable_math" = "xyes"; then + BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_MATH_FUNCTIONS" + AC_MSG_RESULT([enabled]) + AC_SEARCH_LIBS(ceil, m) +else + AC_MSG_RESULT([disabled]) +fi +#----------------------------------------------------------------------- + #----------------------------------------------------------------------- # --enable-fts4 # AC_ARG_ENABLE(fts4, [AS_HELP_STRING( [--enable-fts4], [include fts4 support [default=yes]])], [], [enable_fts4=yes]) +AC_MSG_CHECKING([FTS4 extension]) if test x"$enable_fts4" = "xyes"; then BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_FTS4" + AC_MSG_RESULT([enabled]) +else + AC_MSG_RESULT([disabled]) fi #----------------------------------------------------------------------- @@ -126,8 +148,12 @@ fi AC_ARG_ENABLE(fts3, [AS_HELP_STRING( [--enable-fts3], [include fts3 support [default=no]])], [], []) +AC_MSG_CHECKING([FTS3 extension]) if test x"$enable_fts3" = "xyes" -a x"$enable_fts4" = "xno"; then BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_FTS3" + AC_MSG_RESULT([enabled]) +else + AC_MSG_RESULT([disabled]) fi #----------------------------------------------------------------------- @@ -137,9 +163,13 @@ fi AC_ARG_ENABLE(fts5, [AS_HELP_STRING( [--enable-fts5], [include fts5 support [default=yes]])], [], [enable_fts5=yes]) +AC_MSG_CHECKING([FTS5 extension]) if test x"$enable_fts5" = "xyes"; then + AC_MSG_RESULT([enabled]) AC_SEARCH_LIBS(log, m) BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_FTS5" +else + AC_MSG_RESULT([disabled]) fi #----------------------------------------------------------------------- @@ -149,8 +179,12 @@ fi AC_ARG_ENABLE(json1, [AS_HELP_STRING( [--enable-json1], [include json1 support [default=yes]])], [],[enable_json1=yes]) +AC_MSG_CHECKING([JSON functions]) if test x"$enable_json1" = "xyes"; then BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_JSON1" + AC_MSG_RESULT([enabled]) +else + AC_MSG_RESULT([disabled]) fi #----------------------------------------------------------------------- @@ -160,8 +194,12 @@ fi AC_ARG_ENABLE(rtree, [AS_HELP_STRING( [--enable-rtree], [include rtree support [default=yes]])], [], [enable_rtree=yes]) +AC_MSG_CHECKING([RTREE extension]) if test x"$enable_rtree" = "xyes"; then BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_GEOPOLY" + AC_MSG_RESULT([enabled]) +else + AC_MSG_RESULT([disabled]) fi #----------------------------------------------------------------------- @@ -171,8 +209,12 @@ fi AC_ARG_ENABLE(session, [AS_HELP_STRING( [--enable-session], [enable the session extension [default=no]])], [], []) +AC_MSG_CHECKING([Session extension]) if test x"$enable_session" = "xyes"; then BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_PREUPDATE_HOOK" + AC_MSG_RESULT([enabled]) +else + AC_MSG_RESULT([disabled]) fi #----------------------------------------------------------------------- @@ -182,9 +224,13 @@ fi AC_ARG_ENABLE(debug, [AS_HELP_STRING( [--enable-debug], [build with debugging features enabled [default=no]])], [], []) +AC_MSG_CHECKING([Build type]) if test x"$enable_debug" = "xyes"; then BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_DEBUG -DSQLITE_ENABLE_SELECTTRACE -DSQLITE_ENABLE_WHERETRACE" CFLAGS="-g -O0" + AC_MSG_RESULT([debug]) +else + AC_MSG_RESULT([release]) fi #----------------------------------------------------------------------- diff --git a/contrib/sqlite3/shell.c b/contrib/sqlite3/shell.c index 6f4fee80dc1c..27de22a3819b 100644 --- a/contrib/sqlite3/shell.c +++ b/contrib/sqlite3/shell.c @@ -1424,7 +1424,10 @@ SQLITE_EXTENSION_INIT1 #include #include #include + +#ifndef SQLITE_AMALGAMATION /* typedef sqlite3_uint64 u64; */ +#endif /* SQLITE_AMALGAMATION */ /****************************************************************************** ** The Hash Engine @@ -3637,24 +3640,23 @@ int sqlite3_completion_init( ** appended onto the end of some other file, such as an executable. ** ** A special record must appear at the end of the file that identifies the -** file as an appended database and provides an offset to page 1. For -** best performance page 1 should be located at a disk page boundary, though -** that is not required. +** file as an appended database and provides the offset to the first page +** of the exposed content. (Or, it is the length of the content prefix.) +** For best performance page 1 should be located at a disk page boundary, +** though that is not required. ** ** When opening a database using this VFS, the connection might treat -** the file as an ordinary SQLite database, or it might treat is as a -** database appended onto some other file. Here are the rules: +** the file as an ordinary SQLite database, or it might treat it as a +** database appended onto some other file. The decision is made by +** applying the following rules in order: ** -** (1) When opening a new empty file, that file is treated as an ordinary -** database. +** (1) An empty file is an ordinary database. ** -** (2) When opening a file that begins with the standard SQLite prefix -** string "SQLite format 3", that file is treated as an ordinary -** database. +** (2) If the file ends with the appendvfs trailer string +** "Start-Of-SQLite3-NNNNNNNN" that file is an appended database. ** -** (3) When opening a file that ends with the appendvfs trailer string -** "Start-Of-SQLite3-NNNNNNNN" that file is treated as an appended -** database. +** (3) If the file begins with the standard SQLite prefix string +** "SQLite format 3", that file is an ordinary database. ** ** (4) If none of the above apply and the SQLITE_OPEN_CREATE flag is ** set, then a new database is appended to the already existing file. @@ -3662,13 +3664,13 @@ int sqlite3_completion_init( ** (5) Otherwise, SQLITE_CANTOPEN is returned. ** ** To avoid unnecessary complications with the PENDING_BYTE, the size of -** the file containing the database is limited to 1GB. This VFS will refuse -** to read or write past the 1GB mark. This restriction might be lifted in -** future versions. For now, if you need a large database, then keep the -** database in a separate file. +** the file containing the database is limited to 1GiB. (1073741824 bytes) +** This VFS will not read or write past the 1GiB mark. This restriction +** might be lifted in future versions. For now, if you need a larger +** database, then keep it in a separate file. ** -** If the file being opened is not an appended database, then this shim is -** a pass-through into the default underlying VFS. +** If the file being opened is a plain database (not an appended one), then +** this shim is a pass-through into the default underlying VFS. (rule 3) **/ /* #include "sqlite3ext.h" */ SQLITE_EXTENSION_INIT1 @@ -3681,17 +3683,27 @@ SQLITE_EXTENSION_INIT1 ** 123456789 123456789 12345 ** ** The NNNNNNNN represents a 64-bit big-endian unsigned integer which is -** the offset to page 1. +** the offset to page 1, and also the length of the prefix content. */ #define APND_MARK_PREFIX "Start-Of-SQLite3-" #define APND_MARK_PREFIX_SZ 17 -#define APND_MARK_SIZE 25 +#define APND_MARK_FOS_SZ 8 +#define APND_MARK_SIZE (APND_MARK_PREFIX_SZ+APND_MARK_FOS_SZ) /* ** Maximum size of the combined prefix + database + append-mark. This ** must be less than 0x40000000 to avoid locking issues on Windows. */ -#define APND_MAX_SIZE (65536*15259) +#define APND_MAX_SIZE (0x40000000) + +/* +** Try to align the database to an even multiple of APND_ROUNDUP bytes. +*/ +#ifndef APND_ROUNDUP +#define APND_ROUNDUP 4096 +#endif +#define APND_ALIGN_MASK ((sqlite3_int64)(APND_ROUNDUP-1)) +#define APND_START_ROUNDUP(fsz) (((fsz)+APND_ALIGN_MASK) & ~APND_ALIGN_MASK) /* ** Forward declaration of objects used by this utility @@ -3705,11 +3717,45 @@ typedef struct ApndFile ApndFile; #define ORIGVFS(p) ((sqlite3_vfs*)((p)->pAppData)) #define ORIGFILE(p) ((sqlite3_file*)(((ApndFile*)(p))+1)) -/* An open file */ +/* An open appendvfs file +** +** An instance of this structure describes the appended database file. +** A separate sqlite3_file object is always appended. The appended +** sqlite3_file object (which can be accessed using ORIGFILE()) describes +** the entire file, including the prefix, the database, and the +** append-mark. +** +** The structure of an AppendVFS database is like this: +** +** +-------------+---------+----------+-------------+ +** | prefix-file | padding | database | append-mark | +** +-------------+---------+----------+-------------+ +** ^ ^ +** | | +** iPgOne iMark +** +** +** "prefix file" - file onto which the database has been appended. +** "padding" - zero or more bytes inserted so that "database" +** starts on an APND_ROUNDUP boundary +** "database" - The SQLite database file +** "append-mark" - The 25-byte "Start-Of-SQLite3-NNNNNNNN" that indicates +** the offset from the start of prefix-file to the start +** of "database". +** +** The size of the database is iMark - iPgOne. +** +** The NNNNNNNN in the "Start-Of-SQLite3-NNNNNNNN" suffix is the value +** of iPgOne stored as a big-ending 64-bit integer. +** +** iMark will be the size of the underlying file minus 25 (APND_MARKSIZE). +** Or, iMark is -1 to indicate that it has not yet been written. +*/ struct ApndFile { - sqlite3_file base; /* IO methods */ - sqlite3_int64 iPgOne; /* File offset to page 1 */ - sqlite3_int64 iMark; /* Start of the append-mark */ + sqlite3_file base; /* Subclass. MUST BE FIRST! */ + sqlite3_int64 iPgOne; /* Offset to the start of the database */ + sqlite3_int64 iMark; /* Offset of the append mark. -1 if unwritten */ + /* Always followed by another sqlite3_file that describes the whole file */ }; /* @@ -3801,8 +3847,6 @@ static const sqlite3_io_methods apnd_io_methods = { apndUnfetch /* xUnfetch */ }; - - /* ** Close an apnd-file. */ @@ -3820,22 +3864,37 @@ static int apndRead( int iAmt, sqlite_int64 iOfst ){ - ApndFile *p = (ApndFile *)pFile; + ApndFile *paf = (ApndFile *)pFile; pFile = ORIGFILE(pFile); - return pFile->pMethods->xRead(pFile, zBuf, iAmt, iOfst+p->iPgOne); + return pFile->pMethods->xRead(pFile, zBuf, iAmt, paf->iPgOne+iOfst); } /* -** Add the append-mark onto the end of the file. +** Add the append-mark onto what should become the end of the file. +* If and only if this succeeds, internal ApndFile.iMark is updated. +* Parameter iWriteEnd is the appendvfs-relative offset of the new mark. */ -static int apndWriteMark(ApndFile *p, sqlite3_file *pFile){ - int i; +static int apndWriteMark( + ApndFile *paf, + sqlite3_file *pFile, + sqlite_int64 iWriteEnd +){ + sqlite_int64 iPgOne = paf->iPgOne; unsigned char a[APND_MARK_SIZE]; + int i = APND_MARK_FOS_SZ; + int rc; + assert(pFile == ORIGFILE(paf)); memcpy(a, APND_MARK_PREFIX, APND_MARK_PREFIX_SZ); - for(i=0; i<8; i++){ - a[APND_MARK_PREFIX_SZ+i] = (p->iPgOne >> (56 - i*8)) & 0xff; + while( --i >= 0 ){ + a[APND_MARK_PREFIX_SZ+i] = (unsigned char)(iPgOne & 0xff); + iPgOne >>= 8; + } + iWriteEnd += paf->iPgOne; + if( SQLITE_OK==(rc = pFile->pMethods->xWrite + (pFile, a, APND_MARK_SIZE, iWriteEnd)) ){ + paf->iMark = iWriteEnd; } - return pFile->pMethods->xWrite(pFile, a, APND_MARK_SIZE, p->iMark); + return rc; } /* @@ -3847,38 +3906,28 @@ static int apndWrite( int iAmt, sqlite_int64 iOfst ){ - int rc; - ApndFile *p = (ApndFile *)pFile; + ApndFile *paf = (ApndFile *)pFile; + sqlite_int64 iWriteEnd = iOfst + iAmt; + if( iWriteEnd>=APND_MAX_SIZE ) return SQLITE_FULL; pFile = ORIGFILE(pFile); - if( iOfst+iAmt>=APND_MAX_SIZE ) return SQLITE_FULL; - rc = pFile->pMethods->xWrite(pFile, zBuf, iAmt, iOfst+p->iPgOne); - if( rc==SQLITE_OK && iOfst + iAmt + p->iPgOne > p->iMark ){ - sqlite3_int64 sz = 0; - rc = pFile->pMethods->xFileSize(pFile, &sz); - if( rc==SQLITE_OK ){ - p->iMark = sz - APND_MARK_SIZE; - if( iOfst + iAmt + p->iPgOne > p->iMark ){ - p->iMark = p->iPgOne + iOfst + iAmt; - rc = apndWriteMark(p, pFile); - } - } + /* If append-mark is absent or will be overwritten, write it. */ + if( paf->iMark < 0 || paf->iPgOne + iWriteEnd > paf->iMark ){ + int rc = apndWriteMark(paf, pFile, iWriteEnd); + if( SQLITE_OK!=rc ) return rc; } - return rc; + return pFile->pMethods->xWrite(pFile, zBuf, iAmt, paf->iPgOne+iOfst); } /* ** Truncate an apnd-file. */ static int apndTruncate(sqlite3_file *pFile, sqlite_int64 size){ - int rc; - ApndFile *p = (ApndFile *)pFile; + ApndFile *paf = (ApndFile *)pFile; pFile = ORIGFILE(pFile); - rc = pFile->pMethods->xTruncate(pFile, size+p->iPgOne+APND_MARK_SIZE); - if( rc==SQLITE_OK ){ - p->iMark = p->iPgOne+size; - rc = apndWriteMark(p, pFile); - } - return rc; + /* The append mark goes out first so truncate failure does not lose it. */ + if( SQLITE_OK!=apndWriteMark(paf, pFile, size) ) return SQLITE_IOERR; + /* Truncate underlying file just past append mark */ + return pFile->pMethods->xTruncate(pFile, paf->iMark+APND_MARK_SIZE); } /* @@ -3891,16 +3940,12 @@ static int apndSync(sqlite3_file *pFile, int flags){ /* ** Return the current file-size of an apnd-file. +** If the append mark is not yet there, the file-size is 0. */ static int apndFileSize(sqlite3_file *pFile, sqlite_int64 *pSize){ - ApndFile *p = (ApndFile *)pFile; - int rc; - pFile = ORIGFILE(p); - rc = pFile->pMethods->xFileSize(pFile, pSize); - if( rc==SQLITE_OK && p->iPgOne ){ - *pSize -= p->iPgOne + APND_MARK_SIZE; - } - return rc; + ApndFile *paf = (ApndFile *)pFile; + *pSize = ( paf->iMark >= 0 )? (paf->iMark - paf->iPgOne) : 0; + return SQLITE_OK; } /* @@ -3931,12 +3976,13 @@ static int apndCheckReservedLock(sqlite3_file *pFile, int *pResOut){ ** File control method. For custom operations on an apnd-file. */ static int apndFileControl(sqlite3_file *pFile, int op, void *pArg){ - ApndFile *p = (ApndFile *)pFile; + ApndFile *paf = (ApndFile *)pFile; int rc; pFile = ORIGFILE(pFile); + if( op==SQLITE_FCNTL_SIZE_HINT ) *(sqlite3_int64*)pArg += paf->iPgOne; rc = pFile->pMethods->xFileControl(pFile, op, pArg); if( rc==SQLITE_OK && op==SQLITE_FCNTL_VFSNAME ){ - *(char**)pArg = sqlite3_mprintf("apnd(%lld)/%z", p->iPgOne, *(char**)pArg); + *(char**)pArg = sqlite3_mprintf("apnd(%lld)/%z", paf->iPgOne,*(char**)pArg); } return rc; } @@ -3995,6 +4041,9 @@ static int apndFetch( void **pp ){ ApndFile *p = (ApndFile *)pFile; + if( p->iMark < 0 || iOfst+iAmt > p->iMark ){ + return SQLITE_IOERR; /* Cannot read what is not yet there. */ + } pFile = ORIGFILE(pFile); return pFile->pMethods->xFetch(pFile, iOfst+p->iPgOne, iAmt, pp); } @@ -4006,95 +4055,153 @@ static int apndUnfetch(sqlite3_file *pFile, sqlite3_int64 iOfst, void *pPage){ return pFile->pMethods->xUnfetch(pFile, iOfst+p->iPgOne, pPage); } -/* -** Check to see if the file is an ordinary SQLite database file. -*/ -static int apndIsOrdinaryDatabaseFile(sqlite3_int64 sz, sqlite3_file *pFile){ - int rc; - char zHdr[16]; - static const char aSqliteHdr[] = "SQLite format 3"; - if( sz<512 ) return 0; - rc = pFile->pMethods->xRead(pFile, zHdr, sizeof(zHdr), 0); - if( rc ) return 0; - return memcmp(zHdr, aSqliteHdr, sizeof(zHdr))==0; -} - /* ** Try to read the append-mark off the end of a file. Return the -** start of the appended database if the append-mark is present. If -** there is no append-mark, return -1; +** start of the appended database if the append-mark is present. +** If there is no valid append-mark, return -1; +** +** An append-mark is only valid if the NNNNNNNN start-of-database offset +** indicates that the appended database contains at least one page. The +** start-of-database value must be a multiple of 512. */ static sqlite3_int64 apndReadMark(sqlite3_int64 sz, sqlite3_file *pFile){ int rc, i; sqlite3_int64 iMark; + int msbs = 8 * (APND_MARK_FOS_SZ-1); unsigned char a[APND_MARK_SIZE]; - if( sz<=APND_MARK_SIZE ) return -1; + if( APND_MARK_SIZE!=(sz & 0x1ff) ) return -1; rc = pFile->pMethods->xRead(pFile, a, APND_MARK_SIZE, sz-APND_MARK_SIZE); if( rc ) return -1; if( memcmp(a, APND_MARK_PREFIX, APND_MARK_PREFIX_SZ)!=0 ) return -1; - iMark = ((sqlite3_int64)(a[APND_MARK_PREFIX_SZ]&0x7f))<<56; - for(i=1; i<8; i++){ - iMark += (sqlite3_int64)a[APND_MARK_PREFIX_SZ+i]<<(56-8*i); + iMark = ((sqlite3_int64)(a[APND_MARK_PREFIX_SZ] & 0x7f)) << msbs; + for(i=1; i<8; i++){ + msbs -= 8; + iMark |= (sqlite3_int64)a[APND_MARK_PREFIX_SZ+i]< (sz - APND_MARK_SIZE - 512) ) return -1; + if( iMark & 0x1ff ) return -1; return iMark; } +static const char apvfsSqliteHdr[] = "SQLite format 3"; +/* +** Check to see if the file is an appendvfs SQLite database file. +** Return true iff it is such. Parameter sz is the file's size. +*/ +static int apndIsAppendvfsDatabase(sqlite3_int64 sz, sqlite3_file *pFile){ + int rc; + char zHdr[16]; + sqlite3_int64 iMark = apndReadMark(sz, pFile); + if( iMark>=0 ){ + /* If file has the correct end-marker, the expected odd size, and the + ** SQLite DB type marker where the end-marker puts it, then it + ** is an appendvfs database. + */ + rc = pFile->pMethods->xRead(pFile, zHdr, sizeof(zHdr), iMark); + if( SQLITE_OK==rc + && memcmp(zHdr, apvfsSqliteHdr, sizeof(zHdr))==0 + && (sz & 0x1ff) == APND_MARK_SIZE + && sz>=512+APND_MARK_SIZE + ){ + return 1; /* It's an appendvfs database */ + } + } + return 0; +} + +/* +** Check to see if the file is an ordinary SQLite database file. +** Return true iff so. Parameter sz is the file's size. +*/ +static int apndIsOrdinaryDatabaseFile(sqlite3_int64 sz, sqlite3_file *pFile){ + char zHdr[16]; + if( apndIsAppendvfsDatabase(sz, pFile) /* rule 2 */ + || (sz & 0x1ff) != 0 + || SQLITE_OK!=pFile->pMethods->xRead(pFile, zHdr, sizeof(zHdr), 0) + || memcmp(zHdr, apvfsSqliteHdr, sizeof(zHdr))!=0 + ){ + return 0; + }else{ + return 1; + } +} + /* ** Open an apnd file handle. */ static int apndOpen( - sqlite3_vfs *pVfs, + sqlite3_vfs *pApndVfs, const char *zName, sqlite3_file *pFile, int flags, int *pOutFlags ){ - ApndFile *p; - sqlite3_file *pSubFile; - sqlite3_vfs *pSubVfs; + ApndFile *pApndFile = (ApndFile*)pFile; + sqlite3_file *pBaseFile = ORIGFILE(pFile); + sqlite3_vfs *pBaseVfs = ORIGVFS(pApndVfs); int rc; - sqlite3_int64 sz; - pSubVfs = ORIGVFS(pVfs); + sqlite3_int64 sz = 0; if( (flags & SQLITE_OPEN_MAIN_DB)==0 ){ - return pSubVfs->xOpen(pSubVfs, zName, pFile, flags, pOutFlags); + /* The appendvfs is not to be used for transient or temporary databases. + ** Just use the base VFS open to initialize the given file object and + ** open the underlying file. (Appendvfs is then unused for this file.) + */ + return pBaseVfs->xOpen(pBaseVfs, zName, pFile, flags, pOutFlags); } - p = (ApndFile*)pFile; - memset(p, 0, sizeof(*p)); - pSubFile = ORIGFILE(pFile); + memset(pApndFile, 0, sizeof(ApndFile)); pFile->pMethods = &apnd_io_methods; - rc = pSubVfs->xOpen(pSubVfs, zName, pSubFile, flags, pOutFlags); - if( rc ) goto apnd_open_done; - rc = pSubFile->pMethods->xFileSize(pSubFile, &sz); + pApndFile->iMark = -1; /* Append mark not yet written */ + + rc = pBaseVfs->xOpen(pBaseVfs, zName, pBaseFile, flags, pOutFlags); + if( rc==SQLITE_OK ){ + rc = pBaseFile->pMethods->xFileSize(pBaseFile, &sz); + } if( rc ){ - pSubFile->pMethods->xClose(pSubFile); - goto apnd_open_done; + pBaseFile->pMethods->xClose(pBaseFile); + pFile->pMethods = 0; + return rc; } - if( apndIsOrdinaryDatabaseFile(sz, pSubFile) ){ - memmove(pFile, pSubFile, pSubVfs->szOsFile); + if( apndIsOrdinaryDatabaseFile(sz, pBaseFile) ){ + /* The file being opened appears to be just an ordinary DB. Copy + ** the base dispatch-table so this instance mimics the base VFS. + */ + memmove(pApndFile, pBaseFile, pBaseVfs->szOsFile); return SQLITE_OK; } - p->iMark = 0; - p->iPgOne = apndReadMark(sz, pFile); - if( p->iPgOne>0 ){ + pApndFile->iPgOne = apndReadMark(sz, pFile); + if( pApndFile->iPgOne>=0 ){ + pApndFile->iMark = sz - APND_MARK_SIZE; /* Append mark found */ return SQLITE_OK; } if( (flags & SQLITE_OPEN_CREATE)==0 ){ - pSubFile->pMethods->xClose(pSubFile); + pBaseFile->pMethods->xClose(pBaseFile); rc = SQLITE_CANTOPEN; + pFile->pMethods = 0; + }else{ + /* Round newly added appendvfs location to #define'd page boundary. + ** Note that nothing has yet been written to the underlying file. + ** The append mark will be written along with first content write. + ** Until then, paf->iMark value indicates it is not yet written. + */ + pApndFile->iPgOne = APND_START_ROUNDUP(sz); } - p->iPgOne = (sz+0xfff) & ~(sqlite3_int64)0xfff; -apnd_open_done: - if( rc ) pFile->pMethods = 0; return rc; *** 17973 LINES SKIPPED *** From owner-dev-commits-src-branches@freebsd.org Sun Jun 6 21:55:31 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 043FD63FC91; Sun, 6 Jun 2021 21:55: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 4Fyr0L6kr1z4cyj; Sun, 6 Jun 2021 21:55:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CFF402D3E; Sun, 6 Jun 2021 21:55:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 156LtUHX045797; Sun, 6 Jun 2021 21:55:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 156LtUGs045796; Sun, 6 Jun 2021 21:55:30 GMT (envelope-from git) Date: Sun, 6 Jun 2021 21:55:30 GMT Message-Id: <202106062155.156LtUGs045796@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: dad031410fa7 - stable/11 - Import sqlite 3.34.1 (3340100). MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/11 X-Git-Reftype: branch X-Git-Commit: dad031410fa7144120627416491ace77a424879f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jun 2021 21:55:31 -0000 The branch stable/11 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=dad031410fa7144120627416491ace77a424879f commit dad031410fa7144120627416491ace77a424879f Author: Cy Schubert AuthorDate: 2021-01-25 17:45:04 +0000 Commit: Cy Schubert CommitDate: 2021-06-06 01:05:29 +0000 Import sqlite 3.34.1 (3340100). (cherry picked from commit 25cdacf79b06356c929e59d5074d26c9dac41bdf) --- contrib/sqlite3/configure | 20 +- contrib/sqlite3/configure.ac | 2 +- contrib/sqlite3/ltmain.sh | 0 contrib/sqlite3/shell.c | 700 ++++++++- contrib/sqlite3/sqlite3.c | 2683 +++++++++++++++++++++++++---------- contrib/sqlite3/sqlite3.h | 81 +- contrib/sqlite3/sqlite3ext.h | 4 + contrib/sqlite3/sqlite3rc.h | 2 +- contrib/sqlite3/tea/configure | 18 +- contrib/sqlite3/tea/configure.ac | 2 +- contrib/sqlite3/tea/win/makefile.vc | 2 +- 11 files changed, 2685 insertions(+), 829 deletions(-) diff --git a/contrib/sqlite3/configure b/contrib/sqlite3/configure index 9aed16a74091..0eedad3467dd 100755 --- a/contrib/sqlite3/configure +++ b/contrib/sqlite3/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for sqlite 3.33.0. +# Generated by GNU Autoconf 2.69 for sqlite 3.34.1. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='sqlite' PACKAGE_TARNAME='sqlite' -PACKAGE_VERSION='3.33.0' -PACKAGE_STRING='sqlite 3.33.0' +PACKAGE_VERSION='3.34.1' +PACKAGE_STRING='sqlite 3.34.1' PACKAGE_BUGREPORT='http://www.sqlite.org' PACKAGE_URL='' @@ -1341,7 +1341,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures sqlite 3.33.0 to adapt to many kinds of systems. +\`configure' configures sqlite 3.34.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1412,7 +1412,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of sqlite 3.33.0:";; + short | recursive ) echo "Configuration of sqlite 3.34.1:";; esac cat <<\_ACEOF @@ -1537,7 +1537,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -sqlite configure 3.33.0 +sqlite configure 3.34.1 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1952,7 +1952,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by sqlite $as_me 3.33.0, which was +It was created by sqlite $as_me 3.34.1, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2818,7 +2818,7 @@ fi # Define the identity of the package. PACKAGE='sqlite' - VERSION='3.33.0' + VERSION='3.34.1' cat >>confdefs.h <<_ACEOF @@ -14438,7 +14438,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by sqlite $as_me 3.33.0, which was +This file was extended by sqlite $as_me 3.34.1, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -14495,7 +14495,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -sqlite config.status 3.33.0 +sqlite config.status 3.34.1 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/contrib/sqlite3/configure.ac b/contrib/sqlite3/configure.ac index a83dac3ac142..72472467d5b7 100644 --- a/contrib/sqlite3/configure.ac +++ b/contrib/sqlite3/configure.ac @@ -10,7 +10,7 @@ # AC_PREREQ(2.61) -AC_INIT(sqlite, 3.33.0, http://www.sqlite.org) +AC_INIT(sqlite, 3.34.1, http://www.sqlite.org) AC_CONFIG_SRCDIR([sqlite3.c]) AC_CONFIG_AUX_DIR([.]) diff --git a/contrib/sqlite3/ltmain.sh b/contrib/sqlite3/ltmain.sh old mode 100755 new mode 100644 diff --git a/contrib/sqlite3/shell.c b/contrib/sqlite3/shell.c index a1a77e49fa5f..6f4fee80dc1c 100644 --- a/contrib/sqlite3/shell.c +++ b/contrib/sqlite3/shell.c @@ -571,8 +571,6 @@ static void utf8_width_print(FILE *pOut, int w, const char *zUtf){ int i; int n; int aw = w<0 ? -w : w; - char zBuf[1000]; - if( aw>(int)sizeof(zBuf)/3 ) aw = (int)sizeof(zBuf)/3; for(i=n=0; zUtf[i]; i++){ if( (zUtf[i]&0xc0)!=0x80 ){ n++; @@ -2016,9 +2014,11 @@ static void sha3QueryFunc( } nCol = sqlite3_column_count(pStmt); z = sqlite3_sql(pStmt); - n = (int)strlen(z); - hash_step_vformat(&cx,"S%d:",n); - SHA3Update(&cx,(unsigned char*)z,n); + if( z ){ + n = (int)strlen(z); + hash_step_vformat(&cx,"S%d:",n); + SHA3Update(&cx,(unsigned char*)z,n); + } /* Compute a hash over the result of the query */ while( SQLITE_ROW==sqlite3_step(pStmt) ){ @@ -5315,6 +5315,444 @@ int sqlite3_ieee_init( } /************************* End ../ext/misc/ieee754.c ********************/ +/************************* Begin ../ext/misc/series.c ******************/ +/* +** 2015-08-18 +** +** The author disclaims copyright to this source code. In place of +** a legal notice, here is a blessing: +** +** May you do good and not evil. +** May you find forgiveness for yourself and forgive others. +** May you share freely, never taking more than you give. +** +************************************************************************* +** +** This file demonstrates how to create a table-valued-function using +** a virtual table. This demo implements the generate_series() function +** which gives similar results to the eponymous function in PostgreSQL. +** Examples: +** +** SELECT * FROM generate_series(0,100,5); +** +** The query above returns integers from 0 through 100 counting by steps +** of 5. +** +** SELECT * FROM generate_series(0,100); +** +** Integers from 0 through 100 with a step size of 1. +** +** SELECT * FROM generate_series(20) LIMIT 10; +** +** Integers 20 through 29. +** +** HOW IT WORKS +** +** The generate_series "function" is really a virtual table with the +** following schema: +** +** CREATE TABLE generate_series( +** value, +** start HIDDEN, +** stop HIDDEN, +** step HIDDEN +** ); +** +** Function arguments in queries against this virtual table are translated +** into equality constraints against successive hidden columns. In other +** words, the following pairs of queries are equivalent to each other: +** +** SELECT * FROM generate_series(0,100,5); +** SELECT * FROM generate_series WHERE start=0 AND stop=100 AND step=5; +** +** SELECT * FROM generate_series(0,100); +** SELECT * FROM generate_series WHERE start=0 AND stop=100; +** +** SELECT * FROM generate_series(20) LIMIT 10; +** SELECT * FROM generate_series WHERE start=20 LIMIT 10; +** +** The generate_series virtual table implementation leaves the xCreate method +** set to NULL. This means that it is not possible to do a CREATE VIRTUAL +** TABLE command with "generate_series" as the USING argument. Instead, there +** is a single generate_series virtual table that is always available without +** having to be created first. +** +** The xBestIndex method looks for equality constraints against the hidden +** start, stop, and step columns, and if present, it uses those constraints +** to bound the sequence of generated values. If the equality constraints +** are missing, it uses 0 for start, 4294967295 for stop, and 1 for step. +** xBestIndex returns a small cost when both start and stop are available, +** and a very large cost if either start or stop are unavailable. This +** encourages the query planner to order joins such that the bounds of the +** series are well-defined. +*/ +/* #include "sqlite3ext.h" */ +SQLITE_EXTENSION_INIT1 +#include +#include + +#ifndef SQLITE_OMIT_VIRTUALTABLE + + +/* series_cursor is a subclass of sqlite3_vtab_cursor which will +** serve as the underlying representation of a cursor that scans +** over rows of the result +*/ +typedef struct series_cursor series_cursor; +struct series_cursor { + sqlite3_vtab_cursor base; /* Base class - must be first */ + int isDesc; /* True to count down rather than up */ + sqlite3_int64 iRowid; /* The rowid */ + sqlite3_int64 iValue; /* Current value ("value") */ + sqlite3_int64 mnValue; /* Mimimum value ("start") */ + sqlite3_int64 mxValue; /* Maximum value ("stop") */ + sqlite3_int64 iStep; /* Increment ("step") */ +}; + +/* +** The seriesConnect() method is invoked to create a new +** series_vtab that describes the generate_series virtual table. +** +** Think of this routine as the constructor for series_vtab objects. +** +** All this routine needs to do is: +** +** (1) Allocate the series_vtab object and initialize all fields. +** +** (2) Tell SQLite (via the sqlite3_declare_vtab() interface) what the +** result set of queries against generate_series will look like. +*/ +static int seriesConnect( + sqlite3 *db, + void *pUnused, + int argcUnused, const char *const*argvUnused, + sqlite3_vtab **ppVtab, + char **pzErrUnused +){ + sqlite3_vtab *pNew; + int rc; + +/* Column numbers */ +#define SERIES_COLUMN_VALUE 0 +#define SERIES_COLUMN_START 1 +#define SERIES_COLUMN_STOP 2 +#define SERIES_COLUMN_STEP 3 + + (void)pUnused; + (void)argcUnused; + (void)argvUnused; + (void)pzErrUnused; + rc = sqlite3_declare_vtab(db, + "CREATE TABLE x(value,start hidden,stop hidden,step hidden)"); + if( rc==SQLITE_OK ){ + pNew = *ppVtab = sqlite3_malloc( sizeof(*pNew) ); + if( pNew==0 ) return SQLITE_NOMEM; + memset(pNew, 0, sizeof(*pNew)); + sqlite3_vtab_config(db, SQLITE_VTAB_INNOCUOUS); + } + return rc; +} + +/* +** This method is the destructor for series_cursor objects. +*/ +static int seriesDisconnect(sqlite3_vtab *pVtab){ + sqlite3_free(pVtab); + return SQLITE_OK; +} + +/* +** Constructor for a new series_cursor object. +*/ +static int seriesOpen(sqlite3_vtab *pUnused, sqlite3_vtab_cursor **ppCursor){ + series_cursor *pCur; + (void)pUnused; + pCur = sqlite3_malloc( sizeof(*pCur) ); + if( pCur==0 ) return SQLITE_NOMEM; + memset(pCur, 0, sizeof(*pCur)); + *ppCursor = &pCur->base; + return SQLITE_OK; +} + +/* +** Destructor for a series_cursor. +*/ +static int seriesClose(sqlite3_vtab_cursor *cur){ + sqlite3_free(cur); + return SQLITE_OK; +} + + +/* +** Advance a series_cursor to its next row of output. +*/ +static int seriesNext(sqlite3_vtab_cursor *cur){ + series_cursor *pCur = (series_cursor*)cur; + if( pCur->isDesc ){ + pCur->iValue -= pCur->iStep; + }else{ + pCur->iValue += pCur->iStep; + } + pCur->iRowid++; + return SQLITE_OK; +} + +/* +** Return values of columns for the row at which the series_cursor +** is currently pointing. +*/ +static int seriesColumn( + sqlite3_vtab_cursor *cur, /* The cursor */ + sqlite3_context *ctx, /* First argument to sqlite3_result_...() */ + int i /* Which column to return */ +){ + series_cursor *pCur = (series_cursor*)cur; + sqlite3_int64 x = 0; + switch( i ){ + case SERIES_COLUMN_START: x = pCur->mnValue; break; + case SERIES_COLUMN_STOP: x = pCur->mxValue; break; + case SERIES_COLUMN_STEP: x = pCur->iStep; break; + default: x = pCur->iValue; break; + } + sqlite3_result_int64(ctx, x); + return SQLITE_OK; +} + +/* +** Return the rowid for the current row. In this implementation, the +** first row returned is assigned rowid value 1, and each subsequent +** row a value 1 more than that of the previous. +*/ +static int seriesRowid(sqlite3_vtab_cursor *cur, sqlite_int64 *pRowid){ + series_cursor *pCur = (series_cursor*)cur; + *pRowid = pCur->iRowid; + return SQLITE_OK; +} + +/* +** Return TRUE if the cursor has been moved off of the last +** row of output. +*/ +static int seriesEof(sqlite3_vtab_cursor *cur){ + series_cursor *pCur = (series_cursor*)cur; + if( pCur->isDesc ){ + return pCur->iValue < pCur->mnValue; + }else{ + return pCur->iValue > pCur->mxValue; + } +} + +/* True to cause run-time checking of the start=, stop=, and/or step= +** parameters. The only reason to do this is for testing the +** constraint checking logic for virtual tables in the SQLite core. +*/ +#ifndef SQLITE_SERIES_CONSTRAINT_VERIFY +# define SQLITE_SERIES_CONSTRAINT_VERIFY 0 +#endif + +/* +** This method is called to "rewind" the series_cursor object back +** to the first row of output. This method is always called at least +** once prior to any call to seriesColumn() or seriesRowid() or +** seriesEof(). +** +** The query plan selected by seriesBestIndex is passed in the idxNum +** parameter. (idxStr is not used in this implementation.) idxNum +** is a bitmask showing which constraints are available: +** +** 1: start=VALUE +** 2: stop=VALUE +** 4: step=VALUE +** +** Also, if bit 8 is set, that means that the series should be output +** in descending order rather than in ascending order. +** +** This routine should initialize the cursor and position it so that it +** is pointing at the first row, or pointing off the end of the table +** (so that seriesEof() will return true) if the table is empty. +*/ +static int seriesFilter( + sqlite3_vtab_cursor *pVtabCursor, + int idxNum, const char *idxStrUnused, + int argc, sqlite3_value **argv +){ + series_cursor *pCur = (series_cursor *)pVtabCursor; + int i = 0; + (void)idxStrUnused; + if( idxNum & 1 ){ + pCur->mnValue = sqlite3_value_int64(argv[i++]); + }else{ + pCur->mnValue = 0; + } + if( idxNum & 2 ){ + pCur->mxValue = sqlite3_value_int64(argv[i++]); + }else{ + pCur->mxValue = 0xffffffff; + } + if( idxNum & 4 ){ + pCur->iStep = sqlite3_value_int64(argv[i++]); + if( pCur->iStep<1 ) pCur->iStep = 1; + }else{ + pCur->iStep = 1; + } + for(i=0; imnValue = 1; + pCur->mxValue = 0; + break; + } + } + if( idxNum & 8 ){ + pCur->isDesc = 1; + pCur->iValue = pCur->mxValue; + if( pCur->iStep>0 ){ + pCur->iValue -= (pCur->mxValue - pCur->mnValue)%pCur->iStep; + } + }else{ + pCur->isDesc = 0; + pCur->iValue = pCur->mnValue; + } + pCur->iRowid = 1; + return SQLITE_OK; +} + +/* +** SQLite will invoke this method one or more times while planning a query +** that uses the generate_series virtual table. This routine needs to create +** a query plan for each invocation and compute an estimated cost for that +** plan. +** +** In this implementation idxNum is used to represent the +** query plan. idxStr is unused. +** +** The query plan is represented by bits in idxNum: +** +** (1) start = $value -- constraint exists +** (2) stop = $value -- constraint exists +** (4) step = $value -- constraint exists +** (8) output in descending order +*/ +static int seriesBestIndex( + sqlite3_vtab *tabUnused, + sqlite3_index_info *pIdxInfo +){ + int i, j; /* Loop over constraints */ + int idxNum = 0; /* The query plan bitmask */ + int unusableMask = 0; /* Mask of unusable constraints */ + int nArg = 0; /* Number of arguments that seriesFilter() expects */ + int aIdx[3]; /* Constraints on start, stop, and step */ + const struct sqlite3_index_constraint *pConstraint; + + /* This implementation assumes that the start, stop, and step columns + ** are the last three columns in the virtual table. */ + assert( SERIES_COLUMN_STOP == SERIES_COLUMN_START+1 ); + assert( SERIES_COLUMN_STEP == SERIES_COLUMN_START+2 ); + (void)tabUnused; + aIdx[0] = aIdx[1] = aIdx[2] = -1; + pConstraint = pIdxInfo->aConstraint; + for(i=0; inConstraint; i++, pConstraint++){ + int iCol; /* 0 for start, 1 for stop, 2 for step */ + int iMask; /* bitmask for those column */ + if( pConstraint->iColumniColumn - SERIES_COLUMN_START; + assert( iCol>=0 && iCol<=2 ); + iMask = 1 << iCol; + if( pConstraint->usable==0 ){ + unusableMask |= iMask; + continue; + }else if( pConstraint->op==SQLITE_INDEX_CONSTRAINT_EQ ){ + idxNum |= iMask; + aIdx[iCol] = i; + } + } + for(i=0; i<3; i++){ + if( (j = aIdx[i])>=0 ){ + pIdxInfo->aConstraintUsage[j].argvIndex = ++nArg; + pIdxInfo->aConstraintUsage[j].omit = !SQLITE_SERIES_CONSTRAINT_VERIFY; + } + } + if( (unusableMask & ~idxNum)!=0 ){ + /* The start, stop, and step columns are inputs. Therefore if there + ** are unusable constraints on any of start, stop, or step then + ** this plan is unusable */ + return SQLITE_CONSTRAINT; + } + if( (idxNum & 3)==3 ){ + /* Both start= and stop= boundaries are available. This is the + ** the preferred case */ + pIdxInfo->estimatedCost = (double)(2 - ((idxNum&4)!=0)); + pIdxInfo->estimatedRows = 1000; + if( pIdxInfo->nOrderBy==1 ){ + if( pIdxInfo->aOrderBy[0].desc ) idxNum |= 8; + pIdxInfo->orderByConsumed = 1; + } + }else{ + /* If either boundary is missing, we have to generate a huge span + ** of numbers. Make this case very expensive so that the query + ** planner will work hard to avoid it. */ + pIdxInfo->estimatedRows = 2147483647; + } + pIdxInfo->idxNum = idxNum; + return SQLITE_OK; +} + +/* +** This following structure defines all the methods for the +** generate_series virtual table. +*/ +static sqlite3_module seriesModule = { + 0, /* iVersion */ + 0, /* xCreate */ + seriesConnect, /* xConnect */ + seriesBestIndex, /* xBestIndex */ + seriesDisconnect, /* xDisconnect */ + 0, /* xDestroy */ + seriesOpen, /* xOpen - open a cursor */ + seriesClose, /* xClose - close a cursor */ + seriesFilter, /* xFilter - configure scan constraints */ + seriesNext, /* xNext - advance a cursor */ + seriesEof, /* xEof - check for end of scan */ + seriesColumn, /* xColumn - read data */ + seriesRowid, /* xRowid - read data */ + 0, /* xUpdate */ + 0, /* xBegin */ + 0, /* xSync */ + 0, /* xCommit */ + 0, /* xRollback */ + 0, /* xFindMethod */ + 0, /* xRename */ + 0, /* xSavepoint */ + 0, /* xRelease */ + 0, /* xRollbackTo */ + 0 /* xShadowName */ +}; + +#endif /* SQLITE_OMIT_VIRTUALTABLE */ + +#ifdef _WIN32 + +#endif +int sqlite3_series_init( + sqlite3 *db, + char **pzErrMsg, + const sqlite3_api_routines *pApi +){ + int rc = SQLITE_OK; + SQLITE_EXTENSION_INIT2(pApi); +#ifndef SQLITE_OMIT_VIRTUALTABLE + if( sqlite3_libversion_number()<3008012 ){ + *pzErrMsg = sqlite3_mprintf( + "generate_series() requires SQLite 3.8.12 or later"); + return SQLITE_ERROR; + } + rc = sqlite3_create_module(db, "generate_series", &seriesModule, 0); +#endif + return rc; +} + +/************************* End ../ext/misc/series.c ********************/ #ifdef SQLITE_HAVE_ZLIB /************************* Begin ../ext/misc/zipfile.c ******************/ /* @@ -5842,14 +6280,16 @@ static int zipfileAppendData( const u8 *aWrite, int nWrite ){ - size_t n; - fseek(pTab->pWriteFd, (long)pTab->szCurrent, SEEK_SET); - n = fwrite(aWrite, 1, nWrite, pTab->pWriteFd); - if( (int)n!=nWrite ){ - pTab->base.zErrMsg = sqlite3_mprintf("error in fwrite()"); - return SQLITE_ERROR; + if( nWrite>0 ){ + size_t n = nWrite; + fseek(pTab->pWriteFd, (long)pTab->szCurrent, SEEK_SET); + n = fwrite(aWrite, 1, nWrite, pTab->pWriteFd); + if( (int)n!=nWrite ){ + pTab->base.zErrMsg = sqlite3_mprintf("error in fwrite()"); + return SQLITE_ERROR; + } + pTab->szCurrent += nWrite; } - pTab->szCurrent += nWrite; return SQLITE_OK; } @@ -8494,6 +8934,7 @@ static int idxGetTableInfo( IdxTable *pNew = 0; int rc, rc2; char *pCsr = 0; + int nPk = 0; rc = idxPrintfPrepareStmt(db, &p1, pzErrmsg, "PRAGMA table_info=%Q", zTab); while( rc==SQLITE_OK && SQLITE_ROW==sqlite3_step(p1) ){ @@ -8504,6 +8945,7 @@ static int idxGetTableInfo( ); nByte += 1 + STRLEN(zCol); nCol++; + nPk += (sqlite3_column_int(p1, 5)>0); } rc2 = sqlite3_reset(p1); if( rc==SQLITE_OK ) rc = rc2; @@ -8523,7 +8965,7 @@ static int idxGetTableInfo( const char *zCol = (const char*)sqlite3_column_text(p1, 1); int nCopy = STRLEN(zCol) + 1; pNew->aCol[nCol].zName = pCsr; - pNew->aCol[nCol].iPk = sqlite3_column_int(p1, 5); + pNew->aCol[nCol].iPk = (sqlite3_column_int(p1, 5)==1 && nPk==1); memcpy(pCsr, zCol, nCopy); pCsr += nCopy; @@ -9528,10 +9970,12 @@ static int idxPopulateStat1(sqlite3expert *p, char **pzErr){ idxFinalize(&rc, pIndexXInfo); idxFinalize(&rc, pWrite); - for(i=0; inSlot; i++){ - sqlite3_free(pCtx->aSlot[i].z); + if( pCtx ){ + for(i=0; inSlot; i++){ + sqlite3_free(pCtx->aSlot[i].z); + } + sqlite3_free(pCtx); } - sqlite3_free(pCtx); if( rc==SQLITE_OK ){ rc = sqlite3_exec(p->dbm, "ANALYZE sqlite_schema", 0, 0, 0); @@ -10771,6 +11215,8 @@ struct ShellState { #define SHFLG_CountChanges 0x00000020 /* .changes setting */ #define SHFLG_Echo 0x00000040 /* .echo or --echo setting */ #define SHFLG_HeaderSet 0x00000080 /* .header has been used */ +#define SHFLG_DumpDataOnly 0x00000100 /* .dump show data only */ +#define SHFLG_DumpNoSys 0x00000200 /* .dump omits system tables */ /* ** Macros for testing and setting shellFlgs @@ -13291,19 +13737,25 @@ static int dump_callback(void *pArg, int nArg, char **azArg, char **azNotUsed){ const char *zType; const char *zSql; ShellState *p = (ShellState *)pArg; + int dataOnly; + int noSys; UNUSED_PARAMETER(azNotUsed); if( nArg!=3 || azArg==0 ) return 0; zTable = azArg[0]; zType = azArg[1]; zSql = azArg[2]; + dataOnly = (p->shellFlgs & SHFLG_DumpDataOnly)!=0; + noSys = (p->shellFlgs & SHFLG_DumpNoSys)!=0; - if( strcmp(zTable, "sqlite_sequence")==0 ){ - raw_printf(p->out, "DELETE FROM sqlite_sequence;\n"); - }else if( sqlite3_strglob("sqlite_stat?", zTable)==0 ){ - raw_printf(p->out, "ANALYZE sqlite_schema;\n"); + if( strcmp(zTable, "sqlite_sequence")==0 && !noSys ){ + if( !dataOnly ) raw_printf(p->out, "DELETE FROM sqlite_sequence;\n"); + }else if( sqlite3_strglob("sqlite_stat?", zTable)==0 && !noSys ){ + if( !dataOnly ) raw_printf(p->out, "ANALYZE sqlite_schema;\n"); }else if( strncmp(zTable, "sqlite_", 7)==0 ){ return 0; + }else if( dataOnly ){ + /* no-op */ }else if( strncmp(zSql, "CREATE VIRTUAL TABLE", 20)==0 ){ char *zIns; if( !p->writableSchema ){ @@ -13476,8 +13928,10 @@ static const char *(azHelp[]) = { ".dbinfo ?DB? Show status information about the database", ".dump ?TABLE? Render database content as SQL", " Options:", - " --preserve-rowids Include ROWID values in the output", + " --data-only Output only INSERT statements", " --newlines Allow unescaped newline characters in output", + " --nosys Omit system tables (ex: \"sqlite_stat1\")", + " --preserve-rowids Include ROWID values in the output", " TABLE is a LIKE pattern for the tables to dump", " Additional LIKE patterns can be given in subsequent arguments", ".echo on|off Turn command echo on or off", @@ -13602,8 +14056,9 @@ static const char *(azHelp[]) = { ".save FILE Write in-memory database into FILE", ".scanstats on|off Turn sqlite3_stmt_scanstatus() metrics on or off", ".schema ?PATTERN? Show the CREATE statements matching PATTERN", - " Options:", - " --indent Try to pretty-print the schema", + " Options:", + " --indent Try to pretty-print the schema", + " --nosys Omit objects whose names start with \"sqlite_\"", ".selftest ?OPTIONS? Run tests defined in the SELFTEST table", " Options:", " --init Create a new SELFTEST table", @@ -14012,6 +14467,20 @@ static void shellIdQuote( } } +/* +** Scalar function "usleep(X)" invokes sqlite3_sleep(X) and returns X. +*/ +static void shellUSleepFunc( + sqlite3_context *context, + int argcUnused, + sqlite3_value **argv +){ + int sleep = sqlite3_value_int(argv[0]); + (void)argcUnused; + sqlite3_sleep(sleep/1000); + sqlite3_result_int(context, sleep); +} + /* ** Scalar function "shell_escape_crnl" used by the .recover command. ** The argument passed to this function is the output of built-in @@ -14176,6 +14645,7 @@ static void open_db(ShellState *p, int openFlags){ sqlite3_uint_init(p->db, 0, 0); sqlite3_decimal_init(p->db, 0, 0); sqlite3_ieee_init(p->db, 0, 0); + sqlite3_series_init(p->db, 0, 0); #if !defined(SQLITE_OMIT_VIRTUALTABLE) && defined(SQLITE_ENABLE_DBPAGE_VTAB) sqlite3_dbdata_init(p->db, 0, 0); #endif @@ -14195,6 +14665,8 @@ static void open_db(ShellState *p, int openFlags){ shellInt32, 0, 0); sqlite3_create_function(p->db, "shell_idquote", 1, SQLITE_UTF8, 0, shellIdQuote, 0, 0); + sqlite3_create_function(p->db, "usleep",1,SQLITE_UTF8,0, + shellUSleepFunc, 0, 0); #ifndef SQLITE_NOHAVE_SYSTEM sqlite3_create_function(p->db, "edit", 1, SQLITE_UTF8, 0, editFunc, 0, 0); @@ -17169,21 +17641,41 @@ static int do_meta_command(char *zLine, ShellState *p){ }else if( c=='d' && n>1 && strncmp(azArg[0], "databases", n)==0 ){ - ShellState data; - char *zErrMsg = 0; + char **azName = 0; + int nName = 0; + sqlite3_stmt *pStmt; + int i; open_db(p, 0); - memcpy(&data, p, sizeof(data)); - data.showHeader = 0; - data.cMode = data.mode = MODE_List; - sqlite3_snprintf(sizeof(data.colSeparator),data.colSeparator,": "); - data.cnt = 0; - sqlite3_exec(p->db, "SELECT name, file FROM pragma_database_list", - callback, &data, &zErrMsg); - if( zErrMsg ){ - utf8_printf(stderr,"Error: %s\n", zErrMsg); - sqlite3_free(zErrMsg); + rc = sqlite3_prepare_v2(p->db, "PRAGMA database_list", -1, &pStmt, 0); + if( rc ){ + utf8_printf(stderr, "Error: %s\n", sqlite3_errmsg(p->db)); rc = 1; + }else{ + while( sqlite3_step(pStmt)==SQLITE_ROW ){ + const char *zSchema = (const char *)sqlite3_column_text(pStmt,1); + const char *zFile = (const char*)sqlite3_column_text(pStmt,2); + azName = sqlite3_realloc(azName, (nName+1)*2*sizeof(char*)); + if( azName==0 ){ shell_out_of_memory(); /* Does not return */ } + azName[nName*2] = strdup(zSchema); + azName[nName*2+1] = strdup(zFile); + nName++; + } } + sqlite3_finalize(pStmt); + for(i=0; idb, azName[i*2]); + int bRdonly = sqlite3_db_readonly(p->db, azName[i*2]); + const char *z = azName[i*2+1]; + utf8_printf(p->out, "%s: %s %s%s\n", + azName[i*2], + z && z[0] ? z : "\"\"", + bRdonly ? "r/o" : "r/w", + eTxn==SQLITE_TXN_NONE ? "" : + eTxn==SQLITE_TXN_READ ? " read-txn" : " write-txn"); + free(azName[i*2]); + free(azName[i*2+1]); + } + sqlite3_free(azName); }else if( c=='d' && n>=3 && strncmp(azArg[0], "dbconfig", n)==0 ){ @@ -17242,7 +17734,9 @@ static int do_meta_command(char *zLine, ShellState *p){ int i; int savedShowHeader = p->showHeader; int savedShellFlags = p->shellFlgs; - ShellClearFlag(p, SHFLG_PreserveRowid|SHFLG_Newlines|SHFLG_Echo); + ShellClearFlag(p, + SHFLG_PreserveRowid|SHFLG_Newlines|SHFLG_Echo + |SHFLG_DumpDataOnly|SHFLG_DumpNoSys); for(i=1; iout, "PRAGMA foreign_keys=OFF;\n"); - raw_printf(p->out, "BEGIN TRANSACTION;\n"); + if( (p->shellFlgs & SHFLG_DumpDataOnly)==0 ){ + /* When playing back a "dump", the content might appear in an order + ** which causes immediate foreign key constraints to be violated. + ** So disable foreign-key constraint enforcement to prevent problems. */ + raw_printf(p->out, "PRAGMA foreign_keys=OFF;\n"); + raw_printf(p->out, "BEGIN TRANSACTION;\n"); + } p->writableSchema = 0; p->showHeader = 0; /* Set writable_schema=ON since doing so forces SQLite to initialize @@ -17299,14 +17801,16 @@ static int do_meta_command(char *zLine, ShellState *p){ ); run_schema_dump_query(p,zSql); sqlite3_free(zSql); - zSql = sqlite3_mprintf( - "SELECT sql FROM sqlite_schema " - "WHERE (%s) AND sql NOT NULL" - " AND type IN ('index','trigger','view')", - zLike - ); - run_table_dump_query(p, zSql); - sqlite3_free(zSql); + if( (p->shellFlgs & SHFLG_DumpDataOnly)==0 ){ + zSql = sqlite3_mprintf( + "SELECT sql FROM sqlite_schema " + "WHERE (%s) AND sql NOT NULL" + " AND type IN ('index','trigger','view')", + zLike + ); + run_table_dump_query(p, zSql); + sqlite3_free(zSql); + } sqlite3_free(zLike); if( p->writableSchema ){ raw_printf(p->out, "PRAGMA writable_schema=OFF;\n"); @@ -17314,7 +17818,9 @@ static int do_meta_command(char *zLine, ShellState *p){ } sqlite3_exec(p->db, "PRAGMA writable_schema=OFF;", 0, 0, 0); sqlite3_exec(p->db, "RELEASE dump;", 0, 0, 0); - raw_printf(p->out, p->nErr?"ROLLBACK; -- due to errors\n":"COMMIT;\n"); + if( (p->shellFlgs & SHFLG_DumpDataOnly)==0 ){ + raw_printf(p->out, p->nErr?"ROLLBACK; -- due to errors\n":"COMMIT;\n"); + } p->showHeader = savedShowHeader; p->shellFlgs = savedShellFlags; }else @@ -17753,7 +18259,7 @@ static int do_meta_command(char *zLine, ShellState *p){ while( (nSkip--)>0 ){ while( xRead(&sCtx) && sCtx.cTerm==sCtx.cColSep ){} } - zSql = sqlite3_mprintf("SELECT * FROM %s", zTable); + zSql = sqlite3_mprintf("SELECT * FROM \"%w\"", zTable); if( zSql==0 ){ import_cleanup(&sCtx); shell_out_of_memory(); @@ -17762,7 +18268,7 @@ static int do_meta_command(char *zLine, ShellState *p){ rc = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0); import_append_char(&sCtx, 0); /* To ensure sCtx.z is allocated */ if( rc && sqlite3_strglob("no such table: *", sqlite3_errmsg(p->db))==0 ){ - char *zCreate = sqlite3_mprintf("CREATE TABLE %s", zTable); + char *zCreate = sqlite3_mprintf("CREATE TABLE \"%w\"", zTable); char cSep = '('; while( xRead(&sCtx) ){ zCreate = sqlite3_mprintf("%z%c\n \"%w\" TEXT", zCreate, cSep, sCtx.z); @@ -17783,7 +18289,7 @@ static int do_meta_command(char *zLine, ShellState *p){ rc = sqlite3_exec(p->db, zCreate, 0, 0, 0); sqlite3_free(zCreate); if( rc ){ - utf8_printf(stderr, "CREATE TABLE %s(...) failed: %s\n", zTable, + utf8_printf(stderr, "CREATE TABLE \"%s\"(...) failed: %s\n", zTable, sqlite3_errmsg(p->db)); import_cleanup(&sCtx); rc = 1; @@ -18548,9 +19054,16 @@ static int do_meta_command(char *zLine, ShellState *p){ rc = 1; goto meta_command_exit; } - if( notNormalFile(azArg[1]) - || (p->in = fopen(azArg[1], "rb"))==0 - ){ + if( azArg[1][0]=='|' ){ + p->in = popen(azArg[1]+1, "r"); + if( p->in==0 ){ + utf8_printf(stderr, "Error: cannot open \"%s\"\n", azArg[1]); + rc = 1; + }else{ + rc = process_input(p); + pclose(p->in); + } + }else if( notNormalFile(azArg[1]) || (p->in = fopen(azArg[1], "rb"))==0 ){ utf8_printf(stderr,"Error: cannot open \"%s\"\n", azArg[1]); rc = 1; }else{ @@ -18632,6 +19145,7 @@ static int do_meta_command(char *zLine, ShellState *p){ const char *zName = 0; int iSchema = 0; int bDebug = 0; + int bNoSystemTabs = 0; int ii; open_db(p, 0); @@ -18644,10 +19158,16 @@ static int do_meta_command(char *zLine, ShellState *p){ data.cMode = data.mode = MODE_Pretty; }else if( optionMatch(azArg[ii],"debug") ){ bDebug = 1; + }else if( optionMatch(azArg[ii],"nosys") ){ + bNoSystemTabs = 1; + }else if( azArg[ii][0]=='-' ){ + utf8_printf(stderr, "Unknown option: \"%s\"\n", azArg[ii]); + rc = 1; + goto meta_command_exit; }else if( zName==0 ){ zName = azArg[ii]; }else{ - raw_printf(stderr, "Usage: .schema ?--indent? ?LIKE-PATTERN?\n"); + raw_printf(stderr, "Usage: .schema ?--indent? ?--nosys? ?LIKE-PATTERN?\n"); rc = 1; goto meta_command_exit; } @@ -18733,7 +19253,10 @@ static int do_meta_command(char *zLine, ShellState *p){ appendText(&sSelect, " AND ", 0); sqlite3_free(zQarg); } - appendText(&sSelect, "type!='meta' AND sql IS NOT NULL" + if( bNoSystemTabs ){ + appendText(&sSelect, "name NOT LIKE 'sqlite_%%' AND ", 0); + } + appendText(&sSelect, "sql IS NOT NULL" " ORDER BY snum, rowid", 0); if( bDebug ){ utf8_printf(p->out, "SQL: %s;\n", sSelect.z); @@ -19430,6 +19953,7 @@ static int do_meta_command(char *zLine, ShellState *p){ *** 5486 LINES SKIPPED *** From owner-dev-commits-src-branches@freebsd.org Sun Jun 6 21:55:32 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 982E063FB2E; Sun, 6 Jun 2021 21:55: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 4Fyr0N3x4Nz4d4J; Sun, 6 Jun 2021 21:55:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6F9522F67; Sun, 6 Jun 2021 21:55:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 156LtW7j045821; Sun, 6 Jun 2021 21:55:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 156LtVoJ045817; Sun, 6 Jun 2021 21:55:31 GMT (envelope-from git) Date: Sun, 6 Jun 2021 21:55:31 GMT Message-Id: <202106062155.156LtVoJ045817@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: d9d03b5409f3 - stable/11 - sqlite3: import sqlite3 3.35.5 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/11 X-Git-Reftype: branch X-Git-Commit: d9d03b5409f32668a71468975d944ac1015e878b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jun 2021 21:55:32 -0000 The branch stable/11 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=d9d03b5409f32668a71468975d944ac1015e878b commit d9d03b5409f32668a71468975d944ac1015e878b Author: Cy Schubert AuthorDate: 2021-05-07 01:01:44 +0000 Commit: Cy Schubert CommitDate: 2021-06-06 01:05:50 +0000 sqlite3: import sqlite3 3.35.5 Merge commit '0511e356f5e2106928ee352ee974d1470c860a9a' into new_merge Changes at https://www.sqlite.org/releaselog/3_35_5.html. MFC after: 1 month (cherry picked from commit ce9de47260d4edc963a94140789e4a52642c28e6) --- contrib/sqlite3/Makefile.msc | 3 + contrib/sqlite3/configure | 153 +- contrib/sqlite3/configure.ac | 50 +- contrib/sqlite3/shell.c | 501 +- contrib/sqlite3/sqlite3.c | 11777 ++++++++++++++++++++++--------------- contrib/sqlite3/sqlite3.h | 59 +- contrib/sqlite3/sqlite3rc.h | 2 +- contrib/sqlite3/tea/configure | 18 +- contrib/sqlite3/tea/configure.ac | 2 +- 9 files changed, 7708 insertions(+), 4857 deletions(-) diff --git a/contrib/sqlite3/Makefile.msc b/contrib/sqlite3/Makefile.msc index 746162a00c04..1f177557a25a 100644 --- a/contrib/sqlite3/Makefile.msc +++ b/contrib/sqlite3/Makefile.msc @@ -303,6 +303,9 @@ OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_SESSION=1 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_PREUPDATE_HOOK=1 !ENDIF +# Always enable math functions on Windows +OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_MATH_FUNCTIONS + # Should the rbu extension be enabled? If so, add compilation options # to enable it. # diff --git a/contrib/sqlite3/configure b/contrib/sqlite3/configure index 0eedad3467dd..4a16edbb6e02 100755 --- a/contrib/sqlite3/configure +++ b/contrib/sqlite3/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for sqlite 3.34.1. +# Generated by GNU Autoconf 2.69 for sqlite 3.35.5. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='sqlite' PACKAGE_TARNAME='sqlite' -PACKAGE_VERSION='3.34.1' -PACKAGE_STRING='sqlite 3.34.1' +PACKAGE_VERSION='3.35.5' +PACKAGE_STRING='sqlite 3.35.5' PACKAGE_BUGREPORT='http://www.sqlite.org' PACKAGE_URL='' @@ -772,6 +772,7 @@ enable_editline enable_readline enable_threadsafe enable_dynamic_extensions +enable_math enable_fts4 enable_fts3 enable_fts5 @@ -1341,7 +1342,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures sqlite 3.34.1 to adapt to many kinds of systems. +\`configure' configures sqlite 3.35.5 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1412,7 +1413,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of sqlite 3.34.1:";; + short | recursive ) echo "Configuration of sqlite 3.35.5:";; esac cat <<\_ACEOF @@ -1437,6 +1438,7 @@ Optional Features: --enable-threadsafe build a thread-safe library [default=yes] --enable-dynamic-extensions support loadable extensions [default=yes] + --enable-math SQL math functions [default=yes] --enable-fts4 include fts4 support [default=yes] --enable-fts3 include fts3 support [default=no] --enable-fts5 include fts5 support [default=yes] @@ -1537,7 +1539,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -sqlite configure 3.34.1 +sqlite configure 3.35.5 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1952,7 +1954,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by sqlite $as_me 3.34.1, which was +It was created by sqlite $as_me 3.35.5, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2818,7 +2820,7 @@ fi # Define the identity of the package. PACKAGE='sqlite' - VERSION='3.34.1' + VERSION='3.35.5' cat >>confdefs.h <<_ACEOF @@ -13335,7 +13337,9 @@ else enable_threadsafe=yes fi -if test x"$enable_threadsafe" != "xno"; then +if test x"$enable_threadsafe" == "xno"; then + BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_THREADSAFE=0" +else BUILD_CFLAGS="$BUILD_CFLAGS -D_REENTRANT=1 -DSQLITE_THREADSAFE=1" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing pthread_create" >&5 $as_echo_n "checking for library containing pthread_create... " >&6; } @@ -13528,6 +13532,84 @@ $as_echo_n "checking for whether to support dynamic extensions... " >&6; } $as_echo "$enable_dynamic_extensions" >&6; } #----------------------------------------------------------------------- +#----------------------------------------------------------------------- +# --enable-math +# +# Check whether --enable-math was given. +if test "${enable_math+set}" = set; then : + enableval=$enable_math; +else + enable_math=yes +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking SQL math functions" >&5 +$as_echo_n "checking SQL math functions... " >&6; } +if test x"$enable_math" = "xyes"; then + BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_MATH_FUNCTIONS" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: enabled" >&5 +$as_echo "enabled" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing ceil" >&5 +$as_echo_n "checking for library containing ceil... " >&6; } +if ${ac_cv_search_ceil+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char ceil (); +int +main () +{ +return ceil (); + ; + return 0; +} +_ACEOF +for ac_lib in '' m; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_ceil=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_ceil+:} false; then : + break +fi +done +if ${ac_cv_search_ceil+:} false; then : + +else + ac_cv_search_ceil=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_ceil" >&5 +$as_echo "$ac_cv_search_ceil" >&6; } +ac_res=$ac_cv_search_ceil +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 +$as_echo "disabled" >&6; } +fi +#----------------------------------------------------------------------- + #----------------------------------------------------------------------- # --enable-fts4 # @@ -13538,8 +13620,15 @@ else enable_fts4=yes fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking FTS4 extension" >&5 +$as_echo_n "checking FTS4 extension... " >&6; } if test x"$enable_fts4" = "xyes"; then BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_FTS4" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: enabled" >&5 +$as_echo "enabled" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 +$as_echo "disabled" >&6; } fi #----------------------------------------------------------------------- @@ -13551,8 +13640,15 @@ if test "${enable_fts3+set}" = set; then : enableval=$enable_fts3; fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking FTS3 extension" >&5 +$as_echo_n "checking FTS3 extension... " >&6; } if test x"$enable_fts3" = "xyes" -a x"$enable_fts4" = "xno"; then BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_FTS3" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: enabled" >&5 +$as_echo "enabled" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 +$as_echo "disabled" >&6; } fi #----------------------------------------------------------------------- @@ -13566,7 +13662,11 @@ else enable_fts5=yes fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking FTS5 extension" >&5 +$as_echo_n "checking FTS5 extension... " >&6; } if test x"$enable_fts5" = "xyes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: enabled" >&5 +$as_echo "enabled" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing log" >&5 $as_echo_n "checking for library containing log... " >&6; } if ${ac_cv_search_log+:} false; then : @@ -13624,6 +13724,9 @@ if test "$ac_res" != no; then : fi BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_FTS5" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 +$as_echo "disabled" >&6; } fi #----------------------------------------------------------------------- @@ -13637,8 +13740,15 @@ else enable_json1=yes fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking JSON functions" >&5 +$as_echo_n "checking JSON functions... " >&6; } if test x"$enable_json1" = "xyes"; then BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_JSON1" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: enabled" >&5 +$as_echo "enabled" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 +$as_echo "disabled" >&6; } fi #----------------------------------------------------------------------- @@ -13652,8 +13762,15 @@ else enable_rtree=yes fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking RTREE extension" >&5 +$as_echo_n "checking RTREE extension... " >&6; } if test x"$enable_rtree" = "xyes"; then BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_GEOPOLY" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: enabled" >&5 +$as_echo "enabled" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 +$as_echo "disabled" >&6; } fi #----------------------------------------------------------------------- @@ -13665,8 +13782,15 @@ if test "${enable_session+set}" = set; then : enableval=$enable_session; fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Session extension" >&5 +$as_echo_n "checking Session extension... " >&6; } if test x"$enable_session" = "xyes"; then BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_PREUPDATE_HOOK" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: enabled" >&5 +$as_echo "enabled" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 +$as_echo "disabled" >&6; } fi #----------------------------------------------------------------------- @@ -13678,9 +13802,16 @@ if test "${enable_debug+set}" = set; then : enableval=$enable_debug; fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Build type" >&5 +$as_echo_n "checking Build type... " >&6; } if test x"$enable_debug" = "xyes"; then BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_DEBUG -DSQLITE_ENABLE_SELECTTRACE -DSQLITE_ENABLE_WHERETRACE" CFLAGS="-g -O0" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: debug" >&5 +$as_echo "debug" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: release" >&5 +$as_echo "release" >&6; } fi #----------------------------------------------------------------------- @@ -14438,7 +14569,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by sqlite $as_me 3.34.1, which was +This file was extended by sqlite $as_me 3.35.5, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -14495,7 +14626,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -sqlite config.status 3.34.1 +sqlite config.status 3.35.5 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/contrib/sqlite3/configure.ac b/contrib/sqlite3/configure.ac index 72472467d5b7..166f7019cd5c 100644 --- a/contrib/sqlite3/configure.ac +++ b/contrib/sqlite3/configure.ac @@ -10,7 +10,7 @@ # AC_PREREQ(2.61) -AC_INIT(sqlite, 3.34.1, http://www.sqlite.org) +AC_INIT(sqlite, 3.35.5, http://www.sqlite.org) AC_CONFIG_SRCDIR([sqlite3.c]) AC_CONFIG_AUX_DIR([.]) @@ -87,7 +87,9 @@ AC_SUBST(READLINE_LIBS) AC_ARG_ENABLE(threadsafe, [AS_HELP_STRING( [--enable-threadsafe], [build a thread-safe library [default=yes]])], [], [enable_threadsafe=yes]) -if test x"$enable_threadsafe" != "xno"; then +if test x"$enable_threadsafe" == "xno"; then + BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_THREADSAFE=0" +else BUILD_CFLAGS="$BUILD_CFLAGS -D_REENTRANT=1 -DSQLITE_THREADSAFE=1" AC_SEARCH_LIBS(pthread_create, pthread) AC_SEARCH_LIBS(pthread_mutexattr_init, pthread) @@ -109,14 +111,34 @@ AC_MSG_CHECKING([for whether to support dynamic extensions]) AC_MSG_RESULT($enable_dynamic_extensions) #----------------------------------------------------------------------- +#----------------------------------------------------------------------- +# --enable-math +# +AC_ARG_ENABLE(math, [AS_HELP_STRING( + [--enable-math], [SQL math functions [default=yes]])], + [], [enable_math=yes]) +AC_MSG_CHECKING([SQL math functions]) +if test x"$enable_math" = "xyes"; then + BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_MATH_FUNCTIONS" + AC_MSG_RESULT([enabled]) + AC_SEARCH_LIBS(ceil, m) +else + AC_MSG_RESULT([disabled]) +fi +#----------------------------------------------------------------------- + #----------------------------------------------------------------------- # --enable-fts4 # AC_ARG_ENABLE(fts4, [AS_HELP_STRING( [--enable-fts4], [include fts4 support [default=yes]])], [], [enable_fts4=yes]) +AC_MSG_CHECKING([FTS4 extension]) if test x"$enable_fts4" = "xyes"; then BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_FTS4" + AC_MSG_RESULT([enabled]) +else + AC_MSG_RESULT([disabled]) fi #----------------------------------------------------------------------- @@ -126,8 +148,12 @@ fi AC_ARG_ENABLE(fts3, [AS_HELP_STRING( [--enable-fts3], [include fts3 support [default=no]])], [], []) +AC_MSG_CHECKING([FTS3 extension]) if test x"$enable_fts3" = "xyes" -a x"$enable_fts4" = "xno"; then BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_FTS3" + AC_MSG_RESULT([enabled]) +else + AC_MSG_RESULT([disabled]) fi #----------------------------------------------------------------------- @@ -137,9 +163,13 @@ fi AC_ARG_ENABLE(fts5, [AS_HELP_STRING( [--enable-fts5], [include fts5 support [default=yes]])], [], [enable_fts5=yes]) +AC_MSG_CHECKING([FTS5 extension]) if test x"$enable_fts5" = "xyes"; then + AC_MSG_RESULT([enabled]) AC_SEARCH_LIBS(log, m) BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_FTS5" +else + AC_MSG_RESULT([disabled]) fi #----------------------------------------------------------------------- @@ -149,8 +179,12 @@ fi AC_ARG_ENABLE(json1, [AS_HELP_STRING( [--enable-json1], [include json1 support [default=yes]])], [],[enable_json1=yes]) +AC_MSG_CHECKING([JSON functions]) if test x"$enable_json1" = "xyes"; then BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_JSON1" + AC_MSG_RESULT([enabled]) +else + AC_MSG_RESULT([disabled]) fi #----------------------------------------------------------------------- @@ -160,8 +194,12 @@ fi AC_ARG_ENABLE(rtree, [AS_HELP_STRING( [--enable-rtree], [include rtree support [default=yes]])], [], [enable_rtree=yes]) +AC_MSG_CHECKING([RTREE extension]) if test x"$enable_rtree" = "xyes"; then BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_GEOPOLY" + AC_MSG_RESULT([enabled]) +else + AC_MSG_RESULT([disabled]) fi #----------------------------------------------------------------------- @@ -171,8 +209,12 @@ fi AC_ARG_ENABLE(session, [AS_HELP_STRING( [--enable-session], [enable the session extension [default=no]])], [], []) +AC_MSG_CHECKING([Session extension]) if test x"$enable_session" = "xyes"; then BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_PREUPDATE_HOOK" + AC_MSG_RESULT([enabled]) +else + AC_MSG_RESULT([disabled]) fi #----------------------------------------------------------------------- @@ -182,9 +224,13 @@ fi AC_ARG_ENABLE(debug, [AS_HELP_STRING( [--enable-debug], [build with debugging features enabled [default=no]])], [], []) +AC_MSG_CHECKING([Build type]) if test x"$enable_debug" = "xyes"; then BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_DEBUG -DSQLITE_ENABLE_SELECTTRACE -DSQLITE_ENABLE_WHERETRACE" CFLAGS="-g -O0" + AC_MSG_RESULT([debug]) +else + AC_MSG_RESULT([release]) fi #----------------------------------------------------------------------- diff --git a/contrib/sqlite3/shell.c b/contrib/sqlite3/shell.c index 6f4fee80dc1c..27de22a3819b 100644 --- a/contrib/sqlite3/shell.c +++ b/contrib/sqlite3/shell.c @@ -1424,7 +1424,10 @@ SQLITE_EXTENSION_INIT1 #include #include #include + +#ifndef SQLITE_AMALGAMATION /* typedef sqlite3_uint64 u64; */ +#endif /* SQLITE_AMALGAMATION */ /****************************************************************************** ** The Hash Engine @@ -3637,24 +3640,23 @@ int sqlite3_completion_init( ** appended onto the end of some other file, such as an executable. ** ** A special record must appear at the end of the file that identifies the -** file as an appended database and provides an offset to page 1. For -** best performance page 1 should be located at a disk page boundary, though -** that is not required. +** file as an appended database and provides the offset to the first page +** of the exposed content. (Or, it is the length of the content prefix.) +** For best performance page 1 should be located at a disk page boundary, +** though that is not required. ** ** When opening a database using this VFS, the connection might treat -** the file as an ordinary SQLite database, or it might treat is as a -** database appended onto some other file. Here are the rules: +** the file as an ordinary SQLite database, or it might treat it as a +** database appended onto some other file. The decision is made by +** applying the following rules in order: ** -** (1) When opening a new empty file, that file is treated as an ordinary -** database. +** (1) An empty file is an ordinary database. ** -** (2) When opening a file that begins with the standard SQLite prefix -** string "SQLite format 3", that file is treated as an ordinary -** database. +** (2) If the file ends with the appendvfs trailer string +** "Start-Of-SQLite3-NNNNNNNN" that file is an appended database. ** -** (3) When opening a file that ends with the appendvfs trailer string -** "Start-Of-SQLite3-NNNNNNNN" that file is treated as an appended -** database. +** (3) If the file begins with the standard SQLite prefix string +** "SQLite format 3", that file is an ordinary database. ** ** (4) If none of the above apply and the SQLITE_OPEN_CREATE flag is ** set, then a new database is appended to the already existing file. @@ -3662,13 +3664,13 @@ int sqlite3_completion_init( ** (5) Otherwise, SQLITE_CANTOPEN is returned. ** ** To avoid unnecessary complications with the PENDING_BYTE, the size of -** the file containing the database is limited to 1GB. This VFS will refuse -** to read or write past the 1GB mark. This restriction might be lifted in -** future versions. For now, if you need a large database, then keep the -** database in a separate file. +** the file containing the database is limited to 1GiB. (1073741824 bytes) +** This VFS will not read or write past the 1GiB mark. This restriction +** might be lifted in future versions. For now, if you need a larger +** database, then keep it in a separate file. ** -** If the file being opened is not an appended database, then this shim is -** a pass-through into the default underlying VFS. +** If the file being opened is a plain database (not an appended one), then +** this shim is a pass-through into the default underlying VFS. (rule 3) **/ /* #include "sqlite3ext.h" */ SQLITE_EXTENSION_INIT1 @@ -3681,17 +3683,27 @@ SQLITE_EXTENSION_INIT1 ** 123456789 123456789 12345 ** ** The NNNNNNNN represents a 64-bit big-endian unsigned integer which is -** the offset to page 1. +** the offset to page 1, and also the length of the prefix content. */ #define APND_MARK_PREFIX "Start-Of-SQLite3-" #define APND_MARK_PREFIX_SZ 17 -#define APND_MARK_SIZE 25 +#define APND_MARK_FOS_SZ 8 +#define APND_MARK_SIZE (APND_MARK_PREFIX_SZ+APND_MARK_FOS_SZ) /* ** Maximum size of the combined prefix + database + append-mark. This ** must be less than 0x40000000 to avoid locking issues on Windows. */ -#define APND_MAX_SIZE (65536*15259) +#define APND_MAX_SIZE (0x40000000) + +/* +** Try to align the database to an even multiple of APND_ROUNDUP bytes. +*/ +#ifndef APND_ROUNDUP +#define APND_ROUNDUP 4096 +#endif +#define APND_ALIGN_MASK ((sqlite3_int64)(APND_ROUNDUP-1)) +#define APND_START_ROUNDUP(fsz) (((fsz)+APND_ALIGN_MASK) & ~APND_ALIGN_MASK) /* ** Forward declaration of objects used by this utility @@ -3705,11 +3717,45 @@ typedef struct ApndFile ApndFile; #define ORIGVFS(p) ((sqlite3_vfs*)((p)->pAppData)) #define ORIGFILE(p) ((sqlite3_file*)(((ApndFile*)(p))+1)) -/* An open file */ +/* An open appendvfs file +** +** An instance of this structure describes the appended database file. +** A separate sqlite3_file object is always appended. The appended +** sqlite3_file object (which can be accessed using ORIGFILE()) describes +** the entire file, including the prefix, the database, and the +** append-mark. +** +** The structure of an AppendVFS database is like this: +** +** +-------------+---------+----------+-------------+ +** | prefix-file | padding | database | append-mark | +** +-------------+---------+----------+-------------+ +** ^ ^ +** | | +** iPgOne iMark +** +** +** "prefix file" - file onto which the database has been appended. +** "padding" - zero or more bytes inserted so that "database" +** starts on an APND_ROUNDUP boundary +** "database" - The SQLite database file +** "append-mark" - The 25-byte "Start-Of-SQLite3-NNNNNNNN" that indicates +** the offset from the start of prefix-file to the start +** of "database". +** +** The size of the database is iMark - iPgOne. +** +** The NNNNNNNN in the "Start-Of-SQLite3-NNNNNNNN" suffix is the value +** of iPgOne stored as a big-ending 64-bit integer. +** +** iMark will be the size of the underlying file minus 25 (APND_MARKSIZE). +** Or, iMark is -1 to indicate that it has not yet been written. +*/ struct ApndFile { - sqlite3_file base; /* IO methods */ - sqlite3_int64 iPgOne; /* File offset to page 1 */ - sqlite3_int64 iMark; /* Start of the append-mark */ + sqlite3_file base; /* Subclass. MUST BE FIRST! */ + sqlite3_int64 iPgOne; /* Offset to the start of the database */ + sqlite3_int64 iMark; /* Offset of the append mark. -1 if unwritten */ + /* Always followed by another sqlite3_file that describes the whole file */ }; /* @@ -3801,8 +3847,6 @@ static const sqlite3_io_methods apnd_io_methods = { apndUnfetch /* xUnfetch */ }; - - /* ** Close an apnd-file. */ @@ -3820,22 +3864,37 @@ static int apndRead( int iAmt, sqlite_int64 iOfst ){ - ApndFile *p = (ApndFile *)pFile; + ApndFile *paf = (ApndFile *)pFile; pFile = ORIGFILE(pFile); - return pFile->pMethods->xRead(pFile, zBuf, iAmt, iOfst+p->iPgOne); + return pFile->pMethods->xRead(pFile, zBuf, iAmt, paf->iPgOne+iOfst); } /* -** Add the append-mark onto the end of the file. +** Add the append-mark onto what should become the end of the file. +* If and only if this succeeds, internal ApndFile.iMark is updated. +* Parameter iWriteEnd is the appendvfs-relative offset of the new mark. */ -static int apndWriteMark(ApndFile *p, sqlite3_file *pFile){ - int i; +static int apndWriteMark( + ApndFile *paf, + sqlite3_file *pFile, + sqlite_int64 iWriteEnd +){ + sqlite_int64 iPgOne = paf->iPgOne; unsigned char a[APND_MARK_SIZE]; + int i = APND_MARK_FOS_SZ; + int rc; + assert(pFile == ORIGFILE(paf)); memcpy(a, APND_MARK_PREFIX, APND_MARK_PREFIX_SZ); - for(i=0; i<8; i++){ - a[APND_MARK_PREFIX_SZ+i] = (p->iPgOne >> (56 - i*8)) & 0xff; + while( --i >= 0 ){ + a[APND_MARK_PREFIX_SZ+i] = (unsigned char)(iPgOne & 0xff); + iPgOne >>= 8; + } + iWriteEnd += paf->iPgOne; + if( SQLITE_OK==(rc = pFile->pMethods->xWrite + (pFile, a, APND_MARK_SIZE, iWriteEnd)) ){ + paf->iMark = iWriteEnd; } - return pFile->pMethods->xWrite(pFile, a, APND_MARK_SIZE, p->iMark); + return rc; } /* @@ -3847,38 +3906,28 @@ static int apndWrite( int iAmt, sqlite_int64 iOfst ){ - int rc; - ApndFile *p = (ApndFile *)pFile; + ApndFile *paf = (ApndFile *)pFile; + sqlite_int64 iWriteEnd = iOfst + iAmt; + if( iWriteEnd>=APND_MAX_SIZE ) return SQLITE_FULL; pFile = ORIGFILE(pFile); - if( iOfst+iAmt>=APND_MAX_SIZE ) return SQLITE_FULL; - rc = pFile->pMethods->xWrite(pFile, zBuf, iAmt, iOfst+p->iPgOne); - if( rc==SQLITE_OK && iOfst + iAmt + p->iPgOne > p->iMark ){ - sqlite3_int64 sz = 0; - rc = pFile->pMethods->xFileSize(pFile, &sz); - if( rc==SQLITE_OK ){ - p->iMark = sz - APND_MARK_SIZE; - if( iOfst + iAmt + p->iPgOne > p->iMark ){ - p->iMark = p->iPgOne + iOfst + iAmt; - rc = apndWriteMark(p, pFile); - } - } + /* If append-mark is absent or will be overwritten, write it. */ + if( paf->iMark < 0 || paf->iPgOne + iWriteEnd > paf->iMark ){ + int rc = apndWriteMark(paf, pFile, iWriteEnd); + if( SQLITE_OK!=rc ) return rc; } - return rc; + return pFile->pMethods->xWrite(pFile, zBuf, iAmt, paf->iPgOne+iOfst); } /* ** Truncate an apnd-file. */ static int apndTruncate(sqlite3_file *pFile, sqlite_int64 size){ - int rc; - ApndFile *p = (ApndFile *)pFile; + ApndFile *paf = (ApndFile *)pFile; pFile = ORIGFILE(pFile); - rc = pFile->pMethods->xTruncate(pFile, size+p->iPgOne+APND_MARK_SIZE); - if( rc==SQLITE_OK ){ - p->iMark = p->iPgOne+size; - rc = apndWriteMark(p, pFile); - } - return rc; + /* The append mark goes out first so truncate failure does not lose it. */ + if( SQLITE_OK!=apndWriteMark(paf, pFile, size) ) return SQLITE_IOERR; + /* Truncate underlying file just past append mark */ + return pFile->pMethods->xTruncate(pFile, paf->iMark+APND_MARK_SIZE); } /* @@ -3891,16 +3940,12 @@ static int apndSync(sqlite3_file *pFile, int flags){ /* ** Return the current file-size of an apnd-file. +** If the append mark is not yet there, the file-size is 0. */ static int apndFileSize(sqlite3_file *pFile, sqlite_int64 *pSize){ - ApndFile *p = (ApndFile *)pFile; - int rc; - pFile = ORIGFILE(p); - rc = pFile->pMethods->xFileSize(pFile, pSize); - if( rc==SQLITE_OK && p->iPgOne ){ - *pSize -= p->iPgOne + APND_MARK_SIZE; - } - return rc; + ApndFile *paf = (ApndFile *)pFile; + *pSize = ( paf->iMark >= 0 )? (paf->iMark - paf->iPgOne) : 0; + return SQLITE_OK; } /* @@ -3931,12 +3976,13 @@ static int apndCheckReservedLock(sqlite3_file *pFile, int *pResOut){ ** File control method. For custom operations on an apnd-file. */ static int apndFileControl(sqlite3_file *pFile, int op, void *pArg){ - ApndFile *p = (ApndFile *)pFile; + ApndFile *paf = (ApndFile *)pFile; int rc; pFile = ORIGFILE(pFile); + if( op==SQLITE_FCNTL_SIZE_HINT ) *(sqlite3_int64*)pArg += paf->iPgOne; rc = pFile->pMethods->xFileControl(pFile, op, pArg); if( rc==SQLITE_OK && op==SQLITE_FCNTL_VFSNAME ){ - *(char**)pArg = sqlite3_mprintf("apnd(%lld)/%z", p->iPgOne, *(char**)pArg); + *(char**)pArg = sqlite3_mprintf("apnd(%lld)/%z", paf->iPgOne,*(char**)pArg); } return rc; } @@ -3995,6 +4041,9 @@ static int apndFetch( void **pp ){ ApndFile *p = (ApndFile *)pFile; + if( p->iMark < 0 || iOfst+iAmt > p->iMark ){ + return SQLITE_IOERR; /* Cannot read what is not yet there. */ + } pFile = ORIGFILE(pFile); return pFile->pMethods->xFetch(pFile, iOfst+p->iPgOne, iAmt, pp); } @@ -4006,95 +4055,153 @@ static int apndUnfetch(sqlite3_file *pFile, sqlite3_int64 iOfst, void *pPage){ return pFile->pMethods->xUnfetch(pFile, iOfst+p->iPgOne, pPage); } -/* -** Check to see if the file is an ordinary SQLite database file. -*/ -static int apndIsOrdinaryDatabaseFile(sqlite3_int64 sz, sqlite3_file *pFile){ - int rc; - char zHdr[16]; - static const char aSqliteHdr[] = "SQLite format 3"; - if( sz<512 ) return 0; - rc = pFile->pMethods->xRead(pFile, zHdr, sizeof(zHdr), 0); - if( rc ) return 0; - return memcmp(zHdr, aSqliteHdr, sizeof(zHdr))==0; -} - /* ** Try to read the append-mark off the end of a file. Return the -** start of the appended database if the append-mark is present. If -** there is no append-mark, return -1; +** start of the appended database if the append-mark is present. +** If there is no valid append-mark, return -1; +** +** An append-mark is only valid if the NNNNNNNN start-of-database offset +** indicates that the appended database contains at least one page. The +** start-of-database value must be a multiple of 512. */ static sqlite3_int64 apndReadMark(sqlite3_int64 sz, sqlite3_file *pFile){ int rc, i; sqlite3_int64 iMark; + int msbs = 8 * (APND_MARK_FOS_SZ-1); unsigned char a[APND_MARK_SIZE]; - if( sz<=APND_MARK_SIZE ) return -1; + if( APND_MARK_SIZE!=(sz & 0x1ff) ) return -1; rc = pFile->pMethods->xRead(pFile, a, APND_MARK_SIZE, sz-APND_MARK_SIZE); if( rc ) return -1; if( memcmp(a, APND_MARK_PREFIX, APND_MARK_PREFIX_SZ)!=0 ) return -1; - iMark = ((sqlite3_int64)(a[APND_MARK_PREFIX_SZ]&0x7f))<<56; - for(i=1; i<8; i++){ - iMark += (sqlite3_int64)a[APND_MARK_PREFIX_SZ+i]<<(56-8*i); + iMark = ((sqlite3_int64)(a[APND_MARK_PREFIX_SZ] & 0x7f)) << msbs; + for(i=1; i<8; i++){ + msbs -= 8; + iMark |= (sqlite3_int64)a[APND_MARK_PREFIX_SZ+i]< (sz - APND_MARK_SIZE - 512) ) return -1; + if( iMark & 0x1ff ) return -1; return iMark; } +static const char apvfsSqliteHdr[] = "SQLite format 3"; +/* +** Check to see if the file is an appendvfs SQLite database file. +** Return true iff it is such. Parameter sz is the file's size. +*/ +static int apndIsAppendvfsDatabase(sqlite3_int64 sz, sqlite3_file *pFile){ + int rc; + char zHdr[16]; + sqlite3_int64 iMark = apndReadMark(sz, pFile); + if( iMark>=0 ){ + /* If file has the correct end-marker, the expected odd size, and the + ** SQLite DB type marker where the end-marker puts it, then it + ** is an appendvfs database. + */ + rc = pFile->pMethods->xRead(pFile, zHdr, sizeof(zHdr), iMark); + if( SQLITE_OK==rc + && memcmp(zHdr, apvfsSqliteHdr, sizeof(zHdr))==0 + && (sz & 0x1ff) == APND_MARK_SIZE + && sz>=512+APND_MARK_SIZE + ){ + return 1; /* It's an appendvfs database */ + } + } + return 0; +} + +/* +** Check to see if the file is an ordinary SQLite database file. +** Return true iff so. Parameter sz is the file's size. +*/ +static int apndIsOrdinaryDatabaseFile(sqlite3_int64 sz, sqlite3_file *pFile){ + char zHdr[16]; + if( apndIsAppendvfsDatabase(sz, pFile) /* rule 2 */ + || (sz & 0x1ff) != 0 + || SQLITE_OK!=pFile->pMethods->xRead(pFile, zHdr, sizeof(zHdr), 0) + || memcmp(zHdr, apvfsSqliteHdr, sizeof(zHdr))!=0 + ){ + return 0; + }else{ + return 1; + } +} + /* ** Open an apnd file handle. */ static int apndOpen( - sqlite3_vfs *pVfs, + sqlite3_vfs *pApndVfs, const char *zName, sqlite3_file *pFile, int flags, int *pOutFlags ){ - ApndFile *p; - sqlite3_file *pSubFile; - sqlite3_vfs *pSubVfs; + ApndFile *pApndFile = (ApndFile*)pFile; + sqlite3_file *pBaseFile = ORIGFILE(pFile); + sqlite3_vfs *pBaseVfs = ORIGVFS(pApndVfs); int rc; - sqlite3_int64 sz; - pSubVfs = ORIGVFS(pVfs); + sqlite3_int64 sz = 0; if( (flags & SQLITE_OPEN_MAIN_DB)==0 ){ - return pSubVfs->xOpen(pSubVfs, zName, pFile, flags, pOutFlags); + /* The appendvfs is not to be used for transient or temporary databases. + ** Just use the base VFS open to initialize the given file object and + ** open the underlying file. (Appendvfs is then unused for this file.) + */ + return pBaseVfs->xOpen(pBaseVfs, zName, pFile, flags, pOutFlags); } - p = (ApndFile*)pFile; - memset(p, 0, sizeof(*p)); - pSubFile = ORIGFILE(pFile); + memset(pApndFile, 0, sizeof(ApndFile)); pFile->pMethods = &apnd_io_methods; - rc = pSubVfs->xOpen(pSubVfs, zName, pSubFile, flags, pOutFlags); - if( rc ) goto apnd_open_done; - rc = pSubFile->pMethods->xFileSize(pSubFile, &sz); + pApndFile->iMark = -1; /* Append mark not yet written */ + + rc = pBaseVfs->xOpen(pBaseVfs, zName, pBaseFile, flags, pOutFlags); + if( rc==SQLITE_OK ){ + rc = pBaseFile->pMethods->xFileSize(pBaseFile, &sz); + } if( rc ){ - pSubFile->pMethods->xClose(pSubFile); - goto apnd_open_done; + pBaseFile->pMethods->xClose(pBaseFile); + pFile->pMethods = 0; + return rc; } - if( apndIsOrdinaryDatabaseFile(sz, pSubFile) ){ - memmove(pFile, pSubFile, pSubVfs->szOsFile); + if( apndIsOrdinaryDatabaseFile(sz, pBaseFile) ){ + /* The file being opened appears to be just an ordinary DB. Copy + ** the base dispatch-table so this instance mimics the base VFS. + */ + memmove(pApndFile, pBaseFile, pBaseVfs->szOsFile); return SQLITE_OK; } - p->iMark = 0; - p->iPgOne = apndReadMark(sz, pFile); - if( p->iPgOne>0 ){ + pApndFile->iPgOne = apndReadMark(sz, pFile); + if( pApndFile->iPgOne>=0 ){ + pApndFile->iMark = sz - APND_MARK_SIZE; /* Append mark found */ return SQLITE_OK; } if( (flags & SQLITE_OPEN_CREATE)==0 ){ - pSubFile->pMethods->xClose(pSubFile); + pBaseFile->pMethods->xClose(pBaseFile); rc = SQLITE_CANTOPEN; + pFile->pMethods = 0; + }else{ + /* Round newly added appendvfs location to #define'd page boundary. + ** Note that nothing has yet been written to the underlying file. + ** The append mark will be written along with first content write. + ** Until then, paf->iMark value indicates it is not yet written. + */ + pApndFile->iPgOne = APND_START_ROUNDUP(sz); } - p->iPgOne = (sz+0xfff) & ~(sqlite3_int64)0xfff; -apnd_open_done: - if( rc ) pFile->pMethods = 0; return rc; *** 17973 LINES SKIPPED *** From owner-dev-commits-src-branches@freebsd.org Sun Jun 6 23:23:09 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A710E640C62; Sun, 6 Jun 2021 23:23: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 4FysxT47Hjz4kRS; Sun, 6 Jun 2021 23:23:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 75EE645A9; Sun, 6 Jun 2021 23:23:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 156NN9mX064541; Sun, 6 Jun 2021 23:23:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 156NN9Tl064540; Sun, 6 Jun 2021 23:23:09 GMT (envelope-from git) Date: Sun, 6 Jun 2021 23:23:09 GMT Message-Id: <202106062323.156NN9Tl064540@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 15077bc4b91f - stable/13 - tcp: improve handling of SYN segments in SYN-SENT state MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 15077bc4b91fc9c98eb5cd743d8386de2d3c1336 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jun 2021 23:23:09 -0000 The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=15077bc4b91fc9c98eb5cd743d8386de2d3c1336 commit 15077bc4b91fc9c98eb5cd743d8386de2d3c1336 Author: Michael Tuexen AuthorDate: 2021-03-22 14:58:49 +0000 Commit: Michael Tuexen CommitDate: 2021-06-02 21:20:26 +0000 tcp: improve handling of SYN segments in SYN-SENT state Ensure that the stack does not generate a DSACK block for user data received on a SYN segment in SYN-SENT state. Reviewed by: rscheff Differential Revision: https://reviews.freebsd.org/D29376 Sponsored by: Netflix, Inc. (cherry picked from commit 40f41ece765dc0b0907ca90796a1af4f4f89b2a0) --- sys/netinet/tcp_input.c | 4 +++- sys/netinet/tcp_stacks/bbr.c | 4 +++- sys/netinet/tcp_stacks/rack.c | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index b3d4ef5cf5de..397cbc5084e6 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -3157,7 +3157,9 @@ dodata: /* XXX */ thflags = tcp_reass(tp, th, &temp, &tlen, m); tp->t_flags |= TF_ACKNOW; } - if ((tp->t_flags & TF_SACK_PERMIT) && (save_tlen > 0)) { + if ((tp->t_flags & TF_SACK_PERMIT) && + (save_tlen > 0) && + TCPS_HAVEESTABLISHED(tp->t_state)) { if ((tlen == 0) && (SEQ_LT(save_start, save_rnxt))) { /* * DSACK actually handled in the fastpath diff --git a/sys/netinet/tcp_stacks/bbr.c b/sys/netinet/tcp_stacks/bbr.c index 49ed7e992fba..cc20d6bf52ca 100644 --- a/sys/netinet/tcp_stacks/bbr.c +++ b/sys/netinet/tcp_stacks/bbr.c @@ -8371,7 +8371,9 @@ bbr_process_data(struct mbuf *m, struct tcphdr *th, struct socket *so, thflags = tcp_reass(tp, th, &temp, &tlen, m); tp->t_flags |= TF_ACKNOW; } - if ((tp->t_flags & TF_SACK_PERMIT) && (save_tlen > 0)) { + if ((tp->t_flags & TF_SACK_PERMIT) && + (save_tlen > 0) && + TCPS_HAVEESTABLISHED(tp->t_state)) { if ((tlen == 0) && (SEQ_LT(save_start, save_rnxt))) { /* * DSACK actually handled in the fastpath diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index 4a883ee32c79..0ee73a95a6d7 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -8683,7 +8683,9 @@ rack_process_data(struct mbuf *m, struct tcphdr *th, struct socket *so, thflags = tcp_reass(tp, th, &temp, &tlen, m); tp->t_flags |= TF_ACKNOW; } - if ((tp->t_flags & TF_SACK_PERMIT) && (save_tlen > 0)) { + if ((tp->t_flags & TF_SACK_PERMIT) && + (save_tlen > 0) && + TCPS_HAVEESTABLISHED(tp->t_state)) { if ((tlen == 0) && (SEQ_LT(save_start, save_rnxt))) { /* * DSACK actually handled in the fastpath From owner-dev-commits-src-branches@freebsd.org Sun Jun 6 23:25:15 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B07766410CE; Sun, 6 Jun 2021 23:25: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 4Fyszv4Yqxz4knd; Sun, 6 Jun 2021 23:25:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 84DBD44FB; Sun, 6 Jun 2021 23:25:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 156NPFTo064787; Sun, 6 Jun 2021 23:25:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 156NPFQn064786; Sun, 6 Jun 2021 23:25:15 GMT (envelope-from git) Date: Sun, 6 Jun 2021 23:25:15 GMT Message-Id: <202106062325.156NPFQn064786@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: abcf615834dd - stable/13 - sctp: fix handling of RTO.initial of 1 ms MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: abcf615834dd85c34eaa42e895d7a31dba5adedf Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jun 2021 23:25:15 -0000 The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=abcf615834dd85c34eaa42e895d7a31dba5adedf commit abcf615834dd85c34eaa42e895d7a31dba5adedf Author: Michael Tuexen AuthorDate: 2021-03-22 15:40:41 +0000 Commit: Michael Tuexen CommitDate: 2021-06-02 21:36:40 +0000 sctp: fix handling of RTO.initial of 1 ms Reported by: syzbot+5eb0e009147050056ce9@syzkaller.appspotmail.com (cherry picked from commit d995cc7e5431873b839269fe22577acfa3b157bd) --- sys/netinet/sctputil.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/netinet/sctputil.c b/sys/netinet/sctputil.c index 7ddb4c3710df..5d4b3347a2c9 100644 --- a/sys/netinet/sctputil.c +++ b/sys/netinet/sctputil.c @@ -2277,7 +2277,9 @@ sctp_timer_start(int t_type, struct sctp_inpcb *inp, struct sctp_tcb *stcb, } rndval = sctp_select_initial_TSN(&inp->sctp_ep); jitter = rndval % to_ticks; - to_ticks >>= 1; + if (to_ticks > 1) { + to_ticks >>= 1; + } if (jitter < (UINT32_MAX - to_ticks)) { to_ticks += jitter; } else { From owner-dev-commits-src-branches@freebsd.org Sun Jun 6 23:27:19 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7F3066410EB; Sun, 6 Jun 2021 23: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 4Fyt2H3B5vz4kcQ; Sun, 6 Jun 2021 23:27:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 54EAE43DF; Sun, 6 Jun 2021 23:27:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 156NRJ3v065031; Sun, 6 Jun 2021 23:27:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 156NRJo8065030; Sun, 6 Jun 2021 23:27:19 GMT (envelope-from git) Date: Sun, 6 Jun 2021 23:27:19 GMT Message-Id: <202106062327.156NRJo8065030@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 57e0431da113 - stable/13 - sctp: small cleanup, no functional change MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 57e0431da1133daf59dd9d154ba17b7f15a71cdc Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jun 2021 23:27:19 -0000 The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=57e0431da1133daf59dd9d154ba17b7f15a71cdc commit 57e0431da1133daf59dd9d154ba17b7f15a71cdc Author: Michael Tuexen AuthorDate: 2021-04-26 00:56:48 +0000 Commit: Michael Tuexen CommitDate: 2021-06-02 21:38:17 +0000 sctp: small cleanup, no functional change (cherry picked from commit 163153c2a0809d2710e607463dcb24c7f795e156) --- sys/netinet/sctp_input.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/sys/netinet/sctp_input.c b/sys/netinet/sctp_input.c index 43a2b06d1c79..5b4c3152da0d 100644 --- a/sys/netinet/sctp_input.c +++ b/sys/netinet/sctp_input.c @@ -3412,19 +3412,16 @@ sctp_find_stream_reset(struct sctp_tcb *stcb, uint32_t seq, struct sctp_tmit_chu int len, clen; asoc = &stcb->asoc; - if (TAILQ_EMPTY(&stcb->asoc.control_send_queue)) { - asoc->stream_reset_outstanding = 0; - return (NULL); - } - if (stcb->asoc.str_reset == NULL) { + chk = asoc->str_reset; + if (TAILQ_EMPTY(&asoc->control_send_queue) || + (chk == NULL)) { asoc->stream_reset_outstanding = 0; return (NULL); } - chk = stcb->asoc.str_reset; if (chk->data == NULL) { return (NULL); } - if (bchk) { + if (bchk != NULL) { /* he wants a copy of the chk pointer */ *bchk = chk; } From owner-dev-commits-src-branches@freebsd.org Sun Jun 6 23:28:50 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B623A641409; Sun, 6 Jun 2021 23:28: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 4Fyt424MXfz4kXf; Sun, 6 Jun 2021 23:28:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7E07843E0; Sun, 6 Jun 2021 23:28:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 156NSoFp065235; Sun, 6 Jun 2021 23:28:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 156NSojN065234; Sun, 6 Jun 2021 23:28:50 GMT (envelope-from git) Date: Sun, 6 Jun 2021 23:28:50 GMT Message-Id: <202106062328.156NSojN065234@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: f7b539eb6d83 - stable/13 - sctp: improve handling of illegal packets containing INIT chunks MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f7b539eb6d8331daefbb9faa01973b76923cb44d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jun 2021 23:28:50 -0000 The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=f7b539eb6d8331daefbb9faa01973b76923cb44d commit f7b539eb6d8331daefbb9faa01973b76923cb44d Author: Michael Tuexen AuthorDate: 2021-04-26 08:38:05 +0000 Commit: Michael Tuexen CommitDate: 2021-06-02 21:40:11 +0000 sctp: improve handling of illegal packets containing INIT chunks Stop further processing of a packet when detecting that it contains an INIT chunk, which is too small or is not the only chunk in the packet. Still allow to finish the processing of chunks before the INIT chunk. Thanks to Antoly Korniltsev and Taylor Brandstetter for reporting an issue with the userland stack, which made me aware of this issue. (cherry picked from commit c70d1ef15db0d994eff4a2c4d9feabdc46bff1c6) --- sys/netinet/sctp_input.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/sys/netinet/sctp_input.c b/sys/netinet/sctp_input.c index 5b4c3152da0d..c70358f0af07 100644 --- a/sys/netinet/sctp_input.c +++ b/sys/netinet/sctp_input.c @@ -4611,10 +4611,7 @@ process_control_chunks: chunk_buf); if (ch == NULL) { *offset = length; - if (stcb != NULL) { - SCTP_TCB_UNLOCK(stcb); - } - return (NULL); + return (stcb); } num_chunks++; @@ -4648,12 +4645,12 @@ process_control_chunks: /* The INIT chunk must be the only chunk. */ if ((num_chunks > 1) || (length - *offset > (int)SCTP_SIZE32(chk_length))) { - /* RFC 4960 requires that no ABORT is sent */ + /* + * RFC 4960bis requires stopping the + * processing of the packet. + */ *offset = length; - if (stcb != NULL) { - SCTP_TCB_UNLOCK(stcb); - } - return (NULL); + return (stcb); } /* Honor our resource limit. */ if (chk_length > SCTP_LARGEST_INIT_ACCEPTED) { From owner-dev-commits-src-branches@freebsd.org Sun Jun 6 23:30:06 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 367AC6412A8; Sun, 6 Jun 2021 23:30: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 4Fyt5V14KTz4l36; Sun, 6 Jun 2021 23:30:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0CAFD44FD; Sun, 6 Jun 2021 23:30:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 156NU5Se067863; Sun, 6 Jun 2021 23:30:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 156NU5JK067860; Sun, 6 Jun 2021 23:30:05 GMT (envelope-from git) Date: Sun, 6 Jun 2021 23:30:05 GMT Message-Id: <202106062330.156NU5JK067860@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 54be3bf824e8 - stable/13 - sctp: cleanup verification of INIT and INIT-ACK chunks MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 54be3bf824e8158981ed6c3cf3d53c9e131480ff Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jun 2021 23:30:06 -0000 The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=54be3bf824e8158981ed6c3cf3d53c9e131480ff commit 54be3bf824e8158981ed6c3cf3d53c9e131480ff Author: Michael Tuexen AuthorDate: 2021-04-27 10:45:14 +0000 Commit: Michael Tuexen CommitDate: 2021-06-02 21:41:39 +0000 sctp: cleanup verification of INIT and INIT-ACK chunks (cherry picked from commit 059ec2225c00cc18ed9745d733cc9aa0dbd9eaa2) --- sys/netinet/sctp_input.c | 94 ++++++------------------------------------------ 1 file changed, 10 insertions(+), 84 deletions(-) diff --git a/sys/netinet/sctp_input.c b/sys/netinet/sctp_input.c index c70358f0af07..51041ed67c58 100644 --- a/sys/netinet/sctp_input.c +++ b/sys/netinet/sctp_input.c @@ -98,49 +98,12 @@ sctp_handle_init(struct mbuf *m, int iphlen, int offset, if (stcb == NULL) { SCTP_INP_RLOCK(inp); } - /* validate length */ - if (ntohs(cp->ch.chunk_length) < sizeof(struct sctp_init_chunk)) { - op_err = sctp_generate_cause(SCTP_CAUSE_INVALID_PARAM, ""); - sctp_abort_association(inp, stcb, m, iphlen, src, dst, sh, op_err, - mflowtype, mflowid, - vrf_id, port); - if (stcb) - *abort_no_unlock = 1; - goto outnow; - } - /* validate parameters */ + /* Validate parameters */ init = &cp->init; - if (init->initiate_tag == 0) { - /* protocol error... send abort */ - op_err = sctp_generate_cause(SCTP_CAUSE_INVALID_PARAM, ""); - sctp_abort_association(inp, stcb, m, iphlen, src, dst, sh, op_err, - mflowtype, mflowid, - vrf_id, port); - if (stcb) - *abort_no_unlock = 1; - goto outnow; - } - if (ntohl(init->a_rwnd) < SCTP_MIN_RWND) { - /* invalid parameter... send abort */ - op_err = sctp_generate_cause(SCTP_CAUSE_INVALID_PARAM, ""); - sctp_abort_association(inp, stcb, m, iphlen, src, dst, sh, op_err, - mflowtype, mflowid, - vrf_id, port); - if (stcb) - *abort_no_unlock = 1; - goto outnow; - } - if (init->num_inbound_streams == 0) { - /* protocol error... send abort */ - op_err = sctp_generate_cause(SCTP_CAUSE_INVALID_PARAM, ""); - sctp_abort_association(inp, stcb, m, iphlen, src, dst, sh, op_err, - mflowtype, mflowid, - vrf_id, port); - if (stcb) - *abort_no_unlock = 1; - goto outnow; - } - if (init->num_outbound_streams == 0) { + if ((ntohl(init->initiate_tag) == 0) || + (ntohl(init->a_rwnd) < SCTP_MIN_RWND) || + (ntohs(init->num_inbound_streams) == 0) || + (ntohs(init->num_outbound_streams) == 0)) { /* protocol error... send abort */ op_err = sctp_generate_cause(SCTP_CAUSE_INVALID_PARAM, ""); sctp_abort_association(inp, stcb, m, iphlen, src, dst, sh, op_err, @@ -1277,49 +1240,12 @@ sctp_handle_init_ack(struct mbuf *m, int iphlen, int offset, "sctp_handle_init_ack: TCB is null\n"); return (-1); } - if (ntohs(cp->ch.chunk_length) < sizeof(struct sctp_init_ack_chunk)) { - /* Invalid length */ - op_err = sctp_generate_cause(SCTP_CAUSE_INVALID_PARAM, ""); - sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, - src, dst, sh, op_err, - mflowtype, mflowid, - vrf_id, net->port); - *abort_no_unlock = 1; - return (-1); - } init_ack = &cp->init; - /* validate parameters */ - if (init_ack->initiate_tag == 0) { - /* protocol error... send an abort */ - op_err = sctp_generate_cause(SCTP_CAUSE_INVALID_PARAM, ""); - sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, - src, dst, sh, op_err, - mflowtype, mflowid, - vrf_id, net->port); - *abort_no_unlock = 1; - return (-1); - } - if (ntohl(init_ack->a_rwnd) < SCTP_MIN_RWND) { - /* protocol error... send an abort */ - op_err = sctp_generate_cause(SCTP_CAUSE_INVALID_PARAM, ""); - sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, - src, dst, sh, op_err, - mflowtype, mflowid, - vrf_id, net->port); - *abort_no_unlock = 1; - return (-1); - } - if (init_ack->num_inbound_streams == 0) { - /* protocol error... send an abort */ - op_err = sctp_generate_cause(SCTP_CAUSE_INVALID_PARAM, ""); - sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, - src, dst, sh, op_err, - mflowtype, mflowid, - vrf_id, net->port); - *abort_no_unlock = 1; - return (-1); - } - if (init_ack->num_outbound_streams == 0) { + /* Validate parameters. */ + if ((ntohl(init_ack->initiate_tag) == 0) || + (ntohl(init_ack->a_rwnd) < SCTP_MIN_RWND) || + (ntohs(init_ack->num_inbound_streams) == 0) || + (ntohs(init_ack->num_outbound_streams) == 0)) { /* protocol error... send an abort */ op_err = sctp_generate_cause(SCTP_CAUSE_INVALID_PARAM, ""); sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, From owner-dev-commits-src-branches@freebsd.org Sun Jun 6 23:31:27 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8D7F4641432; Sun, 6 Jun 2021 23:31: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 4Fyt733cs1z4l19; Sun, 6 Jun 2021 23:31:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 64FFD48B2; Sun, 6 Jun 2021 23:31:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 156NVRnP075371; Sun, 6 Jun 2021 23:31:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 156NVRh5075370; Sun, 6 Jun 2021 23:31:27 GMT (envelope-from git) Date: Sun, 6 Jun 2021 23:31:27 GMT Message-Id: <202106062331.156NVRh5075370@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 0cbc89fe44fd - stable/13 - sctp: improve consistency in handling chunks with wrong size MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 0cbc89fe44fd606a731268821e6a151ce077e110 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jun 2021 23:31:27 -0000 The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=0cbc89fe44fd606a731268821e6a151ce077e110 commit 0cbc89fe44fd606a731268821e6a151ce077e110 Author: Michael Tuexen AuthorDate: 2021-04-28 16:09:11 +0000 Commit: Michael Tuexen CommitDate: 2021-06-02 21:42:49 +0000 sctp: improve consistency in handling chunks with wrong size Just skip the chunk, if no other handling is required by the specification. (cherry picked from commit 9de7354bb8e0c7821aa90db3486605f933c6796d) --- sys/netinet/sctp_input.c | 150 +++++++++++++++++++++++------------------------ 1 file changed, 74 insertions(+), 76 deletions(-) diff --git a/sys/netinet/sctp_input.c b/sys/netinet/sctp_input.c index 51041ed67c58..0790e6f4d2db 100644 --- a/sys/netinet/sctp_input.c +++ b/sys/netinet/sctp_input.c @@ -4294,6 +4294,7 @@ sctp_process_control(struct mbuf *m, int iphlen, int *offset, int length, int ret; int abort_no_unlock = 0; int ecne_seen = 0; + int abort_flag; /* * How big should this be, and should it be alloc'd? Lets try the @@ -4773,8 +4774,7 @@ process_control_chunks: SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_HEARTBEAT_ACK\n"); if ((stcb == NULL) || (chk_length != sizeof(struct sctp_heartbeat_chunk))) { /* Its not ours */ - *offset = length; - return (stcb); + break; } SCTP_STAT_INCR(sctps_recvheartbeatack); if ((netp != NULL) && (*netp != NULL)) { @@ -4800,12 +4800,10 @@ process_control_chunks: SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_SHUTDOWN, stcb %p\n", (void *)stcb); if ((stcb == NULL) || (chk_length != sizeof(struct sctp_shutdown_chunk))) { - *offset = length; - return (stcb); + break; } if ((netp != NULL) && (*netp != NULL)) { - int abort_flag = 0; - + abort_flag = 0; sctp_handle_shutdown((struct sctp_shutdown_chunk *)ch, stcb, *netp, &abort_flag); if (abort_flag) { @@ -4956,7 +4954,7 @@ process_control_chunks: case SCTP_COOKIE_ACK: SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_COOKIE_ACK, stcb %p\n", (void *)stcb); if ((stcb == NULL) || chk_length != sizeof(struct sctp_cookie_ack_chunk)) { - return (stcb); + break; } if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) { /* We are not interested anymore */ @@ -4975,26 +4973,29 @@ process_control_chunks: break; case SCTP_ECN_ECHO: SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_ECN_ECHO\n"); - if ((stcb == NULL) || (chk_length != sizeof(struct sctp_ecne_chunk))) { - /* Its not ours */ - *offset = length; - return (stcb); + if (stcb == NULL) { + break; } if (stcb->asoc.ecn_supported == 0) { goto unknown_chunk; } + if (chk_length != sizeof(struct sctp_ecne_chunk)) { + break; + } sctp_handle_ecn_echo((struct sctp_ecne_chunk *)ch, stcb); ecne_seen = 1; break; case SCTP_ECN_CWR: SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_ECN_CWR\n"); - if ((stcb == NULL) || (chk_length != sizeof(struct sctp_cwr_chunk))) { - *offset = length; - return (stcb); + if (stcb == NULL) { + break; } if (stcb->asoc.ecn_supported == 0) { goto unknown_chunk; } + if (chk_length != sizeof(struct sctp_cwr_chunk)) { + break; + } sctp_handle_ecn_cwr((struct sctp_cwr_chunk *)ch, stcb, *netp); break; case SCTP_SHUTDOWN_COMPLETE: @@ -5025,15 +5026,16 @@ process_control_chunks: break; case SCTP_ASCONF_ACK: SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_ASCONF_ACK\n"); + if (stcb == NULL) { + break; + } + if (stcb->asoc.asconf_supported == 0) { + goto unknown_chunk; + } if (chk_length < sizeof(struct sctp_asconf_ack_chunk)) { - /* Its not ours */ - *offset = length; - return (stcb); + break; } - if ((stcb != NULL) && (netp != NULL) && (*netp != NULL)) { - if (stcb->asoc.asconf_supported == 0) { - goto unknown_chunk; - } + if ((netp != NULL) && (*netp != NULL)) { /* He's alive so give him credit */ if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_THRESHOLD_LOGGING) { sctp_misc_ints(SCTP_THRESHOLD_CLEAR, @@ -5053,61 +5055,58 @@ process_control_chunks: case SCTP_IFORWARD_CUM_TSN: SCTPDBG(SCTP_DEBUG_INPUT3, "%s\n", ch->chunk_type == SCTP_FORWARD_CUM_TSN ? "FORWARD_TSN" : "I_FORWARD_TSN"); + if (stcb == NULL) { + break; + } + if (stcb->asoc.prsctp_supported == 0) { + goto unknown_chunk; + } if (chk_length < sizeof(struct sctp_forward_tsn_chunk)) { - /* Its not ours */ - *offset = length; - return (stcb); + break; } - - if (stcb != NULL) { - int abort_flag = 0; - - if (stcb->asoc.prsctp_supported == 0) { - goto unknown_chunk; - } - if (((stcb->asoc.idata_supported == 1) && (ch->chunk_type == SCTP_FORWARD_CUM_TSN)) || - ((stcb->asoc.idata_supported == 0) && (ch->chunk_type == SCTP_IFORWARD_CUM_TSN))) { - if (ch->chunk_type == SCTP_FORWARD_CUM_TSN) { - SCTP_SNPRINTF(msg, sizeof(msg), "%s", "FORWARD-TSN chunk received when I-FORWARD-TSN was negotiated"); - } else { - SCTP_SNPRINTF(msg, sizeof(msg), "%s", "I-FORWARD-TSN chunk received when FORWARD-TSN was negotiated"); - } - op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); - sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); - *offset = length; - return (NULL); - } - *fwd_tsn_seen = 1; - if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) { - /* We are not interested anymore */ - (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, - SCTP_FROM_SCTP_INPUT + SCTP_LOC_31); - *offset = length; - return (NULL); - } - /* - * For sending a SACK this looks like DATA - * chunks. - */ - stcb->asoc.last_data_chunk_from = stcb->asoc.last_control_chunk_from; - sctp_handle_forward_tsn(stcb, - (struct sctp_forward_tsn_chunk *)ch, &abort_flag, m, *offset); - if (abort_flag) { - *offset = length; - return (NULL); + if (((stcb->asoc.idata_supported == 1) && (ch->chunk_type == SCTP_FORWARD_CUM_TSN)) || + ((stcb->asoc.idata_supported == 0) && (ch->chunk_type == SCTP_IFORWARD_CUM_TSN))) { + if (ch->chunk_type == SCTP_FORWARD_CUM_TSN) { + SCTP_SNPRINTF(msg, sizeof(msg), "%s", "FORWARD-TSN chunk received when I-FORWARD-TSN was negotiated"); + } else { + SCTP_SNPRINTF(msg, sizeof(msg), "%s", "I-FORWARD-TSN chunk received when FORWARD-TSN was negotiated"); } + op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); + sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); + *offset = length; + return (NULL); + } + *fwd_tsn_seen = 1; + if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) { + /* We are not interested anymore */ + (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, + SCTP_FROM_SCTP_INPUT + SCTP_LOC_31); + *offset = length; + return (NULL); + } + /* + * For sending a SACK this looks like DATA chunks. + */ + stcb->asoc.last_data_chunk_from = stcb->asoc.last_control_chunk_from; + abort_flag = 0; + sctp_handle_forward_tsn(stcb, + (struct sctp_forward_tsn_chunk *)ch, &abort_flag, m, *offset); + if (abort_flag) { + *offset = length; + return (NULL); } break; case SCTP_STREAM_RESET: SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_STREAM_RESET\n"); - if ((stcb == NULL) || (chk_length < sizeof(struct sctp_stream_reset_tsn_req))) { - /* Its not ours */ - *offset = length; - return (stcb); + if (stcb == NULL) { + break; } if (stcb->asoc.reconfig_supported == 0) { goto unknown_chunk; } + if (chk_length < sizeof(struct sctp_stream_reset_tsn_req)) { + break; + } if (sctp_handle_stream_reset(stcb, m, *offset, ch)) { /* stop processing */ *offset = length; @@ -5116,17 +5115,16 @@ process_control_chunks: break; case SCTP_PACKET_DROPPED: SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_PACKET_DROPPED\n"); - /* re-get it all please */ + if (stcb == NULL) { + break; + } + if (stcb->asoc.pktdrop_supported == 0) { + goto unknown_chunk; + } if (chk_length < sizeof(struct sctp_pktdrop_chunk)) { - /* Its not ours */ - *offset = length; - return (stcb); + break; } - - if ((stcb != NULL) && (netp != NULL) && (*netp != NULL)) { - if (stcb->asoc.pktdrop_supported == 0) { - goto unknown_chunk; - } + if ((netp != NULL) && (*netp != NULL)) { sctp_handle_packet_dropped((struct sctp_pktdrop_chunk *)ch, stcb, *netp, min(chk_length, contiguous)); @@ -5142,7 +5140,7 @@ process_control_chunks: auth_skipped = 1; } /* skip this chunk (temporarily) */ - goto next_chunk; + break; } if (stcb->asoc.auth_supported == 0) { goto unknown_chunk; @@ -5156,7 +5154,7 @@ process_control_chunks: } if (got_auth == 1) { /* skip this chunk... it's already auth'd */ - goto next_chunk; + break; } got_auth = 1; if (sctp_handle_auth(stcb, (struct sctp_auth_chunk *)ch, m, *offset)) { From owner-dev-commits-src-branches@freebsd.org Sun Jun 6 23:32:06 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A216B641785; Sun, 6 Jun 2021 23:32: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 4Fyt7p2twpz4l8N; Sun, 6 Jun 2021 23:32:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4CF244843; Sun, 6 Jun 2021 23:32:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 156NW66w078496; Sun, 6 Jun 2021 23:32:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 156NW6CQ078495; Sun, 6 Jun 2021 23:32:06 GMT (envelope-from git) Date: Sun, 6 Jun 2021 23:32:06 GMT Message-Id: <202106062332.156NW6CQ078495@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 6b1dfc549caf - stable/13 - sctp: use RTO.Initial of 1 second as specified in RFC 4960bis MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6b1dfc549caf2de3cc2b785a86257eedae491bdf Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jun 2021 23:32:06 -0000 The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=6b1dfc549caf2de3cc2b785a86257eedae491bdf commit 6b1dfc549caf2de3cc2b785a86257eedae491bdf Author: Michael Tuexen AuthorDate: 2021-04-29 22:45:56 +0000 Commit: Michael Tuexen CommitDate: 2021-06-02 21:44:10 +0000 sctp: use RTO.Initial of 1 second as specified in RFC 4960bis (cherry picked from commit eecdf5220b1a559e4b58c3c21daf502e3fbfd1cd) --- sys/netinet/sctp_constants.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet/sctp_constants.h b/sys/netinet/sctp_constants.h index 28c543f88045..197b93791944 100644 --- a/sys/netinet/sctp_constants.h +++ b/sys/netinet/sctp_constants.h @@ -596,7 +596,7 @@ __FBSDID("$FreeBSD$"); #define SCTP_RTO_UPPER_BOUND (60000) /* 60 sec in ms */ #define SCTP_RTO_LOWER_BOUND (1000) /* 1 sec is ms */ -#define SCTP_RTO_INITIAL (3000) /* 3 sec in ms */ +#define SCTP_RTO_INITIAL (1000) /* 1 sec in ms */ #define SCTP_INP_KILL_TIMEOUT 20 /* number of ms to retry kill of inpcb */ #define SCTP_ASOC_KILL_TIMEOUT 10 /* number of ms to retry kill of inpcb */ From owner-dev-commits-src-branches@freebsd.org Sun Jun 6 23:34:16 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7451564169A; Sun, 6 Jun 2021 23:34: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 4FytBJ2s4Mz4kwK; Sun, 6 Jun 2021 23:34:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 404B0484A; Sun, 6 Jun 2021 23:34:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 156NYGRT078791; Sun, 6 Jun 2021 23:34:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 156NYG5T078790; Sun, 6 Jun 2021 23:34:16 GMT (envelope-from git) Date: Sun, 6 Jun 2021 23:34:16 GMT Message-Id: <202106062334.156NYG5T078790@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 4e71474ed97a - stable/13 - sctp: fix SCTP_PEER_ADDR_PARAMS socket option MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4e71474ed97a39aa8f0c6fcfa9136555dde89d64 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jun 2021 23:34:16 -0000 The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=4e71474ed97a39aa8f0c6fcfa9136555dde89d64 commit 4e71474ed97a39aa8f0c6fcfa9136555dde89d64 Author: Michael Tuexen AuthorDate: 2021-04-30 10:27:47 +0000 Commit: Michael Tuexen CommitDate: 2021-06-02 21:44:46 +0000 sctp: fix SCTP_PEER_ADDR_PARAMS socket option Ignore spp_pathmtu if it is 0, when setting the IPPROTO_SCTP level socket option SCTP_PEER_ADDR_PARAMS as required by RFC 6458. (cherry picked from commit eb79855920ffa33d6c096221eac9cc9a6d7a484b) --- sys/netinet/sctp_usrreq.c | 72 ++++++++++++++++++++++++++--------------------- 1 file changed, 40 insertions(+), 32 deletions(-) diff --git a/sys/netinet/sctp_usrreq.c b/sys/netinet/sctp_usrreq.c index fb3e398c2878..238c20c0e368 100644 --- a/sys/netinet/sctp_usrreq.c +++ b/sys/netinet/sctp_usrreq.c @@ -5325,6 +5325,7 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize, return (EINVAL); } if ((paddrp->spp_flags & SPP_PMTUD_DISABLE) && + (paddrp->spp_pathmtu > 0) && ((paddrp->spp_pathmtu < SCTP_SMALLEST_PMTU) || (paddrp->spp_pathmtu > SCTP_LARGEST_PMTU))) { if (stcb) @@ -5369,23 +5370,25 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize, SCTP_FROM_SCTP_USRREQ + SCTP_LOC_11); } net->dest_state |= SCTP_ADDR_NO_PMTUD; - net->mtu = paddrp->spp_pathmtu; - switch (net->ro._l_addr.sa.sa_family) { + if (paddrp->spp_pathmtu > 0) { + net->mtu = paddrp->spp_pathmtu; + switch (net->ro._l_addr.sa.sa_family) { #ifdef INET - case AF_INET: - net->mtu += SCTP_MIN_V4_OVERHEAD; - break; + case AF_INET: + net->mtu += SCTP_MIN_V4_OVERHEAD; + break; #endif #ifdef INET6 - case AF_INET6: - net->mtu += SCTP_MIN_OVERHEAD; - break; + case AF_INET6: + net->mtu += SCTP_MIN_OVERHEAD; + break; #endif - default: - break; - } - if (net->mtu < stcb->asoc.smallest_mtu) { - sctp_pathmtu_adjustment(stcb, net->mtu); + default: + break; + } + if (net->mtu < stcb->asoc.smallest_mtu) { + sctp_pathmtu_adjustment(stcb, net->mtu); + } } } if (paddrp->spp_flags & SPP_PMTUD_ENABLE) { @@ -5394,7 +5397,7 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize, } net->dest_state &= ~SCTP_ADDR_NO_PMTUD; } - if (paddrp->spp_pathmaxrxt) { + if (paddrp->spp_pathmaxrxt > 0) { if (net->dest_state & SCTP_ADDR_PF) { if (net->error_count > paddrp->spp_pathmaxrxt) { net->dest_state &= ~SCTP_ADDR_PF; @@ -5437,7 +5440,7 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize, #endif } else { /************************ASSOC ONLY -- NO NET SPECIFIC SET ******************/ - if (paddrp->spp_pathmaxrxt != 0) { + if (paddrp->spp_pathmaxrxt > 0) { stcb->asoc.def_net_failure = paddrp->spp_pathmaxrxt; TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { if (net->dest_state & SCTP_ADDR_PF) { @@ -5469,7 +5472,6 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize, net->failure_threshold = paddrp->spp_pathmaxrxt; } } - if (paddrp->spp_flags & SPP_HB_ENABLE) { if (paddrp->spp_hbinterval != 0) { stcb->asoc.heart_beat_delay = paddrp->spp_hbinterval; @@ -5512,26 +5514,30 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize, SCTP_FROM_SCTP_USRREQ + SCTP_LOC_16); } net->dest_state |= SCTP_ADDR_NO_PMTUD; - net->mtu = paddrp->spp_pathmtu; - switch (net->ro._l_addr.sa.sa_family) { + if (paddrp->spp_pathmtu > 0) { + net->mtu = paddrp->spp_pathmtu; + switch (net->ro._l_addr.sa.sa_family) { #ifdef INET - case AF_INET: - net->mtu += SCTP_MIN_V4_OVERHEAD; - break; + case AF_INET: + net->mtu += SCTP_MIN_V4_OVERHEAD; + break; #endif #ifdef INET6 - case AF_INET6: - net->mtu += SCTP_MIN_OVERHEAD; - break; + case AF_INET6: + net->mtu += SCTP_MIN_OVERHEAD; + break; #endif - default: - break; - } - if (net->mtu < stcb->asoc.smallest_mtu) { - sctp_pathmtu_adjustment(stcb, net->mtu); + default: + break; + } + if (net->mtu < stcb->asoc.smallest_mtu) { + sctp_pathmtu_adjustment(stcb, net->mtu); + } } } - stcb->asoc.default_mtu = paddrp->spp_pathmtu; + if (paddrp->spp_pathmtu > 0) { + stcb->asoc.default_mtu = paddrp->spp_pathmtu; + } sctp_stcb_feature_on(inp, stcb, SCTP_PCB_FLAGS_DO_NOT_PMTUD); } if (paddrp->spp_flags & SPP_PMTUD_ENABLE) { @@ -5578,7 +5584,7 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize, * set it with the options on the * socket */ - if (paddrp->spp_pathmaxrxt != 0) { + if (paddrp->spp_pathmaxrxt > 0) { inp->sctp_ep.def_net_failure = paddrp->spp_pathmaxrxt; } @@ -5604,7 +5610,9 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize, inp->sctp_ep.default_mtu = 0; sctp_feature_off(inp, SCTP_PCB_FLAGS_DO_NOT_PMTUD); } else if (paddrp->spp_flags & SPP_PMTUD_DISABLE) { - inp->sctp_ep.default_mtu = paddrp->spp_pathmtu; + if (paddrp->spp_pathmtu > 0) { + inp->sctp_ep.default_mtu = paddrp->spp_pathmtu; + } sctp_feature_on(inp, SCTP_PCB_FLAGS_DO_NOT_PMTUD); } if (paddrp->spp_flags & SPP_DSCP) { From owner-dev-commits-src-branches@freebsd.org Sun Jun 6 23:35:27 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 276F764133E; Sun, 6 Jun 2021 23:35: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 4FytCg0b7vz4lCf; Sun, 6 Jun 2021 23:35:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F08F648C8; Sun, 6 Jun 2021 23:35:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 156NZQXR078987; Sun, 6 Jun 2021 23:35:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 156NZQbu078986; Sun, 6 Jun 2021 23:35:26 GMT (envelope-from git) Date: Sun, 6 Jun 2021 23:35:26 GMT Message-Id: <202106062335.156NZQbu078986@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 1f663bc4baeb - stable/13 - sctp: update the vtag for INIT and INIT-ACK chunks MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1f663bc4baeb984a256f939eb6e019e61f400e3b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jun 2021 23:35:27 -0000 The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=1f663bc4baeb984a256f939eb6e019e61f400e3b commit 1f663bc4baeb984a256f939eb6e019e61f400e3b Author: Michael Tuexen AuthorDate: 2021-04-30 11:31:38 +0000 Commit: Michael Tuexen CommitDate: 2021-06-02 21:47:00 +0000 sctp: update the vtag for INIT and INIT-ACK chunks This is needed in case of responding with an ABORT to an INIT-ACK. (cherry picked from commit e010d20032c8c2a04da103b3402a8d24bd682dd5) --- sys/netinet/sctputil.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sys/netinet/sctputil.c b/sys/netinet/sctputil.c index 5d4b3347a2c9..2c10ab158c83 100644 --- a/sys/netinet/sctputil.c +++ b/sys/netinet/sctputil.c @@ -4553,7 +4553,7 @@ sctp_handle_ootb(struct mbuf *m, int iphlen, int offset, * if there is return 1, else return 0. */ int -sctp_is_there_an_abort_here(struct mbuf *m, int iphlen, uint32_t *vtagfill) +sctp_is_there_an_abort_here(struct mbuf *m, int iphlen, uint32_t *vtag) { struct sctp_chunkhdr *ch; struct sctp_init_chunk *init_chk, chunk_buf; @@ -4574,12 +4574,13 @@ sctp_is_there_an_abort_here(struct mbuf *m, int iphlen, uint32_t *vtagfill) /* yep, tell them */ return (1); } - if (ch->chunk_type == SCTP_INITIATION) { + if ((ch->chunk_type == SCTP_INITIATION) || + (ch->chunk_type == SCTP_INITIATION_ACK)) { /* need to update the Vtag */ init_chk = (struct sctp_init_chunk *)sctp_m_getptr(m, - offset, sizeof(*init_chk), (uint8_t *)&chunk_buf); + offset, sizeof(struct sctp_init_chunk), (uint8_t *)&chunk_buf); if (init_chk != NULL) { - *vtagfill = ntohl(init_chk->init.initiate_tag); + *vtag = ntohl(init_chk->init.initiate_tag); } } /* Nope, move to the next chunk */ From owner-dev-commits-src-branches@freebsd.org Sun Jun 6 23:39:04 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A0FD46416D5; Sun, 6 Jun 2021 23:39: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 4FytHr48nDz4ldH; Sun, 6 Jun 2021 23:39:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 76DCA48C9; Sun, 6 Jun 2021 23:39:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 156Nd4tZ079344; Sun, 6 Jun 2021 23:39:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 156Nd4ad079343; Sun, 6 Jun 2021 23:39:04 GMT (envelope-from git) Date: Sun, 6 Jun 2021 23:39:04 GMT Message-Id: <202106062339.156Nd4ad079343@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 7f1b88c36e06 - stable/13 - sctp: improve error handling in INIT/INIT-ACK processing MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7f1b88c36e067695392b0e3b64aff36bef82bb45 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jun 2021 23:39:04 -0000 The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=7f1b88c36e067695392b0e3b64aff36bef82bb45 commit 7f1b88c36e067695392b0e3b64aff36bef82bb45 Author: Michael Tuexen AuthorDate: 2021-05-02 20:38:27 +0000 Commit: Michael Tuexen CommitDate: 2021-06-02 21:48:13 +0000 sctp: improve error handling in INIT/INIT-ACK processing When processing INIT and INIT-ACK information, also during COOKIE processing, delete the current association, when it would end up in an inconsistent state. (cherry picked from commit 5f2e1835054ee84f2e68ebc890d92716a91775b7) --- sys/netinet/sctp_input.c | 101 +++++++++++++++++++++++++++++++++-------------- 1 file changed, 72 insertions(+), 29 deletions(-) diff --git a/sys/netinet/sctp_input.c b/sys/netinet/sctp_input.c index 0790e6f4d2db..072322ea074a 100644 --- a/sys/netinet/sctp_input.c +++ b/sys/netinet/sctp_input.c @@ -449,18 +449,24 @@ sctp_process_init_ack(struct mbuf *m, int iphlen, int offset, asoc = &stcb->asoc; asoc->peer_supports_nat = (uint8_t)nat_friendly; /* process the peer's parameters in the INIT-ACK */ - retval = sctp_process_init((struct sctp_init_chunk *)cp, stcb); - if (retval < 0) { + if (sctp_process_init((struct sctp_init_chunk *)cp, stcb) < 0) { if (op_err != NULL) { sctp_m_freem(op_err); } - return (retval); + op_err = sctp_generate_cause(SCTP_CAUSE_OUT_OF_RESC, ""); + SCTPDBG(SCTP_DEBUG_INPUT1, "sctp_process_init() failed\n"); + sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, + src, dst, sh, op_err, + mflowtype, mflowid, + vrf_id, net->port); + *abort_no_unlock = 1; + return (-1); } initack_limit = offset + ntohs(cp->ch.chunk_length); /* load all addresses */ if ((retval = sctp_load_addresses_from_init(stcb, m, - (offset + sizeof(struct sctp_init_chunk)), initack_limit, - src, dst, NULL, stcb->asoc.port))) { + offset + sizeof(struct sctp_init_chunk), + initack_limit, src, dst, NULL, stcb->asoc.port)) < 0) { if (op_err != NULL) { sctp_m_freem(op_err); } @@ -1458,10 +1464,15 @@ sctp_process_cookie_existing(struct mbuf *m, int iphlen, int offset, * the right seq no's. */ /* First we must process the INIT !! */ - retval = sctp_process_init(init_cp, stcb); - if (retval < 0) { + if (sctp_process_init(init_cp, stcb) < 0) { if (how_indx < sizeof(asoc->cookie_how)) asoc->cookie_how[how_indx] = 3; + op_err = sctp_generate_cause(SCTP_CAUSE_OUT_OF_RESC, ""); + SCTPDBG(SCTP_DEBUG_INPUT1, "sctp_process_init() failed\n"); + sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, + src, dst, sh, op_err, + mflowtype, mflowid, + vrf_id, net->port); return (NULL); } /* we have already processed the INIT so no problem */ @@ -1523,16 +1534,20 @@ sctp_process_cookie_existing(struct mbuf *m, int iphlen, int offset, break; } /* end switch */ sctp_stop_all_cookie_timers(stcb); - /* - * We ignore the return code here.. not sure if we should - * somehow abort.. but we do have an existing asoc. This - * really should not fail. - */ - if (sctp_load_addresses_from_init(stcb, m, + if ((ret = sctp_load_addresses_from_init(stcb, m, init_offset + sizeof(struct sctp_init_chunk), - initack_offset, src, dst, init_src, stcb->asoc.port)) { + initack_offset, src, dst, init_src, stcb->asoc.port)) < 0) { if (how_indx < sizeof(asoc->cookie_how)) asoc->cookie_how[how_indx] = 4; + op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), + "Problem with address parameters"); + SCTPDBG(SCTP_DEBUG_INPUT1, + "Load addresses from INIT causes an abort %d\n", + retval); + sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, + src, dst, sh, op_err, + mflowtype, mflowid, + vrf_id, net->port); return (NULL); } /* respond with a COOKIE-ACK */ @@ -1650,17 +1665,31 @@ sctp_process_cookie_existing(struct mbuf *m, int iphlen, int offset, } } /* process the INIT info (peer's info) */ - retval = sctp_process_init(init_cp, stcb); - if (retval < 0) { + if (sctp_process_init(init_cp, stcb) < 0) { if (how_indx < sizeof(asoc->cookie_how)) asoc->cookie_how[how_indx] = 9; + op_err = sctp_generate_cause(SCTP_CAUSE_OUT_OF_RESC, ""); + SCTPDBG(SCTP_DEBUG_INPUT1, "sctp_process_init() failed\n"); + sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, + src, dst, sh, op_err, + mflowtype, mflowid, + vrf_id, net->port); return (NULL); } - if (sctp_load_addresses_from_init(stcb, m, + if ((retval = sctp_load_addresses_from_init(stcb, m, init_offset + sizeof(struct sctp_init_chunk), - initack_offset, src, dst, init_src, stcb->asoc.port)) { + initack_offset, src, dst, init_src, stcb->asoc.port)) < 0) { if (how_indx < sizeof(asoc->cookie_how)) asoc->cookie_how[how_indx] = 10; + op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), + "Problem with address parameters"); + SCTPDBG(SCTP_DEBUG_INPUT1, + "Load addresses from INIT causes an abort %d\n", + retval); + sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, + src, dst, sh, op_err, + mflowtype, mflowid, + vrf_id, net->port); return (NULL); } if ((SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_WAIT) || @@ -1874,11 +1903,15 @@ sctp_process_cookie_existing(struct mbuf *m, int iphlen, int offset, asoc->total_flight = 0; asoc->total_flight_count = 0; /* process the INIT info (peer's info) */ - retval = sctp_process_init(init_cp, stcb); - if (retval < 0) { + if (sctp_process_init(init_cp, stcb) < 0) { if (how_indx < sizeof(asoc->cookie_how)) asoc->cookie_how[how_indx] = 13; - + op_err = sctp_generate_cause(SCTP_CAUSE_OUT_OF_RESC, ""); + SCTPDBG(SCTP_DEBUG_INPUT1, "sctp_process_init() failed\n"); + sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, + src, dst, sh, op_err, + mflowtype, mflowid, + vrf_id, net->port); return (NULL); } /* @@ -1887,12 +1920,20 @@ sctp_process_cookie_existing(struct mbuf *m, int iphlen, int offset, */ net->hb_responded = 1; - if (sctp_load_addresses_from_init(stcb, m, + if ((retval = sctp_load_addresses_from_init(stcb, m, init_offset + sizeof(struct sctp_init_chunk), - initack_offset, src, dst, init_src, stcb->asoc.port)) { + initack_offset, src, dst, init_src, stcb->asoc.port)) < 0) { if (how_indx < sizeof(asoc->cookie_how)) asoc->cookie_how[how_indx] = 14; - + op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), + "Problem with address parameters"); + SCTPDBG(SCTP_DEBUG_INPUT1, + "Load addresses from INIT causes an abort %d\n", + retval); + sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, + src, dst, sh, op_err, + mflowtype, mflowid, + vrf_id, net->port); return (NULL); } /* respond with a COOKIE-ACK */ @@ -2047,16 +2088,15 @@ sctp_process_cookie_new(struct mbuf *m, int iphlen, int offset, asoc->advanced_peer_ack_point = asoc->last_acked_seq; /* process the INIT info (peer's info) */ - retval = sctp_process_init(init_cp, stcb); - if (retval < 0) { + if (sctp_process_init(init_cp, stcb) < 0) { (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_19); return (NULL); } /* load all addresses */ - if (sctp_load_addresses_from_init(stcb, m, - init_offset + sizeof(struct sctp_init_chunk), initack_offset, - src, dst, init_src, port)) { + if ((retval = sctp_load_addresses_from_init(stcb, m, + init_offset + sizeof(struct sctp_init_chunk), + initack_offset, src, dst, init_src, port)) < 0) { (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_20); return (NULL); @@ -2518,6 +2558,9 @@ sctp_handle_cookie_echo(struct mbuf *m, int iphlen, int offset, ¬ification, auth_skipped, auth_offset, auth_len, mflowtype, mflowid, vrf_id, port); + if (*stcb == NULL) { + *locked_tcb = NULL; + } } if (*stcb == NULL) { From owner-dev-commits-src-branches@freebsd.org Sun Jun 6 23:39:05 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E8A2A6418A9; Sun, 6 Jun 2021 23:39: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 4FytHs5S01z4lVJ; Sun, 6 Jun 2021 23:39:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 98EB148CA; Sun, 6 Jun 2021 23:39:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 156Nd5ZS079365; Sun, 6 Jun 2021 23:39:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 156Nd5n0079364; Sun, 6 Jun 2021 23:39:05 GMT (envelope-from git) Date: Sun, 6 Jun 2021 23:39:05 GMT Message-Id: <202106062339.156Nd5n0079364@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: bbcea8510964 - stable/13 - Fix build after 5f2e1835054ee84f2e68ebc890d92716a91775b7. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: bbcea851096428038b5b4eec21e66037ed67c0e5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jun 2021 23:39:06 -0000 The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=bbcea851096428038b5b4eec21e66037ed67c0e5 commit bbcea851096428038b5b4eec21e66037ed67c0e5 Author: Alexander Motin AuthorDate: 2021-05-03 00:07:38 +0000 Commit: Michael Tuexen CommitDate: 2021-06-02 21:49:33 +0000 Fix build after 5f2e1835054ee84f2e68ebc890d92716a91775b7. (cherry picked from commit 655c200cc89185c940bc7d5724be09a0f2e1a8a6) --- sys/netinet/sctp_input.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet/sctp_input.c b/sys/netinet/sctp_input.c index 072322ea074a..10e1c37c6cfb 100644 --- a/sys/netinet/sctp_input.c +++ b/sys/netinet/sctp_input.c @@ -1534,7 +1534,7 @@ sctp_process_cookie_existing(struct mbuf *m, int iphlen, int offset, break; } /* end switch */ sctp_stop_all_cookie_timers(stcb); - if ((ret = sctp_load_addresses_from_init(stcb, m, + if ((retval = sctp_load_addresses_from_init(stcb, m, init_offset + sizeof(struct sctp_init_chunk), initack_offset, src, dst, init_src, stcb->asoc.port)) < 0) { if (how_indx < sizeof(asoc->cookie_how)) From owner-dev-commits-src-branches@freebsd.org Sun Jun 6 23:41:13 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3354764191E; Sun, 6 Jun 2021 23:41: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 4FytLK10Wvz4lVx; Sun, 6 Jun 2021 23:41:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 00B1F4858; Sun, 6 Jun 2021 23:41:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 156NfC1w090164; Sun, 6 Jun 2021 23:41:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 156NfC5Z090163; Sun, 6 Jun 2021 23:41:12 GMT (envelope-from git) Date: Sun, 6 Jun 2021 23:41:12 GMT Message-Id: <202106062341.156NfC5Z090163@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 405bee30bc93 - stable/13 - sctp: improve restart handling MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 405bee30bc938e6c55a10ab68818573aca2de209 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jun 2021 23:41:13 -0000 The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=405bee30bc938e6c55a10ab68818573aca2de209 commit 405bee30bc938e6c55a10ab68818573aca2de209 Author: Michael Tuexen AuthorDate: 2021-05-03 00:20:24 +0000 Commit: Michael Tuexen CommitDate: 2021-06-02 21:52:39 +0000 sctp: improve restart handling This fixes in particular a possible use after free bug reported Anatoly Korniltsev and Taylor Brandstetter for the userland stack. (cherry picked from commit a89481d328fd96ccbfa642e1db6d03825fa1dc6d) --- sys/netinet/sctp_input.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/sys/netinet/sctp_input.c b/sys/netinet/sctp_input.c index 10e1c37c6cfb..b6fe6449bc21 100644 --- a/sys/netinet/sctp_input.c +++ b/sys/netinet/sctp_input.c @@ -1761,11 +1761,7 @@ sctp_process_cookie_existing(struct mbuf *m, int iphlen, int offset, /* temp code */ if (how_indx < sizeof(asoc->cookie_how)) asoc->cookie_how[how_indx] = 12; - sctp_timer_stop(SCTP_TIMER_TYPE_INIT, inp, stcb, net, - SCTP_FROM_SCTP_INPUT + SCTP_LOC_16); - sctp_timer_stop(SCTP_TIMER_TYPE_HEARTBEAT, inp, stcb, net, - SCTP_FROM_SCTP_INPUT + SCTP_LOC_17); - + sctp_stop_association_timers(stcb, false); /* notify upper layer */ *notification = SCTP_NOTIFY_ASSOC_RESTART; atomic_add_int(&stcb->asoc.refcnt, 1); @@ -1798,6 +1794,10 @@ sctp_process_cookie_existing(struct mbuf *m, int iphlen, int offset, asoc->str_reset_seq_in = asoc->init_seq_number; asoc->advanced_peer_ack_point = asoc->last_acked_seq; asoc->send_sack = 1; + asoc->data_pkts_seen = 0; + asoc->last_data_chunk_from = NULL; + asoc->last_control_chunk_from = NULL; + asoc->last_net_cmt_send_started = NULL; if (asoc->mapping_array) { memset(asoc->mapping_array, 0, asoc->mapping_array_size); @@ -1858,6 +1858,9 @@ sctp_process_cookie_existing(struct mbuf *m, int iphlen, int offset, SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_chunk), chk); SCTP_DECR_CHK_COUNT(); } + asoc->ctrl_queue_cnt = 0; + asoc->str_reset = NULL; + asoc->stream_reset_outstanding = 0; TAILQ_FOREACH_SAFE(chk, &asoc->asconf_send_queue, sctp_next, nchk) { TAILQ_REMOVE(&asoc->asconf_send_queue, chk, sctp_next); if (chk->data) { @@ -1937,12 +1940,13 @@ sctp_process_cookie_existing(struct mbuf *m, int iphlen, int offset, return (NULL); } /* respond with a COOKIE-ACK */ - sctp_stop_all_cookie_timers(stcb); - sctp_toss_old_cookies(stcb, asoc); sctp_send_cookie_ack(stcb); if (how_indx < sizeof(asoc->cookie_how)) asoc->cookie_how[how_indx] = 15; - + if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_AUTOCLOSE) && + (asoc->sctp_autoclose_ticks > 0)) { + sctp_timer_start(SCTP_TIMER_TYPE_AUTOCLOSE, inp, stcb, NULL); + } return (stcb); } if (how_indx < sizeof(asoc->cookie_how)) From owner-dev-commits-src-branches@freebsd.org Sun Jun 6 23:43:02 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 18C79641A24; Sun, 6 Jun 2021 23:43:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FytNQ0Fjpz4llY; Sun, 6 Jun 2021 23:43:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E501C4C85; Sun, 6 Jun 2021 23:43:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 156Nh1Ej092045; Sun, 6 Jun 2021 23:43:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 156Nh1tm092044; Sun, 6 Jun 2021 23:43:01 GMT (envelope-from git) Date: Sun, 6 Jun 2021 23:43:01 GMT Message-Id: <202106062343.156Nh1tm092044@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 50948b57070f - stable/13 - sctp: improve address list scanning MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 50948b57070f91d8c99807bb7a698659bfbda6b4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jun 2021 23:43:02 -0000 The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=50948b57070f91d8c99807bb7a698659bfbda6b4 commit 50948b57070f91d8c99807bb7a698659bfbda6b4 Author: Michael Tuexen AuthorDate: 2021-05-03 00:50:05 +0000 Commit: Michael Tuexen CommitDate: 2021-06-02 21:54:34 +0000 sctp: improve address list scanning If the alternate address has to be removed, force the stack to find a new one, if it is still needed. (cherry picked from commit 8b3d0f6439fa27f0d37a9a7b9d27bbfdfdf487c4) --- sys/netinet/sctp_pcb.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index f4264ab387f1..08acccbf9185 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -6562,11 +6562,15 @@ next_param: /* remove and free it */ stcb->asoc.numnets--; TAILQ_REMOVE(&stcb->asoc.nets, net, sctp_next); - sctp_free_remote_addr(net); + if (net == stcb->asoc.alternate) { + sctp_free_remote_addr(stcb->asoc.alternate); + stcb->asoc.alternate = NULL; + } if (net == stcb->asoc.primary_destination) { stcb->asoc.primary_destination = NULL; sctp_select_primary_destination(stcb); } + sctp_free_remote_addr(net); } } if ((stcb->asoc.ecn_supported == 1) && From owner-dev-commits-src-branches@freebsd.org Sun Jun 6 23:44:01 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C8B52641C22; Sun, 6 Jun 2021 23:44:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FytPY4yvpz4m2b; Sun, 6 Jun 2021 23:44:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 92AE54B3E; Sun, 6 Jun 2021 23:44:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 156Ni1L4092230; Sun, 6 Jun 2021 23:44:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 156Ni1av092229; Sun, 6 Jun 2021 23:44:01 GMT (envelope-from git) Date: Sun, 6 Jun 2021 23:44:01 GMT Message-Id: <202106062344.156Ni1av092229@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: a2fdddf83e8c - stable/13 - sctp: drop packet with SHUTDOWN-ACK chunks with wrong vtags MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a2fdddf83e8cc2c17d838f09f9601fd210457e74 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jun 2021 23:44:01 -0000 The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=a2fdddf83e8cc2c17d838f09f9601fd210457e74 commit a2fdddf83e8cc2c17d838f09f9601fd210457e74 Author: Michael Tuexen AuthorDate: 2021-05-04 16:42:31 +0000 Commit: Michael Tuexen CommitDate: 2021-06-02 21:55:37 +0000 sctp: drop packet with SHUTDOWN-ACK chunks with wrong vtags (cherry picked from commit b621fbb1bf1b2a1e6ea22e0ad2d7667b1aec9fae) --- sys/netinet/sctp_input.c | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/sys/netinet/sctp_input.c b/sys/netinet/sctp_input.c index b6fe6449bc21..e1f096ea5817 100644 --- a/sys/netinet/sctp_input.c +++ b/sys/netinet/sctp_input.c @@ -4502,27 +4502,6 @@ sctp_process_control(struct mbuf *m, int iphlen, int *offset, int length, } return (NULL); } - } else if (ch->chunk_type == SCTP_SHUTDOWN_ACK) { - if (vtag_in != asoc->my_vtag) { - /* - * this could be a stale SHUTDOWN-ACK or the - * peer never got the SHUTDOWN-COMPLETE and - * is still hung; we have started a new asoc - * but it won't complete until the shutdown - * is completed - */ - if (stcb != NULL) { - SCTP_TCB_UNLOCK(stcb); - } - SCTP_SNPRINTF(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__); - op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), - msg); - sctp_handle_ootb(m, iphlen, *offset, src, dst, - sh, inp, op_err, - mflowtype, mflowid, fibnum, - vrf_id, port); - return (NULL); - } } else { /* for all other chunks, vtag must match */ if (vtag_in != asoc->my_vtag) { From owner-dev-commits-src-branches@freebsd.org Sun Jun 6 23:45:20 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 81081641E30; Sun, 6 Jun 2021 23:45: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 4FytR43G9Fz4m0Z; Sun, 6 Jun 2021 23:45:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 586614866; Sun, 6 Jun 2021 23:45:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 156NjKCE092432; Sun, 6 Jun 2021 23:45:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 156NjKLQ092431; Sun, 6 Jun 2021 23:45:20 GMT (envelope-from git) Date: Sun, 6 Jun 2021 23:45:20 GMT Message-Id: <202106062345.156NjKLQ092431@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 399798c97b03 - stable/13 - sctp: improve consistency when handling chunks of wrong size MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 399798c97b031b10499b27ad4c0cff668521b42c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jun 2021 23:45:20 -0000 The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=399798c97b031b10499b27ad4c0cff668521b42c commit 399798c97b031b10499b27ad4c0cff668521b42c Author: Michael Tuexen AuthorDate: 2021-05-05 23:02:41 +0000 Commit: Michael Tuexen CommitDate: 2021-06-02 21:56:57 +0000 sctp: improve consistency when handling chunks of wrong size (cherry picked from commit d1cb8d11b0c09c35b87c144bab7b02b75c5725b6) --- sys/netinet/sctp_input.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/sys/netinet/sctp_input.c b/sys/netinet/sctp_input.c index e1f096ea5817..050f30d145b7 100644 --- a/sys/netinet/sctp_input.c +++ b/sys/netinet/sctp_input.c @@ -4840,11 +4840,12 @@ process_control_chunks: break; case SCTP_SHUTDOWN_ACK: SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_SHUTDOWN_ACK, stcb %p\n", (void *)stcb); - if ((stcb != NULL) && (netp != NULL) && (*netp != NULL)) { + if ((chk_length == sizeof(struct sctp_shutdown_ack_chunk)) && + (stcb != NULL) && (netp != NULL) && (*netp != NULL)) { sctp_handle_shutdown_ack((struct sctp_shutdown_ack_chunk *)ch, stcb, *netp); + *offset = length; + return (NULL); } - *offset = length; - return (NULL); break; case SCTP_OPERATION_ERROR: SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_OP_ERR\n"); @@ -5032,12 +5033,13 @@ process_control_chunks: *offset = length; return (stcb); } - if ((stcb != NULL) && (netp != NULL) && (*netp != NULL)) { + if ((chk_length == sizeof(struct sctp_shutdown_complete_chunk)) && + (stcb != NULL) && (netp != NULL) && (*netp != NULL)) { sctp_handle_shutdown_complete((struct sctp_shutdown_complete_chunk *)ch, stcb, *netp); + *offset = length; + return (NULL); } - *offset = length; - return (NULL); break; case SCTP_ASCONF: SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_ASCONF\n"); From owner-dev-commits-src-branches@freebsd.org Sun Jun 6 23:46:38 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9E116641CA9; Sun, 6 Jun 2021 23:46:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FytSZ47f2z4mB3; Sun, 6 Jun 2021 23:46:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 765AC4B40; Sun, 6 Jun 2021 23:46:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 156NkcGb092622; Sun, 6 Jun 2021 23:46:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 156NkcMD092621; Sun, 6 Jun 2021 23:46:38 GMT (envelope-from git) Date: Sun, 6 Jun 2021 23:46:38 GMT Message-Id: <202106062346.156NkcMD092621@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 8421c612ee01 - stable/13 - sctp: fix locking in case of error handling during a restart MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8421c612ee01d3b7a8d07df6a5ba9e86ded77278 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jun 2021 23:46:38 -0000 The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=8421c612ee01d3b7a8d07df6a5ba9e86ded77278 commit 8421c612ee01d3b7a8d07df6a5ba9e86ded77278 Author: Michael Tuexen AuthorDate: 2021-05-12 13:29:06 +0000 Commit: Michael Tuexen CommitDate: 2021-06-02 21:57:59 +0000 sctp: fix locking in case of error handling during a restart Thanks to Taylor Brandstetter for finding the issue and providing a patch for the userland stack. (cherry picked from commit 12dda000ed32efa16f59909a6294e4d4b5a771ba) --- sys/netinet/sctp_input.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sys/netinet/sctp_input.c b/sys/netinet/sctp_input.c index 050f30d145b7..f066cc100ac2 100644 --- a/sys/netinet/sctp_input.c +++ b/sys/netinet/sctp_input.c @@ -1395,6 +1395,7 @@ sctp_process_cookie_existing(struct mbuf *m, int iphlen, int offset, vrf_id, net->port); if (how_indx < sizeof(asoc->cookie_how)) asoc->cookie_how[how_indx] = 2; + SCTP_TCB_UNLOCK(stcb); return (NULL); } /* @@ -1409,9 +1410,11 @@ sctp_process_cookie_existing(struct mbuf *m, int iphlen, int offset, (uint8_t *)&init_buf); if (init_cp == NULL) { /* could not pull a INIT chunk in cookie */ + SCTP_TCB_UNLOCK(stcb); return (NULL); } if (init_cp->ch.chunk_type != SCTP_INITIATION) { + SCTP_TCB_UNLOCK(stcb); return (NULL); } /* @@ -1424,9 +1427,11 @@ sctp_process_cookie_existing(struct mbuf *m, int iphlen, int offset, (uint8_t *)&initack_buf); if (initack_cp == NULL) { /* could not pull INIT-ACK chunk in cookie */ + SCTP_TCB_UNLOCK(stcb); return (NULL); } if (initack_cp->ch.chunk_type != SCTP_INITIATION_ACK) { + SCTP_TCB_UNLOCK(stcb); return (NULL); } if ((ntohl(initack_cp->init.initiate_tag) == asoc->my_vtag) && @@ -1452,6 +1457,7 @@ sctp_process_cookie_existing(struct mbuf *m, int iphlen, int offset, */ if (how_indx < sizeof(asoc->cookie_how)) asoc->cookie_how[how_indx] = 17; + SCTP_TCB_UNLOCK(stcb); return (NULL); } switch (SCTP_GET_STATE(stcb)) { @@ -1567,6 +1573,7 @@ sctp_process_cookie_existing(struct mbuf *m, int iphlen, int offset, */ if (how_indx < sizeof(asoc->cookie_how)) asoc->cookie_how[how_indx] = 6; + SCTP_TCB_UNLOCK(stcb); return (NULL); } /* @@ -1592,6 +1599,7 @@ sctp_process_cookie_existing(struct mbuf *m, int iphlen, int offset, sctp_send_abort(m, iphlen, src, dst, sh, 0, op_err, mflowtype, mflowid, inp->fibnum, vrf_id, port); + SCTP_TCB_UNLOCK(stcb); return (NULL); } if ((ntohl(initack_cp->init.initiate_tag) == asoc->my_vtag) && @@ -1622,6 +1630,7 @@ sctp_process_cookie_existing(struct mbuf *m, int iphlen, int offset, if (how_indx < sizeof(asoc->cookie_how)) asoc->cookie_how[how_indx] = 7; + SCTP_TCB_UNLOCK(stcb); return (NULL); } if (how_indx < sizeof(asoc->cookie_how)) @@ -1952,6 +1961,7 @@ sctp_process_cookie_existing(struct mbuf *m, int iphlen, int offset, if (how_indx < sizeof(asoc->cookie_how)) asoc->cookie_how[how_indx] = 16; /* all other cases... */ + SCTP_TCB_UNLOCK(stcb); return (NULL); }