diff --git a/orchagent/vxlanorch.cpp b/orchagent/vxlanorch.cpp index 1983cf7286b..a1b149b870a 100644 --- a/orchagent/vxlanorch.cpp +++ b/orchagent/vxlanorch.cpp @@ -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; @@ -1950,11 +1950,18 @@ bool VxlanTunnelMapOrch::addOperation(const Request& request) if (!tunnel_obj->isActive()) { + auto encap_ttl = static_cast(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(encap_ttl)); if (!tunnel_orch->isDipTunnelsSupported()) { Port tunPort; diff --git a/orchagent/vxlanorch.h b/orchagent/vxlanorch.h index 695f7441e05..cc5e6a8869a 100644 --- a/orchagent/vxlanorch.h +++ b/orchagent/vxlanorch.h @@ -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" } };