diff options
author | Ryan Thomas McBride <mcbride@cvs.openbsd.org> | 2006-11-07 06:16:57 +0000 |
---|---|---|
committer | Ryan Thomas McBride <mcbride@cvs.openbsd.org> | 2006-11-07 06:16:57 +0000 |
commit | 1e969d75b2e68f8cf347b825f004fca8dcfd003e (patch) | |
tree | 55235ee3c8acd308dcc19e9dd3993b341020becf /sbin | |
parent | c9b0720691a3741b4cf9a38b0545e359722a1091 (diff) |
Only try to recursively print rules if they are actually anchors.
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/pfctl/pfctl.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c index d3c2fc1e32e..e9e96ead821 100644 --- a/sbin/pfctl/pfctl.c +++ b/sbin/pfctl/pfctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pfctl.c,v 1.255 2006/11/07 01:12:01 mcbride Exp $ */ +/* $OpenBSD: pfctl.c,v 1.256 2006/11/07 06:16:56 mcbride Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -755,9 +755,10 @@ pfctl_show_rules(int dev, char *path, int opts, int format, if (pr.rule.label[0] && (opts & PF_OPT_SHOWALL)) labels = 1; INDENT(depth, !(opts & PF_OPT_VERBOSE)); - if ((((p = strrchr(pr.anchor_call, '_')) != NULL) && + if (pr.anchor_call[0] && + ((((p = strrchr(pr.anchor_call, '_')) != NULL) && ((void *)p == (void *)pr.anchor_call || - *(--p) == '/')) || opts & PF_OPT_RECURSE) { + *(--p) == '/')) || opts & PF_OPT_RECURSE)) { brace++; if ((p = strrchr(pr.anchor_call, '/')) != NULL) |