udp: use limited socket backlog

Make udp adapt to the limited socket backlog change.

Cc: "David S. Miller" <[email protected]>
Cc: Alexey Kuznetsov <[email protected]>
Cc: "Pekka Savola (ipv6)" <[email protected]>
Cc: Patrick McHardy <[email protected]>
Signed-off-by: Zhu Yi <[email protected]>
Acked-by: Eric Dumazet <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
Zhu Yi 2010-03-04 18:01:42 +00:00 • committed by David S. Miller
commit 55349790d7
2 changed files with 22 additions and 12 deletions

View file

@ -1371,8 +1371,10 @@ int udp_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
bh_lock_sock(sk);
if (!sock_owned_by_user(sk))
rc = __udp_queue_rcv_skb(sk, skb);
else
sk_add_backlog(sk, skb);
else if (sk_add_backlog_limited(sk, skb)) {
bh_unlock_sock(sk);
goto drop;
}
bh_unlock_sock(sk);
return rc;