git: 3b4437e9c9df - stable/15 - pf: set the correct type for rule timeouts

From: Kristof Provost <kp_at_FreeBSD.org>
Date: Tue, 06 Oct 2026 21:25:14 UTC
The branch stable/15 has been updated by kp:

URL: https://cgit.FreeBSD.org/src/commit/?id=3b4437e9c9df13612b9958144dbb7a77ed22a258

commit 3b4437e9c9df13612b9958144dbb7a77ed22a258
Author:     Kristof Provost <kp@FreeBSD.org>
AuthorDate: 2026-09-28 18:11:45 +0000
Commit:     Kristof Provost <kp@FreeBSD.org>
CommitDate: 2026-10-06 21:22:37 +0000

    pf: set the correct type for rule timeouts
    
    PR:             298877
    MFC after:      1 week
    Sponsored by:   Rubicon Communications, LLC ("Netgate")
    
    (cherry picked from commit 3c58e64369fd8124c83f1c7d63106bddca83fa1e)
---
 sys/netpfil/pf/pf_nl.c            |  2 +-
 tests/sys/netpfil/pf/src_track.sh | 25 +++++++++++++++++++++++++
 2 files changed, 26 insertions(+), 1 deletion(-)

diff --git a/sys/netpfil/pf/pf_nl.c b/sys/netpfil/pf/pf_nl.c
index 5df1457594e7..b8655297f782 100644
--- a/sys/netpfil/pf/pf_nl.c
+++ b/sys/netpfil/pf/pf_nl.c
@@ -676,7 +676,7 @@ nlattr_add_timeout(struct nl_writer *nw, int attrtype, uint32_t *timeout)
 	int off = nlattr_add_nested(nw, attrtype);
 
 	for (int i = 0; i < PFTM_MAX; i++)
-		nlattr_add_u32(nw, PF_RT_TIMEOUT, timeout[i]);
+		nlattr_add_u32(nw, PF_TT_TIMEOUT, timeout[i]);
 
 	nlattr_set_len(nw, off);
 
diff --git a/tests/sys/netpfil/pf/src_track.sh b/tests/sys/netpfil/pf/src_track.sh
index d86b4ce6c466..cc0f11b51413 100755
--- a/tests/sys/netpfil/pf/src_track.sh
+++ b/tests/sys/netpfil/pf/src_track.sh
@@ -588,6 +588,30 @@ mixed_af_cleanup()
 	pft_cleanup
 }
 
+atf_test_case "pr298877" "cleanup"
+pr298877_head()
+{
+	atf_set descr 'Test per rule timeout values'
+	atf_set require.user root
+}
+
+pr298877_body()
+{
+	pft_init
+
+	vnet_mkjail alcatraz
+	pft_set_rules alcatraz \
+	    "pass in keep state (src.track 10)"
+
+	atf_check -s exit:0 -o match:'.*src.track 10.*' \
+	    jexec alcatraz pfctl -sr
+}
+
+pr298877_cleanup()
+{
+	pft_cleanup
+}
+
 atf_init_test_cases()
 {
 	atf_add_test_case "source_track"
@@ -598,4 +622,5 @@ atf_init_test_cases()
 	atf_add_test_case "sn_types_compat"
 	atf_add_test_case "sn_types_pass"
 	atf_add_test_case "mixed_af"
+	atf_add_test_case "pr298877"
 }