]> git.baikalelectronics.ru Git - kernel.git/commit
[IP]: Simplify and consolidate MSG_PEEK error handling
authorHerbert Xu <herbert@gondor.apana.org.au>
Wed, 14 Dec 2005 07:16:37 +0000 (23:16 -0800)
committerDavid S. Miller <davem@sunset.davemloft.net>
Tue, 3 Jan 2006 21:10:41 +0000 (13:10 -0800)
commitd5b8e1757fabcebae43483d408dca4c43bfc528c
tree909ed75c500d0ac422738781f84a819c933703c5
parent04d194c8c18a0d5daf56e3226077d603ba92d2a9
[IP]: Simplify and consolidate MSG_PEEK error handling

When a packet is obtained from skb_recv_datagram with MSG_PEEK enabled
it is left on the socket receive queue.  This means that when we detect
a checksum error we have to be careful when trying to free the packet
as someone could have dequeued it in the time being.

Currently this delicate logic is duplicated three times between UDPv4,
UDPv6 and RAWv6.  This patch moves them into a one place and simplifies
the code somewhat.

This is based on a suggestion by Eric Dumazet.

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/raw.c
net/ipv6/udp.c