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

Bryan Drewery bdrewery at FreeBSD.org
Thu Feb 28 20:57:43 UTC 2019


Author: bdrewery
Date: Thu Feb 28 20:57:41 2019
New Revision: 344668
URL: https://svnweb.freebsd.org/changeset/base/344668

Log:
  MFC r343877,r343880:
  
    r343877:
      ipfw table list: Fix showing header outside of 'all'.
    r343880:
      Fix build of r343877
  
  Relnotes:	yes

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	Thu Feb 28 20:57:36 2019	(r344667)
+++ stable/11/sbin/ipfw/tables.c	Thu Feb 28 20:57:41 2019	(r344668)
@@ -282,13 +282,14 @@ ipfw_table_handler(int ac, char *av[])
 		}
 		break;
 	case TOK_LIST:
+		arg = is_all ? (void*)1 : NULL;
 		if (is_all == 0) {
 			ipfw_xtable_info i;
 			if ((error = table_get_info(&oh, &i)) != 0)
 				err(EX_OSERR, "failed to request table info");
-			table_show_one(&i, NULL);
+			table_show_one(&i, arg);
 		} else {
-			error = tables_foreach(table_show_one, NULL, 1);
+			error = tables_foreach(table_show_one, arg, 1);
 			if (error != 0)
 				err(EX_OSERR, "failed to request tables list");
 		}
@@ -821,13 +822,16 @@ table_show_one(ipfw_xtable_info *i, void *arg)
 {
 	ipfw_obj_header *oh;
 	int error;
+	int is_all;
 
+	is_all = arg == NULL ? 0 : 1;
+
 	if ((error = table_do_get_list(i, &oh)) != 0) {
 		err(EX_OSERR, "Error requesting table %s list", i->tablename);
 		return (error);
 	}
 
-	table_show_list(oh, 1);
+	table_show_list(oh, is_all);
 
 	free(oh);
 	return (0);	


More information about the svn-src-all mailing list