summaryrefslogtreecommitdiffstats
path: root/pimd
diff options
context:
space:
mode:
authorKaren Schoener <karen@volta.io>2020-03-06 16:33:40 +0100
committerKaren Schoener <karen@volta.io>2020-03-23 14:17:17 +0100
commit17da84a49dd665edf50d646d86e52cdf2c4c19b7 (patch)
tree011923776c9c4bf65c50e8296ce51de8434cf9cf /pimd
parentMerge pull request #5916 from mjstapp/fix_gmtime (diff)
downloadfrr-17da84a49dd665edf50d646d86e52cdf2c4c19b7.tar.xz
frr-17da84a49dd665edf50d646d86e52cdf2c4c19b7.zip
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 'pimd')
-rw-r--r--pimd/pim_zlookup.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/pimd/pim_zlookup.c b/pimd/pim_zlookup.c
index fc486f499..84fac4f95 100644
--- a/pimd/pim_zlookup.c
+++ b/pimd/pim_zlookup.c
@@ -61,6 +61,14 @@ static int zclient_lookup_connect(struct thread *t)
zlookup->fail = 0; /* reset counter on connection */
}
+ if (zclient_send_hello(zlookup) < 0) {
+ if (close(zlookup->sock)) {
+ zlog_warn("%s: closing fd=%d: errno=%d %s", __func__,
+ zlookup->sock, errno, safe_strerror(errno));
+ }
+ zlookup->sock = -1;
+ }
+
if (zlookup->sock < 0) {
/* Since last connect failed, retry within 10 secs */
zclient_lookup_sched(zlookup, 10);
@@ -125,7 +133,10 @@ void zclient_lookup_free(void)
void zclient_lookup_new(void)
{
- zlookup = zclient_new(router->master, &zclient_options_default);
+ struct zclient_options options = zclient_options_default;
+ options.synchronous = true;
+
+ zlookup = zclient_new(router->master, &options);
if (!zlookup) {
flog_err(EC_LIB_ZAPI_SOCKET, "%s: zclient_new() failure",
__func__);
@@ -161,6 +172,7 @@ static int zclient_read_nexthop(struct pim_instance *pim,
if (PIM_DEBUG_PIM_NHT_DETAIL) {
char addr_str[INET_ADDRSTRLEN];
+
pim_inet4_dump("<addr?>", addr, addr_str, sizeof(addr_str));
zlog_debug("%s: addr=%s(%s)", __func__, addr_str,
pim->vrf->name);