From 35d6862d609d183c712c78c859f4b21a7e37768c Mon Sep 17 00:00:00 2001 From: Anuradha Karuppiah Date: Fri, 22 Nov 2019 09:14:00 -0800 Subject: [PATCH] pimd: eval use_rpt on new upstream post IIF setup but before MFC programming use_rpt macro depends on JoinDesired macro and is mostly independent of the actual RPF interface i.e. doesn't change when the RPF interface changes. There is however one exception to this handling and that is on the first hop router (DR or non-DR). On the DR the FHR flag is set so the RPF interface stays irrelevant to use_rpt eval. But on the non-DR the IIF is the only way to know we are directly connected to the SG i.e. to know that we must NOT switch the source to RPT. This commit fixes up the order of use_rpt eval - 1. it is done before mroute programming 2. but after IIF setup, for SRC_NOCACHE and STATIC_IIF upstream entries Note: drop an unnecessary check to verify that the RPF interface is pim enabled. This is just to make the code consistent. Ticket: CM-27446 Signed-off-by: Donald Sharp Signed-off-by: Anuradha Karuppiah --- pimd/pim_upstream.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pimd/pim_upstream.c b/pimd/pim_upstream.c index 8b54bcf019..ce26d2b398 100644 --- a/pimd/pim_upstream.c +++ b/pimd/pim_upstream.c @@ -865,12 +865,16 @@ static struct pim_upstream *pim_upstream_new(struct pim_instance *pim, pim_upstream_fill_static_iif(up, incoming); pim_ifp = up->rpf.source_nexthop.interface->info; assert(pim_ifp); + pim_upstream_update_use_rpt(up, + false /*update_mroute*/); pim_upstream_mroute_iif_update(up->channel_oil, __func__); if (PIM_UPSTREAM_FLAG_TEST_SRC_NOCACHE(up->flags)) pim_upstream_keep_alive_timer_start( up, pim->keep_alive_time); } else if (up->upstream_addr.s_addr != INADDR_ANY) { + pim_upstream_update_use_rpt(up, + false /*update_mroute*/); rpf_result = pim_rpf_update(pim, up, NULL, __func__); if (rpf_result == PIM_RPF_FAILURE) { if (PIM_DEBUG_PIM_TRACE) @@ -881,12 +885,9 @@ static struct pim_upstream *pim_upstream_new(struct pim_instance *pim, if (up->rpf.source_nexthop.interface) { pim_ifp = up->rpf.source_nexthop.interface->info; - if (pim_ifp) - pim_upstream_mroute_iif_update(up->channel_oil, - __func__); + pim_upstream_mroute_iif_update(up->channel_oil, + __func__); } - pim_upstream_update_use_rpt(up, - false /*update_mroute*/); } listnode_add_sort(pim->upstream_list, up);