Commit d86cf443 authored by Matteo Riondato's avatar Matteo Riondato Committed by Kristof Provost
Browse files

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
parent 4642a6fa
......@@ -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)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment