ipv6: fix typo in fib6_net_exit()
[pandora-kernel.git] / net / ipv6 / route.c
index cda5cfe..6fc91f9 100644 (file)
@@ -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();
+               }
        }
 }