Thread (11 messages) flat view 11 messages, 2 authors, 2018-01-19
STALE3139d

Revision v2 of 2 in this series.

Revisions (2)
  1. v1 [diff vs current]
  2. v2 current

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

From: Serhey Popovych <hidden>
Date: 2018-01-18 14:05:44
Subsystem: the rest · Maintainer: Linus Torvalds

One is missing in JSON output because fprintf()
is used instead of print_uint().

Signed-off-by: Serhey Popovych <redacted>
---
 ip/link_gre.c  |    3 ++-
 ip/link_gre6.c |    4 +++-
 2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/ip/link_gre.c b/ip/link_gre.c
index d403d24..6254e88 100644
--- a/ip/link_gre.c
+++ b/ip/link_gre.c
@@ -465,7 +465,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);
 	}
 
 	tnl_print_encap(tb,
diff --git a/ip/link_gre6.c b/ip/link_gre6.c
index a159b54..29ca3d1 100644
--- a/ip/link_gre6.c
+++ b/ip/link_gre6.c
@@ -513,7 +513,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);
 	}
 
 	tnl_print_encap(tb,
-- 
1.7.10.4
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help