]> git.proxmox.com Git - mirror_iproute2.git/commitdiff
tc: add 'kind' property to 'csum' action
authorDavide Caratti <dcaratti@redhat.com>
Thu, 31 Jan 2019 17:58:41 +0000 (18:58 +0100)
committerDavid Ahern <dsahern@gmail.com>
Sun, 3 Feb 2019 17:10:38 +0000 (09:10 -0800)
unlike other TC actions already supporting JSON printout, 'csum' does not
print the value of TCA_KIND in the 'kind' property: remove 'csum' word
from 'csum' property, and add a separate 'kind' property containing the
action name. The human-readable printout is preserved.

Tested with:
 # ./tdc.py -c csum

Cc: Andrea Claudi <aclaudi@redhat.com>
Signed-off-by: Davide Caratti <dcaratti@redhat.com>
Signed-off-by: David Ahern <dsahern@gmail.com>
tc/m_csum.c

index 752269d1d02049dea645b2ed196421080b67e259..84396d6a482df9216d22de5778d48c70ce9cab2e 100644 (file)
@@ -199,10 +199,11 @@ print_csum(struct action_util *au, FILE *f, struct rtattr *arg)
                uflag_1 = "?empty";
        }
 
+       print_string(PRINT_ANY, "kind", "%s ", "csum");
        snprintf(buf, sizeof(buf), "%s%s%s%s%s%s%s",
                 uflag_1, uflag_2, uflag_3,
                 uflag_4, uflag_5, uflag_6, uflag_7);
-       print_string(PRINT_ANY, "csum", "csum (%s) ", buf);
+       print_string(PRINT_ANY, "csum", "(%s) ", buf);
 
        print_action_control(f, "action ", sel->action, "\n");
        print_uint(PRINT_ANY, "index", "\tindex %u", sel->index);