diff options
author | Renato Westphal <renato@opensourcerouting.org> | 2017-09-05 16:38:25 +0200 |
---|---|---|
committer | Renato Westphal <renato@opensourcerouting.org> | 2017-09-21 18:27:50 +0200 |
commit | eb327fa59048349c31e20a81e6509cdeea339d89 (patch) | |
tree | 3e390cd5e198f0de90c9cd68e71e7a2e83f27e68 /zebra | |
parent | zebra: plug memory leak in rib_add_multipath() (diff) | |
download | frr-eb327fa59048349c31e20a81e6509cdeea339d89.tar.xz frr-eb327fa59048349c31e20a81e6509cdeea339d89.zip |
zebra: pay attention to metric from kernel (ECMP version)
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>
Diffstat (limited to 'zebra')
-rw-r--r-- | zebra/zebra_rib.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index 297a4ab95..bc39ffeac 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -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; } |