libpfctl: Fix displaying deeply nested anchors

Set the number of rulesets (i.e., anchors) directly attached to the
anchor and its path in pfctl_get_ruleset().

While here, add a test to document this behavior.

PR:		290478
Reviewed by:	kp
Fixes:		041ce1d690 ("pfctl: recursively flush rules and tables")
MFC after:	2 days
Differential Revision:	https://reviews.freebsd.org/D53358
This commit is contained in:
Jose Luis Duran
2025-10-25 09:19:18 +00:00
parent e5f545e0d8
commit a943a96a50
2 changed files with 49 additions and 0 deletions
+3
View File
@@ -3202,6 +3202,9 @@ pfctl_get_ruleset(struct pfctl_handle *h, const char *path, uint32_t nr, struct
continue;
}
rs->nr = nr;
strlcpy(rs->path, path, sizeof(rs->path));
return (e.error);
}