net: add a limit parameter to sk_add_backlog()
sk_add_backlog() & sk_rcvqueues_full() hard coded sk_rcvbuf as the memory limit. We need to make this limit a parameter for TCP use. No functional change expected in this patch, all callers still using the old sk_rcvbuf limit. Signed-off-by: Eric Dumazet <edumazet@google.com> Cc: Neal Cardwell <ncardwell@google.com> Cc: Tom Herbert <therbert@google.com> Cc: Maciej Żenczykowski <maze@google.com> Cc: Yuchung Cheng <ycheng@google.com> Cc: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi> Cc: Rick Jones <rick.jones2@hp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
b98985073b
commit
f545a38f74
@@ -1479,7 +1479,7 @@ int udp_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
|
||||
goto drop;
|
||||
|
||||
|
||||
if (sk_rcvqueues_full(sk, skb))
|
||||
if (sk_rcvqueues_full(sk, skb, sk->sk_rcvbuf))
|
||||
goto drop;
|
||||
|
||||
rc = 0;
|
||||
@@ -1488,7 +1488,7 @@ 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 if (sk_add_backlog(sk, skb)) {
|
||||
else if (sk_add_backlog(sk, skb, sk->sk_rcvbuf)) {
|
||||
bh_unlock_sock(sk);
|
||||
goto drop;
|
||||
}
|
||||
|
Reference in New Issue
Block a user