diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2005-12-14 02:16:37 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-01-03 16:10:41 -0500 |
commit | 3305b80c214c642b89cd5c21af83bc91ec13f8bd (patch) | |
tree | 909ed75c500d0ac422738781f84a819c933703c5 /include/linux | |
parent | 57cca05af1e20fdc65b55be52c042c234f86c866 (diff) |
[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>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/skbuff.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 8c5d6001a923..97f6580ce039 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -1239,6 +1239,8 @@ extern int skb_copy_and_csum_datagram_iovec(struct sk_buff *skb, | |||
1239 | int hlen, | 1239 | int hlen, |
1240 | struct iovec *iov); | 1240 | struct iovec *iov); |
1241 | extern void skb_free_datagram(struct sock *sk, struct sk_buff *skb); | 1241 | extern void skb_free_datagram(struct sock *sk, struct sk_buff *skb); |
1242 | extern void skb_kill_datagram(struct sock *sk, struct sk_buff *skb, | ||
1243 | unsigned int flags); | ||
1242 | extern unsigned int skb_checksum(const struct sk_buff *skb, int offset, | 1244 | extern unsigned int skb_checksum(const struct sk_buff *skb, int offset, |
1243 | int len, unsigned int csum); | 1245 | int len, unsigned int csum); |
1244 | extern int skb_copy_bits(const struct sk_buff *skb, int offset, | 1246 | extern int skb_copy_bits(const struct sk_buff *skb, int offset, |