From 799a81df9d1c9abfc525fffd53983226fd5233c1 Mon Sep 17 00:00:00 2001 From: Renato Westphal Date: Wed, 29 Apr 2020 18:49:29 -0300 Subject: [PATCH] lib: update the CLI xpath index when exiting from the VRF node All custom "exit-*" commands that exit from a YANG-modeled CLI node need to use cmd_exit() to ensure the CLI xpath index (vty->xpath_index) will be updated accordingly. Fixes #6316. Signed-off-by: Renato Westphal --- lib/vrf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/vrf.c b/lib/vrf.c index f8702973bc..6bd577fce1 100644 --- a/lib/vrf.c +++ b/lib/vrf.c @@ -726,7 +726,7 @@ DEFUN_NOSH(vrf_exit, { /* We have to set vrf context to default vrf */ VTY_PUSH_CONTEXT(VRF_NODE, vrf_get(VRF_DEFAULT, VRF_DEFAULT_NAME)); - vty->node = CONFIG_NODE; + cmd_exit(vty); return CMD_SUCCESS; }