From: Stephen Hemminger Date: Thu, 22 Mar 2007 19:15:45 +0000 (-0700) Subject: [NETEM]: report reorder percent correctly. X-Git-Tag: v2.6.22-rc1~1128^2~208 X-Git-Url: http://git.rot13.org/?p=powerpc.git;a=commitdiff_plain;h=a362e0a7890c735a3ef63aab12d71ecfc6e6f4a5 [NETEM]: report reorder percent correctly. If you setup netem to just delay packets; "tc qdisc ls" will report the reordering as 100%. Well it's a lie, reorder isn't used unless gap is set, so just set value to 0 so the output of utility is correct. 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 4818da5a7e..791c615e3a 100644 --- a/net/sched/sch_netem.c +++ b/net/sched/sch_netem.c @@ -429,7 +429,8 @@ static int netem_change(struct Qdisc *sch, struct rtattr *opt) /* for compatiablity with earlier versions. * if gap is set, need to assume 100% probablity */ - q->reorder = ~0; + if (q->gap) + q->reorder = ~0; /* Handle nested options after initial queue options. * Should have put all options in nested format but too late now.