From owner-dev-commits-src-all@freebsd.org Thu Jun 17 09:18:12 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 CF20F650003; Thu, 17 Jun 2021 09:18: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 4G5GgS5TbZz3w10; Thu, 17 Jun 2021 09:18: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 A426745EB; Thu, 17 Jun 2021 09:18: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 15H9ICj3054546; Thu, 17 Jun 2021 09:18:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15H9ICMY054545; Thu, 17 Jun 2021 09:18:12 GMT (envelope-from git) Date: Thu, 17 Jun 2021 09:18:12 GMT Message-Id: <202106170918.15H9ICMY054545@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 67cef6d411ce - main - 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/main X-Git-Reftype: branch X-Git-Commit: 67cef6d411cef0c3dfcf768ff890b4f97cf513b6 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: Thu, 17 Jun 2021 09:18:12 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=67cef6d411cef0c3dfcf768ff890b4f97cf513b6 commit 67cef6d411cef0c3dfcf768ff890b4f97cf513b6 Author: Kristof Provost AuthorDate: 2021-06-15 08:50:32 +0000 Commit: Kristof Provost CommitDate: 2021-06-17 08:53:40 +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") --- 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;