aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Winter <Thomas.Winter@alliedtelesis.co.nz>2018-04-30 17:15:29 -0400
committerDavid S. Miller <davem@davemloft.net>2018-05-01 14:23:33 -0400
commitedd7ceb78296fb1574958991b6655c3c2cedf124 (patch)
tree77b37435ded8db11a3be72f83157d37b03bacef0
parentd656fe49e33df48ee6bc19e871f5862f49895c9e (diff)
ipv6: Allow non-gateway ECMP for IPv6
It is valid to have static routes where the nexthop is an interface not an address such as tunnels. For IPv4 it was possible to use ECMP on these routes but not for IPv6. Signed-off-by: Thomas Winter <Thomas.Winter@alliedtelesis.co.nz> Cc: David Ahern <dsahern@gmail.com> Cc: "David S. Miller" <davem@davemloft.net> Cc: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru> Cc: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org> Acked-by: David Ahern <dsahern@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--include/net/ip6_route.h3
-rw-r--r--net/ipv6/ip6_fib.c3
2 files changed, 1 insertions, 5 deletions
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h
index 08b132381984..abceb5864d99 100644
--- a/include/net/ip6_route.h
+++ b/include/net/ip6_route.h
@@ -68,8 +68,7 @@ static inline bool rt6_need_strict(const struct in6_addr *daddr)
68 68
69static inline bool rt6_qualify_for_ecmp(const struct rt6_info *rt) 69static inline bool rt6_qualify_for_ecmp(const struct rt6_info *rt)
70{ 70{
71 return (rt->rt6i_flags & (RTF_GATEWAY|RTF_ADDRCONF|RTF_DYNAMIC)) == 71 return (rt->rt6i_flags & (RTF_ADDRCONF | RTF_DYNAMIC)) == 0;
72 RTF_GATEWAY;
73} 72}
74 73
75void ip6_route_input(struct sk_buff *skb); 74void ip6_route_input(struct sk_buff *skb);
diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
index deab2db6692e..3c97c29d4401 100644
--- a/net/ipv6/ip6_fib.c
+++ b/net/ipv6/ip6_fib.c
@@ -934,9 +934,6 @@ static int fib6_add_rt2node(struct fib6_node *fn, struct rt6_info *rt,
934 * list. 934 * list.
935 * Only static routes (which don't have flag 935 * Only static routes (which don't have flag
936 * RTF_EXPIRES) are used for ECMPv6. 936 * RTF_EXPIRES) are used for ECMPv6.
937 *
938 * To avoid long list, we only had siblings if the
939 * route have a gateway.
940 */ 937 */
941 if (rt_can_ecmp && 938 if (rt_can_ecmp &&
942 rt6_qualify_for_ecmp(iter)) 939 rt6_qualify_for_ecmp(iter))