summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/link.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>2000-08-15 00:59:21 +0000
committerbrian <brian@FreeBSD.org>2000-08-15 00:59:21 +0000
commit99a91bd0c26b2f7b5c04ac078ddedd9550f164e8 (patch)
tree1ac1c245b05046fc001749f926966b0cc5140e26 /usr.sbin/ppp/link.c
parent63e7d24009d010dea2cd23b7a1b4d2ebd2a1aadd (diff)
downloadFreeBSD-src-99a91bd0c26b2f7b5c04ac078ddedd9550f164e8.zip
FreeBSD-src-99a91bd0c26b2f7b5c04ac078ddedd9550f164e8.tar.gz
Calculate the average link throughput using a counter based on the
cumulative total of all active links rather than basing it on the total of PROTO_MP traffic. This fixes a problem whereby Cisco routers send PROTO_IP packets only when there's only one link (hmm, what a good idea!).
Diffstat (limited to 'usr.sbin/ppp/link.c')
-rw-r--r--usr.sbin/ppp/link.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/usr.sbin/ppp/link.c b/usr.sbin/ppp/link.c
index e52c31b..7b81fd9 100644
--- a/usr.sbin/ppp/link.c
+++ b/usr.sbin/ppp/link.c
@@ -67,16 +67,24 @@
static void Despatch(struct bundle *, struct link *, struct mbuf *, u_short);
-void
+static inline void
link_AddInOctets(struct link *l, int n)
{
- throughput_addin(&l->throughput, n);
+ if (l->stats.gather) {
+ throughput_addin(&l->stats.total, n);
+ if (l->stats.parent)
+ throughput_addin(l->stats.parent, n);
+ }
}
-void
+static inline void
link_AddOutOctets(struct link *l, int n)
{
- throughput_addout(&l->throughput, n);
+ if (l->stats.gather) {
+ throughput_addout(&l->stats.total, n);
+ if (l->stats.parent)
+ throughput_addout(l->stats.parent, n);
+ }
}
void
OpenPOWER on IntegriCloud