[PATCH bpf] bpftool: fix BTF raw dump of FWD's fwd_kind

Subsystems: bpf [general] (safe dynamic programs and tools), bpf [tooling] (bpftool), the rest

STALE2679d

2 messages, 2 authors, 2019-05-17 · open the first message on its own page

[PATCH bpf] bpftool: fix BTF raw dump of FWD's fwd_kind

From: Andrii Nakryiko <hidden>
Date: 2019-05-17 06:21:42

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 <redacted>
---
 tools/bpf/bpftool/btf.c | 4 ++--
 1 file 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,
 		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);
-- 
2.17.1

Re: [PATCH bpf] bpftool: fix BTF raw dump of FWD's fwd_kind

From: Daniel Borkmann <daniel@iogearbox.net>
Date: 2019-05-17 12:24:03

On 05/17/2019 08:21 AM, Andrii Nakryiko wrote:
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 <redacted>
Applied, thanks!
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help