From ab8e13b896ffbd3efbb82dba1bb7e58fd96b843e Mon Sep 17 00:00:00 2001 From: Prabhjot Singh Sethi Date: Mon, 9 Feb 2015 23:07:03 -0800 Subject: [PATCH] OVSDB fix exporting routes for existing VRF Issue: ------ if client comes after vrf is available it fails to export route table till further change happens on vrf entry. Fix: ---- start walk on vrf table in VrfOvsdbObject Constructor to iterate through existing VRF entries and export them Change-Id: I392395a719ceeb8381fa46f478cf74f7d7560492 Closes-Bug: 1420130 --- .../ovs_tor_agent/ovsdb_client/unicast_mac_remote_ovsdb.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/vnsw/agent/ovs_tor_agent/ovsdb_client/unicast_mac_remote_ovsdb.cc b/src/vnsw/agent/ovs_tor_agent/ovsdb_client/unicast_mac_remote_ovsdb.cc index 62786e36f30..fe5f3659ed2 100644 --- a/src/vnsw/agent/ovs_tor_agent/ovsdb_client/unicast_mac_remote_ovsdb.cc +++ b/src/vnsw/agent/ovs_tor_agent/ovsdb_client/unicast_mac_remote_ovsdb.cc @@ -311,6 +311,13 @@ VrfOvsdbObject::VrfOvsdbObject(OvsdbClientIdl *idl, DBTable *table) : walkid_(DBTableWalker::kInvalidWalkerId) { vrf_listener_id_ = table->Register(boost::bind(&VrfOvsdbObject::VrfNotify, this, _1, _2)); + + // Trigger Walk to get existing vrf entries. + DBTableWalker *walker = idl->agent()->db()->GetWalker(); + walkid_ = walker->WalkTable(table_, NULL, + boost::bind(&VrfOvsdbObject::VrfWalkNotify, this, _1, _2), + boost::bind(&VrfOvsdbObject::VrfWalkDone, this, _1)); + client_idl_->Register(OvsdbClientIdl::OVSDB_UCAST_MAC_REMOTE, boost::bind(&VrfOvsdbObject::OvsdbRouteNotify, this, _1, _2)); }