Skip to content

Commit

Permalink
[intfmgr] Fix OA crash issue due to link local configurations (sonic-…
Browse files Browse the repository at this point in the history
…net#1195)

* [intfmgr] Fix OA crash issue due to link local configurations

Signed-off-by: Zhenggen Xu <zxu@linkedin.com>
  • Loading branch information
zhenggen-xu authored Aug 18, 2020
1 parent 11da264 commit e3ed57b
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions cfgmgr/intfmgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -587,19 +587,27 @@ bool IntfMgr::doIntfAddrTask(const vector<string>& keys,

std::vector<FieldValueTuple> fvVector;
FieldValueTuple f("family", ip_prefix.isV4() ? IPV4_NAME : IPV6_NAME);
FieldValueTuple s("scope", "global");
fvVector.push_back(s);
fvVector.push_back(f);

m_appIntfTableProducer.set(appKey, fvVector);
m_stateIntfTable.hset(keys[0] + state_db_key_delimiter + keys[1], "state", "ok");
// Don't send link local config to AppDB and Orchagent
if (ip_prefix.getIp().getAddrScope() != IpAddress::AddrScope::LINK_SCOPE)
{
FieldValueTuple s("scope", "global");
fvVector.push_back(s);
fvVector.push_back(f);
m_appIntfTableProducer.set(appKey, fvVector);
m_stateIntfTable.hset(keys[0] + state_db_key_delimiter + keys[1], "state", "ok");
}
}
else if (op == DEL_COMMAND)
{
setIntfIp(alias, "del", ip_prefix);

m_appIntfTableProducer.del(appKey);
m_stateIntfTable.del(keys[0] + state_db_key_delimiter + keys[1]);
// Don't send link local config to AppDB and Orchagent
if (ip_prefix.getIp().getAddrScope() != IpAddress::AddrScope::LINK_SCOPE)
{
m_appIntfTableProducer.del(appKey);
m_stateIntfTable.del(keys[0] + state_db_key_delimiter + keys[1]);
}
}
else
{
Expand Down

0 comments on commit e3ed57b

Please sign in to comment.