From 08d338aef26e77d90581f345a46c3f8c8ae7471e Mon Sep 17 00:00:00 2001 From: abanu-ms Date: Fri, 5 Feb 2021 13:29:44 +0200 Subject: [PATCH] syncd: Fix profile iterator bug (#789) As I didn't see SAI specifying that the user of the service table should reset the iterator before iterating over the values, I think this would come as a surprise to most vendors implementing SAI. Because the iterator was first stored before adding any values to the map, it would be pointing to the profile's .end(), thus if a SAI implementation would try iterating over the values, it'd get none until it'd reset the iterator. --- syncd/Syncd.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/syncd/Syncd.cpp b/syncd/Syncd.cpp index 5f10614631e9..24b6b7cab9ca 100644 --- a/syncd/Syncd.cpp +++ b/syncd/Syncd.cpp @@ -95,10 +95,10 @@ Syncd::Syncd( m_manager = std::make_shared(m_vendorSai, m_contextConfig->m_dbCounters); - m_profileIter = m_profileMap.begin(); - loadProfileMap(); + m_profileIter = m_profileMap.begin(); + // we need STATE_DB ASIC_DB and COUNTERS_DB m_dbAsic = std::make_shared(m_contextConfig->m_dbAsic, 0);