summaryrefslogtreecommitdiffstats
path: root/lib/libfrr.h
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.h
parentlib: rename very_late_init hook to config_post (diff)
downloadfrr-bf645e31f696a42f60fbd5361beefd4ee707b25e.tar.xz
frr-bf645e31f696a42f60fbd5361beefd4ee707b25e.zip
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.h')
-rw-r--r--lib/libfrr.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/libfrr.h b/lib/libfrr.h
index 114e63122..47ded8f31 100644
--- a/lib/libfrr.h
+++ b/lib/libfrr.h
@@ -141,8 +141,12 @@ extern enum frr_cli_mode frr_get_cli_mode(void);
extern uint32_t frr_get_fd_limit(void);
extern bool frr_is_startup_fd(int fd);
+/* call order of these hooks is as ordered here */
DECLARE_HOOK(frr_late_init, (struct thread_master * tm), (tm));
+/* fork() happens between late_init and config_pre */
+DECLARE_HOOK(frr_config_pre, (struct thread_master * tm), (tm));
DECLARE_HOOK(frr_config_post, (struct thread_master * tm), (tm));
+
extern void frr_config_fork(void);
extern void frr_run(struct thread_master *master);