errorResponse must not pack completion code in data payload
Until the response goes back out onto D-Bus, the completion code is held
in a separate part of the Response object. The D-Bus response has a
separate field for the completion code as well, reserving a byte array
for response data only.
This fixes the ipmitool error message 'Bad response length, len=1' when
it attempts to query the PICMG capabilities.
Change-Id: Iff0c3cb2e46a20e52229265eebb0995878a41714
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
diff --git a/include/ipmid/handler.hpp b/include/ipmid/handler.hpp
index 0c65436..1643e58 100644
--- a/include/ipmid/handler.hpp
+++ b/include/ipmid/handler.hpp
@@ -42,15 +42,15 @@
errorResponse(message::Request::ptr request, ipmi::Cc cc, Args&&... args)
{
message::Response::ptr response = request->makeResponse();
- auto payload = std::make_tuple(cc, args...);
- response->pack(payload);
+ response->cc = cc;
+ response->pack(args...);
return response;
}
static inline message::Response::ptr
errorResponse(message::Request::ptr request, ipmi::Cc cc)
{
message::Response::ptr response = request->makeResponse();
- response->pack(cc);
+ response->cc = cc;
return response;
}