diff options
author | 1999-09-29 04:30:39 +0000 | |
---|---|---|
committer | 1999-09-29 04:30:39 +0000 | |
commit | 92ebf76e890cea2aaf8360f56daf82eb2e2e9016 (patch) | |
tree | ee24e61686a8e1f5ca1f6acf9b959faa7e711585 | |
parent | cure the cancer; jean@parc.xerox.com (diff) | |
download | wireguard-openbsd-92ebf76e890cea2aaf8360f56daf82eb2e2e9016.tar.xz wireguard-openbsd-92ebf76e890cea2aaf8360f56daf82eb2e2e9016.zip |
fix byte counters; imain@netidea.com
-rw-r--r-- | sys/net/if_tun.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/net/if_tun.c b/sys/net/if_tun.c index 6beafcb183a..54965c3f782 100644 --- a/sys/net/if_tun.c +++ b/sys/net/if_tun.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_tun.c,v 1.26 1999/07/24 03:18:32 brian Exp $ */ +/* $OpenBSD: if_tun.c,v 1.27 1999/09/29 04:30:39 deraadt Exp $ */ /* $NetBSD: if_tun.c,v 1.24 1996/05/07 02:40:48 thorpej Exp $ */ /* @@ -140,6 +140,8 @@ tunattach(unused) ifp->if_oerrors = 0; ifp->if_ipackets = 0; ifp->if_opackets = 0; + ifp->if_ibytes = 0; + ifp->if_obytes = 0; if_attach(ifp); #if NBPFILTER > 0 bpfattach(&ifp->if_bpf, ifp, DLT_NULL, sizeof(u_int32_t)); @@ -362,10 +364,10 @@ tun_output(ifp, m0, dst, rt) return (ENOBUFS); } IF_ENQUEUE(&ifp->if_snd, m0); - splx(s); ifp->if_opackets++; ifp->if_obytes += m0->m_pkthdr.len + sizeof(*af); + splx(s); if (tp->tun_flags & TUN_RWAIT) { tp->tun_flags &= ~TUN_RWAIT; @@ -650,7 +652,7 @@ tunwrite(dev, uio, ioflag) IF_ENQUEUE(ifq, top); schednetisr(isr); ifp->if_ipackets++; - ifp->if_ibytes += m->m_pkthdr.len; + ifp->if_ibytes += top->m_pkthdr.len; splx(s); return error; } |