Skip to content

Commit

Permalink
kamel: Fix for TTL leak from inner to outer VXLAN
Browse files Browse the repository at this point in the history
  • Loading branch information
bluecmd committed Feb 22, 2024
1 parent 178166e commit e53ccb6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
11 changes: 9 additions & 2 deletions orchagent/vxlanorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1925,7 +1925,7 @@ bool VxlanTunnelMapOrch::addOperation(const Request& request)
if (vni_id >= MAX_VNI_ID)
{
SWSS_LOG_ERROR("Vxlan tunnel map vni id is too big: %d", vni_id);
return true;
return false;
}

tempPort.m_vnid = (uint32_t) vni_id;
Expand All @@ -1950,11 +1950,18 @@ bool VxlanTunnelMapOrch::addOperation(const Request& request)

if (!tunnel_obj->isActive())
{
auto encap_ttl = static_cast<sai_uint32_t>(request.getAttrUint("encap_ttl"));
if (encap_ttl > 255)
{
SWSS_LOG_ERROR("Vxlan tunnel map encap TTL is too big: %d", encap_ttl);
return false;
}
//@Todo, currently only decap mapper is allowed
uint8_t mapper_list = 0;
TUNNELMAP_SET_VLAN(mapper_list);
TUNNELMAP_SET_VRF(mapper_list);
tunnel_obj->createTunnelHw(mapper_list,TUNNEL_MAP_USE_DEDICATED_ENCAP_DECAP);
tunnel_obj->createTunnelHw(mapper_list, TUNNEL_MAP_USE_DEDICATED_ENCAP_DECAP,
/* with_term */ true, static_cast<sai_uint8_t>(encap_ttl));
if (!tunnel_orch->isDipTunnelsSupported())
{
Port tunPort;
Expand Down
1 change: 1 addition & 0 deletions orchagent/vxlanorch.h
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,7 @@ const request_description_t vxlan_tunnel_map_request_description = {
{
{ "vni", REQ_T_UINT },
{ "vlan", REQ_T_VLAN },
{ "encap_ttl", REQ_T_UINT },
},
{ "vni", "vlan" }
};
Expand Down

0 comments on commit e53ccb6

Please sign in to comment.