Skip to content

Commit

Permalink
pf: silence a runtime warning
Browse files Browse the repository at this point in the history
Sometimes, for negated tables, pf can log 'pfr_update_stats: assertion failed'.
This warning does not clarify anything for users, so silence it, just as
OpenBSD has.

PR:		234874
MFC after:	1 week
  • Loading branch information
kprovost committed Jan 15, 2019
1 parent 305bb04 commit 032dff6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion sys/netpfil/pf/pf_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ __FBSDID("$FreeBSD$");
#include <net/vnet.h>
#include <net/pfvar.h>

#define DPFPRINTF(n, x) if (V_pf_status.debug >= (n)) printf x

#define ACCEPT_FLAGS(flags, oklist) \
do { \
if ((flags & ~(oklist)) & \
Expand Down Expand Up @@ -1992,7 +1994,8 @@ pfr_update_stats(struct pfr_ktable *kt, struct pf_addr *a, sa_family_t af,
}
if ((ke == NULL || ke->pfrke_not) != notrule) {
if (op_pass != PFR_OP_PASS)
printf("pfr_update_stats: assertion failed.\n");
DPFPRINTF(PF_DEBUG_URGENT,
("pfr_update_stats: assertion failed.\n"));
op_pass = PFR_OP_XPASS;
}
kt->pfrkt_packets[dir_out][op_pass]++;
Expand Down

0 comments on commit 032dff6

Please sign in to comment.