提交 4b6eca9d 编写于 作者: J Jakub Kicinski 提交者: Alexei Starovoitov

tools: bpftool: don't use hex numbers in JSON output

JSON does not accept hex numbers with 0x prefix.  Simply print
as decimal numbers, JSON should be primarily machine-readable.
Signed-off-by: NJakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: NQuentin Monnet <quentin.monnet@netronome.com>
Fixes: 831a0aaf ("tools: bpftool: add JSON output for `bpftool map *` commands")
Signed-off-by: NAlexei Starovoitov <ast@kernel.org>
上级 1bfa26ff
......@@ -428,7 +428,7 @@ static int show_map_close_json(int fd, struct bpf_map_info *info)
jsonw_string_field(json_wtr, "name", info->name);
jsonw_name(json_wtr, "flags");
jsonw_printf(json_wtr, "%#x", info->map_flags);
jsonw_printf(json_wtr, "%d", info->map_flags);
print_dev_json(info->ifindex, info->netns_dev, info->netns_ino);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册