Skip to content

Commit

Permalink
Merge pull request #17558 from donaldsharp/bfd_fix
Browse files Browse the repository at this point in the history
lib: Fix session re-establishment
  • Loading branch information
Jafaral authored Dec 4, 2024
2 parents 267dc19 + 2c6fcbd commit 9797f20
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/bfd.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ enum bfd_session_event {
BSE_UNINSTALL,
/** Install the BFD session configuration. */
BSE_INSTALL,
/** We should install but it couldn't because of a error talking to zebra */
BSE_VALID_FOR_INSTALL,
};

/**
Expand Down Expand Up @@ -527,6 +529,10 @@ static void _bfd_sess_send(struct event *t)
vrf_id_to_name(bsp->args.vrf_id), bsp->args.vrf_id,
bsp->lastev == BSE_INSTALL ? "installed"
: "uninstalled");

bsp->installed = false;
if (bsp->lastev == BSE_INSTALL)
bsp->lastev = BSE_VALID_FOR_INSTALL;
}
}

Expand Down Expand Up @@ -883,7 +889,7 @@ int zclient_bfd_session_replay(ZAPI_CALLBACK_ARGS)
/* Replay all activated peers. */
TAILQ_FOREACH (bsp, &bsglobal.bsplist, entry) {
/* Skip not installed sessions. */
if (!bsp->installed)
if (!bsp->installed && bsp->lastev != BSE_VALID_FOR_INSTALL)
continue;

/* We are reconnecting, so we must send installation. */
Expand Down

0 comments on commit 9797f20

Please sign in to comment.