Skip to content

Commit

Permalink
pimd: fix missing checking the return value for igmp command
Browse files Browse the repository at this point in the history
`gm_join_new()` will return NULL in the case of running out of
socket/file resources.  Just add the check for it.

Signed-off-by: anlan_cs <[email protected]>
  • Loading branch information
anlancs committed Aug 16, 2024
1 parent 4f70004 commit cbe5098
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pimd/pim_iface.c
Original file line number Diff line number Diff line change
Expand Up @@ -1322,7 +1322,10 @@ ferr_r pim_if_gm_join_add(struct interface *ifp, pim_addr group_addr,
return ferr_ok();
}

(void)gm_join_new(ifp, group_addr, source_addr);
if (!gm_join_new(ifp, group_addr, source_addr)) {
return ferr_cfg_invalid("can't join (%pPA,%pPA) on interface %s",
&source_addr, &group_addr, ifp->name);
}

if (PIM_DEBUG_GM_EVENTS) {
zlog_debug(
Expand Down

0 comments on commit cbe5098

Please sign in to comment.