From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ido Schimmel Subject: [PATCH net-next 08/18] ipv6: Check nexthop flags in route dump instead of carrier Date: Sun, 7 Jan 2018 12:45:08 +0200 Message-ID: <20180107104518.31693-9-idosch@mellanox.com> References: <20180107104518.31693-1-idosch@mellanox.com> Mime-Version: 1.0 Content-Type: text/plain Cc: davem@davemloft.net, dsahern@gmail.com, roopa@cumulusnetworks.com, nicolas.dichtel@6wind.com, weiwan@google.com, kafai@fb.com, yoshfuji@linux-ipv6.org, mlxsw@mellanox.com, Ido Schimmel To: netdev@vger.kernel.org Return-path: Received: from mail-eopbgr00048.outbound.protection.outlook.com ([40.107.0.48]:42941 "EHLO EUR02-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753053AbeAGKrA (ORCPT ); Sun, 7 Jan 2018 05:47:00 -0500 In-Reply-To: <20180107104518.31693-1-idosch@mellanox.com> Sender: netdev-owner@vger.kernel.org List-ID: 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 --- net/ipv6/route.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv6/route.c b/net/ipv6/route.c index ab0eed43ed97..f980f904d6ea 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -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; -- 2.14.3