]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Merge commit '9efaf6ba' into tmp-bad-learn
authorMaria Matejka <mq@ucw.cz>
Thu, 29 Sep 2022 07:58:27 +0000 (09:58 +0200)
committerMaria Matejka <mq@ucw.cz>
Thu, 29 Sep 2022 07:59:32 +0000 (09:59 +0200)
Also fixed forgotten best route selection among alien routes.

1  2 
sysdep/unix/krt.c

index 4539feee5733c685caf52bc5e6da853342d61e39,67d19cbb4bea1584711c693756b6419f5bfedac2..93d19614931eeab85203d655873f38b6555b15fe
@@@ -974,6 -757,6 +757,14 @@@ krt_feed_end(struct channel *C
    krt_scan_timer_kick(p);
  }
  
++static int
++krt_rte_better(rte *new, rte *old)
++{
++  u32 n = ea_get_int(new->attrs, &ea_krt_metric, IGP_METRIC_UNKNOWN);
++  u32 o = ea_get_int(old->attrs, &ea_krt_metric, IGP_METRIC_UNKNOWN);
++
++  return (n < o);
++}
  
  /*
   *    Protocol glue
@@@ -1033,6 -816,6 +824,7 @@@ krt_init(struct proto_config *CF
    p->p.if_notify = krt_if_notify;
    p->p.reload_routes = krt_reload_routes;
    p->p.feed_end = krt_feed_end;
++  p->p.rte_better = krt_rte_better;
  
    krt_sys_init(p);
    return &p->p;