From patchwork Thu Aug 13 14:39:00 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Gospodarek X-Patchwork-Id: 507039 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id A9DA11401AF for ; Fri, 14 Aug 2015 00:39:44 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=cumulusnetworks.com header.i=@cumulusnetworks.com header.b=MyLAjK4O; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752383AbbHMOjk (ORCPT ); Thu, 13 Aug 2015 10:39:40 -0400 Received: from mail-yk0-f177.google.com ([209.85.160.177]:36494 "EHLO mail-yk0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751931AbbHMOjj (ORCPT ); Thu, 13 Aug 2015 10:39:39 -0400 Received: by ykay144 with SMTP id y144so42633540yka.3 for ; Thu, 13 Aug 2015 07:39:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cumulusnetworks.com; s=google; h=from:to:cc:subject:date:message-id; bh=Jze8nQWd3fn7/I3RcQmKzJkmB5lLHd2EAU+gYG1aid4=; b=MyLAjK4Oy6rUuF07yuzXzgfjdwsD4AU5yrpuo93bOLz53h8vsJOGGB1dw6oA0/IaUf YezcXkHRxQ6Wvan0HaTB6DQ9zaoSZ+i3ViUWv/i59JHrRdqO1Tmisb4RjV8ernoCRtDG hKEw34EFlfjPP2V/CRf7HPFeFHVM8Jhfo694Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Jze8nQWd3fn7/I3RcQmKzJkmB5lLHd2EAU+gYG1aid4=; b=PUwww/nSxMH/t5q5UK71qhFjB1Xrh1pA7mS+OBz9WipfA7QwVG7ldVYoA2LLBuch9i UEQL+j+6M19upFRcAH2H5GNYQVKDHlr14AP+7Hdc/6ile3RiaaSbg3PXboY07mwUcKv5 JYtjgT4ynrv5dlPGUJcOG+AnyprePx1gdb3E9x0VDNDBAU1d5sBmVNRd2M6J/tS9m6lF EL7J0dyWe3vqJI8ZSho36sH7FXrDGIRVaxF+RHrIs3YMvx7nXI1m0+Wy8XXypoe9ML+7 TEoZTGX2oSt8FH6SDL28mO8Fy8AzLlXT+rbnU0Fa9+adMhmJHFFuuaAGQpYEsxxDuq84 46Vg== X-Gm-Message-State: ALoCoQnL/OVaXaNDMKMqetEIykxP28+4004hurSnyRnKhJUjEmoSwmKDVqIqJ1/NONbTEZpnNUOn X-Received: by 10.13.239.1 with SMTP id y1mr39806027ywe.155.1439476778737; Thu, 13 Aug 2015 07:39:38 -0700 (PDT) Received: from fedora-devel.home.greyhouse.net (cpe-65-190-8-248.nc.res.rr.com. [65.190.8.248]) by smtp.googlemail.com with ESMTPSA id b9sm2187691ywa.38.2015.08.13.07.39.37 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Aug 2015 07:39:37 -0700 (PDT) From: Andy Gospodarek To: netdev@vger.kernel.org Cc: Andy Gospodarek , Dinesh Dutt Subject: [PATCH net-next v2 1/2] net: track link status of ipv6 nexthops Date: Thu, 13 Aug 2015 10:39:00 -0400 Message-Id: <1439476741-952-1-git-send-email-gospo@cumulusnetworks.com> X-Mailer: git-send-email 1.9.3 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Add support to track current link status of ipv6 nexthops to match recent changes that added support for ipv4 nexthops. This takes a simple approach to track linkdown status for next-hops and simply checks the dev for the dst entry and sets proper flags that to be used in the netlink message. v2: drop use of rt6i_nhflags since it is not needed right now Signed-off-by: Andy Gospodarek Signed-off-by: Dinesh Dutt --- I realize this patch might be a bit different expected based on conversations on netdev yesterday, but I got a few off-list communications that indicated a preference to not expand rt6_info at this time -- despite the fact that expansion will likely be needed for switchdev offload of ipv6 fib entries in the near future. net/ipv6/route.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 54fccf0..26b51e1 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -2885,6 +2885,8 @@ static int rt6_fill_node(struct net *net, else rtm->rtm_type = RTN_UNICAST; rtm->rtm_flags = 0; + if (!netif_carrier_ok(rt->dst.dev)) + rtm->rtm_flags |= RTNH_F_LINKDOWN; rtm->rtm_scope = RT_SCOPE_UNIVERSE; rtm->rtm_protocol = rt->rt6i_protocol; if (rt->rt6i_flags & RTF_DYNAMIC)