]> git.proxmox.com Git - mirror_frr.git/blobdiff - pimd/pim_vxlan.c
pimd: fix pim_instance NULL deference in pim_vxlan_mlag_update
[mirror_frr.git] / pimd / pim_vxlan.c
index 39a1a32a5b835f2ade7f48e5753e4e7923bc72eb..e4d969daee9efe42a118aae969bf2e68a25b1b4d 100644 (file)
@@ -184,11 +184,10 @@ void pim_vxlan_update_sg_reg_state(struct pim_instance *pim,
                pim_vxlan_del_work(vxlan_sg);
 }
 
-static int pim_vxlan_work_timer_cb(struct thread *t)
+static void pim_vxlan_work_timer_cb(struct thread *t)
 {
        pim_vxlan_do_reg_work();
        pim_vxlan_work_timer_setup(true /* start */);
-       return 0;
 }
 
 /* global 1second timer used for periodic processing */
@@ -881,6 +880,12 @@ void pim_vxlan_mlag_update(bool enable, bool peer_state, uint32_t role,
         */
        pim = pim_get_pim_instance(VRF_DEFAULT);
 
+       if (!pim) {
+               if (PIM_DEBUG_VXLAN)
+                       zlog_debug("%s: Unable to find pim instance", __func__);
+               return;
+       }
+
        if (enable)
                vxlan_mlag.flags |= PIM_VXLAN_MLAGF_ENABLED;
        else