]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
gre/tunnel: Print erspan_index using print_uint()
authorSerhey Popovych <serhe.popovych@gmail.com>
Thu, 18 Jan 2018 14:04:33 +0000 (16:04 +0200)
committerStephen Hemminger <stephen@networkplumber.org>
Fri, 19 Jan 2018 00:34:40 +0000 (16:34 -0800)
One is missing in JSON output because fprintf()
is used instead of print_uint().

Signed-off-by: Serhey Popovych <serhe.popovych@gmail.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
ip/link_gre.c
ip/link_gre6.c

index d403d24ac4e123bc4ffe9fc610c3145fda1f5c81..6254e8875135088facb9e363242da76427ea0bde 100644 (file)
@@ -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,
index a159b542fa1c7ff587ced7fc407a53e1f8786e67..29ca3d1373d891d268fac08a8f2b6c3e7aa9f304 100644 (file)
@@ -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,