aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristof Provost <kp@FreeBSD.org>2021-06-15 08:50:32 +0000
committerKristof Provost <kp@FreeBSD.org>2021-06-22 21:00:33 +0000
commitc419c8231fbbd16bbed4ac0b50a78914a79963fd (patch)
tree521f3e6ecc7153157282ecc927e853624b2aa9a1
parent742d315019789de01d5dbf736cbafd49cc603276 (diff)
downloadsrc-c419c8231fbbd16bbed4ac0b50a78914a79963fd.tar.gz
src-c419c8231fbbd16bbed4ac0b50a78914a79963fd.zip
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)
-rw-r--r--usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c4
1 files 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;