0 commit ad7f49f98b1ae7504f69db897901a055613c8300 Author: Kristof Provost AuthorDate: 2025-12-17 13:59:34 +0000 Commit: Kristof Provost CommitDate: 2025-12-18 13:39:27 +0000 libpfctl: fix tstats address count Reported by: Marcos Mendoza See also: https://redmine.pfsense.org/issues/16588 Sponsored by: Rubicon Communications, LLC ("Netgate") --- lib/libpfctl/libpfctl.c | 3 ++- tests/sys/netpfil/pf/table.sh | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) 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 @@ -194,6 +194,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" \