fw: localhop scope restriction in best-route v1, multicast, ncc strategies
canForwardToLegacy function no longer checks scope. Strategies using this
function shall use wouldViolateScope separately.
refs #3841, #1756
Change-Id: Ib1bd3f9fe19e4cadfa27e86dcc730d16cfd4b0db
diff --git a/daemon/fw/best-route-strategy.cpp b/daemon/fw/best-route-strategy.cpp
index ebe0d08..a8877e1 100644
--- a/daemon/fw/best-route-strategy.cpp
+++ b/daemon/fw/best-route-strategy.cpp
@@ -48,16 +48,17 @@
const fib::Entry& fibEntry = this->lookupFib(*pitEntry);
const fib::NextHopList& nexthops = fibEntry.getNextHops();
- fib::NextHopList::const_iterator it = std::find_if(nexthops.begin(), nexthops.end(),
- [&pitEntry] (const fib::NextHop& nexthop) { return canForwardToLegacy(*pitEntry, nexthop.getFace()); });
- if (it == nexthops.end()) {
- this->rejectPendingInterest(pitEntry);
- return;
+ for (fib::NextHopList::const_iterator it = nexthops.begin(); it != nexthops.end(); ++it) {
+ Face& outFace = it->getFace();
+ if (!wouldViolateScope(inFace, interest, outFace) &&
+ canForwardToLegacy(*pitEntry, outFace)) {
+ this->sendInterest(pitEntry, outFace, interest);
+ return;
+ }
}
- Face& outFace = it->getFace();
- this->sendInterest(pitEntry, outFace);
+ this->rejectPendingInterest(pitEntry);
}
} // namespace fw