diff options
author | Artem Savkov <asavkov@redhat.com> | 2022-04-21 16:01:04 +0300 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2022-04-21 17:34:55 +0300 |
commit | 920fd5e1771db8b338d4145c2d30d60bf0bcce99 (patch) | |
tree | 020352f368979bfde1c743492799e0da57e8e428 /tools/testing/selftests/bpf/test_sock.c | |
parent | 9d87e41a6d644d4cee66a72fd1656fac5b7850d1 (diff) | |
download | linux-920fd5e1771db8b338d4145c2d30d60bf0bcce99.tar.xz |
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.c | 2 |
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 |