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

pimd: Prevent crash when receiving register message when the RP() is … #14294

Merged
merged 1 commit into from
Sep 1, 2023
Merged
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
10 changes: 9 additions & 1 deletion pimd/pim_register.c
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,7 @@ int pim_register_recv(struct interface *ifp, pim_addr dest_addr,
struct pim_interface *pim_ifp = ifp->info;
struct pim_instance *pim = pim_ifp->pim;
pim_addr rp_addr;
struct pim_rpf *rpg;

if (pim_ifp->pim_passive_enable) {
if (PIM_DEBUG_PIM_PACKETS)
Expand Down Expand Up @@ -602,7 +603,14 @@ int pim_register_recv(struct interface *ifp, pim_addr dest_addr,
}
}

rp_addr = (RP(pim, sg.grp))->rpf_addr;
rpg = RP(pim, sg.grp);
if (!rpg) {
zlog_warn("%s: Received Register Message %pSG from %pPA on %s where the RP could not be looked up",
__func__, &sg, &src_addr, ifp->name);
return 0;
}

rp_addr = rpg->rpf_addr;
if (i_am_rp && (!pim_addr_cmp(dest_addr, rp_addr))) {
sentRegisterStop = 0;

Expand Down
Loading