[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freebsd-commits-all
Subject:    svn commit: r344668 - stable/11/sbin/ipfw
From:       Bryan Drewery <bdrewery () FreeBSD ! org>
Date:       2019-02-28 20:57:41
Message-ID: 201902282057.x1SKvfY2087944 () repo ! freebsd ! org
[Download RAW message or body]

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);	
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic