]> git.puffer.fish Git - matthieu/frr.git/commitdiff
pim: fix order of vxlan mroutes cleanup when pimd is shutdown
authorAnuradha Karuppiah <anuradhak@cumulusnetworks.com>
Wed, 17 Apr 2019 01:49:28 +0000 (18:49 -0700)
committerAnuradha Karuppiah <anuradhak@cumulusnetworks.com>
Sun, 21 Apr 2019 14:24:20 +0000 (07:24 -0700)
1. vxlan instance cleanup needs to be done before the upstream entries are
force-flushed.
2. also vxlan callbacks need to be ignored post instance-cleanup.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
pimd/pim_instance.c
pimd/pim_vxlan.c

index 1416d8de550836801848b3712390bd0f35c01117..a2bf3d27839b64969df4d0cdc3cb8f6c44529213 100644 (file)
@@ -36,6 +36,8 @@
 
 static void pim_instance_terminate(struct pim_instance *pim)
 {
+       pim_vxlan_exit(pim);
+
        if (pim->ssm_info) {
                pim_ssm_terminate(pim->ssm_info);
                pim->ssm_info = NULL;
@@ -60,7 +62,6 @@ static void pim_instance_terminate(struct pim_instance *pim)
        pim_oil_terminate(pim);
 
        pim_msdp_exit(pim);
-       pim_vxlan_exit(pim);
 
        XFREE(MTYPE_PIM_PIM_INSTANCE, pim);
 }
index e973c8c04583506425af670b2f8cd3295ed14b43..af76c6d732cbf548c77741076b81c60b4f8752a2 100644 (file)
@@ -858,7 +858,9 @@ static void pim_vxlan_set_default_iif(struct pim_instance *pim,
        /* add/del upstream entries for the existing vxlan SG when the
         * interface becomes available
         */
-       hash_iterate(pim->vxlan.sg_hash, pim_vxlan_orig_mr_iif_update, ifp);
+       if (pim->vxlan.sg_hash)
+               hash_iterate(pim->vxlan.sg_hash,
+                               pim_vxlan_orig_mr_iif_update, ifp);
 }
 
 static void pim_vxlan_set_peerlink_rif(struct pim_instance *pim,
@@ -889,7 +891,9 @@ static void pim_vxlan_set_peerlink_rif(struct pim_instance *pim,
        /* add/del upstream entries for the existing vxlan SG when the
         * interface becomes available
         */
-       hash_iterate(pim->vxlan.sg_hash, pim_vxlan_orig_mr_iif_update, ifp);
+       if (pim->vxlan.sg_hash)
+               hash_iterate(pim->vxlan.sg_hash,
+                               pim_vxlan_orig_mr_iif_update, ifp);
 }
 
 void pim_vxlan_add_vif(struct interface *ifp)
@@ -972,8 +976,10 @@ void pim_vxlan_add_term_dev(struct pim_instance *pim,
        }
 
        pim->vxlan.term_if = ifp;
-       hash_iterate(pim_ifp->pim->vxlan.sg_hash,
-               pim_vxlan_term_mr_oif_update, ifp);
+
+       if (pim->vxlan.sg_hash)
+               hash_iterate(pim_ifp->pim->vxlan.sg_hash,
+                               pim_vxlan_term_mr_oif_update, ifp);
 }
 
 void pim_vxlan_del_term_dev(struct pim_instance *pim)
@@ -985,8 +991,10 @@ void pim_vxlan_del_term_dev(struct pim_instance *pim)
                zlog_debug("vxlan term oif changed from %s to -", ifp->name);
 
        pim->vxlan.term_if = NULL;
-       hash_iterate(pim->vxlan.sg_hash,
-               pim_vxlan_term_mr_oif_update, NULL);
+
+       if (pim->vxlan.sg_hash)
+               hash_iterate(pim->vxlan.sg_hash,
+                               pim_vxlan_term_mr_oif_update, NULL);
 
        pim_ifp = (struct pim_interface *)ifp->info;
        if (pim_ifp) {