]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: fix detection of duplicate kernel routes (ECMP version)
authorRenato Westphal <renato@opensourcerouting.org>
Wed, 20 Sep 2017 22:04:26 +0000 (19:04 -0300)
committerRenato Westphal <renato@opensourcerouting.org>
Thu, 21 Sep 2017 16:27:50 +0000 (13:27 -0300)
Fixes the following bug:
% ip route add 50.0.0.0/8 nexthop via 10.0.1.2 nexthop via 10.0.2.2
% ip route replace 50.0.0.0/8 nexthop via 10.0.1.3 nexthop via 10.0.2.3
% ip route replace 50.0.0.0/8 nexthop via 10.0.1.4 nexthop via 10.0.2.4
%
% vtysh -c "show ip route"
[snip]
K * 50.0.0.0/8 [0/0] via 10.0.1.4, rt1-eth1, 00:00:00
  *                  via 10.0.2.4, rt1-eth2, 00:00:00
K * 50.0.0.0/8 [0/0] via 10.0.1.3, rt1-eth1, 00:00:10
  *                  via 10.0.2.3, rt1-eth2, 00:00:10
K>* 50.0.0.0/8 [0/0] via 10.0.1.2, rt1-eth1, 00:00:24
  *                  via 10.0.2.2, rt1-eth2, 00:00:24

Commit a3d18ce6 fixed a similar problem for single-path routes.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
zebra/zebra_rib.c

index bc39ffeacf19b9451f358a5b7e95ed4746bf3294..13057e0ae41e79805ff226ba3f943a80cb1795f3 100644 (file)
@@ -2260,7 +2260,11 @@ int rib_add_multipath(afi_t afi, safi_t safi, struct prefix *p,
                if (same->type == ZEBRA_ROUTE_KERNEL &&
                    same->metric != re->metric)
                        continue;
-               if (!RIB_SYSTEM_ROUTE(same))
+               /*
+                * We should allow duplicate connected routes because of
+                * IPv6 link-local routes and unnumbered interfaces on Linux.
+                */
+               if (same->type != ZEBRA_ROUTE_CONNECT)
                        break;
        }