From 2b010051bf1341e975d1456cd9bef43e1b9c6eb8 Mon Sep 17 00:00:00 2001 From: tylerlinp <38244140+tylerlinp@users.noreply.github.com> Date: Wed, 18 Apr 2018 00:13:32 +0800 Subject: [PATCH] [crmorch]: neighbor used counter increased twice (#472) * [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 8ca234aad8..76f01606a6 100644 --- a/orchagent/neighorch.cpp +++ b/orchagent/neighorch.cpp @@ -413,16 +413,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