pimd: change from ifchannels to oil's

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
Donald Sharp 2016-08-01 12:29:58 -04:00
parent 13376be4f2
commit 3667b0bcf6
2 changed files with 38 additions and 28 deletions

View File

@ -31,6 +31,7 @@
#include "pim_msg.h" #include "pim_msg.h"
#include "pim_pim.h" #include "pim_pim.h"
#include "pim_join.h" #include "pim_join.h"
#include "pim_oil.h"
#include "pim_iface.h" #include "pim_iface.h"
#include "pim_hello.h" #include "pim_hello.h"
#include "pim_ifchannel.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, pim_ifchannel_join_add(ifp, neigh->source_addr, upstream,
&sg, source_flags, holdtime); &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); for (ALL_LIST_ELEMENTS_RO (qpim_upstream_list, up_node, child))
if (up)
{ {
char buff[100]; if (child->parent == up)
strcpy (buff, pim_str_sg_dump (&up->sg)); {
zlog_debug("%s %s: Join(S,G)=%s from %s", char buff[100];
__FILE__, __PRETTY_FUNCTION__, strcpy (buff, pim_str_sg_dump (&up->sg));
buff, pim_str_sg_dump (&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_channel_add_oif (up->channel_oil, ifp, PIM_OIF_FLAG_PROTO_PIM);
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);
} }
} }
@ -162,20 +164,23 @@ static void recv_prune(struct interface *ifp,
pim_ifchannel_prune(ifp, upstream, &sg, source_flags, holdtime); 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; struct pim_upstream *up = pim_upstream_find (&sg);
struct pim_upstream *child;
struct listnode *up_node;
up = pim_upstream_find_non_any (&sg); for (ALL_LIST_ELEMENTS_RO (qpim_upstream_list, up_node, child))
if (up)
{ {
char buff[100]; if (child->parent == up)
strcpy (buff, pim_str_sg_dump (&up->sg)); {
zlog_debug("%s %s: Prune(S,G)=%s from %s", char buff[100];
__FILE__, __PRETTY_FUNCTION__, strcpy (buff, pim_str_sg_dump (&up->sg));
buff, pim_str_sg_dump (&sg)); zlog_debug("%s %s: Prune(S,G)=%s from %s",
pim_ifchannel_prune (ifp, upstream, &up->sg, source_flags, holdtime); __FILE__, __PRETTY_FUNCTION__,
buff, pim_str_sg_dump (&sg));
pim_channel_del_oif (up->channel_oil, ifp, PIM_OIF_FLAG_PROTO_PIM);
}
} }
} }

View File

@ -932,6 +932,10 @@ pim_upstream_inherited_olist (struct pim_upstream *up)
struct prefix anysrc; struct prefix anysrc;
int output_intf = 0; 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 = up->sg;
anysrc.u.sg.src.s_addr = INADDR_ANY; 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)) 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) if (ch->upstream != anysrc_up)
continue; continue;
if (ch->ifjoin_state == PIM_IFJOIN_JOIN) if (ch->ifjoin_state == PIM_IFJOIN_JOIN)
{ {
nch = pim_ifchannel_add (ifp, &up->sg); pim_channel_add_oif (up->channel_oil, ifp, PIM_OIF_FLAG_PROTO_PIM);
pim_ifchannel_ifjoin_switch (__PRETTY_FUNCTION__, nch, PIM_IFJOIN_JOIN); //nch = pim_ifchannel_add (ifp, &up->sg);
pim_forward_start (ch); //pim_ifchannel_ifjoin_switch (__PRETTY_FUNCTION__, nch, PIM_IFJOIN_JOIN);
//pim_forward_start (ch);
output_intf++; output_intf++;
} }
} }