Skip to content
Draft
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
4 changes: 1 addition & 3 deletions orchagent/routeorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2964,12 +2964,10 @@ bool RouteOrch::removeRoutePost(const RouteBulkContext& ctx)
return true;
}

bool RouteOrch::isRouteExists(const IpPrefix& prefix)
bool RouteOrch::isRouteExists(sai_object_id_t vrf_id, const IpPrefix& prefix)
{
SWSS_LOG_ENTER();

sai_object_id_t& vrf_id = gVirtualRouterId;

sai_route_entry_t route_entry;
route_entry.vr_id = vrf_id;
route_entry.switch_id = gSwitchId;
Expand Down
2 changes: 1 addition & 1 deletion orchagent/routeorch.h
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ class RouteOrch : public ZmqOrch, public Subject
const NextHopGroupKey getSyncdRouteNhgKey(sai_object_id_t vrf_id, const IpPrefix& ipPrefix);
bool createFineGrainedNextHopGroup(sai_object_id_t &next_hop_group_id, vector<sai_attribute_t> &nhg_attrs);
bool removeFineGrainedNextHopGroup(sai_object_id_t &next_hop_group_id);
bool isRouteExists(const IpPrefix& prefix);
bool isRouteExists(sai_object_id_t vrf_id, const IpPrefix& prefix);
bool removeRoutePrefix(const IpPrefix& prefix);

void addLinkLocalRouteToMe(sai_object_id_t vrf_id, IpPrefix linklocal_prefix);
Expand Down
8 changes: 5 additions & 3 deletions orchagent/vnetorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1192,7 +1192,7 @@ bool VNetRouteOrch::doRouteTask<VNetVrfObject>(const string& vnet, IpPrefix& ipP
prefixToRemove = adv_prefix;
}
auto prefixSubnet = prefixToRemove.getSubnet();
if(gRouteOrch && gRouteOrch->isRouteExists(prefixSubnet))
if(gRouteOrch && gRouteOrch->isRouteExists(vr_id, prefixSubnet))
{
if (!gRouteOrch->removeRoutePrefix(prefixSubnet))
{
Expand Down Expand Up @@ -2501,7 +2501,9 @@ void VNetRouteOrch::updateVnetTunnel(const BfdUpdate& update)
ipPrefixsubnet = adv_prefix.getSubnet();
}
}
if(gRouteOrch && gRouteOrch->isRouteExists(ipPrefixsubnet))

sai_object_id_t vr_id = vrf_obj->getVRidIngress();
if(gRouteOrch && gRouteOrch->isRouteExists(vr_id, ipPrefixsubnet))
{
if (!gRouteOrch->removeRoutePrefix(ipPrefixsubnet))
{
Expand Down Expand Up @@ -2749,7 +2751,7 @@ void VNetRouteOrch::updateVnetTunnelCustomMonitor(const MonitorUpdate& update)
}
}
auto prefixsubnet = prefixToUse.getSubnet();
if (gRouteOrch && gRouteOrch->isRouteExists(prefixsubnet))
if (gRouteOrch && gRouteOrch->isRouteExists(vr_id, prefixsubnet))
{
if (!gRouteOrch->removeRoutePrefix(prefixsubnet))
{
Expand Down
Loading