summaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2012-09-06 01:34:44 +0200
committerDavid S. Miller <davem@davemloft.net>2012-09-07 18:56:00 +0200
commit979402b16cde048ced4839e21cc49e0779352b80 (patch)
treee2cb35c6029a59ba46e24fe933404b0f442ecb73 /net/ipv4
parentnet/mlx4_core: Return the error value in case of command initialization failure (diff)
downloadlinux-979402b16cde048ced4839e21cc49e0779352b80.tar.xz
linux-979402b16cde048ced4839e21cc49e0779352b80.zip
udp: increment UDP_MIB_INERRORS if copy failed
In UDP recvmsg(), we miss an increase of UDP_MIB_INERRORS if the copy of skb to userspace failed for whatever reason. Reported-by: Shawn Bohrer <sbohrer@rgmadvisors.com> Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/udp.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 6f6d1aca3c3d..2814f66dac64 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -1226,6 +1226,11 @@ try_again:
if (unlikely(err)) {
trace_kfree_skb(skb, udp_recvmsg);
+ if (!peeked) {
+ atomic_inc(&sk->sk_drops);
+ UDP_INC_STATS_USER(sock_net(sk),
+ UDP_MIB_INERRORS, is_udplite);
+ }
goto out_free;
}