summaryrefslogtreecommitdiff
path: root/sbin/pfctl/pfctl_qstats.c
diff options
context:
space:
mode:
authorRyan Thomas McBride <mcbride@cvs.openbsd.org>2004-01-29 01:25:14 +0000
committerRyan Thomas McBride <mcbride@cvs.openbsd.org>2004-01-29 01:25:14 +0000
commitff7c23cd9c21fb734bc32bea72d363e1bf1062f4 (patch)
treed3a6958a7fa65e3183123a23096da321de878f26 /sbin/pfctl/pfctl_qstats.c
parent7457a320f6802dfe7a4512de256878ea2bea673b (diff)
Clean up 'pfctl -s all' output.
ok deraadt@ henning@
Diffstat (limited to 'sbin/pfctl/pfctl_qstats.c')
-rw-r--r--sbin/pfctl/pfctl_qstats.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sbin/pfctl/pfctl_qstats.c b/sbin/pfctl/pfctl_qstats.c
index 23c431ea1fd..0517fcdd248 100644
--- a/sbin/pfctl/pfctl_qstats.c
+++ b/sbin/pfctl/pfctl_qstats.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfctl_qstats.c,v 1.24 2003/07/31 09:46:08 kjc Exp $ */
+/* $OpenBSD: pfctl_qstats.c,v 1.25 2004/01/29 01:25:13 mcbride Exp $ */
/*
* Copyright (c) Henning Brauer <henning@openbsd.org>
@@ -84,9 +84,13 @@ int
pfctl_show_altq(int dev, int opts, int verbose2)
{
struct pf_altq_node *root = NULL, *node;
+ int nodes;
- if (pfctl_update_qstats(dev, &root))
+
+ if ((nodes = pfctl_update_qstats(dev, &root)) < 0)
return (-1);
+ if (opts & PF_OPT_SHOWALL && nodes > 0)
+ pfctl_print_title("ALTQ:");
for (node = root; node != NULL; node = node->next)
pfctl_print_altq_node(dev, node, 0, opts);
@@ -155,7 +159,7 @@ pfctl_update_qstats(int dev, struct pf_altq_node **root)
}
}
}
- return (0);
+ return (mnr);
}
void