Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

openpower-pels: Check response header #76

Open
wants to merge 1 commit into
base: 1110
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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