summaryrefslogtreecommitdiffstats
path: root/net/ipv6/inet6_hashtables.c
diff options
context:
space:
mode:
authorPeter Oskolkov2018-12-12 22:15:35 +0100
committerDavid S. Miller2018-12-15 00:55:20 +0100
commitd9fbc7f6431fc0e5c0ddedf72206d7c5175c5c9a (patch)
tree89f1ed973b4df1a7c87041dc26a3c991f0e699da /net/ipv6/inet6_hashtables.c
parentnet: udp6: prefer listeners bound to an address (diff)
downloadkernel-qcow2-linux-d9fbc7f6431fc0e5c0ddedf72206d7c5175c5c9a.tar.gz
kernel-qcow2-linux-d9fbc7f6431fc0e5c0ddedf72206d7c5175c5c9a.tar.xz
kernel-qcow2-linux-d9fbc7f6431fc0e5c0ddedf72206d7c5175c5c9a.zip
net: tcp: prefer listeners bound to an address
A relatively common use case is to have several IPs configured on a host, and have different listeners for each of them. We would like to add a "catch all" listener on addr_any, to match incoming connections not served by any of the listeners bound to a specific address. However, port-only lookups can match addr_any sockets when sockets listening on specific addresses are present if so_reuseport flag is set. This patch eliminates lookups into port-only hashtable, as lookups by (addr,port) tuple are easily available. In addition, compute_score() is tweaked to _not_ match addr_any sockets to specific addresses, as hash collisions could result in the unwanted behavior described above. Tested: the patch compiles; full test in the last patch in this patchset. Existing reuseport_* selftests also pass. Suggested-by: Eric Dumazet <edumazet@google.com> Signed-off-by: Peter Oskolkov <posk@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/inet6_hashtables.c')
0 files changed, 0 insertions, 0 deletions