Merge pull request #8778 from idryzhov/fix-zebra-vrf

zebra: fix config after exit from vrf
This commit is contained in:
Rafael Zalamena 2021-06-07 08:59:10 -03:00 committed by GitHub
commit 455d14ae31
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 4 deletions

View File

@ -780,8 +780,6 @@ DEFUN_NOSH(vrf_exit,
"exit-vrf",
"Exit current mode and down to previous mode\n")
{
/* We have to set vrf context to default vrf */
VTY_PUSH_CONTEXT(VRF_NODE, vrf_get(VRF_DEFAULT, VRF_DEFAULT_NAME));
cmd_exit(vty);
return CMD_SUCCESS;
}

View File

@ -192,8 +192,13 @@ struct zebra_vrf {
* special macro to allow us to get the correct zebra_vrf
*/
#define ZEBRA_DECLVAR_CONTEXT(A, B) \
struct vrf *A = VTY_GET_CONTEXT(vrf); \
struct zebra_vrf *B = (A) ? A->info : vrf_info_lookup(VRF_DEFAULT)
struct vrf *A; \
if (vty->node == CONFIG_NODE) \
A = vrf_lookup_by_id(VRF_DEFAULT); \
else \
A = VTY_GET_CONTEXT(vrf); \
VTY_CHECK_CONTEXT(A); \
struct zebra_vrf *B = A->info
static inline vrf_id_t zvrf_id(struct zebra_vrf *zvrf)
{