]> git.proxmox.com Git - mirror_frr.git/blobdiff - pimd/pim_vxlan.c
Merge pull request #5288 from SumitAgarwal123/bfd_docs
[mirror_frr.git] / pimd / pim_vxlan.c
index a4a6ce6922006f138d05cdbb80b20ff08f03bdf5..33e3b2340c2ec0253c2cd72aa756f6f0cd2fb259 100644 (file)
@@ -115,7 +115,7 @@ static void pim_vxlan_init_work(void)
        vxlan_info.max_work_cnt = PIM_VXLAN_WORK_MAX;
        vxlan_info.flags |= PIM_VXLANF_WORK_INITED;
        vxlan_info.work_list = list_new();
-       pim_vxlan_work_timer_setup(TRUE /* start */);
+       pim_vxlan_work_timer_setup(true/* start */);
 }
 
 static void pim_vxlan_add_work(struct pim_vxlan_sg *vxlan_sg)
@@ -245,7 +245,7 @@ static void pim_vxlan_orig_mr_up_del(struct pim_vxlan_sg *vxlan_sg)
                 * for nht
                 */
                if (up)
-                       pim_rpf_update(vxlan_sg->pim, up, NULL, 1 /* is_new */);
+                       pim_rpf_update(vxlan_sg->pim, up, NULL);
        }
 }
 
@@ -344,7 +344,7 @@ static void pim_vxlan_orig_mr_up_add(struct pim_vxlan_sg *vxlan_sg)
                        nht_p.prefixlen = IPV4_MAX_BITLEN;
                        nht_p.u.prefix4 = up->upstream_addr;
                        pim_delete_tracked_nexthop(vxlan_sg->pim,
-                               &nht_p, up, NULL);
+                               &nht_p, up, NULL, false);
                }
                pim_upstream_ref(up, flags, __PRETTY_FUNCTION__);
                vxlan_sg->up = up;
@@ -623,9 +623,9 @@ static void pim_vxlan_term_mr_del(struct pim_vxlan_sg *vxlan_sg)
 }
 
 /************************** vxlan SG cache management ************************/
-static unsigned int pim_vxlan_sg_hash_key_make(void *p)
+static unsigned int pim_vxlan_sg_hash_key_make(const void *p)
 {
-       struct pim_vxlan_sg *vxlan_sg = p;
+       const struct pim_vxlan_sg *vxlan_sg = p;
 
        return (jhash_2words(vxlan_sg->sg.src.s_addr,
                                vxlan_sg->sg.grp.s_addr, 0));
@@ -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)
@@ -956,7 +960,7 @@ void pim_vxlan_add_term_dev(struct pim_instance *pim,
        if (PIM_DEBUG_VXLAN)
                zlog_debug("vxlan term oif changed from %s to %s",
                        pim->vxlan.term_if ? pim->vxlan.term_if->name : "-",
-                       ifp ? ifp->name : "-");
+                       ifp->name);
 
        /* enable pim on the term ifp */
        pim_ifp = (struct pim_interface *)ifp->info;
@@ -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) {