Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion cfgmgr/intfmgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,12 @@ bool IntfMgr::doIntfGeneralTask(const vector<string>& keys,

if (is_lo)
{
addLoopbackIntf(alias);
if (m_loopbackIntfList.find(alias) == m_loopbackIntfList.end())
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so nat_zone handling is done only if not is_lo. Where is it applying nat_zone on loopback interface?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not pushing the nat_zone value to APPL_DB when it got applied for loopback interface. nat_zone for loopback interface gets handled in natmgr code for setting iptables mangle tables rules (https://github.com/Azure/sonic-swss/blob/master/cfgmgr/natmgr.cpp#L901)

{
addLoopbackIntf(alias);
m_loopbackIntfList.insert(alias);
SWSS_LOG_INFO("Added %s loopback interface", alias.c_str());
}
}
else
{
Expand Down Expand Up @@ -540,6 +545,7 @@ bool IntfMgr::doIntfGeneralTask(const vector<string>& keys,
if (is_lo)
{
delLoopbackIntf(alias);
m_loopbackIntfList.erase(alias);
}

if (!subIntfAlias.empty())
Expand Down
7 changes: 4 additions & 3 deletions cfgmgr/intfmgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,21 @@ class IntfMgr : public Orch
Table m_statePortTable, m_stateLagTable, m_stateVlanTable, m_stateVrfTable, m_stateIntfTable;

std::set<std::string> m_subIntfList;
std::set<std::string> m_loopbackIntfList;

void setIntfIp(const std::string &alias, const std::string &opCmd, const IpPrefix &ipPrefix);
void setIntfVrf(const std::string &alias, const std::string &vrfName);
void setIntfMac(const std::string &alias, const std::string &macAddr);

bool doIntfGeneralTask(const std::vector<std::string>& keys, std::vector<FieldValueTuple> data, const std::string& op);
bool doIntfAddrTask(const std::vector<std::string>& keys, const std::vector<FieldValueTuple>& data, const std::string& op);
void doTask(Consumer &consumer);

bool isIntfStateOk(const std::string &alias);
bool isIntfCreated(const std::string &alias);
bool isIntfChangeVrf(const std::string &alias, const std::string &vrfName);
int getIntfIpCount(const std::string &alias);

void addLoopbackIntf(const std::string &alias);
void delLoopbackIntf(const std::string &alias);
void flushLoopbackIntfs(void);
Expand Down