diff options
author | Damien Bergamini <damien@cvs.openbsd.org> | 2008-08-07 18:09:23 +0000 |
---|---|---|
committer | Damien Bergamini <damien@cvs.openbsd.org> | 2008-08-07 18:09:23 +0000 |
commit | 419d579c16c4a63b3e701da55b434b3d09af28b5 (patch) | |
tree | d6908afad5e311527410fa6efdde7e9f5cc787ad /sys | |
parent | 6523e512410347412a8eb1c3ffc36281b4a54ed8 (diff) |
account spanning tree frames in if_obytes and if_omcasts.
ok henning@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/net/bridgestp.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/sys/net/bridgestp.c b/sys/net/bridgestp.c index 39ccd4402f8..3685e96609f 100644 --- a/sys/net/bridgestp.c +++ b/sys/net/bridgestp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bridgestp.c,v 1.34 2008/06/14 19:13:42 jsing Exp $ */ +/* $OpenBSD: bridgestp.c,v 1.35 2008/08/07 18:09:22 damien Exp $ */ /* * Copyright (c) 2000 Jason L. Wright (jason@thought.net) @@ -371,7 +371,7 @@ bstp_transmit_tcn(struct bstp_state *bs, struct bstp_port *bp) struct ifnet *ifp = bp->bp_ifp; struct ether_header *eh; struct mbuf *m; - int s,error; + int s, len, error; if (ifp == NULL || (ifp->if_flags & IFF_RUNNING) == 0) return; @@ -397,9 +397,13 @@ bstp_transmit_tcn(struct bstp_state *bs, struct bstp_port *bp) s = splnet(); bp->bp_txcount++; + len = m->m_pkthdr.len; IFQ_ENQUEUE(&ifp->if_snd, m, NULL, error); - if (error == 0) + if (error == 0) { + ifp->if_obytes += len; + ifp->if_omcasts++; if_start(ifp); + } splx(s); } @@ -482,7 +486,7 @@ bstp_send_bpdu(struct bstp_state *bs, struct bstp_port *bp, struct ifnet *ifp = bp->bp_ifp; struct mbuf *m; struct ether_header *eh; - int s, error; + int s, len, error; s = splnet(); if (ifp == NULL || (ifp->if_flags & IFF_RUNNING) == 0) @@ -530,9 +534,13 @@ bstp_send_bpdu(struct bstp_state *bs, struct bstp_port *bp, m->m_len = m->m_pkthdr.len; bp->bp_txcount++; + len = m->m_pkthdr.len; IFQ_ENQUEUE(&ifp->if_snd, m, NULL, error); - if (error == 0) + if (error == 0) { + ifp->if_obytes += len; + ifp->if_omcasts++; if_start(ifp); + } done: splx(s); } |