ipv6: Check nexthop flags in route dump instead of carrier
authorIdo Schimmel <idosch@mellanox.com>
Sun, 7 Jan 2018 10:45:08 +0000 (12:45 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 8 Jan 2018 02:29:40 +0000 (21:29 -0500)
Similar to previous patch, there is no need to check for the carrier of
the nexthop device when dumping the route and we can instead check for
the presence of the RTNH_F_LINKDOWN flag.

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Acked-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/route.c

index ab0eed43ed977e1b7301b204187c116b10da2e38..f980f904d6ea5a04586e09c184431b16d269151b 100644 (file)
@@ -4039,7 +4039,7 @@ static size_t rt6_nlmsg_size(struct rt6_info *rt)
 static int rt6_nexthop_info(struct sk_buff *skb, struct rt6_info *rt,
                            unsigned int *flags, bool skip_oif)
 {
-       if (!netif_running(rt->dst.dev) || !netif_carrier_ok(rt->dst.dev)) {
+       if (rt->rt6i_nh_flags & RTNH_F_LINKDOWN) {
                *flags |= RTNH_F_LINKDOWN;
                if (rt->rt6i_idev->cnf.ignore_routes_with_linkdown)
                        *flags |= RTNH_F_DEAD;