]> git.puffer.fish Git - mirror/frr.git/commitdiff
pimd: Allow bridges and bonds to up and down
authorDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 8 Dec 2016 17:40:05 +0000 (12:40 -0500)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 22 Dec 2016 01:26:19 +0000 (20:26 -0500)
Bridges and bonds when ifdowned are removed from
the kernel in it's entirety, while pim assumed
that interfaces were kept around in some fashion.

Basically when we had an ifdown event, for all ifchannels
on that interface delete from the OIF.  Also note
the fact that the vif has gone away and we need to
recreate it on the next ifup.

Ticket: CM-13896
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
pimd/pim_iface.c
pimd/pim_ifchannel.c
pimd/pim_zebra.c

index 0a104acef172ff9e00780204b6c6ccfa3a0420f5..3c8bbac6ecb80cc66d79e5efa3aa0562fdae78a5 100644 (file)
@@ -715,6 +715,17 @@ void pim_if_addr_add_all(struct interface *ifp)
        }
       } /* pim */
     }
+  if (PIM_MROUTE_IS_ENABLED) {
+    /*
+     * PIM or IGMP is enabled on interface, and there is at least one
+     * address assigned, then try to create a vif_index.
+     */
+    if (pim_ifp->mroute_vif_index < 0) {
+      pim_if_add_vif(ifp);
+    }
+    pim_ifchannel_scan_forward_start (ifp);
+  }
+
   pim_rp_setup();
   pim_rp_check_on_if_add(pim_ifp);
 }
index efb1e3c65e28c30f011fef9c0862342d5a2bfe1c..77d8e82eec2600d8f24f64ceb44a02e34fe88919 100644 (file)
@@ -141,6 +141,23 @@ void pim_ifchannel_delete(struct pim_ifchannel *ch)
 
   pim_ifp = ch->interface->info;
 
+  if (ch->upstream->channel_oil)
+    {
+      pim_channel_del_oif (ch->upstream->channel_oil, ch->interface, PIM_OIF_FLAG_PROTO_PIM);
+      /*
+       * Do we have any S,G's that are inheriting?
+       * Nuke from on high too.
+       */
+      if (ch->upstream->sources)
+       {
+         struct pim_upstream *child;
+         struct listnode *up_node;
+
+         for (ALL_LIST_ELEMENTS_RO (ch->upstream->sources, up_node, child))
+           pim_channel_del_oif (child->channel_oil, ch->interface, PIM_OIF_FLAG_PROTO_PIM);
+       }
+    }
+
   /*
    * When this channel is removed
    * we need to find all our children
@@ -187,6 +204,8 @@ pim_ifchannel_delete_all (struct interface *ifp)
   struct pim_ifchannel *ifchannel;
 
   pim_ifp = ifp->info;
+  if (!pim_ifp)
+    return;
 
   for (ALL_LIST_ELEMENTS (pim_ifp->pim_ifchannel_list, ifchannel_node,
                          ifchannel_nextnode, ifchannel))
index 9d8c07cadb018d5b89d73321a03a0b8d0fdeee4e..41934074e13b1ab28685946f135ccdea060aeef2 100644 (file)
@@ -174,6 +174,7 @@ static int pim_zebra_if_state_down(int command, struct zclient *zclient,
   }
 
   if (!if_is_operative(ifp)) {
+    pim_ifchannel_delete_all(ifp);
     /*
       pim_if_addr_del_all() suffices for shutting down IGMP,
       but not for shutting down PIM
@@ -189,6 +190,9 @@ static int pim_zebra_if_state_down(int command, struct zclient *zclient,
     }
   }
 
+  if (ifp->info)
+    pim_if_del_vif(ifp);
+
   return 0;
 }