diff options
author | araujo <araujo@FreeBSD.org> | 2015-08-25 15:32:08 +0000 |
---|---|---|
committer | araujo <araujo@FreeBSD.org> | 2015-08-25 15:32:08 +0000 |
commit | 9ff051aa1cc08152eef35ef635d5a4403a86cc95 (patch) | |
tree | 21d06071b944839e6ff3236ddeb50c094d261c7a | |
parent | 3ddee62f4a99a8b6dbced79f4702d17c75a95b64 (diff) | |
download | FreeBSD-src-9ff051aa1cc08152eef35ef635d5a4403a86cc95.zip FreeBSD-src-9ff051aa1cc08152eef35ef635d5a4403a86cc95.tar.gz |
Code cleanup unused-but-set-variable spotted by gcc.
Reviewed by: melifaro
Approved by: bapt (mentor)
Differential Revision: D3473
-rw-r--r-- | sbin/ipfw/ipfw2.c | 4 | ||||
-rw-r--r-- | sbin/ipfw/nat.c | 6 | ||||
-rw-r--r-- | sbin/ipfw/tables.c | 8 |
3 files changed, 4 insertions, 14 deletions
diff --git a/sbin/ipfw/ipfw2.c b/sbin/ipfw/ipfw2.c index 9669dc6..8ad8f90 100644 --- a/sbin/ipfw/ipfw2.c +++ b/sbin/ipfw/ipfw2.c @@ -1308,14 +1308,12 @@ print_icmptypes(struct buf_pr *bp, ipfw_insn_u32 *cmd) 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)) { diff --git a/sbin/ipfw/nat.c b/sbin/ipfw/nat.c index 184b172..28dac86 100644 --- a/sbin/ipfw/nat.c +++ b/sbin/ipfw/nat.c @@ -87,7 +87,7 @@ set_addr_dynamic(const char *ifn, struct nat44_cfg_nat *n) 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 nat44_cfg_nat *n) 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, void *arg) 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) diff --git a/sbin/ipfw/tables.c b/sbin/ipfw/tables.c index 8a2c147..506d771 100644 --- a/sbin/ipfw/tables.c +++ b/sbin/ipfw/tables.c @@ -387,11 +387,9 @@ table_create(ipfw_obj_header *oh, int ac, char *av[]) 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, char *av[]) { 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, ipfw_obj_tentry *tent, char *arg, 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) { |