summaryrefslogtreecommitdiff
path: root/ldpd/lde.c
diff options
context:
space:
mode:
authorKaren Schoener <karen@volta.io>2020-03-06 10:33:40 -0500
committerKaren Schoener <karen@volta.io>2020-03-23 09:17:17 -0400
commit17da84a49dd665edf50d646d86e52cdf2c4c19b7 (patch)
tree011923776c9c4bf65c50e8296ce51de8434cf9cf /ldpd/lde.c
parent5d2724ec2564b648bf93dc7b164a1398cde3c214 (diff)
zebra: Synchronous client queues accumulate messages from zebra.
Zebra is currently sending messages on interface add/delete/update, VRF add/delete, and interface address change - regardless of whether its clients had requested them. This is problematic for lde and isis, which only listens to label chunk messages, and only when it is waiting for one (synchronous client). The effect is the that messages accumulate on the lde synchronous message queue. With this change: - Zebra does not send unsolicited messages to synchronous clients. - Synchronous clients send a ZEBRA_HELLO to zebra. The ZEBRA_HELLO contains a new boolean field: sychronous. - LDP and PIM have been updated to send a ZEBRA_HELLO for their synchronous clients. Signed-off-by: Karen Schoener <karen@voltanet.io>
Diffstat (limited to 'ldpd/lde.c')
-rw-r--r--ldpd/lde.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/ldpd/lde.c b/ldpd/lde.c
index 006d27f6ab..ff5598380a 100644
--- a/ldpd/lde.c
+++ b/ldpd/lde.c
@@ -1631,8 +1631,11 @@ lde_address_list_free(struct lde_nbr *ln)
static void zclient_sync_init(unsigned short instance)
{
+ struct zclient_options options = zclient_options_default;
+ options.synchronous = true;
+
/* Initialize special zclient for synchronous message exchanges. */
- zclient_sync = zclient_new(master, &zclient_options_default);
+ zclient_sync = zclient_new(master, &options);
zclient_sync->sock = -1;
zclient_sync->redist_default = ZEBRA_ROUTE_LDP;
zclient_sync->instance = instance;
@@ -1645,6 +1648,12 @@ static void zclient_sync_init(unsigned short instance)
/* make socket non-blocking */
sock_set_nonblock(zclient_sync->sock);
+ /* Send hello to notify zebra this is a synchronous client */
+ while (zclient_send_hello(zclient_sync) < 0) {
+ log_warnx("Error sending hello for synchronous zclient!");
+ sleep(1);
+ }
+
/* Connect to label manager */
while (lm_label_manager_connect(zclient_sync, 0) != 0) {
log_warnx("Error connecting to label manager!");