Bug 234874

Summary: pf: pfr_update_stats: assertion failed.
Product: Base System Reporter: rozhuk.im
Component: kernAssignee: freebsd-pf mailing list <pf>
Status: Closed FIXED    
Severity: Affects Some People CC: kp, pi, rozhuk.im, zarychtam
Priority: ---    
Version: 12.0-STABLE   
Hardware: Any   
OS: Any   

Description rozhuk.im 2019-01-11 15:19:28 UTC
To many messages, bad user experience:
Jan 11 17:00:05 firewall kernel: pfr_update_stats: assertion failed.
Jan 11 17:00:43 firewall syslogd: last message repeated 36 times
Jan 11 17:02:48 firewall syslogd: last message repeated 194 times
Jan 11 17:12:41 firewall syslogd: last message repeated 2723 times
Jan 11 17:22:45 firewall syslogd: last message repeated 12772 times

Remove this message, or fix, or make it only if some debug is on.
Comment 1 Kristof Provost freebsd_committer 2019-01-11 20:23:13 UTC
Can you provide some more information on your setup? (i.e. network configuration, pf rules, ...)

This had previously been reported, but then it appeared to be the result of a configuration problem: https://lists.freebsd.org/pipermail/freebsd-pf/2018-June/008841.html

I don't yet fully understand the conditions that trigger this log, so I need more information.
Comment 2 rozhuk.im 2019-01-13 21:58:25 UTC
	if ((ke == NULL || ke->pfrke_not) != notrule) {
		if (op_pass != PFR_OP_PASS)
			printf("pfr_update_stats: assertion failed.\n");
		op_pass = PFR_OP_XPASS;
	}

if (op_pass != PFR_OP_PASS && V_pf_status.debug >= PF_DEBUG_MISC)
Probably good fix.
Comment 3 rozhuk.im 2019-01-13 21:59:22 UTC
(In reply to Kristof Provost from comment #1)

All info in private email, if you need more - I will send.
Comment 4 Marek Zarychta 2019-01-14 08:46:00 UTC
(In reply to Kristof Provost from comment #1)
It was not a problem in the configuration but a problem that a specific configuration triggered this. I have tuned my configuration to avoid this.

+1 for no more flooding kernel message buffer with this debug information.
Comment 5 commit-hook freebsd_committer 2019-01-15 09:00:51 UTC
A commit references this bug:

Author: kp
Date: Tue Jan 15 08:59:52 UTC 2019
New revision: 343041
URL: https://svnweb.freebsd.org/changeset/base/343041

Log:
  pf: silence a runtime warning

  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

Changes:
  head/sys/netpfil/pf/pf_table.c
Comment 6 commit-hook freebsd_committer 2019-01-22 01:07:44 UTC
A commit references this bug:

Author: kp
Date: Tue Jan 22 01:07:19 UTC 2019
New revision: 343289
URL: https://svnweb.freebsd.org/changeset/base/343289

Log:
  MFC r343041

  pf: silence a runtime warning

  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

Changes:
_U  stable/12/
  stable/12/sys/netpfil/pf/pf_table.c
Comment 7 commit-hook freebsd_committer 2019-01-22 01:07:47 UTC
A commit references this bug:

Author: kp
Date: Tue Jan 22 01:07:20 UTC 2019
New revision: 343290
URL: https://svnweb.freebsd.org/changeset/base/343290

Log:
  MFC r343041

  pf: silence a runtime warning

  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

Changes:
_U  stable/11/
  stable/11/sys/netpfil/pf/pf_table.c