diff options
author | Neale Ranns <nranns@cisco.com> | 2019-02-22 10:33:21 -0800 |
---|---|---|
committer | Neale Ranns <nranns@cisco.com> | 2019-02-22 19:35:28 +0000 |
commit | 2a3f6d158803c5031d4bcc95dfa02a412bca08b6 (patch) | |
tree | 7b71271b1531fff0fd99e6ec193e52a9144ba335 | |
parent | 918c1615fef4b499720c967baa3d723d183d2308 (diff) |
VOM: GBP use singular instance if shared-ptr is set
Change-Id: I845e0aa0b657b7a4745c158c4c510f604f4502bb
Signed-off-by: Neale Ranns <nranns@cisco.com>
-rw-r--r-- | extras/vom/vom/gbp_bridge_domain.cpp | 10 | ||||
-rw-r--r-- | extras/vom/vom/gbp_route_domain.cpp | 13 |
2 files changed, 20 insertions, 3 deletions
diff --git a/extras/vom/vom/gbp_bridge_domain.cpp b/extras/vom/vom/gbp_bridge_domain.cpp index e370a6abb0c..78f7d8d270f 100644 --- a/extras/vom/vom/gbp_bridge_domain.cpp +++ b/extras/vom/vom/gbp_bridge_domain.cpp @@ -79,6 +79,12 @@ gbp_bridge_domain::gbp_bridge_domain(const bridge_domain& bd, , m_bm_flood(bm_flood) , m_flags(flags) { + if (m_bvi) + m_bvi = m_bvi->singular(); + if (m_uu_fwd) + m_uu_fwd = m_uu_fwd->singular(); + if (m_bm_flood) + m_bm_flood = m_bm_flood->singular(); } gbp_bridge_domain::gbp_bridge_domain(const bridge_domain& bd, @@ -93,6 +99,10 @@ gbp_bridge_domain::gbp_bridge_domain(const bridge_domain& bd, , m_bm_flood(bm_flood) , m_flags(flags) { + if (m_uu_fwd) + m_uu_fwd = m_uu_fwd->singular(); + if (m_bm_flood) + m_bm_flood = m_bm_flood->singular(); } gbp_bridge_domain::gbp_bridge_domain(const gbp_bridge_domain& bd) diff --git a/extras/vom/vom/gbp_route_domain.cpp b/extras/vom/vom/gbp_route_domain.cpp index 96216a6cab5..1c72dc8e3d7 100644 --- a/extras/vom/vom/gbp_route_domain.cpp +++ b/extras/vom/vom/gbp_route_domain.cpp @@ -48,19 +48,26 @@ gbp_route_domain::gbp_route_domain(const route_domain& rd, , m_ip6_uu_fwd(ip6_uu_fwd.singular()) { } + gbp_route_domain::gbp_route_domain(const route_domain& rd, const std::shared_ptr<interface> ip4_uu_fwd, const std::shared_ptr<interface> ip6_uu_fwd) : m_id(rd.table_id()) , m_rd(rd.singular()) - , m_ip4_uu_fwd(ip4_uu_fwd->singular()) - , m_ip6_uu_fwd(ip6_uu_fwd->singular()) + , m_ip4_uu_fwd(ip4_uu_fwd) + , m_ip6_uu_fwd(ip6_uu_fwd) { + if (m_ip4_uu_fwd) + m_ip4_uu_fwd = m_ip4_uu_fwd->singular(); + if (m_ip6_uu_fwd) + m_ip6_uu_fwd = m_ip6_uu_fwd->singular(); } gbp_route_domain::gbp_route_domain(const route_domain& rd) : m_id(rd.table_id()) , m_rd(rd.singular()) + , m_ip4_uu_fwd() + , m_ip6_uu_fwd() { } @@ -175,7 +182,7 @@ gbp_route_domain::update(const gbp_route_domain& desired) std::shared_ptr<gbp_route_domain> gbp_route_domain::find_or_add(const gbp_route_domain& temp) { - return (m_db.find_or_add(temp.m_id.data(), temp)); + return (m_db.find_or_add(temp.key(), temp)); } std::shared_ptr<gbp_route_domain> |