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 <sharpd@cumulusnetworks.com>
Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
This commit is contained in:
Anuradha Karuppiah 2019-11-22 09:14:00 -08:00
parent 075a475e0c
commit 35d6862d60

View File

@ -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);