diff --git a/vslib/src/SwitchStateBase.cpp b/vslib/src/SwitchStateBase.cpp index 28e9c2e950d7..a306b814165a 100644 --- a/vslib/src/SwitchStateBase.cpp +++ b/vslib/src/SwitchStateBase.cpp @@ -403,7 +403,9 @@ sai_status_t SwitchStateBase::setPort( { SWSS_LOG_INFO("setting new MTU: %d on %s", mtu, name.c_str()); - if (vs_set_dev_mtu(name.c_str(), mtu) < 0) + std::string vname = vs_get_veth_name(name, portId); + + if (vs_set_dev_mtu(vname.c_str(), mtu) < 0) { SWSS_LOG_ERROR("failed to set MTU on portId %s", sai_serialize_object_id(portId).c_str()); diff --git a/vslib/src/SwitchStateBaseHostif.cpp b/vslib/src/SwitchStateBaseHostif.cpp index 02070a10d3e7..8b18f52a20bb 100644 --- a/vslib/src/SwitchStateBaseHostif.cpp +++ b/vslib/src/SwitchStateBaseHostif.cpp @@ -656,7 +656,7 @@ sai_status_t SwitchStateBase::vs_create_hostif_tap_interface( SWSS_LOG_INFO("setting new MTU: %d on %s", mtu, vname.c_str()); } - vs_set_dev_mtu(name.c_str(), mtu); + vs_set_dev_mtu(vname.c_str(), mtu); if (!hostif_create_tap_veth_forwarding(name, tapfd, obj_id)) {