X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=net%2Fipv6%2Froute.c;h=6fc91f9e8e1b9418ac8839176d4fab649b3d0f18;hb=ae0ebfe24b8ca8b5a10022d9dc448f2ddf32782d;hp=cda5cfe92f6bb8b617d08ee2250ded2361910045;hpb=cb424db7576009c506281f29893c8ee32af33555;p=pandora-kernel.git diff --git a/net/ipv6/route.c b/net/ipv6/route.c index cda5cfe92f6b..6fc91f9e8e1b 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -964,10 +964,11 @@ struct dst_entry *ip6_blackhole_route(struct net *net, struct dst_entry *dst_ori static struct dst_entry *ip6_dst_check(struct dst_entry *dst, u32 cookie) { struct rt6_info *rt; + u32 rt_cookie = 0; rt = (struct rt6_info *) dst; - if (rt->rt6i_node && (rt->rt6i_node->fn_sernum == cookie)) { + if (rt6_get_cookie_safe(rt, &rt_cookie) && rt_cookie == cookie) { if (rt->rt6i_peer_genid != rt6_peer_genid()) { if (!rt->rt6i_peer) rt6_bind_peer(rt, 0); @@ -1007,8 +1008,15 @@ static void ip6_link_failure(struct sk_buff *skb) if (rt->rt6i_flags&RTF_CACHE) { dst_set_expires(&rt->dst, 0); rt->rt6i_flags |= RTF_EXPIRES; - } else if (rt->rt6i_node && (rt->rt6i_flags & RTF_DEFAULT)) - rt->rt6i_node->fn_sernum = -1; + } else { + struct fib6_node *fn; + + rcu_read_lock(); + fn = rcu_dereference(rt->rt6i_node); + if (fn && (rt->rt6i_flags & RTF_DEFAULT)) + fn->fn_sernum = -1; + rcu_read_unlock(); + } } }