summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormpi <mpi@openbsd.org>2015-09-09 12:50:08 +0000
committermpi <mpi@openbsd.org>2015-09-09 12:50:08 +0000
commitf71dbf6b13a7518faf3555274d47929c2e6a039f (patch)
tree59659b2ab3e6f6bc9c6251962e4ccf0591d15d00
parentSome explicit iflush instructions after the kbind() call are still needed (diff)
downloadwireguard-openbsd-f71dbf6b13a7518faf3555274d47929c2e6a039f.tar.xz
wireguard-openbsd-f71dbf6b13a7518faf3555274d47929c2e6a039f.zip
Kill a couple of if_get()s only needed to increment per-ifp IPv6 stats.
We do not export those per-ifp statistics and they will soon all die. "We're putting inet6 on a diet" claudio@ ok dlg@, mikeb@, claudio@
-rw-r--r--sys/net/if_bridge.c6
-rw-r--r--sys/netinet/ipsec_input.c7
-rw-r--r--sys/netinet6/raw_ip6.c14
3 files changed, 6 insertions, 21 deletions
diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c
index a394ace4849..756fcb899d0 100644
--- a/sys/net/if_bridge.c
+++ b/sys/net/if_bridge.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_bridge.c,v 1.260 2015/08/26 09:40:31 mpi Exp $ */
+/* $OpenBSD: if_bridge.c,v 1.261 2015/09/09 12:50:08 mpi Exp $ */
/*
* Copyright (c) 1999, 2000 Jason L. Wright (jason@thought.net)
@@ -2378,11 +2378,7 @@ bridge_ip(struct bridge_softc *sc, int dir, struct ifnet *ifp,
ip6 = mtod(m, struct ip6_hdr *);
if ((ip6->ip6_vfc & IPV6_VERSION_MASK) != IPV6_VERSION) {
- struct ifnet *ifp;
ip6stat.ip6s_badvers++;
- ifp = if_get(m->m_pkthdr.ph_ifidx);
- if (ifp != NULL)
- in6_ifstat_inc(ifp, ifs6_in_hdrerr);
goto dropit;
}
diff --git a/sys/netinet/ipsec_input.c b/sys/netinet/ipsec_input.c
index 013672e123f..fd24da23c77 100644
--- a/sys/netinet/ipsec_input.c
+++ b/sys/netinet/ipsec_input.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ipsec_input.c,v 1.133 2015/06/16 11:09:40 mpi Exp $ */
+/* $OpenBSD: ipsec_input.c,v 1.134 2015/09/09 12:50:08 mpi Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
* Angelos D. Keromytis (kermit@csd.uch.gr) and
@@ -1019,12 +1019,7 @@ ah6_input_cb(struct mbuf *m, int off, int protoff)
* more sanity checks in header chain processing.
*/
if (m->m_pkthdr.len < off) {
- struct ifnet *ifp;
-
ip6stat.ip6s_tooshort++;
- ifp = if_get(m->m_pkthdr.ph_ifidx);
- if (ifp != NULL)
- in6_ifstat_inc(ifp, ifs6_in_truncated);
goto bad;
}
nxt = (*inet6sw[ip6_protox[nxt]].pr_input)(&m, &off, nxt);
diff --git a/sys/netinet6/raw_ip6.c b/sys/netinet6/raw_ip6.c
index c3912e764f9..f207919159f 100644
--- a/sys/netinet6/raw_ip6.c
+++ b/sys/netinet6/raw_ip6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: raw_ip6.c,v 1.79 2015/07/28 12:22:07 bluhm Exp $ */
+/* $OpenBSD: raw_ip6.c,v 1.80 2015/09/09 12:50:08 mpi Exp $ */
/* $KAME: raw_ip6.c,v 1.69 2001/03/04 15:55:44 itojun Exp $ */
/*
@@ -224,15 +224,9 @@ rip6_input(struct mbuf **mp, int *offp, int proto)
m_freem(m);
else {
u_int8_t *prvnxtp = ip6_get_prevhdr(m, *offp); /* XXX */
- struct ifnet *ifp;
-
- ifp = if_get(m->m_pkthdr.ph_ifidx);
- if (ifp != NULL) {
- in6_ifstat_inc(ifp, ifs6_in_protounknown);
- icmp6_error(m, ICMP6_PARAM_PROB,
- ICMP6_PARAMPROB_NEXTHEADER,
- prvnxtp - mtod(m, u_int8_t *));
- }
+ icmp6_error(m, ICMP6_PARAM_PROB,
+ ICMP6_PARAMPROB_NEXTHEADER,
+ prvnxtp - mtod(m, u_int8_t *));
}
ip6stat.ip6s_delivered--;
}