From: Siddharth Nayyar Date: Wed, 20 May 2026 09:40:44 +0000 (+0000) Subject: bpftool: Fix typo in struct_ops map FD generation for light skeleton X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=be4c6c7bc42952b71188894933946b410deadcfe;p=thirdparty%2Flinux.git 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'. Fixes: 08ac454e258e ("libbpf: Auto-attach struct_ops BPF maps in BPF skeleton") Signed-off-by: Siddharth Nayyar Signed-off-by: Andrii Nakryiko Acked-by: Quentin Monnet Link: https://lore.kernel.org/bpf/20260520-struct_ops_gen_typo_fix-v1-1-4dee3771da46@google.com --- diff --git a/tools/bpf/bpftool/gen.c b/tools/bpf/bpftool/gen.c index 37159e02f418..6ae7262ebe0c 100644 --- a/tools/bpf/bpftool/gen.c +++ b/tools/bpf/bpftool/gen.c @@ -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); }