From 3cf4d4191d4d20508de9838c35ec4ad72a552457 Mon Sep 17 00:00:00 2001 From: "Ondrej Zajicek (work)" Date: Tue, 17 Sep 2019 14:15:41 +0200 Subject: [PATCH] Static: Fix merging of static routes with different metric --- proto/static/static.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/proto/static/static.c b/proto/static/static.c index 0eec3144a..8ff9b291e 100644 --- a/proto/static/static.c +++ b/proto/static/static.c @@ -374,9 +374,11 @@ static_rte_better(struct rte *new, struct rte *old) } static int -static_rte_mergable(rte *pri UNUSED, rte *sec UNUSED) +static_rte_mergable(rte *pri, rte *sec) { - return 1; + u32 a = ea_get_int(pri->attrs->eattrs, EA_GEN_IGP_METRIC, IGP_METRIC_UNKNOWN); + u32 b = ea_get_int(sec->attrs->eattrs, EA_GEN_IGP_METRIC, IGP_METRIC_UNKNOWN); + return a == b; } -- 2.47.2