summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pimd/pim_nht.c9
-rw-r--r--pimd/pim_nht.h1
2 files changed, 7 insertions, 3 deletions
diff --git a/pimd/pim_nht.c b/pimd/pim_nht.c
index 0ec239ceab..8a459fe86e 100644
--- a/pimd/pim_nht.c
+++ b/pimd/pim_nht.c
@@ -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);
diff --git a/pimd/pim_nht.h b/pimd/pim_nht.h
index 8f68af5652..13bb0fcb55 100644
--- a/pimd/pim_nht.h
+++ b/pimd/pim_nht.h
@@ -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;