]> git.puffer.fish Git - mirror/frr.git/commitdiff
pimd: Cleanup shutdown of vrf
authorDonald Sharp <sharpd@cumulusnetworks.com>
Sat, 10 Jun 2017 19:03:03 +0000 (15:03 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 24 Jul 2017 17:51:39 +0000 (13:51 -0400)
When shutting down the vrf don't kill the default vrf
when attempting to cleanup something else.

Also move the terminate to the right spot.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
pimd/pim_instance.c

index 0849e6f7487bcdb1fd44fa8c73fb0771ddd566f3..8ceb2a74f532718df5b0bfca0d541ea661a86f79 100644 (file)
@@ -60,7 +60,7 @@ static void pim_instance_terminate(struct pim_instance *pim)
 
        pim_msdp_exit(pim);
 
-       XFREE(MTYPE_PIM_PIM_INSTANCE, pimg);
+       XFREE(MTYPE_PIM_PIM_INSTANCE, pim);
 }
 
 static struct pim_instance *pim_instance_init(struct vrf *vrf)
@@ -156,6 +156,7 @@ static int pim_vrf_delete(struct vrf *vrf)
        zlog_debug("VRF Deletion: %s(%d)", vrf->name, vrf->vrf_id);
 
        pim_ssmpingd_destroy(pim);
+       pim_instance_terminate(pim);
        return 0;
 }
 
@@ -176,8 +177,6 @@ static int pim_vrf_enable(struct vrf *vrf)
 
 static int pim_vrf_disable(struct vrf *vrf)
 {
-       pim_instance_terminate((struct pim_instance *)vrf->info);
-
        /* Note: This is a callback, the VRF will be deleted by the caller. */
        return 0;
 }