Subject: Re: [PATCH] ipv6: clear RTF_EXPIRES when call ip6_rt_copy

From: Gao feng <[email-masked]>
Date: Tue, 17 Dec 2013 11:25:48 +0800

On 12/16/2013 04:31 PM, [email-masked] wrote:
> From: Li RongQing <[email-masked]>
> 
> The commit ecd9883724b [ipv6: fix race condition regarding dst->expires and
> dst->from.] removed rt6_clean_expires in ip6_rt_copy, which causes the TAHI
> test case v6LC.4.1.4 { Reduce PMTU On-link } failed, since the newly generated
> rt maybe always expired {with RTF_EXPIRES flag, dst.expires is 0, and dst.from
> is NULL}.
> 
> Fix it by clearing RTF_EXPIRES as before 1716a96101[ipv6: fix problem with
> expired dst cache]
> 
> Signed-off-by: Li RongQing <[email-masked]>
> ---
>  net/ipv6/route.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/ipv6/route.c b/net/ipv6/route.c
> index a1a5752..e3d7f21 100644
> --- a/net/ipv6/route.c
> +++ b/net/ipv6/route.c
> @@ -1908,7 +1908,7 @@ static struct rt6_info *ip6_rt_copy(struct rt6_info *ort,
>  			rt->rt6i_gateway = ort->rt6i_gateway;
>  		else
>  			rt->rt6i_gateway = *dest;
> -		rt->rt6i_flags = ort->rt6i_flags;
> +		rt->rt6i_flags = ort->rt6i_flags & ~RTF_EXPIRES;
>  		if ((ort->rt6i_flags & (RTF_DEFAULT | RTF_ADDRCONF)) ==
>  		    (RTF_DEFAULT | RTF_ADDRCONF))
>  			rt6_set_from(rt, ort);
> 

I don't understand, rt6_set_from already clears the RTF_EXPIRES from rt->rt6i_flags.