Commit 94c77bb4 authored by Martin KaFai Lau's avatar Martin KaFai Lau Committed by David S. Miller

ipv6: Avoid redoing fib6_lookup() for RTF_CACHE hit case

When there is a RTF_CACHE hit, no need to redo fib6_lookup()
with reachable=0.

Cc: David Miller <davem@davemloft.net>
Cc: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: default avatarMartin KaFai Lau <kafai@fb.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a3c00e46
...@@ -944,12 +944,12 @@ static struct rt6_info *ip6_pol_route(struct net *net, struct fib6_table *table, ...@@ -944,12 +944,12 @@ static struct rt6_info *ip6_pol_route(struct net *net, struct fib6_table *table,
goto out; goto out;
} }
if (rt->rt6i_flags & RTF_CACHE)
goto out;
dst_hold(&rt->dst); dst_hold(&rt->dst);
read_unlock_bh(&table->tb6_lock); read_unlock_bh(&table->tb6_lock);
if (rt->rt6i_flags & RTF_CACHE)
goto out2;
if (!(rt->rt6i_flags & (RTF_NONEXTHOP | RTF_GATEWAY))) if (!(rt->rt6i_flags & (RTF_NONEXTHOP | RTF_GATEWAY)))
nrt = rt6_alloc_cow(rt, &fl6->daddr, &fl6->saddr); nrt = rt6_alloc_cow(rt, &fl6->daddr, &fl6->saddr);
else if (!(rt->dst.flags & DST_HOST)) else if (!(rt->dst.flags & DST_HOST))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment