summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Longeau <chl@cvs.openbsd.org>2008-09-02 17:35:17 +0000
committerCharles Longeau <chl@cvs.openbsd.org>2008-09-02 17:35:17 +0000
commit515e538a073e21d6705d296c6ea932d050d1b528 (patch)
tree6d3622a34bc0516e1d8bd0b8fec4d0b2dd801aa1
parent63e2ccc237ef84c0b764d3c3ff28f34149565bea (diff)
remove dead stores and newly created unused variables.
Found by LLVM/Clang Static Analyzer. ok henning@ mpf@
-rw-r--r--sys/net/if_bridge.c8
-rw-r--r--sys/net/if_pfsync.c6
-rw-r--r--sys/net/if_vlan.c6
-rw-r--r--sys/net/pf.c6
4 files changed, 8 insertions, 18 deletions
diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c
index 21496b9e964..68137511536 100644
--- a/sys/net/if_bridge.c
+++ b/sys/net/if_bridge.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_bridge.c,v 1.170 2008/06/14 21:46:22 reyk Exp $ */
+/* $OpenBSD: if_bridge.c,v 1.171 2008/09/02 17:35:16 chl Exp $ */
/*
* Copyright (c) 1999, 2000 Jason L. Wright (jason@thought.net)
@@ -999,7 +999,7 @@ bridge_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *sa,
{
struct ether_header *eh;
struct ifnet *dst_if;
- struct ether_addr *src, *dst;
+ struct ether_addr *dst;
struct bridge_softc *sc;
int s, error, len;
#ifdef IPSEC
@@ -1020,7 +1020,6 @@ bridge_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *sa,
}
eh = mtod(m, struct ether_header *);
dst = (struct ether_addr *)&eh->ether_dhost[0];
- src = (struct ether_addr *)&eh->ether_shost[0];
s = splnet();
@@ -2590,7 +2589,7 @@ bridge_fragment(struct bridge_softc *sc, struct ifnet *ifp,
{
struct llc llc;
struct mbuf *m0;
- int s, len, error = 0;
+ int s, error = 0;
int hassnap = 0;
#ifdef INET
u_int16_t etype;
@@ -2671,7 +2670,6 @@ bridge_fragment(struct bridge_softc *sc, struct ifnet *ifp,
error = ENOBUFS;
continue;
}
- len = m->m_pkthdr.len;
bcopy(eh, mtod(m, caddr_t), sizeof(*eh));
s = splnet();
error = bridge_ifenqueue(sc, ifp, m);
diff --git a/sys/net/if_pfsync.c b/sys/net/if_pfsync.c
index 68d3ac40877..8c322ad512a 100644
--- a/sys/net/if_pfsync.c
+++ b/sys/net/if_pfsync.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_pfsync.c,v 1.98 2008/06/29 08:42:15 mcbride Exp $ */
+/* $OpenBSD: if_pfsync.c,v 1.99 2008/09/02 17:35:16 chl Exp $ */
/*
* Copyright (c) 2002 Michael Shalayeff
@@ -1380,7 +1380,6 @@ pfsync_pack_state(u_int8_t action, struct pf_state *st, int flags)
int
pfsync_request_update(struct pfsync_state_upd *up, struct in_addr *src)
{
- struct ifnet *ifp = NULL;
struct pfsync_header *h;
struct pfsync_softc *sc = pfsyncif;
struct pfsync_state_upd_req *rup;
@@ -1389,7 +1388,6 @@ pfsync_request_update(struct pfsync_state_upd *up, struct in_addr *src)
if (sc == NULL)
return (0);
- ifp = &sc->sc_if;
if (sc->sc_mbuf == NULL) {
if ((sc->sc_mbuf = pfsync_get_mbuf(sc, PFSYNC_ACT_UREQ,
(void *)&sc->sc_statep.s)) == NULL)
@@ -1426,7 +1424,6 @@ pfsync_request_update(struct pfsync_state_upd *up, struct in_addr *src)
int
pfsync_clear_states(u_int32_t creatorid, char *ifname)
{
- struct ifnet *ifp = NULL;
struct pfsync_softc *sc = pfsyncif;
struct pfsync_state_clr *cp;
int s, ret;
@@ -1434,7 +1431,6 @@ pfsync_clear_states(u_int32_t creatorid, char *ifname)
if (sc == NULL)
return (0);
- ifp = &sc->sc_if;
s = splnet();
if (sc->sc_mbuf != NULL)
pfsync_sendout(sc);
diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c
index 3fbcb96b89c..fc1fe501f17 100644
--- a/sys/net/if_vlan.c
+++ b/sys/net/if_vlan.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_vlan.c,v 1.73 2008/05/07 13:45:35 dlg Exp $ */
+/* $OpenBSD: if_vlan.c,v 1.74 2008/09/02 17:35:16 chl Exp $ */
/*
* Copyright 1998 Massachusetts Institute of Technology
@@ -422,7 +422,6 @@ vlan_unconfig(struct ifnet *ifp)
struct sockaddr_dl *sdl;
struct ifvlan *ifv;
struct ifnet *p;
- struct ifreq *ifr, *ifr_p;
int s;
ifv = ifp->if_softc;
@@ -430,9 +429,6 @@ vlan_unconfig(struct ifnet *ifp)
if (p == NULL)
return 0;
- ifr = (struct ifreq *)&ifp->if_data;
- ifr_p = (struct ifreq *)&ifv->ifv_p->if_data;
-
s = splnet();
LIST_REMOVE(ifv, ifv_list);
if (ifv->lh_cookie != NULL)
diff --git a/sys/net/pf.c b/sys/net/pf.c
index 2eeb7c5f0ab..1c3f9835ac4 100644
--- a/sys/net/pf.c
+++ b/sys/net/pf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf.c,v 1.616 2008/08/26 12:17:10 henning Exp $ */
+/* $OpenBSD: pf.c,v 1.617 2008/09/02 17:35:16 chl Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -2995,7 +2995,7 @@ pf_test_rule(struct pf_rule **rm, struct pf_state **sm, int direction,
int match = 0;
int state_icmp = 0;
u_int16_t sport, dport;
- u_int16_t nport = 0, bport = 0;
+ u_int16_t nport = 0;
u_int16_t bproto_sum = 0, bip_sum;
u_int8_t icmptype = 0, icmpcode = 0;
@@ -3056,7 +3056,7 @@ pf_test_rule(struct pf_rule **rm, struct pf_state **sm, int direction,
r = TAILQ_FIRST(pf_main_ruleset.rules[PF_RULESET_FILTER].active.ptr);
- bport = nport = sport;
+ nport = sport;
/* check packet for BINAT/NAT/RDR */
if ((nr = pf_get_translation(pd, m, off, direction, kif, &nsn,
&skw, &sks, &sk, &nk, saddr, daddr, sport, dport)) != NULL) {