summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorCharles Longeau <chl@cvs.openbsd.org>2008-09-17 05:43:16 +0000
committerCharles Longeau <chl@cvs.openbsd.org>2008-09-17 05:43:16 +0000
commit5f6fd068155984f4e44d62c940dcb6427f1b39ce (patch)
treea9afa45da3f9a74ce41b4ec9f55fc868ac23b0cc /sys
parent896cd5462b21178d139193235696d72a6407fd60 (diff)
remove dead stores and newly created unused variables.
Found by LLVM/Clang Static Analyzer. ok henning@ mpf@
Diffstat (limited to 'sys')
-rw-r--r--sys/netinet6/icmp6.c9
-rw-r--r--sys/netinet6/ip6_input.c4
-rw-r--r--sys/netinet6/ip6_mroute.c5
-rw-r--r--sys/netinet6/nd6.c9
-rw-r--r--sys/netinet6/nd6_nbr.c4
-rw-r--r--sys/netinet6/nd6_rtr.c5
-rw-r--r--sys/netinet6/raw_ip6.c7
7 files changed, 9 insertions, 34 deletions
diff --git a/sys/netinet6/icmp6.c b/sys/netinet6/icmp6.c
index 992f4d47883..6ef865fe5e5 100644
--- a/sys/netinet6/icmp6.c
+++ b/sys/netinet6/icmp6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: icmp6.c,v 1.100 2008/09/12 12:53:55 henning Exp $ */
+/* $OpenBSD: icmp6.c,v 1.101 2008/09/17 05:43:14 chl Exp $ */
/* $KAME: icmp6.c,v 1.217 2001/06/20 15:03:29 jinmei Exp $ */
/*
@@ -2153,8 +2153,6 @@ icmp6_redirect_input(struct mbuf *m, int off)
int icmp6len = ntohs(ip6->ip6_plen);
char *lladdr = NULL;
int lladdrlen = 0;
- u_char *redirhdr = NULL;
- int redirhdrlen = 0;
struct rtentry *rt = NULL;
int is_router;
int is_onlink;
@@ -2278,11 +2276,6 @@ icmp6_redirect_input(struct mbuf *m, int off)
lladdrlen = ndopts.nd_opts_tgt_lladdr->nd_opt_len << 3;
}
- if (ndopts.nd_opts_rh) {
- redirhdrlen = ndopts.nd_opts_rh->nd_opt_rh_len;
- redirhdr = (u_char *)(ndopts.nd_opts_rh + 1); /* xxx */
- }
-
if (lladdr && ((ifp->if_addrlen + 2 + 7) & ~7) != lladdrlen) {
nd6log((LOG_INFO,
"icmp6_redirect_input: lladdrlen mismatch for %s "
diff --git a/sys/netinet6/ip6_input.c b/sys/netinet6/ip6_input.c
index d4f360847ec..dc9f5dbd335 100644
--- a/sys/netinet6/ip6_input.c
+++ b/sys/netinet6/ip6_input.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip6_input.c,v 1.86 2008/06/11 19:00:50 mcbride Exp $ */
+/* $OpenBSD: ip6_input.c,v 1.87 2008/09/17 05:43:14 chl Exp $ */
/* $KAME: ip6_input.c,v 1.188 2001/03/29 05:34:31 itojun Exp $ */
/*
@@ -802,7 +802,6 @@ ip6_hopopts_input(u_int32_t *plenp, u_int32_t *rtalertp, struct mbuf **mp,
struct mbuf *m = *mp;
int off = *offp, hbhlen;
struct ip6_hbh *hbh;
- u_int8_t *opt;
/* validation of the length of the header */
IP6_EXTHDR_GET(hbh, struct ip6_hbh *, m,
@@ -820,7 +819,6 @@ ip6_hopopts_input(u_int32_t *plenp, u_int32_t *rtalertp, struct mbuf **mp,
}
off += hbhlen;
hbhlen -= sizeof(struct ip6_hbh);
- opt = (u_int8_t *)hbh + sizeof(struct ip6_hbh);
if (ip6_process_hopopts(m, (u_int8_t *)hbh + sizeof(struct ip6_hbh),
hbhlen, rtalertp, plenp) < 0)
diff --git a/sys/netinet6/ip6_mroute.c b/sys/netinet6/ip6_mroute.c
index d780b2f7977..2ac8151296d 100644
--- a/sys/netinet6/ip6_mroute.c
+++ b/sys/netinet6/ip6_mroute.c
@@ -1749,8 +1749,7 @@ pim6_input(struct mbuf **mp, int *offp, int proto)
struct mbuf *mcp;
struct ip6_hdr *eip6;
u_int32_t *reghdr;
- int rc;
-
+
++pim6stat.pim6s_rcv_registers;
if ((reg_mif_num >= nummifs) || (reg_mif_num == (mifi_t) -1)) {
@@ -1851,7 +1850,7 @@ pim6_input(struct mbuf **mp, int *offp, int proto)
}
#endif
- rc = looutput(mif6table[reg_mif_num].m6_ifp, m,
+ looutput(mif6table[reg_mif_num].m6_ifp, m,
(struct sockaddr *) &dst,
(struct rtentry *) NULL);
diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c
index 6957a254c42..8239046ce21 100644
--- a/sys/netinet6/nd6.c
+++ b/sys/netinet6/nd6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nd6.c,v 1.79 2008/06/11 19:00:50 mcbride Exp $ */
+/* $OpenBSD: nd6.c,v 1.80 2008/09/17 05:43:14 chl Exp $ */
/* $KAME: nd6.c,v 1.280 2002/06/08 19:52:07 itojun Exp $ */
/*
@@ -510,7 +510,6 @@ nd6_timer(void *ignored_arg)
struct nd_defrouter *dr;
struct nd_prefix *pr;
struct in6_ifaddr *ia6, *nia6;
- struct in6_addrlifetime *lt6;
s = splsoftnet();
timeout_set(&nd6_timer_ch, nd6_timer, NULL);
@@ -538,7 +537,6 @@ nd6_timer(void *ignored_arg)
for (ia6 = in6_ifaddr; ia6; ia6 = nia6) {
nia6 = ia6->ia_next;
/* check address lifetime */
- lt6 = &ia6->ia6_lifetime;
if (IFA6_IS_INVALID(ia6)) {
in6_purgeaddr(&ia6->ia_ifa);
} else if (IFA6_IS_DEPRECATED(ia6)) {
@@ -997,7 +995,6 @@ nd6_rtrequest(int req, struct rtentry *rt, struct rt_addrinfo *info)
static struct sockaddr_dl null_sdl = {sizeof(null_sdl), AF_LINK};
struct ifnet *ifp = rt->rt_ifp;
struct ifaddr *ifa;
- int mine = 0;
if ((rt->rt_flags & RTF_GATEWAY) != 0)
return;
@@ -1185,7 +1182,6 @@ nd6_rtrequest(int req, struct rtentry *rt, struct rt_addrinfo *info)
nd6_llinfo_settimer(ln, -1);
ln->ln_state = ND6_LLINFO_REACHABLE;
ln->ln_byhint = 0;
- mine = 1;
if (macp) {
Bcopy(macp, LLADDR(SDL(gate)), ifp->if_addrlen);
SDL(gate)->sdl_alen = ifp->if_addrlen;
@@ -2019,11 +2015,10 @@ nd6_sysctl(int name, void *oldp, size_t *oldlenp, void *newp,
size_t newlen)
{
void *p;
- size_t ol, l;
+ size_t ol;
int error;
error = 0;
- l = 0;
if (newp)
return EPERM;
diff --git a/sys/netinet6/nd6_nbr.c b/sys/netinet6/nd6_nbr.c
index 7a0acfc950b..d89e818f254 100644
--- a/sys/netinet6/nd6_nbr.c
+++ b/sys/netinet6/nd6_nbr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nd6_nbr.c,v 1.51 2008/06/11 19:00:50 mcbride Exp $ */
+/* $OpenBSD: nd6_nbr.c,v 1.52 2008/09/17 05:43:15 chl Exp $ */
/* $KAME: nd6_nbr.c,v 1.61 2001/02/10 16:06:14 jinmei Exp $ */
/*
@@ -1332,7 +1332,6 @@ static void
nd6_dad_ns_input(struct ifaddr *ifa)
{
struct in6_ifaddr *ia;
- struct ifnet *ifp;
struct in6_addr *taddr6;
struct dadq *dp;
int duplicate;
@@ -1341,7 +1340,6 @@ nd6_dad_ns_input(struct ifaddr *ifa)
panic("ifa == NULL in nd6_dad_ns_input");
ia = (struct in6_ifaddr *)ifa;
- ifp = ifa->ifa_ifp;
taddr6 = &ia->ia_addr.sin6_addr;
duplicate = 0;
dp = nd6_dad_find(ifa);
diff --git a/sys/netinet6/nd6_rtr.c b/sys/netinet6/nd6_rtr.c
index f0013ca8864..3df2c89ba3b 100644
--- a/sys/netinet6/nd6_rtr.c
+++ b/sys/netinet6/nd6_rtr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nd6_rtr.c,v 1.47 2008/06/11 19:00:50 mcbride Exp $ */
+/* $OpenBSD: nd6_rtr.c,v 1.48 2008/09/17 05:43:15 chl Exp $ */
/* $KAME: nd6_rtr.c,v 1.97 2001/02/07 11:09:13 itojun Exp $ */
/*
@@ -1045,7 +1045,6 @@ prelist_update(struct nd_prefix *new, struct nd_defrouter *dr,
struct nd_prefix *pr;
int s = splsoftnet();
int error = 0;
- int newprefix = 0;
int auth;
struct in6_addrlifetime lt6_tmp;
@@ -1101,8 +1100,6 @@ prelist_update(struct nd_prefix *new, struct nd_defrouter *dr,
} else {
struct nd_prefix *newpr = NULL;
- newprefix = 1;
-
if (new->ndpr_vltime == 0)
goto end;
if (new->ndpr_raf_onlink == 0 && new->ndpr_raf_auto == 0)
diff --git a/sys/netinet6/raw_ip6.c b/sys/netinet6/raw_ip6.c
index e6c8c64e44d..94a20b2e640 100644
--- a/sys/netinet6/raw_ip6.c
+++ b/sys/netinet6/raw_ip6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: raw_ip6.c,v 1.36 2008/06/11 19:00:50 mcbride Exp $ */
+/* $OpenBSD: raw_ip6.c,v 1.37 2008/09/17 05:43:15 chl Exp $ */
/* $KAME: raw_ip6.c,v 1.69 2001/03/04 15:55:44 itojun Exp $ */
/*
@@ -253,8 +253,6 @@ void
rip6_ctlinput(int cmd, struct sockaddr *sa, void *d)
{
struct ip6_hdr *ip6;
- struct mbuf *m;
- int off;
struct ip6ctlparam *ip6cp = NULL;
const struct sockaddr_in6 *sa6_src = NULL;
void *cmdarg;
@@ -279,14 +277,11 @@ rip6_ctlinput(int cmd, struct sockaddr *sa, void *d)
/* if the parameter is from icmp6, decode it. */
if (d != NULL) {
ip6cp = (struct ip6ctlparam *)d;
- m = ip6cp->ip6c_m;
ip6 = ip6cp->ip6c_ip6;
- off = ip6cp->ip6c_off;
cmdarg = ip6cp->ip6c_cmdarg;
sa6_src = ip6cp->ip6c_src;
nxt = ip6cp->ip6c_nxt;
} else {
- m = NULL;
ip6 = NULL;
cmdarg = NULL;
sa6_src = &sa6_any;