svn commit: r317666 - head/sbin/ipfw
Andrey V. Elsukov
ae at FreeBSD.org
Tue May 2 05:02:13 UTC 2017
Author: ae
Date: Tue May 2 05:02:12 2017
New Revision: 317666
URL: https://svnweb.freebsd.org/changeset/base/317666
Log:
Add sets support for ipfw table info/list/flush commands.
PR: 212668
MFC after: 1 week
Modified:
head/sbin/ipfw/tables.c
Modified: head/sbin/ipfw/tables.c
==============================================================================
--- head/sbin/ipfw/tables.c Tue May 2 02:32:10 2017 (r317665)
+++ head/sbin/ipfw/tables.c Tue May 2 05:02:12 2017 (r317666)
@@ -1628,18 +1628,19 @@ tables_foreach(table_cb_t *f, void *arg,
}
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);
}
More information about the svn-src-head
mailing list