diff options
author | stephen hemminger <stephen@networkplumber.org> | 2013-11-29 14:04:26 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-11-30 12:49:29 -0500 |
commit | eff7979f00b2c546f36f6829f4072c8db54763a9 (patch) | |
tree | 9cf1f1f79e84513e1a8f6c2101aabc2a17ccb3df /net | |
parent | ab6c27be8178a4682446faa5aa017b948997937f (diff) |
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 <stephen@networkplumber.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/sched/sch_netem.c | 2 |
1 files changed, 1 insertions, 1 deletions
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) | |||
272 | case 2: | 272 | case 2: |
273 | if (net_random() < clg->a2) | 273 | if (net_random() < clg->a2) |
274 | clg->state = 1; | 274 | clg->state = 1; |
275 | if (clg->a3 > net_random()) | 275 | if (net_random() > clg->a3) |
276 | return true; | 276 | return true; |
277 | } | 277 | } |
278 | 278 | ||