route: handle zero cost links
refs: #4978
Change-Id: I461bdac9e10cb8362a7624b177ee68aa20d3ff3e
diff --git a/src/lsdb.cpp b/src/lsdb.cpp
index 01c1ee0..1e3cf1b 100644
--- a/src/lsdb.cpp
+++ b/src/lsdb.cpp
@@ -218,12 +218,10 @@
m_namePrefixTable.addEntry(name, nlsa.getOrigRouter());
}
}
- }
- if (nlsa.getOrigRouter() != m_confParam.getRouterPrefix()) {
- ndn::time::system_clock::Duration duration = nlsa.getExpirationTimePoint() -
- ndn::time::system_clock::now();
+ auto duration = nlsa.getExpirationTimePoint() - ndn::time::system_clock::now();
timeToExpire = ndn::time::duration_cast<ndn::time::seconds>(duration);
}
+
nlsa.setExpiringEventId(scheduleNameLsaExpiration(nlsa.getKey(),
nlsa.getLsSeqNo(),
timeToExpire));