mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-08 03:28:31 +00:00
lib: fix possible crash on BFD notification
Allow sessions to remove themselves from the notifications without risking crashes. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
This commit is contained in:
parent
b38f1fd03d
commit
464e6541b1
@ -1080,7 +1080,7 @@ static int zclient_bfd_session_reply(ZAPI_CALLBACK_ARGS)
|
|||||||
|
|
||||||
static int zclient_bfd_session_update(ZAPI_CALLBACK_ARGS)
|
static int zclient_bfd_session_update(ZAPI_CALLBACK_ARGS)
|
||||||
{
|
{
|
||||||
struct bfd_session_params *bsp;
|
struct bfd_session_params *bsp, *bspn;
|
||||||
size_t sessions_updated = 0;
|
size_t sessions_updated = 0;
|
||||||
struct interface *ifp;
|
struct interface *ifp;
|
||||||
int remote_cbit = false;
|
int remote_cbit = false;
|
||||||
@ -1137,7 +1137,7 @@ static int zclient_bfd_session_update(ZAPI_CALLBACK_ARGS)
|
|||||||
now = monotime(NULL);
|
now = monotime(NULL);
|
||||||
|
|
||||||
/* Notify all matching sessions about update. */
|
/* Notify all matching sessions about update. */
|
||||||
TAILQ_FOREACH (bsp, &bsglobal.bsplist, entry) {
|
TAILQ_FOREACH_SAFE (bsp, &bsglobal.bsplist, entry, bspn) {
|
||||||
/* Skip not installed entries. */
|
/* Skip not installed entries. */
|
||||||
if (!bsp->installed)
|
if (!bsp->installed)
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
Reference in New Issue
Block a user