summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Longeau <chl@cvs.openbsd.org>2016-03-29 11:57:52 +0000
committerCharles Longeau <chl@cvs.openbsd.org>2016-03-29 11:57:52 +0000
commitb7ea3b5102697b38950a3b2c6e97a1f03f7e727e (patch)
tree5c5b48ed5681e431c79798882d18e667202b03ad
parent44156cfdc5a4f47d0d5aebc6f89f89e45adf9818 (diff)
remove dead stores and unused variables
ok bluhm@ jca@
-rw-r--r--sys/netinet6/icmp6.c7
-rw-r--r--sys/netinet6/ip6_divert.c4
-rw-r--r--sys/netinet6/ip6_forward.c3
-rw-r--r--sys/netinet6/ip6_input.c3
-rw-r--r--sys/netinet6/nd6_nbr.c6
-rw-r--r--sys/netinet6/raw_ip6.c5
6 files changed, 7 insertions, 21 deletions
diff --git a/sys/netinet6/icmp6.c b/sys/netinet6/icmp6.c
index 34751a34048..5dcb434de68 100644
--- a/sys/netinet6/icmp6.c
+++ b/sys/netinet6/icmp6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: icmp6.c,v 1.184 2016/01/21 06:32:19 jsg Exp $ */
+/* $OpenBSD: icmp6.c,v 1.185 2016/03/29 11:57:51 chl Exp $ */
/* $KAME: icmp6.c,v 1.217 2001/06/20 15:03:29 jinmei Exp $ */
/*
@@ -1156,8 +1156,6 @@ icmp6_reflect(struct mbuf *m, size_t off)
struct icmp6_hdr *icmp6;
struct in6_ifaddr *ia6;
struct in6_addr t, *src = NULL;
- int plen;
- int type, code;
struct sockaddr_in6 sa6_src, sa6_dst;
/* too short to reflect */
@@ -1198,12 +1196,9 @@ icmp6_reflect(struct mbuf *m, size_t off)
return;
}
}
- plen = m->m_pkthdr.len - sizeof(struct ip6_hdr);
ip6 = mtod(m, struct ip6_hdr *);
ip6->ip6_nxt = IPPROTO_ICMPV6;
icmp6 = (struct icmp6_hdr *)(ip6 + 1);
- type = icmp6->icmp6_type; /* keep type for statistics */
- code = icmp6->icmp6_code; /* ditto. */
t = ip6->ip6_dst;
/*
diff --git a/sys/netinet6/ip6_divert.c b/sys/netinet6/ip6_divert.c
index 8208b937f5a..4a5f61de24f 100644
--- a/sys/netinet6/ip6_divert.c
+++ b/sys/netinet6/ip6_divert.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip6_divert.c,v 1.40 2016/03/23 15:50:36 vgross Exp $ */
+/* $OpenBSD: ip6_divert.c,v 1.41 2016/03/29 11:57:51 chl Exp $ */
/*
* Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
@@ -87,7 +87,6 @@ divert6_output(struct inpcb *inp, struct mbuf *m, struct mbuf *nam,
struct mbuf *control)
{
struct sockaddr_in6 *sin6;
- struct socket *so;
struct ifaddr *ifa;
int error = 0, min_hdrlen = 0, nxt = 0, off, dir;
struct ip6_hdr *ip6;
@@ -99,7 +98,6 @@ divert6_output(struct inpcb *inp, struct mbuf *m, struct mbuf *nam,
m_freem(control);
sin6 = mtod(nam, struct sockaddr_in6 *);
- so = inp->inp_socket;
/* Do basic sanity checks. */
if (m->m_pkthdr.len < sizeof(struct ip6_hdr))
diff --git a/sys/netinet6/ip6_forward.c b/sys/netinet6/ip6_forward.c
index 5f72bebaa29..3a837ff3703 100644
--- a/sys/netinet6/ip6_forward.c
+++ b/sys/netinet6/ip6_forward.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip6_forward.c,v 1.86 2015/11/02 07:22:28 mpi Exp $ */
+/* $OpenBSD: ip6_forward.c,v 1.87 2016/03/29 11:57:51 chl Exp $ */
/* $KAME: ip6_forward.c,v 1.75 2001/06/29 12:42:13 jinmei Exp $ */
/*
@@ -332,7 +332,6 @@ reroute:
}
if (m == NULL)
goto senderr;
- ip6 = mtod(m, struct ip6_hdr *);
/*
* PF_TAG_REROUTE handling or not...
* Packet is entering IPsec so the routing is
diff --git a/sys/netinet6/ip6_input.c b/sys/netinet6/ip6_input.c
index 81e9a393d5b..90efc1cf4a0 100644
--- a/sys/netinet6/ip6_input.c
+++ b/sys/netinet6/ip6_input.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip6_input.c,v 1.155 2016/03/14 23:08:06 krw Exp $ */
+/* $OpenBSD: ip6_input.c,v 1.156 2016/03/29 11:57:51 chl Exp $ */
/* $KAME: ip6_input.c,v 1.188 2001/03/29 05:34:31 itojun Exp $ */
/*
@@ -639,7 +639,6 @@ ip6_input(struct mbuf *m)
/* draft-itojun-ipv6-tcp-to-anycast */
if (isanycast && nxt == IPPROTO_TCP) {
if (m->m_len >= sizeof(struct ip6_hdr)) {
- ip6 = mtod(m, struct ip6_hdr *);
icmp6_error(m, ICMP6_DST_UNREACH,
ICMP6_DST_UNREACH_ADDR,
offsetof(struct ip6_hdr, ip6_dst));
diff --git a/sys/netinet6/nd6_nbr.c b/sys/netinet6/nd6_nbr.c
index 5f1ea03f9a4..10381564562 100644
--- a/sys/netinet6/nd6_nbr.c
+++ b/sys/netinet6/nd6_nbr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nd6_nbr.c,v 1.101 2015/12/09 15:05:51 mpi Exp $ */
+/* $OpenBSD: nd6_nbr.c,v 1.102 2016/03/29 11:57:51 chl Exp $ */
/* $KAME: nd6_nbr.c,v 1.61 2001/02/10 16:06:14 jinmei Exp $ */
/*
@@ -1375,16 +1375,12 @@ nd6_dad_ns_output(struct dadq *dp, struct ifaddr *ifa)
void
nd6_dad_ns_input(struct ifaddr *ifa)
{
- struct in6_ifaddr *ia6;
- struct in6_addr *taddr6;
struct dadq *dp;
int duplicate;
if (!ifa)
panic("ifa == NULL in nd6_dad_ns_input");
- ia6 = ifatoia6(ifa);
- taddr6 = &ia6->ia_addr.sin6_addr;
duplicate = 0;
dp = nd6_dad_find(ifa);
diff --git a/sys/netinet6/raw_ip6.c b/sys/netinet6/raw_ip6.c
index 5bc2a09d730..605ba4905dd 100644
--- a/sys/netinet6/raw_ip6.c
+++ b/sys/netinet6/raw_ip6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: raw_ip6.c,v 1.88 2016/03/07 18:44:00 naddy Exp $ */
+/* $OpenBSD: raw_ip6.c,v 1.89 2016/03/29 11:57:51 chl Exp $ */
/* $KAME: raw_ip6.c,v 1.69 2001/03/04 15:55:44 itojun Exp $ */
/*
@@ -343,7 +343,7 @@ rip6_output(struct mbuf *m, ...)
u_int plen = m->m_pkthdr.len;
int error = 0;
struct ip6_pktopts opt, *optp = NULL, *origoptp;
- int type, code; /* for ICMPv6 output statistics only */
+ int type; /* for ICMPv6 output statistics only */
int priv = 0;
va_list ap;
int flags;
@@ -382,7 +382,6 @@ rip6_output(struct mbuf *m, ...)
}
icmp6 = mtod(m, struct icmp6_hdr *);
type = icmp6->icmp6_type;
- code = icmp6->icmp6_code;
}
M_PREPEND(m, sizeof(*ip6), M_DONTWAIT);