fw: duplicate Nonce from same face is not loop

refs #3888

Change-Id: I973f58281dca32b5f807d7be82a49d04314cbfb1
diff --git a/daemon/fw/forwarder.cpp b/daemon/fw/forwarder.cpp
index 1e01e02..7a36042 100644
--- a/daemon/fw/forwarder.cpp
+++ b/daemon/fw/forwarder.cpp
@@ -159,8 +159,12 @@
   shared_ptr<pit::Entry> pitEntry = m_pit.insert(interest).first;
 
   // detect duplicate Nonce in PIT entry
-  bool hasDuplicateNonceInPit = fw::findDuplicateNonce(*pitEntry, interest.getNonce(), inFace) !=
-                                fw::DUPLICATE_NONCE_NONE;
+  int dnw = fw::findDuplicateNonce(*pitEntry, interest.getNonce(), inFace);
+  bool hasDuplicateNonceInPit = dnw != fw::DUPLICATE_NONCE_NONE;
+  if (inFace.getLinkType() == ndn::nfd::LINK_TYPE_POINT_TO_POINT) {
+    // for p2p face: duplicate Nonce from same incoming face is not loop
+    hasDuplicateNonceInPit = hasDuplicateNonceInPit && !(dnw & fw::DUPLICATE_NONCE_IN_SAME);
+  }
   if (hasDuplicateNonceInPit) {
     // goto Interest loop pipeline
     this->onInterestLoop(inFace, interest);