From 2ca35b3d73e8e3efe781990c4cf3f24853e477a5 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Mon, 27 Jun 2016 14:51:04 -0400 Subject: [PATCH] pimd: When receiving the register packet, create the mroute 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 --- pimd/pim_mroute.c | 2 +- pimd/pim_register.c | 27 +++++++++++++++++++++++---- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/pimd/pim_mroute.c b/pimd/pim_mroute.c index 4bf490f456..624264b3b5 100644 --- a/pimd/pim_mroute.c +++ b/pimd/pim_mroute.c @@ -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; diff --git a/pimd/pim_register.c b/pimd/pim_register.c index 07f9652fe8..ce3ac1a433 100644 --- a/pimd/pim_register.c +++ b/pimd/pim_register.c @@ -35,6 +35,10 @@ #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); } -- 2.39.5