[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5124A48F.3060907@linux-ipv6.org>
Date: Wed, 20 Feb 2013 19:25:19 +0900
From: YOSHIFUJI Hideaki <yoshfuji@...ux-ipv6.org>
To: YOSHIFUJI Hideaki <yoshfuji@...ux-ipv6.org>
CC: David Miller <davem@...emloft.net>,
Eric Dumazet <eric.dumazet@...il.com>,
Neil Horman <nhorman@...driver.com>,
Gao feng <gaofeng@...fujitsu.com>,
netdev <netdev@...r.kernel.org>
Subject: Re: [PATCH] ipv6: fix race condition regarding dst->expires and dst->from.
YOSHIFUJI Hideaki wrote:
> -static inline void rt6_update_expires(struct rt6_info *rt, int timeout)
> +static inline void rt6_update_expires(struct rt6_info *rt0, int timeout)
> {
> - if (!(rt->rt6i_flags & RTF_EXPIRES)) {
> - if (rt->dst.from)
> - dst_release(rt->dst.from);
> - /* dst_set_expires relies on expires == 0
> - * if it has not been set previously.
> - */
> - rt->dst.expires = 0;
> - }
> -
> - dst_set_expires(&rt->dst, timeout);
> - rt->rt6i_flags |= RTF_EXPIRES;
> + struct rt6_info *rt;
> +
> + for (rt = rt0; rt && !(rt->rt6i_flags & RTF_EXPIRES); rt = rt->dst.from);
> + if (rt && rt != rt0)
> + rt0->dst.expires = rt->dst.expires;
> +
> + dst_set_expires(&rt0->dst, timeout);
> + rt0->rt6i_flags |= RTF_EXPIRES;
> }
>
Oops, I sent wrong version, will resend.
--yoshfuji
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists