mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
[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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
790a353289
commit
b8e1f9b5c3
4 changed files with 8 additions and 6 deletions
|
|
@ -1365,17 +1365,17 @@ asmlinkage long sys_bind(int fd, struct sockaddr __user *umyaddr, int addrlen)
|
|||
* ready for listening.
|
||||
*/
|
||||
|
||||
int sysctl_somaxconn __read_mostly = SOMAXCONN;
|
||||
|
||||
asmlinkage long sys_listen(int fd, int backlog)
|
||||
{
|
||||
struct socket *sock;
|
||||
int err, fput_needed;
|
||||
int somaxconn;
|
||||
|
||||
sock = sockfd_lookup_light(fd, &err, &fput_needed);
|
||||
if (sock) {
|
||||
if ((unsigned)backlog > sysctl_somaxconn)
|
||||
backlog = sysctl_somaxconn;
|
||||
somaxconn = sock->sk->sk_net->sysctl_somaxconn;
|
||||
if ((unsigned)backlog > somaxconn)
|
||||
backlog = somaxconn;
|
||||
|
||||
err = security_socket_listen(sock, backlog);
|
||||
if (!err)
|
||||
|
|
|
|||
Loading…
Reference in a new issue