From owner-svn-src-head@FreeBSD.ORG Fri Oct 17 20:47:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A31BC632; Fri, 17 Oct 2014 20:47:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 75114BE9; Fri, 17 Oct 2014 20:47:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s9HKluoH064469; Fri, 17 Oct 2014 20:47:56 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9HKlugd064466; Fri, 17 Oct 2014 20:47:56 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201410172047.s9HKlugd064466@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Fri, 17 Oct 2014 20:47:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273241 - head/sbin/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Oct 2014 20:47:56 -0000 Author: melifaro Date: Fri Oct 17 20:47:55 2014 New Revision: 273241 URL: https://svnweb.freebsd.org/changeset/base/273241 Log: * Fix table sets handling. * Simplify formatting. Suggested by: luigi Modified: head/sbin/ipfw/ipfw2.c head/sbin/ipfw/tables.c Modified: head/sbin/ipfw/ipfw2.c ============================================================================== --- head/sbin/ipfw/ipfw2.c Fri Oct 17 20:39:39 2014 (r273240) +++ head/sbin/ipfw/ipfw2.c Fri Oct 17 20:47:55 2014 (r273241) @@ -2138,7 +2138,7 @@ ipfw_sets_handler(char *av[]) { uint32_t masks[2]; int i; - uint8_t cmd, new_set, rulenum; + uint8_t cmd, rulenum; ipfw_range_tlv rt; char *msg; size_t size; @@ -2202,7 +2202,7 @@ ipfw_sets_handler(char *av[]) if (!isdigit(*(av[0])) || (cmd == 3 && rt.set > RESVD_SET) || (cmd == 2 && rt.start_rule == IPFW_DEFAULT_RULE) ) errx(EX_DATAERR, "invalid source number %s\n", av[0]); - if (!isdigit(*(av[2])) || new_set > RESVD_SET) + if (!isdigit(*(av[2])) || rt.new_set > RESVD_SET) errx(EX_DATAERR, "invalid dest. set %s\n", av[1]); i = do_range_cmd(cmd, &rt); } else if (_substrcmp(*av, "disable") == 0 || @@ -2543,6 +2543,7 @@ ipfw_show_config(struct cmdline_opts *co dynbase = NULL; dynsz = 0; read = sizeof(*cfg); + rcnt = 0; fo->set_mask = cfg->set_mask; Modified: head/sbin/ipfw/tables.c ============================================================================== --- head/sbin/ipfw/tables.c Fri Oct 17 20:39:39 2014 (r273240) +++ head/sbin/ipfw/tables.c Fri Oct 17 20:47:55 2014 (r273241) @@ -1908,7 +1908,7 @@ ipfw_list_values(int ac, char *av[]) for (i = 0; i < olh->count; i++) { table_show_value(buf, sizeof(buf), (ipfw_table_value *)v, vmask, 0); - printf("[%u] refs=%ju %s\n", v->spare1, v->refcnt, buf); + printf("[%u] refs=%lu %s\n", v->spare1, (u_long)v->refcnt, buf); v = (struct _table_value *)((caddr_t)v + olh->objsize); }