fw: strip Link object when Interest reaches producer region
refs #3893
Change-Id: I7cb0a58f75eb4275bbf0fe0c7dcdb583c8519644
diff --git a/daemon/fw/forwarder.cpp b/daemon/fw/forwarder.cpp
index 76e4127..1e01e02 100644
--- a/daemon/fw/forwarder.cpp
+++ b/daemon/fw/forwarder.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
- * Copyright (c) 2014-2016, Regents of the University of California,
+ * Copyright (c) 2014-2017, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -146,6 +146,15 @@
return;
}
+ // strip Link object if Interest has reached producer region
+ if (interest.hasLink() && m_networkRegionTable.isInProducerRegion(interest.getLink())) {
+ NFD_LOG_DEBUG("onIncomingInterest face=" << inFace.getId() <<
+ " interest=" << interest.getName() << " reaching-producer-region");
+ Interest& interestRef = const_cast<Interest&>(interest);
+ interestRef.unsetLink();
+ interestRef.unsetSelectedDelegation();
+ }
+
// PIT insert
shared_ptr<pit::Entry> pitEntry = m_pit.insert(interest).first;