From b5e9e5197bb75c4d7c8f19b1e76b31f9defcb915 Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Mon, 16 Oct 2023 15:21:36 +0200 Subject: 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. --- nest/mpls.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'nest/mpls.c') diff --git a/nest/mpls.c b/nest/mpls.c index e37535c5..9cdcd572 100644 --- a/nest/mpls.c +++ b/nest/mpls.c @@ -1059,10 +1059,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); -- cgit v1.2.3