]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Merge branch 'mq-aggregator-for-v3' into thread-next
authorMaria Matejka <mq@ucw.cz>
Thu, 9 Nov 2023 16:38:31 +0000 (17:38 +0100)
committerMaria Matejka <mq@ucw.cz>
Thu, 9 Nov 2023 16:38:31 +0000 (17:38 +0100)
1  2 
nest/config.Y
nest/mpls.Y
nest/mpls.c
proto/l3vpn/l3vpn.c

diff --cc nest/config.Y
Simple merge
diff --cc nest/mpls.Y
index 6cf1f909d1dc5263c272769ab0c9d745ce3e104d,0e755fec84aa58a02fc5b1545ec84202f2d6e982..1628800f677e4f7fb1d9c386e48c641ce745b001
@@@ -53,13 -53,13 +53,15 @@@ mpls_domain_end: { mpls_domain_postconf
  
  mpls_range: mpls_range_start mpls_range_opt_list mpls_range_end;
  
--mpls_range_start: LABEL RANGE symbol
--{
--  if (($3->class == SYM_KEYWORD) && ($3->keyword->value == STATIC))
++mpls_range_start: LABEL RANGE STATIC {
      this_mpls_range = this_mpls_domain->static_range;
--  else if (($3->class == SYM_KEYWORD) && ($3->keyword->value == DYNAMIC))
++};
++
++mpls_range_start: LABEL RANGE DYNAMIC {
      this_mpls_range = this_mpls_domain->dynamic_range;
--  else
++};
++
++mpls_range_start: LABEL RANGE symbol {
      this_mpls_range = mpls_range_config_new(this_mpls_domain, $3);
  };
  
diff --cc nest/mpls.c
index 0effb3392b71b576b39a34e5b32ee788b92894f8,b57eb992832403f44adaf6951d4926ee92741dd3..944659f920841d30aa48d64220f050f60893ba23
@@@ -1074,27 -1041,40 +1074,28 @@@ mpls_get_key_attrs(struct mpls_fec_map 
  }
  
  static void
 -mpls_announce_fec(struct mpls_fec_map *m, struct mpls_fec *fec, const rta *src)
 +mpls_announce_fec(struct mpls_fec_map *m, struct mpls_fec *fec, ea_list *src)
  {
 -  rta *a = allocz(RTA_MAX_SIZE);
 -
 -  a->source = m->mpls_rts;
 -  a->scope = m->mpls_scope;
 -
 -  if (!src->hostentry)
 -  {
 -    /* Just copy the nexthop */
 -    a->dest = src->dest;
 -    nexthop_link(a, &src->nh);
 -  }
 -  else
 -  {
 -    const u32 *labels = &src->nh.label[src->nh.labels - src->nh.labels_orig];
 -    mpls_label_stack ms;
++  rte e = {
++    .src = m->channel->proto->main_source,
++  };
 -    /* Reconstruct the original labelstack */
 -    ms.len = src->nh.labels_orig;
 -    memcpy(ms.stack, labels, src->nh.labels_orig * sizeof(u32));
++  ea_set_attr_u32(&e.attrs, &ea_gen_source, 0, m->mpls_rts);
 +  /* Check existence of hostentry */
 +  const struct eattr *heea = ea_find_by_class(src, &ea_gen_hostentry);
 +  if (heea) {
      /* The same hostentry, but different dependent table */
 -    struct hostentry *s = src->hostentry;
 -    rta_set_recursive_next_hop(m->channel->table, a, s->owner, s->addr, s->link, &ms);
 +    struct hostentry_adata *head = SKIP_BACK(struct hostentry_adata, ad, heea->u.ad);
 +    struct hostentry *he = head->he;
-     ea_set_hostentry(&src, m->channel->table, he->owner, he->addr, he->link,
++    ea_set_hostentry(&e.attrs, m->channel->table, he->owner, he->addr, he->link,
 +      HOSTENTRY_LABEL_COUNT(head), head->labels);
    }
  
    net_addr_mpls n = NET_ADDR_MPLS(fec->label);
  
-   rte e = {
-     .src = m->channel->proto->main_source,
-     .attrs = src,
-   };
 -  rte *e = rte_get_temp(rta_lookup(a), m->channel->proto->main_source);
 -  e->pflags = 0;
--
    fec->state = MPLS_FEC_CLEAN;
 -  rte_update2(m->channel, (net_addr *) &n, e, m->channel->proto->main_source);
 +  rte_update(m->channel, (net_addr *) &n, &e, m->channel->proto->main_source);
  }
  
  static void
index eace62d0950b14fa405c6ec6f3146dfcd76d6027,2952f32b7171cfd05b5b3012f7990ce8950e7684..a3c5de9c6f35342c13f283f7a26d29246534c961
@@@ -403,12 -379,15 +409,14 @@@ l3vpn_start(struct proto *P
    p->rd = cf->rd;
    p->import_target = cf->import_target;
    p->export_target = cf->export_target;
+   p->export_target_data = NULL;
  
-   l3vpn_prepare_targets(p);
+   l3vpn_prepare_import_targets(p);
+   l3vpn_prepare_export_targets(p);
  
 -  proto_setup_mpls_map(P, RTS_L3VPN, 1);
 +  proto_setup_mpls_map(P, RTS_L3VPN);
  
 -  if (P->vrf_set)
 -    P->mpls_map->vrf_iface = P->vrf;
 +  P->mpls_map->vrf_iface = P->vrf;
  
    return PS_UP;
  }
@@@ -436,36 -415,43 +444,43 @@@ l3vpn_reconfigure(struct proto *P, stru
        !proto_configure_channel(P, &P->mpls_channel, proto_cf_find_channel(CF, NET_MPLS)))
      return 0;
  
-   if ((p->rd != cf->rd) ||
-       !same_tree(p->import_target, cf->import_target) ||
-       !same_tree(p->export_target, cf->export_target))
+   if (p->rd != cf->rd)
      return 0;
  
-   /*
-   if (!same_tree(p->import_target, cf->import_target))
+   int import_changed = !same_tree(p->import_target, cf->import_target);
+   int export_changed = !same_tree(p->export_target, cf->export_target);
+   /* Update pointers to config structures */
+   p->import_target = cf->import_target;
+   p->export_target = cf->export_target;
 -  proto_setup_mpls_map(P, RTS_L3VPN, 1);
++  proto_setup_mpls_map(P, RTS_L3VPN);
+   if (import_changed)
    {
+     TRACE(D_EVENTS, "Import target changed");
+     l3vpn_prepare_import_targets(p);
      if (p->vpn4_channel && (p->vpn4_channel->channel_state == CS_UP))
--      channel_request_feeding(p->vpn4_channel);
++      channel_request_feeding_dynamic(p->vpn4_channel, CFRT_AUXILIARY);
  
      if (p->vpn6_channel && (p->vpn6_channel->channel_state == CS_UP))
--      channel_request_feeding(p->vpn6_channel);
++      channel_request_feeding_dynamic(p->vpn6_channel, CFRT_AUXILIARY);
    }
  
-   if (!same_tree(p->export_target, cf->export_target))
+   if (export_changed)
    {
+     TRACE(D_EVENTS, "Export target changed");
+     l3vpn_prepare_export_targets(p);
      if (p->ip4_channel && (p->ip4_channel->channel_state == CS_UP))
--      channel_request_feeding(p->ip4_channel);
++      channel_request_feeding_dynamic(p->ip4_channel, CFRT_AUXILIARY);
  
      if (p->ip6_channel && (p->ip6_channel->channel_state == CS_UP))
--      channel_request_feeding(p->ip6_channel);
++      channel_request_feeding_dynamic(p->ip6_channel, CFRT_AUXILIARY);
    }
-   */
-   /* Update pointers to config structures */
-   p->import_target = cf->import_target;
-   p->export_target = cf->export_target;
-   proto_setup_mpls_map(P, RTS_L3VPN);
  
    return 1;
  }