table: don't use shared_ptr in FIB
refs #3164
Change-Id: I5b5eb47d60f6bf5b6389c32ac840f793767e4334
diff --git a/tests/daemon/fw/best-route-strategy2.t.cpp b/tests/daemon/fw/best-route-strategy2.t.cpp
index a3b2aba..ac5c3ef 100644
--- a/tests/daemon/fw/best-route-strategy2.t.cpp
+++ b/tests/daemon/fw/best-route-strategy2.t.cpp
@@ -75,10 +75,10 @@
BOOST_AUTO_TEST_CASE(Forward)
{
- shared_ptr<fib::Entry> fibEntry = fib.insert(Name()).first;
- fibEntry->addNextHop(face1, 10);
- fibEntry->addNextHop(face2, 20);
- fibEntry->addNextHop(face3, 30);
+ fib::Entry& fibEntry = *fib.insert(Name()).first;
+ fibEntry.addNextHop(*face1, 10);
+ fibEntry.addNextHop(*face2, 20);
+ fibEntry.addNextHop(*face3, 30);
shared_ptr<Interest> interest = makeInterest("ndn:/BzgFBchqA");
shared_ptr<pit::Entry> pitEntry = pit.insert(*interest).first;
@@ -127,7 +127,7 @@
BOOST_CHECK_EQUAL(strategy.sendInterestHistory[4].outFaceId, face1->getId());
BOOST_CHECK_EQUAL(strategy.sendInterestHistory[5].outFaceId, face3->getId());
- fibEntry->removeNextHop(face1);
+ fibEntry.removeNextHop(*face1);
strategy.sendInterestHistory.clear();
for (int i = 0; i < 3; ++i) {
@@ -153,10 +153,10 @@
return "/P";
}
- shared_ptr<fib::Entry>
- makeFibEntry(BestRouteStrategy2Fixture* fixture)
+ void
+ insertFibEntry(BestRouteStrategy2Fixture* fixture)
{
- return fixture->fib.insert(Name()).first;
+ fixture->fib.insert(Name());
}
};
@@ -169,12 +169,10 @@
return "/P";
}
- shared_ptr<fib::Entry>
- makeFibEntry(BestRouteStrategy2Fixture* fixture)
+ void
+ insertFibEntry(BestRouteStrategy2Fixture* fixture)
{
- shared_ptr<fib::Entry> fibEntry = fixture->fib.insert(Name()).first;
- fibEntry->addNextHop(fixture->face1, 10);
- return fibEntry;
+ fixture->fib.insert(Name()).first->addNextHop(*fixture->face1, 10);
}
};
@@ -187,13 +185,11 @@
return "/localhop/P";
}
- shared_ptr<fib::Entry>
- makeFibEntry(BestRouteStrategy2Fixture* fixture)
+ void
+ insertFibEntry(BestRouteStrategy2Fixture* fixture)
{
- shared_ptr<fib::Entry> fibEntry = fixture->fib.insert("/localhop").first;
- fibEntry->addNextHop(fixture->face2, 10);
+ fixture->fib.insert("/localhop").first->addNextHop(*fixture->face2, 10);
// face1 and face2 are both non-local; Interest from face1 cannot be forwarded to face2
- return fibEntry;
}
};
@@ -202,13 +198,12 @@
BOOST_AUTO_TEST_CASE_TEMPLATE(IncomingInterest, Scenario, NoRouteScenarios)
{
Scenario scenario;
+ scenario.insertFibEntry(this);
shared_ptr<Interest> interest = makeInterest(scenario.getInterestName());
shared_ptr<pit::Entry> pitEntry = pit.insert(*interest).first;
pitEntry->insertOrUpdateInRecord(face1, *interest);
- shared_ptr<fib::Entry> fibEntry = scenario.makeFibEntry(this);
-
strategy.afterReceiveInterest(*face1, *interest, pitEntry);
BOOST_REQUIRE_EQUAL(strategy.rejectPendingInterestHistory.size(), 1);
@@ -226,10 +221,10 @@
BOOST_AUTO_TEST_CASE(OneUpstream) // one upstream, send Nack when Nack arrives
{
- shared_ptr<fib::Entry> fibEntry = fib.insert(Name()).first;
- fibEntry->addNextHop(face3, 10);
- fibEntry->addNextHop(face4, 20);
- fibEntry->addNextHop(face5, 30);
+ fib::Entry& fibEntry = *fib.insert(Name()).first;
+ fibEntry.addNextHop(*face3, 10);
+ fibEntry.addNextHop(*face4, 20);
+ fibEntry.addNextHop(*face5, 30);
shared_ptr<Interest> interest1 = makeInterest("/McQYjMbm", 992);
shared_ptr<Interest> interest2 = makeInterest("/McQYjMbm", 114);
@@ -256,10 +251,10 @@
BOOST_AUTO_TEST_CASE(TwoUpstreams) // two upstreams, send Nack when both Nacks arrive
{
- shared_ptr<fib::Entry> fibEntry = fib.insert(Name()).first;
- fibEntry->addNextHop(face3, 10);
- fibEntry->addNextHop(face4, 20);
- fibEntry->addNextHop(face5, 30);
+ fib::Entry& fibEntry = *fib.insert(Name()).first;
+ fibEntry.addNextHop(*face3, 10);
+ fibEntry.addNextHop(*face4, 20);
+ fibEntry.addNextHop(*face5, 30);
shared_ptr<Interest> interest1 = makeInterest("/aS9FAyUV19", 286);
shared_ptr<pit::Entry> pitEntry = pit.insert(*interest1).first;
@@ -285,10 +280,10 @@
BOOST_AUTO_TEST_CASE(Timeout) // two upstreams, one times out, don't send Nack
{
- shared_ptr<fib::Entry> fibEntry = fib.insert(Name()).first;
- fibEntry->addNextHop(face3, 10);
- fibEntry->addNextHop(face4, 20);
- fibEntry->addNextHop(face5, 30);
+ fib::Entry& fibEntry = *fib.insert(Name()).first;
+ fibEntry.addNextHop(*face3, 10);
+ fibEntry.addNextHop(*face4, 20);
+ fibEntry.addNextHop(*face5, 30);
shared_ptr<Interest> interest1 = makeInterest("/sIYw0TXWDj", 115);
interest1->setInterestLifetime(time::milliseconds(400));
@@ -429,10 +424,10 @@
{
Combination combination;
- shared_ptr<fib::Entry> fibEntry = fib.insert(Name()).first;
- fibEntry->addNextHop(face3, 10);
- fibEntry->addNextHop(face4, 20);
- fibEntry->addNextHop(face5, 30);
+ fib::Entry& fibEntry = *fib.insert(Name()).first;
+ fibEntry.addNextHop(*face3, 10);
+ fibEntry.addNextHop(*face4, 20);
+ fibEntry.addNextHop(*face5, 30);
shared_ptr<Interest> interest1 = makeInterest("/F6sEwB24I", 282);
shared_ptr<pit::Entry> pitEntry = pit.insert(*interest1).first;
diff --git a/tests/daemon/fw/client-control-strategy.t.cpp b/tests/daemon/fw/client-control-strategy.t.cpp
index 0305b47..0a31244 100644
--- a/tests/daemon/fw/client-control-strategy.t.cpp
+++ b/tests/daemon/fw/client-control-strategy.t.cpp
@@ -54,8 +54,8 @@
forwarder.addFace(face4);
Fib& fib = forwarder.getFib();
- shared_ptr<fib::Entry> fibEntry = fib.insert(Name()).first;
- fibEntry->addNextHop(face2, 0);
+ fib::Entry& fibEntry = *fib.insert(Name()).first;
+ fibEntry.addNextHop(*face2, 0);
Pit& pit = forwarder.getPit();
diff --git a/tests/daemon/fw/dummy-strategy.hpp b/tests/daemon/fw/dummy-strategy.hpp
index ca6a858..17831fd 100644
--- a/tests/daemon/fw/dummy-strategy.hpp
+++ b/tests/daemon/fw/dummy-strategy.hpp
@@ -63,7 +63,7 @@
}
if (interestOutFace) {
- this->sendInterest(pitEntry, interestOutFace);
+ this->sendInterest(pitEntry, *interestOutFace);
}
else {
this->rejectPendingInterest(pitEntry);
diff --git a/tests/daemon/fw/forwarder.t.cpp b/tests/daemon/fw/forwarder.t.cpp
index 1a4de92..7f2bc41 100644
--- a/tests/daemon/fw/forwarder.t.cpp
+++ b/tests/daemon/fw/forwarder.t.cpp
@@ -39,12 +39,9 @@
{
Forwarder forwarder;
- Name nameA("ndn:/A");
- Name nameAB("ndn:/A/B");
- Name nameABC("ndn:/A/B/C");
- shared_ptr<Interest> interestAB = makeInterest(nameAB);
+ shared_ptr<Interest> interestAB = makeInterest("/A/B");
interestAB->setInterestLifetime(time::seconds(4));
- shared_ptr<Data> dataABC = makeData(nameABC);
+ shared_ptr<Data> dataABC = makeData("/A/B/C");
auto face1 = make_shared<DummyFace>();
auto face2 = make_shared<DummyFace>();
@@ -52,15 +49,14 @@
forwarder.addFace(face2);
Fib& fib = forwarder.getFib();
- shared_ptr<fib::Entry> fibEntry = fib.insert(Name("ndn:/A")).first;
- fibEntry->addNextHop(face2, 0);
+ fib.insert("/A").first->addNextHop(*face2, 0);
BOOST_CHECK_EQUAL(forwarder.getCounters().nInInterests, 0);
BOOST_CHECK_EQUAL(forwarder.getCounters().nOutInterests, 0);
face1->receiveInterest(*interestAB);
this->advanceClocks(time::milliseconds(100), time::seconds(1));
BOOST_REQUIRE_EQUAL(face2->sentInterests.size(), 1);
- BOOST_CHECK_EQUAL(face2->sentInterests[0].getName(), nameAB);
+ BOOST_CHECK_EQUAL(face2->sentInterests[0].getName(), "/A/B");
BOOST_REQUIRE(face2->sentInterests[0].getTag<lp::IncomingFaceIdTag>() != nullptr);
BOOST_CHECK_EQUAL(*face2->sentInterests[0].getTag<lp::IncomingFaceIdTag>(), face1->getId());
BOOST_CHECK_EQUAL(forwarder.getCounters().nInInterests, 1);
@@ -71,7 +67,7 @@
face2->receiveData(*dataABC);
this->advanceClocks(time::milliseconds(100), time::seconds(1));
BOOST_REQUIRE_EQUAL(face1->sentData.size(), 1);
- BOOST_CHECK_EQUAL(face1->sentData[0].getName(), nameABC);
+ BOOST_CHECK_EQUAL(face1->sentData[0].getName(), "/A/B/C");
BOOST_REQUIRE(face1->sentData[0].getTag<lp::IncomingFaceIdTag>() != nullptr);
BOOST_CHECK_EQUAL(*face1->sentData[0].getTag<lp::IncomingFaceIdTag>(), face2->getId());
BOOST_CHECK_EQUAL(forwarder.getCounters().nInData, 1);
@@ -89,14 +85,13 @@
forwarder.addFace(face2);
forwarder.addFace(face3);
- shared_ptr<Interest> interestA = makeInterest("ndn:/A");
+ shared_ptr<Interest> interestA = makeInterest("/A");
interestA->setInterestLifetime(time::seconds(4));
- shared_ptr<Data> dataA = makeData("ndn:/A");
+ shared_ptr<Data> dataA = makeData("/A");
dataA->setTag(make_shared<lp::IncomingFaceIdTag>(face3->getId()));
Fib& fib = forwarder.getFib();
- shared_ptr<fib::Entry> fibEntry = fib.insert(Name("ndn:/A")).first;
- fibEntry->addNextHop(face2, 0);
+ fib.insert("/A").first->addNextHop(*face2, 0);
Pit& pit = forwarder.getPit();
BOOST_CHECK_EQUAL(pit.size(), 0);
@@ -130,7 +125,7 @@
forwarder.addFace(face3);
Pit& pit = forwarder.getPit();
- auto interestA1 = makeInterest("ndn:/A");
+ auto interestA1 = makeInterest("/A");
interestA1->setNonce(8378);
shared_ptr<pit::Entry> pitA = pit.insert(*interestA1).first;
pit::InRecordCollection::iterator inA1 = pitA->insertOrUpdateInRecord(face1, *interestA1);
@@ -153,7 +148,7 @@
BOOST_CHECK_EQUAL(face1->sentInterests.back().getNonce(), 8378);
this->advanceClocks(time::seconds(2));
- auto interestA2 = makeInterest("ndn:/A");
+ auto interestA2 = makeInterest("/A");
interestA2->setNonce(9102);
pitA->insertOrUpdateInRecord(face2, *interestA2);
@@ -644,8 +639,7 @@
forwarder.addFace(face4);
Fib& fib = forwarder.getFib();
- shared_ptr<fib::Entry> fibEntry = fib.insert(Name("/zT4XwK0Hnx")).first;
- fibEntry->addNextHop(face4, 0);
+ fib.insert("/zT4XwK0Hnx").first->addNextHop(*face4, 0);
// receive Interest on face1
face1->sentNacks.clear();
@@ -699,8 +693,7 @@
});
Fib& fib = forwarder.getFib();
- shared_ptr<fib::Entry> fibEntry = fib.insert(Name("ndn:/A")).first;
- fibEntry->addNextHop(face2, 0);
+ fib.insert("/A").first->addNextHop(*face2, 0);
// receive an Interest
shared_ptr<Interest> interest = makeInterest("ndn:/A/1");
@@ -758,8 +751,7 @@
// consumer region
nrt.clear();
nrt.insert("/arizona/cs/avenir");
- shared_ptr<fib::Entry> fibRoot = fib.insert("/").first;
- fibRoot->addNextHop(face2, 10);
+ fib.insert("/").first->addNextHop(*face2, 10);
auto interest1 = makeInterest("/net/ndnsim/www/1.html");
interest1->setLink(link->wireEncode());
@@ -769,15 +761,13 @@
BOOST_CHECK_EQUAL(forwarder.lookupFib(*pit1).getPrefix(), "/");
BOOST_CHECK_EQUAL(interest1->hasSelectedDelegation(), false);
- fibRoot->removeNextHop(face2);
+ fib.insert("/").first->removeNextHop(*face2);
// first default-free router, both delegations are available
nrt.clear();
nrt.insert("/arizona/cs/hobo");
- shared_ptr<fib::Entry> fibTelia = fib.insert("/telia").first;
- fibTelia->addNextHop(face2, 10);
- shared_ptr<fib::Entry> fibUcla = fib.insert("/ucla").first;
- fibUcla->addNextHop(face2, 10);
+ fib.insert("/telia").first->addNextHop(*face2, 10);
+ fib.insert("/ucla").first->addNextHop(*face2, 10);
auto interest2 = makeInterest("/net/ndnsim/www/2.html");
interest2->setLink(link->wireEncode());
@@ -788,14 +778,13 @@
BOOST_REQUIRE_EQUAL(interest2->hasSelectedDelegation(), true);
BOOST_CHECK_EQUAL(interest2->getSelectedDelegation(), "/telia/terabits");
- fib.erase(*fibTelia);
- fib.erase(*fibUcla);
+ fib.erase("/telia");
+ fib.erase("/ucla");
// first default-free router, only second delegation is available
nrt.clear();
nrt.insert("/arizona/cs/hobo");
- fibUcla = fib.insert("/ucla").first;
- fibUcla->addNextHop(face2, 10);
+ fib.insert("/ucla").first->addNextHop(*face2, 10);
auto interest3 = makeInterest("/net/ndnsim/www/3.html");
interest3->setLink(link->wireEncode());
@@ -806,15 +795,13 @@
BOOST_REQUIRE_EQUAL(interest3->hasSelectedDelegation(), true);
BOOST_CHECK_EQUAL(interest3->getSelectedDelegation(), "/ucla/cs");
- fib.erase(*fibUcla);
+ fib.erase("/ucla");
// default-free router, chosen SelectedDelegation
nrt.clear();
nrt.insert("/ucsd/caida/click");
- fibTelia = fib.insert("/telia").first;
- fibTelia->addNextHop(face2, 10);
- fibUcla = fib.insert("/ucla").first;
- fibUcla->addNextHop(face2, 10);
+ fib.insert("/telia").first->addNextHop(*face2, 10);
+ fib.insert("/ucla").first->addNextHop(*face2, 10);
auto interest4 = makeInterest("/net/ndnsim/www/4.html");
interest4->setLink(link->wireEncode());
@@ -826,17 +813,15 @@
BOOST_REQUIRE_EQUAL(interest4->hasSelectedDelegation(), true);
BOOST_CHECK_EQUAL(interest4->getSelectedDelegation(), "/ucla/cs");
- fib.erase(*fibTelia);
- fib.erase(*fibUcla);
+ fib.erase("/telia");
+ fib.erase("/ucla");
// producer region
nrt.clear();
nrt.insert("/ucla/cs/spurs");
- fibRoot->addNextHop(face2, 10);
- fibUcla = fib.insert("/ucla").first;
- fibUcla->addNextHop(face2, 10);
- shared_ptr<fib::Entry> fibNdnsim = fib.insert("/net/ndnsim").first;
- fibNdnsim->addNextHop(face2, 10);
+ fib.insert("/").first->addNextHop(*face2, 10);
+ fib.insert("/ucla").first->addNextHop(*face2, 10);
+ fib.insert("/net/ndnsim").first->addNextHop(*face2, 10);
auto interest5 = makeInterest("/net/ndnsim/www/5.html");
interest5->setLink(link->wireEncode());
@@ -848,9 +833,9 @@
BOOST_REQUIRE_EQUAL(interest5->hasSelectedDelegation(), true);
BOOST_CHECK_EQUAL(interest5->getSelectedDelegation(), "/ucla/cs");
- fibRoot->removeNextHop(face2);
- fib.erase(*fibUcla);
- fib.erase(*fibNdnsim);
+ fib.insert("/").first->removeNextHop(*face2);
+ fib.erase("/ucla");
+ fib.erase("/ndnsim");
}
diff --git a/tests/daemon/fw/multicast-strategy.t.cpp b/tests/daemon/fw/multicast-strategy.t.cpp
index 5204821..2800dc7 100644
--- a/tests/daemon/fw/multicast-strategy.t.cpp
+++ b/tests/daemon/fw/multicast-strategy.t.cpp
@@ -52,10 +52,10 @@
forwarder.addFace(face3);
Fib& fib = forwarder.getFib();
- shared_ptr<fib::Entry> fibEntry = fib.insert(Name()).first;
- fibEntry->addNextHop(face1, 0);
- fibEntry->addNextHop(face2, 0);
- fibEntry->addNextHop(face3, 0);
+ fib::Entry& fibEntry = *fib.insert(Name()).first;
+ fibEntry.addNextHop(*face1, 0);
+ fibEntry.addNextHop(*face2, 0);
+ fibEntry.addNextHop(*face3, 0);
shared_ptr<Interest> interest = makeInterest("ndn:/H0D6i5fc");
Pit& pit = forwarder.getPit();
@@ -88,8 +88,8 @@
forwarder.addFace(face2);
Fib& fib = forwarder.getFib();
- shared_ptr<fib::Entry> fibEntry = fib.insert("ndn:/localhop/uS09bub6tm").first;
- fibEntry->addNextHop(face2, 0);
+ fib::Entry& fibEntry = *fib.insert("ndn:/localhop/uS09bub6tm").first;
+ fibEntry.addNextHop(*face2, 0);
shared_ptr<Interest> interest = makeInterest("ndn:/localhop/uS09bub6tm/eG3MMoP6z");
Pit& pit = forwarder.getPit();
@@ -111,8 +111,8 @@
forwarder.addFace(face1);
Fib& fib = forwarder.getFib();
- shared_ptr<fib::Entry> fibEntry = fib.insert(Name()).first;
- fibEntry->addNextHop(face1, 0);
+ fib::Entry& fibEntry = *fib.insert(Name()).first;
+ fibEntry.addNextHop(*face1, 0);
shared_ptr<Interest> interest = makeInterest("ndn:/H0D6i5fc");
Pit& pit = forwarder.getPit();
diff --git a/tests/daemon/fw/ncc-strategy.t.cpp b/tests/daemon/fw/ncc-strategy.t.cpp
index 9fec06b..b624c74 100644
--- a/tests/daemon/fw/ncc-strategy.t.cpp
+++ b/tests/daemon/fw/ncc-strategy.t.cpp
@@ -62,9 +62,9 @@
forwarder.addFace(face3);
Fib& fib = forwarder.getFib();
- shared_ptr<fib::Entry> fibEntry = fib.insert(Name()).first;
- fibEntry->addNextHop(face1, 10);
- fibEntry->addNextHop(face2, 20);
+ fib::Entry& fibEntry = *fib.insert(Name()).first;
+ fibEntry.addNextHop(*face1, 10);
+ fibEntry.addNextHop(*face2, 20);
StrategyChoice& strategyChoice = forwarder.getStrategyChoice();
strategyChoice.install(strategy);
@@ -126,8 +126,8 @@
forwarder.addFace(face3);
Fib& fib = forwarder.getFib();
- shared_ptr<fib::Entry> fibEntry = fib.insert(Name()).first;
- fibEntry->addNextHop(face1, 10);
+ fib::Entry& fibEntry = *fib.insert(Name()).first;
+ fibEntry.addNextHop(*face1, 10);
StrategyChoice& strategyChoice = forwarder.getStrategyChoice();
strategyChoice.install(strategy);
@@ -162,7 +162,7 @@
strategy->afterReceiveInterest(*face3, *interest2, pitEntry2);
// FIB entry is changed before doPropagate executes
- fibEntry->addNextHop(face2, 20);
+ fibEntry.addNextHop(*face2, 20);
this->advanceClocks(time::milliseconds(10), time::milliseconds(1000));// should not crash
}
@@ -182,9 +182,9 @@
forwarder.addFace(face3);
Fib& fib = forwarder.getFib();
- shared_ptr<fib::Entry> fibEntry = fib.insert(Name()).first;
- fibEntry->addNextHop(face1, 10);
- fibEntry->addNextHop(face2, 20);
+ fib::Entry& fibEntry = *fib.insert(Name()).first;
+ fibEntry.addNextHop(*face1, 10);
+ fibEntry.addNextHop(*face2, 20);
StrategyChoice& strategyChoice = forwarder.getStrategyChoice();
strategyChoice.install(strategy);
@@ -242,8 +242,8 @@
forwarder.addFace(face2);
Fib& fib = forwarder.getFib();
- shared_ptr<fib::Entry> fibEntry = fib.insert(Name()).first;
- fibEntry->addNextHop(face2, 10);
+ fib::Entry& fibEntry = *fib.insert(Name()).first;
+ fibEntry.addNextHop(*face2, 10);
StrategyChoice& strategyChoice = forwarder.getStrategyChoice();
strategyChoice.install(strategy);
@@ -292,9 +292,9 @@
forwarder.addFace(face2);
Fib& fib = forwarder.getFib();
- shared_ptr<fib::Entry> fibEntry = fib.insert(Name()).first;
- fibEntry->addNextHop(face1, 10); // face1 is top-ranked nexthop
- fibEntry->addNextHop(face2, 20);
+ fib::Entry& fibEntry = *fib.insert(Name()).first;
+ fibEntry.addNextHop(*face1, 10); // face1 is top-ranked nexthop
+ fibEntry.addNextHop(*face2, 20);
StrategyChoice& strategyChoice = forwarder.getStrategyChoice();
strategyChoice.install(strategy);
diff --git a/tests/daemon/fw/strategy-tester.hpp b/tests/daemon/fw/strategy-tester.hpp
index ed831ff..da79517 100644
--- a/tests/daemon/fw/strategy-tester.hpp
+++ b/tests/daemon/fw/strategy-tester.hpp
@@ -53,7 +53,7 @@
protected:
virtual void
sendInterest(shared_ptr<pit::Entry> pitEntry,
- shared_ptr<Face> outFace,
+ Face& outFace,
bool wantNewNonce = false) override;
virtual void
@@ -91,12 +91,12 @@
template<typename S>
inline void
StrategyTester<S>::sendInterest(shared_ptr<pit::Entry> pitEntry,
- shared_ptr<Face> outFace,
+ Face& outFace,
bool wantNewNonce)
{
- SendInterestArgs args{pitEntry, outFace->getId(), wantNewNonce};
+ SendInterestArgs args{pitEntry, outFace.getId(), wantNewNonce};
sendInterestHistory.push_back(args);
- pitEntry->insertOrUpdateOutRecord(outFace, pitEntry->getInterest());
+ pitEntry->insertOrUpdateOutRecord(outFace.shared_from_this(), pitEntry->getInterest());
afterAction();
}
diff --git a/tests/daemon/fw/topology-tester.cpp b/tests/daemon/fw/topology-tester.cpp
index b1eeb6a..9224b40 100644
--- a/tests/daemon/fw/topology-tester.cpp
+++ b/tests/daemon/fw/topology-tester.cpp
@@ -184,8 +184,7 @@
{
Forwarder& forwarder = this->getForwarder(i);
Fib& fib = forwarder.getFib();
- shared_ptr<fib::Entry> fibEntry = fib.insert(prefix).first;
- fibEntry->addNextHop(const_cast<Face&>(face).shared_from_this(), cost);
+ fib.insert(prefix).first->addNextHop(const_cast<Face&>(face), cost);
}
void