]> git.puffer.fish Git - mirror/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:49:18 +0000 (15:49 +0300)
Fixes #8379.

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

index 234fc6d397c1509333718e67d535c50d33c55898..18f331e201083d1b3b2650aa17798a3d5c67f0b8 100644 (file)
@@ -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.
  */
index a86c1bb9f316ecc28f24e696e6477eb94c1fa1e1..d9d5d8cb5ea74b9c477d5034048d52bace7ab857 100644 (file)
@@ -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.
index 26bce4f357f4748d21dfbeb2d5b43214d99cc110..33adca793bbaa8274a8a769afb4fc6dea0246aaf 100644 (file)
@@ -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: