mirror of
https://github.com/opnsense/src.git
synced 2026-02-18 18:20:26 -05:00
pfctl: fix recursive printing of rules
When asked to print rules recursively, correctly recurse for anchors included in pf.conf with "anchorname/*". PR: 262590 Reviewed by: kp MFC after: 3 weeks
This commit is contained in:
parent
4642a6fac2
commit
d86cf44350
1 changed files with 5 additions and 7 deletions
|
|
@ -1248,13 +1248,11 @@ pfctl_show_rules(int dev, char *path, int opts, enum pfctl_show format,
|
|||
((void *)p == (void *)anchor_call ||
|
||||
*(--p) == '/')) || (opts & PF_OPT_RECURSE))) {
|
||||
brace++;
|
||||
if ((p = strrchr(anchor_call, '/')) !=
|
||||
NULL)
|
||||
p++;
|
||||
else
|
||||
p = &anchor_call[0];
|
||||
} else
|
||||
p = &anchor_call[0];
|
||||
int aclen = strlen(anchor_call);
|
||||
if (anchor_call[aclen - 1] == '*')
|
||||
anchor_call[aclen - 2] = '\0';
|
||||
}
|
||||
p = &anchor_call[0];
|
||||
|
||||
print_rule(&rule, p, rule_numbers, numeric);
|
||||
if (brace)
|
||||
|
|
|
|||
Loading…
Reference in a new issue