From: Renato Westphal Date: Wed, 20 Sep 2017 22:04:26 +0000 (-0300) Subject: zebra: fix detection of duplicate kernel routes (ECMP version) X-Git-Tag: frr-4.0-dev~277^2~1 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=844b3a8748cce00fdcc913d7ff89f181b7fd9dd1;p=mirror%2Ffrr.git zebra: fix detection of duplicate kernel routes (ECMP version) 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 --- diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index bc39ffeacf..13057e0ae4 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -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; }