diff mbox

[net-next,v2,1/2] net: track link status of ipv6 nexthops

Message ID 1439476741-952-1-git-send-email-gospo@cumulusnetworks.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Andy Gospodarek Aug. 13, 2015, 2:39 p.m. UTC
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 <gospo@cumulusnetworks.com>
Signed-off-by: Dinesh Dutt <ddutt@cumulusnetworks.com>
---

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(+)

Comments

David Miller Aug. 14, 2015, 4:27 a.m. UTC | #1
From: Andy Gospodarek <gospo@cumulusnetworks.com>
Date: Thu, 13 Aug 2015 10:39:00 -0400

> 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 <gospo@cumulusnetworks.com>
> Signed-off-by: Dinesh Dutt <ddutt@cumulusnetworks.com>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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)