]> git.puffer.fish Git - matthieu/frr.git/commit
lib: mgmtd: fix too early daemon detach of mgmtd
authorChristian Hopps <chopps@labn.net>
Tue, 23 Jul 2024 21:42:07 +0000 (17:42 -0400)
committerChristian Hopps <chopps@labn.net>
Tue, 23 Jul 2024 21:50:33 +0000 (17:50 -0400)
commitbe9a6fc0ea8180a4aaa558c5402ea543427e2e7e
tree14ae456978e4ca164ffe6ef83965f92ea1a64db7
parentf2d5bf7b67801c58a56251a774765d1311c1190b
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>
lib/libfrr.c
lib/libfrr.h
lib/vty.c