diff --git a/src/bgp/bgp_server.cc b/src/bgp/bgp_server.cc index dd2d89c2e4d..f14e15bf8f2 100644 --- a/src/bgp/bgp_server.cc +++ b/src/bgp/bgp_server.cc @@ -773,6 +773,13 @@ uint32_t BgpServer::SendTableStatsUve(bool first) const { table->GetSecondaryPathCount()); } + if (first || table->stats()->get_infeasible_paths() != + table->GetInfeasiblePathCount()) { + changed = true; + table->stats()->set_infeasible_paths( + table->GetSecondaryPathCount()); + } + uint64_t total_paths = table->stats()->get_primary_paths() + table->stats()->get_secondary_paths() + table->stats()->get_infeasible_paths(); diff --git a/src/bgp/routing-instance/routing_instance.cc b/src/bgp/routing-instance/routing_instance.cc index 9c1c55eac85..64fa0d5fded 100644 --- a/src/bgp/routing-instance/routing_instance.cc +++ b/src/bgp/routing-instance/routing_instance.cc @@ -13,6 +13,7 @@ #include "bgp/bgp_factory.h" #include "bgp/bgp_log.h" #include "bgp/bgp_server.h" +#include "bgp/bgp_table_types.h" #include "bgp/routing-instance/iroute_aggregator.h" #include "bgp/routing-instance/iservice_chain_mgr.h" #include "bgp/routing-instance/istatic_route_mgr.h" @@ -426,6 +427,12 @@ void RoutingInstanceMgr::DestroyRoutingInstance(RoutingInstance *rtinstance) { RTINSTANCE_LOG(Destroy, rtinstance, SandeshLevel::SYS_DEBUG, RTINSTANCE_LOG_FLAG_ALL); + // Delete instance stats uve. + RoutingInstanceStatsData instance_info; + instance_info.set_name(rtinstance->name()); + instance_info.set_deleted(true); + RoutingInstanceStats::Send(instance_info); + // Remove call here also deletes the instance. const string name = rtinstance->name(); instances_.Remove(rtinstance->name(), rtinstance->index());