pimd: fix missing checking the return value for igmp command

`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 <anlan_cs@tom.com>
This commit is contained in:
anlan_cs 2024-08-15 20:49:24 +08:00 committed by anlan_cs
parent 4f70004723
commit cbe50989d9

View file

@ -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(