Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 23 Jun 2018 18:46:16 +0200
From:      Marek Zarychta <zarychtam@plan-b.pwste.edu.pl>
To:        freebsd-pf@freebsd.org
Subject:   Re: pfr_update_stats: assertion failed.
Message-ID:  <20180623164616.GA82672@plan-b.pwste.edu.pl>
In-Reply-To: <20180623152729.GA81271@plan-b.pwste.edu.pl>
References:  <20161016181713.GA95110@plan-b.pwste.edu.pl> <20180623152729.GA81271@plan-b.pwste.edu.pl>

next in thread | previous in thread | raw e-mail | index | archive | help

--UlVJffcvxoiEqYs2
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sat, Jun 23, 2018 at 05:27:29PM +0200, Marek Zarychta wrote:
> On Sun, Oct 16, 2016 at 08:17:13PM +0200, Marek Zarychta wrote:
> > The issue occurred first two years ago, after upgrade from 8 to 9
> > branch. Now this i386 machine is running 11.0-STABLE and despite it was
> > compiled with "WITHOUT_ASSERT_DEBUG=3Dyes", still from time to time
> > message buffer is fed with:
> >   pfr_update_stats: assertion failed.
> >   pfr_update_stats: assertion failed.
> >   pfr_update_stats: assertion failed.
> >   pfr_update_stats: assertion failed.
> >   pfr_update_stats: assertion failed.
> >   pfr_update_stats: assertion failed.
> >   pfr_update_stats: assertion failed.
>=20
> These messages are still filling system message buffer. According to
> pfctl (8) there is nothing wrong with incrementing "XPass" counters
> instead of the "Pass" counters. The message "pfr_update_stats: assertion
> failed" is printed for debugging purposes only. One could also compare
> the counters with the command "pfctl -sT -vv".=20
>=20
> OpenBSD converted printf()'s to DPFDEBUG() macro in their sources almost
> 8 years ago. Only this printf() in pf_table.c has been converted to the
> level of LOG_DEBUG [1].
>=20
> Perhaps this line of code could be removed from FreeBSD PF sources?
>=20

The previous patch was hastily prepared. It should rather look like this:

--- sys/netpfil/pf/pf_table.orig.c	2018-06-23 16:40:14.876882000 +0200
+++ sys/netpfil/pf/pf_table.c	2018-06-23 18:17:49.353490000 +0200
@@ -1984,9 +1984,7 @@
 		panic("%s: unknown address family %u", __func__, af);
 	}
-	if ((ke =3D=3D NULL || ke->pfrke_not) !=3D notrule) {
-		if (op_pass !=3D PFR_OP_PASS)
-			printf("pfr_update_stats: assertion failed.\n");
+	if ((ke =3D=3D NULL || ke->pfrke_not) !=3D notrule)=20
 		op_pass =3D PFR_OP_XPASS;
-	}
 	kt->pfrkt_packets[dir_out][op_pass]++;
 	kt->pfrkt_bytes[dir_out][op_pass] +=3D len;

--=20
Marek Zarychta

--UlVJffcvxoiEqYs2
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQEzBAABCAAdFiEEMOqvKm6wKvS1/ZeCdZ/s//1SjSwFAlsueVUACgkQdZ/s//1S
jSztKQgArzNP6VPaQVfRTfIF63NhauJRskE4kfc6/PSqW9h1DcJEqwrtnST27hBZ
A1oWAGQ5zNbevjj+IF1MFUbFXYNNXs9FWhJUts4PWVPrxCePt3DeUPDpD93hk4VW
o9mYn6cxFjyBwFkvvZoBZxA+jaRU9FUHKILVRzdNOd19gPdq8RX2nK3dQ8y2dLDI
S+SGoN8cjXNMVaEAM4YU+0907UMOOutfZn8cXfbccjdl1gE0jo1mvx5SVBhlpqim
kKKnomSZ6pZrWh/m4UxCvdPSvV4XWelmBhTeAwdcLgqanWe8d2GeJC9QGEprhXmA
b1O2uFsUD5/QjDzLDM3LSncr8ggNkQ==
=w6LP
-----END PGP SIGNATURE-----

--UlVJffcvxoiEqYs2--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20180623164616.GA82672>