During the shutdown phase don't attempt to apply settings to peers
as it is useless and will crash if the peer hash is gone.
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
void bfd_profile_free(struct bfd_profile *bp)
{
/* Detach from any session. */
- bfd_profile_detach(bp);
+ if (bglobal.bg_shutdown == false)
+ bfd_profile_detach(bp);
/* Remove from global list. */
TAILQ_REMOVE(&bplist, bp, entry);
struct zebra_privs_t bfdd_privs;
+ /**
+ * Daemon is exit()ing? Use this to avoid actions that expect a
+ * running system or to avoid unnecessary operations when quitting.
+ */
+ bool bg_shutdown;
+
/* Debug options. */
/* Show all peer state changes events. */
bool debug_peer_event;
static void sigterm_handler(void)
{
+ bglobal.bg_shutdown = true;
+
/* Signalize shutdown. */
frr_early_fini();