Skip to content

Commit

Permalink
Fix packet cbs/ebs conversion.
Browse files Browse the repository at this point in the history
Each packet is counted as 128 bytes by the code, not 125.  Not sure
what I was thinking about here 14 years ago.  May be just a typo.

Reported by:	Dmitry Luhtionov <dmitryluhtionov@gmail.com>
MFC after:	2 weeks
  • Loading branch information
amotin committed May 19, 2021
1 parent f4b38c3 commit 4a68307
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions sys/netgraph/ng_car.c
Original file line number Diff line number Diff line change
Expand Up @@ -491,14 +491,14 @@ ng_car_rcvmsg(node_p node, item_p item, hook_p lasthook)
if (bconf->downstream.opt & NG_CAR_COUNT_PACKETS) {
bconf->downstream.cir *= 1024;
bconf->downstream.pir *= 1024;
bconf->downstream.cbs *= 125;
bconf->downstream.ebs *= 125;
bconf->downstream.cbs *= 128;
bconf->downstream.ebs *= 128;
}
if (bconf->upstream.opt & NG_CAR_COUNT_PACKETS) {
bconf->upstream.cir *= 1024;
bconf->upstream.pir *= 1024;
bconf->upstream.cbs *= 125;
bconf->upstream.ebs *= 125;
bconf->upstream.cbs *= 128;
bconf->upstream.ebs *= 128;
}
if ((bconf->downstream.cir > 1000000000) ||
(bconf->downstream.pir > 1000000000) ||
Expand Down

0 comments on commit 4a68307

Please sign in to comment.