#include <linux/types.h> /* pid_t */
#include <linux/compiler.h> /* __user */
-extern int sysctl_somaxconn;
#ifdef CONFIG_PROC_FS
struct seq_file;
extern void socket_seq_show(struct seq_file *seq);
/* core sysctls */
struct ctl_table_header *sysctl_core_hdr;
+ int sysctl_somaxconn;
/* List of all packet sockets. */
rwlock_t packet_sklist_lock;
{
.ctl_name = NET_CORE_SOMAXCONN,
.procname = "somaxconn",
- .data = &sysctl_somaxconn,
+ .data = &init_net.sysctl_somaxconn,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec
{
struct ctl_table *tbl, *tmp;
+ net->sysctl_somaxconn = SOMAXCONN;
+
tbl = net_core_table;
if (net != &init_net) {
tbl = kmemdup(tbl, sizeof(net_core_table), GFP_KERNEL);
* 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)