From 05948a4d98f587a0ce2cb7f22421ef9216235636 Mon Sep 17 00:00:00 2001 From: Igor Ryzhov Date: Wed, 24 Jan 2024 22:59:07 +0200 Subject: [PATCH] lib: use shared candidate between vty and mgmtd client When the daemon is partially mgmtd-converted, it receives configuration from vty and mgmtmd simultaneosly. This configuration must be synchronized. Signed-off-by: Igor Ryzhov --- lib/mgmt_be_client.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/mgmt_be_client.c b/lib/mgmt_be_client.c index 458623844a..463aefdf25 100644 --- a/lib/mgmt_be_client.c +++ b/lib/mgmt_be_client.c @@ -19,6 +19,7 @@ #include "northbound.h" #include "stream.h" #include "sockopt.h" +#include "northbound_cli.h" #include "lib/mgmt_be_client_clippy.c" @@ -1068,7 +1069,7 @@ struct mgmt_be_client *mgmt_be_client_create(const char *client_name, client->name = XSTRDUP(MTYPE_MGMTD_BE_CLIENT_NAME, client_name); client->running_config = running_config; - client->candidate_config = nb_config_new(NULL); + client->candidate_config = vty_shared_candidate_config; if (cbs) client->cbs = *cbs; mgmt_be_txns_init(&client->txn_head); @@ -1107,7 +1108,6 @@ void mgmt_be_client_destroy(struct mgmt_be_client *client) msg_client_cleanup(&client->client); mgmt_be_cleanup_all_txns(client); mgmt_be_txns_fini(&client->txn_head); - nb_config_free(client->candidate_config); XFREE(MTYPE_MGMTD_BE_CLIENT_NAME, client->name); XFREE(MTYPE_MGMTD_BE_CLIENT, client);