]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 24 Sep 2016 08:09:25 +0000 (10:09 +0200)
commit80f1325549747a4192233f68fe248ec9da6937aa
treeeb3096be71834d9687fd5ab2bff9b6b4c13483be
parentf7b25cb6de30f283c3d9609fa7342437bd1edf1f
udp: fix poll() issue with zero sized packets

[ Upstream commit e83c6744e81abc93a20d0eb3b7f504a176a6126a ]

Laura tracked poll() [and friends] regression caused by commit
e6afc8ace6dd ("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: e6afc8ace6dd ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/ipv4/udp.c