From nobody Thu Mar 28 21:13:58 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V5GVt1t51z5G2y0; Thu, 28 Mar 2024 21:13: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 4V5GVt1QdKz4fqC; Thu, 28 Mar 2024 21:13:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711660438; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LYuCxDZnru6vRraWfu5BEhN+6lM2rEtobd3KwT3q5L4=; b=ilqpbzZG3XkAIOFeEuJdRKMeNYN6emExdSBmGjfN3izpA5/PWg66dgEnGoCybVaLrsCRFa 2DV7tDD3pNKWrA1lduFK5KB3gOKqYsHnqn95zeUGsKdRmoyV4Dr6q0mS78zCwqb4PuOJxN h/3ffTVqlYoVgK3mDusR3aDvkStQOkqXAx7KMCxbnZESm58UbeOj6Gl/227JzDQlW/iZh5 GbsPsSYkaFcHSAewho9Vqsu4URtoYv/guDkx8evToMXZif2E062ad+ecrHbQC7pHIN85X8 n8WaV/VgN3xM/8qlGO93NE2jvsUBIJXvkNQou4ZJx0UCXjdMc2E9X9tKfnaarQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711660438; a=rsa-sha256; cv=none; b=nu+3S9sqeVtb/J92z8i3fakSd8PmdncZ/IGirnNlufHYeQ4+MxQVus2+TfjgeKcbAO7mA5 5jMAbhj5ANd4FAHPsj5Z7FiPDwnTxsml9JwqZ3Biv6b6hImdGnwIe+lzkHLh/GfGHLp5Ug iTl985zBUwOW4WhpYKyBc2HgJq74zo26hgpR9xpZiqBmAIg/IyOXVvxhorKDeafHq0blZT xp0LAjLCu7D8yn+/qT4YyntLlDg+yfnAHMRTyxxmIs/15YfJkvB+cGWHDa7wZ9NcEl+ykD abPHgwfcoWVqRK7DGNZXcdU/Xq/hgeUe8Y4ql07mQLwct7a+ZE7XSNsHYQpuGA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711660438; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LYuCxDZnru6vRraWfu5BEhN+6lM2rEtobd3KwT3q5L4=; b=AvtP2mQyxZuw8t/PliY+zxDyOZaukqorBZjGur+2DDIxdLFka2fnluzwlksVOOM7rBoJ3T pmKA9MgJ2U7K39rP7kDh8rKCN/9GXOnAntMYP7WapAVM1FOPqgsb9XV+Eozz8Zy2uz2luj ZIkFBCJhXKQM4LR36N6tChK1DZbuuNIigYwPg0zIK1bQQ/qeYDi74GlepqS8iLBsszcaKR Q1FsZSdjl1oRXMzVivw6xvj/NpBJolzVX8aZr6r4HRjr4Rumg4vEK1qatbAPagao+q8/7o IVbpGofqptu6eKEUk8UY4vCLzACSs73v7I0M7nM3q0JZbIMjcEYZiW5shSIuLA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V5GVt121VzkRL; Thu, 28 Mar 2024 21:13:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 42SLDwR1043079; Thu, 28 Mar 2024 21:13:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42SLDwFc043077; Thu, 28 Mar 2024 21:13:58 GMT (envelope-from git) Date: Thu, 28 Mar 2024 21:13:58 GMT Message-Id: <202403282113.42SLDwFc043077@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 1bfe195143ff - main - pfilctl: fix 'pfilctl hooks' when nothing is connected List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1bfe195143ffb6832ac6702e281964541554fcb3 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=1bfe195143ffb6832ac6702e281964541554fcb3 commit 1bfe195143ffb6832ac6702e281964541554fcb3 Author: Gleb Smirnoff AuthorDate: 2024-03-28 21:10:15 +0000 Commit: Gleb Smirnoff CommitDate: 2024-03-28 21:10:15 +0000 pfilctl: fix 'pfilctl hooks' when nothing is connected The 'hooks' command actually worked accidentially until now. It used PFILIOC_LISTHEADS to determine current number of hooks. This worked when at least one head had a hook connected to it. --- sbin/pfilctl/pfilctl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sbin/pfilctl/pfilctl.c b/sbin/pfilctl/pfilctl.c index 268f5a8d0e70..1af2190072b6 100644 --- a/sbin/pfilctl/pfilctl.c +++ b/sbin/pfilctl/pfilctl.c @@ -150,8 +150,8 @@ listhooks(int argc __unused, char *argv[] __unused) u_int nhooks, i; plh.pio_nhooks = 0; - if (ioctl(dev, PFILIOC_LISTHEADS, &plh) != 0) - err(1, "ioctl(PFILIOC_LISTHEADS)"); + if (ioctl(dev, PFILIOC_LISTHOOKS, &plh) != 0) + err(1, "ioctl(PFILIOC_LISTHOOKS)"); retry: plh.pio_hooks = calloc(plh.pio_nhooks, sizeof(struct pfilioc_hook)); if (plh.pio_hooks == NULL)