]> git.puffer.fish Git - mirror/frr.git/commitdiff
pimd: Fix some small crashes in pim
authorDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 29 Jun 2017 13:20:42 +0000 (09:20 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 24 Jul 2017 17:51:40 +0000 (13:51 -0400)
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
pimd/pim_ifchannel.c
pimd/pim_upstream.c

index 7a1c3e2acdc06de9cddd077f786999f07ffa372a..f7d9a4e4fbc6caaced99745d55bf3bda147b185e 100644 (file)
@@ -568,7 +568,7 @@ struct pim_ifchannel *pim_ifchannel_add(struct interface *ifp,
                        __PRETTY_FUNCTION__, pim_str_sg_dump(sg), ifp->name);
 
                pim_ifchannel_remove_children(ch);
-               if (ch)
+               if (ch->sources)
                        list_delete(ch->sources);
 
                listnode_delete(pim_ifp->pim_ifchannel_list, ch);
index e7987eb6e793a9a85a60f2e779278516013b0f57..9151d9ecf3ff6f7c7a9e5f68b9ca9bf76789896c 100644 (file)
@@ -1362,6 +1362,13 @@ static int pim_upstream_register_stop_timer(struct thread *t)
                        return 0;
                }
                rpg = RP(pim_ifp->pim, up->sg.grp);
+               if (!rpg) {
+                       if (PIM_DEBUG_TRACE)
+                               zlog_debug(
+                                       "%s: Cannot send register for %s no RPF to the RP",
+                                       __PRETTY_FUNCTION__, up->sg_str);
+                       return 0;
+               }
                memset(&ip_hdr, 0, sizeof(struct ip));
                ip_hdr.ip_p = PIM_IP_PROTO_PIM;
                ip_hdr.ip_hl = 5;