]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bfdd: remove profiles when removing bfd node
authorIgor Ryzhov <iryzhov@nfware.com>
Thu, 1 Apr 2021 12:29:18 +0000 (15:29 +0300)
committerIgor Ryzhov <iryzhov@nfware.com>
Thu, 1 Apr 2021 12:29:18 +0000 (15:29 +0300)
Fixes #8379.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
bfdd/bfd.c
bfdd/bfd.h
bfdd/bfdd_nb_config.c

index c966efd8ea71ee93b2545aadee58b9128f5aa0a2..cf292a836354b58f89f71c57378218e2f3664031 100644 (file)
@@ -1889,6 +1889,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.
  */
index af3f92d6a8f802e6a7c6e7ecaad4f8e3d7bb74ea..9ee1da728717ccea6d2fe8ae069ef7b9f094ea96 100644 (file)
@@ -596,6 +596,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.
index 0046bc625b4503f674695d8627f751d0f3a11fe0..77f8cbd09c074f6ac0b76bb7dae7eb46b1deba5e 100644 (file)
@@ -203,6 +203,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: