table: don't use shared_ptr in FIB
refs #3164
Change-Id: I5b5eb47d60f6bf5b6389c32ac840f793767e4334
diff --git a/daemon/mgmt/fib-manager.cpp b/daemon/mgmt/fib-manager.cpp
index 09e184a..b7ac209 100644
--- a/daemon/mgmt/fib-manager.cpp
+++ b/daemon/mgmt/fib-manager.cpp
@@ -61,11 +61,10 @@
<< " faceid: " << faceId
<< " cost: " << cost);
- auto face = m_getFace(faceId);
- if (static_cast<bool>(face)) {
- auto entry = m_fib.insert(prefix).first;
-
- entry->addNextHop(face, cost);
+ shared_ptr<Face> face = m_getFace(faceId);
+ if (face != nullptr) {
+ fib::Entry* entry = m_fib.insert(prefix).first;
+ entry->addNextHop(*face, cost);
NFD_LOG_DEBUG("add-nexthop result: OK"
<< " prefix:" << prefix
@@ -90,11 +89,11 @@
NFD_LOG_TRACE("remove-nexthop prefix: " << parameters.getName()
<< " faceid: " << parameters.getFaceId());
- auto face = m_getFace(parameters.getFaceId());
- if (static_cast<bool>(face)) {
- auto entry = m_fib.findExactMatch(parameters.getName());
- if (static_cast<bool>(entry)) {
- entry->removeNextHop(face);
+ shared_ptr<Face> face = m_getFace(parameters.getFaceId());
+ if (face != nullptr) {
+ fib::Entry* entry = m_fib.findExactMatch(parameters.getName());
+ if (entry != nullptr) {
+ entry->removeNextHop(*face);
NFD_LOG_DEBUG("remove-nexthop result: OK prefix: " << parameters.getName()
<< " faceid: " << parameters.getFaceId());
@@ -124,7 +123,7 @@
for (auto&& next : nextHops) {
ndn::nfd::NextHopRecord nextHopRecord;
- nextHopRecord.setFaceId(next.getFace()->getId());
+ nextHopRecord.setFaceId(next.getFace().getId());
nextHopRecord.setCost(next.getCost());
record.addNextHopRecord(nextHopRecord);