All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rick Jones <rick.jones2@hp.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Changli Gao <xiaosuo@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	netdev@vger.kernel.org
Subject: Re: [PATCH v2] net: Check the argument for listen(2)
Date: Fri, 28 Jun 2013 11:01:28 -0700	[thread overview]
Message-ID: <51CDCF78.90003@hp.com> (raw)
In-Reply-To: <1372437203.3301.288.camel@edumazet-glaptop>

On 06/28/2013 09:33 AM, Eric Dumazet wrote:

>
> Well, there is still this possible regression for old applications.
>
> Just use u32 fields instead of u16 ?

FWIW, the manpage for listen() gives the backlog parameter as an "int"

SYNOPSIS
        #include <sys/types.h>          /* See NOTES */
        #include <sys/socket.h>

        int listen(int sockfd, int backlog);

and mentions no explicit limit beyond 2.4.35, only interaction with the 
likes of /proc/sys/net/core/somaxconn.

And sys/socket.h has:

/* Prepare to accept connections on socket FD.
    N connection requests will be queued before further requests are 
refused.
    Returns 0 on success, -1 for errors.  */
extern int listen (int __fd, int __n) __THROW;

Not sure if it is considered "sane" to try to set the backlog to a 
negative value of course...

rick jones

      parent reply	other threads:[~2013-06-28 18:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-28 16:22 [PATCH v2] net: Check the argument for listen(2) Changli Gao
2013-06-28 16:33 ` Eric Dumazet
2013-06-28 16:47   ` Changli Gao
2013-06-28 18:01   ` Rick Jones [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51CDCF78.90003@hp.com \
    --to=rick.jones2@hp.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=xiaosuo@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.