]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
ipv6: Allow non-gateway ECMP for IPv6
authorThomas Winter <Thomas.Winter@alliedtelesis.co.nz>
Mon, 30 Apr 2018 21:15:29 +0000 (09:15 +1200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 1 May 2018 18:23:33 +0000 (14:23 -0400)
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>
include/net/ip6_route.h
net/ipv6/ip6_fib.c

index 08b132381984f9fe748dd0be066bb897c8536b4d..abceb5864d995633fcaf76676828031ef4c956fc 100644 (file)
@@ -68,8 +68,7 @@ static inline bool rt6_need_strict(const struct in6_addr *daddr)
 
 static inline bool rt6_qualify_for_ecmp(const struct rt6_info *rt)
 {
-       return (rt->rt6i_flags & (RTF_GATEWAY|RTF_ADDRCONF|RTF_DYNAMIC)) ==
-              RTF_GATEWAY;
+       return (rt->rt6i_flags & (RTF_ADDRCONF | RTF_DYNAMIC)) == 0;
 }
 
 void ip6_route_input(struct sk_buff *skb);
index deab2db6692eb526e88c85c5e9e20e52020c9e94..3c97c29d44013d27ad96d62c156bf1ebbdbf7e02 100644 (file)
@@ -934,9 +934,6 @@ static int fib6_add_rt2node(struct fib6_node *fn, struct rt6_info *rt,
                         * list.
                         * Only static routes (which don't have flag
                         * RTF_EXPIRES) are used for ECMPv6.
-                        *
-                        * To avoid long list, we only had siblings if the
-                        * route have a gateway.
                         */
                        if (rt_can_ecmp &&
                            rt6_qualify_for_ecmp(iter))