]> git.proxmox.com Git - mirror_iproute2.git/commitdiff
tc: fq_codel: fix missing statistic in JSON output
authorLeslie Monis <lesliemonis@gmail.com>
Wed, 25 Dec 2019 19:04:18 +0000 (00:34 +0530)
committerStephen Hemminger <stephen@networkplumber.org>
Sun, 29 Dec 2019 17:57:27 +0000 (09:57 -0800)
Print JSON object even if tc_fq_codel_xstats->class_stats.drop_next
is negative.

Cc: Toke Høiland-Jørgensen <toke@toke.dk>
Fixes: 997f2dc19378 ("tc: Add JSON output of fq_codel stats")
Signed-off-by: Leslie Monis <lesliemonis@gmail.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
tc/q_fq_codel.c

index 376ac50da1a5d6f6d3fee2655a96db5745918d81..d002940da6b78940172d5a419bd8d170ad467c01 100644 (file)
@@ -275,12 +275,12 @@ static int fq_codel_print_xstats(struct qdisc_util *qu, FILE *f,
                        sprint_time(st->class_stats.ldelay, b1));
                if (st->class_stats.dropping) {
                        print_bool(PRINT_ANY, "dropping", " dropping", true);
+                       print_int(PRINT_JSON, "drop_next", NULL,
+                                 st->class_stats.drop_next);
                        if (st->class_stats.drop_next < 0)
                                print_string(PRINT_FP, NULL, " drop_next -%s",
                                        sprint_time(-st->class_stats.drop_next, b1));
                        else {
-                               print_uint(PRINT_JSON, "drop_next", NULL,
-                                       st->class_stats.drop_next);
                                print_string(PRINT_FP, NULL, " drop_next %s",
                                        sprint_time(st->class_stats.drop_next, b1));
                        }