Skip to content

Commit a8893ec

Browse files
Kumaresh Perumalabdosi
Kumaresh Perumal
authored andcommitted
[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 2d3a575 commit a8893ec

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

orchagent/intfsorch.cpp

+15-12
Original file line numberDiff line numberDiff line change
@@ -681,21 +681,24 @@ void IntfsOrch::doTask(Consumer &consumer)
681681
continue;
682682
}
683683

684-
/* Set nat zone id */
685-
if ((!nat_zone.empty()) and (port.m_nat_zone_id != nat_zone_id))
684+
if (gPortsOrch->getPort(alias, port))
686685
{
687-
port.m_nat_zone_id = nat_zone_id;
688-
689-
if (gIsNatSupported)
690-
{
691-
setRouterIntfsNatZoneId(port);
692-
}
693-
else
686+
/* Set nat zone id */
687+
if ((!nat_zone.empty()) and (port.m_nat_zone_id != nat_zone_id))
694688
{
695-
SWSS_LOG_NOTICE("Not set router interface %s NAT Zone Id to %u, as NAT is not supported",
696-
port.m_alias.c_str(), port.m_nat_zone_id);
689+
port.m_nat_zone_id = nat_zone_id;
690+
691+
if (gIsNatSupported)
692+
{
693+
setRouterIntfsNatZoneId(port);
694+
}
695+
else
696+
{
697+
SWSS_LOG_NOTICE("Not set router interface %s NAT Zone Id to %u, as NAT is not supported",
698+
port.m_alias.c_str(), port.m_nat_zone_id);
699+
}
700+
gPortsOrch->setPort(alias, port);
697701
}
698-
gPortsOrch->setPort(alias, port);
699702
}
700703
}
701704

0 commit comments

Comments
 (0)