Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 May 2017 05:05:21 +0000 (UTC)
From:      "Andrey V. Elsukov" <ae@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r318134 - stable/11/sbin/ipfw
Message-ID:  <201705100505.v4A55LU0050416@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201705100505.v4A55LU0050416>