]> git.proxmox.com Git - mirror_iproute2.git/commitdiff
tc: move action cookie print out of the stats if
authorJiri Pirko <jiri@mellanox.com>
Sat, 25 Nov 2017 10:07:56 +0000 (11:07 +0100)
committerStephen Hemminger <stephen@networkplumber.org>
Sun, 26 Nov 2017 20:18:38 +0000 (12:18 -0800)
Cookie print was made dependent on show_stats for no good reason. Fix
this bu pushing cookie print ot of the stats if.

Fixes: fd8b3d2c1b9b ("actions: Add support for user cookies")
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
tc/m_action.c

index 85f9e27bf89b97fb10111cfb055592dc615bbd52..aa3aa52ea0bbf76446b5021b43be4c24ee55d5ad 100644 (file)
@@ -301,19 +301,18 @@ static int tc_print_one_action(FILE *f, struct rtattr *arg)
                return err;
 
        if (show_stats && tb[TCA_ACT_STATS]) {
-
                fprintf(f, "\tAction statistics:\n");
                print_tcstats2_attr(f, tb[TCA_ACT_STATS], "\t", NULL);
-               if (tb[TCA_ACT_COOKIE]) {
-                       int strsz = RTA_PAYLOAD(tb[TCA_ACT_COOKIE]);
-                       char b1[strsz * 2 + 1];
-
-                       fprintf(f, "\n\tcookie len %d %s ", strsz,
-                               hexstring_n2a(RTA_DATA(tb[TCA_ACT_COOKIE]),
-                                             strsz, b1, sizeof(b1)));
-               }
                fprintf(f, "\n");
        }
+       if (tb[TCA_ACT_COOKIE]) {
+               int strsz = RTA_PAYLOAD(tb[TCA_ACT_COOKIE]);
+               char b1[strsz * 2 + 1];
+
+               fprintf(f, "\tcookie len %d %s\n", strsz,
+                       hexstring_n2a(RTA_DATA(tb[TCA_ACT_COOKIE]),
+                                     strsz, b1, sizeof(b1)));
+       }
 
        return 0;
 }