From: Eric Dumazet Date: Mon, 2 Feb 2009 21:41:57 +0000 (-0800) Subject: udp: increments sk_drops in __udp_queue_rcv_skb() X-Git-Tag: v2.6.28.6~22 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f3c21d60f14e68ef5e3b792e6e1c00a12c94c110;p=thirdparty%2Fkernel%2Fstable.git udp: increments sk_drops in __udp_queue_rcv_skb() [ Upstream commit e408b8dcb5ce42243a902205005208e590f28454 ] Commit 93821778def10ec1e69aa3ac10adee975dad4ff3 (udp: Fix rcv socket locking) accidentally removed sk_drops increments for UDP IPV4 sockets. This field can be used to detect incorrect sizing of socket receive buffers. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 27081d6d2c1a8..77b344b355a42 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c @@ -942,9 +942,11 @@ static int __udp_queue_rcv_skb(struct sock *sk, struct sk_buff *skb) if ((rc = sock_queue_rcv_skb(sk, skb)) < 0) { /* Note that an ENOMEM error is charged twice */ - if (rc == -ENOMEM) + if (rc == -ENOMEM) { UDP_INC_STATS_BH(sock_net(sk), UDP_MIB_RCVBUFERRORS, is_udplite); + atomic_inc(&sk->sk_drops); + } goto drop; }