Skip to content

Commit

Permalink
netem: fix gemodel loss generator
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 case 2, of the switch we change the direction of the inequality to
  net_random()>clg->a3, because clg->a3 is h in the GE model and when h
  is 0 all packets will be lost."

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
shemminger authored and davem330 committed Nov 30, 2013
1 parent ab6c27b commit eff7979
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/sched/sch_netem.c
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ static bool loss_gilb_ell(struct netem_sched_data *q)
case 2:
if (net_random() < clg->a2)
clg->state = 1;
if (clg->a3 > net_random())
if (net_random() > clg->a3)
return true;
}

Expand Down

0 comments on commit eff7979

Please sign in to comment.