diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2011-12-21 07:11:44 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-12-23 02:15:14 -0500 |
commit | 0fd7bac6b6157eed6cf0cb86a1e88ba29e57c033 (patch) | |
tree | bcc24e9c63587bc1e8e15ad60654de9c6f72883e /net/core | |
parent | a0a129f8b6cff54ab479324a54aefdab5db4f240 (diff) |
net: relax rcvbuf limits
skb->truesize might be big even for a small packet.
Its even bigger after commit 87fb4b7b533 (net: more accurate skb
truesize) and big MTU.
We should allow queueing at least one packet per receiver, even with a
low RCVBUF setting.
Reported-by: Michal Simek <monstr@monstr.eu>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/sock.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/net/core/sock.c b/net/core/sock.c index 4ed7b1d12f5..b23f174ab84 100644 --- a/net/core/sock.c +++ b/net/core/sock.c @@ -288,11 +288,7 @@ int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb) unsigned long flags; struct sk_buff_head *list = &sk->sk_receive_queue; - /* Cast sk->rcvbuf to unsigned... It's pointless, but reduces - number of warnings when compiling with -W --ANK - */ - if (atomic_read(&sk->sk_rmem_alloc) + skb->truesize >= - (unsigned)sk->sk_rcvbuf) { + if (atomic_read(&sk->sk_rmem_alloc) >= sk->sk_rcvbuf) { atomic_inc(&sk->sk_drops); trace_sock_rcvqueue_full(sk, skb); return -ENOMEM; |