summaryrefslogtreecommitdiff
path: root/lib/vty.c
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2019-10-09 22:17:08 -0300
committerRenato Westphal <renato@opensourcerouting.org>2019-10-11 21:18:36 -0300
commit91f9fd78cb32396e95567fc59ec9741b620c22be (patch)
tree88781f91e3e645226c210ea9c433881dc2c32336 /lib/vty.c
parent5e6a9350c16f54113eeedb497c98fe45b8ce6222 (diff)
lib: optimize loading of the startup configuration
Load the startup configuration directly into the CLI shared candidate configuration instead of loading it into a private candidate configuration. This way we don't need to initialize the shared candidate separately later as a copy of the running configuration, which is a potentially expensive operation. Also, make the northbound process SIGHUP correctly even when --tcli is not used. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'lib/vty.c')
-rw-r--r--lib/vty.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/vty.c b/lib/vty.c
index 502d2c9d04..c08e5e151a 100644
--- a/lib/vty.c
+++ b/lib/vty.c
@@ -2341,8 +2341,7 @@ static void vty_read_file(struct nb_config *config, FILE *confp)
* Automatically commit the candidate configuration after
* reading the configuration file.
*/
- if (config == NULL && vty->candidate_config
- && frr_get_cli_mode() == FRR_CLI_TRANSACTIONAL) {
+ if (config == NULL) {
ret = nb_candidate_commit(vty->candidate_config, NB_CLIENT_CLI,
vty, true, "Read configuration file",
NULL);