summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorCharles Longeau <chl@cvs.openbsd.org>2008-09-17 20:10:38 +0000
committerCharles Longeau <chl@cvs.openbsd.org>2008-09-17 20:10:38 +0000
commit6330619c3e325d3a5459f52c2b3c5fd2790b4e1f (patch)
treefe4acf31f1994869d66e4e93371509241273be8b /sys
parente40e37662ee973c85d7013b73a863195dd578a08 (diff)
remove dead stores and newly created unused variables.
fix potential use of uninitialized value in trunk_port_ioctl() function. Found by LLVM/Clang Static Analyzer. ok mpf@ henning@
Diffstat (limited to 'sys')
-rw-r--r--sys/net/bpf.c3
-rw-r--r--sys/net/if_pfsync.c5
-rw-r--r--sys/net/if_ppp.c6
-rw-r--r--sys/net/if_trunk.c7
-rw-r--r--sys/net/pf.c7
5 files changed, 11 insertions, 17 deletions
diff --git a/sys/net/bpf.c b/sys/net/bpf.c
index 14337d29932..8f1781bf447 100644
--- a/sys/net/bpf.c
+++ b/sys/net/bpf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bpf.c,v 1.68 2008/01/25 16:14:56 mglocker Exp $ */
+/* $OpenBSD: bpf.c,v 1.69 2008/09/17 20:10:37 chl Exp $ */
/* $NetBSD: bpf.c,v 1.33 1997/02/21 23:59:35 thorpej Exp $ */
/*
@@ -1319,7 +1319,6 @@ bpf_catchpacket(struct bpf_d *d, u_char *pkt, size_t pktlen, size_t snaplen,
d->bd_rdStart = 0;
ROTATE_BUFFERS(d);
bpf_wakeup(d);
- curlen = 0;
}
}
}
diff --git a/sys/net/if_pfsync.c b/sys/net/if_pfsync.c
index 256c4b36823..33bc4fb0101 100644
--- a/sys/net/if_pfsync.c
+++ b/sys/net/if_pfsync.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_pfsync.c,v 1.100 2008/09/10 14:01:23 blambert Exp $ */
+/* $OpenBSD: if_pfsync.c,v 1.101 2008/09/17 20:10:37 chl Exp $ */
/*
* Copyright (c) 2002 Michael Shalayeff
@@ -520,7 +520,6 @@ pfsync_input(struct mbuf *m, ...)
case PFSYNC_ACT_CLR: {
struct pf_state *nexts;
struct pf_state_key *nextsk;
- struct pfi_kif *kif;
u_int32_t creatorid;
if ((mp = m_pulldown(m, iplen + sizeof(*ph),
sizeof(*cp), &offp)) == NULL) {
@@ -541,7 +540,7 @@ pfsync_input(struct mbuf *m, ...)
}
}
} else {
- if ((kif = pfi_kif_get(cp->ifname)) == NULL) {
+ if (pfi_kif_get(cp->ifname) == NULL) {
splx(s);
return;
}
diff --git a/sys/net/if_ppp.c b/sys/net/if_ppp.c
index 1037cd3ad7e..c8175bf1511 100644
--- a/sys/net/if_ppp.c
+++ b/sys/net/if_ppp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ppp.c,v 1.50 2007/09/15 16:43:51 henning Exp $ */
+/* $OpenBSD: if_ppp.c,v 1.51 2008/09/17 20:10:37 chl Exp $ */
/* $NetBSD: if_ppp.c,v 1.39 1997/05/17 21:11:59 christos Exp $ */
/*
@@ -1051,12 +1051,12 @@ ppp_dequeue(sc)
if (protocol != PPP_LCP && protocol != PPP_CCP
&& sc->sc_xc_state && (sc->sc_flags & SC_COMP_RUN)) {
struct mbuf *mcomp = NULL;
- int slen, clen;
+ int slen;
slen = 0;
for (mp = m; mp != NULL; mp = mp->m_next)
slen += mp->m_len;
- clen = (*sc->sc_xcomp->compress)
+ (*sc->sc_xcomp->compress)
(sc->sc_xc_state, &mcomp, m, slen,
(sc->sc_flags & SC_CCP_UP ? sc->sc_if.if_mtu + PPP_HDRLEN : 0));
if (mcomp != NULL) {
diff --git a/sys/net/if_trunk.c b/sys/net/if_trunk.c
index 3f06b9d4828..cc00ff8d1b9 100644
--- a/sys/net/if_trunk.c
+++ b/sys/net/if_trunk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_trunk.c,v 1.49 2008/08/07 18:06:17 damien Exp $ */
+/* $OpenBSD: if_trunk.c,v 1.50 2008/09/17 20:10:37 chl Exp $ */
/*
* Copyright (c) 2005, 2006, 2007 Reyk Floeter <reyk@openbsd.org>
@@ -479,14 +479,13 @@ trunk_port_destroy(struct trunk_port *tp)
void
trunk_port_watchdog(struct ifnet *ifp)
{
- struct trunk_softc *tr;
struct trunk_port *tp;
/* Should be checked by the caller */
if (ifp->if_type != IFT_IEEE8023ADLAG)
return;
if ((tp = (struct trunk_port *)ifp->if_tp) == NULL ||
- (tr = (struct trunk_softc *)tp->tp_trunk) == NULL)
+ tp->tp_trunk == NULL)
return;
if (tp->tp_watchdog != NULL)
@@ -499,7 +498,7 @@ trunk_port_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
{
struct trunk_reqport *rp = (struct trunk_reqport *)data;
struct trunk_softc *tr;
- struct trunk_port *tp;
+ struct trunk_port *tp = NULL;
int s, error = 0;
s = splnet();
diff --git a/sys/net/pf.c b/sys/net/pf.c
index 564eea27cf3..e4d67e4630b 100644
--- a/sys/net/pf.c
+++ b/sys/net/pf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf.c,v 1.620 2008/09/10 09:10:17 henning Exp $ */
+/* $OpenBSD: pf.c,v 1.621 2008/09/17 20:10:37 chl Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -3036,7 +3036,6 @@ 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;
u_int16_t bproto_sum = 0, bip_sum;
u_int8_t icmptype = 0, icmpcode = 0;
@@ -3097,7 +3096,6 @@ 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);
- 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) {
@@ -5404,7 +5402,6 @@ pf_route6(struct mbuf **m, struct pf_rule *r, int dir, struct ifnet *oifp,
struct ifnet *ifp = NULL;
struct pf_addr naddr;
struct pf_src_node *sn = NULL;
- int error = 0;
if (m == NULL || *m == NULL || r == NULL ||
(dir != PF_IN && dir != PF_OUT) || oifp == NULL)
@@ -5487,7 +5484,7 @@ pf_route6(struct mbuf **m, struct pf_rule *r, int dir, struct ifnet *oifp,
if (IN6_IS_SCOPE_EMBED(&dst->sin6_addr))
dst->sin6_addr.s6_addr16[1] = htons(ifp->if_index);
if ((u_long)m0->m_pkthdr.len <= ifp->if_mtu) {
- error = nd6_output(ifp, ifp, m0, dst, NULL);
+ nd6_output(ifp, ifp, m0, dst, NULL);
} else {
in6_ifstat_inc(ifp, ifs6_in_toobig);
if (r->rt != PF_DUPTO)