From owner-svn-src-stable@freebsd.org Thu Feb 28 20:57:43 2019 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71EA41518508; Thu, 28 Feb 2019 20:57:43 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0EA5987B3E; Thu, 28 Feb 2019 20:57:43 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 18125A77E; Thu, 28 Feb 2019 20:57:42 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1SKvfgk087945; Thu, 28 Feb 2019 20:57:41 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1SKvfY2087944; Thu, 28 Feb 2019 20:57:41 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201902282057.x1SKvfY2087944@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 28 Feb 2019 20:57:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r344668 - stable/11/sbin/ipfw X-SVN-Group: stable-11 X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: stable/11/sbin/ipfw X-SVN-Commit-Revision: 344668 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0EA5987B3E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.947,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Feb 2019 20:57:43 -0000 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);