Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 Jun 2021 21:04:13 GMT
From:      Kristof Provost <kp@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: c419c8231fbb - stable/12 - bsnmp: Fix incorrect use of libpfctl
Message-ID:  <202106222104.15ML4DsN017406@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/12 has been updated by kp:

URL: https://cgit.FreeBSD.org/src/commit/?id=c419c8231fbbd16bbed4ac0b50a78914a79963fd

commit c419c8231fbbd16bbed4ac0b50a78914a79963fd
Author:     Kristof Provost <kp@FreeBSD.org>
AuthorDate: 2021-06-15 08:50:32 +0000
Commit:     Kristof Provost <kp@FreeBSD.org>
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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202106222104.15ML4DsN017406>