summaryrefslogtreecommitdiff
path: root/zebra/zserv.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2019-02-09 16:38:34 -0500
committerDonald Sharp <sharpd@cumulusnetworks.com>2019-03-27 16:19:28 -0400
commit416745628e73d8889e43bb153e365aa5225f22a5 (patch)
treed142a1c146a6fb339d301a5ed77071a13f95eb31 /zebra/zserv.c
parent9c463972e712d129b8ea801bfede871181e6f455 (diff)
zebra: When shutting down actually close the socket
When shutting down and we have a very large table to shutdown and after we've intentionally closed all the client connections close the zebra zserv client socket. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'zebra/zserv.c')
-rw-r--r--zebra/zserv.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/zebra/zserv.c b/zebra/zserv.c
index 6532491cef..f5bb3aabb7 100644
--- a/zebra/zserv.c
+++ b/zebra/zserv.c
@@ -773,6 +773,18 @@ static int zserv_accept(struct thread *thread)
return 0;
}
+void zserv_close(void)
+{
+ /*
+ * On shutdown, let's close the socket down
+ * so that long running processes of killing the
+ * routing table doesn't leave us in a bad
+ * state where a client tries to reconnect
+ */
+ close(zsock);
+ zsock = -1;
+}
+
void zserv_start(char *path)
{
int ret;