summaryrefslogtreecommitdiffstats
path: root/zebra
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@cumulusnetworks.com>2018-04-11 17:23:23 +0200
committerQuentin Young <qlyoung@cumulusnetworks.com>2018-04-17 20:26:25 +0200
commitc319e19dbd2462440d718cfd32db061b306e006c (patch)
tree167b114b2481b8b096882cd790c810b0f1b89460 /zebra
parentMerge pull request #2058 from chipitsine/master (diff)
downloadfrr-c319e19dbd2462440d718cfd32db061b306e006c.tar.xz
frr-c319e19dbd2462440d718cfd32db061b306e006c.zip
vtysh, zebra: print exit-vrf at end of vrf context
Need to explicitly exit this context otherwise we risk ambiguities between global and vrf context commands Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'zebra')
-rw-r--r--zebra/zebra_vrf.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/zebra/zebra_vrf.c b/zebra/zebra_vrf.c
index 76dc5657d..18d53292b 100644
--- a/zebra/zebra_vrf.c
+++ b/zebra/zebra_vrf.c
@@ -524,10 +524,8 @@ static int vrf_config_write(struct vty *vty)
if (zvrf->l3vni)
vty_out(vty, "vni %u\n", zvrf->l3vni);
vty_out(vty, "!\n");
- }
-
- if (vrf_is_user_cfged(vrf)) {
- vty_out(vty, "vrf %s\n", zvrf_name(zvrf));
+ } else {
+ vty_frame(vty, "vrf %s\n", zvrf_name(zvrf));
if (zvrf->l3vni)
vty_out(vty, " vni %u%s\n", zvrf->l3vni,
is_l3vni_for_prefix_routes_only(
@@ -535,14 +533,15 @@ static int vrf_config_write(struct vty *vty)
? " prefix-routes-only"
: "");
zebra_ns_config_write(vty, (struct ns *)vrf->ns_ctxt);
+
}
static_config(vty, zvrf, AFI_IP, SAFI_UNICAST, "ip route");
static_config(vty, zvrf, AFI_IP, SAFI_MULTICAST, "ip mroute");
static_config(vty, zvrf, AFI_IP6, SAFI_UNICAST, "ipv6 route");
- if (vrf->vrf_id != VRF_DEFAULT)
- vty_out(vty, "!\n");
+ if (zvrf_id(zvrf) != VRF_DEFAULT)
+ vty_endframe(vty, " exit-vrf\n!\n");
}
return 0;
}