diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2009-10-14 20:40:11 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-10-14 20:40:11 -0700 |
commit | 766e9037cc139ee25ed93ee5ad11e1450c4b99f6 (patch) | |
tree | 062702b8edf203a6e91d1e6853ab24989617d758 /net/ipv6 | |
parent | 48bccd25df71f4f8177cb800f4b288222eb57761 (diff) |
net: sk_drops consolidation
sock_queue_rcv_skb() can update sk_drops itself, removing need for
callers to take care of it. This is more consistent since
sock_queue_rcv_skb() also reads sk_drops when queueing a skb.
This adds sk_drops managment to many protocols that not cared yet.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/raw.c | 3 | ||||
-rw-r--r-- | net/ipv6/udp.c | 6 |
2 files changed, 3 insertions, 6 deletions
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c index d8375bc7f2d..fd737efed96 100644 --- a/net/ipv6/raw.c +++ b/net/ipv6/raw.c @@ -381,8 +381,7 @@ static inline int rawv6_rcv_skb(struct sock * sk, struct sk_buff * skb) } /* Charge it to the socket. */ - if (sock_queue_rcv_skb(sk,skb)<0) { - atomic_inc(&sk->sk_drops); + if (sock_queue_rcv_skb(sk, skb) < 0) { kfree_skb(skb); return NET_RX_DROP; } diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c index 1f8e2afa449..b86425b7ea2 100644 --- a/net/ipv6/udp.c +++ b/net/ipv6/udp.c @@ -385,13 +385,11 @@ int udpv6_queue_rcv_skb(struct sock * sk, struct sk_buff *skb) goto drop; } - if ((rc = sock_queue_rcv_skb(sk,skb)) < 0) { + if ((rc = sock_queue_rcv_skb(sk, skb)) < 0) { /* Note that an ENOMEM error is charged twice */ - if (rc == -ENOMEM) { + if (rc == -ENOMEM) UDP6_INC_STATS_BH(sock_net(sk), UDP_MIB_RCVBUFERRORS, is_udplite); - atomic_inc(&sk->sk_drops); - } goto drop; } |