Skip to content

Commit

Permalink
syncd: Fix profile iterator bug (#789)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
abanu-ms committed Feb 5, 2021
1 parent a6377d0 commit 08d338a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions syncd/Syncd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@ Syncd::Syncd(

m_manager = std::make_shared<FlexCounterManager>(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<swss::DBConnector>(m_contextConfig->m_dbAsic, 0);
Expand Down

0 comments on commit 08d338a

Please sign in to comment.