diff options
author | David Ahern <dsahern@gmail.com> | 2017-07-05 14:41:46 -0600 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-07-06 10:48:01 +0100 |
commit | f06b7549b79e29a672336d4e134524373fb7a232 (patch) | |
tree | fd4cee9ed88cffa5de743b4745bfc96bcc427376 /net/ipv6/route.c | |
parent | 05a6b4cae8c0cc1680c9dd33a97a49a13c0f01bc (diff) | |
download | op-kernel-dev-f06b7549b79e29a672336d4e134524373fb7a232.zip op-kernel-dev-f06b7549b79e29a672336d4e134524373fb7a232.tar.gz |
net: ipv6: Compare lwstate in detecting duplicate nexthops
Lennert reported a failure to add different mpls encaps in a multipath
route:
$ ip -6 route add 1234::/16 \
nexthop encap mpls 10 via fe80::1 dev ens3 \
nexthop encap mpls 20 via fe80::1 dev ens3
RTNETLINK answers: File exists
The problem is that the duplicate nexthop detection does not compare
lwtunnel configuration. Add it.
Fixes: 19e42e451506 ("ipv6: support for fib route lwtunnel encap attributes")
Signed-off-by: David Ahern <dsahern@gmail.com>
Reported-by: João Taveira Araújo <joao.taveira@gmail.com>
Reported-by: Lennert Buytenhek <buytenh@wantstofly.org>
Acked-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Tested-by: Lennert Buytenhek <buytenh@wantstofly.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/route.c')
-rw-r--r-- | net/ipv6/route.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 0488a24c..4d30c96 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -3036,17 +3036,11 @@ static int ip6_route_info_append(struct list_head *rt6_nh_list, struct rt6_info *rt, struct fib6_config *r_cfg) { struct rt6_nh *nh; - struct rt6_info *rtnh; int err = -EEXIST; list_for_each_entry(nh, rt6_nh_list, next) { /* check if rt6_info already exists */ - rtnh = nh->rt6_info; - - if (rtnh->dst.dev == rt->dst.dev && - rtnh->rt6i_idev == rt->rt6i_idev && - ipv6_addr_equal(&rtnh->rt6i_gateway, - &rt->rt6i_gateway)) + if (rt6_duplicate_nexthop(nh->rt6_info, rt)) return err; } |