Redfish(Ethernet): Don't init the vlanID and vlanEnable
These variables are of type std::optional,The values should be
filled by the readJSON function,as further decision to handle the
patch for the vlan is dependent on whether the value for vlanID and vlanEnable
is not null.
Due to this issue, control goes to handle the vlan patch and the
readJSON inside the handleVlanPatch doesn't find the values for
vlanID and vlanEnable so set the resp result to forbidden.
After that if any other readJSON would be called it would return failure
and due to that no other PATCH operation on the ipv4Address can be
completed.
Change-Id: I3ebab18ae4adfa7c871ecab862a2865dc14f154d
Signed-off-by: Ratan Gupta <ratagupt@linux.vnet.ibm.com>
diff --git a/redfish-core/lib/ethernet.hpp b/redfish-core/lib/ethernet.hpp
index 70e5536..0bfe9db 100644
--- a/redfish-core/lib/ethernet.hpp
+++ b/redfish-core/lib/ethernet.hpp
@@ -1228,8 +1228,10 @@
{
return;
}
- std::optional<uint64_t> vlanId = 0;
- std::optional<bool> vlanEnable = false;
+
+ std::optional<uint64_t> vlanId;
+ std::optional<bool> vlanEnable;
+
if (vlan)
{
if (!json_util::readJson(*vlan, res, "VLANEnable", vlanEnable,