diff --git a/pimd/pim_mroute.c b/pimd/pim_mroute.c index f6808feb49..9460219f13 100644 --- a/pimd/pim_mroute.c +++ b/pimd/pim_mroute.c @@ -26,6 +26,7 @@ #include "prefix.h" #include "pimd.h" +#include "pim_rpf.h" #include "pim_mroute.h" #include "pim_oil.h" #include "pim_str.h" @@ -345,6 +346,17 @@ pim_mroute_msg_wrvifwhole (int fd, struct interface *ifp, const char *buf) if (PIM_DEBUG_MROUTE) zlog_debug ("If channel: %p", ch); + up = pim_upstream_find (&sg); + if (up) + { + struct pim_nexthop source; + //No if channel, but upstream we are at the RP. + pim_nexthop_lookup (&source, up->upstream_register, NULL); + pim_register_stop_send(source.interface, &sg, up->upstream_register); + //Send S bit down the join. + return 0; + } + up = pim_upstream_add (&sg, ifp); if (!up) diff --git a/pimd/pim_register.c b/pimd/pim_register.c index d0fe89b01b..79f9283138 100644 --- a/pimd/pim_register.c +++ b/pimd/pim_register.c @@ -44,7 +44,7 @@ struct thread *send_test_packet_timer = NULL; -static void +void pim_register_stop_send (struct interface *ifp, struct prefix_sg *sg, struct in_addr originator) { @@ -321,6 +321,7 @@ pim_register_recv (struct interface *ifp, { upstream = pim_upstream_add (&sg, ifp); + upstream->upstream_register = src_addr; pim_rp_set_upstream_addr (&upstream->upstream_addr, sg.src, sg.grp); pim_nexthop_lookup (&upstream->rpf.source_nexthop, upstream->upstream_addr, NULL); @@ -328,7 +329,8 @@ pim_register_recv (struct interface *ifp, upstream->sg.src = sg.src; upstream->rpf.rpf_addr = upstream->rpf.source_nexthop.mrib_nexthop_addr; - pim_upstream_switch (upstream, PIM_UPSTREAM_PRUNE); + //pim_upstream_switch (upstream, PIM_UPSTREAM_PRUNE); + upstream->join_state = PIM_UPSTREAM_PRUNE; } diff --git a/pimd/pim_register.h b/pimd/pim_register.h index 8ab24b7137..ce2e052104 100644 --- a/pimd/pim_register.h +++ b/pimd/pim_register.h @@ -43,5 +43,6 @@ int pim_register_recv (struct interface *ifp, uint8_t *tlv_buf, int tlv_buf_size); void pim_register_send (const uint8_t *buf, int buf_size, struct pim_rpf *rpg, int null_register); +void pim_register_stop_send (struct interface *ifp, struct prefix_sg *sg, struct in_addr originator); #endif diff --git a/pimd/pim_upstream.c b/pimd/pim_upstream.c index 932e06b76d..9ee0e87004 100644 --- a/pimd/pim_upstream.c +++ b/pimd/pim_upstream.c @@ -225,8 +225,7 @@ static void join_timer_start(struct pim_upstream *up) pim_str_sg_dump (&up->sg)); } - zassert(!up->t_join_timer); - + THREAD_OFF (up->t_join_timer); THREAD_TIMER_ON(master, up->t_join_timer, on_join_timer, up, qpim_t_periodic); diff --git a/pimd/pim_upstream.h b/pimd/pim_upstream.h index eea9456013..fccb1c4186 100644 --- a/pimd/pim_upstream.h +++ b/pimd/pim_upstream.h @@ -90,6 +90,7 @@ struct pim_upstream { struct pim_upstream *parent; int fhr; struct in_addr upstream_addr;/* Who we are talking to */ + struct in_addr upstream_register; /*Who we received a register from*/ struct prefix_sg sg; /* (S,G) group key */ uint32_t flags; struct channel_oil *channel_oil;