Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Aug 2015 15:32:09 +0000 (UTC)
From:      Marcelo Araujo <araujo@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r287130 - head/sbin/ipfw
Message-ID:  <201508251532.t7PFW9Wb000114@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201508251532.t7PFW9Wb000114>