Subject: Re: [patch 06/12][NETNS][IPV6] route6 - make route6 per namespace

From: Daniel Lezcano <[email-masked]>
Date: Wed, 05 Mar 2008 10:33:15 +0100

YOSHIFUJI Hideaki / 吉藤英明 wrote:
> In article <[email-masked]> (at Tue, 04 Mar 2008 22:03:32 +0100), Daniel Lezcano <[email-masked]> says:
> 
>> This patch makes the routing engine use the network namespaces
>> to access routing informations:
>> Add a network namespace parameter to ipv6_route_ioctl and 
>> propagate the network namespace value to all the routing code
>> that have not yet been changed.
>>
>> Signed-off-by: Daniel Lezcano <[email-masked]>
>> Signed-off-by: Benjamin Thery <[email-masked]>
>> ---
>>  include/net/ip6_route.h |    4 +
>>  net/ipv6/af_inet6.c     |    3 -
>>  net/ipv6/route.c        |   98 ++++++++++++++++++++++++------------------------
>>  3 files changed, 54 insertions(+), 51 deletions(-)
>>
> :
>> @@ -2544,6 +2545,7 @@ static void ip6_route_net_exit(struct ne
>>  	proc_net_remove(net, "ipv6_route");
>>  	proc_net_remove(net, "rt6_stats");
>>  #endif
>> +	rt6_ifdown(net, NULL);
>>  }
>>  
>>  static struct pernet_operations ip6_route_net_ops = {
>> @@ -2592,7 +2594,6 @@ fib6_rules_init:
>>  xfrm6_init:
>>  	xfrm6_fini();
>>  out_fib6_init:
>> -	rt6_ifdown(&init_net, NULL);
>>  	fib6_gc_cleanup();
>>  out_kmem_cache:
>>  	kmem_cache_destroy(ip6_dst_ops.kmem_cachep);
> 
> Please do not change the calling path here.

The calling path is still the same. Instead of having rt6_ifdown called 
before fib6_gc_cleanup, it is the first function called into 
fib6_gc_cleanup via unregister_pernet_subsys.

This is because we need to call rt6_ifdown when a network namespace 
exits or when the system shutdown (aka init_net exits).

   -- Daniel