Skip to content

Commit 08d338a

Browse files
authored
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.
1 parent a6377d0 commit 08d338a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

syncd/Syncd.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,10 @@ Syncd::Syncd(
9595

9696
m_manager = std::make_shared<FlexCounterManager>(m_vendorSai, m_contextConfig->m_dbCounters);
9797

98-
m_profileIter = m_profileMap.begin();
99-
10098
loadProfileMap();
10199

100+
m_profileIter = m_profileMap.begin();
101+
102102
// we need STATE_DB ASIC_DB and COUNTERS_DB
103103

104104
m_dbAsic = std::make_shared<swss::DBConnector>(m_contextConfig->m_dbAsic, 0);

0 commit comments

Comments
 (0)