diff options
Diffstat (limited to 'nest/rt-table.c')
-rw-r--r-- | nest/rt-table.c | 11 |
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; |