mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-07 05:42:21 +00:00
zebra: notify data plane providers about shutdown
Call the `dp_fini` callback twice: once at the beginning of the shutdown and then again right before `exit()`ing zebra. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
This commit is contained in:
parent
9d73613388
commit
6ba8db2186
@ -3557,12 +3557,20 @@ bool dplane_is_in_shutdown(void)
|
|||||||
*/
|
*/
|
||||||
void zebra_dplane_pre_finish(void)
|
void zebra_dplane_pre_finish(void)
|
||||||
{
|
{
|
||||||
|
struct zebra_dplane_provider *dp;
|
||||||
|
|
||||||
if (IS_ZEBRA_DEBUG_DPLANE)
|
if (IS_ZEBRA_DEBUG_DPLANE)
|
||||||
zlog_debug("Zebra dataplane pre-fini called");
|
zlog_debug("Zebra dataplane pre-fini called");
|
||||||
|
|
||||||
zdplane_info.dg_is_shutdown = true;
|
zdplane_info.dg_is_shutdown = true;
|
||||||
|
|
||||||
/* TODO -- Notify provider(s) of pending shutdown */
|
/* Notify provider(s) of pending shutdown. */
|
||||||
|
TAILQ_FOREACH(dp, &zdplane_info.dg_providers_q, dp_prov_link) {
|
||||||
|
if (dp->dp_fini == NULL)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
dp->dp_fini(dp, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -3863,6 +3871,8 @@ done:
|
|||||||
*/
|
*/
|
||||||
void zebra_dplane_shutdown(void)
|
void zebra_dplane_shutdown(void)
|
||||||
{
|
{
|
||||||
|
struct zebra_dplane_provider *dp;
|
||||||
|
|
||||||
if (IS_ZEBRA_DEBUG_DPLANE)
|
if (IS_ZEBRA_DEBUG_DPLANE)
|
||||||
zlog_debug("Zebra dataplane shutdown called");
|
zlog_debug("Zebra dataplane shutdown called");
|
||||||
|
|
||||||
@ -3881,7 +3891,13 @@ void zebra_dplane_shutdown(void)
|
|||||||
zdplane_info.dg_pthread = NULL;
|
zdplane_info.dg_pthread = NULL;
|
||||||
zdplane_info.dg_master = NULL;
|
zdplane_info.dg_master = NULL;
|
||||||
|
|
||||||
/* TODO -- Notify provider(s) of final shutdown */
|
/* Notify provider(s) of final shutdown. */
|
||||||
|
TAILQ_FOREACH(dp, &zdplane_info.dg_providers_q, dp_prov_link) {
|
||||||
|
if (dp->dp_fini == NULL)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
dp->dp_fini(dp, false);
|
||||||
|
}
|
||||||
|
|
||||||
/* TODO -- Clean-up provider objects */
|
/* TODO -- Clean-up provider objects */
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user