summaryrefslogtreecommitdiff
path: root/ldpd/lde_lib.c
diff options
context:
space:
mode:
authorRenato Westphal <renatowestphal@gmail.com>2016-09-28 12:25:18 -0300
committerDonald Sharp <sharpd@cumulusnetworks.com>2016-09-28 16:05:42 -0400
commitdaca38aecede78f3d4b1cc93ccd0623c250c4778 (patch)
treed67d3bc6f4d5f2b5e0db058553e0e0fcb23b5772 /ldpd/lde_lib.c
parent134970a2a183d5021a1de42e8eede2fc3aa32e56 (diff)
ldpd: always advertise labels upon receiving a redistributed route
Whenever a routing daemon advertises a new version of a route to zebra, zebra removes the old version of this route (implicit withdraw) and then create a new 'rib' structure for the new version of the route. In this process, the previously received label(s) from ldpd are lost. This is because upon receiving a ZEBRA_MPLS_LABELS_ADD message, zebra only adds a label to a nexthop of an existing route. And routes are volatile, they can be removed while being updated. To workaround this issue, this patch makes ldpd always advertise the appropriate labels whenever it receives a redistributed route, even if it was already received before (an older version). This way, when ldpd receives the updated version of a route, it will readvertise the appropriate label(s) and zebra will reinstall them. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'ldpd/lde_lib.c')
-rw-r--r--ldpd/lde_lib.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/ldpd/lde_lib.c b/ldpd/lde_lib.c
index c72a25985d..43e5f92f2f 100644
--- a/ldpd/lde_lib.c
+++ b/ldpd/lde_lib.c
@@ -336,6 +336,7 @@ lde_kernel_insert(struct fec *fec, int af, union ldpd_addr *nexthop,
fn = fec_add(fec);
fnh = fec_nh_find(fn, af, nexthop, priority);
if (fnh != NULL) {
+ lde_send_change_klabel(fn, fnh);
fnh->flags |= F_FEC_NH_NEW;
return;
}