Re: [PATCH bpf] bpf: tcp: recv() should return 0 when the peer socket is closed

2020-06-12 Thread John Fastabend
Alexei Starovoitov wrote: > On Fri, Jun 12, 2020 at 3:18 AM Jakub Sitnicki wrote: > > > > On Wed, 10 Jun 2020 12:19:43 +0200 > > Sabrina Dubroca wrote: > > > > > If the peer is closed, we will never get more data, so > > > tcp_bpf_wait_data will get stuck forever. In case we passed > > > MSG_DONT

Re: [PATCH bpf] bpf: tcp: recv() should return 0 when the peer socket is closed

2020-06-12 Thread Alexei Starovoitov
On Fri, Jun 12, 2020 at 3:18 AM Jakub Sitnicki wrote: > > On Wed, 10 Jun 2020 12:19:43 +0200 > Sabrina Dubroca wrote: > > > If the peer is closed, we will never get more data, so > > tcp_bpf_wait_data will get stuck forever. In case we passed > > MSG_DONTWAIT to recv(), we get EAGAIN but we shoul

Re: [PATCH bpf] bpf: tcp: recv() should return 0 when the peer socket is closed

2020-06-12 Thread Jakub Sitnicki
On Wed, 10 Jun 2020 12:19:43 +0200 Sabrina Dubroca wrote: > If the peer is closed, we will never get more data, so > tcp_bpf_wait_data will get stuck forever. In case we passed > MSG_DONTWAIT to recv(), we get EAGAIN but we should actually get > 0. > > From man 2 recv: > > RETURN VALUE > >