Skip to content

Commit

Permalink
openpower-pels: Check response header
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Eddie James committed Oct 17, 2024
1 parent 1af06bb commit 7e395af
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions extensions/openpower-pels/pldm_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ void PLDMInterface::receive(IO& /*io*/, int /*fd*/, uint32_t revents,
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.
Expand All @@ -298,6 +299,11 @@ void PLDMInterface::receive(IO& /*io*/, int /*fd*/, uint32_t revents,

responseMsg = nullptr;
}
if (hdr && (hdr->request || hdr->datagram))
{
free(responseMsg);
return;
}

cleanupCmd();

Expand Down

0 comments on commit 7e395af

Please sign in to comment.