From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755983AbcHXNnn (ORCPT ); Wed, 24 Aug 2016 09:43:43 -0400 Received: from lxorguk.ukuu.org.uk ([81.2.110.251]:46400 "EHLO lxorguk.ukuu.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754342AbcHXNnm (ORCPT ); Wed, 24 Aug 2016 09:43:42 -0400 Date: Wed, 24 Aug 2016 14:42:46 +0100 From: One Thousand Gnomes To: "Dan Akunis" Cc: , "David Miller" , , , , , , , , Subject: Re: [REGRESSION] Select hang with zero sized UDP packets Message-ID: <20160824144246.5a61254c@lxorguk.ukuu.org.uk> In-Reply-To: <2ABF798B42E64D9C89DEB806A2E636B5@mtl.com> References: <08d225a8-e98f-c0c6-271d-acc2584347fc@redhat.com> <20160823.112515.318902967155957764.davem@davemloft.net> <2ABF798B42E64D9C89DEB806A2E636B5@mtl.com> Organization: Intel Corporation X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 24 Aug 2016 11:22:09 +0300 "Dan Akunis" wrote: > When select wakes up on a UDP socket, user is expecting to get data. Getting > 0 from recvfrom() or whatever read function she uses, is a wrong attitude. > I agree with David. > > The unit test that expects select to wake up is wrong and should be changed. The unit test is correct. The behaviour of a 0 byte frame is actually well established and a 0 byte data frame is a meaningful message is several protocols. It is distinct from no pending data because that would report EWOULDBLOCK. It's more fun with regard to EOF but UDP has no EOF semantics. If you want to understand how to handle zero length datagrams in a connection oriented protocol the old DECnet documentation covers it in all its pain 8) Alan