Redfish : Fix setting the Hypervisor interface prefixlength
The static IPv4 configuration on the Hypervisor interface was
failing. The user setting value for the prefixlength was not
getting set to the DBus property.
This commit fixes the async DBus interface call to set the user
setting value of the prefixlength property at the DBus interface
xyz.openbmc_project.Network.IP
Tested by :
PATCH -D patch.txt -d '{ "IPv4StaticAddresses": [{"Address": <>,"SubnetMask": <>,"Gateway":<>}]}'
https://${bmc}/redfish/v1/Systems/hypervisor/EthernetInterfaces/eth0
Verify the DBus property gets set by the values patched.
Signed-off-by: Sunitha Harish <sunharis@in.ibm.com>
Change-Id: Ife6283ba491ec421a95803b841d8c73a35aea9f2
diff --git a/redfish-core/lib/hypervisor_ethernet.hpp b/redfish-core/lib/hypervisor_ethernet.hpp
index 3266069..192b3bd 100644
--- a/redfish-core/lib/hypervisor_ethernet.hpp
+++ b/redfish-core/lib/hypervisor_ethernet.hpp
@@ -382,10 +382,9 @@
BMCWEB_LOG_DEBUG << "SubnetMask is Set";
},
"xyz.openbmc_project.Settings",
- "/xyz/openbmc_project/network/hypervisor/" + ethIfaceId +
- "/ipv4/addr0"
- "org.freedesktop.DBus.Properties",
- "Set", "xyz.openbmc_project.Network.IP", "PrefixLength",
+ "/xyz/openbmc_project/network/hypervisor/" + ethIfaceId + "/ipv4/addr0",
+ "org.freedesktop.DBus.Properties", "Set",
+ "xyz.openbmc_project.Network.IP", "PrefixLength",
std::variant<uint8_t>(subnet));
}