[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>
This commit is contained in:

committed by
David S. Miller

parent
c8fecf2242
commit
27ab256864
@@ -207,8 +207,8 @@ out:
|
||||
return err;
|
||||
|
||||
csum_copy_err:
|
||||
UDP6_INC_STATS_USER(UDP_MIB_INERRORS, is_udplite);
|
||||
skb_kill_datagram(sk, skb, flags);
|
||||
if (!skb_kill_datagram(sk, skb, flags))
|
||||
UDP6_INC_STATS_USER(UDP_MIB_INERRORS, is_udplite);
|
||||
|
||||
if (flags & MSG_DONTWAIT)
|
||||
return -EAGAIN;
|
||||
|
Reference in New Issue
Block a user