Skip to content

Commit 75c8874

Browse files
committed
Prevent route deletion in default vrf upon creating tunnel route in non default vnet
1 parent a4ed959 commit 75c8874

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

orchagent/vnetorch.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1192,7 +1192,7 @@ bool VNetRouteOrch::doRouteTask<VNetVrfObject>(const string& vnet, IpPrefix& ipP
11921192
prefixToRemove = adv_prefix;
11931193
}
11941194
auto prefixSubnet = prefixToRemove.getSubnet();
1195-
if(gRouteOrch && gRouteOrch->isRouteExists(prefixSubnet))
1195+
if(gRouteOrch && gRouteOrch->isRouteExists(vr_id, prefixSubnet))
11961196
{
11971197
if (!gRouteOrch->removeRoutePrefix(prefixSubnet))
11981198
{
@@ -2501,7 +2501,9 @@ void VNetRouteOrch::updateVnetTunnel(const BfdUpdate& update)
25012501
ipPrefixsubnet = adv_prefix.getSubnet();
25022502
}
25032503
}
2504-
if(gRouteOrch && gRouteOrch->isRouteExists(ipPrefixsubnet))
2504+
2505+
sai_object_id_t vr_id = vrf_obj->getVRidIngress();
2506+
if(gRouteOrch && gRouteOrch->isRouteExists(vr_id, ipPrefixsubnet))
25052507
{
25062508
if (!gRouteOrch->removeRoutePrefix(ipPrefixsubnet))
25072509
{
@@ -2749,7 +2751,7 @@ void VNetRouteOrch::updateVnetTunnelCustomMonitor(const MonitorUpdate& update)
27492751
}
27502752
}
27512753
auto prefixsubnet = prefixToUse.getSubnet();
2752-
if (gRouteOrch && gRouteOrch->isRouteExists(prefixsubnet))
2754+
if (gRouteOrch && gRouteOrch->isRouteExists(vr_id, prefixsubnet))
27532755
{
27542756
if (!gRouteOrch->removeRoutePrefix(prefixsubnet))
27552757
{

0 commit comments

Comments
 (0)