mirror of
https://github.com/opnsense/src.git
synced 2026-06-11 01:30:30 -04:00
bsnmp: Use libpfctl
Reviewed by: glebius
MFC after: 4 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D29642
(cherry picked from commit 956e7d2325)
This commit is contained in:
parent
3711a14493
commit
5268c55fa5
2 changed files with 6 additions and 1 deletions
|
|
@ -9,4 +9,7 @@ XSYM= begemotPf
|
|||
DEFS= ${MOD}_tree.def
|
||||
BMIBS= BEGEMOT-PF-MIB.txt
|
||||
|
||||
CFLAGS+= -I${SRCTOP}/lib/libpfctl -I${OBJTOP}/lib/libpfctl
|
||||
LIBADD+= pfctl
|
||||
|
||||
.include <bsd.snmpmod.mk>
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@
|
|||
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <libpfctl.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
|
@ -1528,7 +1529,8 @@ pfl_scan_ruleset(const char *path)
|
|||
|
||||
for (nr = pr.nr, i = 0; i < nr; i++) {
|
||||
pr.nr = i;
|
||||
if (ioctl(dev, DIOCGETRULE, &pr)) {
|
||||
if (pfctl_add_rule(dev, &pr.rule, pr.anchor, pr.anchor_call,
|
||||
pr.ticket, pr.pool_ticket)) {
|
||||
syslog(LOG_ERR, "pfl_scan_ruleset: ioctl(DIOCGETRULE):"
|
||||
" %s", strerror(errno));
|
||||
goto err;
|
||||
|
|
|
|||
Loading…
Reference in a new issue