summaryrefslogtreecommitdiffstats
path: root/zebra/zebra_vty.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2016-05-04 03:04:00 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2016-05-06 16:41:30 +0200
commitc1c747a897ebc7cfa5a6a46580cd8b046e426907 (patch)
tree10cd67b7c4b1d341dc4663238d86f56e60ffaed8 /zebra/zebra_vty.c
parentzebra: Save the zvrf in a zvrf_list (diff)
downloadfrr-c1c747a897ebc7cfa5a6a46580cd8b046e426907.tar.xz
frr-c1c747a897ebc7cfa5a6a46580cd8b046e426907.zip
zebra: Fix show vrf and show run to use the zvrf_list
The show vrf and show run commands were iterating over the vrf_list. Use the zvrf_list instead so that we can understand the differences between something configed -vs- created Ticket: CM-10139 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> Reviewed-by: Vivek Venkatraman <vivek@cumulusnetworks.com> Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
Diffstat (limited to 'zebra/zebra_vty.c')
-rw-r--r--zebra/zebra_vty.c22
1 files changed, 7 insertions, 15 deletions
diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c
index 6b2f65d70..d0f2700b8 100644
--- a/zebra/zebra_vty.c
+++ b/zebra/zebra_vty.c
@@ -3223,12 +3223,10 @@ static_config_ipv4 (struct vty *vty, safi_t safi, const char *cmd)
struct zebra_vrf *zvrf;
int write =0;
struct listnode *node;
- struct vrf *vrfp;
- for (ALL_LIST_ELEMENTS_RO (vrf_list, node, vrfp))
+ for (ALL_LIST_ELEMENTS_RO (zvrf_list, node, zvrf))
{
- if ((zvrf = vrfp->info) == NULL ||
- (stable = zvrf->stable[AFI_IP][safi]) == NULL)
+ if ((stable = zvrf->stable[AFI_IP][safi]) == NULL)
continue;
for (rn = route_top (stable); rn; rn = route_next (rn))
@@ -3267,7 +3265,7 @@ static_config_ipv4 (struct vty *vty, safi_t safi, const char *cmd)
vty_out (vty, " %d", si->distance);
if (si->vrf_id != VRF_DEFAULT)
- vty_out (vty, " vrf %s", vrfp ? vrfp->name : "");
+ vty_out (vty, " vrf %s", zvrf ? zvrf->name : "");
vty_out (vty, "%s", VTY_NEWLINE);
@@ -5490,12 +5488,10 @@ static_config_ipv6 (struct vty *vty)
struct route_table *stable;
struct zebra_vrf *zvrf;
struct listnode *node;
- struct vrf *vrfp;
- for (ALL_LIST_ELEMENTS_RO (vrf_list, node, vrfp))
+ for (ALL_LIST_ELEMENTS_RO (zvrf_list, node, zvrf))
{
- if ((zvrf = vrfp->info) == NULL ||
- (stable = zvrf->stable[AFI_IP6][SAFI_UNICAST]) == NULL)
+ if ((stable = zvrf->stable[AFI_IP6][SAFI_UNICAST]) == NULL)
continue;
for (rn = route_top (stable); rn; rn = route_next (rn))
@@ -5532,8 +5528,7 @@ static_config_ipv6 (struct vty *vty)
if (si->vrf_id != VRF_DEFAULT)
{
- zvrf = vrf_info_lookup (si->vrf_id);
- vty_out (vty, " vrf %s", vrfp->name);
+ vty_out (vty, " vrf %s", zvrf->name);
}
vty_out (vty, "%s", VTY_NEWLINE);
@@ -5574,12 +5569,9 @@ DEFUN (show_vrf,
{
struct zebra_vrf *zvrf;
struct listnode *node;
- struct vrf *vrfp;
- for (ALL_LIST_ELEMENTS_RO (vrf_list, node, vrfp))
+ for (ALL_LIST_ELEMENTS_RO (zvrf_list, node, zvrf))
{
- if ((zvrf = vrfp->info) == NULL)
- continue;
if (!zvrf->vrf_id)
continue;