summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorLorenz Bauer <lmb@cloudflare.com>2020-06-29 11:56:30 +0200
committerAlexei Starovoitov <ast@kernel.org>2020-06-30 19:46:39 +0200
commit1a1ad3c20a6fe0e8a4b570fbf835d7cc6e87a9d8 (patch)
tree51347f94f585ce81fddfbee355802ce1edd2923f /tools
parentselftests: bpf: Pass program and target_fd in flow_dissector_reattach (diff)
downloadlinux-1a1ad3c20a6fe0e8a4b570fbf835d7cc6e87a9d8.tar.xz
linux-1a1ad3c20a6fe0e8a4b570fbf835d7cc6e87a9d8.zip
selftests: bpf: Pass program to bpf_prog_detach in flow_dissector
Calling bpf_prog_detach is incorrect, since it takes target_fd as its argument. The intention here is to pass it as attach_bpf_fd, so use bpf_prog_detach2 and pass zero for target_fd. Fixes: 06716e04a043 ("selftests/bpf: Extend test_flow_dissector to cover link creation") Signed-off-by: Lorenz Bauer <lmb@cloudflare.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Link: https://lore.kernel.org/bpf/20200629095630.7933-7-lmb@cloudflare.com
Diffstat (limited to 'tools')
-rw-r--r--tools/testing/selftests/bpf/prog_tests/flow_dissector.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/testing/selftests/bpf/prog_tests/flow_dissector.c b/tools/testing/selftests/bpf/prog_tests/flow_dissector.c
index ea14e3ece812..f11f187990e9 100644
--- a/tools/testing/selftests/bpf/prog_tests/flow_dissector.c
+++ b/tools/testing/selftests/bpf/prog_tests/flow_dissector.c
@@ -527,8 +527,8 @@ static void test_skb_less_prog_attach(struct bpf_flow *skel, int tap_fd)
run_tests_skb_less(tap_fd, skel->maps.last_dissection);
- err = bpf_prog_detach(prog_fd, BPF_FLOW_DISSECTOR);
- CHECK(err, "bpf_prog_detach", "err %d errno %d\n", err, errno);
+ err = bpf_prog_detach2(prog_fd, 0, BPF_FLOW_DISSECTOR);
+ CHECK(err, "bpf_prog_detach2", "err %d errno %d\n", err, errno);
}
static void test_skb_less_link_create(struct bpf_flow *skel, int tap_fd)