Merge pull request #10959 from patrasar/pim_coverity

pimd: Fixing pim coverity issues
This commit is contained in:
Donald Sharp 2022-04-05 09:38:42 -04:00 committed by GitHub
commit 95e6a352d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 0 deletions

View File

@ -880,6 +880,12 @@ void pim_vxlan_mlag_update(bool enable, bool peer_state, uint32_t role,
*/ */
pim = pim_get_pim_instance(VRF_DEFAULT); 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) if (enable)
vxlan_mlag.flags |= PIM_VXLAN_MLAGF_ENABLED; vxlan_mlag.flags |= PIM_VXLAN_MLAGF_ENABLED;
else else

View File

@ -166,6 +166,13 @@ static int pim_zebra_if_address_add(ZAPI_CALLBACK_ARGS)
struct pim_instance *pim; struct pim_instance *pim;
pim = pim_get_pim_instance(vrf_id); pim = pim_get_pim_instance(vrf_id);
if (!pim) {
if (PIM_DEBUG_ZEBRA)
zlog_debug("%s: Unable to find pim instance",
__func__);
return 0;
}
pim_ifp->pim = pim; pim_ifp->pim = pim;
pim_rp_check_on_if_add(pim_ifp); pim_rp_check_on_if_add(pim_ifp);

View File

@ -388,6 +388,12 @@ void zclient_lookup_read_pipe(struct thread *thread)
struct pim_zlookup_nexthop nexthop_tab[10]; struct pim_zlookup_nexthop nexthop_tab[10];
struct in_addr l = {.s_addr = INADDR_ANY}; struct in_addr l = {.s_addr = INADDR_ANY};
if (!pim) {
if (PIM_DEBUG_PIM_NHT_DETAIL)
zlog_debug("%s: Unable to find pim instance", __func__);
return;
}
zclient_lookup_nexthop_once(pim, nexthop_tab, 10, l); zclient_lookup_nexthop_once(pim, nexthop_tab, 10, l);
thread_add_timer(router->master, zclient_lookup_read_pipe, zlookup, 60, thread_add_timer(router->master, zclient_lookup_read_pipe, zlookup, 60,
&zlookup_read); &zlookup_read);