From: Andrii Nakryiko Date: Fri, 17 May 2019 06:21:29 +0000 (-0700) Subject: bpftool: fix BTF raw dump of FWD's fwd_kind X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=9c3ddee1246411a3c9c39bfa5457e49579027f0c;p=linux.git 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 Signed-off-by: Daniel Borkmann --- diff --git a/tools/bpf/bpftool/btf.c b/tools/bpf/bpftool/btf.c index 58a2cd002a4b1..7317438ecd9ec 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);