aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf/test_sock.c
diff options
context:
space:
mode:
authorArtem Savkov <asavkov@redhat.com>2022-04-21 15:01:04 +0200
committerDaniel Borkmann <daniel@iogearbox.net>2022-04-21 16:34:55 +0200
commit920fd5e1771db8b338d4145c2d30d60bf0bcce99 (patch)
tree020352f368979bfde1c743492799e0da57e8e428 /tools/testing/selftests/bpf/test_sock.c
parenti40e, xsk: Get rid of redundant 'fallthrough' (diff)
downloadlinux-dev-920fd5e1771db8b338d4145c2d30d60bf0bcce99.tar.xz
linux-dev-920fd5e1771db8b338d4145c2d30d60bf0bcce99.zip
selftests/bpf: Fix attach tests retcode checks
Switching to libbpf 1.0 API broke test_sock and test_sysctl as they check for return of bpf_prog_attach to be exactly -1. Switch the check to '< 0' instead. Fixes: b858ba8c52b6 ("selftests/bpf: Use libbpf 1.0 API mode instead of RLIMIT_MEMLOCK") Signed-off-by: Artem Savkov <asavkov@redhat.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Reviewed-by: Yafang Shao <laoar.shao@gmail.com> Link: https://lore.kernel.org/bpf/20220421130104.1582053-1-asavkov@redhat.com
Diffstat (limited to 'tools/testing/selftests/bpf/test_sock.c')
-rw-r--r--tools/testing/selftests/bpf/test_sock.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/selftests/bpf/test_sock.c b/tools/testing/selftests/bpf/test_sock.c
index 6c4494076bbf..810c3740b2cc 100644
--- a/tools/testing/selftests/bpf/test_sock.c
+++ b/tools/testing/selftests/bpf/test_sock.c
@@ -492,7 +492,7 @@ static int run_test_case(int cgfd, const struct sock_test *test)
goto err;
}
- if (attach_sock_prog(cgfd, progfd, test->attach_type) == -1) {
+ if (attach_sock_prog(cgfd, progfd, test->attach_type) < 0) {
if (test->result == ATTACH_REJECT)
goto out;
else