浏览代码

[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 <shemminger@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Stephen Hemminger 18 年之前
父节点
当前提交
a362e0a789
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      net/sched/sch_netem.c

+ 2 - 1
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.