aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/udp.c
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2007-12-05 04:51:58 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 17:56:32 -0500
commit27ab2568649d5ba6c5a20212079b7c4f6da4ca0d (patch)
tree19bb85e73d7deb0adf40386af3117c2f397b653d /net/ipv6/udp.c
parentc8fecf2242a0ab7230210665986b8ef915e1ae9e (diff)
[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>
Diffstat (limited to 'net/ipv6/udp.c')
-rw-r--r--net/ipv6/udp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index 77ab31b99232..87bccec9882a 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -207,8 +207,8 @@ out:
207 return err; 207 return err;
208 208
209csum_copy_err: 209csum_copy_err:
210 UDP6_INC_STATS_USER(UDP_MIB_INERRORS, is_udplite); 210 if (!skb_kill_datagram(sk, skb, flags))
211 skb_kill_datagram(sk, skb, flags); 211 UDP6_INC_STATS_USER(UDP_MIB_INERRORS, is_udplite);
212 212
213 if (flags & MSG_DONTWAIT) 213 if (flags & MSG_DONTWAIT)
214 return -EAGAIN; 214 return -EAGAIN;