From: Sergey V. Lobanov Date: Sat, 10 May 2014 23:01:14 +0000 (+0400) Subject: Fixed 'tc qdisc show' for tbf when latency<0 X-Git-Tag: v3.15.0~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3ff10e82c135ba1b7ddd22ea15dda5ae0c2e78c1;p=thirdparty%2Fiproute2.git Fixed 'tc qdisc show' for tbf when latency<0 When limit --- diff --git a/tc/q_tbf.c b/tc/q_tbf.c index f3022b65f..2d5633110 100644 --- a/tc/q_tbf.c +++ b/tc/q_tbf.c @@ -302,16 +302,16 @@ static int tbf_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt) } } - if (show_raw) - fprintf(f, "limit %s ", sprint_size(qopt->limit, b1)); - latency = TIME_UNITS_PER_SEC*(qopt->limit/(double)rate64) - tc_core_tick2time(qopt->buffer); if (prate64) { double lat2 = TIME_UNITS_PER_SEC*(qopt->limit/(double)prate64) - tc_core_tick2time(qopt->mtu); if (lat2 > latency) latency = lat2; } - fprintf(f, "lat %s ", sprint_time(latency, b1)); + if (latency >= 0.0) + fprintf(f, "lat %s ", sprint_time(latency, b1)); + if (show_raw || latency < 0.0) + fprintf(f, "limit %s ", sprint_size(qopt->limit, b1)); if (qopt->rate.overhead) { fprintf(f, "overhead %d", qopt->rate.overhead);