summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorAndrii Nakryiko <andriin@fb.com>2019-05-17 02:21:29 -0400
committerDaniel Borkmann <daniel@iogearbox.net>2019-05-17 08:21:29 -0400
commit9c3ddee1246411a3c9c39bfa5457e49579027f0c (patch)
tree74efef8330fb7833afe1ae0a50b110b6f410bb6d /tools
parent7ed4b4e60bb1dd3df7a45dfbde3a96efce9df7eb (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.c4
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,
208 break; 208 break;
209 } 209 }
210 case BTF_KIND_FWD: { 210 case BTF_KIND_FWD: {
211 const char *fwd_kind = BTF_INFO_KIND(t->info) ? "union" 211 const char *fwd_kind = BTF_INFO_KFLAG(t->info) ? "union"
212 : "struct"; 212 : "struct";
213 213
214 if (json_output) 214 if (json_output)
215 jsonw_string_field(w, "fwd_kind", fwd_kind); 215 jsonw_string_field(w, "fwd_kind", fwd_kind);