summaryrefslogtreecommitdiff
path: root/lib/command.c
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@users.noreply.github.com>2019-05-07 16:53:17 -0400
committerGitHub <noreply@github.com>2019-05-07 16:53:17 -0400
commit6915af74fd47378c422b24dc87579103a90ede86 (patch)
tree4235c445ab0a720d8c7d84fbe7f3adc0d98c7e00 /lib/command.c
parent6c90b756696900eb8cf649982b941659671558e1 (diff)
parentec2ac5f28a83c39b2df02279482494129ddaea28 (diff)
Merge pull request #4082 from opensourcerouting/grpc-nb-plugin
gRPC northbound plugin
Diffstat (limited to 'lib/command.c')
-rw-r--r--lib/command.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/command.c b/lib/command.c
index 559457c119..b3ef028004 100644
--- a/lib/command.c
+++ b/lib/command.c
@@ -1705,12 +1705,16 @@ static int vty_write_config(struct vty *vty)
vty_out(vty, "frr defaults %s\n", DFLT_NAME);
vty_out(vty, "!\n");
- for (i = 0; i < vector_active(cmdvec); i++)
- if ((node = vector_slot(cmdvec, i)) && node->func
- && (node->vtysh || vty->type != VTY_SHELL)) {
- if ((*node->func)(vty))
- vty_out(vty, "!\n");
- }
+ pthread_rwlock_rdlock(&running_config->lock);
+ {
+ for (i = 0; i < vector_active(cmdvec); i++)
+ if ((node = vector_slot(cmdvec, i)) && node->func
+ && (node->vtysh || vty->type != VTY_SHELL)) {
+ if ((*node->func)(vty))
+ vty_out(vty, "!\n");
+ }
+ }
+ pthread_rwlock_unlock(&running_config->lock);
if (vty->type == VTY_TERM) {
vty_out(vty, "end\n");