From af178fd08ae7bb23a5615cf27ce716a0b9863646 Mon Sep 17 00:00:00 2001 From: damien Date: Thu, 7 Aug 2008 18:09:22 +0000 Subject: [PATCH] account spanning tree frames in if_obytes and if_omcasts. ok henning@ --- sys/net/bridgestp.c | 18 +++++++++++++----- 1 file 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); } -- 2.20.1