From: Ondrej Zajicek (work) Date: Tue, 17 Sep 2019 12:15:41 +0000 (+0200) Subject: Static: Fix merging of static routes with different metric X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3cf4d4191d4d20508de9838c35ec4ad72a552457;p=thirdparty%2Fbird.git Static: Fix merging of static routes with different metric --- 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; }