]> git.puffer.fish Git - mirror/frr.git/commit
lib: mgmtd: fix too early daemon detach of mgmtd 16459/head
authorChristian Hopps <chopps@labn.net>
Tue, 23 Jul 2024 21:42:07 +0000 (17:42 -0400)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Wed, 24 Jul 2024 14:23:40 +0000 (14:23 +0000)
commit3284a7325a4c5b7382a13b0fa9c98409168368fe
treede7db4fc4a8c120a34e6c3153d30d10b645fdb3d
parente612bc5075ffe09ecc41e8885dcd6729d5ce002b
lib: mgmtd: fix too early daemon detach of mgmtd

Correct FRR startup counts on a daemon's vty socket to be open when the
parent process exits. The parent process waits for `frr_check_detach()`
to be called by the child before exiting. The problem is when the
`FRR_MANUAL_VTY_START` flag is set the vty socket was not opened but
`frr_check_detach()` was called anyway.

Instead add a bool option for `frr_check_detach()` to be called when the
socket is opened with `frr_vty_serv_start()`, and do so when "manually"
calling said function (i.e., when FRR_MANUAL_VTY_START is set).

The `FRR_MANUAL_VTY_START` flag is only set by mgmtd. The reason we
wait to open the vty socket is so that mgmtd can parse the various
daemon specific config files it has taken over, after the event loop has
started, but before we receive any possible new config from `vtysh`.

fixes #16362

Signed-off-by: Christian Hopps <chopps@labn.net>
(cherry picked from commit be9a6fc0ea8180a4aaa558c5402ea543427e2e7e)
lib/libfrr.c
lib/libfrr.h
lib/vty.c