diff options
author | Andrii Nakryiko <andriin@fb.com> | 2019-05-16 23:21:29 -0700 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2019-05-17 14:21:29 +0200 |
commit | 9c3ddee1246411a3c9c39bfa5457e49579027f0c (patch) | |
tree | 74efef8330fb7833afe1ae0a50b110b6f410bb6d /tools | |
parent | 7ed4b4e60bb1dd3df7a45dfbde3a96efce9df7eb (diff) |
bpftool: fix BTF raw dump of FWD's fwd_kind
kflag bit determines whether FWD is for struct or union. Use that bit.
Fixes: c93cc69004df ("bpftool: add ability to dump BTF types")
Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/bpf/bpftool/btf.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/bpf/bpftool/btf.c b/tools/bpf/bpftool/btf.c index 58a2cd002a4b..7317438ecd9e 100644 --- a/tools/bpf/bpftool/btf.c +++ b/tools/bpf/bpftool/btf.c @@ -208,8 +208,8 @@ static int dump_btf_type(const struct btf *btf, __u32 id, break; } case BTF_KIND_FWD: { - const char *fwd_kind = BTF_INFO_KIND(t->info) ? "union" - : "struct"; + const char *fwd_kind = BTF_INFO_KFLAG(t->info) ? "union" + : "struct"; if (json_output) jsonw_string_field(w, "fwd_kind", fwd_kind); |