Skip to content

Commit f9b7ff0

Browse files
lmbAlexei Starovoitov
authored and
Alexei Starovoitov
committed
tools/bpftool: Fix attaching flow dissector
My earlier patch to reject non-zero arguments to flow dissector attach broke attaching via bpftool. Instead of 0 it uses -1 for target_fd. Fix this by passing a zero argument when attaching the flow dissector. Fixes: 1b51423 ("bpf: flow_dissector: Check value of unused flags to BPF_PROG_ATTACH") Reported-by: Jiri Benc <[email protected]> Signed-off-by: Lorenz Bauer <[email protected]> Signed-off-by: Alexei Starovoitov <[email protected]> Acked-by: Song Liu <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
1 parent 25cf73b commit f9b7ff0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/bpf/bpftool/prog.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -940,7 +940,7 @@ static int parse_attach_detach_args(int argc, char **argv, int *progfd,
940940
}
941941

942942
if (*attach_type == BPF_FLOW_DISSECTOR) {
943-
*mapfd = -1;
943+
*mapfd = 0;
944944
return 0;
945945
}
946946

0 commit comments

Comments
 (0)