From: Donald Sharp Date: Mon, 1 Aug 2016 16:29:58 +0000 (-0400) Subject: pimd: change from ifchannels to oil's X-Git-Tag: frr-3.0-branchpoint~64^2~10^2~329 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=3667b0bcf62d73248587ece9d4efd91f78c83a63;p=mirror%2Ffrr.git pimd: change from ifchannels to oil's Signed-off-by: Donald Sharp --- diff --git a/pimd/pim_join.c b/pimd/pim_join.c index 265165d83b..0a40ab6210 100644 --- a/pimd/pim_join.c +++ b/pimd/pim_join.c @@ -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); + } } } diff --git a/pimd/pim_upstream.c b/pimd/pim_upstream.c index b404e144e8..7b87bdac73 100644 --- a/pimd/pim_upstream.c +++ b/pimd/pim_upstream.c @@ -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++; } }