]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Merge commit 'f18968f5' into thread-next
authorMaria Matejka <mq@ucw.cz>
Tue, 12 Jul 2022 13:05:04 +0000 (15:05 +0200)
committerMaria Matejka <mq@ucw.cz>
Tue, 12 Jul 2022 13:05:04 +0000 (15:05 +0200)
1  2 
nest/rt-table.c

diff --cc nest/rt-table.c
index 50ddc141d13e66ca8aa9d0c2c81bd5bee79863de,2dcb2e261da100e289de29724552625ab7d5b3d1..3f8c7a83f6fc6f1162a69c0f01c4cfc58bca1cb7
@@@ -3572,10 -2648,11 +3572,13 @@@ rt_update_hostentry(rtable *tab, struc
    if (n)
      {
        struct rte_storage *e = n->routes;
 -      rta *a = e->rte.attrs;
 -      word pref = a->pref;
 +      ea_list *a = e->rte.attrs;
-       pxlen = n->n.addr->pxlen;
++      u32 pref = rt_get_preference(&e->rte);
  
-       if (ea_find(a, &ea_gen_hostentry))
+       for (struct rte_storage *ee = n->routes; ee; ee = ee->next)
 -      if ((ee->rte.attrs->pref >= pref) && ee->rte.attrs->hostentry)
++      if (rte_is_valid(&ee->rte) &&
++          (rt_get_preference(&ee->rte) >= pref) &&
++          ea_find(ee->rte.attrs, &ea_gen_hostentry))
        {
          /* Recursive route should not depend on another recursive route */
          log(L_WARN "Next hop address %I resolvable through recursive route for %N",
          goto done;
        }
  
 -      if (a->dest == RTD_UNICAST)
 -      {
 -        for (struct nexthop *nh = &(a->nh); nh; nh = nh->next)
+       pxlen = n->n.addr->pxlen;
 +      eattr *nhea = ea_find(a, &ea_gen_nexthop);
 +      ASSERT_DIE(nhea);
 +      struct nexthop_adata *nhad = (void *) nhea->u.ptr;
 +
 +      if (NEXTHOP_IS_REACHABLE(nhad))
 +        NEXTHOP_WALK(nh, nhad)
            if (ipa_zero(nh->gw))
              {
                if (if_local_addr(he->addr, nh->iface))