]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
bpftool: Fix typo in struct_ops map FD generation for light skeleton
authorSiddharth Nayyar <sidnayyar@google.com>
Wed, 20 May 2026 09:40:44 +0000 (09:40 +0000)
committerAndrii Nakryiko <andrii@kernel.org>
Thu, 28 May 2026 21:19:15 +0000 (14:19 -0700)
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 <sidnayyar@google.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Quentin Monnet <qmo@kernel.org>
Link: https://lore.kernel.org/bpf/20260520-struct_ops_gen_typo_fix-v1-1-4dee3771da46@google.com
tools/bpf/bpftool/gen.c

index 37159e02f418cb597afdf1ba3e05e1e5302737e5..6ae7262ebe0c1d65b10e4913af9979b83edd772b 100644 (file)
@@ -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);
                }