Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pim: handle return code to fix a couple of coverity issues #17673

Merged
merged 1 commit into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 vif_src:%pPA, sg.src:%pPA, sg.grp:%pPA",
__func__, &vif_source, &sg.src, &sg.grp);

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