summaryrefslogtreecommitdiffstats
path: root/net/core/sock.c
diff options
context:
space:
mode:
authorPavel Emelyanov2012-04-19 05:39:36 +0200
committerDavid S. Miller2012-04-21 21:52:25 +0200
commit4a17fd5229c1b6066aa478f6b690f8293ce811a1 (patch)
treef6acd00935d2d7a990befb4c77f57fdf39f46689 /net/core/sock.c
parentdrivers/net: decouple ISA and ISA_DMA_API (diff)
downloadkernel-qcow2-linux-4a17fd5229c1b6066aa478f6b690f8293ce811a1.tar.gz
kernel-qcow2-linux-4a17fd5229c1b6066aa478f6b690f8293ce811a1.tar.xz
kernel-qcow2-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/core/sock.c')
-rw-r--r--net/core/sock.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/core/sock.c b/net/core/sock.c
index c7e60eac639b..679c5bbe2bed 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -561,7 +561,7 @@ int sock_setsockopt(struct socket *sock, int level, int optname,
sock_valbool_flag(sk, SOCK_DBG, valbool);
break;
case SO_REUSEADDR:
- sk->sk_reuse = valbool;
+ sk->sk_reuse = (valbool ? SK_CAN_REUSE : SK_NO_REUSE);
break;
case SO_TYPE:
case SO_PROTOCOL: