diff --git a/orchagent/vxlanorch.cpp b/orchagent/vxlanorch.cpp index 6e25454f13e..1d86e75c21b 100644 --- a/orchagent/vxlanorch.cpp +++ b/orchagent/vxlanorch.cpp @@ -1391,6 +1391,7 @@ bool VxlanTunnelOrch::delOperation(const Request& request) SWSS_LOG_ENTER(); const auto& tunnel_name = request.getKeyString(0); + EvpnNvoOrch* evpn_orch = gDirectory.get(); if (!isTunnelExists(tunnel_name)) { @@ -1405,6 +1406,11 @@ bool VxlanTunnelOrch::delOperation(const Request& request) return false; } + if (vtep_ptr == evpn_orch->getEVPNVtep()) + { + evpn_orch->delEVPNVtep(); + } + vxlan_tunnel_table_.erase(tunnel_name); SWSS_LOG_NOTICE("Vxlan tunnel '%s' was removed", tunnel_name.c_str()); diff --git a/orchagent/vxlanorch.h b/orchagent/vxlanorch.h index edc65d97fe2..2800e097ff3 100644 --- a/orchagent/vxlanorch.h +++ b/orchagent/vxlanorch.h @@ -484,6 +484,11 @@ class EvpnNvoOrch : public Orch2 return source_vtep_ptr; } + void delEVPNVtep() + { + source_vtep_ptr = NULL; + } + private: virtual bool addOperation(const Request& request); virtual bool delOperation(const Request& request);