]> git.puffer.fish Git - mirror/frr.git/commit
lib: mgmtd: fix too early daemon detach of mgmtd 16458/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:34 +0000 (14:23 +0000)
commit609a84f4fd35ea441d88b31f9ef4a9566c80c65e
treea6e43e854d599d2adc61d8cea3c74cbe1ec8551e
parent066854e7da47404fc691f739ac9b53544977e98b
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