diff options
author | Renato Westphal <renato@opensourcerouting.org> | 2016-10-29 02:26:04 +0200 |
---|---|---|
committer | Renato Westphal <renato@opensourcerouting.org> | 2016-11-28 19:18:35 +0100 |
commit | 51bdc5f85ceb5d597924fc5f9b550257972a38fd (patch) | |
tree | beb96514a56fb04befb18b89d81eb44d904b8ea4 /zebra/zebra_vty.c | |
parent | lib: fix creation of pre-provisioned VRFs (diff) | |
download | frr-51bdc5f85ceb5d597924fc5f9b550257972a38fd.tar.xz frr-51bdc5f85ceb5d597924fc5f9b550257972a38fd.zip |
zebra: nuke zvrf_list and always use vrf_list instead
zvrf_list doesn't need to exist, it's basically a duplicate version
of vrf_list.
Also, zebra_vrf_delete() wasn't removing zvrf from zvrf_list, which was
a bug.
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'zebra/zebra_vty.c')
-rw-r--r-- | zebra/zebra_vty.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c index 9b0fad93e..74f64dd05 100644 --- a/zebra/zebra_vty.c +++ b/zebra/zebra_vty.c @@ -3673,13 +3673,18 @@ static_config_ipv4 (struct vty *vty, safi_t safi, const char *cmd) struct route_node *rn; struct static_route *si; struct route_table *stable; + struct vrf *vrf; struct zebra_vrf *zvrf; char buf[BUFSIZ]; int write =0; struct listnode *node; - for (ALL_LIST_ELEMENTS_RO (zvrf_list, node, zvrf)) + for (ALL_LIST_ELEMENTS_RO (vrf_list, node, vrf)) { + zvrf = vrf->info; + if (! zvrf) + continue; + if ((stable = zvrf->stable[AFI_IP][safi]) == NULL) continue; @@ -5782,11 +5787,16 @@ static_config_ipv6 (struct vty *vty) int write = 0; char buf[PREFIX_STRLEN]; struct route_table *stable; + struct vrf *vrf; struct zebra_vrf *zvrf; struct listnode *node; - for (ALL_LIST_ELEMENTS_RO (zvrf_list, node, zvrf)) + for (ALL_LIST_ELEMENTS_RO (vrf_list, node, vrf)) { + zvrf = vrf->info; + if (! zvrf) + continue; + if ((stable = zvrf->stable[AFI_IP6][SAFI_UNICAST]) == NULL) continue; @@ -5874,13 +5884,15 @@ DEFUN (show_vrf, SHOW_STR "VRF\n") { + struct vrf *vrf; struct zebra_vrf *zvrf; struct listnode *node; - for (ALL_LIST_ELEMENTS_RO (zvrf_list, node, zvrf)) + for (ALL_LIST_ELEMENTS_RO (vrf_list, node, vrf)) { - if (!zvrf->vrf_id) - continue; + zvrf = vrf->info; + if (! zvrf || ! zvrf->vrf_id) + continue; vty_out (vty, "vrf %s ", zvrf->name); if (zvrf->vrf_id == VRF_UNKNOWN) |