diff options
author | Jeremie Courreges-Anglas <jca@cvs.openbsd.org> | 2017-02-05 16:04:15 +0000 |
---|---|---|
committer | Jeremie Courreges-Anglas <jca@cvs.openbsd.org> | 2017-02-05 16:04:15 +0000 |
commit | a0fe76973a89628bbcd7a93577076e67e111a4a4 (patch) | |
tree | 627e4d024b0b67aff06231ec1d2f58ae6f4b8a80 /sys/net | |
parent | daf9ee77f00685cfb1100181f3ecec6af00c6ee1 (diff) |
Use percpu counters for ip6stat
Try to follow the existing examples. Some notes:
- don't implement counters_dec() yet, which could be used in two
similar chunks of code. Let's see if there are more users first.
- stop incrementing IPv6-specific mbuf stats, IPv4 has no equivalent.
Input from mpi@, ok bluhm@ mpi@
Diffstat (limited to 'sys/net')
-rw-r--r-- | sys/net/if_bridge.c | 6 | ||||
-rw-r--r-- | sys/net/pf.c | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c index 43c8e5e478c..4e27e3f249f 100644 --- a/sys/net/if_bridge.c +++ b/sys/net/if_bridge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_bridge.c,v 1.293 2017/01/24 10:08:30 krw Exp $ */ +/* $OpenBSD: if_bridge.c,v 1.294 2017/02/05 16:04:14 jca Exp $ */ /* * Copyright (c) 1999, 2000 Jason L. Wright (jason@thought.net) @@ -1692,7 +1692,7 @@ bridge_ip(struct bridge_softc *sc, int dir, struct ifnet *ifp, if (m->m_len < sizeof(struct ip6_hdr)) { if ((m = m_pullup(m, sizeof(struct ip6_hdr))) == NULL) { - ip6stat.ip6s_toosmall++; + ip6stat_inc(ip6s_toosmall); return (NULL); } } @@ -1700,7 +1700,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) { - ip6stat.ip6s_badvers++; + ip6stat_inc(ip6s_badvers); goto dropit; } diff --git a/sys/net/pf.c b/sys/net/pf.c index 3895dd18d4d..b4e598716e9 100644 --- a/sys/net/pf.c +++ b/sys/net/pf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf.c,v 1.1013 2017/01/30 17:52:24 benno Exp $ */ +/* $OpenBSD: pf.c,v 1.1014 2017/02/05 16:04:14 jca Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -5974,7 +5974,7 @@ pf_route6(struct pf_pdesc *pd, struct pf_rule *r, struct pf_state *s) rt = rtalloc(sin6tosa(dst), RT_RESOLVE, rtableid); if (!rtisvalid(rt)) { - ip6stat.ip6s_noroute++; + ip6stat_inc(ip6s_noroute); goto bad; } |