[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAF=yD-JwAidB+Hc+sH9woBMR=3JUnbneB3fCRiJ3wmt3gzTcMg@mail.gmail.com>
Date: Mon, 14 Aug 2017 14:25:23 -0400
From: Willem de Bruijn <willemdebruijn.kernel@...il.com>
To: Thiago Macieira <thiago.macieira@...el.com>
Cc: Matthew Dawson <matthew@...systems.ca>,
Paolo Abeni <pabeni@...hat.com>,
Network Development <netdev@...r.kernel.org>
Subject: Re: [PATCH net] datagram: When peeking datagrams with offset < 0
don't skip empty skbs
On Mon, Aug 14, 2017 at 1:02 PM, Thiago Macieira
<thiago.macieira@...el.com> wrote:
> On Monday, 14 August 2017 09:33:48 PDT Willem de Bruijn wrote:
>> > But here's a question: if the peek offset is equal to the length, should
>> > the reading return an empty datagram? This would indicate to the caller
>> > that there was a datagram there, which was skipped over.
>>
>> In the general case, no, it should read at the offset, which is the next
>> skb.
>
> I beg to differ. In this particular case, we are talking about datagrams. If
> it were stream sockets, I would agree with you: just skip to the next. But in
> datagrams, the same way you do return zero-sized ones, I would return an empty
> one if you peeked at or past the end.
It can be argued either way. I would not change it in the scope of
this bug.
>
>> Since we only need to change no-offset semantics to fix this bug,
>> I would not change this behavior, which is also expected by some
>> applications by now.
>
> Do applications using SOCK_DGRAM rely on the behaviour of skipping over
> datagrams that are too short?
It is established behavior. It cannot be ruled out that an application
somewhere depends on it.
Powered by blists - more mailing lists