From owner-dev-commits-src-all@freebsd.org Tue Jun 22 21:03:39 2021 Return-Path: Delivered-To: dev-commits-src-all@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 06100662F47; Tue, 22 Jun 2021 21:03: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 4G8f566kpGz4TRJ; Tue, 22 Jun 2021 21:03: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 CF42E18207; Tue, 22 Jun 2021 21:03: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 15ML3cB6017229; Tue, 22 Jun 2021 21:03:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15ML3cnA017228; Tue, 22 Jun 2021 21:03:38 GMT (envelope-from git) Date: Tue, 22 Jun 2021 21:03:38 GMT Message-Id: <202106222103.15ML3cnA017228@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: a20c597c6d73 - stable/13 - bsnmp: Fix incorrect use of libpfctl 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: a20c597c6d73a305126108eeacb5a2f4355ce6af Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2021 21:03:39 -0000 The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=a20c597c6d73a305126108eeacb5a2f4355ce6af commit a20c597c6d73a305126108eeacb5a2f4355ce6af Author: Kristof Provost AuthorDate: 2021-06-15 08:50:32 +0000 Commit: Kristof Provost CommitDate: 2021-06-22 21:00:33 +0000 bsnmp: Fix incorrect use of libpfctl When we introduced libpfctl in bnsmpd this was done incorrectly, and a GETRULE call was replaced by pfctl_add_rule(). Change it to pfctl_get_rule(). Reviewed by: donner MFC after: 3 days Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 67cef6d411cef0c3dfcf768ff890b4f97cf513b6) --- usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c b/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c index 51d940f20c99..4ef35ac1eec2 100644 --- a/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c +++ b/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c @@ -1530,8 +1530,8 @@ pfl_scan_ruleset(const char *path) for (nr = pr.nr, i = 0; i < nr; i++) { pr.nr = i; - if (pfctl_add_rule(dev, &rule, pr.anchor, pr.anchor_call, - pr.ticket, pr.pool_ticket)) { + if (pfctl_get_rule(dev, pr.nr, pr.ticket, pr.anchor, + PF_PASS, &rule, pr.anchor_call)) { syslog(LOG_ERR, "pfl_scan_ruleset: ioctl(DIOCGETRULE):" " %s", strerror(errno)); goto err;