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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user