diff options
author | Stanislav Fomichev <sdf@google.com> | 2023-05-11 10:04:55 -0700 |
---|---|---|
committer | Martin KaFai Lau <martin.lau@kernel.org> | 2023-05-13 16:55:46 -0700 |
commit | e01b4a72f132c1ca63e3ed851bef9b3c62ae6149 (patch) | |
tree | 1908d1e5bc4f34dd4908561cecbaeffd738151fc /tools/testing/selftests/bpf/prog_tests/sockopt_qos_to_cc.c | |
parent | 989a4a7dbff21399da42e808a4ae134023546f41 (diff) | |
download | linux-e01b4a72f132c1ca63e3ed851bef9b3c62ae6149.tar.gz linux-e01b4a72f132c1ca63e3ed851bef9b3c62ae6149.tar.bz2 linux-e01b4a72f132c1ca63e3ed851bef9b3c62ae6149.zip |
selftests/bpf: Correctly handle optlen > 4096
Even though it's not relevant in selftests, the people
might still copy-paste from them. So let's take care
of optlen > 4096 cases explicitly.
Signed-off-by: Stanislav Fomichev <sdf@google.com>
Link: https://lore.kernel.org/r/20230511170456.1759459-4-sdf@google.com
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/sockopt_qos_to_cc.c')
-rw-r--r-- | tools/testing/selftests/bpf/prog_tests/sockopt_qos_to_cc.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/prog_tests/sockopt_qos_to_cc.c b/tools/testing/selftests/bpf/prog_tests/sockopt_qos_to_cc.c index 6b53b3cb8dad..6b2d300e9fd4 100644 --- a/tools/testing/selftests/bpf/prog_tests/sockopt_qos_to_cc.c +++ b/tools/testing/selftests/bpf/prog_tests/sockopt_qos_to_cc.c @@ -42,6 +42,8 @@ void test_sockopt_qos_to_cc(void) if (!ASSERT_OK_PTR(skel, "skel")) goto done; + skel->bss->page_size = sysconf(_SC_PAGESIZE); + sock_fd = socket(AF_INET6, SOCK_STREAM, 0); if (!ASSERT_GE(sock_fd, 0, "v6 socket open")) goto done; |