diff options
author | Johnathan Mantey <johnathanx.mantey@intel.com> | 2019-12-11 13:47:43 -0800 |
---|---|---|
committer | Johnathan Mantey <johnathanx.mantey@intel.com> | 2019-12-12 08:10:21 -0800 |
commit | 4a15685ee852d0b0ee0981d3d1a2a9dd55130835 (patch) | |
tree | 0b4dbf2b276c31ca12025b5093bf2dc13fc4d098 | |
parent | 225dec858e52f0e8319acfe72d7b3630adcc7a0d (diff) | |
download | phosphor-host-ipmid-4a15685ee852d0b0ee0981d3d1a2a9dd55130835.tar.gz phosphor-host-ipmid-4a15685ee852d0b0ee0981d3d1a2a9dd55130835.zip |
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>
-rw-r--r-- | transporthandler.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/transporthandler.cpp b/transporthandler.cpp index 1a06ae5..c8dccb3 100644 --- a/transporthandler.cpp +++ b/transporthandler.cpp @@ -1334,6 +1334,10 @@ RspType<> setLan(uint4_t channelBits, uint4_t, uint8_t parameter, { return responseReqDataLenInvalid(); } + if (rsvd) + { + return responseInvalidFieldRequest(); + } auto status = static_cast<SetStatus>(static_cast<uint8_t>(flag)); switch (status) { @@ -1391,6 +1395,10 @@ RspType<> setLan(uint4_t channelBits, uint4_t, uint8_t parameter, { return responseReqDataLenInvalid(); } + if (rsvd) + { + return responseInvalidFieldRequest(); + } switch (static_cast<IPSrc>(static_cast<uint8_t>(flag))) { case IPSrc::DHCP: @@ -1516,6 +1524,10 @@ RspType<> setLan(uint4_t channelBits, uint4_t, uint8_t parameter, { return responseReqDataLenInvalid(); } + if (rsvd) + { + return responseInvalidFieldRequest(); + } copyInto(ip, ipbytes); if (enabled) { |