提交 5339ab8b 编写于 作者: D David S. Miller

ipv6: fib: Convert fib6_age() to dst_neigh_lookup().

In this specific situation we know we are dealing with a gatewayed route
and therefore rt6i_gateway is not going to be in6addr_any even in future
interpretations.
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 eb857186
...@@ -1552,11 +1552,20 @@ static int fib6_age(struct rt6_info *rt, void *arg) ...@@ -1552,11 +1552,20 @@ static int fib6_age(struct rt6_info *rt, void *arg)
time_after_eq(now, rt->dst.lastuse + gc_args.timeout)) { time_after_eq(now, rt->dst.lastuse + gc_args.timeout)) {
RT6_TRACE("aging clone %p\n", rt); RT6_TRACE("aging clone %p\n", rt);
return -1; return -1;
} else if ((rt->rt6i_flags & RTF_GATEWAY) && } else if (rt->rt6i_flags & RTF_GATEWAY) {
(!(dst_get_neighbour_noref_raw(&rt->dst)->flags & NTF_ROUTER))) { struct neighbour *neigh;
RT6_TRACE("purging route %p via non-router but gateway\n", __u8 neigh_flags = 0;
rt);
return -1; neigh = dst_neigh_lookup(&rt->dst, &rt->rt6i_gateway);
if (neigh) {
neigh_flags = neigh->flags;
neigh_release(neigh);
}
if (neigh_flags & NTF_ROUTER) {
RT6_TRACE("purging route %p via non-router but gateway\n",
rt);
return -1;
}
} }
gc_args.more++; gc_args.more++;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册