]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: pay attention to metric from kernel (ECMP version)
authorRenato Westphal <renato@opensourcerouting.org>
Tue, 5 Sep 2017 14:38:25 +0000 (11:38 -0300)
committerRenato Westphal <renato@opensourcerouting.org>
Thu, 21 Sep 2017 16:27:50 +0000 (13:27 -0300)
Commit f19435a8 fixed rib_add() but didn't fix rib_add_multipath().

While here, remove the unnecessary 'same->table == re->table' check as
it always evaluate to true.

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

index 297a4ab95bbeda66a6a647fb657dac9904831df5..bc39ffeacf19b9451f358a5b7e95ed4746bf3294 100644 (file)
@@ -2253,8 +2253,14 @@ int rib_add_multipath(afi_t afi, safi_t safi, struct prefix *p,
                if (CHECK_FLAG(same->status, ROUTE_ENTRY_REMOVED))
                        continue;
 
-               if (same->type == re->type && same->instance == re->instance
-                   && same->table == re->table && !RIB_SYSTEM_ROUTE(same))
+               if (same->type != re->type)
+                       continue;
+               if (same->instance != re->instance)
+                       continue;
+               if (same->type == ZEBRA_ROUTE_KERNEL &&
+                   same->metric != re->metric)
+                       continue;
+               if (!RIB_SYSTEM_ROUTE(same))
                        break;
        }