Fix Get Payload Data failing for type 0 and 5 files.

Issue: Get Payload Data for type 0 and type 5 is giving command response
error(0xce).

Fix: Added validation code to get response data.

Tested:
Before Fix:
Command: ipmitool raw 0x30 0xd6 1 5 0 0 0 0 0x44 0 0 0
Response:
Unable to send RAW command (channel=0x0 netfn=0x30 lun=0x0 cmd=0xd6
rsp=0xce): Command response could not be provided

After Fix:
Case-1: For Payload type 0
Command: Get Payload Info
ipmitool raw 0x30 0xd6 0x0 0x0
Response :
 00 00 00 47 36 04 00 62 c8 b8 62 00 01 3a 43 a9
 61
Command: Get Payload Data
ipmitool raw 0x30 0xd6 1 0 0 0 0 0 0x08 0 0 0
Response:
 00 08 00 00 00 06 bb c3 29 5d 00 00 00 01 22 54
 ac
Case-2: For Payload type 5
1. Create Payload 5
Command: Set Payload Start Info
ipmitool raw 0x30 0xd5 0 5 0 0 0x44 0 0 0 0xc 0xab 0xc2 0x53 0x0
Response: Success with Reservation ID
Command: Set Payload In Progress
ipmitool raw 0x30 0xd5 1 5 <ReservationID> 0 0 0 0 0x44 0 0 0 0xc 0xab
0xc2 0x53 0x50 0x58 0x4F 0x24 0x44 00 0x20 00 0x02 0x4E 0x81 00 0x03 00
0x03 0xF8 0x02 00 00 0x79 0x18 00 0x04 00 0x07 00 00 00 00 00 00 00
0x02 0x24 00 00 0xE8 0x7E 0xF8 0x83 0x06 00 00 00 00 00 00 00 00 00 00
00 00 0x7F 00 0x07 00 00 0x81 00 00 00 00 00 00 00 00 00
Response: Success
Command: Set Payload End Transfer
ipmitool raw 0x30 0xd5 2 5 <ReservationID>
Response: Success
2. Reboot BMC
3. Check for Payload 5 file in /var/oob folder
4. Check with Get Payload
Command: Get Payload Info
ipmitool raw 0x30 0xd6 0 5
Response:
 00 00 05 44 00 00 00 0c ab c2 53 00 01 fc 43 a9
 61
Command: Get Payload Data
ipmitool raw 0x30 0xd6 1 5 0 0 0 0 0x44 0 0 0
Response: Success with data

Signed-off-by: Snehalatha Venkatesh <snehalathax.v@intel.com>
Change-Id: I198fa005f1732f80d5eb94550ab6cabd0f3754be
diff --git a/src/biosconfigcommands.cpp b/src/biosconfigcommands.cpp
index c9e9c01..8792e9b 100644
--- a/src/biosconfigcommands.cpp
+++ b/src/biosconfigcommands.cpp
@@ -907,6 +907,8 @@
                     filestat.st_mtime;
                 gNVOOBdata.payloadInfo[payloadType].payloadTotalSize =
                     filestat.st_size;
+                gNVOOBdata.payloadInfo[payloadType].payloadStatus =
+                    static_cast<uint8_t>(ipmi::PStatus::Valid);
             }
             else
             {
@@ -1020,7 +1022,7 @@
                 std::string payloadFilePath =
                     "/var/oob/Payload" + std::to_string(payloadType);
 
-                if (length < static_cast<uint32_t>(maxGetPayloadDataSize))
+                if (length > static_cast<uint32_t>(maxGetPayloadDataSize))
                 {
                     phosphor::logging::log<phosphor::logging::level::ERR>(
                         "ipmiOEMGetPayload: length > maxGetPayloadDataSize",