From 2a8d0f6e9c3f4bbea83b76ab2aa8032be5ecf405 Mon Sep 17 00:00:00 2001 From: Serhey Popovych Date: Thu, 18 Jan 2018 16:04:33 +0200 Subject: [PATCH] gre/tunnel: Print erspan_index using print_uint() One is missing in JSON output because fprintf() is used instead of print_uint(). Signed-off-by: Serhey Popovych Signed-off-by: Stephen Hemminger --- 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 d403d24ac..6254e8875 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 a159b542f..29ca3d137 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, -- 2.47.2