BUG: WilLSatisfyPendingInterest method is now may be called with 0 as
incoming face (when satisfied from the local cache). Adding additional
check before trying to update statistics for non-existent face.
diff --git a/model/forwarding-strategy/green-yellow-red.cc b/model/forwarding-strategy/green-yellow-red.cc
index 70ae829..d881b00 100644
--- a/model/forwarding-strategy/green-yellow-red.cc
+++ b/model/forwarding-strategy/green-yellow-red.cc
@@ -106,8 +106,11 @@
GreenYellowRed::WillSatisfyPendingInterest (const Ptr<CcnxFace> &incomingFace,
Ptr<CcnxPitEntry> pitEntry)
{
- // Update metric status for the incoming interface in the corresponding FIB entry
- pitEntry->GetFibEntry ()->UpdateStatus (incomingFace, CcnxFibFaceMetric::NDN_FIB_GREEN);
+ if (incomingFace != 0)
+ {
+ // Update metric status for the incoming interface in the corresponding FIB entry
+ pitEntry->GetFibEntry ()->UpdateStatus (incomingFace, CcnxFibFaceMetric::NDN_FIB_GREEN);
+ }
super::WillSatisfyPendingInterest (incomingFace, pitEntry);
}
@@ -119,7 +122,8 @@
{
super::DidReceiveValidNack (incomingFace, nackCode, pitEntry);
- if (nackCode != CcnxInterestHeader::NACK_LOOP)
+ if (incomingFace != 0 &&
+ nackCode != CcnxInterestHeader::NACK_LOOP)
{
pitEntry->GetFibEntry ()->UpdateStatus (incomingFace, CcnxFibFaceMetric::NDN_FIB_YELLOW);
}