Subject: Re: [RFC PATCH 06/10] ipv6: Avoid deleting RTF_CACHE route from ip6_route_del()

From: Martin KaFai Lau <[email-masked]>
Date: Mon, 20 Apr 2015 12:33:05 -0700

On Mon, Apr 20, 2015 at 02:23:05PM -0400, David Miller wrote:
> From: Martin KaFai Lau <[email-masked]>
> Date: Fri, 10 Apr 2015 18:54:09 -0700
> 
> > Before patch 'Allow pmtu update on /128 via gateway route',
> > RTF_CACHE route was not created for DST_HOST.  It also requires changes on both
> > delete code path and rt6_select() code patch.
> > 
> > This patch fixes the delete code path to avoid deleting the RTF_CACHE
> > route by 'ip -6 r del...'
> > 
> > Signed-off-by: Martin KaFai Lau <[email-masked]>
> > Reviewed-by: Hannes Frederic Sowa <[email-masked]>
> 
> If a cached route was created in response to say a PMTU event, and
> it's a clone/copy/cow of the route we are being asked to delete,
> it absolutely should be removed.
> 
> In fact this is a critically important aspect of removing routes
> from the table.
When a non-clone routes are removed, its clones are removed together by
fib6_prune_clones() in fib6_del().

Hence, 'ip -6 r del' will remove a route and its clones.
'ip -6 r flush table cache will only remove RTF_CACHE routes.

I will fix up the commit message.

Thanks,
--Martin