summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas@opensourcerouting.org>2023-09-28 09:03:06 +0200
committerGitHub <noreply@github.com>2023-09-28 09:03:06 +0200
commit0af454157655fa27a33d79ed60b4f6383cc283a9 (patch)
tree8fa5594d5abd58065d82de4382ca19292efc0c9a /lib
parentMerge pull request #14222 from opensourcerouting/doc/debian12 (diff)
parentvtysh: fix entering configuration node in file-lock mode (diff)
downloadfrr-0af454157655fa27a33d79ed60b4f6383cc283a9.tar.xz
frr-0af454157655fa27a33d79ed60b4f6383cc283a9.zip
Merge pull request #14498 from idryzhov/fix-conf-t-file-lock
Fixes for `file-lock` mode of configuration node
Diffstat (limited to 'lib')
-rw-r--r--lib/command.c4
-rw-r--r--lib/vty.c8
2 files changed, 10 insertions, 2 deletions
diff --git a/lib/command.c b/lib/command.c
index 1977dc4fa..86da488fd 100644
--- a/lib/command.c
+++ b/lib/command.c
@@ -1316,8 +1316,8 @@ DEFUN (config_terminal,
config_terminal_cmd,
"configure [terminal [file-lock]]",
"Configuration from vty interface\n"
- "Configuration with locked datastores\n"
- "Configuration terminal\n")
+ "Configuration terminal\n"
+ "Configuration with locked datastores\n")
{
return vty_config_enter(vty, false, false, argc == 3);
}
diff --git a/lib/vty.c b/lib/vty.c
index 15cc340eb..ed8b71ed2 100644
--- a/lib/vty.c
+++ b/lib/vty.c
@@ -2890,6 +2890,12 @@ int vty_config_enter(struct vty *vty, bool private_config, bool exclusive,
}
assert(vty->mgmt_locked_candidate_ds);
assert(vty->mgmt_locked_running_ds);
+
+ /*
+ * As datastores are locked explicitly, we don't need implicit
+ * commits and should allow pending changes.
+ */
+ vty->pending_allowed = true;
}
vty->node = CONFIG_NODE;
@@ -2946,6 +2952,8 @@ int vty_config_node_exit(struct vty *vty)
/* TODO: could we check for un-commited changes here? */
+ vty->pending_allowed = false;
+
if (vty->mgmt_locked_running_ds)
vty_mgmt_unlock_running_inline(vty);