diff options
author | Cedric Berger <cedric@cvs.openbsd.org> | 2004-02-26 11:57:20 +0000 |
---|---|---|
committer | Cedric Berger <cedric@cvs.openbsd.org> | 2004-02-26 11:57:20 +0000 |
commit | 2174234402981deb3b259b1c5ca988f28be55ee4 (patch) | |
tree | f9c235e84438b2651cfd6ea78125a51bd310baa0 | |
parent | 79c6c491cea62c4fc7a2fbce1038424de50f5ec0 (diff) |
Fix pfctl -sa output. Found by David Krause, ok mcbride@
-rw-r--r-- | sbin/pfctl/pfctl_table.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/sbin/pfctl/pfctl_table.c b/sbin/pfctl/pfctl_table.c index 9daa0b646a7..4d4f1e786ad 100644 --- a/sbin/pfctl/pfctl_table.c +++ b/sbin/pfctl/pfctl_table.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pfctl_table.c,v 1.57 2004/02/19 21:37:01 cedric Exp $ */ +/* $OpenBSD: pfctl_table.c,v 1.58 2004/02/26 11:57:19 cedric Exp $ */ /* * Copyright (c) 2002 Cedric Berger @@ -156,7 +156,6 @@ pfctl_table(int argc, char *argv[], char *tname, const char *command, RVTEST(pfr_clr_tables(&table, &ndel, flags)); xprintf(opts, "%d tables deleted", ndel); } else if (!strcmp(command, "-s")) { - int i = 0; b.pfrb_type = (opts & PF_OPT_VERBOSE2) ? PFRB_TSTATS : PFRB_TABLES; if (argc || file != NULL) @@ -172,10 +171,9 @@ pfctl_table(int argc, char *argv[], char *tname, const char *command, b.pfrb_caddr, &b.pfrb_size, flags)); if (b.pfrb_size <= b.pfrb_msize) break; - i++; } - if (opts & PF_OPT_SHOWALL && i > 0) + if (opts & PF_OPT_SHOWALL && b.pfrb_size > 0) pfctl_print_title("TABLES:"); PFRB_FOREACH(p, &b) |