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")
This commit is contained in:
Kristof Provost 2021-06-15 10:50:32 +02:00
parent b6f8436b09
commit 67cef6d411

View File

@ -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;