]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
tc: fix second printing of requeues
authorJakub Kicinski <jakub.kicinski@netronome.com>
Sat, 27 Jan 2018 09:19:04 +0000 (01:19 -0800)
committerStephen Hemminger <stephen@networkplumber.org>
Sun, 28 Jan 2018 00:06:54 +0000 (16:06 -0800)
Non-JSON tc qdisc output used to print the "requeues" statistic
twice.  Commit 4fcec7f3665b ("tc: jsonify stats2") tried to preserve
this behaviour for both standard output and JSON, but used the wrong
statistic (q.qlen).  Also duplicating keys in JSON is not allowed,
so the second occurrence should be completely skipped with JSON.

Fixes: 4fcec7f3665b ("tc: jsonify stats2")
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
tc/tc_util.c

index 10e5aa91168a119ddc0d442c17693cd1b5e78de3..aceb0d9449337a64b71596072b5df370f49ea97b 100644 (file)
@@ -846,7 +846,7 @@ void print_tcstats2_attr(FILE *fp, struct rtattr *rta, char *prefix, struct rtat
                print_string(PRINT_FP, NULL, "backlog %s",
                             sprint_size(q.backlog, b1));
                print_uint(PRINT_ANY, "qlen", " %up", q.qlen);
-               print_uint(PRINT_ANY, "requeues", " requeues %u", q.qlen);
+               print_uint(PRINT_FP, NULL, " requeues %u", q.requeues);
        }
 
        if (xstats)