]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Merge commit '8f79e6b9' into thread-next
authorMaria Matejka <mq@ucw.cz>
Mon, 7 Nov 2022 09:24:56 +0000 (10:24 +0100)
committerMaria Matejka <mq@ucw.cz>
Mon, 7 Nov 2022 09:24:56 +0000 (10:24 +0100)
1  2 
doc/bird.sgml
nest/rt-table.c
proto/bgp/bgp.c
proto/bgp/bgp.h
proto/bgp/config.Y
proto/bgp/packets.c

diff --cc doc/bird.sgml
Simple merge
diff --cc nest/rt-table.c
index 8980f147f823031fde248b4a10da7c33e04ef3dc,cb8c56a611ee89e653bdf7479c8baa46f20411b1..f4ca9170733a4478587c8954e9f7205e7129c450
@@@ -4727,19 -3594,16 +4727,20 @@@ rt_update_hostcache(void *data
        }
  
        if (rt_update_hostentry(tab, he))
 -      rt_schedule_nhu(he->tab);
 +      nhu_pending[he->tab->id] = he->tab;
      }
 +  }
  
 -  tab->hcu_scheduled = 0;
 +  for (uint i=0; i<rtable_max_id; i++)
 +    if (nhu_pending[i])
 +      RT_LOCKED(nhu_pending[i], dst)
 +      rt_schedule_nhu(dst);
  }
  
 -struct hostentry *
 -rt_get_hostentry(rtable *tab, ip_addr a, ip_addr ll, rtable *dep)
 +static struct hostentry *
 +rt_get_hostentry(struct rtable_private *tab, ip_addr a, ip_addr ll, rtable *dep)
  {
+   ip_addr link = ipa_zero(ll) ? a : ll;
    struct hostentry *he;
  
    if (!tab->hostcache)
diff --cc proto/bgp/bgp.c
Simple merge
diff --cc proto/bgp/bgp.h
Simple merge
index 9f0d230660b70f7c89000ed59bc4f7acabaea43b,2294119ea488a798f38cd695dc5b43142d453188..b4edf2c5f273f3bdb7f2097fe3bc5f9429290595
@@@ -29,9 -30,9 +29,9 @@@ CF_KEYWORDS(BGP, LOCAL, NEIGHBOR, AS, H
        GRACEFUL, RESTART, AWARE, CHECK, LINK, PORT, EXTENDED, MESSAGES, SETKEY,
        STRICT, BIND, CONFEDERATION, MEMBER, MULTICAST, FLOW4, FLOW6, LONG,
        LIVED, STALE, IMPORT, IBGP, EBGP, MANDATORY, INTERNAL, EXTERNAL, SETS,
 -      DYNAMIC, RANGE, NAME, DIGITS, BGP_AIGP, AIGP, ORIGINATE, COST, ENFORCE,
 +      DYNAMIC, RANGE, NAME, DIGITS, AIGP, ORIGINATE, COST, ENFORCE,
        FIRST, FREE, VALIDATE, BASE, ROLE, ROLES, PEER, PROVIDER, CUSTOMER,
-       RS_SERVER, RS_CLIENT, REQUIRE, BGP_OTC)
+       RS_SERVER, RS_CLIENT, REQUIRE, BGP_OTC, PREFER, GLOBAL)
  
  %type <i> bgp_nh
  %type <i32> bgp_afi
index f9c1da41387e8c4daddefa6b2924e54f26d094e4,c464e9c7e60d1a434573abdd53bbf6647cb845bc..506268c96bb4c88edafb14cc90e355f108c5422c
@@@ -1028,13 -1020,13 +1028,15 @@@ bgp_apply_next_hop(struct bgp_parse_sta
        WITHDRAW(BAD_NEXT_HOP " - zero address");
  
      rtable *tab = ipa_is_ip4(gw) ? c->igp_table_ip4 : c->igp_table_ip6;
 -    s->hostentry = rt_get_hostentry(tab, gw, lla, c->c.table);
 -
 -    if (!s->mpls)
 -      rta_apply_hostentry(a, s->hostentry, NULL);
+     ip_addr lla = (c->cf->next_hop_prefer == NHP_LOCAL) ? ll : IPA_NONE;
 -    /* With MPLS, hostentry is applied later in bgp_apply_mpls_labels() */
-       ea_set_hostentry(to, c->c.table, tab, gw, ll, BGP_MPLS_MAX, labels);
 +    if (s->mpls)
 +    {
 +      u32 labels[BGP_MPLS_MAX];
-       ea_set_hostentry(to, c->c.table, tab, gw, ll, 0, NULL);
++      ea_set_hostentry(to, c->c.table, tab, gw, lla, BGP_MPLS_MAX, labels);
 +    }
 +    else
++      ea_set_hostentry(to, c->c.table, tab, gw, lla, 0, NULL);
    }
  }