summaryrefslogtreecommitdiffstats
path: root/ldpd/ldpd.c
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2020-12-06 01:45:52 +0100
committerRenato Westphal <renato@opensourcerouting.org>2021-01-09 02:22:11 +0100
commit077d336aa7f543525c03de5a4617a2314c7ca984 (patch)
tree50cb5507a3be86de8db95d0691482c5e004c6550 /ldpd/ldpd.c
parentldpd: detect when route received from zebra hasn't changed (diff)
downloadfrr-077d336aa7f543525c03de5a4617a2314c7ca984.tar.xz
frr-077d336aa7f543525c03de5a4617a2314c7ca984.zip
ldpd: add support for RLFA clients
Add an API that allows IGP client daemons to register/unregister RLFAs with ldpd. IGP daemons need to be able to query the LDP labels needed by RLFAs and monitor label updates that might affect those RLFAs. This is similar to the NHT mechanism used by bgpd to resolve and monitor recursive nexthops. This API is based on the following ZAPI opaque messages: * LDP_RLFA_REGISTER: used by IGP daemons to register an RLFA with ldpd. * LDP_RLFA_UNREGISTER_ALL: used by IGP daemons to unregister all of their RLFAs with ldpd. * LDP_RLFA_LABELS: used by ldpd to send RLFA labels to the registered clients. For each RLFA, ldpd needs to return the following labels: * Outer label(s): the labels advertised by the adjacent routers to reach the PQ node; * Inner label: the label advertised by the PQ node to reach the RLFA destination. For the inner label, ldpd automatically establishes a targeted neighborship with the PQ node if one doesn't already exist. For that to work, the PQ node needs to be configured to accept targeted hello messages. If that doesn't happen, ldpd doesn't send a response to the IGP client daemon which in turn won't be able to activate the previously computed RLFA. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'ldpd/ldpd.c')
-rw-r--r--ldpd/ldpd.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/ldpd/ldpd.c b/ldpd/ldpd.c
index d6da45c86..83e93ebbb 100644
--- a/ldpd/ldpd.c
+++ b/ldpd/ldpd.c
@@ -625,6 +625,7 @@ main_dispatch_lde(struct thread *thread)
struct imsg imsg;
ssize_t n;
int shut = 0;
+ struct zapi_rlfa_response *rlfa_labels;
iev->ev_read = NULL;
@@ -691,6 +692,15 @@ main_dispatch_lde(struct thread *thread)
fatalx("IMSG_ACL_CHECK imsg with wrong len");
ldp_acl_reply(iev, (struct acl_check *)imsg.data);
break;
+ case IMSG_RLFA_LABELS:
+ if (imsg.hdr.len != IMSG_HEADER_SIZE +
+ sizeof(struct zapi_rlfa_response)) {
+ log_warnx("%s: wrong imsg len", __func__);
+ break;
+ }
+ rlfa_labels = imsg.data;
+ ldp_zebra_send_rlfa_labels(rlfa_labels);
+ break;
default:
log_debug("%s: error handling imsg %d", __func__,
imsg.hdr.type);