rib: Perform FIB updates before modifying RIB
refs: #1941
Change-Id: I1457f71ddd1c120daae48308d5cc02a7c0ecf93d
diff --git a/rib/fib-update.cpp b/rib/fib-update.cpp
index cda4f14..25e2a62 100644
--- a/rib/fib-update.cpp
+++ b/rib/fib-update.cpp
@@ -1,12 +1,12 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
- * Copyright (c) 2014, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis
+ * Copyright (c) 2014-2015, Regents of the University of California,
+ * Arizona Board of Regents,
+ * Colorado State University,
+ * University Pierre & Marie Curie, Sorbonne University,
+ * Washington University in St. Louis,
+ * Beijing Institute of Technology,
+ * The University of Memphis.
*
* This file is part of NFD (Named Data Networking Forwarding Daemon).
* See AUTHORS.md for complete list of NFD authors and contributors.
@@ -28,27 +28,27 @@
namespace nfd {
namespace rib {
-shared_ptr<FibUpdate>
+FibUpdate
FibUpdate::createAddUpdate(const Name& name, const uint64_t faceId, const uint64_t cost)
{
- shared_ptr<FibUpdate> update = make_shared<FibUpdate>();
+ FibUpdate update;
- update->name = name;
- update->faceId = faceId;
- update->cost = cost;
- update->action = ADD_NEXTHOP;
+ update.name = name;
+ update.faceId = faceId;
+ update.cost = cost;
+ update.action = ADD_NEXTHOP;
return update;
}
-shared_ptr<FibUpdate>
+FibUpdate
FibUpdate::createRemoveUpdate(const Name& name, const uint64_t faceId)
{
- shared_ptr<FibUpdate> update = make_shared<FibUpdate>();
+ FibUpdate update;
- update->name = name;
- update->faceId = faceId;
- update->action = REMOVE_NEXTHOP;
+ update.name = name;
+ update.faceId = faceId;
+ update.action = REMOVE_NEXTHOP;
return update;
}