ipmbbridged: Fix the issue with busy caused by incorrect requests
D-bus method:
sendRequest yyyyay <channel> <netf> <lun> <cmd> <dataLen> <data>
If dataLen is greater than ipmbMaxFrameLength (264), the request will
not be set to invalid and will continue to occupy outstandingRequests
until it is full, which will result in all subsequent requests being
busy.
busctl call xyz.openbmc_project.Ipmi.Channel.Ipmb \
/xyz/openbmc_project/Ipmi/Channel/Ipmb org.openbmc.Ipmb \
sendRequest yyyyay 0x00 0x30 0x00 0x06 0x00
(iyyyyay) 3 0 0 0 0 0
Error:
sendRequest (dataLen > 264) ipmbHandleRequest
|
requestAdd
|
(outstandingRequests save request) <-- makeRequestValid(request)
|
(dataLen > 264, return -1) <-- ipmbToi2cConstruct(buffer)
|
returnStatus(ipmbResponseStatus::error)
(Repeat sending until outstandingRequests is full)
------------------------------------------------------------------
sendRequest ipmbHandleRequest
|
requestAdd
|
seqNumGet \
(outstandingRequests is full, return false) <----
|
returnStatus(ipmbResponseStatus::busy)
All subsequent requests will be returned to busy and can only be
restored by restarting the service.
Change-Id: Idfda2af1a136dfcdc478e21d172de673f1efef03
Signed-off-by: Tian Jingzai <tianjingzai@phytium.com.cn>
diff --git a/ipmbbridged.cpp b/ipmbbridged.cpp
index 07e0740..a2bcf6b 100644
--- a/ipmbbridged.cpp
+++ b/ipmbbridged.cpp
@@ -721,6 +721,7 @@
std::vector<uint8_t> buffer{};
if (request->ipmbToi2cConstruct(buffer) != 0)
{
+ makeRequestInvalid(*request);
return returnStatus(ipmbResponseStatus::error);
}