aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIdo Schimmel <idosch@mellanox.com>2018-05-02 15:41:56 -0400
committerDavid S. Miller <davem@davemloft.net>2018-05-02 16:33:02 -0400
commit30ca22e4a5d0063dd9a9cdf35cd139c5807cbeb3 (patch)
tree062c2d521125bed978582d9f4e6d46987f1ce019
parent784813aed6ba24a1f24e7e11d9d0f208cee37a7d (diff)
ipv6: Revert "ipv6: Allow non-gateway ECMP for IPv6"
This reverts commit edd7ceb78296 ("ipv6: Allow non-gateway ECMP for IPv6"). Eric reported a division by zero in rt6_multipath_rebalance() which is caused by above commit that considers identical local routes to be siblings. The division by zero happens because a nexthop weight is not set for local routes. Revert the commit as it does not fix a bug and has side effects. To reproduce: # ip -6 address add 2001:db8::1/64 dev dummy0 # ip -6 address add 2001:db8::1/64 dev dummy1 Fixes: edd7ceb78296 ("ipv6: Allow non-gateway ECMP for IPv6") Signed-off-by: Ido Schimmel <idosch@mellanox.com> Reported-by: Eric Dumazet <eric.dumazet@gmail.com> Tested-by: Eric Dumazet <edumazet@google.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, 5 insertions, 1 deletions
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h
index abceb5864d99..08b132381984 100644
--- a/include/net/ip6_route.h
+++ b/include/net/ip6_route.h
@@ -68,7 +68,8 @@ 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_ADDRCONF | RTF_DYNAMIC)) == 0; 71 return (rt->rt6i_flags & (RTF_GATEWAY|RTF_ADDRCONF|RTF_DYNAMIC)) ==
72 RTF_GATEWAY;
72} 73}
73 74
74void ip6_route_input(struct sk_buff *skb); 75void ip6_route_input(struct sk_buff *skb);
diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
index 3c97c29d4401..deab2db6692e 100644
--- a/net/ipv6/ip6_fib.c
+++ b/net/ipv6/ip6_fib.c
@@ -934,6 +934,9 @@ 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.
937 */ 940 */
938 if (rt_can_ecmp && 941 if (rt_can_ecmp &&
939 rt6_qualify_for_ecmp(iter)) 942 rt6_qualify_for_ecmp(iter))