]> git.puffer.fish Git - mirror/frr.git/commitdiff
pimd: fix missing checking the return value for igmp command 16599/head
authoranlan_cs <vic.lan@pica8.com>
Thu, 15 Aug 2024 12:49:24 +0000 (20:49 +0800)
committeranlan_cs <anlan_cs@tom.com>
Fri, 16 Aug 2024 14:33:59 +0000 (22:33 +0800)
`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>
pimd/pim_iface.c

index dcb6116012e5ec863bffbc7f12ab69e8009f7900..cdcca0ebe6e0c16e4ae25539b207fb129dc6526b 100644 (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(