diff options
author | Pavel Emelyanov <xemul@parallels.com> | 2012-04-19 05:39:36 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-04-21 21:52:25 +0200 |
commit | 4a17fd5229c1b6066aa478f6b690f8293ce811a1 (patch) | |
tree | f6acd00935d2d7a990befb4c77f57fdf39f46689 /net/ipv4/inet_connection_sock.c | |
parent | drivers/net: decouple ISA and ISA_DMA_API (diff) | |
download | linux-4a17fd5229c1b6066aa478f6b690f8293ce811a1.tar.xz linux-4a17fd5229c1b6066aa478f6b690f8293ce811a1.zip |
sock: Introduce named constants for sk_reuse
Name them in a "backward compatible" manner, i.e. reuse or not
are still 1 and 0 respectively. The reuse value of 2 means that
the socket with it will forcibly reuse everyone else's port.
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/inet_connection_sock.c')
-rw-r--r-- | net/ipv4/inet_connection_sock.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c index 7d972f650a61..95e61596e605 100644 --- a/net/ipv4/inet_connection_sock.c +++ b/net/ipv4/inet_connection_sock.c @@ -182,6 +182,9 @@ have_snum: goto tb_not_found; tb_found: if (!hlist_empty(&tb->owners)) { + if (sk->sk_reuse == SK_FORCE_REUSE) + goto success; + if (tb->fastreuse > 0 && sk->sk_reuse && sk->sk_state != TCP_LISTEN && smallest_size == -1) { |