]> git.puffer.fish Git - mirror/frr.git/commitdiff
pimd: Turn on forwarding for a late added interface.
authorDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 24 Aug 2016 14:25:11 +0000 (10:25 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 22 Dec 2016 01:26:07 +0000 (20:26 -0500)
If we receive a join for a upstream interface that hasn't
yet been added to pim for working under it, we never
go back and add the forwarding on when we get the
interface added to pim.

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

index dab2e0e1e715a07f5f7e6bed18b4c6d1edb602ef..867f59679add2086a88827cd6da514ccb9ede97b 100644 (file)
@@ -407,6 +407,7 @@ void pim_if_addr_add(struct connected *ifc)
     if (pim_ifp->mroute_vif_index < 0) {
       pim_if_add_vif(ifp);
     }
+    pim_ifchannel_scan_forward_start (ifp);
   }
 }
 
index 85bd178d9be9a7c9bd086e5d81df3a5fdbf25de9..e2b145a5b21bfaa1accb96b57590ae16922c936e 100644 (file)
@@ -25,6 +25,7 @@
 #include "thread.h"
 #include "memory.h"
 #include "if.h"
+#include "vrf.h"
 
 #include "pimd.h"
 #include "pim_str.h"
@@ -980,3 +981,41 @@ void pim_ifchannel_update_assert_tracking_desired(struct pim_ifchannel *ch)
     }
   }
 }
+
+/*
+ * If we have a new pim interface, check to
+ * see if any of the pre-existing channels have
+ * their upstream out that way and turn on forwarding
+ * for that ifchannel then.
+ */
+void
+pim_ifchannel_scan_forward_start (struct interface *new_ifp)
+{
+  struct listnode *ifnode;
+  struct interface *ifp;
+  struct pim_interface *new_pim_ifp = new_ifp->info;
+
+  for (ALL_LIST_ELEMENTS_RO (vrf_iflist (VRF_DEFAULT), ifnode, ifp))
+    {
+      struct pim_interface *loop_pim_ifp = ifp->info;
+      struct listnode *ch_node;
+      struct pim_ifchannel *ch;
+
+      if (!loop_pim_ifp)
+        continue;
+
+      if (new_pim_ifp == loop_pim_ifp)
+        continue;
+
+      for (ALL_LIST_ELEMENTS_RO (loop_pim_ifp->pim_ifchannel_list, ch_node, ch))
+        {
+          if (ch->ifjoin_state == PIM_IFJOIN_JOIN)
+            {
+              struct pim_upstream *up = ch->upstream;
+              if ((!up->channel_oil) &&
+                 (up->rpf.source_nexthop.interface == new_ifp))
+                pim_forward_start (ch);
+            }
+        }
+    }
+}
index 7036131e560979d05b52fba598d970e586ffa011..0c39210642d55171ebdce102771fd18a8347bb13 100644 (file)
@@ -136,4 +136,5 @@ void pim_ifchannel_update_could_assert(struct pim_ifchannel *ch);
 void pim_ifchannel_update_my_assert_metric(struct pim_ifchannel *ch);
 void pim_ifchannel_update_assert_tracking_desired(struct pim_ifchannel *ch);
 
+void pim_ifchannel_scan_forward_start (struct interface *new_ifp);
 #endif /* PIM_IFCHANNEL_H */