Skip to content

Commit

Permalink
pim: handle return code to fix a couple of coverity issues
Browse files Browse the repository at this point in the history
Signed-off-by: Jafar Al-Gharaibeh <[email protected]>
  • Loading branch information
Jafaral committed Dec 18, 2024
1 parent f78b178 commit 7dc12cb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
12 changes: 9 additions & 3 deletions pimd/pim_rp.c
Original file line number Diff line number Diff line change
Expand Up @@ -960,8 +960,9 @@ void pim_rp_setup(struct pim_instance *pim)
if (!pim_nht_lookup_ecmp(pim, &rp_info->rp.source_nexthop, nht_p, &rp_info->group,
true)) {
if (PIM_DEBUG_PIM_NHT_RP)
zlog_debug(
"Unable to lookup nexthop for rp specified");
zlog_debug("%s: unable to lookup nexthop for rp %pPA", __func__,
&rp_info->rp.rpf_addr);

pim_nht_rp_del(rp_info);
}
}
Expand Down Expand Up @@ -1107,7 +1108,12 @@ struct pim_rpf *pim_rp_g(struct pim_instance *pim, pim_addr group)
__func__, &nht_p, &rp_info->group);
pim_nht_find_or_track(pim, nht_p, NULL, rp_info, NULL);
pim_rpf_set_refresh_time(pim);
pim_nht_lookup_ecmp(pim, &rp_info->rp.source_nexthop, nht_p, &rp_info->group, true);
if (!pim_nht_lookup_ecmp(pim, &rp_info->rp.source_nexthop, nht_p, &rp_info->group,
true))
if (PIM_DEBUG_PIM_NHT_RP)
zlog_debug("%s: unable to lookup nexthop for rp %pPA", __func__,
&rp_info->rp.rpf_addr);

return (&rp_info->rp);
}

Expand Down
6 changes: 5 additions & 1 deletion pimd/pim_tib.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ tib_sg_oil_setup(struct pim_instance *pim, pim_sgaddr sg, struct interface *oif)
up = pim_upstream_find(pim, &sg);
if (up) {
memcpy(&nexthop, &up->rpf.source_nexthop, sizeof(struct pim_nexthop));
pim_nht_lookup_ecmp(pim, &nexthop, vif_source, &grp, false);
if (!pim_nht_lookup_ecmp(pim, &nexthop, vif_source, &grp, false))
if (PIM_DEBUG_PIM_NHT_RP)
zlog_debug("%s: Nexthop Lookup failed (%pPA, %pPA)", __func__,
&sg.src, &sg.grp);

if (nexthop.interface)
input_iface_vif_index = pim_if_find_vifindex_by_ifindex(
pim, nexthop.interface->ifindex);
Expand Down

0 comments on commit 7dc12cb

Please sign in to comment.