diff mbox series

[iproute2-next] tc: add 'kind' property to 'csum' action

Message ID 60a8d248feaea84e6ebddaf1b8f28871a8a25ffc.1548957208.git.dcaratti@redhat.com
State Accepted
Delegated to: David Ahern
Headers show
Series [iproute2-next] tc: add 'kind' property to 'csum' action | expand

Commit Message

Davide Caratti Jan. 31, 2019, 5:58 p.m. UTC
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>
---
 tc/m_csum.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

David Ahern Feb. 3, 2019, 5:12 p.m. UTC | #1
On 1/31/19 10:58 AM, Davide Caratti wrote:
> 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>
> ---
>  tc/m_csum.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 

applied to iproute2-next. Thanks
diff mbox series

Patch

diff --git a/tc/m_csum.c b/tc/m_csum.c
index 752269d1d020..84396d6a482d 100644
--- a/tc/m_csum.c
+++ b/tc/m_csum.c
@@ -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);