pimd: Add a flag PIM_NEXTHOP_ANSWER_RECEIVED

Track whether or not we have received an answer from
our query to do nexthop tracking.  This allows us to
go straight to doing a synchronous query for our
RPF.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
Donald Sharp 2019-04-03 11:21:37 -04:00
parent 43763b11d0
commit 2cb7234faf
2 changed files with 7 additions and 3 deletions

View file

@ -710,6 +710,7 @@ int pim_parse_nexthop_update(int command, struct zclient *zclient,
nexthops_free(pnc->nexthop);
pnc->nexthop = NULL;
}
SET_FLAG(pnc->flags, PIM_NEXTHOP_ANSWER_RECEIVED);
if (PIM_DEBUG_PIM_NHT) {
char buf[PREFIX2STR_BUFFER];
@ -762,9 +763,11 @@ int pim_ecmp_nexthop_lookup(struct pim_instance *pim,
rpf.rpf_addr.u.prefix4 = src->u.prefix4;
pnc = pim_nexthop_cache_find(pim, &rpf);
if (pnc)
return pim_ecmp_nexthop_search(pim, pnc, nexthop, src, grp,
neighbor_needed);
if (pnc) {
if (CHECK_FLAG(pnc->flags, PIM_NEXTHOP_ANSWER_RECEIVED))
return pim_ecmp_nexthop_search(pim, pnc, nexthop, src, grp,
neighbor_needed);
}
memset(nexthop_tab, 0,
sizeof(struct pim_zlookup_nexthop) * MULTIPATH_NUM);

View file

@ -41,6 +41,7 @@ struct pim_nexthop_cache {
int64_t last_update;
uint16_t flags;
#define PIM_NEXTHOP_VALID (1 << 0)
#define PIM_NEXTHOP_ANSWER_RECEIVED (1 << 1)
struct list *rp_list;
struct hash *upstream_hash;