aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristof Provost <kp@FreeBSD.org>2025-12-17 13:59:34 +0000
committerKristof Provost <kp@FreeBSD.org>2025-12-18 13:39:27 +0000
commitad7f49f98b1ae7504f69db897901a055613c8300 (patch)
tree6816a5197ce4c4077bc3ae21b1c4b65649b60e15
parenta862e4b5a27c356e2584ee74fd9e211c18b1b125 (diff)
libpfctl: fix tstats address count
Reported by: Marcos Mendoza <mmendoza@netgate.com> See also: https://redmine.pfsense.org/issues/16588 Sponsored by: Rubicon Communications, LLC ("Netgate")
-rw-r--r--lib/libpfctl/libpfctl.c3
-rw-r--r--tests/sys/netpfil/pf/table.sh4
2 files changed, 6 insertions, 1 deletions
diff --git a/lib/libpfctl/libpfctl.c b/lib/libpfctl/libpfctl.c
index ab49dabe88c2..1959f7bebc39 100644
--- a/lib/libpfctl/libpfctl.c
+++ b/lib/libpfctl/libpfctl.c
@@ -3611,7 +3611,8 @@ static struct snl_attr_parser ap_tstats[] = {
{ .type = PF_TS_MATCH, .off = _OUT(pfrts_match), .cb = snl_attr_get_uint64 },
{. type = PF_TS_NOMATCH, .off = _OUT(pfrts_nomatch), .cb = snl_attr_get_uint64 },
{ .type = PF_TS_TZERO, .off = _OUT(pfrts_tzero), .cb = snl_attr_get_uint64 },
- { .type = PF_TS_REFCNT, .off = _OUT(pfrts_cnt), . arg = (void *)PFR_REFCNT_MAX, .cb = snl_attr_get_uint64_into_int_array },
+ { .type = PF_TS_CNT, .off = _OUT(pfrts_cnt), .cb = snl_attr_get_uint64 },
+ { .type = PF_TS_REFCNT, .off = _OUT(pfrts_refcnt), . arg = (void *)PFR_REFCNT_MAX, .cb = snl_attr_get_uint64_into_int_array },
};
#undef _OUT
SNL_DECLARE_PARSER(tstats_parser, struct genlmsghdr, snl_f_p_empty, ap_tstats);
diff --git a/tests/sys/netpfil/pf/table.sh b/tests/sys/netpfil/pf/table.sh
index 0b2b56592404..cd83ac90e559 100644
--- a/tests/sys/netpfil/pf/table.sh
+++ b/tests/sys/netpfil/pf/table.sh
@@ -195,6 +195,10 @@ zero_one_body()
jexec alcatraz pfctl -t foo -T show -vv
atf_check -s exit:0 -e ignore \
+ -o match:'Addresses: 2' \
+ jexec alcatraz pfctl -vvsTables
+
+ atf_check -s exit:0 -e ignore \
-o match:'In/Block:.*'"$TABLE_STATS_ZERO_REGEXP" \
-o match:'In/Pass:.*'"$TABLE_STATS_NONZERO_REGEXP" \
-o match:'Out/Block:.*'"$TABLE_STATS_ZERO_REGEXP" \