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

Commit 8668d0e2 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller
Browse files

ipv6: no longer reference init_net in ip6_frags_ns_ctl_table[]



(struct net *)->ipv6.fqdir will soon be a pointer, so make
sure ip6_frags_ns_ctl_table[] does not reference init_net.

ip6_frags_ns_ctl_register() can perform the needed initialization
for all netns.

Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8dfdb313
Loading
Loading
Loading
Loading
+5 −10
Original line number Original line Diff line number Diff line
@@ -401,23 +401,18 @@ static const struct inet6_protocol frag_protocol = {
static struct ctl_table ip6_frags_ns_ctl_table[] = {
static struct ctl_table ip6_frags_ns_ctl_table[] = {
	{
	{
		.procname	= "ip6frag_high_thresh",
		.procname	= "ip6frag_high_thresh",
		.data		= &init_net.ipv6.fqdir.high_thresh,
		.maxlen		= sizeof(unsigned long),
		.maxlen		= sizeof(unsigned long),
		.mode		= 0644,
		.mode		= 0644,
		.proc_handler	= proc_doulongvec_minmax,
		.proc_handler	= proc_doulongvec_minmax,
		.extra1		= &init_net.ipv6.fqdir.low_thresh
	},
	},
	{
	{
		.procname	= "ip6frag_low_thresh",
		.procname	= "ip6frag_low_thresh",
		.data		= &init_net.ipv6.fqdir.low_thresh,
		.maxlen		= sizeof(unsigned long),
		.maxlen		= sizeof(unsigned long),
		.mode		= 0644,
		.mode		= 0644,
		.proc_handler	= proc_doulongvec_minmax,
		.proc_handler	= proc_doulongvec_minmax,
		.extra2		= &init_net.ipv6.fqdir.high_thresh
	},
	},
	{
	{
		.procname	= "ip6frag_time",
		.procname	= "ip6frag_time",
		.data		= &init_net.ipv6.fqdir.timeout,
		.maxlen		= sizeof(int),
		.maxlen		= sizeof(int),
		.mode		= 0644,
		.mode		= 0644,
		.proc_handler	= proc_dointvec_jiffies,
		.proc_handler	= proc_dointvec_jiffies,
@@ -449,12 +444,12 @@ static int __net_init ip6_frags_ns_sysctl_register(struct net *net)
		if (!table)
		if (!table)
			goto err_alloc;
			goto err_alloc;


	}
	table[0].data	= &net->ipv6.fqdir.high_thresh;
	table[0].data	= &net->ipv6.fqdir.high_thresh;
	table[0].extra1	= &net->ipv6.fqdir.low_thresh;
	table[0].extra1	= &net->ipv6.fqdir.low_thresh;
	table[1].data	= &net->ipv6.fqdir.low_thresh;
	table[1].data	= &net->ipv6.fqdir.low_thresh;
	table[1].extra2	= &net->ipv6.fqdir.high_thresh;
	table[1].extra2	= &net->ipv6.fqdir.high_thresh;
	table[2].data	= &net->ipv6.fqdir.timeout;
	table[2].data	= &net->ipv6.fqdir.timeout;
	}


	hdr = register_net_sysctl(net, "net/ipv6", table);
	hdr = register_net_sysctl(net, "net/ipv6", table);
	if (!hdr)
	if (!hdr)