fw: NccStrategy always sets pitEntryEntry->maxInterval
Change-Id: I675745cbd40e8d9c6651e6a728deb194ff37d189
refs: #1853
diff --git a/daemon/fw/ncc-strategy.cpp b/daemon/fw/ncc-strategy.cpp
index 838dd9a..fcabe7a 100644
--- a/daemon/fw/ncc-strategy.cpp
+++ b/daemon/fw/ncc-strategy.cpp
@@ -100,6 +100,12 @@
pitEntryInfo->maxInterval = std::max(time::microseconds(1),
time::microseconds((2 * deferRange.count() + nUpstreams - 1) / nUpstreams));
}
+ else {
+ // Normally, maxInterval is unused if there aren't any face beyond best and previousBest.
+ // However, in case FIB entry gains a new nexthop before doPropagate executes (bug 1853),
+ // this maxInterval would be used to determine when the next doPropagate would happen.
+ pitEntryInfo->maxInterval = deferFirst;
+ }
pitEntryInfo->propagateTimer = scheduler::schedule(deferFirst,
bind(&NccStrategy::doPropagate, this,
weak_ptr<pit::Entry>(pitEntry), weak_ptr<fib::Entry>(fibEntry)));
@@ -143,8 +149,8 @@
}
if (isForwarded) {
- boost::random::uniform_int_distribution<time::nanoseconds::rep> dist(
- 0, pitEntryInfo->maxInterval.count() - 1);
+ boost::random::uniform_int_distribution<time::nanoseconds::rep> dist(0,
+ pitEntryInfo->maxInterval.count() - 1);
time::nanoseconds deferNext = time::nanoseconds(dist(getGlobalRng()));
pitEntryInfo->propagateTimer = scheduler::schedule(deferNext,
bind(&NccStrategy::doPropagate, this,