diff --git a/src/bgp/bgp_config.cc b/src/bgp/bgp_config.cc index cea403ed553..7108d5b3003 100644 --- a/src/bgp/bgp_config.cc +++ b/src/bgp/bgp_config.cc @@ -488,7 +488,8 @@ static void GetRoutingInstanceExportTargets(DBGraph *graph, IFMapNode *node, (GetInstanceTargetRouteTarget(graph, adj, &target))) { const autogen::InstanceTarget *itarget = dynamic_cast(adj->GetObject()); - assert(itarget); + if (!itarget) + continue; const autogen::InstanceTargetType &itt = itarget->data(); if (itt.import_export != "import") target_list->push_back(target); @@ -568,7 +569,8 @@ void BgpInstanceConfig::Update(BgpConfigManager *manager, if (GetInstanceTargetRouteTarget(graph, adj, &target)) { const autogen::InstanceTarget *itarget = dynamic_cast(adj->GetObject()); - assert(itarget); + if (!itarget) + continue; const autogen::InstanceTargetType &itt = itarget->data(); if (itt.import_export == "import") { import_list_.insert(target); @@ -1164,7 +1166,9 @@ void BgpConfigManager::ProcessBgpPeering(const BgpConfigDelta &delta) { event = BgpConfigManager::CFG_ADD; string instance_name(IdentifierParent(routers.first->name())); BgpInstanceConfig *rti = config_->FindInstance(instance_name); - assert(rti != NULL); + if (rti == NULL) { + return; + } peering = config_->CreatePeering(rti, proxy); } else { const IFMapNode *node = peering->node(); diff --git a/src/bgp/routing-instance/routing_instance.cc b/src/bgp/routing-instance/routing_instance.cc index d81a2de9562..2310955d942 100644 --- a/src/bgp/routing-instance/routing_instance.cc +++ b/src/bgp/routing-instance/routing_instance.cc @@ -313,7 +313,7 @@ void RoutingInstanceMgr::UpdateRoutingInstance( RTINSTANCE_LOG_MESSAGE(server_, SandeshLevel::SYS_WARN, RTINSTANCE_LOG_FLAG_ALL, config->name(), "Instance not found during update"); - assert(rtinstance != NULL); + return; } InstanceTargetRemove(rtinstance); @@ -360,7 +360,7 @@ void RoutingInstanceMgr::DeleteRoutingInstance(const string &name) { RTINSTANCE_LOG_MESSAGE(server_, SandeshLevel::SYS_WARN, RTINSTANCE_LOG_FLAG_ALL, name, "Instance not found during delete"); - assert(rtinstance != NULL); + return; } InstanceVnIndexRemove(rtinstance);