]> git.puffer.fish Git - mirror/frr.git/commitdiff
pimd: fix pimd crash when pim interface disabled
authorChirag Shah <chirag@cumulusnetworks.com>
Thu, 4 May 2017 01:56:44 +0000 (18:56 -0700)
committerChirag Shah <chirag@cumulusnetworks.com>
Sun, 7 May 2017 00:38:18 +0000 (17:38 -0700)
Upon pim enabled disabled, current upstreams entries rpf update callback,
needs to check if old rpf is still pim enabled otherwise do not trigger
prune towards old rpf.

Testing Done:
Verified by disabling pim enabled rpf interface and
 crash is not observed upon disabling pim on rpf interface.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
pimd/pim_jp_agg.c

index ce4ddfd4a4a20baa4ba904982ad1fac49bd40ab8..bbc51bd91c7fad8027638abc3a6bc9e5989332cb 100644 (file)
@@ -127,6 +127,10 @@ pim_jp_agg_get_interface_upstream_switch_list (struct pim_rpf *rpf)
   struct pim_iface_upstream_switch *pius;
   struct listnode *node, *nnode;
 
+  /* Old interface is pim disabled */
+  if (!pim_ifp)
+    return NULL;
+
   for (ALL_LIST_ELEMENTS(pim_ifp->upstream_switch_list, node, nnode, pius))
     {
       if (pius->address.s_addr == rpf->rpf_addr.u.prefix4.s_addr)
@@ -323,7 +327,8 @@ pim_jp_agg_switch_interface (struct pim_rpf *orpf,
    */
 
   /* send Prune(S,G) to the old upstream neighbor */
-  pim_jp_agg_add_group (opius->us, up, false);
+  if (opius)
+    pim_jp_agg_add_group (opius->us, up, false);
 
   /* send Join(S,G) to the current upstream neighbor */
   pim_jp_agg_add_group (npius->us, up, true);