summaryrefslogtreecommitdiffstats
path: root/include/ipmid
diff options
context:
space:
mode:
authorWilliam A. Kennington III <wak@google.com>2019-04-25 02:10:55 -0700
committerWilliam A. Kennington III <wak@google.com>2019-04-29 12:08:20 -0700
commit5d06cc6dfee3aa0c42bb181dd7e050f4f8f8dd1e (patch)
tree00faff197e5c16cb14d25a37af68daaa108316e9 /include/ipmid
parentda31f9a684f74dae03d1b881e2173c51689b283d (diff)
downloadphosphor-host-ipmid-5d06cc6dfee3aa0c42bb181dd7e050f4f8f8dd1e.tar.gz
phosphor-host-ipmid-5d06cc6dfee3aa0c42bb181dd7e050f4f8f8dd1e.zip
handler: Fix request passing for legacy commands
Legacy OEM commands didn't handle the IANA numbers themselves as part of their handler body, and expect the request buffer to not contain them. We can't pass the raw buffer without removing the already extracted prefixes. This should make legacy OEM commands work again. Also reworks group handling to become consistent with OEM handling. This happens to fix cases where groupIds were not being returned with error codes. Change-Id: I10efe8004f2c2b262f48980852b46317035ca367 Signed-off-by: William A. Kennington III <wak@google.com>
Diffstat (limited to 'include/ipmid')
-rw-r--r--include/ipmid/handler.hpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/include/ipmid/handler.hpp b/include/ipmid/handler.hpp
index c84bffd..53b0bb8 100644
--- a/include/ipmid/handler.hpp
+++ b/include/ipmid/handler.hpp
@@ -310,17 +310,18 @@ class IpmiHandler<ipmid_callback_t> final : public HandlerBase
executeCallback(message::Request::ptr request) override
{
message::Response::ptr response = request->makeResponse();
- size_t len = request->payload.size();
// allocate a big response buffer here
response->payload.resize(
getChannelMaxTransferSize(request->ctx->channel));
+ size_t len = request->payload.size() - request->payload.rawIndex;
Cc ccRet{ccSuccess};
try
{
- ccRet = handler_(request->ctx->netFn, request->ctx->cmd,
- request->payload.data(), response->payload.data(),
- &len, handlerCtx);
+ ccRet =
+ handler_(request->ctx->netFn, request->ctx->cmd,
+ request->payload.data() + request->payload.rawIndex,
+ response->payload.data(), &len, handlerCtx);
}
catch (const std::exception& e)
{
@@ -399,16 +400,18 @@ class IpmiHandler<oem::Handler> final : public HandlerBase
executeCallback(message::Request::ptr request) override
{
message::Response::ptr response = request->makeResponse();
- size_t len = request->payload.size();
// allocate a big response buffer here
response->payload.resize(
getChannelMaxTransferSize(request->ctx->channel));
+ size_t len = request->payload.size() - request->payload.rawIndex;
Cc ccRet{ccSuccess};
try
{
- ccRet = handler_(request->ctx->cmd, request->payload.data(),
- response->payload.data(), &len);
+ ccRet =
+ handler_(request->ctx->cmd,
+ request->payload.data() + request->payload.rawIndex,
+ response->payload.data(), &len);
}
catch (const std::exception& e)
{
OpenPOWER on IntegriCloud