Index: net/if.c =================================================================== RCS file: /cvs/src/sys/net/if.c,v retrieving revision 1.345 diff -u -p -r1.345 if.c --- net/if.c 25 Jun 2015 09:20:20 -0000 1.345 +++ net/if.c 29 Jun 2015 08:43:18 -0000 @@ -494,15 +494,18 @@ void if_input(struct ifnet *ifp, struct mbuf_list *ml) { struct mbuf *m; + size_t ibytes = 0; splassert(IPL_NET); - ifp->if_ipackets += ml_len(ml); - MBUF_LIST_FOREACH(ml, m) { m->m_pkthdr.ph_ifidx = ifp->if_index; m->m_pkthdr.ph_rtableid = ifp->if_rdomain; + ibytes += m->m_pkthdr.len; } + + ifp->if_ipackets += ml_len(ml); + ifp->if_ibytes += ibytes; #if NBPFILTER > 0 if (ifp->if_bpf) { Index: net/if_ethersubr.c =================================================================== RCS file: /cvs/src/sys/net/if_ethersubr.c,v retrieving revision 1.210 diff -u -p -r1.210 if_ethersubr.c --- net/if_ethersubr.c 25 Jun 2015 09:22:36 -0000 1.210 +++ net/if_ethersubr.c 29 Jun 2015 08:43:18 -0000 @@ -320,8 +320,6 @@ ether_input(struct mbuf *m) ifp->if_imcasts++; } - ifp->if_ibytes += m->m_pkthdr.len + sizeof(*eh); - etype = ntohs(eh->ether_type); ac = (struct arpcom *)ifp; Index: net/if_trunk.c =================================================================== RCS file: /cvs/src/sys/net/if_trunk.c,v retrieving revision 1.104 diff -u -p -r1.104 if_trunk.c --- net/if_trunk.c 24 Jun 2015 09:40:54 -0000 1.104 +++ net/if_trunk.c 29 Jun 2015 08:43:18 -0000 @@ -1101,8 +1101,6 @@ trunk_input(struct mbuf *m) if (ETHER_IS_MULTICAST(eh->ether_dhost)) ifp->if_imcasts++; - ifp->if_ibytes += m->m_pkthdr.len; - /* Should be checked by the caller */ if (ifp->if_type != IFT_IEEE8023ADLAG) { error = EPROTONOSUPPORT; Index: net/if_vlan.c =================================================================== RCS file: /cvs/src/sys/net/if_vlan.c,v retrieving revision 1.131 diff -u -p -r1.131 if_vlan.c --- net/if_vlan.c 24 Jun 2015 09:40:54 -0000 1.131 +++ net/if_vlan.c 29 Jun 2015 08:43:18 -0000 @@ -282,8 +282,6 @@ vlan_input(struct mbuf *m) return (0); } - ifp->if_ibytes += m->m_pkthdr.len; - /* From now on ether_vtag is fine */ tag = EVL_VLANOFTAG(m->m_pkthdr.ether_vtag); m->m_pkthdr.pf.prio = EVL_PRIOFTAG(m->m_pkthdr.ether_vtag);