svn commit: r318134 - stable/11/sbin/ipfw

Andrey V. Elsukov ae at FreeBSD.org
Wed May 10 05:05:22 UTC 2017


Author: ae
Date: Wed May 10 05:05:21 2017
New Revision: 318134
URL: https://svnweb.freebsd.org/changeset/base/318134

Log:
  MFC r317666:
    Add sets support for ipfw table info/list/flush commands.
  
    PR:		212668

Modified:
  stable/11/sbin/ipfw/tables.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sbin/ipfw/tables.c
==============================================================================
--- stable/11/sbin/ipfw/tables.c	Wed May 10 05:04:16 2017	(r318133)
+++ stable/11/sbin/ipfw/tables.c	Wed May 10 05:05:21 2017	(r318134)
@@ -1654,18 +1654,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-all mailing list