summaryrefslogtreecommitdiff
path: root/sys/net
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2019-04-23 11:48:56 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2019-04-23 11:48:56 +0000
commiteaa363c6b2948705e873bd3a760a0cdf74034192 (patch)
treeb994c6f39c31560ad7942c364499a6d84b96d503 /sys/net
parentc1db0a3decc49f1d202c4015234e690f5621aa7e (diff)
give gre and mgre percpu counters too
makes input bytes and packets consistent
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/if_gre.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/net/if_gre.c b/sys/net/if_gre.c
index ee4798b8124..7638fc0176a 100644
--- a/sys/net/if_gre.c
+++ b/sys/net/if_gre.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_gre.c,v 1.149 2019/04/23 10:53:45 dlg Exp $ */
+/* $OpenBSD: if_gre.c,v 1.150 2019/04/23 11:48:55 dlg Exp $ */
/* $NetBSD: if_gre.c,v 1.9 1999/10/25 19:18:11 drochner Exp $ */
/*
@@ -608,6 +608,7 @@ gre_clone_create(struct if_clone *ifc, int unit)
timeout_set_proc(&sc->sc_ka_hold, gre_keepalive_hold, sc);
sc->sc_ka_state = GRE_KA_NONE;
+ if_counters_alloc(ifp);
if_attach(ifp);
if_alloc_sadl(ifp);
@@ -672,6 +673,7 @@ mgre_clone_create(struct if_clone *ifc, int unit)
sc->sc_tunnel.t_df = htons(0);
sc->sc_tunnel.t_ecn = ECN_ALLOWED;
+ if_counters_alloc(ifp);
if_attach(ifp);
if_alloc_sadl(ifp);
@@ -1195,8 +1197,8 @@ gre_input_key(struct mbuf **mp, int *offp, int type, int af, uint8_t otos,
pf_pkt_addr_changed(m);
#endif
- ifp->if_ipackets++;
- ifp->if_ibytes += m->m_pkthdr.len;
+ counters_pkt(ifp->if_counters,
+ ifc_ipackets, ifc_ibytes, m->m_pkthdr.len);
#if NBPFILTER > 0
if (ifp->if_bpf)