svn commit: r240971 - head/sys/net
Gleb Smirnoff
glebius at FreeBSD.org
Wed Sep 26 20:09:49 UTC 2012
Author: glebius
Date: Wed Sep 26 20:09:48 2012
New Revision: 240971
URL: http://svn.freebsd.org/changeset/base/240971
Log:
- In the bridge_enqueue() do success/error accounting for
each fragment, not only once.
- In the GRAB_OUR_PACKETS() macro do increase if_ibytes.
Modified:
head/sys/net/if_bridge.c
Modified: head/sys/net/if_bridge.c
==============================================================================
--- head/sys/net/if_bridge.c Wed Sep 26 19:49:22 2012 (r240970)
+++ head/sys/net/if_bridge.c Wed Sep 26 20:09:48 2012 (r240971)
@@ -1783,13 +1783,12 @@ bridge_enqueue(struct bridge_softc *sc,
short mflags;
struct mbuf *m0;
- len = m->m_pkthdr.len;
- mflags = m->m_flags;
-
/* We may be sending a fragment so traverse the mbuf */
for (; m; m = m0) {
m0 = m->m_nextpkt;
m->m_nextpkt = NULL;
+ len = m->m_pkthdr.len;
+ mflags = m->m_flags;
/*
* If underlying interface can not do VLAN tag insertion itself
@@ -1809,11 +1808,10 @@ bridge_enqueue(struct bridge_softc *sc,
if ((err = dst_ifp->if_transmit(dst_ifp, m))) {
m_freem(m0);
+ sc->sc_ifp->if_oerrors++;
break;
}
- }
- if (err == 0) {
sc->sc_ifp->if_opackets++;
sc->sc_ifp->if_obytes += len;
if (mflags & M_MCAST)
@@ -2303,6 +2301,7 @@ bridge_input(struct ifnet *ifp, struct m
if ((iface)->if_type == IFT_BRIDGE) { \
ETHER_BPF_MTAP(iface, m); \
iface->if_ipackets++; \
+ iface->if_ibytes += m->m_pkthdr.len; \
/* Filter on the physical interface. */ \
if (pfil_local_phys && \
(PFIL_HOOKED(&V_inet_pfil_hook) \
More information about the svn-src-head
mailing list