🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: muc.lists.freebsd.bugs
Article #491

[Bug 300818] bsnmp-pf reports incorrect pfTablesTblCount values for PF tables

#491
From: bugzilla-noreply
Date: Mon, 16 Nov 2026 15:27
89 lines
5083 bytes
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=300818

            Bug ID: 300818
           Summary: bsnmp-pf reports incorrect pfTablesTblCount values for
                    PF tables
           Product: Base System
           Version: 15.1-STABLE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: bugs@FreeBSD.org
          Reporter: zeus@gnu.org.ua

The bsnmp-pf module (begemotPf MIB) reports wildly inaccurate address counts
for PF tables via the pfTablesTblCount OID
(1.3.6.1.4.1.12325.1.200.1.9.2.1.3).

When a dynamic table is populated with a large number of addresses (e.g., by
sshguard), pfctl correctly shows tens of thousands of entries, but bsnmpd
reports the count as 1 (or similarly low single-digit numbers).

Additionally, walking the actual address pool (pfTablesAddrTable / ...1.9.3)
successfully returns hundreds of thousands of lines, confirming the daemon
is aware the addresses exist, but the summary count in pfTablesTblTable is
broken.

Steps to Reproduce:

1. Populate a PF table with a large number of addresses.
2. Verify the true address count using pfctl.
3. Walk the pfTablesTblTable (1.3.6.1.4.1.12325.1.200.1.9.2.1) using bsnmpwalk.

Actual Results:
The actual count according to the kernel is 24,861:

# pfctl -T show -t sshguard | wc -l
   24861



The count reported by bsnmpd for the identical table is 1:

# bsnmpwalk -v 2 -s foo.bar 1.3.6.1.4.1.12325.1.200.1.9.2.1|grep '.68 ='
1.3.6.1.4.1.12325.1.200.1.9.2.1.2.68 = sshguard
1.3.6.1.4.1.12325.1.200.1.9.2.1.3.68 = 1
1.3.6.1.4.1.12325.1.200.1.9.2.1.4.68 = 5893600
1.3.6.1.4.1.12325.1.200.1.9.2.1.5.68 = 0
1.3.6.1.4.1.12325.1.200.1.9.2.1.6.68 = 0
1.3.6.1.4.1.12325.1.200.1.9.2.1.7.68 = 410
1.3.6.1.4.1.12325.1.200.1.9.2.1.8.68 = 72608
1.3.6.1.4.1.12325.1.200.1.9.2.1.9.68 = 0
1.3.6.1.4.1.12325.1.200.1.9.2.1.10.68 = 16712
1.3.6.1.4.1.12325.1.200.1.9.2.1.11.68 = 0
1.3.6.1.4.1.12325.1.200.1.9.2.1.12.68 = 0
1.3.6.1.4.1.12325.1.200.1.9.2.1.13.68 = 0
1.3.6.1.4.1.12325.1.200.1.9.2.1.14.68 = 0
1.3.6.1.4.1.12325.1.200.1.9.2.1.15.68 = 0
1.3.6.1.4.1.12325.1.200.1.9.2.1.16.68 = 281
1.3.6.1.4.1.12325.1.200.1.9.2.1.17.68 = 0
1.3.6.1.4.1.12325.1.200.1.9.2.1.18.68 = 0
1.3.6.1.4.1.12325.1.200.1.9.2.1.19.68 = 0
1.3.6.1.4.1.12325.1.200.1.9.2.1.20.68 = 0

As I suggest, the pfTablesTblCount value should closely match the output of
pfctl -T show -t <table> | wc -l.

Besides that:

The bug persists even when the SNMP table indices (e.g., 68 in the example
above) are perfectly synchronized across the pfTablesTblDescr and
pfTablesTblCount columns.

The values 1, 0, 0, 2... appearing in the count column suggest that bsnmp-pf
may be accidentally populating the count column with an internal reference
counter (like pfTablesTblRefsAnchor or pfTablesTblRefsRule) rather than the
actual pfr_tstats address count.

-- 
You are receiving this mail because:
You are the assignee for the bug.

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-admin@muc.de
Technical Details
Message-ID: <bug-300818-227@https.bugs.freebsd.org/bugzilla/>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!2.eu.feeder.erje.net!feeder.erje.net!news2.arglkargh.de!news.karotte.org!news.muc.de!.POSTED.news.muc.de!not-for-mail

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!2.eu.feeder.erje.net!feeder.erje.net!news2.arglkargh.de!news.karotte.org!news.muc.de!.POSTED.news.muc.de!not-for-mail
From: bugzilla-noreply@freebsd.org
Newsgroups: muc.lists.freebsd.bugs
Subject: [Bug 300818] bsnmp-pf reports incorrect pfTablesTblCount values for
 PF tables
Date: Mon, 16 Nov 2026 15:27:09 +0000
Organization: Newsgate at muc.de e.V.
Approved: news-admin@muc.de
Distribution: world
Message-ID: <bug-300818-227@https.bugs.freebsd.org/bugzilla/>
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Injection-Info: news.muc.de; posting-host="news.muc.de:193.149.48.2";
	logging-data="84018"; mail-complaints-to="news-admin@muc.de"
X-Original-To: bugs@mlmmj.nyi.freebsd.org
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim;
	t=1794842829;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding;
	bh=ZJKlvRmrHl0AiLbY3l/Hbt3mbJDxPiCwPmdfNpBmTC8=;
	b=gbh2HPnEaeitSWyFLBVQ5c4aOEdLQfP0MCKwedxy1tlVk07FVaE6JGe5se1I25Y/yHXbEM
	mNKCR31yp4pEItJ7asUE271cUIRBuIePy43OCxx20TfAfql74rrZxe26SQx48EI2K4U6OK
	kkVD7WjjpO3SpPKAo2ePeuUp0GUhVCV/EV+JnBfyg8vsGZ9dntnBZGmddmaSXiz/RAZpOx
	8PCnEYSAOn2QjKx3dX3dLP3dx5VCpoX7jnc5tXH+Zgv9hhGgGG0XFUAVPd6XjagfFVrFaa
	qGfxz+NRv55IfqmFp9HWO1nsL02vtRX09dT5Y9Xc0QpRAFan5p6J7Vs3QyR7/g==
X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f
Auto-Submitted: auto-generated
Precedence: list
X-Newsgate-Id: f02c70b8849f+
X-No-Archive: Yes