summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikael Magnusson <mikma@users.sourceforge.net>2023-11-25 23:59:55 +0100
committerMikael Magnusson <mikma@users.sourceforge.net>2023-11-25 23:59:55 +0100
commit6b8ab60b711b238065fc9411777b8b5cd6435e4a (patch)
treec58fd3726ad338e89cb752e562ea62fecca6c04e
parentd854968453a5a32c5bc786d0c83ab0040de17bea (diff)
parentb5e9e5197bb75c4d7c8f19b1e76b31f9defcb915 (diff)
Merge commit 'b5e9e519' into wireguard-next-tmp7-1
-rw-r--r--nest/mpls.c7
-rw-r--r--nest/route.h3
-rw-r--r--nest/rt-table.c1
3 files changed, 8 insertions, 3 deletions
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);
diff --git a/nest/route.h b/nest/route.h
index 7331ae97..7b277eed 100644
--- a/nest/route.h
+++ b/nest/route.h
@@ -244,7 +244,8 @@ struct hostentry {
ip_addr addr; /* IP address of host, part of key */
ip_addr link; /* (link-local) IP address of host, used as gw
if host is directly attached */
- struct rtable *tab; /* Dependent table, part of key */
+ rtable *tab; /* Dependent table, part of key */
+ rtable *owner; /* Nexthop owner table */
struct hostentry *next; /* Next in hash chain */
unsigned hash_key; /* Hash key */
unsigned uc; /* Use count */
diff --git a/nest/rt-table.c b/nest/rt-table.c
index e497524f..0ac18cf5 100644
--- a/nest/rt-table.c
+++ b/nest/rt-table.c
@@ -3663,6 +3663,7 @@ rt_get_hostentry(rtable *tab, ip_addr a, ip_addr ll, rtable *dep)
return he;
he = hc_new_hostentry(hc, tab->rp, a, link, dep, k);
+ he->owner = tab;
rt_update_hostentry(tab, he);
return he;
}