diff options
author | Otto Hollmann <otto.hollmann@suse.com> | 2021-04-01 18:57:05 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-04-02 01:58:36 +0300 |
commit | a7a80b17c750c0f4b2c15cc61be5ff7c1d29f8d6 (patch) | |
tree | 85a89221458ff8b2a25853552c23e4973ccdf3b8 /drivers/net/phy | |
parent | e228c0de904c8c5eb732dafb49a8446c1794dc72 (diff) | |
download | linux-a7a80b17c750c0f4b2c15cc61be5ff7c1d29f8d6.tar.xz |
net: document a side effect of ip_local_reserved_ports
If there is overlapp between ip_local_port_range and ip_local_reserved_ports with a huge reserved block, it will affect probability of selecting ephemeral ports, see file net/ipv4/inet_hashtables.c:723
int __inet_hash_connect(
...
for (i = 0; i < remaining; i += 2, port += 2) {
if (unlikely(port >= high))
port -= remaining;
if (inet_is_local_reserved_port(net, port))
continue;
E.g. if there is reserved block of 10000 ports, two ports right after this block will be 5000 more likely selected than others.
If this was intended, we can/should add note into documentation as proposed in this commit, otherwise we should think about different solution. One option could be mapping table of continuous port ranges. Second option could be letting user to modify step (port+=2) in above loop, e.g. using new sysctl parameter.
Signed-off-by: Otto Hollmann <otto.hollmann@suse.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/phy')
0 files changed, 0 insertions, 0 deletions