diff options
author | Ingo Molnar <mingo@elte.hu> | 2010-03-22 18:46:57 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-03-22 18:47:01 +0100 |
commit | d2f1e15b661e71fd52111f51c99a6ce41384e9ef (patch) | |
tree | 8731e7e772e6f825ebbc6eef7681bc46302149bd /net/ipv6/udp.c | |
parent | 40b7e05e17eef31ff30fe08dfc2424ef653a792c (diff) | |
parent | 220bf991b0366cc50a94feede3d7341fa5710ee4 (diff) | |
download | op-kernel-dev-d2f1e15b661e71fd52111f51c99a6ce41384e9ef.zip op-kernel-dev-d2f1e15b661e71fd52111f51c99a6ce41384e9ef.tar.gz |
Merge commit 'v2.6.34-rc2' into perf/core
Merge reason: Pick up latest perf fixes from upstream.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'net/ipv6/udp.c')
-rw-r--r-- | net/ipv6/udp.c | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c index 52b8347..3c0c9c7 100644 --- a/net/ipv6/udp.c +++ b/net/ipv6/udp.c @@ -583,16 +583,20 @@ static void flush_stack(struct sock **stack, unsigned int count, bh_lock_sock(sk); if (!sock_owned_by_user(sk)) udpv6_queue_rcv_skb(sk, skb1); - else - sk_add_backlog(sk, skb1); + else if (sk_add_backlog(sk, skb1)) { + kfree_skb(skb1); + bh_unlock_sock(sk); + goto drop; + } bh_unlock_sock(sk); - } else { - atomic_inc(&sk->sk_drops); - UDP6_INC_STATS_BH(sock_net(sk), - UDP_MIB_RCVBUFERRORS, IS_UDPLITE(sk)); - UDP6_INC_STATS_BH(sock_net(sk), - UDP_MIB_INERRORS, IS_UDPLITE(sk)); + continue; } +drop: + atomic_inc(&sk->sk_drops); + UDP6_INC_STATS_BH(sock_net(sk), + UDP_MIB_RCVBUFERRORS, IS_UDPLITE(sk)); + UDP6_INC_STATS_BH(sock_net(sk), + UDP_MIB_INERRORS, IS_UDPLITE(sk)); } } /* @@ -754,8 +758,12 @@ int __udp6_lib_rcv(struct sk_buff *skb, struct udp_table *udptable, bh_lock_sock(sk); if (!sock_owned_by_user(sk)) udpv6_queue_rcv_skb(sk, skb); - else - sk_add_backlog(sk, skb); + else if (sk_add_backlog(sk, skb)) { + atomic_inc(&sk->sk_drops); + bh_unlock_sock(sk); + sock_put(sk); + goto discard; + } bh_unlock_sock(sk); sock_put(sk); return 0; |