]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
misc/ifstat: fix incorrect output data in json mode
authorChander Govindarajan <mail@chandergovind.org>
Tue, 25 Jul 2023 01:23:48 +0000 (18:23 -0700)
committerStephen Hemminger <stephen@networkplumber.org>
Tue, 25 Jul 2023 01:23:48 +0000 (18:23 -0700)
Due to this bug, in json mode (with the -j flag), the output was
always in absolute mode (as if passing in the -a flag) and not in
relative mode.

Signed-off-by: Chander Govindarajan <mail@chandergovind.org>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
misc/ifstat.c

index 6c76fa156a2a65f9f1e4349b5b29772e5cce22cb..f6f9ba5027d3a3e395d49bf06e4e8566caa065c3 100644 (file)
@@ -569,7 +569,7 @@ static void dump_incr_db(FILE *fp)
                        continue;
 
                if (jw)
-                       print_one_json(jw, n, vals);
+                       print_one_json(jw, n, n->val);
                else
                        print_one_if(fp, n, vals);
        }