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@gmail.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
This commit is contained in:
Martin Jeřábek 2018-12-05 16:39:20 +01:00 committed by Stephen Hemminger
parent 4ac4217464
commit 2e320d8b7e
1 changed files with 1 additions and 1 deletions

View File

@ -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");
}