Emit correct error code when "reserved" fields are modified.
The Set LAN Configuration IP Source command has reserved bits. Check
to make sure none of the bits are set. Return a 0xcc code when any of
them are.
Tested:
for val in $(seq 64 16 240)
do
ipmitool raw 0xc 1 3 4 $val
done
Each iteration returned a 0xcc code.
Used the "raw" style, as the "lan set" commands will not use the
invalid values.
Change-Id: I77f007453a3bede7424b0ccad9c5cb9bad9e8fe0
Signed-off-by: Johnathan Mantey <johnathanx.mantey@intel.com>
diff --git a/transporthandler.cpp b/transporthandler.cpp
index 1a06ae5..c8dccb3 100644
--- a/transporthandler.cpp
+++ b/transporthandler.cpp
@@ -1334,6 +1334,10 @@
{
return responseReqDataLenInvalid();
}
+ if (rsvd)
+ {
+ return responseInvalidFieldRequest();
+ }
auto status = static_cast<SetStatus>(static_cast<uint8_t>(flag));
switch (status)
{
@@ -1391,6 +1395,10 @@
{
return responseReqDataLenInvalid();
}
+ if (rsvd)
+ {
+ return responseInvalidFieldRequest();
+ }
switch (static_cast<IPSrc>(static_cast<uint8_t>(flag)))
{
case IPSrc::DHCP:
@@ -1516,6 +1524,10 @@
{
return responseReqDataLenInvalid();
}
+ if (rsvd)
+ {
+ return responseInvalidFieldRequest();
+ }
copyInto(ip, ipbytes);
if (enabled)
{