Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib: Fix session re-establishment #17558

Merged
merged 1 commit into from
Dec 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading