diff options
author | David Ahern <dsa@cumulusnetworks.com> | 2016-10-24 12:27:23 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-11-15 07:48:53 +0100 |
commit | d46b19687feca220e933f8d92844151154a51775 (patch) | |
tree | bf8d97140485865a99e04595bebefe3975ad6f66 /net | |
parent | eb77db88ea11e334816ceb5a537d775c1fc3fb72 (diff) | |
download | lwn-d46b19687feca220e933f8d92844151154a51775.tar.gz lwn-d46b19687feca220e933f8d92844151154a51775.zip |
net: ipv6: Do not consider link state for nexthop validation
[ Upstream commit d5d32e4b76687f4df9ad3ba8d3702b7347f51fa6 ]
Similar to IPv4, do not consider link state when validating next hops.
Currently, if the link is down default routes can fail to insert:
$ ip -6 ro add vrf blue default via 2100:2::64 dev eth2
RTNETLINK answers: No route to host
With this patch the command succeeds.
Fixes: 8c14586fc320 ("net: ipv6: Use passed in table for nexthop lookups")
Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv6/route.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 269218aacbea..23153ac6c9b9 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -656,7 +656,8 @@ static struct rt6_info *find_match(struct rt6_info *rt, int oif, int strict, struct net_device *dev = rt->dst.dev; if (dev && !netif_carrier_ok(dev) && - idev->cnf.ignore_routes_with_linkdown) + idev->cnf.ignore_routes_with_linkdown && + !(strict & RT6_LOOKUP_F_IGNORE_LINKSTATE)) goto out; if (rt6_check_expired(rt)) @@ -1050,6 +1051,7 @@ struct rt6_info *ip6_pol_route(struct net *net, struct fib6_table *table, int strict = 0; strict |= flags & RT6_LOOKUP_F_IFACE; + strict |= flags & RT6_LOOKUP_F_IGNORE_LINKSTATE; if (net->ipv6.devconf_all->forwarding == 0) strict |= RT6_LOOKUP_F_REACHABLE; @@ -1783,7 +1785,7 @@ static struct rt6_info *ip6_nh_lookup_table(struct net *net, }; struct fib6_table *table; struct rt6_info *rt; - int flags = RT6_LOOKUP_F_IFACE; + int flags = RT6_LOOKUP_F_IFACE | RT6_LOOKUP_F_IGNORE_LINKSTATE; table = fib6_get_table(net, cfg->fc_table); if (!table) |