aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryan Drewery <bdrewery@FreeBSD.org>2019-02-07 21:05:44 +0000
committerBryan Drewery <bdrewery@FreeBSD.org>2019-02-07 21:05:44 +0000
commit2b3d6647387f70a1776e71813bd792077f22cdc0 (patch)
tree482ec511a4229b284921688d362b0e15d790c0b9
parent4f33c3808382c3dc989aee2b24d59238d6e8348b (diff)
downloadsrc-2b3d6647387f70a1776e71813bd792077f22cdc0.tar.gz
src-2b3d6647387f70a1776e71813bd792077f22cdc0.zip
ipfw table list: Fix showing header outside of 'all'.
Properly pass down is_all to table_show_list(). This restores the behavior before r272840 so that only 'ipfw table all list' shows the headers. MFC after: 2 weeks Relnotes: yes
Notes
Notes: svn path=/head/; revision=343877
-rw-r--r--sbin/ipfw/tables.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sbin/ipfw/tables.c b/sbin/ipfw/tables.c
index 0c3f38060965..3cb037802676 100644
--- a/sbin/ipfw/tables.c
+++ b/sbin/ipfw/tables.c
@@ -282,13 +282,14 @@ ipfw_table_handler(int ac, char *av[])
}
break;
case TOK_LIST:
+ arg = is_all ? (void*)1 : (void*)0;
if (is_all == 0) {
ipfw_xtable_info i;
if ((error = table_get_info(&oh, &i)) != 0)
err(EX_OSERR, "failed to request table info");
- table_show_one(&i, NULL);
+ table_show_one(&i, arg);
} else {
- error = tables_foreach(table_show_one, NULL, 1);
+ error = tables_foreach(table_show_one, arg, 1);
if (error != 0)
err(EX_OSERR, "failed to request tables list");
}
@@ -821,13 +822,14 @@ table_show_one(ipfw_xtable_info *i, void *arg)
{
ipfw_obj_header *oh;
int error;
+ int is_all = (int)arg;
if ((error = table_do_get_list(i, &oh)) != 0) {
err(EX_OSERR, "Error requesting table %s list", i->tablename);
return (error);
}
- table_show_list(oh, 1);
+ table_show_list(oh, is_all);
free(oh);
return (0);