summaryrefslogtreecommitdiff
path: root/lib/lib_vty.c
diff options
context:
space:
mode:
authorPushpasis Sarkar <pushpasis.frr@gmail.com>2023-03-14 03:36:06 -0700
committerChristian Hopps <chopps@gmail.com>2023-03-22 05:22:56 +0000
commit1401ee8bf74b7688ca5f5bdfc3411734e9f0cb3b (patch)
tree04c63358d2e90417cf95dd0eee6968a3f9c08521 /lib/lib_vty.c
parentf82370b47bddb214d53ffb94775805d637300e9b (diff)
lib, mgmtd: Add few fixes for commit-check and rollback
This commit contains fixes for the following issues found - 'mgmt commit check' issued through 'vtysh -f' was actually commtting the changeset. - On config validation failure backend, mgmtd was not passing the correct error-reason to frontend. - 'mgmt rollback ...' was reverting the change on backend, but config on mgmtd daemon remains intact Signed-off-by: Pushpasis Sarkar <pushpasis@gmail.com>
Diffstat (limited to 'lib/lib_vty.c')
-rw-r--r--lib/lib_vty.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/lib_vty.c b/lib/lib_vty.c
index 91318e0d95..3e4dc9d78c 100644
--- a/lib/lib_vty.c
+++ b/lib/lib_vty.c
@@ -242,8 +242,16 @@ DEFUN_NOSH(end_config, end_config_cmd, "XFRR_end_configuration",
ret = nb_cli_pending_commit_check(vty);
zlog_info("Configuration Read in Took: %s", readin_time_str);
+ zlog_debug("%s: VTY:%p, pending SET-CFG: %u",
+ __func__, vty, (uint32_t)vty->mgmt_num_pending_setcfg);
- if (vty_mgmt_fe_enabled())
+ /*
+ * If (and only if) we have sent any CLI config commands to MGMTd
+ * FE interface using vty_mgmt_send_config_data() without implicit
+ * commit before, should we need to send an explicit COMMIT-REQ now
+ * to apply all those commands at once.
+ */
+ if (vty->mgmt_num_pending_setcfg && vty_mgmt_fe_enabled())
vty_mgmt_send_commit_config(vty, false, false);
if (callback.end_config)