From: Donald Sharp Date: Mon, 29 Aug 2016 14:49:47 +0000 (-0400) Subject: pimd: trigger on nbr up to look at rpf cache X-Git-Tag: frr-3.0-branchpoint~64^2~10^2~255 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=d3dd1804063b2c2125d6463a1b0ec734af44dd68;p=mirror%2Ffrr.git pimd: trigger on nbr up to look at rpf cache If a neighbor comes up *after* igmp joins and *after* all the routes are installed into the kernel, then we never go back and fix up the rpf cache information. So joins never go out for those igmp joins. Ticket: CM-12613 Signed-off-by: Donald Sharp --- diff --git a/pimd/pim_neighbor.c b/pimd/pim_neighbor.c index 4d79388092..61e19d8005 100644 --- a/pimd/pim_neighbor.c +++ b/pimd/pim_neighbor.c @@ -462,6 +462,8 @@ struct pim_neighbor *pim_neighbor_add(struct interface *ifp, else pim_hello_restart_triggered(neigh->interface); + pim_upstream_find_new_rpf(); + return neigh; } diff --git a/pimd/pim_upstream.c b/pimd/pim_upstream.c index 84b64fd709..9a11eefd60 100644 --- a/pimd/pim_upstream.c +++ b/pimd/pim_upstream.c @@ -506,7 +506,7 @@ static struct pim_upstream *pim_upstream_new(struct prefix_sg *sg, up->rpf.source_nexthop.mrib_route_metric = qpim_infinite_assert_metric.route_metric; up->rpf.rpf_addr.s_addr = PIM_NET_INADDR_ANY; - rpf_result = pim_rpf_update(up, 0); + rpf_result = pim_rpf_update(up, NULL); if (rpf_result == PIM_RPF_FAILURE) { XFREE(MTYPE_PIM_UPSTREAM, up); return NULL; @@ -1102,3 +1102,31 @@ pim_upstream_inherited_olist (struct pim_upstream *up) return output_intf; } + +/* + * When we have a new neighbor, + * find upstreams that don't have their rpf_addr + * set and see if the new neighbor allows + * the join to be sent + */ +void +pim_upstream_find_new_rpf (void) +{ + struct listnode *up_node; + struct listnode *up_nextnode; + struct pim_upstream *up; + + /* + Scan all (S,G) upstreams searching for RPF'(S,G)=neigh_addr + */ + for (ALL_LIST_ELEMENTS(qpim_upstream_list, up_node, up_nextnode, up)) + { + if (PIM_INADDR_IS_ANY(up->rpf.rpf_addr)) + { + if (PIM_DEBUG_PIM_TRACE) + zlog_debug ("Upstream %s without a path to send join, checking", + pim_str_sg_dump (&up->sg)); + pim_rpf_update (up, NULL); + } + } +} diff --git a/pimd/pim_upstream.h b/pimd/pim_upstream.h index 03dcd6bfd2..95492b27c1 100644 --- a/pimd/pim_upstream.h +++ b/pimd/pim_upstream.h @@ -160,4 +160,7 @@ void pim_upstream_switch (struct pim_upstream *up, enum pim_upstream_state new_s const char *pim_upstream_state2str (enum pim_upstream_state join_state); int pim_upstream_inherited_olist (struct pim_upstream *up); + +void pim_upstream_find_new_rpf (void); + #endif /* PIM_UPSTREAM_H */