X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvpp-api%2Fvom%2Fbridge_domain_entry.cpp;h=9ac5ceae87cda844cfea7591db17986b0e6ff503;hb=3a758b0af83e1f8c791d899ee6dfcea813a09c5b;hp=79f36f7d947bff6809029b63813275a6361f83ca;hpb=fd920609819a5b10d3d7c8d34fe4fa4214c7da22;p=vpp.git diff --git a/src/vpp-api/vom/bridge_domain_entry.cpp b/src/vpp-api/vom/bridge_domain_entry.cpp index 79f36f7d947..9ac5ceae87c 100644 --- a/src/vpp-api/vom/bridge_domain_entry.cpp +++ b/src/vpp-api/vom/bridge_domain_entry.cpp @@ -79,8 +79,8 @@ void bridge_domain_entry::sweep() { if (m_hw) { - HW::enqueue( - new bridge_domain_entry_cmds::delete_cmd(m_hw, m_mac, m_bd->id())); + HW::enqueue(new bridge_domain_entry_cmds::delete_cmd( + m_hw, m_mac, m_bd->id(), interface::type_t::BVI == m_tx_itf->type())); } HW::write(); } @@ -90,7 +90,8 @@ bridge_domain_entry::replay() { if (m_hw) { HW::enqueue(new bridge_domain_entry_cmds::create_cmd( - m_hw, m_mac, m_bd->id(), m_tx_itf->handle())); + m_hw, m_mac, m_bd->id(), m_tx_itf->handle(), + interface::type_t::BVI == m_tx_itf->type())); } } std::string @@ -111,7 +112,8 @@ bridge_domain_entry::update(const bridge_domain_entry& r) */ if (rc_t::OK != m_hw.rc()) { HW::enqueue(new bridge_domain_entry_cmds::create_cmd( - m_hw, m_mac, m_bd->id(), m_tx_itf->handle())); + m_hw, m_mac, m_bd->id(), m_tx_itf->handle(), + interface::type_t::BVI == m_tx_itf->type())); } } @@ -155,8 +157,8 @@ bridge_domain_entry::event_handler::handle_replay() void bridge_domain_entry::event_handler::handle_populate(const client_db::key_t& key) { - std::shared_ptr cmd( - new bridge_domain_entry_cmds::dump_cmd()); + std::shared_ptr cmd = + std::make_shared(); HW::enqueue(cmd); HW::write(); @@ -166,11 +168,21 @@ bridge_domain_entry::event_handler::handle_populate(const client_db::key_t& key) std::shared_ptr itf = interface::find(payload.sw_if_index); std::shared_ptr bd = bridge_domain::find(payload.bd_id); + + if (!bd || !itf) { + VOM_LOG(log_level_t::ERROR) << "bridge-domain-entry dump:" + << " itf:" << payload.sw_if_index + << " bd:" << payload.bd_id; + continue; + } + mac_address_t mac(payload.mac); bridge_domain_entry bd_e(*bd, mac, *itf); - VOM_LOG(log_level_t::DEBUG) << "bd-entry-dump: " << bd->to_string() - << mac.to_string() << itf->to_string(); + VOM_LOG(log_level_t::DEBUG) << "bridge-domain-entry dump:" + << " " << bd->to_string() << " " + << itf->to_string() << " mac:[" + << mac.to_string() << "]"; /* * Write each of the discovered interfaces into the OM,