Use payload interface to unpack group/IANA from message
Directly calling unpack from the Request interface will attempt to
unpack the whole message, resulting in a 0xC7 response if the whole
message was not unpacked. Since at this point in the execution, the
point is to only extract the group ID or the IANA, the lower-level
Payload unpack interface must be used. This allows for partial unpacks
and only returns error if there are not enough bytes to unpack.
Change-Id: Ie18377597e925eff89c9b7c1a6d2258627d5f240
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
diff --git a/ipmid-new.cpp b/ipmid-new.cpp
index 4986e49..b7c6205 100644
--- a/ipmid-new.cpp
+++ b/ipmid-new.cpp
@@ -286,7 +286,7 @@
{
// look up the group for this request
Group group;
- if (0 != request->unpack(group))
+ if (0 != request->payload.unpack(group))
{
return errorResponse(request, ccReqDataLenInvalid);
}
@@ -306,7 +306,7 @@
{
// look up the iana for this request
Iana iana;
- if (0 != request->unpack(iana))
+ if (0 != request->payload.unpack(iana))
{
return errorResponse(request, ccReqDataLenInvalid);
}