Skip to content

Commit

Permalink
bpftool: fix BTF raw dump of FWD's fwd_kind
Browse files Browse the repository at this point in the history
kflag bit determines whether FWD is for struct or union. Use that bit.

Fixes: c93cc69 ("bpftool: add ability to dump BTF types")
Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
  • Loading branch information
anakryiko authored and borkmann committed May 17, 2019
1 parent 7ed4b4e commit 9c3ddee
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/bpf/bpftool/btf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 9c3ddee

Please sign in to comment.