diff options
author | David S. Miller <davem@davemloft.net> | 2012-01-27 18:14:01 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-01-27 21:00:08 -0500 |
commit | 5339ab8b1dd82f14df168fb9bf59449f3e24b03d (patch) | |
tree | 8abf0ccd062988c249cb098067f99dadebd61499 /net | |
parent | eb857186eb771998fc9ab4bfd398a6fedb5a295c (diff) |
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: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv6/ip6_fib.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c index b82bcde53f7a..5b27fbcae346 100644 --- a/net/ipv6/ip6_fib.c +++ b/net/ipv6/ip6_fib.c | |||
@@ -1552,11 +1552,20 @@ static int fib6_age(struct rt6_info *rt, void *arg) | |||
1552 | time_after_eq(now, rt->dst.lastuse + gc_args.timeout)) { | 1552 | time_after_eq(now, rt->dst.lastuse + gc_args.timeout)) { |
1553 | RT6_TRACE("aging clone %p\n", rt); | 1553 | RT6_TRACE("aging clone %p\n", rt); |
1554 | return -1; | 1554 | return -1; |
1555 | } else if ((rt->rt6i_flags & RTF_GATEWAY) && | 1555 | } else if (rt->rt6i_flags & RTF_GATEWAY) { |
1556 | (!(dst_get_neighbour_noref_raw(&rt->dst)->flags & NTF_ROUTER))) { | 1556 | struct neighbour *neigh; |
1557 | RT6_TRACE("purging route %p via non-router but gateway\n", | 1557 | __u8 neigh_flags = 0; |
1558 | rt); | 1558 | |
1559 | return -1; | 1559 | neigh = dst_neigh_lookup(&rt->dst, &rt->rt6i_gateway); |
1560 | if (neigh) { | ||
1561 | neigh_flags = neigh->flags; | ||
1562 | neigh_release(neigh); | ||
1563 | } | ||
1564 | if (neigh_flags & NTF_ROUTER) { | ||
1565 | RT6_TRACE("purging route %p via non-router but gateway\n", | ||
1566 | rt); | ||
1567 | return -1; | ||
1568 | } | ||
1560 | } | 1569 | } |
1561 | gc_args.more++; | 1570 | gc_args.more++; |
1562 | } | 1571 | } |