bsnmp: Use libpfctl
Reviewed by: glebius MFC after: 4 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D29642
This commit is contained in:
parent
95be9288f0
commit
956e7d2325
@ -9,4 +9,7 @@ XSYM= begemotPf
|
|||||||
DEFS= ${MOD}_tree.def
|
DEFS= ${MOD}_tree.def
|
||||||
BMIBS= BEGEMOT-PF-MIB.txt
|
BMIBS= BEGEMOT-PF-MIB.txt
|
||||||
|
|
||||||
|
CFLAGS+= -I${SRCTOP}/lib/libpfctl -I${OBJTOP}/lib/libpfctl
|
||||||
|
LIBADD+= pfctl
|
||||||
|
|
||||||
.include <bsd.snmpmod.mk>
|
.include <bsd.snmpmod.mk>
|
||||||
|
@ -38,6 +38,7 @@
|
|||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
#include <libpfctl.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@ -1528,7 +1529,8 @@ pfl_scan_ruleset(const char *path)
|
|||||||
|
|
||||||
for (nr = pr.nr, i = 0; i < nr; i++) {
|
for (nr = pr.nr, i = 0; i < nr; i++) {
|
||||||
pr.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):"
|
syslog(LOG_ERR, "pfl_scan_ruleset: ioctl(DIOCGETRULE):"
|
||||||
" %s", strerror(errno));
|
" %s", strerror(errno));
|
||||||
goto err;
|
goto err;
|
||||||
|
Loading…
Reference in New Issue
Block a user