diff options
| author | Christian Hopps <chopps@labn.net> | 2023-05-19 04:25:57 -0400 |
|---|---|---|
| committer | Christian Hopps <chopps@labn.net> | 2023-05-30 02:10:20 -0400 |
| commit | 5ba5613077c78f99ef14715bd56c796f2bfc2d95 (patch) | |
| tree | e693e035083dce3c545c33b7704ea8fcf147b6d5 /lib/libfrr.c | |
| parent | e13a5c4165835f1e5a462866d8bf38c3ad42a73e (diff) | |
lib: mgmtd: add manual vty server start option and use it
Signed-off-by: Christian Hopps <chopps@labn.net>
Diffstat (limited to 'lib/libfrr.c')
| -rw-r--r-- | lib/libfrr.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/libfrr.c b/lib/libfrr.c index e890057269..33237df5fc 100644 --- a/lib/libfrr.c +++ b/lib/libfrr.c @@ -1036,7 +1036,7 @@ void frr_config_fork(void) zlog_tls_buffer_init(); } -static void frr_vty_serv(void) +void frr_vty_serv_start(void) { /* allow explicit override of vty_path in the future * (not currently set anywhere) */ @@ -1058,7 +1058,15 @@ static void frr_vty_serv(void) di->vty_path = vtypath_default; } - vty_serv_sock(di->vty_addr, di->vty_port, di->vty_path); + vty_serv_start(di->vty_addr, di->vty_port, di->vty_path); +} + +void frr_vty_serv_stop(void) +{ + vty_serv_stop(); + + if (di->vty_path) + unlink(di->vty_path); } static void frr_check_detach(void) @@ -1155,7 +1163,8 @@ void frr_run(struct event_loop *master) { char instanceinfo[64] = ""; - frr_vty_serv(); + if (!(di->flags & FRR_MANUAL_VTY_START)) + frr_vty_serv_start(); if (di->instance) snprintf(instanceinfo, sizeof(instanceinfo), "instance %u ", |
