@@ -1277,16 +1277,18 @@ bool MACsecOrch::updateMACsecSCs(MACsecPort &macsec_port, std::function<bool(MAC
1277
1277
{
1278
1278
SWSS_LOG_ENTER ();
1279
1279
1280
- for (auto &sc : macsec_port.m_egress_scs )
1280
+ auto sc = macsec_port.m_egress_scs .begin ();
1281
+ while (sc != macsec_port.m_egress_scs .end ())
1281
1282
{
1282
- if (!action (sc. second ))
1283
+ if (!action ((sc++)-> second ))
1283
1284
{
1284
1285
return false ;
1285
1286
}
1286
1287
}
1287
- for (auto &sc : macsec_port.m_ingress_scs )
1288
+ sc = macsec_port.m_ingress_scs .begin ();
1289
+ while (sc != macsec_port.m_ingress_scs .end ())
1288
1290
{
1289
- if (!action (sc. second ))
1291
+ if (!action ((sc++)-> second ))
1290
1292
{
1291
1293
return false ;
1292
1294
}
@@ -1307,17 +1309,21 @@ bool MACsecOrch::deleteMACsecPort(
1307
1309
1308
1310
bool result = true ;
1309
1311
1310
- for (auto &sc : macsec_port.m_egress_scs )
1312
+ auto sc = macsec_port.m_egress_scs .begin ();
1313
+ while (sc != macsec_port.m_egress_scs .end ())
1311
1314
{
1312
- const std::string port_sci = swss::join (' :' , port_name, sc.first );
1315
+ const std::string port_sci = swss::join (' :' , port_name, sc->first );
1316
+ sc ++;
1313
1317
if (deleteMACsecSC (port_sci, SAI_MACSEC_DIRECTION_EGRESS) != task_success)
1314
1318
{
1315
1319
result &= false ;
1316
1320
}
1317
1321
}
1318
- for (auto &sc : macsec_port.m_ingress_scs )
1322
+ sc = macsec_port.m_ingress_scs .begin ();
1323
+ while (sc != macsec_port.m_ingress_scs .end ())
1319
1324
{
1320
- const std::string port_sci = swss::join (' :' , port_name, sc.first );
1325
+ const std::string port_sci = swss::join (' :' , port_name, sc->first );
1326
+ sc ++;
1321
1327
if (deleteMACsecSC (port_sci, SAI_MACSEC_DIRECTION_INGRESS) != task_success)
1322
1328
{
1323
1329
result &= false ;
@@ -1705,9 +1711,11 @@ task_process_status MACsecOrch::deleteMACsecSC(
1705
1711
1706
1712
auto result = task_success;
1707
1713
1708
- for (auto &sa : ctx.get_macsec_sc ()->m_sa_ids )
1714
+ auto sa = ctx.get_macsec_sc ()->m_sa_ids .begin ();
1715
+ while (sa != ctx.get_macsec_sc ()->m_sa_ids .end ())
1709
1716
{
1710
- const std::string port_sci_an = swss::join (' :' , port_sci, sa.first );
1717
+ const std::string port_sci_an = swss::join (' :' , port_sci, sa->first );
1718
+ sa ++;
1711
1719
deleteMACsecSA (port_sci_an, direction);
1712
1720
}
1713
1721
0 commit comments