]> git.puffer.fish Git - mirror/frr.git/commitdiff
pimd: change from ifchannels to oil's
authorDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 1 Aug 2016 16:29:58 +0000 (12:29 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 22 Dec 2016 01:26:04 +0000 (20:26 -0500)
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
pimd/pim_join.c
pimd/pim_upstream.c

index 265165d83b4dd74f77a6a6af1d3b41259bf04d50..0a40ab6210e634d0726aa28555f5ed7a3e8d0466 100644 (file)
@@ -31,6 +31,7 @@
 #include "pim_msg.h"
 #include "pim_pim.h"
 #include "pim_join.h"
+#include "pim_oil.h"
 #include "pim_iface.h"
 #include "pim_hello.h"
 #include "pim_ifchannel.h"
@@ -99,23 +100,24 @@ static void recv_join(struct interface *ifp,
   pim_ifchannel_join_add(ifp, neigh->source_addr, upstream,
                         &sg, source_flags, holdtime);
 
-  if (I_am_RP (group) && sg.u.sg.src.s_addr == INADDR_ANY)
+  if (sg.u.sg.src.s_addr == INADDR_ANY)
     {
-      struct pim_upstream *up;
+      struct pim_upstream *up = pim_upstream_find (&sg);
+      struct pim_upstream *child;
+      struct listnode *up_node;
 
-      up = pim_upstream_find_non_any (&sg);
-
-      if (up)
+      for (ALL_LIST_ELEMENTS_RO (qpim_upstream_list, up_node, child))
         {
-         char buff[100];
-         strcpy (buff, pim_str_sg_dump (&up->sg));
-         zlog_debug("%s %s: Join(S,G)=%s from %s",
-                    __FILE__, __PRETTY_FUNCTION__,
-                    buff, pim_str_sg_dump (&sg));
-
-         pim_rp_set_upstream_addr (&up->upstream_addr, up->sg.u.sg.src);
-         pim_nexthop_lookup (&up->rpf.source_nexthop, up->upstream_addr, NULL);
-         pim_ifchannel_join_add (ifp, neigh->source_addr, upstream, &up->sg, source_flags, holdtime);
+          if (child->parent == up)
+            {
+             char buff[100];
+             strcpy (buff, pim_str_sg_dump (&up->sg));
+             zlog_debug("%s %s: Join(S,G)=%s from %s",
+                        __FILE__, __PRETTY_FUNCTION__,
+                        buff, pim_str_sg_dump (&sg));
+
+              pim_channel_add_oif (up->channel_oil, ifp, PIM_OIF_FLAG_PROTO_PIM);
+            }
         }
     }
 
@@ -162,20 +164,23 @@ static void recv_prune(struct interface *ifp,
   
   pim_ifchannel_prune(ifp, upstream, &sg, source_flags, holdtime);
 
-  if (I_am_RP (group) && sg.u.sg.src.s_addr == INADDR_ANY)
+  if (sg.u.sg.src.s_addr == INADDR_ANY)
     {
-      struct pim_upstream *up;
-
-      up = pim_upstream_find_non_any (&sg);
+      struct pim_upstream *up = pim_upstream_find (&sg);
+      struct pim_upstream *child;
+      struct listnode *up_node;
 
-      if (up)
+      for (ALL_LIST_ELEMENTS_RO (qpim_upstream_list, up_node, child))
         {
-         char buff[100];
-         strcpy (buff, pim_str_sg_dump (&up->sg));
-         zlog_debug("%s %s: Prune(S,G)=%s from %s",
-                    __FILE__, __PRETTY_FUNCTION__,
-                    buff, pim_str_sg_dump (&sg));
-         pim_ifchannel_prune (ifp, upstream, &up->sg, source_flags, holdtime);
+          if (child->parent == up)
+            {
+             char buff[100];
+             strcpy (buff, pim_str_sg_dump (&up->sg));
+             zlog_debug("%s %s: Prune(S,G)=%s from %s",
+                        __FILE__, __PRETTY_FUNCTION__,
+                        buff, pim_str_sg_dump (&sg));
+             pim_channel_del_oif (up->channel_oil, ifp, PIM_OIF_FLAG_PROTO_PIM);
+           }
         }
     }
 
index b404e144e89bbe9949d73abe79e394310394acf9..7b87bdac736e2e4754dc8cbd5cae351684d0a4d6 100644 (file)
@@ -932,6 +932,10 @@ pim_upstream_inherited_olist (struct pim_upstream *up)
   struct prefix anysrc;
   int output_intf = 0;
 
+  pim_ifp = up->rpf.source_nexthop.interface->info;
+  zlog_debug ("Channel Oil%s: %p", pim_str_sg_dump (&up->sg), up->channel_oil);
+  if (!up->channel_oil)
+    up->channel_oil = pim_channel_oil_add (&up->sg, pim_ifp->mroute_vif_index);
   anysrc = up->sg;
   anysrc.u.sg.src.s_addr = INADDR_ANY;
 
@@ -946,16 +950,17 @@ pim_upstream_inherited_olist (struct pim_upstream *up)
 
          for (ALL_LIST_ELEMENTS (pim_ifp->pim_ifchannel_list, chnode, chnextnode, ch))
            {
-             struct pim_ifchannel *nch;
+             //struct pim_ifchannel *nch;
 
              if (ch->upstream != anysrc_up)
                continue;
 
              if (ch->ifjoin_state == PIM_IFJOIN_JOIN)
                {
-                 nch = pim_ifchannel_add (ifp, &up->sg);
-                 pim_ifchannel_ifjoin_switch (__PRETTY_FUNCTION__, nch, PIM_IFJOIN_JOIN);
-                 pim_forward_start (ch);
+                 pim_channel_add_oif (up->channel_oil, ifp, PIM_OIF_FLAG_PROTO_PIM);
+                 //nch = pim_ifchannel_add (ifp, &up->sg);
+                 //pim_ifchannel_ifjoin_switch (__PRETTY_FUNCTION__, nch, PIM_IFJOIN_JOIN);
+                 //pim_forward_start (ch);
                  output_intf++;
                }
            }