summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoranlan_cs <vic.lan@pica8.com>2024-08-15 20:49:24 +0800
committeranlan_cs <anlan_cs@tom.com>2024-08-16 22:33:59 +0800
commitcbe50989d94c549de23e35f15121321fe56fd40e (patch)
tree07bd16ca6ffad231793bd8313350f18909c12c31
parent4f70004723262626cd2d9db50092e0f47ee8a08d (diff)
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>
-rw-r--r--pimd/pim_iface.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/pimd/pim_iface.c b/pimd/pim_iface.c
index dcb6116012..cdcca0ebe6 100644
--- a/pimd/pim_iface.c
+++ b/pimd/pim_iface.c
@@ -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(