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);
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 */
return he;
he = hc_new_hostentry(hc, tab->rp, a, link, dep, k);
+ he->owner = tab;
rt_update_hostentry(tab, he);
return he;
}