summaryrefslogtreecommitdiffstats
path: root/net/ipv6/route.c
diff options
context:
space:
mode:
authorDavid Ahern <dsa@cumulusnetworks.com>2016-10-24 15:27:23 -0400
committerDavid S. Miller <davem@davemloft.net>2016-10-27 16:33:12 -0400
commitd5d32e4b76687f4df9ad3ba8d3702b7347f51fa6 (patch)
tree2457e16e66036cd52467f4abdf938df45b475aea /net/ipv6/route.c
parent830218c1add1da16519b71909e5cf21522b7d062 (diff)
net: ipv6: Do not consider link state for nexthop validation
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>
Diffstat (limited to 'net/ipv6/route.c')
-rw-r--r--net/ipv6/route.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 3ac19eb81a86..947ed1ded026 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -658,7 +658,8 @@ static struct rt6_info *find_match(struct rt6_info *rt, int oif, int strict,
658 struct net_device *dev = rt->dst.dev; 658 struct net_device *dev = rt->dst.dev;
659 659
660 if (dev && !netif_carrier_ok(dev) && 660 if (dev && !netif_carrier_ok(dev) &&
661 idev->cnf.ignore_routes_with_linkdown) 661 idev->cnf.ignore_routes_with_linkdown &&
662 !(strict & RT6_LOOKUP_F_IGNORE_LINKSTATE))
662 goto out; 663 goto out;
663 664
664 if (rt6_check_expired(rt)) 665 if (rt6_check_expired(rt))
@@ -1052,6 +1053,7 @@ struct rt6_info *ip6_pol_route(struct net *net, struct fib6_table *table,
1052 int strict = 0; 1053 int strict = 0;
1053 1054
1054 strict |= flags & RT6_LOOKUP_F_IFACE; 1055 strict |= flags & RT6_LOOKUP_F_IFACE;
1056 strict |= flags & RT6_LOOKUP_F_IGNORE_LINKSTATE;
1055 if (net->ipv6.devconf_all->forwarding == 0) 1057 if (net->ipv6.devconf_all->forwarding == 0)
1056 strict |= RT6_LOOKUP_F_REACHABLE; 1058 strict |= RT6_LOOKUP_F_REACHABLE;
1057 1059
@@ -1791,7 +1793,7 @@ static struct rt6_info *ip6_nh_lookup_table(struct net *net,
1791 }; 1793 };
1792 struct fib6_table *table; 1794 struct fib6_table *table;
1793 struct rt6_info *rt; 1795 struct rt6_info *rt;
1794 int flags = RT6_LOOKUP_F_IFACE; 1796 int flags = RT6_LOOKUP_F_IFACE | RT6_LOOKUP_F_IGNORE_LINKSTATE;
1795 1797
1796 table = fib6_get_table(net, cfg->fc_table); 1798 table = fib6_get_table(net, cfg->fc_table);
1797 if (!table) 1799 if (!table)