From bfe55a1f7ca6388662cf9613d08ebb5266cd82f8 Mon Sep 17 00:00:00 2001 From: Vernon Mauery Date: Fri, 8 Mar 2019 13:48:40 -0800 Subject: 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 --- include/ipmid/handler.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 @@ static inline message::Response::ptr 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; } -- cgit v1.2.1