From mboxrd@z Thu Jan 1 00:00:00 1970 From: Serhey Popovych Subject: [PATCH iproute2 v2 6/9] gre/tunnel: Print erspan_index using print_uint() Date: Thu, 18 Jan 2018 16:04:33 +0200 Message-ID: <1516284276-10942-7-git-send-email-serhe.popovych@gmail.com> References: <1516284276-10942-1-git-send-email-serhe.popovych@gmail.com> To: netdev@vger.kernel.org Return-path: Received: from mail-lf0-f65.google.com ([209.85.215.65]:41763 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756483AbeAROFo (ORCPT ); Thu, 18 Jan 2018 09:05:44 -0500 Received: by mail-lf0-f65.google.com with SMTP id f136so5341868lff.8 for ; Thu, 18 Jan 2018 06:05:44 -0800 (PST) Received: from tuxracer.localdomain ([2a01:6d80::195:20:96:53]) by smtp.gmail.com with ESMTPSA id r21sm1344748lja.8.2018.01.18.06.05.42 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jan 2018 06:05:42 -0800 (PST) In-Reply-To: <1516284276-10942-1-git-send-email-serhe.popovych@gmail.com> Sender: netdev-owner@vger.kernel.org List-ID: One is missing in JSON output because fprintf() is used instead of print_uint(). Signed-off-by: Serhey Popovych --- 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