From 14266d5d414b6e85288829b3e6501f01da1b4be8 Mon Sep 17 00:00:00 2001 From: Praveen K V Date: Fri, 8 May 2015 16:17:24 +0530 Subject: [PATCH] Handle ":" in the table-name Inet tables can have ":" in the table-name. Parsing of table name in for introspect should take care of it. Also, by default set stale_ flag to false for route tables. Change-Id: I336e6813123059e957ac44c4c67a3b83b2d784ee --- src/vnsw/agent/oper/agent_sandesh.cc | 6 ++++-- src/vnsw/agent/oper/evpn_route.cc | 2 +- src/vnsw/agent/oper/inet4_multicast_route.cc | 2 +- src/vnsw/agent/oper/inet_unicast_route.cc | 9 +++++++-- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/vnsw/agent/oper/agent_sandesh.cc b/src/vnsw/agent/oper/agent_sandesh.cc index a5ca0ac4b3b..6549d91fe80 100644 --- a/src/vnsw/agent/oper/agent_sandesh.cc +++ b/src/vnsw/agent/oper/agent_sandesh.cc @@ -446,9 +446,11 @@ int AgentSandeshArguments::Decode(const std::string &str) { for (vector::iterator it = token_list.begin(); it != token_list.end(); ++it) { vector args; - if (Split((*it), ':', args) == 2) { - Add(args[0], args[1]); + if (Split((*it), ':', args) < 2) { + return 0; } + string val = (*it).substr(args[0].length() + 1); + Add(args[0], val); } return count; diff --git a/src/vnsw/agent/oper/evpn_route.cc b/src/vnsw/agent/oper/evpn_route.cc index 17277af2784..130dc836c65 100644 --- a/src/vnsw/agent/oper/evpn_route.cc +++ b/src/vnsw/agent/oper/evpn_route.cc @@ -362,7 +362,7 @@ void EvpnRouteReq::HandleRequest() const { AgentSandeshPtr EvpnAgentRouteTable::GetAgentSandesh (const AgentSandeshArguments *args, const std::string &context) { return AgentSandeshPtr(new AgentEvpnRtSandesh(vrf_entry(), context, "", - true)); + false)); } bool EvpnRouteEntry::DBEntrySandesh(Sandesh *sresp, bool stale) const { diff --git a/src/vnsw/agent/oper/inet4_multicast_route.cc b/src/vnsw/agent/oper/inet4_multicast_route.cc index a0a1ca6646e..bfd24febb71 100644 --- a/src/vnsw/agent/oper/inet4_multicast_route.cc +++ b/src/vnsw/agent/oper/inet4_multicast_route.cc @@ -231,5 +231,5 @@ void Inet4McRouteReq::HandleRequest() const { AgentSandeshPtr Inet4MulticastAgentRouteTable::GetAgentSandesh (const AgentSandeshArguments *args, const std::string &context) { return AgentSandeshPtr(new AgentInet4McRtSandesh(vrf_entry(), context, "", - true)); + false)); } diff --git a/src/vnsw/agent/oper/inet_unicast_route.cc b/src/vnsw/agent/oper/inet_unicast_route.cc index 2e42d278098..15ce57fe14d 100644 --- a/src/vnsw/agent/oper/inet_unicast_route.cc +++ b/src/vnsw/agent/oper/inet_unicast_route.cc @@ -949,8 +949,13 @@ void Inet4UcRouteReq::HandleRequest() const { AgentSandeshPtr InetUnicastAgentRouteTable::GetAgentSandesh (const AgentSandeshArguments *args, const std::string &context) { - return AgentSandeshPtr(new AgentInet4UcRtSandesh(vrf_entry(), context, - true)); + if (type_ == Agent::INET4_UNICAST) { + return AgentSandeshPtr(new AgentInet4UcRtSandesh(vrf_entry(), context, + false)); + } else { + return AgentSandeshPtr(new AgentInet6UcRtSandesh(vrf_entry(), context, + false)); + } } void Inet6UcRouteReq::HandleRequest() const {