]> git.proxmox.com Git - mirror_iproute2.git/commitdiff
ip: iplink_can.c: fix json formatting
authorMartin Jeřábek <martin.jerabek01@gmail.com>
Wed, 5 Dec 2018 15:39:20 +0000 (16:39 +0100)
committerStephen Hemminger <stephen@networkplumber.org>
Fri, 7 Dec 2018 17:22:29 +0000 (09:22 -0800)
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>
ip/iplink_can.c

index c0deeb1f1fcf38e466ce38d8c1ebebab399db669..5bf490a9d1c3f1e9d33c09ae10bf81b65cec1619 100644 (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");
        }