commit | 3e7a8da60d70f4c42ae8ce0a3ecb0709194eb831 | [log] [tgz] |
---|---|---|
author | Anthony <anthonyhkf@google.com> | Mon Oct 23 14:22:43 2023 +0800 |
committer | Ed Tanous <ed@tanous.net> | Wed Nov 15 16:43:56 2023 +0000 |
tree | 032c984274c1163cf9c2e3206653692697cb12f0 | |
parent | 9e9d99dadc7fa1933b2dfbc66d34b72091674d60 [diff] |
ethernet: change MTU type to size_t Modify the type to get this working on 64-bit system. In phosphor-dbus-interfaces, the type is `size`: https://github.com/openbmc/phosphor-dbus-interfaces/blob/8a2674b/yaml/xyz/openbmc_project/Network/EthernetInterface.interface.yaml#L26 phoshor-networkd has this correct and no other places use. https://github.com/openbmc/phosphor-networkd/blob/6f256bc591bec72dd1448522d941874b21145a81/src/ethernet_interface.hpp#L146 Tested: ``` Before: curl localhost/redfish/v1/Managers/bmc/EthernetInterfaces/eth0 -s | grep MTU "MTUSize": 0, After: curl localhost/redfish/v1/Managers/bmc/EthernetInterfaces/eth0 -s | grep MTU "MTUSize": 1500, ``` Change-Id: If3506c6274d2083b61c5c27cc6d8e178495ccea0 Signed-off-by: Anthony <anthonyhkf@google.com> Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
diff --git a/redfish-core/lib/ethernet.hpp b/redfish-core/lib/ethernet.hpp index 80da49b..099aab8 100644 --- a/redfish-core/lib/ethernet.hpp +++ b/redfish-core/lib/ethernet.hpp
@@ -254,8 +254,8 @@ } else if (propertyPair.first == "MTU") { - const uint32_t* mtuSize = - std::get_if<uint32_t>(&propertyPair.second); + const size_t* mtuSize = + std::get_if<size_t>(&propertyPair.second); if (mtuSize != nullptr) { ethData.mtuSize = *mtuSize;