Commit 9c3ddee1 authored by Andrii Nakryiko's avatar Andrii Nakryiko Committed by Daniel Borkmann

bpftool: fix BTF raw dump of FWD's fwd_kind

kflag bit determines whether FWD is for struct or union. Use that bit.

Fixes: c93cc690 ("bpftool: add ability to dump BTF types")
Signed-off-by: default avatarAndrii Nakryiko <andriin@fb.com>
Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
parent 7ed4b4e6
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment