+ if (rt == net->ipv6.ip6_null_entry || (rt->rt6i_flags & RTF_CACHE)) {
+ goto done;
+ } else if (unlikely((fl6->flowi6_flags & FLOWI_FLAG_KNOWN_NH) &&
+ !(rt->rt6i_flags & RTF_GATEWAY))) {
+ /* Create a RTF_CACHE clone which will not be
+ * owned by the fib6 tree. It is for the special case where
+ * the daddr in the skb during the neighbor look-up is different
+ * from the fl6->daddr used to look-up route here.
+ */
+
+ struct rt6_info *uncached_rt;
+
+ uncached_rt = ip6_rt_cache_alloc(rt, &fl6->daddr, NULL);
+ dst_release(&rt->dst);
+
+ if (uncached_rt)
+ uncached_rt->dst.flags |= DST_NOCACHE;
+ else
+ uncached_rt = net->ipv6.ip6_null_entry;
+ dst_hold(&uncached_rt->dst);
+ return uncached_rt;
+ }