diff options
author | Ryan Thomas McBride <mcbride@cvs.openbsd.org> | 2006-10-31 23:46:26 +0000 |
---|---|---|
committer | Ryan Thomas McBride <mcbride@cvs.openbsd.org> | 2006-10-31 23:46:26 +0000 |
commit | 830df3f8420b9a9e5efb47bd5a79ec1eaba144a4 (patch) | |
tree | 3b385aee32f1652d620f4b3407038d8c5e7b4df1 /sbin/pfctl/pfctl_parser.c | |
parent | 4408b82564117ed0494a4eeabda5de5816253ac9 (diff) |
Allow a user to recursively print anchors including those without
reserved names, if a trailing * is specified in the anchor name.
e.g. recursively print the main ruleset:
pfctl -a '*' -sr
Recursively print the spam anchor:
pfctl -a 'spam*'
pfctl -a 'spam/*'
Also fix a bug which prevented the contents of inline anchors with
explicit names from being loaded into the kernel.
ok henning@
Diffstat (limited to 'sbin/pfctl/pfctl_parser.c')
-rw-r--r-- | sbin/pfctl/pfctl_parser.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/sbin/pfctl/pfctl_parser.c b/sbin/pfctl/pfctl_parser.c index 4503048e069..e7b3b852735 100644 --- a/sbin/pfctl/pfctl_parser.c +++ b/sbin/pfctl/pfctl_parser.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pfctl_parser.c,v 1.233 2006/10/28 14:29:05 mcbride Exp $ */ +/* $OpenBSD: pfctl_parser.c,v 1.234 2006/10/31 23:46:24 mcbride Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -668,7 +668,6 @@ print_rule(struct pf_rule *r, const char *anchor_call, int verbose) "anchor", "nat-anchor", "nat-anchor", "binat-anchor", "binat-anchor", "rdr-anchor", "rdr-anchor" }; int i, opts; - int brace = 0; if (verbose) printf("@%d ", r->nr); @@ -676,12 +675,10 @@ print_rule(struct pf_rule *r, const char *anchor_call, int verbose) printf("action(%d)", r->action); else if (anchor_call[0]) { if (anchor_call[0] == '_') { - brace++; printf("%s", anchortypes[r->action]); } else printf("%s \"%s\"", anchortypes[r->action], anchor_call); - } else { printf("%s", actiontypes[r->action]); if (r->natpass) @@ -990,9 +987,6 @@ print_rule(struct pf_rule *r, const char *anchor_call, int verbose) print_pool(&r->rpool, r->rpool.proxy_port[0], r->rpool.proxy_port[1], r->af, r->action); } - if (brace) - printf(" {"); - printf("\n"); } void |