bpf, sockmap: Add tests for MSG_F_PEEK
authorJohn Fastabend <john.fastabend@gmail.com>
Tue, 26 Sep 2023 03:53:00 +0000 (20:53 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Fri, 29 Sep 2023 15:06:21 +0000 (17:06 +0200)
commit5f405c0c0c4651b991c109cf9be33bb996af098e
tree748778ba879b88615c25f107e8eefaa78b91671f
parentda9e915eaf5dadb1963b7738cdfa42ed55212445
bpf, sockmap: Add tests for MSG_F_PEEK

Test that we can read with MSG_F_PEEK and then still get correct number
of available bytes through FIONREAD. The recv() (without PEEK) then
returns the bytes as expected. The recv() always worked though because
it was just the available byte reporting that was broke before latest
fixes.

Signed-off-by: John Fastabend <john.fastabend@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Reviewed-by: Jakub Sitnicki <jakub@cloudflare.com>
Link: https://lore.kernel.org/bpf/20230926035300.135096-4-john.fastabend@gmail.com
tools/testing/selftests/bpf/prog_tests/sockmap_basic.c