diff options
| author | David Lamparter <equinox@opensourcerouting.org> | 2021-04-22 13:18:19 +0200 |
|---|---|---|
| committer | David Lamparter <equinox@opensourcerouting.org> | 2021-04-22 13:20:34 +0200 |
| commit | bf645e31f696a42f60fbd5361beefd4ee707b25e (patch) | |
| tree | 952e683a3afb6bb0cd98529b0d46fff06bacbbef /lib/libfrr.h | |
| parent | 2bafda27a602f74a592551bf695438218efd62f4 (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.h')
| -rw-r--r-- | lib/libfrr.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/libfrr.h b/lib/libfrr.h index 114e631226..47ded8f313 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); |
