Skip to content

Commit 3a12e84

Browse files
author
vedganes
committed
[intfsorch, neighorch]Fix to get system port alias from port
1 parent 0c43ecf commit 3a12e84

File tree

2 files changed

+24
-4
lines changed

2 files changed

+24
-4
lines changed

orchagent/intfsorch.cpp

+12-2
Original file line numberDiff line numberDiff line change
@@ -1328,8 +1328,13 @@ bool IntfsOrch::voqSyncAddIntf(string &alias, sai_object_id_t &rif_id)
13281328
{
13291329
return true;
13301330
}
1331+
alias = port.m_system_port_info.alias;
1332+
}
1333+
else
1334+
{
1335+
SWSS_LOG_ERROR("Port does not exist for %s!", alias.c_str());
1336+
return false;
13311337
}
1332-
alias = port.m_system_port_info.alias;
13331338

13341339
//Get router interface to make sure it exists
13351340
sai_attribute_t attr;
@@ -1372,8 +1377,13 @@ bool IntfsOrch::voqSyncDelIntf(string &alias)
13721377
{
13731378
return true;
13741379
}
1380+
alias = port.m_system_port_info.alias;
1381+
}
1382+
else
1383+
{
1384+
SWSS_LOG_ERROR("Port does not exist for %s!", alias.c_str());
1385+
return false;
13751386
}
1376-
alias = port.m_system_port_info.alias;
13771387

13781388
m_tableVoqSystemInterfaceTable.del(alias);
13791389

orchagent/neighorch.cpp

+12-2
Original file line numberDiff line numberDiff line change
@@ -1000,8 +1000,13 @@ bool NeighOrch::voqSyncAddNeigh(string &alias, IpAddress &ip_address, const MacA
10001000
{
10011001
return true;
10021002
}
1003+
alias = port.m_system_port_info.alias;
1004+
}
1005+
else
1006+
{
1007+
SWSS_LOG_ERROR("Port does not exist for %s!", alias.c_str());
1008+
return false;
10031009
}
1004-
alias = port.m_system_port_info.alias;
10051010

10061011
attr.id = SAI_NEIGHBOR_ENTRY_ATTR_ENCAP_INDEX;
10071012

@@ -1037,8 +1042,13 @@ bool NeighOrch::voqSyncDelNeigh(string &alias, IpAddress &ip_address)
10371042
{
10381043
return true;
10391044
}
1045+
alias = port.m_system_port_info.alias;
1046+
}
1047+
else
1048+
{
1049+
SWSS_LOG_ERROR("Port does not exist for %s!", alias.c_str());
1050+
return false;
10401051
}
1041-
alias = port.m_system_port_info.alias;
10421052

10431053
string key = alias + ":" + ip_address.to_string();
10441054
m_tableVoqSystemNeighTable.del(key);

0 commit comments

Comments
 (0)