提交 14c5206c 编写于 作者: I Ido Schimmel 提交者: David S. Miller

ipv6: Check nexthop flags during route lookup instead of carrier

Now that the RTNH_F_LINKDOWN flag is set in nexthops, we can avoid the
need to dereference the nexthop device and check its carrier and instead
check for the presence of the flag.
Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
Acked-by: NDavid Ahern <dsahern@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 5609b80a
...@@ -474,7 +474,7 @@ static struct rt6_info *rt6_multipath_select(struct rt6_info *match, ...@@ -474,7 +474,7 @@ static struct rt6_info *rt6_multipath_select(struct rt6_info *match,
if (route_choosen == 0) { if (route_choosen == 0) {
struct inet6_dev *idev = sibling->rt6i_idev; struct inet6_dev *idev = sibling->rt6i_idev;
if (!netif_carrier_ok(sibling->dst.dev) && if (sibling->rt6i_nh_flags & RTNH_F_LINKDOWN &&
idev->cnf.ignore_routes_with_linkdown) idev->cnf.ignore_routes_with_linkdown)
break; break;
if (rt6_score_route(sibling, oif, strict) < 0) if (rt6_score_route(sibling, oif, strict) < 0)
...@@ -679,10 +679,9 @@ static struct rt6_info *find_match(struct rt6_info *rt, int oif, int strict, ...@@ -679,10 +679,9 @@ static struct rt6_info *find_match(struct rt6_info *rt, int oif, int strict,
int m; int m;
bool match_do_rr = false; bool match_do_rr = false;
struct inet6_dev *idev = rt->rt6i_idev; struct inet6_dev *idev = rt->rt6i_idev;
struct net_device *dev = rt->dst.dev;
if (dev && !netif_carrier_ok(dev) && if (idev->cnf.ignore_routes_with_linkdown &&
idev->cnf.ignore_routes_with_linkdown && rt->rt6i_nh_flags & RTNH_F_LINKDOWN &&
!(strict & RT6_LOOKUP_F_IGNORE_LINKSTATE)) !(strict & RT6_LOOKUP_F_IGNORE_LINKSTATE))
goto out; goto out;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册