From: stephen hemminger Date: Fri, 29 Nov 2013 19:04:26 +0000 (-0800) Subject: netem: fix gemodel loss generator X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=eff7979f00b2c546f36f6829f4072c8db54763a9;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git netem: fix gemodel loss generator 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 Signed-off-by: David S. Miller --- diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c index 9685624f7bc7..bccd52b36e97 100644 --- a/net/sched/sch_netem.c +++ b/net/sched/sch_netem.c @@ -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; }