Commit 5339ab8b1dd82f14df168fb9bf59449f3e24b03d

Authored by David S. Miller
1 parent eb857186eb

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>

Showing 1 changed file with 14 additions and 5 deletions Side-by-side Diff

... ... @@ -1552,11 +1552,20 @@
1552 1552 time_after_eq(now, rt->dst.lastuse + gc_args.timeout)) {
1553 1553 RT6_TRACE("aging clone %p\n", rt);
1554 1554 return -1;
1555   - } else if ((rt->rt6i_flags & RTF_GATEWAY) &&
1556   - (!(dst_get_neighbour_noref_raw(&rt->dst)->flags & NTF_ROUTER))) {
1557   - RT6_TRACE("purging route %p via non-router but gateway\n",
1558   - rt);
1559   - return -1;
  1555 + } else if (rt->rt6i_flags & RTF_GATEWAY) {
  1556 + struct neighbour *neigh;
  1557 + __u8 neigh_flags = 0;
  1558 +
  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 1570 gc_args.more++;
1562 1571 }