Subject: Re: [PATCH] sysctl: ipv6: use correct net in ipv6_sysctl_rtcache_flush

From: Daniel Lezcano <[email-masked]>
Date: Wed, 02 Mar 2011 17:38:23 +0100

On 03/02/2011 04:25 AM, Shan Wei wrote:
> Lucian Adrian Grijincu wrote, at 02/25/2011 01:48 PM:
>> Before this patch issuing these commands:
>>
>>    fd = open("/proc/sys/net/ipv6/route/flush")
>>    unshare(CLONE_NEWNET)
>>    write(fd, "stuff")
>>
>> would flush the newly created net, not the original one.
>
> After appling your patch, when excuting above commands,
> router cache still not be flushed in init net namespace.
> But IPv4 is ok.
>
> Host1:                   Host2
> ping6 Host2
>                          (shell1)
> 			open(/proc/sys/net/ipv6/route/flush)
> 			unshare(CLONE_NEWNET)
> 			while(1) {write(fd, "stuff")}
>
>
> 			(shell2)
>                          ip -6 route show cache<==1*
> 			1*: IPv6 will show one route cache entry.
> 			    But IPv4 shows nothing.
>
> As changlog said, after this patch, shell1 only fulsh the original
> net namespace, not the newly created one. But from shell2, we
> can see that IPv6 route cache is not flushed.
>
> Have i missed something?

Yes, you are right you shouldn't see any route from shell2.
Are you sure 'ip -6 route show cache' does not show the route cache in a 
window where ping6 created a new route and 'write(fd, "stuff")' did not 
flushed the new route yet ?