pldmd: do not exit on recv fail with af-mctp transport Under the Linux kernel AF_MCTP transport, transient receive failures (e.g., PLDM_REQUESTER_RECV_FAIL returned when a downstream endpoint is resetting, disconnected, or sending unmapped packets) do not indicate that the underlying transport socket has been closed by a daemon. Exiting the event loop on PLDM_REQUESTER_RECV_FAIL was originally introduced for mctp-demux UNIX domain sockets, where recv failure indicated the demux daemon process had terminated. In the AF_MCTP architecture, this causes pldmd to terminate and restart unnecessarily whenever a downstream device resets. Restrict the socket-close exit logic to PLDM_TRANSPORT_WITH_MCTP_DEMUX so that AF_MCTP logs a warning and continues event processing. Tested: Verified error handling for AF_MCTP transport. Google-Bug-Id: 543041824 Change-Id: I5c1b0c0b57dd6e27d173bdceaf0cd80010b0afee Signed-off-by: Guangzong Chen <guangzong@google.com> TAG=agy CONV=f6e4e885-dc2d-47ba-99c7-be407d766de9
diff --git a/pldmd/pldmd.cpp b/pldmd/pldmd.cpp index a32f6dc..25a976e 100644 --- a/pldmd/pldmd.cpp +++ b/pldmd/pldmd.cpp
@@ -434,6 +434,7 @@ // TODO check that we get here if mctp-demux dies? else if (returnCode == PLDM_REQUESTER_RECV_FAIL) { +#if defined(PLDM_TRANSPORT_WITH_MCTP_DEMUX) // MCTP daemon has closed the socket this daemon is connected to. // This may or may not be an error scenario, in either case the // recovery mechanism for this daemon is to restart, and hence exit @@ -443,6 +444,10 @@ "MCTP daemon closed the socket, IO exiting with response code '{RC}'", "RC", returnCode); io.get_event().exit(0); +#else + warning("Failed to receive PLDM message, response code '{RC}'", + "RC", returnCode); +#endif } else {