]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Static: Fix merging of static routes with different metric
authorOndrej Zajicek (work) <santiago@crfreenet.org>
Tue, 17 Sep 2019 12:15:41 +0000 (14:15 +0200)
committerOndrej Zajicek (work) <santiago@crfreenet.org>
Tue, 17 Sep 2019 12:15:41 +0000 (14:15 +0200)
proto/static/static.c

index 0eec3144a64aa8f7d4719dd4d07eff3629c427d8..8ff9b291e7e9003abc976fca3e60f364acc3eab7 100644 (file)
@@ -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;
 }