forked from Mirror/frr
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>
This commit is contained in:
parent
9c463972e7
commit
416745628e
|
@ -153,7 +153,9 @@ static void sigint(void)
|
||||||
for (ALL_LIST_ELEMENTS(zrouter.client_list, ln, nn, client))
|
for (ALL_LIST_ELEMENTS(zrouter.client_list, ln, nn, client))
|
||||||
zserv_close_client(client);
|
zserv_close_client(client);
|
||||||
|
|
||||||
|
zserv_close();
|
||||||
list_delete_all_node(zrouter.client_list);
|
list_delete_all_node(zrouter.client_list);
|
||||||
|
|
||||||
zebra_ptm_finish();
|
zebra_ptm_finish();
|
||||||
|
|
||||||
if (retain_mode)
|
if (retain_mode)
|
||||||
|
|
|
@ -773,6 +773,18 @@ static int zserv_accept(struct thread *thread)
|
||||||
return 0;
|
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)
|
void zserv_start(char *path)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
|
@ -183,6 +183,13 @@ extern unsigned int multipath_num;
|
||||||
*/
|
*/
|
||||||
extern void zserv_init(void);
|
extern void zserv_init(void);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Stop the Zebra API server.
|
||||||
|
*
|
||||||
|
* closes the socket
|
||||||
|
*/
|
||||||
|
extern void zserv_close(void);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Start Zebra API server.
|
* Start Zebra API server.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in a new issue