Commit 2b241361 authored by Ido Schimmel's avatar Ido Schimmel Committed by David S. Miller

ipv6: Mark dead nexthops with appropriate flags

When a netdev is put administratively down or unregistered all the
nexthops using it as their nexthop device should be marked with the
'dead' and 'linkdown' flags.

Currently, when a route is dumped its nexthop device is tested and the
flags are set accordingly. A similar check is performed during route
lookup.

Instead, we can simply mark the nexthops based on netdev events and
avoid checking the netdev's state during route dump and lookup.
Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
Acked-by: default avatarDavid Ahern <dsahern@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 9fcb0714
...@@ -3473,8 +3473,10 @@ static int fib6_ifdown(struct rt6_info *rt, void *arg) ...@@ -3473,8 +3473,10 @@ static int fib6_ifdown(struct rt6_info *rt, void *arg)
if (rt->dst.dev == dev && if (rt->dst.dev == dev &&
rt != adn->net->ipv6.ip6_null_entry && rt != adn->net->ipv6.ip6_null_entry &&
(rt->rt6i_nsiblings == 0 || netdev_unregistering(dev) || (rt->rt6i_nsiblings == 0 || netdev_unregistering(dev) ||
!rt->rt6i_idev->cnf.ignore_routes_with_linkdown)) !rt->rt6i_idev->cnf.ignore_routes_with_linkdown)) {
rt->rt6i_nh_flags |= (RTNH_F_DEAD | RTNH_F_LINKDOWN);
return -1; return -1;
}
return 0; return 0;
} }
......
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