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>
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 @@
         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 @@
         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)
         {