Re: [PATCH] bpf: tcp_bpf_recvmsg should return EAGAIN when nonblocking and no data
From: Song Liu <hidden>
Date: 2018-10-30 07:04:10
From: Song Liu <hidden>
Date: 2018-10-30 07:04:10
On Mon, Oct 29, 2018 at 1:32 PM John Fastabend [off-list ref] wrote:
On 10/29/2018 12:31 PM, John Fastabend wrote:quoted
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. Signed-off-by: John Fastabend <john.fastabend@gmail.com>
Acked-by: Song Liu <redacted>
quoted
---Add fixes tag. Fixes: 604326b41a6f ("bpf, sockmap: convert to generic sk_msg interface")