]> git.puffer.fish Git - mirror/frr.git/commitdiff
pimd: When receiving the register packet, create the mroute
authorDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 27 Jun 2016 18:51:04 +0000 (14:51 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 27 Jun 2016 19:46:02 +0000 (15:46 -0400)
When a RP receives the register packet, move the (*,G) to a
(S,G) route and send the pim message upstream to the source.

With this change the multicast packets are sent from the
source to the interested parties.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
pimd/pim_mroute.c
pimd/pim_register.c

index 4bf490f4569fd51a9bea4a3fd7f6ce1d606a7fd6..624264b3b5c4498eaff93cce1116c7e17c2e82c4 100644 (file)
@@ -524,7 +524,7 @@ int pim_mroute_del_vif(int vif_index)
 int pim_mroute_add(struct mfcctl *mc)
 {
   int err;
-  int orig;
+  int orig = 0;
 
   qpim_mroute_add_last = pim_time_monotonic_sec();
   ++qpim_mroute_add_events;
index 07f9652fe80758da394a4c3be6c53f2ab7a9f893..ce3ac1a4333eb362149f29cf199a179254f6825a 100644 (file)
 #include "pim_register.h"
 #include "pim_upstream.h"
 #include "pim_br.h"
+#include "pim_rpf.h"
+#include "pim_oil.h"
+#include "pim_zebra.h"
+#include "pim_join.h"
 
 struct thread *send_test_packet_timer = NULL;
 
@@ -250,10 +254,25 @@ pim_register_recv (struct interface *ifp,
     }
 
     if (!(upstream->sptbit == PIM_UPSTREAM_SPTBIT_TRUE) &&
-       !(*bits & PIM_REGISTER_NR_BIT)) {
-      //decapsulate and forward the iner packet to
-      //inherited_olist(S,G,rpt)
-    }
+       !(*bits & PIM_REGISTER_NR_BIT))
+      {
+       pim_rp_set_upstream_addr (&upstream->upstream_addr, source);
+       pim_nexthop_lookup (&upstream->rpf.source_nexthop,
+                           upstream->upstream_addr, NULL);
+       upstream->rpf.source_nexthop.interface = ifp;
+       upstream->source_addr.s_addr = source.s_addr;
+       upstream->rpf.rpf_addr.s_addr = source.s_addr;
+       upstream->channel_oil->oil.mfcc_origin = source;
+       pim_scan_individual_oil (upstream->channel_oil);
+       pim_joinprune_send(upstream->rpf.source_nexthop.interface,
+                          upstream->rpf.source_nexthop.mrib_nexthop_addr,
+                          upstream->source_addr,
+                          upstream->group_addr,
+                          1);
+
+       //decapsulate and forward the iner packet to
+       //inherited_olist(S,G,rpt)
+      }
   } else {
     pim_register_stop_send(src_addr);
   }