fw: localhop scope restriction in ASF strategy
refs: #3841, #1756
Change-Id: Ic82e7055ace9d3f8eca8f9bad94603692ff321d5
diff --git a/daemon/fw/asf-strategy.cpp b/daemon/fw/asf-strategy.cpp
index 657656c..acab918 100644
--- a/daemon/fw/asf-strategy.cpp
+++ b/daemon/fw/asf-strategy.cpp
@@ -24,6 +24,7 @@
*/
#include "asf-strategy.hpp"
+#include "algorithm.hpp"
#include "core/logger.hpp"
@@ -89,9 +90,6 @@
Face* faceToProbe = m_probing.getFaceToProbe(inFace, interest, fibEntry, *faceToUse);
if (faceToProbe != nullptr) {
- NFD_LOG_TRACE("Sending probe for " << fibEntry.getPrefix()
- << " to FaceId: " << faceToProbe->getId());
-
bool wantNewNonce = true;
forwardInterest(interest, fibEntry, pitEntry, *faceToProbe, wantNewNonce);
m_probing.afterForwardingProbe(fibEntry, interest);
@@ -140,7 +138,17 @@
Face& outFace,
bool wantNewNonce)
{
- this->sendInterest(pitEntry, outFace, wantNewNonce);
+ if (wantNewNonce) {
+ //Send probe: interest with new Nonce
+ Interest probeInterest(interest);
+ probeInterest.refreshNonce();
+ NFD_LOG_TRACE("Sending probe for " << probeInterest << probeInterest.getNonce()
+ << " to FaceId: " << outFace.getId());
+ this->sendInterest(pitEntry, outFace, probeInterest);
+ }
+ else {
+ this->sendInterest(pitEntry, outFace, interest);
+ }
FaceInfo& faceInfo = m_measurements.getOrCreateFaceInfo(fibEntry, interest, outFace);
@@ -219,7 +227,7 @@
for (const fib::NextHop& hop : fibEntry.getNextHops()) {
Face& hopFace = hop.getFace();
- if (hopFace.getId() == inFace.getId()) {
+ if (hopFace.getId() == inFace.getId() || wouldViolateScope(inFace, interest, hopFace)) {
continue;
}