diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2016-08-01 12:29:58 -0400 |
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2016-12-21 20:26:04 -0500 |
| commit | 3667b0bcf62d73248587ece9d4efd91f78c83a63 (patch) | |
| tree | f81251b40f5660879b4d9c5862e1caa374879ae0 /pimd/pim_join.c | |
| parent | 13376be4f28cbc99394452f50ce214f7127f2965 (diff) | |
pimd: change from ifchannels to oil's
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'pimd/pim_join.c')
| -rw-r--r-- | pimd/pim_join.c | 55 |
1 files changed, 30 insertions, 25 deletions
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); + } } } |
