From f674dfe234515156eca7618bf2fc647ccfd34787 Mon Sep 17 00:00:00 2001 From: Renato Westphal Date: Wed, 20 Sep 2017 00:05:25 -0300 Subject: [PATCH] zebra: implement recursive MPLS labels When a nexthop is resolved via a label based nexthop, copy the labels into the newly created recursive nexthop. Please note that this does not fix the case where we have a label based nexthop that is recursively resolved through *another* nexthop that is also label based. In this case we need to create a new label stack for those routes. Signed-off-by: Renato Westphal --- zebra/zebra_rib.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index 41e14459b1..f7f05ba68a 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -372,6 +372,12 @@ static void nexthop_set_resolved(afi_t afi, struct nexthop *newhop, break; } + /* Copy labels of the resolved route */ + if (newhop->nh_label) + nexthop_add_labels(resolved_hop, newhop->nh_label_type, + newhop->nh_label->num_labels, + &newhop->nh_label->label[0]); + resolved_hop->rparent = nexthop; nexthop_add(&nexthop->resolved, resolved_hop); } -- 2.39.5