From owner-svn-src-head@freebsd.org Tue Aug 25 15:32:10 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 592E999A5E5; Tue, 25 Aug 2015 15:32:10 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.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 3D9BCEF4; Tue, 25 Aug 2015 15:32:10 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7PFWA3n000117; Tue, 25 Aug 2015 15:32:10 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7PFW9Wb000114; Tue, 25 Aug 2015 15:32:09 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201508251532.t7PFW9Wb000114@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Tue, 25 Aug 2015 15:32:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287130 - 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.20 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: Tue, 25 Aug 2015 15:32:10 -0000 Author: araujo Date: Tue Aug 25 15:32:08 2015 New Revision: 287130 URL: https://svnweb.freebsd.org/changeset/base/287130 Log: Code cleanup unused-but-set-variable spotted by gcc. Reviewed by: melifaro Approved by: bapt (mentor) Differential Revision: D3473 Modified: head/sbin/ipfw/ipfw2.c head/sbin/ipfw/nat.c head/sbin/ipfw/tables.c Modified: head/sbin/ipfw/ipfw2.c ============================================================================== --- head/sbin/ipfw/ipfw2.c Tue Aug 25 15:27:32 2015 (r287129) +++ head/sbin/ipfw/ipfw2.c Tue Aug 25 15:32:08 2015 (r287130) @@ -1308,14 +1308,12 @@ print_icmptypes(struct buf_pr *bp, ipfw_ static void print_dscp(struct buf_pr *bp, ipfw_insn_u32 *cmd) { - int i, c; + int i = 0; uint32_t *v; char sep= ' '; const char *code; bprintf(bp, " dscp"); - i = 0; - c = 0; v = cmd->d; while (i < 64) { if (*v & (1 << i)) { Modified: head/sbin/ipfw/nat.c ============================================================================== --- head/sbin/ipfw/nat.c Tue Aug 25 15:27:32 2015 (r287129) +++ head/sbin/ipfw/nat.c Tue Aug 25 15:32:08 2015 (r287130) @@ -87,7 +87,7 @@ set_addr_dynamic(const char *ifn, struct struct ifa_msghdr *ifam; struct sockaddr_dl *sdl; struct sockaddr_in *sin; - int ifIndex, ifMTU; + int ifIndex; mib[0] = CTL_NET; mib[1] = PF_ROUTE; @@ -126,7 +126,6 @@ set_addr_dynamic(const char *ifn, struct if (strlen(ifn) == sdl->sdl_nlen && strncmp(ifn, sdl->sdl_data, sdl->sdl_nlen) == 0) { ifIndex = ifm->ifm_index; - ifMTU = ifm->ifm_data.ifi_mtu; break; } } @@ -635,14 +634,13 @@ nat_show_log(struct nat44_cfg_nat *n, vo static void nat_show_cfg(struct nat44_cfg_nat *n, void *arg) { - int i, cnt, flag, off; + int i, cnt, off; struct nat44_cfg_redir *t; struct nat44_cfg_spool *s; caddr_t buf; struct protoent *p; buf = (caddr_t)n; - flag = 1; off = sizeof(*n); printf("ipfw nat %s config", n->name); if (strlen(n->if_name) != 0) Modified: head/sbin/ipfw/tables.c ============================================================================== --- head/sbin/ipfw/tables.c Tue Aug 25 15:27:32 2015 (r287129) +++ head/sbin/ipfw/tables.c Tue Aug 25 15:32:08 2015 (r287130) @@ -387,11 +387,9 @@ table_create(ipfw_obj_header *oh, int ac ipfw_xtable_info xi; int error, tcmd, val; uint32_t fset, fclear; - size_t sz; char *e, *p; char tbuf[128]; - sz = sizeof(tbuf); memset(&xi, 0, sizeof(xi)); while (ac > 0) { @@ -494,10 +492,7 @@ table_modify(ipfw_obj_header *oh, int ac { ipfw_xtable_info xi; int tcmd; - size_t sz; - char tbuf[128]; - sz = sizeof(tbuf); memset(&xi, 0, sizeof(xi)); while (ac > 0) { @@ -1449,14 +1444,13 @@ tentry_fill_value(ipfw_obj_header *oh, i uint8_t type, uint32_t vmask) { struct addrinfo hints, *res; - uint32_t a4, flag, val, vm; + uint32_t a4, flag, val; ipfw_table_value *v; uint32_t i; int dval; char *comma, *e, *etype, *n, *p; v = &tent->v.value; - vm = vmask; /* Compat layer: keep old behavior for legacy value types */ if (vmask == IPFW_VTYPE_LEGACY) {