]> git.baikalelectronics.ru Git - kernel.git/commit
udp: fix poll() issue with zero sized packets
authorEric Dumazet <edumazet@google.com>
Tue, 23 Aug 2016 20:59:33 +0000 (13:59 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 23 Aug 2016 23:39:14 +0000 (16:39 -0700)
commit6baa852321a9cab826b43f3a4d2833dce0bbd6ad
treedee57e012d013ab817eb69dd6d1b8a277052e366
parent6a6cb50f961e4aa1cba23674a1cecda6411eb7f7
udp: fix poll() issue with zero sized packets

Laura tracked poll() [and friends] regression caused by commit
f1b0743d94dc ("udp: remove headers from UDP packets before queueing")

udp_poll() needs to know if there is a valid packet in receive queue,
even if its payload length is 0.

Change first_packet_length() to return an signed int, and use -1
as the indication of an empty queue.

Fixes: f1b0743d94dc ("udp: remove headers from UDP packets before queueing")
Reported-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Tested-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/udp.c