diff options
author | Damien Bergamini <damien@cvs.openbsd.org> | 2008-08-04 18:55:09 +0000 |
---|---|---|
committer | Damien Bergamini <damien@cvs.openbsd.org> | 2008-08-04 18:55:09 +0000 |
commit | e86d182943ddc0566d17a16e21c6195c400ef4f7 (patch) | |
tree | 947e7ef3eb095f9eb6fff05f383fe02ca89a7c29 /sys/net | |
parent | c178a8db046c94d9857a1a51b96a797cd9b10686 (diff) |
do not count ethernet header twice in if_obytes stats.
do not count address family field twice in tun's if_obytes stats.
ok henning@ reyk@ deraadt@ for the ethernet bits.
ok deraadt@ for the tun bits.
Diffstat (limited to 'sys/net')
-rw-r--r-- | sys/net/if_ethersubr.c | 6 | ||||
-rw-r--r-- | sys/net/if_tun.c | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c index 6dd11e54023..fb928093639 100644 --- a/sys/net/if_ethersubr.c +++ b/sys/net/if_ethersubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ethersubr.c,v 1.122 2008/06/13 23:24:21 mpf Exp $ */ +/* $OpenBSD: if_ethersubr.c,v 1.123 2008/08/04 18:55:08 damien Exp $ */ /* $NetBSD: if_ethersubr.c,v 1.19 1996/05/07 02:40:30 thorpej Exp $ */ /* @@ -460,10 +460,10 @@ ether_output(ifp0, m0, dst, rt0) splx(s); return (error); } - ifp->if_obytes += len + ETHER_HDR_LEN; + ifp->if_obytes += len; #if NCARP > 0 if (ifp != ifp0) - ifp0->if_obytes += len + ETHER_HDR_LEN; + ifp0->if_obytes += len; #endif /* NCARP > 0 */ if (mflags & M_MCAST) ifp->if_omcasts++; diff --git a/sys/net/if_tun.c b/sys/net/if_tun.c index 417c350a13f..bd20a295b48 100644 --- a/sys/net/if_tun.c +++ b/sys/net/if_tun.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_tun.c,v 1.93 2008/05/07 05:51:12 mpf Exp $ */ +/* $OpenBSD: if_tun.c,v 1.94 2008/08/04 18:55:08 damien Exp $ */ /* $NetBSD: if_tun.c,v 1.24 1996/05/07 02:40:48 thorpej Exp $ */ /* @@ -561,7 +561,7 @@ tun_output(struct ifnet *ifp, struct mbuf *m0, struct sockaddr *dst, bpf_mtap(ifp->if_bpf, m0, BPF_DIRECTION_OUT); #endif - len = m0->m_pkthdr.len + sizeof(*af); + len = m0->m_pkthdr.len; s = splnet(); IFQ_ENQUEUE(&ifp->if_snd, m0, NULL, error); if (error) { |