From e5056fa885f8abb3098a6b6703f28950f6ed5d03 Mon Sep 17 00:00:00 2001 From: Prakash Bailkeri Date: Wed, 3 Feb 2016 14:38:37 +0530 Subject: [PATCH] Fix introspect output for route-aggregate also fix display of path source Fixed similar issue in static route introspect Change-Id: I1665b29562d8cbce1e7a99f89c307248b471ce1a Related-bug: #1500698 --- src/bgp/bgp_route.cc | 4 ++++ src/bgp/routing-instance/show_route_aggregate.cc | 2 +- src/bgp/routing-instance/show_static_route.cc | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/bgp/bgp_route.cc b/src/bgp/bgp_route.cc index 1d64fb804ed..8a18c9e47da 100644 --- a/src/bgp/bgp_route.cc +++ b/src/bgp/bgp_route.cc @@ -438,6 +438,10 @@ void BgpRoute::FillRouteInfo(const BgpTable *table, srp.set_protocol("StaticRoute"); } else if (path->GetSource() == BgpPath::Local) { srp.set_protocol("Local"); + } else if (path->GetSource() == BgpPath::Aggregate) { + srp.set_protocol("Aggregate"); + } else if (path->GetSource() == BgpPath::ResolvedRoute) { + srp.set_protocol("ResolvedRoute"); } const BgpPeer *bgp_peer = dynamic_cast(peer); diff --git a/src/bgp/routing-instance/show_route_aggregate.cc b/src/bgp/routing-instance/show_route_aggregate.cc index 2438445a7cc..b3cf5586f77 100644 --- a/src/bgp/routing-instance/show_route_aggregate.cc +++ b/src/bgp/routing-instance/show_route_aggregate.cc @@ -44,9 +44,9 @@ bool BgpShowHandlername_clower_bound(data->next_entry); - AggregateRouteEntriesInfo info; for (uint32_t iter_count = 0; it != rim->name_cend(); ++it, ++iter_count) { RoutingInstance *rinstance = it->second; + AggregateRouteEntriesInfo info; if (FillRouteAggregateInfo(Address::INET, data->search_string, info, rinstance)) { data->show_list.push_back(info); diff --git a/src/bgp/routing-instance/show_static_route.cc b/src/bgp/routing-instance/show_static_route.cc index bd9abdc2327..0bc45a124c8 100644 --- a/src/bgp/routing-instance/show_static_route.cc +++ b/src/bgp/routing-instance/show_static_route.cc @@ -44,9 +44,9 @@ bool BgpShowHandlername_clower_bound(data->next_entry); - StaticRouteEntriesInfo info; for (uint32_t iter_count = 0; it != rim->name_cend(); ++it, ++iter_count) { RoutingInstance *rinstance = it->second; + StaticRouteEntriesInfo info; if (FillStaticRouteInfo(Address::INET, data->search_string, info, rinstance)) { data->show_list.push_back(info);