Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 27922b4260f65d317aabda37e42bbbff > files > 2560

kernel-2.6.18-238.el5.src.rpm

From: Neil Horman <nhorman@redhat.com>
Date: Fri, 6 Aug 2010 16:31:16 -0400
Subject: [net] don't double count UDP_INERRORS
Message-id: <20100806163116.GF19118@hmsreliant.think-freely.org>
Patchwork-id: 27455
O-Subject: [RHEL5.6 PATCH] don't double count UDP_INERRORS (bz 618818)
Bugzilla: 618818
RH-Acked-by: David S. Miller <davem@redhat.com>
RH-Acked-by: Amerigo Wang <amwang@redhat.com>

Hey-
	We had a customer note that we're double counting UDP_INERRORS twice in
the case of ENOMEM.  Upstream did it this way for awhile but then separated out
the code to two separate counters.  I don't think we can backport the new
counter without messing with ABI, and, despite the note in the function, I can't
for the life of me see why we would ever doulbe count the ENOMEM error case.  So
lets remove it.  Fixes bz 618818

Neil

Signed-off-by: Jarod Wilson <jarod@redhat.com>

diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index b58f579..bebc101 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -1018,18 +1018,12 @@ static int __udp_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
 	int rc;
 
 	if ((rc = sock_queue_rcv_skb(sk, skb)) < 0) {
-		/* Note that an ENOMEM error is charged twice */
-		if (rc == -ENOMEM)
-			UDP_INC_STATS_BH(UDP_MIB_INERRORS);
-		goto drop;
+		UDP_INC_STATS_BH(UDP_MIB_INERRORS);
+		kfree_skb(skb);
+		return -1;
 	}
 
 	return 0;
-
-drop:
-	UDP_INC_STATS_BH(UDP_MIB_INERRORS);
-	kfree_skb(skb);
-	return -1;
 }
 
 /* returns: