diff mbox series

[iproute2,6/9] gre/tunnel: Print erspan_index using print_uint()

Message ID 1515778774-24173-7-git-send-email-serhe.popovych@gmail.com
State Changes Requested, archived
Delegated to: stephen hemminger
Headers show
Series ip/tunnel: Improve tunnel parameters printing | expand

Commit Message

Serhey Popovych Jan. 12, 2018, 5:39 p.m. UTC
One is missing in JSON output because fprintf()
is used instead of print_uint().

Signed-off-by: Serhey Popovych <serhe.popovych@gmail.com>
---
 ip/link_gre.c  |    3 ++-
 ip/link_gre6.c |    4 +++-
 2 files changed, 5 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/ip/link_gre.c b/ip/link_gre.c
index b70f73b..a7d1cd1 100644
--- a/ip/link_gre.c
+++ b/ip/link_gre.c
@@ -464,7 +464,8 @@  static void gre_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])
 	if (tb[IFLA_GRE_ERSPAN_INDEX]) {
 		__u32 erspan_idx = rta_getattr_u32(tb[IFLA_GRE_ERSPAN_INDEX]);
 
-		fprintf(f, "erspan_index %u ", erspan_idx);
+		print_uint(PRINT_ANY,
+			   "erspan_index", "erspan_index %u ", erspan_idx);
 	}
 
 	if (tb[IFLA_GRE_ENCAP_TYPE] &&
diff --git a/ip/link_gre6.c b/ip/link_gre6.c
index 41180bb..200846e 100644
--- a/ip/link_gre6.c
+++ b/ip/link_gre6.c
@@ -512,7 +512,9 @@  static void gre_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])
 
 	if (tb[IFLA_GRE_ERSPAN_INDEX]) {
 		__u32 erspan_idx = rta_getattr_u32(tb[IFLA_GRE_ERSPAN_INDEX]);
-		fprintf(f, "erspan_index %u ", erspan_idx);
+
+		print_uint(PRINT_ANY,
+			   "erspan_index", "erspan_index %u ", erspan_idx);
 	}
 
 	if (tb[IFLA_GRE_ENCAP_TYPE] &&