diff options
author | Pavel Emelyanov <xemul@openvz.org> | 2007-12-08 03:12:33 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 17:56:57 -0500 |
commit | b8e1f9b5c37e77cc8f978a58859b35fe5edd5542 (patch) | |
tree | 3c39da61f10eeb8b8e200ec68770128f1b57f25d /net/socket.c | |
parent | 790a35328991b01181ff5624bdb084053b6fac54 (diff) |
[NET] sysctl: make sysctl_somaxconn per-namespace
Just move the variable on the struct net and adjust
its usage.
Others sysctls from sys.net.core table are more
difficult to virtualize (i.e. make them per-namespace),
but I'll look at them as well a bit later.
Signed-off-by: Pavel Emelyanov <xemul@oenvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/socket.c')
-rw-r--r-- | net/socket.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/net/socket.c b/net/socket.c index 9ebca5c695d..7651de00850 100644 --- a/net/socket.c +++ b/net/socket.c | |||
@@ -1365,17 +1365,17 @@ asmlinkage long sys_bind(int fd, struct sockaddr __user *umyaddr, int addrlen) | |||
1365 | * ready for listening. | 1365 | * ready for listening. |
1366 | */ | 1366 | */ |
1367 | 1367 | ||
1368 | int sysctl_somaxconn __read_mostly = SOMAXCONN; | ||
1369 | |||
1370 | asmlinkage long sys_listen(int fd, int backlog) | 1368 | asmlinkage long sys_listen(int fd, int backlog) |
1371 | { | 1369 | { |
1372 | struct socket *sock; | 1370 | struct socket *sock; |
1373 | int err, fput_needed; | 1371 | int err, fput_needed; |
1372 | int somaxconn; | ||
1374 | 1373 | ||
1375 | sock = sockfd_lookup_light(fd, &err, &fput_needed); | 1374 | sock = sockfd_lookup_light(fd, &err, &fput_needed); |
1376 | if (sock) { | 1375 | if (sock) { |
1377 | if ((unsigned)backlog > sysctl_somaxconn) | 1376 | somaxconn = sock->sk->sk_net->sysctl_somaxconn; |
1378 | backlog = sysctl_somaxconn; | 1377 | if ((unsigned)backlog > somaxconn) |
1378 | backlog = somaxconn; | ||
1379 | 1379 | ||
1380 | err = security_socket_listen(sock, backlog); | 1380 | err = security_socket_listen(sock, backlog); |
1381 | if (!err) | 1381 | if (!err) |