summaryrefslogtreecommitdiffstats
path: root/net/core/sock.c
diff options
context:
space:
mode:
authorTom Herbert <therbert@google.com>2013-01-22 09:49:50 +0000
committerDavid S. Miller <davem@davemloft.net>2013-01-23 13:44:00 -0500
commit055dc21a1d1d219608cd4baac7d0683fb2cbbe8a (patch)
tree23e66bde4668a92585f62d15c759c53fd4d0892f /net/core/sock.c
parent4a633a602c26497b8285a202830829d3be007c7b (diff)
soreuseport: infrastructure
Definitions and macros for implementing soreusport. Signed-off-by: Tom Herbert <therbert@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/sock.c')
-rw-r--r--net/core/sock.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/net/core/sock.c b/net/core/sock.c
index 8258fb741e9..235fb89e897 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -665,6 +665,9 @@ int sock_setsockopt(struct socket *sock, int level, int optname,
case SO_REUSEADDR:
sk->sk_reuse = (valbool ? SK_CAN_REUSE : SK_NO_REUSE);
break;
+ case SO_REUSEPORT:
+ sk->sk_reuseport = valbool;
+ break;
case SO_TYPE:
case SO_PROTOCOL:
case SO_DOMAIN:
@@ -972,6 +975,10 @@ int sock_getsockopt(struct socket *sock, int level, int optname,
v.val = sk->sk_reuse;
break;
+ case SO_REUSEPORT:
+ v.val = sk->sk_reuseport;
+ break;
+
case SO_KEEPALIVE:
v.val = sock_flag(sk, SOCK_KEEPOPEN);
break;