Skip to contentSkip to conversation

bpftool: fix BTF raw dump of FWD's fwd_kind

PATCH Applied Andrii Nakryiko 2 participants 2 messages May 17, 2019

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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")
---
 tools/bpf/bpftool/btf.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tools/bpf/bpftool/btf.c +2 -2
index 58a2cd002a4b..7317438ecd9e 100644
@@ -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);
Signature · 1 line
2.17.1
maintainer Applied
#1 lore raw
Quoted 4 lines · Andrii Nakryiko

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

Fixes c93cc69004df ("bpftool: add ability to dump BTF types")

Applied, thanks!