From: David Miller <davem@davemloft.net>
To: eric.dumazet@gmail.com
Cc: ncardwell@google.com, netdev@vger.kernel.org,
mtk.manpages@gmail.com, maze@google.com
Subject: Re: [PATCH v2 net-next] inet: add IP_BIND_ADDRESS_NO_PORT to overcome bind(0) limitations
Date: Sat, 06 Jun 2015 23:57:33 -0700 (PDT) [thread overview]
Message-ID: <20150606.235733.812264566485784834.davem@davemloft.net> (raw)
In-Reply-To: <1433650677.29864.26.camel@edumazet-glaptop2.roam.corp.google.com>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Sat, 06 Jun 2015 21:17:57 -0700
> From: Eric Dumazet <edumazet@google.com>
>
> When an application needs to force a source IP on an active TCP socket
> it has to use bind(IP, port=x).
>
> As most applications do not want to deal with already used ports, x is
> often set to 0, meaning the kernel is in charge to find an available
> port.
> But kernel does not know yet if this socket is going to be a listener or
> be connected.
> It has very limited choices (no full knowledge of final 4-tuple for a
> connect())
>
> With limited ephemeral port range (about 32K ports), it is very easy to
> fill the space.
>
> This patch adds a new SOL_IP socket option, asking kernel to ignore
> the 0 port provided by application in bind(IP, port=0) and only
> remember the given IP address.
>
> The port will be automatically chosen at connect() time, in a way
> that allows sharing a source port as long as the 4-tuples are unique.
>
> This new feature is available for both IPv4 and IPv6 (Thanks Neal)
>
> Tested:
...
> Signed-off-by: Eric Dumazet <edumazet@google.com>
Looks good, applied, thanks Eric.
prev parent reply other threads:[~2015-06-07 6:57 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-06 15:53 [PATCH net-next] inet: add IP_BIND_ADDRESS_NO_PORT to overcome bind(0) limitations Eric Dumazet
2015-06-06 16:38 ` Maciej Żenczykowski
2015-06-06 17:39 ` Eric Dumazet
2015-06-06 19:40 ` David Miller
2015-06-07 2:30 ` Neal Cardwell
2015-06-07 3:08 ` Eric Dumazet
2015-06-07 4:17 ` [PATCH v2 " Eric Dumazet
2015-06-07 6:57 ` David Miller [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=20150606.235733.812264566485784834.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=maze@google.com \
--cc=mtk.manpages@gmail.com \
--cc=ncardwell@google.com \
--cc=netdev@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).