summaryrefslogtreecommitdiffstats
path: root/sbin/ipfw
diff options
context:
space:
mode:
authorae <ae@FreeBSD.org>2017-05-10 05:05:21 +0000
committerae <ae@FreeBSD.org>2017-05-10 05:05:21 +0000
commite18a1f1bdc4c218ec482daf2fe86d8f571234336 (patch)
tree9c152cb4abb32e862164bb100cb0bec695bad063 /sbin/ipfw
parenteb416a82609ee88948139b557fd027b05f0fa2b4 (diff)
downloadFreeBSD-src-e18a1f1bdc4c218ec482daf2fe86d8f571234336.zip
FreeBSD-src-e18a1f1bdc4c218ec482daf2fe86d8f571234336.tar.gz
MFC r317666:
Add sets support for ipfw table info/list/flush commands. PR: 212668
Diffstat (limited to 'sbin/ipfw')
-rw-r--r--sbin/ipfw/tables.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sbin/ipfw/tables.c b/sbin/ipfw/tables.c
index b8a8cd2..bc0c61b 100644
--- a/sbin/ipfw/tables.c
+++ b/sbin/ipfw/tables.c
@@ -1654,18 +1654,19 @@ tables_foreach(table_cb_t *f, void *arg, int sort)
}
if (sort != 0)
- qsort(olh + 1, olh->count, olh->objsize, tablename_cmp);
+ qsort(olh + 1, olh->count, olh->objsize,
+ tablename_cmp);
info = (ipfw_xtable_info *)(olh + 1);
for (i = 0; i < olh->count; i++) {
- error = f(info, arg); /* Ignore errors for now */
- info = (ipfw_xtable_info *)((caddr_t)info + olh->objsize);
+ if (co.use_set == 0 || info->set == co.use_set - 1)
+ error = f(info, arg);
+ info = (ipfw_xtable_info *)((caddr_t)info +
+ olh->objsize);
}
-
free(olh);
break;
}
-
return (0);
}
OpenPOWER on IntegriCloud