From a749b9004136bd7c550c54f8f21d1e84b1569c20 Mon Sep 17 00:00:00 2001 From: Anuradha Karuppiah Date: Fri, 15 Nov 2019 11:19:53 -0800 Subject: [PATCH] pimd: on some triggers use_rpt re-evaluated for all groups RP config change is a big hammer and use_rpt/spt needs to be re-evaluated on all existing (S,G) entries. Signed-off-by: Anuradha Karuppiah --- pimd/pim_rp.c | 3 +++ pimd/pim_upstream.c | 16 ++++++++++++++++ pimd/pim_upstream.h | 1 + 3 files changed, 20 insertions(+) diff --git a/pimd/pim_rp.c b/pimd/pim_rp.c index 9ccba37f10..e85b1dd72d 100644 --- a/pimd/pim_rp.c +++ b/pimd/pim_rp.c @@ -274,6 +274,7 @@ struct rp_info *pim_rp_find_match_group(struct pim_instance *pim, static void pim_rp_refresh_group_to_rp_mapping(struct pim_instance *pim) { pim_msdp_i_am_rp_changed(pim); + pim_upstream_reeval_use_rpt(pim); } void pim_rp_prefix_list_update(struct pim_instance *pim, @@ -1041,6 +1042,7 @@ void pim_rp_check_on_if_add(struct pim_interface *pim_ifp) if (i_am_rp_changed) { pim_msdp_i_am_rp_changed(pim); + pim_upstream_reeval_use_rpt(pim); } } @@ -1083,6 +1085,7 @@ void pim_i_am_rp_re_evaluate(struct pim_instance *pim) if (i_am_rp_changed) { pim_msdp_i_am_rp_changed(pim); + pim_upstream_reeval_use_rpt(pim); } } diff --git a/pimd/pim_upstream.c b/pimd/pim_upstream.c index 316209c551..d841d10a07 100644 --- a/pimd/pim_upstream.c +++ b/pimd/pim_upstream.c @@ -627,6 +627,22 @@ void pim_upstream_update_use_rpt(struct pim_upstream *up, } } +/* some events like RP change require re-evaluation of SGrpt across + * all groups + */ +void pim_upstream_reeval_use_rpt(struct pim_instance *pim) +{ + struct pim_upstream *up; + struct listnode *node; + + for (ALL_LIST_ELEMENTS_RO(pim->upstream_list, node, up)) { + if (up->sg.src.s_addr == INADDR_ANY) + continue; + + pim_upstream_update_use_rpt(up, true /*update_mroute*/); + } +} + void pim_upstream_switch(struct pim_instance *pim, struct pim_upstream *up, enum pim_upstream_state new_state) { diff --git a/pimd/pim_upstream.h b/pimd/pim_upstream.h index 7597baaa32..3925bdf4a6 100644 --- a/pimd/pim_upstream.h +++ b/pimd/pim_upstream.h @@ -336,4 +336,5 @@ void pim_upstream_fill_static_iif(struct pim_upstream *up, struct interface *incoming); void pim_upstream_update_use_rpt(struct pim_upstream *up, bool update_mroute); +void pim_upstream_reeval_use_rpt(struct pim_instance *pim); #endif /* PIM_UPSTREAM_H */