Commit ab6c27be authored by stephen hemminger's avatar stephen hemminger Committed by David S. Miller

netem: fix loss 4 state model

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: default avatarStephen Hemminger <stephen@networkplumber.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7c2781fa
...@@ -215,10 +215,10 @@ static bool loss_4state(struct netem_sched_data *q) ...@@ -215,10 +215,10 @@ static bool loss_4state(struct netem_sched_data *q)
if (rnd < clg->a4) { if (rnd < clg->a4) {
clg->state = 4; clg->state = 4;
return true; return true;
} else if (clg->a4 < rnd && rnd < clg->a1) { } else if (clg->a4 < rnd && rnd < clg->a1 + clg->a4) {
clg->state = 3; clg->state = 3;
return true; return true;
} else if (clg->a1 < rnd) } else if (clg->a1 + clg->a4 < rnd)
clg->state = 1; clg->state = 1;
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment