[<prev] [next>] [day] [month] [year] [list]
Message-ID: <3309ad9d-4896-447a-f58f-e3848e771ff9@gmail.com>
Date: Wed, 5 Dec 2018 16:39:20 +0100
From: Martin Jeřábek <martin.jerabek01@...il.com>
To: netdev@...r.kernel.org
Cc: Martin Jeřábek <martin.jerabek01@...il.com>
Subject: [PATCH iproute2] ip: iplink_can.c: fix json formatting
Previously the CAN state was always printed in human-readable txt format,
resulting in invalid JSON.
Signed-off-by: Martin Jeřábek <martin.jerabek01@...il.com>
---
ip/iplink_can.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ip/iplink_can.c b/ip/iplink_can.c
index c0deeb1f1fcf..5bf490a9d1c3 100644
--- a/ip/iplink_can.c
+++ b/ip/iplink_can.c
@@ -283,7 +283,7 @@ static void can_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])
if (tb[IFLA_CAN_STATE]) {
uint32_t state = rta_getattr_u32(tb[IFLA_CAN_STATE]);
- fprintf(f, "state %s ", state < CAN_STATE_MAX ?
+ print_string(PRINT_ANY, "state", "state %s ", state < CAN_STATE_MAX ?
can_state_names[state] : "UNKNOWN");
}
--
2.19.2
Powered by blists - more mailing lists