diff options
author | Igor Ryzhov <iryzhov@nfware.com> | 2021-04-01 14:29:18 +0200 |
---|---|---|
committer | Igor Ryzhov <iryzhov@nfware.com> | 2021-04-01 14:49:18 +0200 |
commit | e93c3c003db40eb5c695c13253c58ec8e57c7bc3 (patch) | |
tree | 1055e0f6dfd74f7ff07c399c3e24e3b1d77f6949 /bfdd | |
parent | Merge pull request #8345 from dslicenc/frr-reload-vrf-static (diff) | |
download | frr-e93c3c003db40eb5c695c13253c58ec8e57c7bc3.tar.xz frr-e93c3c003db40eb5c695c13253c58ec8e57c7bc3.zip |
bfdd: remove profiles when removing bfd node
Fixes #8379.
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Diffstat (limited to 'bfdd')
-rw-r--r-- | bfdd/bfd.c | 8 | ||||
-rw-r--r-- | bfdd/bfd.h | 1 | ||||
-rw-r--r-- | bfdd/bfdd_nb_config.c | 1 |
3 files changed, 10 insertions, 0 deletions
diff --git a/bfdd/bfd.c b/bfdd/bfd.c index 234fc6d39..18f331e20 100644 --- a/bfdd/bfd.c +++ b/bfdd/bfd.c @@ -1941,6 +1941,14 @@ void bfd_sessions_remove_manual(void) hash_iterate(bfd_key_hash, _bfd_session_remove_manual, NULL); } +void bfd_profiles_remove(void) +{ + struct bfd_profile *bp; + + while ((bp = TAILQ_FIRST(&bplist)) != NULL) + bfd_profile_free(bp); +} + /* * Profile related hash functions. */ diff --git a/bfdd/bfd.h b/bfdd/bfd.h index a86c1bb9f..d9d5d8cb5 100644 --- a/bfdd/bfd.h +++ b/bfdd/bfd.h @@ -619,6 +619,7 @@ void bfd_session_free(struct bfd_session *bs); const struct bfd_session *bfd_session_next(const struct bfd_session *bs, bool mhop); void bfd_sessions_remove_manual(void); +void bfd_profiles_remove(void); /** * Set the BFD session echo state. diff --git a/bfdd/bfdd_nb_config.c b/bfdd/bfdd_nb_config.c index 26bce4f35..33adca793 100644 --- a/bfdd/bfdd_nb_config.c +++ b/bfdd/bfdd_nb_config.c @@ -246,6 +246,7 @@ int bfdd_bfd_destroy(struct nb_cb_destroy_args *args) case NB_EV_APPLY: bfd_sessions_remove_manual(); + bfd_profiles_remove(); break; case NB_EV_ABORT: |