raiden00pl opened a new pull request, #21996:
URL: https://github.com/apache/nuttx/pull/21996
## Summary
A peer RST marked the socket as gracefully closed, so recv() returned 0
(end of file) and SO_ERROR gave ECONNREFUSED.
- The loss of an established connection records the pending error:
ECONNRESET (peer RST), ETIMEDOUT or ENETDOWN.
- The next send(), recv() or getsockopt(SO_ERROR) reports it once and
clears
it; after that send() fails with EPIPE and recv() with ENOTCONN.
- A refused nonblocking connect keeps ECONNREFUSED.
- A zero window probe timeout is reported as a timeout, not as a reset.
- s_error no longer depends on CONFIG_NET_SOCKOPTS.
POSIX XSH 2.10.10: "The error is returned in response to a subsequent
send(), recv(), or getsockopt() operation on the socket, and the pending
error is then cleared." recv(): "[ECONNRESET] A connection was forcibly
closed by a peer."
## Impact
recv() after a reset by the peer fails with ECONNRESET instead of returning
end of file. Each socket has a 2-byte pending error also without
CONFIG_NET_SOCKOPTS.
## Testing
qemu-armv8a: a TLS client and server whose peer resets the connection get
ECONNRESET. TCP keepalive dead peer (ETIMEDOUT), reset in the middle of a
transfer, half close, backlog, nonblocking connect and TLS interop tests
unchanged. sim: builds with and without CONFIG_NET_SOCKOPTS
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]