aboutsummaryrefslogtreecommitdiff
path: root/sys/net/if_vlan.c
diff options
context:
space:
mode:
authorPyun YongHyeon <yongari@FreeBSD.org>2011-12-29 18:40:58 +0000
committerPyun YongHyeon <yongari@FreeBSD.org>2011-12-29 18:40:58 +0000
commit1ad7a2570da0cf76c20d8a7c1cef1ceb0dec91ee (patch)
tree579f657f05faf1e619eaae8a272741c1940333c8 /sys/net/if_vlan.c
parent3b0b2840be64ee1ed67bc6939c412b59bfaac2c7 (diff)
downloadsrc-1ad7a2570da0cf76c20d8a7c1cef1ceb0dec91ee.tar.gz
src-1ad7a2570da0cf76c20d8a7c1cef1ceb0dec91ee.zip
Update if_obytes and if_omcast after successful transmit.
While I'm here update if_oerrors if parent interface of vlan is not up and running. Previously it updated collision counter and it was confusing to interprete it. PR: kern/163478 Reviewed by: glebius, jhb Tested by: Joe Holden < lists <> rewt dot org dot uk >
Notes
Notes: svn path=/head/; revision=228967
Diffstat (limited to 'sys/net/if_vlan.c')
-rw-r--r--sys/net/if_vlan.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c
index 51e1c6cff338..7fea1837094c 100644
--- a/sys/net/if_vlan.c
+++ b/sys/net/if_vlan.c
@@ -1012,10 +1012,12 @@ vlan_transmit(struct ifnet *ifp, struct mbuf *m)
{
struct ifvlan *ifv;
struct ifnet *p;
- int error;
+ int error, len, mcast;
ifv = ifp->if_softc;
p = PARENT(ifv);
+ len = m->m_pkthdr.len;
+ mcast = (m->m_flags & (M_MCAST | M_BCAST)) ? 1 : 0;
BPF_MTAP(ifp, m);
@@ -1025,7 +1027,7 @@ vlan_transmit(struct ifnet *ifp, struct mbuf *m)
*/
if (!UP_AND_RUNNING(p)) {
m_freem(m);
- ifp->if_collisions++;
+ ifp->if_oerrors++;
return (0);
}
@@ -1081,9 +1083,11 @@ vlan_transmit(struct ifnet *ifp, struct mbuf *m)
* Send it, precisely as ether_output() would have.
*/
error = (p->if_transmit)(p, m);
- if (!error)
+ if (!error) {
ifp->if_opackets++;
- else
+ ifp->if_omcasts += mcast;
+ ifp->if_obytes += len;
+ } else
ifp->if_oerrors++;
return (error);
}