summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2019-10-05 20:52:36 -0300
committerRenato Westphal <renato@opensourcerouting.org>2019-10-11 21:18:36 -0300
commitcaaa8b9c834dcf26292af67ebaaf154cac7cb8fe (patch)
treea90d02fef0f02c7740d752a60d8d23921bcf0ad9
parent09ea1a40386f02a13cdb0462cc55af0d03f0c277 (diff)
lib: optimize VTY_CHECK_XPATH
There's no need to check for removed configuration objects in the following two cases: * A private candidate configuration is being edited; * The startup configuration is being read. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
-rw-r--r--lib/vty.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/vty.h b/lib/vty.h
index c7352efbd3..a0b8e8afa1 100644
--- a/lib/vty.h
+++ b/lib/vty.h
@@ -254,7 +254,8 @@ static inline void vty_push_context(struct vty *vty, int node, uint64_t id)
#define VTY_CHECK_XPATH \
do { \
- if (vty->xpath_index > 0 \
+ if (vty->type != VTY_FILE && !vty->private_config \
+ && vty->xpath_index > 0 \
&& !yang_dnode_exists(vty->candidate_config->dnode, \
VTY_CURR_XPATH)) { \
vty_out(vty, \