From: Donald Sharp Date: Sat, 23 Jul 2016 16:30:41 +0000 (-0400) Subject: pimd: Some bug fixes for the register receive code path X-Git-Tag: frr-3.0-branchpoint~64^2~10^2~347 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=216bb84fd5f287d5e52ea170efd37cc002db8493;p=mirror%2Ffrr.git pimd: Some bug fixes for the register receive code path When we receive a register receive handle it a bit better. Signed-off-by: Donald Sharp --- diff --git a/pimd/pim_register.c b/pimd/pim_register.c index 87a8ca935f..79bfa4afc9 100644 --- a/pimd/pim_register.c +++ b/pimd/pim_register.c @@ -316,6 +316,14 @@ pim_register_recv (struct interface *ifp, if (!upstream) { upstream = pim_upstream_add (&sg, ifp); + + pim_rp_set_upstream_addr (&upstream->upstream_addr, sg.u.sg.src); + pim_nexthop_lookup (&upstream->rpf.source_nexthop, + upstream->upstream_addr, NULL); + upstream->rpf.source_nexthop.interface = ifp; + upstream->sg.u.sg.src = sg.u.sg.src; + upstream->rpf.rpf_addr = upstream->rpf.source_nexthop.mrib_nexthop_addr; + pim_upstream_switch (upstream, PIM_UPSTREAM_PRUNE); } @@ -323,14 +331,7 @@ pim_register_recv (struct interface *ifp, if ((upstream->sptbit == PIM_UPSTREAM_SPTBIT_TRUE) || ((SwitchToSptDesired(&sg)) && pim_upstream_inherited_olist (upstream) == 0)) { - pim_rp_set_upstream_addr (&upstream->upstream_addr, sg.u.sg.src); - pim_nexthop_lookup (&upstream->rpf.source_nexthop, - upstream->upstream_addr, NULL); - upstream->rpf.source_nexthop.interface = ifp; - upstream->sg.u.sg.src = sg.u.sg.src; - upstream->rpf.rpf_addr = upstream->rpf.source_nexthop.mrib_nexthop_addr; - upstream->channel_oil->oil.mfcc_origin = sg.u.sg.src; - pim_scan_individual_oil (upstream->channel_oil); + //pim_scan_individual_oil (upstream->channel_oil); pim_register_stop_send (ifp, &sg, src_addr); sentRegisterStop = 1; } diff --git a/pimd/pim_upstream.c b/pimd/pim_upstream.c index 34e7d9a759..7d20de6bda 100644 --- a/pimd/pim_upstream.c +++ b/pimd/pim_upstream.c @@ -507,7 +507,8 @@ void pim_upstream_update_join_desired(struct pim_upstream *up) /* switched from false to true */ if (is_join_desired && !was_join_desired) { - zassert(up->join_state == PIM_UPSTREAM_NOTJOINED); + zassert(up->join_state == PIM_UPSTREAM_NOTJOINED || + up->join_state == PIM_UPSTREAM_PRUNE); pim_upstream_switch(up, PIM_UPSTREAM_JOINED); return; } @@ -914,12 +915,16 @@ pim_upstream_inherited_olist (struct pim_upstream *up) for (ALL_LIST_ELEMENTS (pim_ifp->pim_ifchannel_list, chnode, chnextnode, ch)) { + struct pim_ifchannel *nch; + if (ch->upstream != anysrc_up) continue; if (ch->ifjoin_state == PIM_IFJOIN_JOIN) { - pim_ifchannel_add (ifp, &up->sg); + nch = pim_ifchannel_add (ifp, &up->sg); + pim_ifchannel_ifjoin_switch (__PRETTY_FUNCTION__, nch, PIM_IFJOIN_JOIN); + pim_forward_start (ch); output_intf++; } } @@ -927,7 +932,8 @@ pim_upstream_inherited_olist (struct pim_upstream *up) } if (output_intf) - pim_upstream_send_join (up); + if (up->join_state != PIM_UPSTREAM_JOINED) + pim_upstream_switch (up, PIM_UPSTREAM_JOINED); return output_intf; }