bpftool: fix typo in struct_ops map FD generation for light skeleton
PATCH 1/1 bpftool: fix typo in struct_ops map FD generation for light skeleton
When generating light skeletons for BPF programs containing struct_ops maps, bpftool incorrectly outputs a stray literal 't' instead of a tab character for the map file descriptor member in the links structure. This causes a compilation error when the generated light skeleton is used.
Correct the format string by replacing 't' with '\t'.
--- tools/bpf/bpftool/gen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/bpf/bpftool/gen.c +1 -1
@@ -1399,7 +1399,7 @@ static int do_skeleton(int argc, char **argv)continue ;if (use_loader) -printf ("t\tint %s_fd;\n" , ident); +printf ("\t\tint %s_fd;\n" , ident);else printf ("\t\tstruct bpf_link *%s;\n" , ident); }
---
base-commit: c6e99c10fd9855082568cbd71bb2cc5dc90eda53
change-id: 20260519-struct_ops_gen_typo_fix-59d53748cece
Best regards,
Signature · 1 line
Siddharth Nayyar <[email protected]>
2026-05-20 09:40 UTC+0000 ~ Siddharth Nayyar <[email protected]>
Quoted 10 lines
When generating light skeletons for BPF programs containing
struct_opsmaps, bpftool incorrectly outputs a stray literal 't' instead of a tab character for the map file descriptor member in the links structure. This causes a compilation error when the generated light skeleton is used.Correct the format string by replacing 't' with '\t'.
Fixes 08ac454e258e ("libbpf: Auto-attach struct_ops BPF maps in BPF skeleton")Signed-off-by Siddharth Nayyar <[email protected]>
Thank you!
This patch was applied to bpf/bpf-next.git (master) by Andrii Nakryiko <[email protected]>:
Hello:
This patch was applied to bpf/bpf-next.git (master) by Andrii Nakryiko <[email protected]>:
Quoted 9 lines · On Wed, 20 May 2026 09:40:44 +0000 you wrote:
When generating light skeletons for BPF programs containing
struct_opsmaps, bpftool incorrectly outputs a stray literal 't' instead of a tab character for the map file descriptor member in the links structure. This causes a compilation error when the generated light skeleton is used.Correct the format string by replacing 't' with '\t'.
[...]
Here is the summary with links:
- bpftool: fix typo in struct_ops map FD generation for light skeleton
https://git.kernel.org/bpf/bpf-next/c/be4c6c7bc429
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html