]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Fixed a rarely used part of Babel: comparing two routes in table by their metric
authorMaria Matejka <mq@ucw.cz>
Fri, 22 Jul 2022 13:48:20 +0000 (15:48 +0200)
committerMaria Matejka <mq@ucw.cz>
Fri, 22 Jul 2022 13:48:20 +0000 (15:48 +0200)
proto/babel/babel.c

index 7ea1aba89431579bb06a869ff6ee417761185177..ecfd2763d737a697900d2c7df5777a0fac07bc98 100644 (file)
@@ -2338,8 +2338,8 @@ babel_rt_notify(struct proto *P, struct channel *c UNUSED, struct network *net,
 static int
 babel_rte_better(struct rte *new, struct rte *old)
 {
-  uint new_metric = ea_find(new->attrs->eattrs, EA_BABEL_SEQNO)->u.data;
-  uint old_metric = ea_find(old->attrs->eattrs, EA_BABEL_SEQNO)->u.data;
+  uint new_metric = ea_get_int(new->attrs->eattrs, EA_BABEL_METRIC, BABEL_INFINITY);
+  uint old_metric = ea_get_int(old->attrs->eattrs, EA_BABEL_METRIC, BABEL_INFINITY);
 
   return new_metric < old_metric;
 }