On Fri, 21 Dec 2018 16:18:54 +0800 [email protected] wrote: > + > + if (tb[LWTUNNEL_IP_FLAGS]) { > + flags = rta_getattr_u16(tb[LWTUNNEL_IP_FLAGS]); > + if (flags & TUNNEL_KEY) > + print_string(PRINT_ANY, NULL, "%s ", "key"); > + if (flags & TUNNEL_CSUM) > + print_string(PRINT_ANY, NULL, "%s ", "csum"); > + if (flags & TUNNEL_SEQ) > + print_string(PRINT_ANY, NULL, "%s ", "seq"); > + }
I don't think this will generate valid JSON. Please take output of ip link command with your changes and the json format option and run it into python validator. If the json is valid this will pretty print it. If not, it will give an error. $ ip -j li | python -m json.tool
