Return invalid data length (0xc7) for commands not properly unpacked

The correct value for commands that unpacked but did not consume all
the data was already returned (0xc7), but if all the expected data
was not present, the return code was the response of the unpack
command, which is not an IPMI value. This changes the unpack response
to always return 0xc7 if it is too short or too long for the command.

Tested-by: run ipmitool with correct and incorrect byte counts
           (get channel access command expects 2 bytes of data)
           # ipmitool raw 6 0x41
            Unable to send RAW command (channel=0x0 netfn=0x6
              lun=0x0 cmd=0x41 rsp=0xc7): Request data length invalid
           # ipmitool raw 6 0x41 1
            Unable to send RAW command (channel=0x0 netfn=0x6
              lun=0x0 cmd=0x41 rsp=0xc7): Request data length invalid
           # ipmitool raw 6 0x41 1 0x80
            40 40
           # ipmitool raw 6 0x41 1 0x80 1
            Unable to send RAW command (channel=0x0 netfn=0x6
              lun=0x0 cmd=0x41 rsp=0xc7): Request data length invalid

Change-Id: Ic72c1f2050f7bdcdcc8a5b808d11f80fac4e9813
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
1 file changed