summaryrefslogtreecommitdiff
path: root/nest/rt-table.c
diff options
context:
space:
mode:
authorMikael Magnusson <mikma@users.sourceforge.net>2023-11-25 23:38:46 +0100
committerMikael Magnusson <mikma@users.sourceforge.net>2023-11-25 23:38:46 +0100
commitb26801568ed5aa75797d752b1de458cc4bcac152 (patch)
treea10f4d613305fd77d540283952111d9a2f893549 /nest/rt-table.c
parent03ed8f17dc5c8399ed81bef22e34c62301a3cad1 (diff)
parent333ddd4f981b90d5d3dff166b6abf9bf40bede9f (diff)
Merge commit '333ddd4f' into wireguard-next-tmp7-1
Diffstat (limited to 'nest/rt-table.c')
-rw-r--r--nest/rt-table.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/nest/rt-table.c b/nest/rt-table.c
index 5e677465..6eaee069 100644
--- a/nest/rt-table.c
+++ b/nest/rt-table.c
@@ -98,6 +98,7 @@
#include "nest/route.h"
#include "nest/protocol.h"
#include "nest/iface.h"
+#include "nest/mpls.h"
#include "lib/resource.h"
#include "lib/event.h"
#include "lib/timer.h"
@@ -1559,9 +1560,10 @@ rte_update_unlock(void)
void
rte_update2(struct channel *c, const net_addr *n, rte *new, struct rte_src *src)
{
- // struct proto *p = c->proto;
+ struct proto *p = c->proto;
struct proto_stats *stats = &c->stats;
const struct filter *filter = c->in_filter;
+ struct mpls_fec *fec = NULL;
net *nn;
ASSERT(c->channel_state == CS_UP);
@@ -1610,6 +1612,10 @@ rte_update2(struct channel *c, const net_addr *n, rte *new, struct rte_src *src)
new->flags |= REF_FILTERED;
}
}
+
+ if (p->mpls_map)
+ mpls_handle_rte(p->mpls_map, n, new, rte_update_pool, &fec);
+
if (!rta_is_cached(new->attrs)) /* Need to copy attributes */
new->attrs = rta_lookup(new->attrs);
new->flags |= REF_COW;
@@ -1634,6 +1640,9 @@ rte_update2(struct channel *c, const net_addr *n, rte *new, struct rte_src *src)
/* And recalculate the best route */
rte_recalculate(c, nn, new, src);
+ if (p->mpls_map)
+ mpls_handle_rte_cleanup(p->mpls_map, &fec);
+
rte_update_unlock();
return;