Re: [PATCH net-next 2/3] ipv6: per netns fib6 walkers

From: David Miller
Date: Mon Mar 07 2016 - 14:49:04 EST


From: Michal Kubecek <mkubecek@xxxxxxx>
Date: Fri, 4 Mar 2016 11:59:25 +0100 (CET)

> @@ -1978,6 +1980,12 @@ static int ipv6_route_yield(struct fib6_walker *w)
>
> static void ipv6_route_seq_setup_walk(struct ipv6_route_iter *iter)
> {
> +#ifdef CONFIG_NET_NS
> + struct net *net = iter->p.net;
> +#else
> + struct net *net = &init_net;
> +#endif

Please use read_pnet(), it exists so that we don't need to do ugly CPP
stuff like this in *.c files.

Thanks.