openpower-pels: Check response header
Using the new PLDM API requires checking the response header for the
request and datagram flags, as those indicate that the message isn't
really a response.
Change-Id: I38f8e77bd5defaf611695649bb75d589b2548f17
Signed-off-by: Eddie James <eajames@linux.ibm.com>
diff --git a/extensions/openpower-pels/pldm_interface.cpp b/extensions/openpower-pels/pldm_interface.cpp
index 392bd00..c8f59e2 100644
--- a/extensions/openpower-pels/pldm_interface.cpp
+++ b/extensions/openpower-pels/pldm_interface.cpp
@@ -275,6 +275,7 @@
pldm_tid_t pldmTID;
auto rc = pldm_transport_recv_msg(transport, &pldmTID, &responseMsg,
&responseSize);
+ struct pldm_msg_hdr* hdr = (struct pldm_msg_hdr*)responseMsg;
if (pldmTID != _eid)
{
// We got a response to someone else's message. Ignore it.
@@ -298,6 +299,11 @@
responseMsg = nullptr;
}
+ if (hdr && (hdr->request || hdr->datagram))
+ {
+ free(responseMsg);
+ return;
+ }
cleanupCmd();