diff options
author | David S. Miller <davem@davemloft.net> | 2020-03-12 12:08:10 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-03-12 12:08:10 -0700 |
commit | 93e616131a3825189570524d4792b5223bf1d68c (patch) | |
tree | 46fadd2182ac940b8f992ca32d32eb017eca43b4 /net/ipv4/sysctl_net_ipv4.c | |
parent | af91fd7e17f12119763b95ccf526bce4b0693144 (diff) | |
parent | 7f204a7de8b08542aca3c1daa96ed20e1177ba87 (diff) |
Merge branch 'bind_addr_zero'
Kuniyuki Iwashima says:
====================
Improve bind(addr, 0) behaviour.
Currently we fail to bind sockets to ephemeral ports when all of the ports
are exhausted even if all sockets have SO_REUSEADDR enabled. In this case,
we still have a chance to connect to the different remote hosts.
These patches add net.ipv4.ip_autobind_reuse option and fix the behaviour
to fully utilize all space of the local (addr, port) tuples.
Changes in v5:
- Add more description to documents.
- Fix sysctl option to use proc_dointvec_minmax.
- Remove the Fixes: tag and squash two commits.
Changes in v4:
- Add net.ipv4.ip_autobind_reuse option to not change the current behaviour.
- Modify .gitignore for test.
https://lore.kernel.org/netdev/20200308181615.90135-1-kuniyu@amazon.co.jp/
Changes in v3:
- Change the title and write more specific description of the 3rd patch.
- Add a test in tools/testing/selftests/net/ as the 4th patch.
https://lore.kernel.org/netdev/20200229113554.78338-1-kuniyu@amazon.co.jp/
Changes in v2:
- Change the description of the 2nd patch ('localhost' -> 'address').
- Correct the description and the if statement of the 3rd patch.
https://lore.kernel.org/netdev/20200226074631.67688-1-kuniyu@amazon.co.jp/
v1 with tests:
https://lore.kernel.org/netdev/20200220152020.13056-1-kuniyu@amazon.co.jp/
====================
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/sysctl_net_ipv4.c')
-rw-r--r-- | net/ipv4/sysctl_net_ipv4.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c index d9531b4b33f2..81b267e990a1 100644 --- a/net/ipv4/sysctl_net_ipv4.c +++ b/net/ipv4/sysctl_net_ipv4.c @@ -764,6 +764,15 @@ static struct ctl_table ipv4_net_table[] = { .proc_handler = proc_dointvec }, { + .procname = "ip_autobind_reuse", + .data = &init_net.ipv4.sysctl_ip_autobind_reuse, + .maxlen = sizeof(int), + .mode = 0644, + .proc_handler = proc_dointvec_minmax, + .extra1 = SYSCTL_ZERO, + .extra2 = SYSCTL_ONE, + }, + { .procname = "fwmark_reflect", .data = &init_net.ipv4.sysctl_fwmark_reflect, .maxlen = sizeof(int), |