Add sets support for ipfw table info/list/flush commands.

PR:		212668
MFC after:	1 week
This commit is contained in:
ae 2017-05-02 05:02:12 +00:00
parent 93b20c978b
commit bfda0532b1

View File

@ -1628,18 +1628,19 @@ tables_foreach(table_cb_t *f, void *arg, int sort)
} }
if (sort != 0) 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); info = (ipfw_xtable_info *)(olh + 1);
for (i = 0; i < olh->count; i++) { for (i = 0; i < olh->count; i++) {
error = f(info, arg); /* Ignore errors for now */ if (co.use_set == 0 || info->set == co.use_set - 1)
info = (ipfw_xtable_info *)((caddr_t)info + olh->objsize); error = f(info, arg);
info = (ipfw_xtable_info *)((caddr_t)info +
olh->objsize);
} }
free(olh); free(olh);
break; break;
} }
return (0); return (0);
} }