Commit f9b7ff0d authored by Lorenz Bauer's avatar Lorenz Bauer Committed by Alexei Starovoitov

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: 1b514239 ("bpf: flow_dissector: Check value of unused flags to BPF_PROG_ATTACH")
Reported-by: default avatarJiri Benc <jbenc@redhat.com>
Signed-off-by: default avatarLorenz Bauer <lmb@cloudflare.com>
Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
Acked-by: default avatarSong Liu <songliubraving@fb.com>
Link: https://lore.kernel.org/bpf/20201105115230.296657-1-lmb@cloudflare.com
parent 25cf73b9
...@@ -940,7 +940,7 @@ static int parse_attach_detach_args(int argc, char **argv, int *progfd, ...@@ -940,7 +940,7 @@ static int parse_attach_detach_args(int argc, char **argv, int *progfd,
} }
if (*attach_type == BPF_FLOW_DISSECTOR) { if (*attach_type == BPF_FLOW_DISSECTOR) {
*mapfd = -1; *mapfd = 0;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment