summaryrefslogtreecommitdiff
path: root/lib/libfrr.c
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2021-04-22 13:18:19 +0200
committerDavid Lamparter <equinox@opensourcerouting.org>2021-04-22 13:20:34 +0200
commitbf645e31f696a42f60fbd5361beefd4ee707b25e (patch)
tree952e683a3afb6bb0cd98529b0d46fff06bacbbef /lib/libfrr.c
parent2bafda27a602f74a592551bf695438218efd62f4 (diff)
lib: add frr_config_pre hook
... for any initialization that needs to run after forking, but that would be racy if it were just scheduled on the thread_master (since the config load is also just a thread callback, ordering would be undefined for another scheduled thread callback.) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'lib/libfrr.c')
-rw-r--r--lib/libfrr.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/libfrr.c b/lib/libfrr.c
index ee02e019e3..38f994bdfc 100644
--- a/lib/libfrr.c
+++ b/lib/libfrr.c
@@ -46,6 +46,7 @@
#include "frrscript.h"
DEFINE_HOOK(frr_late_init, (struct thread_master * tm), (tm));
+DEFINE_HOOK(frr_config_pre, (struct thread_master * tm), (tm));
DEFINE_HOOK(frr_config_post, (struct thread_master * tm), (tm));
DEFINE_KOOH(frr_early_fini, (), ());
DEFINE_KOOH(frr_fini, (), ());
@@ -931,6 +932,8 @@ static void frr_daemonize(void)
*/
static int frr_config_read_in(struct thread *t)
{
+ hook_call(frr_config_pre, master);
+
if (!vty_read_config(vty_shared_candidate_config, di->config_file,
config_default)
&& di->backup_config_file) {