aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/vpp-api/vom/route.cpp4
-rw-r--r--src/vpp-api/vom/route_domain.cpp23
-rw-r--r--src/vpp-api/vom/route_domain.hpp2
3 files changed, 5 insertions, 24 deletions
diff --git a/src/vpp-api/vom/route.cpp b/src/vpp-api/vom/route.cpp
index 3b86fb28357..780881e5805 100644
--- a/src/vpp-api/vom/route.cpp
+++ b/src/vpp-api/vom/route.cpp
@@ -403,7 +403,7 @@ ip_route::event_handler::handle_populate(const client_db::key_t& key)
* populating the route domain here
*/
route_domain rd_temp(payload.table_id);
- std::shared_ptr<route_domain> rd = route_domain::find(rd_temp);
+ std::shared_ptr<route_domain> rd = route_domain::find(payload.table_id);
if (!rd) {
OM::commit(key, rd_temp);
}
@@ -450,7 +450,7 @@ ip_route::event_handler::handle_populate(const client_db::key_t& key)
prefix_t pfx(1, payload.address, payload.address_length);
route_domain rd_temp(payload.table_id);
- std::shared_ptr<route_domain> rd = route_domain::find(rd_temp);
+ std::shared_ptr<route_domain> rd = route_domain::find(payload.table_id);
if (!rd) {
OM::commit(key, rd_temp);
}
diff --git a/src/vpp-api/vom/route_domain.cpp b/src/vpp-api/vom/route_domain.cpp
index e8c1e598899..626a9cd29a9 100644
--- a/src/vpp-api/vom/route_domain.cpp
+++ b/src/vpp-api/vom/route_domain.cpp
@@ -108,28 +108,9 @@ route_domain::to_string() const
}
std::shared_ptr<route_domain>
-route_domain::find(const route_domain& temp)
+route_domain::find(const key_t& k)
{
- std::shared_ptr<route_domain> rd;
-
- auto it = m_db.cbegin();
-
- while (it != m_db.cend()) {
- /*
- * The key in the DB is a pair of the interface's name and prefix.
- * If the keys match, save the L3-config
- */
- auto key = it->first;
-
- if (temp.table_id() == key) {
- rd = it->second.lock();
- break;
- }
-
- ++it;
- }
-
- return (rd);
+ return (m_db.find(k));
}
void
diff --git a/src/vpp-api/vom/route_domain.hpp b/src/vpp-api/vom/route_domain.hpp
index 7d83154a0f1..19a3c18dddc 100644
--- a/src/vpp-api/vom/route_domain.hpp
+++ b/src/vpp-api/vom/route_domain.hpp
@@ -81,7 +81,7 @@ public:
/**
* Find the instnace of the route domain in the OM
*/
- static std::shared_ptr<route_domain> find(const route_domain& temp);
+ static std::shared_ptr<route_domain> find(const key_t& temp);
/**
* Dump all route-doamin into the stream provided