From 43365f331bc1c594537dae21e5d96dd73a6667da Mon Sep 17 00:00:00 2001 From: MaxPolovyi Date: Mon, 14 May 2018 19:50:17 +0300 Subject: [PATCH] [crmorch]: neighbor used counter increased twice (#472) (#501) * [crmorch]: neighbor used counter increased twice --- orchagent/neighorch.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/orchagent/neighorch.cpp b/orchagent/neighorch.cpp index 4ddedaa080e9..961fc1f4147f 100644 --- a/orchagent/neighorch.cpp +++ b/orchagent/neighorch.cpp @@ -395,16 +395,16 @@ bool NeighOrch::addNeighbor(NeighborEntry neighborEntry, MacAddress macAddress) } m_intfsOrch->decreaseRouterIntfsRefCount(alias); - return false; - } + if (neighbor_entry.ip_address.addr_family == SAI_IP_ADDR_FAMILY_IPV4) + { + gCrmOrch->decCrmResUsedCounter(CrmResourceType::CRM_IPV4_NEIGHBOR); + } + else + { + gCrmOrch->decCrmResUsedCounter(CrmResourceType::CRM_IPV6_NEIGHBOR); + } - if (neighbor_entry.ip_address.addr_family == SAI_IP_ADDR_FAMILY_IPV4) - { - gCrmOrch->incCrmResUsedCounter(CrmResourceType::CRM_IPV4_NEIGHBOR); - } - else - { - gCrmOrch->incCrmResUsedCounter(CrmResourceType::CRM_IPV6_NEIGHBOR); + return false; } } else