net: Move all of the network sysctls without a namespace into init_net.
authorEric W. Biederman <ebiederm@xmission.com>
Thu, 19 Apr 2012 13:24:33 +0000 (13:24 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sat, 21 Apr 2012 01:21:17 +0000 (21:21 -0400)
This makes it clearer which sysctls are relative to your current network
namespace.

This makes it a little less error prone by not exposing sysctls for the
initial network namespace in other namespaces.

This is the same way we handle all of our other network interfaces to
userspace and I can't honestly remember why we didn't do this for
sysctls right from the start.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
31 files changed:
drivers/infiniband/core/ucma.c
net/802/tr.c
net/appletalk/sysctl_net_atalk.c
net/ax25/sysctl_net_ax25.c
net/bridge/br_netfilter.c
net/core/neighbour.c
net/core/sysctl_net_core.c
net/dccp/sysctl.c
net/decnet/dn_dev.c
net/decnet/sysctl_net_decnet.c
net/ipv4/netfilter/ip_queue.c
net/ipv4/route.c
net/ipv4/sysctl_net_ipv4.c
net/ipv6/netfilter/ip6_queue.c
net/ipv6/netfilter/nf_conntrack_reasm.c
net/ipv6/sysctl_net_ipv6.c
net/ipx/sysctl_net_ipx.c
net/irda/irsysctl.c
net/llc/sysctl_net_llc.c
net/netfilter/nf_conntrack_proto.c
net/netfilter/nf_conntrack_standalone.c
net/netfilter/nf_log.c
net/netrom/sysctl_net_netrom.c
net/phonet/sysctl.c
net/rds/ib_sysctl.c
net/rds/iw_sysctl.c
net/rds/sysctl.c
net/rose/sysctl_net_rose.c
net/sctp/sysctl.c
net/unix/sysctl_net_unix.c
net/x25/sysctl_net_x25.c

index 5861cdb22b7c51c875720bd84cd1083d9133e2d0..9f3e2beec91d8ca59bf1d2af1e7c30c836c2dc29 100644 (file)
@@ -1392,7 +1392,7 @@ static int __init ucma_init(void)
                goto err1;
        }
 
-       ucma_ctl_table_hdr = register_sysctl_paths(ucma_ctl_path, ucma_ctl_table);
+       ucma_ctl_table_hdr = register_net_sysctl_table(&init_net, ucma_ctl_path, ucma_ctl_table);
        if (!ucma_ctl_table_hdr) {
                printk(KERN_ERR "rdma_ucm: couldn't register sysctl paths\n");
                ret = -ENOMEM;
@@ -1408,7 +1408,7 @@ err1:
 
 static void __exit ucma_cleanup(void)
 {
-       unregister_sysctl_table(ucma_ctl_table_hdr);
+       unregister_net_sysctl_table(ucma_ctl_table_hdr);
        device_remove_file(ucma_misc.this_device, &dev_attr_abi_version);
        misc_deregister(&ucma_misc);
        idr_destroy(&ctx_idr);
index e65f0b8de0c46b5056ac975ed780b2b093dbd675..103e0201b0abe4fbf331ca4337bf6add48072e3e 100644 (file)
@@ -662,7 +662,7 @@ static int __init rif_init(void)
        setup_timer(&rif_timer, rif_check_expire, 0);
        add_timer(&rif_timer);
 #ifdef CONFIG_SYSCTL
-       register_sysctl_paths(tr_path, tr_table);
+       register_net_sysctl_table(&init_net, tr_path, tr_table);
 #endif
        proc_net_fops_create(&init_net, "tr_rif", S_IRUGO, &rif_seq_fops);
        return 0;
index 04e9c0da7aa95e5936d09c026c0f03a0bb4cb060..5edce8f70cb79180019afe308d83637276c59192 100644 (file)
@@ -52,10 +52,10 @@ static struct ctl_table_header *atalk_table_header;
 
 void atalk_register_sysctl(void)
 {
-       atalk_table_header = register_sysctl_paths(atalk_path, atalk_table);
+       atalk_table_header = register_net_sysctl_table(&init_net, atalk_path, atalk_table);
 }
 
 void atalk_unregister_sysctl(void)
 {
-       unregister_sysctl_table(atalk_table_header);
+       unregister_net_sysctl_table(atalk_table_header);
 }
index ebe0ef3f1d839c1715dcf3784e8d9148b62820e2..7ba381b6f074ac1317a777eff0c04a90989cab7b 100644 (file)
@@ -196,13 +196,13 @@ void ax25_register_sysctl(void)
        }
        spin_unlock_bh(&ax25_dev_lock);
 
-       ax25_table_header = register_sysctl_paths(ax25_path, ax25_table);
+       ax25_table_header = register_net_sysctl_table(&init_net, ax25_path, ax25_table);
 }
 
 void ax25_unregister_sysctl(void)
 {
        ctl_table *p;
-       unregister_sysctl_table(ax25_table_header);
+       unregister_net_sysctl_table(ax25_table_header);
 
        for (p = ax25_table; p->procname; p++)
                kfree(p->child);
index dec4f3817133c879b524a65f0919b5dabcff46ea..4f4c4a619f680dbbdad4b8691bf4a856e693bab2 100644 (file)
@@ -1030,7 +1030,7 @@ int __init br_netfilter_init(void)
                return ret;
        }
 #ifdef CONFIG_SYSCTL
-       brnf_sysctl_header = register_sysctl_paths(brnf_path, brnf_table);
+       brnf_sysctl_header = register_net_sysctl_table(&init_net, brnf_path, brnf_table);
        if (brnf_sysctl_header == NULL) {
                printk(KERN_WARNING
                       "br_netfilter: can't register to sysctl.\n");
@@ -1047,7 +1047,7 @@ void br_netfilter_fini(void)
 {
        nf_unregister_hooks(br_nf_ops, ARRAY_SIZE(br_nf_ops));
 #ifdef CONFIG_SYSCTL
-       unregister_sysctl_table(brnf_sysctl_header);
+       unregister_net_sysctl_table(brnf_sysctl_header);
 #endif
        dst_entries_destroy(&fake_dst_ops);
 }
index 434eed8c618574f127d7dd977c820049f4d01f55..0c2df3d3cfbf4e40c468c796f11d1e8ca3d76619 100644 (file)
@@ -3017,7 +3017,7 @@ void neigh_sysctl_unregister(struct neigh_parms *p)
        if (p->sysctl_table) {
                struct neigh_sysctl_table *t = p->sysctl_table;
                p->sysctl_table = NULL;
-               unregister_sysctl_table(t->sysctl_header);
+               unregister_net_sysctl_table(t->sysctl_header);
                kfree(t->dev_name);
                kfree(t);
        }
index 8f67633b484e5059660ba77ab77ce29934b43c61..7d3772e0d150511070d89f81a7097e37d1c697b7 100644 (file)
@@ -257,7 +257,7 @@ static __init int sysctl_core_init(void)
 {
        static struct ctl_table empty[1];
 
-       kmemleak_not_leak(register_sysctl_paths(net_core_path, empty));
+       kmemleak_not_leak(register_net_sysctl_table(&init_net, net_core_path, empty));
        register_net_sysctl(&init_net, "net/core", net_core_table);
        return register_pernet_subsys(&sysctl_core_ops);
 }
index 42348824ee318c31f4a3ae901d1d5e57aa1f8c17..329e1390c26dfd1514edb3bc2d2835e7a6bdf395 100644 (file)
@@ -109,7 +109,7 @@ static struct ctl_table_header *dccp_table_header;
 
 int __init dccp_sysctl_init(void)
 {
-       dccp_table_header = register_sysctl_paths(dccp_path,
+       dccp_table_header = register_net_sysctl_table(&init_net, dccp_path,
                        dccp_default_table);
 
        return dccp_table_header != NULL ? 0 : -ENOMEM;
@@ -118,7 +118,7 @@ int __init dccp_sysctl_init(void)
 void dccp_sysctl_exit(void)
 {
        if (dccp_table_header != NULL) {
-               unregister_sysctl_table(dccp_table_header);
+               unregister_net_sysctl_table(dccp_table_header);
                dccp_table_header = NULL;
        }
 }
index a4aecb09d12aac0717b934b486a85c77412635e5..ce8a18471845e16f6fa7cbcd0fc6074dda31f366 100644 (file)
@@ -236,7 +236,7 @@ static void dn_dev_sysctl_register(struct net_device *dev, struct dn_dev_parms *
 
        t->dn_dev_vars[0].extra1 = (void *)dev;
 
-       t->sysctl_header = register_sysctl_paths(dn_ctl_path, t->dn_dev_vars);
+       t->sysctl_header = register_net_sysctl_table(&init_net, dn_ctl_path, t->dn_dev_vars);
        if (t->sysctl_header == NULL)
                kfree(t);
        else
@@ -248,7 +248,7 @@ static void dn_dev_sysctl_unregister(struct dn_dev_parms *parms)
        if (parms->sysctl) {
                struct dn_dev_sysctl_table *t = parms->sysctl;
                parms->sysctl = NULL;
-               unregister_sysctl_table(t->sysctl_header);
+               unregister_net_sysctl_table(t->sysctl_header);
                kfree(t);
        }
 }
index 02e75d11cfbb2e73a1a473e536bfa81e1429c92e..4380b8edea7228006ba0d30ebe1a239942f4631b 100644 (file)
@@ -359,12 +359,12 @@ static struct ctl_path dn_path[] = {
 
 void dn_register_sysctl(void)
 {
-       dn_table_header = register_sysctl_paths(dn_path, dn_table);
+       dn_table_header = register_net_sysctl_table(&init_net, dn_path, dn_table);
 }
 
 void dn_unregister_sysctl(void)
 {
-       unregister_sysctl_table(dn_table_header);
+       unregister_net_sysctl_table(dn_table_header);
 }
 
 #else  /* CONFIG_SYSCTL */
index 94d45e1f8882558ae45575ee7723f5aacd6022d9..766485d7d099c70ad7a720721343b14364a011ff 100644 (file)
@@ -586,7 +586,7 @@ static int __init ip_queue_init(void)
 #endif
        register_netdevice_notifier(&ipq_dev_notifier);
 #ifdef CONFIG_SYSCTL
-       ipq_sysctl_header = register_sysctl_paths(net_ipv4_ctl_path, ipq_table);
+       ipq_sysctl_header = register_net_sysctl_table(&init_net, net_ipv4_ctl_path, ipq_table);
 #endif
        status = nf_register_queue_handler(NFPROTO_IPV4, &nfqh);
        if (status < 0) {
@@ -597,7 +597,7 @@ static int __init ip_queue_init(void)
 
 cleanup_sysctl:
 #ifdef CONFIG_SYSCTL
-       unregister_sysctl_table(ipq_sysctl_header);
+       unregister_net_sysctl_table(ipq_sysctl_header);
 #endif
        unregister_netdevice_notifier(&ipq_dev_notifier);
        proc_net_remove(&init_net, IPQ_PROC_FS_NAME);
@@ -618,7 +618,7 @@ static void __exit ip_queue_fini(void)
        ipq_flush(NULL, 0);
 
 #ifdef CONFIG_SYSCTL
-       unregister_sysctl_table(ipq_sysctl_header);
+       unregister_net_sysctl_table(ipq_sysctl_header);
 #endif
        unregister_netdevice_notifier(&ipq_dev_notifier);
        proc_net_remove(&init_net, IPQ_PROC_FS_NAME);
index a1c115d750e99d5a0da206049a1416946610249d..86866a4b537f318ec9c22b7709045fee2bba4b7b 100644 (file)
@@ -3515,6 +3515,6 @@ int __init ip_rt_init(void)
  */
 void __init ip_static_sysctl_init(void)
 {
-       kmemleak_not_leak(register_sysctl_paths(ipv4_path, ipv4_skeleton));
+       kmemleak_not_leak(register_net_sysctl_table(&init_net, ipv4_path, ipv4_skeleton));
 }
 #endif
index 34a628625d9cc84abf6e033aaf0a414ea0ecf9d7..e7a6fa3d70bb5d295b6be1e0794e7d7c9681af14 100644 (file)
@@ -857,12 +857,12 @@ static __init int sysctl_ipv4_init(void)
        if (!i->procname)
                return -EINVAL;
 
-       hdr = register_sysctl_paths(net_ipv4_ctl_path, ipv4_table);
+       hdr = register_net_sysctl_table(&init_net, net_ipv4_ctl_path, ipv4_table);
        if (hdr == NULL)
                return -ENOMEM;
 
        if (register_pernet_subsys(&ipv4_sysctl_ops)) {
-               unregister_sysctl_table(hdr);
+               unregister_net_sysctl_table(hdr);
                return -ENOMEM;
        }
 
index a34c9e4c792ca1adb3360e67edb5f2b2f64e7cb7..6785f5044acfe63d1dfeff4911a4e4ec63cb534d 100644 (file)
@@ -588,7 +588,7 @@ static int __init ip6_queue_init(void)
 #endif
        register_netdevice_notifier(&ipq_dev_notifier);
 #ifdef CONFIG_SYSCTL
-       ipq_sysctl_header = register_sysctl_paths(net_ipv6_ctl_path, ipq_table);
+       ipq_sysctl_header = register_net_sysctl_table(&init_net, net_ipv6_ctl_path, ipq_table);
 #endif
        status = nf_register_queue_handler(NFPROTO_IPV6, &nfqh);
        if (status < 0) {
@@ -599,7 +599,7 @@ static int __init ip6_queue_init(void)
 
 cleanup_sysctl:
 #ifdef CONFIG_SYSCTL
-       unregister_sysctl_table(ipq_sysctl_header);
+       unregister_net_sysctl_table(ipq_sysctl_header);
 #endif
        unregister_netdevice_notifier(&ipq_dev_notifier);
        proc_net_remove(&init_net, IPQ_PROC_FS_NAME);
@@ -621,7 +621,7 @@ static void __exit ip6_queue_fini(void)
        ipq_flush(NULL, 0);
 
 #ifdef CONFIG_SYSCTL
-       unregister_sysctl_table(ipq_sysctl_header);
+       unregister_net_sysctl_table(ipq_sysctl_header);
 #endif
        unregister_netdevice_notifier(&ipq_dev_notifier);
        proc_net_remove(&init_net, IPQ_PROC_FS_NAME);
index 38f00b0298d3f53327f2e35447e8ab97a1568e83..754814462950b0e329ffbda7e0c6c02d34764787 100644 (file)
@@ -626,7 +626,7 @@ int nf_ct_frag6_init(void)
        inet_frags_init(&nf_frags);
 
 #ifdef CONFIG_SYSCTL
-       nf_ct_frag6_sysctl_header = register_sysctl_paths(nf_net_netfilter_sysctl_path,
+       nf_ct_frag6_sysctl_header = register_net_sysctl_table(&init_net, nf_net_netfilter_sysctl_path,
                                                          nf_ct_frag6_sysctl_table);
        if (!nf_ct_frag6_sysctl_header) {
                inet_frags_fini(&nf_frags);
@@ -640,7 +640,7 @@ int nf_ct_frag6_init(void)
 void nf_ct_frag6_cleanup(void)
 {
 #ifdef CONFIG_SYSCTL
-       unregister_sysctl_table(nf_ct_frag6_sysctl_header);
+       unregister_net_sysctl_table(nf_ct_frag6_sysctl_header);
        nf_ct_frag6_sysctl_header = NULL;
 #endif
        inet_frags_fini(&nf_frags);
index 06f21e5ad361a01214c4746a1987e02eec7f0397..99279c8aaf294a31339b5d64ca1957c2a2745223 100644 (file)
@@ -165,7 +165,7 @@ static struct ctl_table_header *ip6_base;
 
 int ipv6_static_sysctl_register(void)
 {
-       ip6_base = register_sysctl_paths(net_ipv6_ctl_path, ipv6_static_skeleton);
+       ip6_base = register_net_sysctl_table(&init_net, net_ipv6_ctl_path, ipv6_static_skeleton);
        if (ip6_base == NULL)
                return -ENOMEM;
        return 0;
index bd6dca00fb85aab82bba393914feaa8a6e9537f3..035880709e840302f3a1498988d508e0ca07b1ef 100644 (file)
@@ -8,6 +8,7 @@
 
 #include <linux/mm.h>
 #include <linux/sysctl.h>
+#include <net/net_namespace.h>
 
 #ifndef CONFIG_SYSCTL
 #error This file should not be compiled without CONFIG_SYSCTL defined
@@ -37,10 +38,10 @@ static struct ctl_table_header *ipx_table_header;
 
 void ipx_register_sysctl(void)
 {
-       ipx_table_header = register_sysctl_paths(ipx_path, ipx_table);
+       ipx_table_header = register_net_sysctl_table(&init_net, ipx_path, ipx_table);
 }
 
 void ipx_unregister_sysctl(void)
 {
-       unregister_sysctl_table(ipx_table_header);
+       unregister_net_sysctl_table(ipx_table_header);
 }
index 2615ffc8e785df65ca5bbba9a7a883881b607316..20ced38fc371371a1932361f46d3d51588f6d992 100644 (file)
@@ -251,7 +251,7 @@ static struct ctl_table_header *irda_table_header;
  */
 int __init irda_sysctl_register(void)
 {
-       irda_table_header = register_sysctl_paths(irda_path, irda_table);
+       irda_table_header = register_net_sysctl_table(&init_net, irda_path, irda_table);
        if (!irda_table_header)
                return -ENOMEM;
 
@@ -266,7 +266,7 @@ int __init irda_sysctl_register(void)
  */
 void irda_sysctl_unregister(void)
 {
-       unregister_sysctl_table(irda_table_header);
+       unregister_net_sysctl_table(irda_table_header);
 }
 
 
index e2ebe358626313956ac432c8377ef1564b44805b..9a6a65f2104b529df77821928affc314412a7074 100644 (file)
@@ -7,6 +7,7 @@
 #include <linux/mm.h>
 #include <linux/init.h>
 #include <linux/sysctl.h>
+#include <net/net_namespace.h>
 #include <net/llc.h>
 
 #ifndef CONFIG_SYSCTL
@@ -89,7 +90,7 @@ static struct ctl_table_header *llc_table_header;
 
 int __init llc_sysctl_init(void)
 {
-       llc_table_header = register_sysctl_paths(llc_path, llc_table);
+       llc_table_header = register_net_sysctl_table(&init_net, llc_path, llc_table);
 
        return llc_table_header ? 0 : -ENOMEM;
 }
@@ -97,7 +98,7 @@ int __init llc_sysctl_init(void)
 void llc_sysctl_exit(void)
 {
        if (llc_table_header) {
-               unregister_sysctl_table(llc_table_header);
+               unregister_net_sysctl_table(llc_table_header);
                llc_table_header = NULL;
        }
 }
index be3da2c8cdc5803c120b743c9abcceb4b6707fd5..bbc753fd4fe0430cbe40de63056a438a3809ed64 100644 (file)
@@ -40,7 +40,7 @@ nf_ct_register_sysctl(struct ctl_table_header **header, struct ctl_path *path,
                      struct ctl_table *table, unsigned int *users)
 {
        if (*header == NULL) {
-               *header = register_sysctl_paths(path, table);
+               *header = register_net_sysctl_table(&init_net, path, table);
                if (*header == NULL)
                        return -ENOMEM;
        }
@@ -56,7 +56,7 @@ nf_ct_unregister_sysctl(struct ctl_table_header **header,
        if (users != NULL && --*users > 0)
                return;
 
-       unregister_sysctl_table(*header);
+       unregister_net_sysctl_table(*header);
        *header = NULL;
 }
 #endif
index 885f5ab9bc28efed6b3d7116ed87887bb9fd33b9..0c3888de0f551fd76327cf96184ff3c4db9b2f6f 100644 (file)
@@ -479,7 +479,7 @@ static int nf_conntrack_standalone_init_sysctl(struct net *net)
 
        if (net_eq(net, &init_net)) {
                nf_ct_netfilter_header =
-                      register_sysctl_paths(nf_ct_path, nf_ct_netfilter_table);
+                      register_net_sysctl_table(&init_net, nf_ct_path, nf_ct_netfilter_table);
                if (!nf_ct_netfilter_header)
                        goto out;
        }
@@ -505,7 +505,7 @@ out_unregister_netfilter:
        kfree(table);
 out_kmemdup:
        if (net_eq(net, &init_net))
-               unregister_sysctl_table(nf_ct_netfilter_header);
+               unregister_net_sysctl_table(nf_ct_netfilter_header);
 out:
        printk(KERN_ERR "nf_conntrack: can't register to sysctl.\n");
        return -ENOMEM;
@@ -516,7 +516,7 @@ static void nf_conntrack_standalone_fini_sysctl(struct net *net)
        struct ctl_table *table;
 
        if (net_eq(net, &init_net))
-               unregister_sysctl_table(nf_ct_netfilter_header);
+               unregister_net_sysctl_table(nf_ct_netfilter_header);
        table = net->ct.sysctl_header->ctl_table_arg;
        unregister_net_sysctl_table(net->ct.sysctl_header);
        kfree(table);
index 957374a234d410bbf87bee24f3fee4428a5ff678..04fca48d901aa27f407ef18eaa0c04645cee93ba 100644 (file)
@@ -283,7 +283,7 @@ static __init int netfilter_log_sysctl_init(void)
                nf_log_sysctl_table[i].extra1 = (void *)(unsigned long) i;
        }
 
-       nf_log_dir_header = register_sysctl_paths(nf_log_sysctl_path,
+       nf_log_dir_header = register_net_sysctl_table(&init_net, nf_log_sysctl_path,
                                       nf_log_sysctl_table);
        if (!nf_log_dir_header)
                return -ENOMEM;
index 1e0fa9e57aac42fd43e11c719b0c8877c8d3ca2c..4ed149e265bf93895254bb8670c8523c822b34dd 100644 (file)
@@ -154,10 +154,10 @@ static struct ctl_path nr_path[] = {
 
 void __init nr_register_sysctl(void)
 {
-       nr_table_header = register_sysctl_paths(nr_path, nr_table);
+       nr_table_header = register_net_sysctl_table(&init_net, nr_path, nr_table);
 }
 
 void nr_unregister_sysctl(void)
 {
-       unregister_sysctl_table(nr_table_header);
+       unregister_net_sysctl_table(nr_table_header);
 }
index 8bed7675b3f49cf1176b6ec846d16165d480ec08..aa55db5f383bf6b54aaee9968960b562f35ab66b 100644 (file)
@@ -106,11 +106,11 @@ static struct ctl_path phonet_ctl_path[] = {
 
 int __init phonet_sysctl_init(void)
 {
-       phonet_table_hrd = register_sysctl_paths(phonet_ctl_path, phonet_table);
+       phonet_table_hrd = register_net_sysctl_table(&init_net, phonet_ctl_path, phonet_table);
        return phonet_table_hrd == NULL ? -ENOMEM : 0;
 }
 
 void phonet_sysctl_exit(void)
 {
-       unregister_sysctl_table(phonet_table_hrd);
+       unregister_net_sysctl_table(phonet_table_hrd);
 }
index 1253b006efdb3b25f2f4bdb5bb3011e0e71fbdf3..0fef3e15777b5396e994dc886ba542e6fbe6c81d 100644 (file)
@@ -116,12 +116,12 @@ static struct ctl_path rds_ib_sysctl_path[] = {
 void rds_ib_sysctl_exit(void)
 {
        if (rds_ib_sysctl_hdr)
-               unregister_sysctl_table(rds_ib_sysctl_hdr);
+               unregister_net_sysctl_table(rds_ib_sysctl_hdr);
 }
 
 int rds_ib_sysctl_init(void)
 {
-       rds_ib_sysctl_hdr = register_sysctl_paths(rds_ib_sysctl_path, rds_ib_sysctl_table);
+       rds_ib_sysctl_hdr = register_net_sysctl_table(&init_net, rds_ib_sysctl_path, rds_ib_sysctl_table);
        if (!rds_ib_sysctl_hdr)
                return -ENOMEM;
        return 0;
index e2e47176e729f5a8c24cb1359335a7412d5e7ea8..bcfe36dc55a732805ec731eb3d4d565929dc4767 100644 (file)
@@ -119,12 +119,12 @@ static struct ctl_path rds_iw_sysctl_path[] = {
 void rds_iw_sysctl_exit(void)
 {
        if (rds_iw_sysctl_hdr)
-               unregister_sysctl_table(rds_iw_sysctl_hdr);
+               unregister_net_sysctl_table(rds_iw_sysctl_hdr);
 }
 
 int rds_iw_sysctl_init(void)
 {
-       rds_iw_sysctl_hdr = register_sysctl_paths(rds_iw_sysctl_path, rds_iw_sysctl_table);
+       rds_iw_sysctl_hdr = register_net_sysctl_table(&init_net, rds_iw_sysctl_path, rds_iw_sysctl_table);
        if (!rds_iw_sysctl_hdr)
                return -ENOMEM;
        return 0;
index 25ad0c77a26cd16cca2d96681fae4f77373757bf..30354b8cd5848c364badb8f716088c9d0eff49e9 100644 (file)
@@ -102,7 +102,7 @@ static struct ctl_path rds_sysctl_path[] = {
 void rds_sysctl_exit(void)
 {
        if (rds_sysctl_reg_table)
-               unregister_sysctl_table(rds_sysctl_reg_table);
+               unregister_net_sysctl_table(rds_sysctl_reg_table);
 }
 
 int rds_sysctl_init(void)
@@ -110,7 +110,7 @@ int rds_sysctl_init(void)
        rds_sysctl_reconnect_min = msecs_to_jiffies(1);
        rds_sysctl_reconnect_min_jiffies = rds_sysctl_reconnect_min;
 
-       rds_sysctl_reg_table = register_sysctl_paths(rds_sysctl_path, rds_sysctl_rds_table);
+       rds_sysctl_reg_table = register_net_sysctl_table(&init_net, rds_sysctl_path, rds_sysctl_rds_table);
        if (!rds_sysctl_reg_table)
                return -ENOMEM;
        return 0;
index df6d9dac21865845d88bdc52050a4d0aa6edcf51..02b73979535bb08fa723d4b2c2940e1d2031a7a7 100644 (file)
@@ -126,10 +126,10 @@ static struct ctl_path rose_path[] = {
 
 void __init rose_register_sysctl(void)
 {
-       rose_table_header = register_sysctl_paths(rose_path, rose_table);
+       rose_table_header = register_net_sysctl_table(&init_net, rose_path, rose_table);
 }
 
 void rose_unregister_sysctl(void)
 {
-       unregister_sysctl_table(rose_table_header);
+       unregister_net_sysctl_table(rose_table_header);
 }
index 60ffbd067ff75643ac3f5cc61e4ba20c2b8ef3b9..1e385b452047eaa30c68f37c575dd38765ecb8d2 100644 (file)
@@ -286,11 +286,11 @@ static struct ctl_table_header * sctp_sysctl_header;
 /* Sysctl registration.  */
 void sctp_sysctl_register(void)
 {
-       sctp_sysctl_header = register_sysctl_paths(sctp_path, sctp_table);
+       sctp_sysctl_header = register_net_sysctl_table(&init_net, sctp_path, sctp_table);
 }
 
 /* Sysctl deregistration.  */
 void sctp_sysctl_unregister(void)
 {
-       unregister_sysctl_table(sctp_sysctl_header);
+       unregister_net_sysctl_table(sctp_sysctl_header);
 }
index 397cffebb3b655546043a540067ac81be99fa42c..4f6979c06f84288532a969b6236266aa13cce26d 100644 (file)
@@ -58,6 +58,6 @@ void unix_sysctl_unregister(struct net *net)
        struct ctl_table *table;
 
        table = net->unx.ctl->ctl_table_arg;
-       unregister_sysctl_table(net->unx.ctl);
+       unregister_net_sysctl_table(net->unx.ctl);
        kfree(table);
 }
index d2efd29f434ee8fa329b5d6528e6a0cc024e58fd..08337cb488d4120b1cec01c3991d2f8764fe85dc 100644 (file)
@@ -81,10 +81,10 @@ static struct ctl_path x25_path[] = {
 
 void __init x25_register_sysctl(void)
 {
-       x25_table_header = register_sysctl_paths(x25_path, x25_table);
+       x25_table_header = register_net_sysctl_table(&init_net, x25_path, x25_table);
 }
 
 void x25_unregister_sysctl(void)
 {
-       unregister_sysctl_table(x25_table_header);
+       unregister_net_sysctl_table(x25_table_header);
 }