Commits
Suman Anna committed 2c3f89c4da3
net/rpmsg: return ENOLINK upon Rx on errored sockets The rpmsg_proto driver is used to provide a socket interface to userspace under the AF_RPMSG address family, and is used by the TI IPC MessageQ stack. The rpmsg proto driver creates a rpmsg endpoint per remote processor (a Rx socket) for each MessageQ object through the socket's bind() call. These rpmsg endpoints are associated with a published parent rpmsg device from that remote processor. These endpoints are cleaned up normally either when the userspace program / application closes them or through the automatic cleanup of the file descriptors when a process is terminated/closed. These endpoints can also be cleaned up by the rpmsg_proto driver as part of the error recovery of a remote processor, during the removal of their parent rpmsg device, with the corresponding Rx sockets simply marked with the error status RPMSG_ERROR. This error status is not currently being returned to the userspace in the socket's recvfrom() interface. Fix this by specifically checking for this error status, and returning an error value of ENOLINK back to userspace. The ENOLINK error code is used to allow the userspace to differentiate this terminal error from other errors on the Rx sockets and take appropriate action. This error code on Rx sockets serves the same as the error code ESHUTDOWN used for Tx sockets, and is chosen specifically to have a meaningful strerror message appropriate to Rx sockets. Signed-off-by: Suman Anna <s-anna@ti.com>