Skip to content

Commit 6674e08

Browse files
authored
Merge pull request #14336 from FRRouting/mergify/bp/stable/9.0/pr-14294
pimd: Prevent crash when receiving register message when the RP() is … (backport #14294)
2 parents c24c9a0 + d51a974 commit 6674e08

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

pimd/pim_register.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,7 @@ int pim_register_recv(struct interface *ifp, pim_addr dest_addr,
494494
struct pim_interface *pim_ifp = ifp->info;
495495
struct pim_instance *pim = pim_ifp->pim;
496496
pim_addr rp_addr;
497+
struct pim_rpf *rpg;
497498

498499
if (pim_ifp->pim_passive_enable) {
499500
if (PIM_DEBUG_PIM_PACKETS)
@@ -602,7 +603,14 @@ int pim_register_recv(struct interface *ifp, pim_addr dest_addr,
602603
}
603604
}
604605

605-
rp_addr = (RP(pim, sg.grp))->rpf_addr;
606+
rpg = RP(pim, sg.grp);
607+
if (!rpg) {
608+
zlog_warn("%s: Received Register Message %pSG from %pPA on %s where the RP could not be looked up",
609+
__func__, &sg, &src_addr, ifp->name);
610+
return 0;
611+
}
612+
613+
rp_addr = rpg->rpf_addr;
606614
if (i_am_rp && (!pim_addr_cmp(dest_addr, rp_addr))) {
607615
sentRegisterStop = 0;
608616

0 commit comments

Comments
 (0)