[UDP]: Avoid repeated counting of checksum errors due to peeking
authorHerbert Xu <herbert@gondor.apana.org.au>
Wed, 5 Dec 2007 09:51:58 +0000 (01:51 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 28 Jan 2008 22:56:32 +0000 (14:56 -0800)
commit27ab2568649d5ba6c5a20212079b7c4f6da4ca0d
tree19bb85e73d7deb0adf40386af3117c2f397b653d
parentc8fecf2242a0ab7230210665986b8ef915e1ae9e
[UDP]: Avoid repeated counting of checksum errors due to peeking

Currently it is possible for two processes to peek on the same socket
and end up incrementing the error counter twice for the same packet.

This patch fixes it by making skb_kill_datagram return whether it
succeeded in unlinking the packet and only incrementing the counter
if it did.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/skbuff.h
net/core/datagram.c
net/ipv4/udp.c
net/ipv6/udp.c