Skip to content

Commit 36fe710

Browse files
author
Kumaresh Perumal
authored
[intfsorch] Retrieve Port object before setting NAT zone on router interfaces. (sonic-net#1372)
Method(setRouterIntfsNatZoneId) is called using local Port object that causes orchagent to crash on config reload with non-zero NAT zone configuration. Orchagent: Retrieve Port object using getPort method before setting NAT zone on Router interfaces. Addressing the issue : sonic-net#1312 Signed-off-by: Kumaresh Perumal [email protected]
1 parent 85c5701 commit 36fe710

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

orchagent/intfsorch.cpp

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -712,21 +712,24 @@ void IntfsOrch::doTask(Consumer &consumer)
712712
continue;
713713
}
714714

715-
/* Set nat zone id */
716-
if ((!nat_zone.empty()) and (port.m_nat_zone_id != nat_zone_id))
715+
if (gPortsOrch->getPort(alias, port))
717716
{
718-
port.m_nat_zone_id = nat_zone_id;
719-
720-
if (gIsNatSupported)
721-
{
722-
setRouterIntfsNatZoneId(port);
723-
}
724-
else
717+
/* Set nat zone id */
718+
if ((!nat_zone.empty()) and (port.m_nat_zone_id != nat_zone_id))
725719
{
726-
SWSS_LOG_NOTICE("Not set router interface %s NAT Zone Id to %u, as NAT is not supported",
727-
port.m_alias.c_str(), port.m_nat_zone_id);
720+
port.m_nat_zone_id = nat_zone_id;
721+
722+
if (gIsNatSupported)
723+
{
724+
setRouterIntfsNatZoneId(port);
725+
}
726+
else
727+
{
728+
SWSS_LOG_NOTICE("Not set router interface %s NAT Zone Id to %u, as NAT is not supported",
729+
port.m_alias.c_str(), port.m_nat_zone_id);
730+
}
731+
gPortsOrch->setPort(alias, port);
728732
}
729-
gPortsOrch->setPort(alias, port);
730733
}
731734
}
732735

0 commit comments

Comments
 (0)