From: Donald Sharp Date: Thu, 28 Mar 2019 14:27:57 +0000 (-0400) Subject: pimd: No need to rescan upstream list on rpf change X-Git-Tag: 7.1_pulled~117^2~2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=4f9aec30ead36414971ffb1317a3f23d6b413206;p=mirror%2Ffrr.git pimd: No need to rescan upstream list on rpf change The code as written will scan the entirety of all pim upstreams on a rpf change, this is not necessary because we know that when we get a nexthop change we already scan the upstreams reliant on that and do this work. There is no need to do this again a short time later. Signed-off-by: Donald Sharp --- diff --git a/pimd/pim_zebra.c b/pimd/pim_zebra.c index 78cccd5877..a277226885 100644 --- a/pimd/pim_zebra.c +++ b/pimd/pim_zebra.c @@ -541,45 +541,6 @@ void pim_zebra_upstream_rpf_changed(struct pim_instance *pim, pim_upstream_update_join_desired(pim, up); } -static void scan_upstream_rpf_cache(struct pim_instance *pim) -{ - struct listnode *up_node; - struct listnode *up_nextnode; - struct pim_upstream *up; - - for (ALL_LIST_ELEMENTS(pim->upstream_list, up_node, up_nextnode, up)) { - enum pim_rpf_result rpf_result; - struct pim_rpf old; - struct prefix nht_p; - - if (up->upstream_addr.s_addr == INADDR_ANY) { - if (PIM_DEBUG_TRACE) - zlog_debug( - "%s: RP not configured for Upstream %s", - __PRETTY_FUNCTION__, up->sg_str); - continue; - } - - nht_p.family = AF_INET; - nht_p.prefixlen = IPV4_MAX_BITLEN; - nht_p.u.prefix4.s_addr = up->upstream_addr.s_addr; - pim_resolve_upstream_nh(pim, &nht_p); - - old.source_nexthop.interface = up->rpf.source_nexthop.interface; - old.source_nexthop.nbr = up->rpf.source_nexthop.nbr; - rpf_result = pim_rpf_update(pim, up, &old, 0); - - if (rpf_result == PIM_RPF_FAILURE) - continue; - - if (rpf_result == PIM_RPF_CHANGED) - pim_zebra_upstream_rpf_changed(pim, up, &old); - - } /* for (qpim_upstream_list) */ - - pim_zebra_update_all_interfaces(pim); -} - void pim_scan_individual_oil(struct channel_oil *c_oil, int in_vif_index) { struct in_addr vif_source; @@ -743,9 +704,6 @@ static int on_rpf_cache_refresh(struct thread *t) { struct pim_instance *pim = THREAD_ARG(t); - /* update PIM protocol state */ - scan_upstream_rpf_cache(pim); - /* update kernel multicast forwarding cache (MFC) */ pim_scan_oil(pim);