]> err.no Git - linux-2.6/blobdiff - net/core/sysctl_net_core.c
Merge branch 'for-2.6.25' of master.kernel.org:/pub/scm/linux/kernel/git/jwboyer...
[linux-2.6] / net / core / sysctl_net_core.c
index 57a7eadb8551ca83a7c98878e269c6fc69c56156..130338f83ae5c7be54b7f848d755931f65b4bc0e 100644 (file)
@@ -127,7 +127,7 @@ static struct ctl_table net_core_table[] = {
        {
                .ctl_name       = NET_CORE_SOMAXCONN,
                .procname       = "somaxconn",
-               .data           = &sysctl_somaxconn,
+               .data           = &init_net.sysctl_somaxconn,
                .maxlen         = sizeof(int),
                .mode           = 0644,
                .proc_handler   = &proc_dointvec
@@ -161,14 +161,21 @@ static __net_init int sysctl_core_net_init(struct net *net)
 {
        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);
                if (tbl == NULL)
                        goto err_dup;
 
-               for (tmp = tbl; tmp->procname; tmp++)
-                       tmp->mode &= ~0222;
+               for (tmp = tbl; tmp->procname; tmp++) {
+                       if (tmp->data >= (void *)&init_net &&
+                                       tmp->data < (void *)(&init_net + 1))
+                               tmp->data += (char *)net - (char *)&init_net;
+                       else
+                               tmp->mode &= ~0222;
+               }
        }
 
        net->sysctl_core_hdr = register_net_sysctl_table(net,