summaryrefslogtreecommitdiff
path: root/ldpd
diff options
context:
space:
mode:
authorßingen <bingen@voltanet.io>2017-04-26 11:50:21 +0200
committerßingen <bingen@voltanet.io>2017-05-11 19:20:08 +0200
commit5c7ef8dc4fee3521a225aec0a3d42912a5bfd247 (patch)
tree44fbde87a6fd0b8373c92f895109654d6fe3aea2 /ldpd
parent42025b43f265c042116d9432cf4d34aeb79152f6 (diff)
lm: Make relay label manager async
To avoid blocking zebra when it's acting as a proxy for an external label manager. Besides: Fix get chunk reconnection. Socket was still being destroyed on failure, so next attempt would never work. Filter out unwanted messages in lm sync sock. Until LDE client sends ZEBRA_LABEL_MANAGER_CONNECT message, zserv doesn't know which kind of client it is, so it might enqueue unwanted messages like interface add, interface up, etc. Changes in this commit discard those messages in the client side in case they arrive before the expected response. Change function name for zclient_connect in label manager to avoid confusion with zclient one. Signed-off-by: ßingen <bingen@voltanet.io>
Diffstat (limited to 'ldpd')
-rw-r--r--ldpd/lde.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ldpd/lde.c b/ldpd/lde.c
index d8a2924b31..36998e7cf8 100644
--- a/ldpd/lde.c
+++ b/ldpd/lde.c
@@ -140,6 +140,8 @@ zclient_sync_init(u_short instance)
fprintf(stderr, "Error connecting synchronous zclient!\n");
lde_sleep();
}
+ /* make socket non-blocking */
+ sock_set_nonblock(zclient_sync->sock);
/* Connect to label manager */
while (lm_label_manager_connect (zclient_sync) != 0) {
@@ -1596,8 +1598,6 @@ lde_get_label_chunk(void)
if (ret < 0)
{
log_warnx("Error getting label chunk!");
- close(zclient_sync->sock);
- zclient_sync->sock = -1;
return -1;
}