summaryrefslogtreecommitdiffstats
path: root/tools/bpf
diff options
context:
space:
mode:
authorJakub Kicinski <jakub.kicinski@netronome.com>2018-03-23 19:45:12 -0700
committerAlexei Starovoitov <ast@kernel.org>2018-03-24 10:38:59 -0700
commit4b6eca9d6817e58ae9b3342a5974e8fd9285279e (patch)
tree39a0326ccea069d0a4efa15aef78f62a7bd28b4d /tools/bpf
parent1bfa26ff8c4b7512f4e4efa6df211239223033d4 (diff)
downloadlinux-stable-4b6eca9d6817e58ae9b3342a5974e8fd9285279e.tar.gz
linux-stable-4b6eca9d6817e58ae9b3342a5974e8fd9285279e.tar.bz2
linux-stable-4b6eca9d6817e58ae9b3342a5974e8fd9285279e.zip
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: Jakub Kicinski <jakub.kicinski@netronome.com> Reviewed-by: Quentin Monnet <quentin.monnet@netronome.com> Fixes: 831a0aafe5c3 ("tools: bpftool: add JSON output for `bpftool map *` commands") Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/bpf')
-rw-r--r--tools/bpf/bpftool/map.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/bpf/bpftool/map.c b/tools/bpf/bpftool/map.c
index f95fa67bb498..f509c86faede 100644
--- a/tools/bpf/bpftool/map.c
+++ b/tools/bpf/bpftool/map.c
@@ -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);