Skip to content

Commit

Permalink
netem: fix loss 4 state model
Browse files Browse the repository at this point in the history
Patch from developers of the alternative loss models, downloaded from:
   http://netgroup.uniroma2.it/twiki/bin/view.cgi/Main/NetemCLG

 "In the case 1 of the switch statement in the if conditions we
   need to add clg->a4 to clg->a1, according to the model."

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
stephen hemminger authored and David S. Miller committed Nov 30, 2013
1 parent 7c2781f commit ab6c27b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/sched/sch_netem.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,10 +215,10 @@ static bool loss_4state(struct netem_sched_data *q)
if (rnd < clg->a4) {
clg->state = 4;
return true;
} else if (clg->a4 < rnd && rnd < clg->a1) {
} else if (clg->a4 < rnd && rnd < clg->a1 + clg->a4) {
clg->state = 3;
return true;
} else if (clg->a1 < rnd)
} else if (clg->a1 + clg->a4 < rnd)
clg->state = 1;

break;
Expand Down

0 comments on commit ab6c27b

Please sign in to comment.