Skip to content
Merged
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
26 changes: 20 additions & 6 deletions orchagent/vxlanorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -295,10 +295,17 @@ create_tunnel(
void
remove_tunnel(sai_object_id_t tunnel_id)
{
sai_status_t status = sai_tunnel_api->remove_tunnel(tunnel_id);
if (status != SAI_STATUS_SUCCESS)
if (tunnel_id != SAI_NULL_OBJECT_ID)
{
sai_status_t status = sai_tunnel_api->remove_tunnel(tunnel_id);
if (status != SAI_STATUS_SUCCESS)
{
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add an error message here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add an error message here?
The "runtime_error" in the next line has thrown the error message.

throw std::runtime_error("Can't remove a tunnel object");
}
}
else
{
throw std::runtime_error("Can't remove a tunnel object");
SWSS_LOG_DEBUG("Tunnel id is NULL.");
}
}

Expand Down Expand Up @@ -364,10 +371,17 @@ create_tunnel_termination(
void
remove_tunnel_termination(sai_object_id_t term_table_id)
{
sai_status_t status = sai_tunnel_api->remove_tunnel_term_table_entry(term_table_id);
if (status != SAI_STATUS_SUCCESS)
if (term_table_id != SAI_NULL_OBJECT_ID)
{
sai_status_t status = sai_tunnel_api->remove_tunnel_term_table_entry(term_table_id);
if (status != SAI_STATUS_SUCCESS)
{
throw std::runtime_error("Can't remove a tunnel term table object");
}
}
else
{
throw std::runtime_error("Can't remove a tunnel term table object");
SWSS_LOG_DEBUG("Tunnel term table id is NULL.");
}
}

Expand Down
2 changes: 1 addition & 1 deletion orchagent/vxlanorch.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class VxlanTunnel
string tunnel_name_;
bool active_ = false;

tunnel_ids_t ids_;
tunnel_ids_t ids_ = {0, 0, 0, 0};
std::pair<MAP_T, MAP_T> tunnel_map_ = { MAP_T::MAP_TO_INVALID, MAP_T::MAP_TO_INVALID };

TunnelMapEntries tunnel_map_entries_;
Expand Down