Thread (6 messages) 6 messages, 2 authors, 2013-11-30
STALE4576d

[PATCH net 3/3] netem: fix gemodel loss generator

From: Stephen Hemminger <stephen@networkplumber.org>
Date: 2013-11-29 19:04:34

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>
--- a/net/sched/sch_netem.c	2013-11-29 10:58:49.441419081 -0800
+++ b/net/sched/sch_netem.c	2013-11-29 10:58:55.313369015 -0800
@@ -272,7 +272,7 @@ static bool loss_gilb_ell(struct netem_s
 	case 2:
 		if (net_random() < clg->a2)
 			clg->state = 1;
-		if (clg->a3 > net_random())
+		if (net_random() > clg->a3)
 			return true;
 	}
 
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help