From 1d72e48aff5e7a4ceefe8a9dbeee1868a9a6f8c0 Mon Sep 17 00:00:00 2001 From: vivek Date: Mon, 4 Dec 2017 20:05:15 -0800 Subject: [PATCH] lib: Display configured VRFs Ensure that configured VRFs are displayed in the running configuration. Signed-off-by: Vivek Venkatraman Reviewed-by: Donald Sharp Reviewed-by: Mitesh Kanjariya Ticket: CM-10139 Reviewed By: CCR-7012 Testing Done: Verify failed test scenario --- vtysh/vtysh_config.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/vtysh/vtysh_config.c b/vtysh/vtysh_config.c index 138a446321..967f855fbc 100644 --- a/vtysh/vtysh_config.c +++ b/vtysh/vtysh_config.c @@ -352,13 +352,15 @@ void vtysh_config_dump(FILE *fp) for (i = 0; i < vector_active(configvec); i++) if ((master = vector_slot(configvec, i)) != NULL) { for (ALL_LIST_ELEMENTS(master, node, nnode, config)) { - /* Don't print empty sections for interface/vrf. + /* Don't print empty sections for interface. * Route maps on the * other hand could have a legitimate empty * section at the end. + * VRF is handled in the backend, we could have + * "configured" VRFs with static routes which + * are not under the VRF node. */ - if ((config->index == INTERFACE_NODE - || config->index == VRF_NODE) + if (config->index == INTERFACE_NODE && list_isempty(config->line)) continue; -- 2.39.5