Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5dd3df10 authored by Eric W. Biederman's avatar Eric W. Biederman Committed by David S. Miller
Browse files

net: Move all of the network sysctls without a namespace into init_net.



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: default avatarEric W. Biederman <ebiederm@xmission.com>
Acked-by: default avatarPavel Emelyanov <xemul@parallels.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 43444757
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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 @@ static int __init ucma_init(void)

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);
+1 −1
Original line number Diff line number Diff line
@@ -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;
+2 −2
Original line number Diff line number Diff line
@@ -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);
}
+2 −2
Original line number Diff line number Diff line
@@ -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);
+2 −2
Original line number Diff line number Diff line
@@ -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);
}
Loading