Skip to content

Commit

Permalink
Merge pull request FRRouting#14294 from donaldsharp/pim_crashola
Browse files Browse the repository at this point in the history
pimd: Prevent crash when receiving register message when the RP() is …
  • Loading branch information
ton31337 authored Sep 1, 2023
2 parents 592ee11 + 54aa0bf commit 640b59a
Showing 1 changed file with 9 additions and 1 deletion.
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

0 comments on commit 640b59a

Please sign in to comment.