summaryrefslogtreecommitdiff
path: root/lib/vty.c
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2016-09-27 16:53:25 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2016-10-07 09:09:52 -0400
commitcc933ef9f6a6104f287415d97e22bf6e34f193d4 (patch)
tree552c08a261ad070972d989ca3de38efc1bc28a69 /lib/vty.c
parent8ff5a39992b1b8ef53f40b0c49970af4cee07974 (diff)
lib, isisd: enable concurrent configuration editing
Finally, this disables the config editing lock for isisd. It also enables deprecation warnings for the lib/ and isisd/ to catch accidental uses of vty->index. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'lib/vty.c')
-rw-r--r--lib/vty.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/vty.c b/lib/vty.c
index 14ef7e6e4a..cc30def303 100644
--- a/lib/vty.c
+++ b/lib/vty.c
@@ -83,6 +83,7 @@ char *vty_cwd = NULL;
/* Configure lock. */
static int vty_config;
+static int vty_config_is_lockless = 0;
/* Login password check. */
static int no_password_check = 0;
@@ -2634,6 +2635,8 @@ vty_log_fixed (char *buf, size_t len)
int
vty_config_lock (struct vty *vty)
{
+ if (vty_config_is_lockless)
+ return 1;
if (vty_config == 0)
{
vty->config = 1;
@@ -2645,6 +2648,8 @@ vty_config_lock (struct vty *vty)
int
vty_config_unlock (struct vty *vty)
{
+ if (vty_config_is_lockless)
+ return 0;
if (vty_config == 1 && vty->config == 1)
{
vty->config = 0;
@@ -2653,6 +2658,12 @@ vty_config_unlock (struct vty *vty)
return vty->config;
}
+void
+vty_config_lockless (void)
+{
+ vty_config_is_lockless = 1;
+}
+
/* Master of the threads. */
static struct thread_master *vty_master;