From nobody Tue Apr 16 15:58:48 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VJpcT1D3qz5H5cL; Tue, 16 Apr 2024 15:58: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 4VJpcT0gFhz4S4g; Tue, 16 Apr 2024 15:58:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713283129; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MZsH6wut4Oyr4ouy348AhKMMvUNrdWZ3mwhDJs2KPE0=; b=qEBknhwBQ37bjuShP6OJphMYTih4V4Xy4cw8CzQL2aXjdxL60llbzhtrRMdoQLaszReL/n lM+vGDwSQwzo8ILtJw8NQ3PLOk/4Rnn/FOELvIJrFzsuBnYJYCjZAmzU0X6ane4eOI6tzG vI0bShVXOWJDlu/yifHGZkCPThyzBAtCu9pFHVKPHOiXlRkPbMXKt7QDMpmDllx+LPXTQB +pUh6Bd/EkS15DhBOpeXRi8JUTpxebUc40WmGFSMGm3ecg2irvUYirWCtVGVpdRZS2dCnA zqDWKK0xqWzmUwdHArAiXatBSy7+KATAD42esP4VJPXhO1lpXOh77nTceP+3vQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1713283129; a=rsa-sha256; cv=none; b=ONSQv7kfrXzwzFGrwV7SEN7eKNBAio2fRTOg68BcF0WA5wpatX4HytDNTwnJ5kRXajS9/g qKunBtJ3LkWRLzNSqE8k66uh9Owt990rrGWfRk50/zgPUvBK/CoJYPjpwpPisBDZdoXpZk j3sMxVpfNdFhIELuZT2ODmYZz1f4ux2sElGB1Ys2vHaHAQ14tL6RFx9ohkMvgsnfelXMPr ezSVD7XAo+xgs3n+l6D5Ul5buo65xQaFHK14cbTU7fKy+k8wTxcU76R//ur0mSnIBVrYFN QoqnasPYPkPZUvClwxxpAGlKNucd8QawO+9demhRbfmsN10Dc2/eJufwM6aVxg== 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=1713283129; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MZsH6wut4Oyr4ouy348AhKMMvUNrdWZ3mwhDJs2KPE0=; b=V+RPLuj3GXCd502m+4H/zcTCRJY7Pr48290VFIenqoS/x+gEkyIDBwZAapiIqjerMQBBUI 1v1JbUPwsOJLQA+Jecw5DTZ/4gxSOEhOcWkc0kCeLDW6ejNtWPjbJzTo4FUtcpBSyyQCj4 hPXnljlER9KdhFrdkTMM908lWdXfZgyqY2nwcCiQUjezyeRaI5dHJFEBGWv80JIaSt7ZJE cBi+7t/FZXEBcU3TC3xTfCOfUjPtHiDCko9prkryxgJ3Uqa0wygQWouHD5Gx1Qwab4MlWk WSYvEdszC+CShpc47vMqVHsvAKUNPo5y1NaFTS0LpW2gq4B6NCQvLLCi2zTvOw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VJpcT0GRKzq86; Tue, 16 Apr 2024 15:58:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43GFwm0r095162; Tue, 16 Apr 2024 15:58:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43GFwmYF095159; Tue, 16 Apr 2024 15:58:48 GMT (envelope-from git) Date: Tue, 16 Apr 2024 15:58:48 GMT Message-Id: <202404161558.43GFwmYF095159@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gleb Smirnoff Subject: git: cc16c3c3cb5f - stable/14 - pfilctl: fix 'pfilctl hooks' when nothing is connected List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: cc16c3c3cb5f166a2c743077ac8ec37f6af5c24a Auto-Submitted: auto-generated The branch stable/14 has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=cc16c3c3cb5f166a2c743077ac8ec37f6af5c24a commit cc16c3c3cb5f166a2c743077ac8ec37f6af5c24a Author: Gleb Smirnoff AuthorDate: 2024-03-28 21:10:15 +0000 Commit: Gleb Smirnoff CommitDate: 2024-04-16 15:56:13 +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. (cherry picked from commit 1bfe195143ffb6832ac6702e281964541554fcb3) --- 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 c2fe04ecc777..81b6d9716dc9 100644 --- a/sbin/pfilctl/pfilctl.c +++ b/sbin/pfilctl/pfilctl.c @@ -151,8 +151,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)