summaryrefslogtreecommitdiffstats
path: root/zebra/main.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2016-03-22 22:03:04 +0100
committerDonald Sharp <sharpd@cumulusnetworks.com>2016-03-23 13:30:08 +0100
commit2878e4dff6fa9b4c2b1b99fc56b889985e65ad66 (patch)
treec2ed127d234063dfbe50d9f3d5f2b7d2103de7f6 /zebra/main.c
parentzebra: Replace vrf with zebra_vrf in a few places (diff)
downloadfrr-2878e4dff6fa9b4c2b1b99fc56b889985e65ad66.tar.xz
frr-2878e4dff6fa9b4c2b1b99fc56b889985e65ad66.zip
zebra: Some small modifications to actually delete the vrf
zebra was not actually deleting the vrf passed in. Ticket: CM-9412 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> Reviewed-by: Don Slice <dslice@cumulusnetworks.com> Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
Diffstat (limited to 'zebra/main.c')
-rw-r--r--zebra/main.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/zebra/main.c b/zebra/main.c
index 3590eed26..b3571c26f 100644
--- a/zebra/main.c
+++ b/zebra/main.c
@@ -297,6 +297,12 @@ zebra_ns_disable (ns_id_t ns_id, void **info)
static int
zebra_vrf_disable (vrf_id_t vrf_id, const char *name, void **info)
{
+ return 0;
+}
+
+static int
+zebra_vrf_delete (vrf_id_t vrf_id, const char *name, void **info)
+{
struct zebra_vrf *zvrf = (struct zebra_vrf *) (*info);
struct listnode *list_node;
struct interface *ifp;
@@ -317,6 +323,8 @@ zebra_vrf_disable (vrf_id_t vrf_id, const char *name, void **info)
list_delete_all_node (zvrf->rid_all_sorted_list);
list_delete_all_node (zvrf->rid_lo_sorted_list);
+ XFREE (MTYPE_ZEBRA_VRF, zvrf);
+
return 0;
}
@@ -329,6 +337,7 @@ zebra_vrf_init (void)
vrf_add_hook (VRF_NEW_HOOK, zebra_vrf_new);
vrf_add_hook (VRF_ENABLE_HOOK, zebra_vrf_enable);
vrf_add_hook (VRF_DISABLE_HOOK, zebra_vrf_disable);
+ vrf_add_hook (VRF_DELETE_HOOK, zebra_vrf_delete);
/* Default NS initialization */