diff options
author | John Fastabend <john.fastabend@gmail.com> | 2018-10-29 22:31:28 +0300 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2018-10-31 01:31:22 +0300 |
commit | 27b31e68bc9fc25c519c7772fa23913687218d5f (patch) | |
tree | efc8ca26473eb98d494b0ad3c01af4d5a54050f8 /tools/testing/selftests/bpf/test_sock_addr.sh | |
parent | b31d30d9be32d41bef3e6076a965565d3a3d8005 (diff) | |
download | linux-27b31e68bc9fc25c519c7772fa23913687218d5f.tar.xz |
bpf: tcp_bpf_recvmsg should return EAGAIN when nonblocking and no data
We return 0 in the case of a nonblocking socket that has no data
available. However, this is incorrect and may confuse applications.
After this patch we do the correct thing and return the error
EAGAIN.
Quoting return codes from recvmsg manpage,
EAGAIN or EWOULDBLOCK
The socket is marked nonblocking and the receive operation would
block, or a receive timeout had been set and the timeout expired
before data was received.
Fixes: 604326b41a6f ("bpf, sockmap: convert to generic sk_msg interface")
Signed-off-by: John Fastabend <john.fastabend@gmail.com>
Acked-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'tools/testing/selftests/bpf/test_sock_addr.sh')
0 files changed, 0 insertions, 0 deletions