Skip to content

Commit

Permalink
Check RIF/Port exists only for add entries (sonic-net#1110)
Browse files Browse the repository at this point in the history
  • Loading branch information
prsunny authored Oct 29, 2019
1 parent 59440f2 commit 5516ec4
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions orchagent/neighorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -317,27 +317,27 @@ void NeighOrch::doTask(Consumer &consumer)
continue;
}

Port p;
if (!gPortsOrch->getPort(alias, p))
{
SWSS_LOG_INFO("Port %s doesn't exist", alias.c_str());
it++;
continue;
}

if (!p.m_rif_id)
{
SWSS_LOG_INFO("Router interface doesn't exist on %s", alias.c_str());
it++;
continue;
}

IpAddress ip_address(key.substr(found+1));

NeighborEntry neighbor_entry = { ip_address, alias };

if (op == SET_COMMAND)
{
Port p;
if (!gPortsOrch->getPort(alias, p))
{
SWSS_LOG_INFO("Port %s doesn't exist", alias.c_str());
it++;
continue;
}

if (!p.m_rif_id)
{
SWSS_LOG_INFO("Router interface doesn't exist on %s", alias.c_str());
it++;
continue;
}

MacAddress mac_address;
for (auto i = kfvFieldsValues(t).begin();
i != kfvFieldsValues(t).end(); i++)
Expand Down

0 comments on commit 5516ec4

Please sign in to comment.