1
0
mirror of https://gitlab.labs.nic.cz/labs/bird.git synced 2024-05-11 16:54:54 +00:00

MPLS: Fix issue with recursive MPLS routes

Recursive MPLS routes used hostentry from the original route, which
triggered different table than MPLS table, and therefore were not
updated.
This commit is contained in:
Ondrej Zajicek
2023-10-16 15:21:36 +02:00
committed by Maria Matejka
parent 3611555883
commit a0b4835253
3 changed files with 8 additions and 3 deletions

View File

@@ -838,10 +838,13 @@ mpls_announce_fec(struct mpls_fec_map *m, struct mpls_fec *fec, const rta *src)
const u32 *labels = &src->nh.label[src->nh.labels - src->nh.labels_orig];
mpls_label_stack ms;
/* Apply the hostentry with the original labelstack */
/* Reconstruct the original labelstack */
ms.len = src->nh.labels_orig;
memcpy(ms.stack, labels, src->nh.labels_orig * sizeof(u32));
rta_apply_hostentry(a, src->hostentry, &ms);
/* 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);
}
net_addr_mpls n = NET_ADDR_MPLS(fec->label);