From owner-freebsd-pf@freebsd.org Sat Jun 23 16:46:20 2018 Return-Path: Delivered-To: freebsd-pf@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2DD2410271CB for ; Sat, 23 Jun 2018 16:46:20 +0000 (UTC) (envelope-from zarychtam@plan-b.pwste.edu.pl) Received: from plan-b.pwste.edu.pl (plan-b.pwste.edu.pl [IPv6:2001:678:618::40]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "plan-b.pwste.edu.pl", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A89508A1B1 for ; Sat, 23 Jun 2018 16:46:19 +0000 (UTC) (envelope-from zarychtam@plan-b.pwste.edu.pl) Received: from plan-b.pwste.edu.pl (zarychtam@localhost [127.0.0.1]) by plan-b.pwste.edu.pl (8.15.2/8.15.2) with ESMTPS id w5NGkGM7082793 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Sat, 23 Jun 2018 18:46:16 +0200 (CEST) (envelope-from zarychtam@plan-b.pwste.edu.pl) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=plan-b.pwste.edu.pl; s=plan-b-mailer; t=1529772376; bh=z/uigPvSai/9EymuGNCDW2Rxl0y7rknw6O1XamM6QwI=; h=Date:From:To:Subject:References:In-Reply-To; b=zk53V2AG2DvCX6jC6a1A6uZZsMUPkBfRMJOq61PLzHzCpco9rpz0T4v5UajkpbCz7 pPxCGrmPq1LJo4Nl1YoNCDkotuHOTzECgKSxengekPA4xNn5c1YZ2ckvpINHiGJ2+I 8wo2qe0nrPOB+Fyjw/V89UVnUslQa/c2Rn5juc7PCvA8NdKieUbZc7XDTg6h6SNa7q bFFmUmNdEol830Q+6O0mcfSWB7jA5rypX78K7II8OOUQSzpwUYGG90NlWOlyWZjb5G tcF7p7SRjtoKme+9LbB4aCX3jVZLA38e4pRjCGFzQBpEIwyBsrKpUsx5izhiNxm9Ks 70fGN1VfBm3EQ== Received: (from zarychtam@localhost) by plan-b.pwste.edu.pl (8.15.2/8.15.2/Submit) id w5NGkGn1082792 for freebsd-pf@freebsd.org; Sat, 23 Jun 2018 18:46:16 +0200 (CEST) (envelope-from zarychtam) Date: Sat, 23 Jun 2018 18:46:16 +0200 From: Marek Zarychta To: freebsd-pf@freebsd.org Subject: Re: pfr_update_stats: assertion failed. Message-ID: <20180623164616.GA82672@plan-b.pwste.edu.pl> References: <20161016181713.GA95110@plan-b.pwste.edu.pl> <20180623152729.GA81271@plan-b.pwste.edu.pl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="UlVJffcvxoiEqYs2" Content-Disposition: inline In-Reply-To: <20180623152729.GA81271@plan-b.pwste.edu.pl> User-Agent: Mutt/1.10.0 (2018-05-17) X-BeenThere: freebsd-pf@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "Technical discussion and general questions about packet filter \(pf\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jun 2018 16:46:20 -0000 --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--