Subject: Re: [PATCH 1/8] net: add limit for socket backlog

From: Zhu Yi <[email-masked]>
Date: Wed, 03 Mar 2010 16:14:13 +0800

On Wed, 2010-03-03 at 16:02 +0800, Eric Dumazet wrote:
> > sk->sk_rcvbuf can be adjusted by setsockopt from user at run time.
> The
> > minimum allowed value is 256. I'm afraid this will break most
> protocols.
> 
> I see, then maybe use some offset in your test, to allow some extra
> space.
> 
> #define MINBACKLOG 2048
> 
> if (sk->sk_backlog.len >= (sk->sk_rcvbuf << 1) + MINBACKLOG)
>         return -ENOBUFS;

I want to provide a method for protocols to set its sock backlog limit.
For example, the sctp_rmem is 373500 (sysctl_sctp_rmem[1]) which is
larger than (sysctl_rmem_default << 1). But I'm not very sure about the
actual required size. So I didn't make it in the sctp patch. What do you
think?

Thanks,
-yi